@snabcentr/vue-ui-lib 3.5.21 → 3.5.23
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,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],M):(D=typeof globalThis<"u"?globalThis:D||self,M(D.SC_VueUiLib={},D["lodash-es"],D.Vue,D["naive-ui"],D["@snabcentr/common-lib"],D["date-fns"],D["libphonenumber-js"],D["ts-case-convert"],D["vue-tel-input"]))})(this,(function(D,M,i,z,Q,Dn,rr,Is,Hu){"use strict";var lC=Object.defineProperty;var Ou=D=>{throw TypeError(D)};var cC=(D,M,i)=>M in D?lC(D,M,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[M]=i;var k=(D,M,i)=>cC(D,typeof M!="symbol"?M+"":M,i),zu=(D,M,i)=>M.has(D)||Ou("Cannot "+i);var Rt=(D,M,i)=>(zu(D,M,"read from private field"),i?i.call(D):M.get(D)),La=(D,M,i)=>M.has(D)?Ou("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(D):M.set(D,i),Lu=(D,M,i,z)=>(zu(D,M,"write to private field"),z?z.call(D,i):M.set(D,i),i);var Ci,lt,Fs;var Ge=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Ge||{}),Ye=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ye||{});class ri{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ri.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ri.isVnodeEmpty(e()):!1}}const _t=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Ha=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},Gt=t=>t?Number.parseFloat(t.replace(",",".")):null,Ke=(t,e)=>{t[e]={}};class Ft{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=M.isString(r.key)?M.get(d,r.key):r.key(c),f=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(f)?"- Не определено -":f,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Wu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ju(t,e){return i.openBlock(),i.createElementBlock("svg",Wu,[...e[0]||(e[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 Wa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:ju}),qu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xu(t,e){return i.openBlock(),i.createElementBlock("svg",qu,[...e[0]||(e[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 ja=i.markRaw({name:"tabler-edit",render:Xu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const qa=i.markRaw({name:"ion-checkmark-done-circle",render:Uu}),Ku={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gu(t,e){return i.openBlock(),i.createElementBlock("svg",Ku,[...e[0]||(e[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:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Xa=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Gu}),Zu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Qu(t,e){return i.openBlock(),i.createElementBlock("svg",Zu,[...e[0]||(e[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 Ju=i.markRaw({name:"fluent-pin32-regular",render:Qu}),ef={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tf(t,e){return i.openBlock(),i.createElementBlock("svg",ef,[...e[0]||(e[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 nf=i.markRaw({name:"ion-eye-outline",render:tf}),rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...e[0]||(e[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 of=i.markRaw({name:"fluent-pin32-filled",render:sf}),af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[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 cf=i.markRaw({name:"ion-bookmark-outline",render:lf}),df={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hf(t,e){return i.openBlock(),i.createElementBlock("svg",df,[...e[0]||(e[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 uf=i.markRaw({name:"ion-eye-off-sharp",render:hf}),ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[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 mf=i.markRaw({name:"ion-chevron-forward-outline",render:gf}),pf=["data-name"],yf={class:"sc-collapse-item-header flex flex-row gap-2.5"},bf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},_f={key:0},wf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},xf={class:"flex flex-1 flex-col"},vf={key:0,class:"sc-collapse-item-sub-title flex-1"},kf={key:1,class:"sc-collapse-item-title-extra flex-none"},Cf={key:0,class:"sc-collapse-item-content"},Sf={},Bf=i.defineComponent({...Sf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,b)=>{const y=mf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",yf,[i.createElementVNode("div",bf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ri).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",_f,[i.createElementVNode("div",wf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",xf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ri).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",vf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ri).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",kf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",Cf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pf)}}}),si=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Ya=si(Bf,[["__scopeId","data-v-415a3dda"]]),Tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Rf(t,e){return i.openBlock(),i.createElementBlock("svg",Tf,[...e[0]||(e[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 Ua=i.markRaw({name:"ion-cart-outline",render:Rf}),Ar=Symbol(),Pf={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"}},$f={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ef={},Ka=i.defineComponent({...Ef,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(Ar,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=f=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:f})};return(f,g)=>{var S;const m=Xa,u=qa,p=z.NButton,b=z.NTooltip,y=ja,_=Ua,v=Wa,B=z.NDropdown;return i.openBlock(),i.createElementBlock("div",$f,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(u,{key:1})):(i.openBlock(),i.createBlock(m,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[g[0]||(g[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[g[1]||(g[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[g[2]||(g[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((S=a.value)==null?void 0:S.length)>0?(i.openBlock(),i.createBlock(B,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Nf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ff(t,e){return i.openBlock(),i.createElementBlock("svg",Nf,[...e[0]||(e[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 Af=i.markRaw({name:"tabler-history",render:Ff}),Mf={class:"flex flex-row gap-1"},Vf={key:0,class:"flex flex-row text-nowrap text-sm line-through"},If={key:1,class:"flex flex-row text-nowrap text-sm"},Of={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},zf={},Mr=i.defineComponent({...zf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},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(t){const e=t,n=i.computed(()=>M.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:M.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Dn.format(e.product.costDate,Q.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!M.isNil(r.value)),l=i.computed(()=>M.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>M.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,f)=>{var p;const g=z.NTag,m=z.NTooltip,u=Af;return i.openBlock(),i.createElementBlock("div",Mf,[t.showTag?(i.openBlock(),i.createBlock(m,{key:0},{trigger:i.withCtx(()=>[i.createVNode(g,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var b;return[i.createTextVNode(i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var b;return[i.createTextVNode(" "+i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Vf,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:f[0]||(f[0]=()=>{var b;a.value&&((b=t.eventEmitter)==null||b.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",If," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Of,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(m,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"cursor-pointer",onClick:f[1]||(f[1]=b=>{var y;return(y=t.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Lf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Df(t,e){return i.openBlock(),i.createElementBlock("svg",Lf,[...e[0]||(e[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 Os=i.markRaw({name:"ion-information-circle-outline",render:Df}),Hf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...e[0]||(e[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 Ga=i.markRaw({name:"ion-images",render:Wf}),jf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qf(t,e){return i.openBlock(),i.createElementBlock("svg",jf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const Xf=i.markRaw({name:"ion-bookmark",render:qf});/*!
|
|
1
|
+
(function(D,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],M):(D=typeof globalThis<"u"?globalThis:D||self,M(D.SC_VueUiLib={},D["lodash-es"],D.Vue,D["naive-ui"],D["@snabcentr/common-lib"],D["date-fns"],D["libphonenumber-js"],D["ts-case-convert"],D["vue-tel-input"]))})(this,(function(D,M,i,z,Q,Dn,rr,Is,Hu){"use strict";var lC=Object.defineProperty;var Ou=D=>{throw TypeError(D)};var cC=(D,M,i)=>M in D?lC(D,M,{enumerable:!0,configurable:!0,writable:!0,value:i}):D[M]=i;var k=(D,M,i)=>cC(D,typeof M!="symbol"?M+"":M,i),zu=(D,M,i)=>M.has(D)||Ou("Cannot "+i);var Rt=(D,M,i)=>(zu(D,M,"read from private field"),i?i.call(D):M.get(D)),La=(D,M,i)=>M.has(D)?Ou("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(D):M.set(D,i),Lu=(D,M,i,z)=>(zu(D,M,"write to private field"),z?z.call(D,i):M.set(D,i),i);var Ci,lt,Fs;var Ge=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Ge||{}),Ye=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ye||{});class ri{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ri.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ri.isVnodeEmpty(e()):!1}}const _t=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Ha=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},Gt=t=>t?Number.parseFloat(t.replace(",",".")):null,Ke=(t,e)=>{t[e]={}};class Ft{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=M.isString(r.key)?M.get(d,r.key):r.key(c),f=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(f)?"- Не определено -":f,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Wu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ju(t,e){return i.openBlock(),i.createElementBlock("svg",Wu,[...e[0]||(e[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 Wa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:ju}),qu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xu(t,e){return i.openBlock(),i.createElementBlock("svg",qu,[...e[0]||(e[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 ja=i.markRaw({name:"tabler-edit",render:Xu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const qa=i.markRaw({name:"ion-checkmark-done-circle",render:Uu}),Ku={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gu(t,e){return i.openBlock(),i.createElementBlock("svg",Ku,[...e[0]||(e[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:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Xa=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Gu}),Zu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Qu(t,e){return i.openBlock(),i.createElementBlock("svg",Zu,[...e[0]||(e[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 Ju=i.markRaw({name:"fluent-pin32-regular",render:Qu}),ef={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tf(t,e){return i.openBlock(),i.createElementBlock("svg",ef,[...e[0]||(e[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 nf=i.markRaw({name:"ion-eye-outline",render:tf}),rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...e[0]||(e[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 of=i.markRaw({name:"fluent-pin32-filled",render:sf}),af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[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 cf=i.markRaw({name:"ion-bookmark-outline",render:lf}),df={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hf(t,e){return i.openBlock(),i.createElementBlock("svg",df,[...e[0]||(e[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 uf=i.markRaw({name:"ion-eye-off-sharp",render:hf}),ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[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 mf=i.markRaw({name:"ion-chevron-forward-outline",render:gf}),pf=["data-name"],yf={class:"sc-collapse-item-header flex flex-row gap-2.5"},bf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},_f={key:0},wf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},xf={class:"flex flex-1 flex-col"},vf={key:0,class:"sc-collapse-item-sub-title flex-1"},kf={key:1,class:"sc-collapse-item-title-extra flex-none"},Cf={key:0,class:"sc-collapse-item-content"},Sf={},Bf=i.defineComponent({...Sf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,b)=>{const y=mf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",yf,[i.createElementVNode("div",bf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ri).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",_f,[i.createElementVNode("div",wf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",xf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ri).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",vf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ri).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",kf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",Cf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pf)}}}),si=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Ya=si(Bf,[["__scopeId","data-v-415a3dda"]]),Tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Rf(t,e){return i.openBlock(),i.createElementBlock("svg",Tf,[...e[0]||(e[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 Ua=i.markRaw({name:"ion-cart-outline",render:Rf}),Ar=Symbol(),Pf={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"}},$f={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ef={},Ka=i.defineComponent({...Ef,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(Ar,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=f=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:f})};return(f,g)=>{var B;const m=Xa,u=qa,p=z.NButton,b=z.NTooltip,y=ja,_=Ua,w=Wa,S=z.NDropdown;return i.openBlock(),i.createElementBlock("div",$f,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(u,{key:1})):(i.openBlock(),i.createBlock(m,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[g[0]||(g[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[g[1]||(g[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[g[2]||(g[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((B=a.value)==null?void 0:B.length)>0?(i.openBlock(),i.createBlock(S,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(w)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Nf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ff(t,e){return i.openBlock(),i.createElementBlock("svg",Nf,[...e[0]||(e[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 Af=i.markRaw({name:"tabler-history",render:Ff}),Mf={class:"flex flex-row gap-1"},Vf={key:0,class:"flex flex-row text-nowrap text-sm line-through"},If={key:1,class:"flex flex-row text-nowrap text-sm"},Of={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},zf={},Mr=i.defineComponent({...zf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},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(t){var g;const e=t,n=i.computed(()=>M.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=((g=Q.AppConfigProvider.getConfig())==null?void 0:g.defaultCurrency)??"RUB",s=i.computed(()=>n.value?n.value.cost:M.get(e.product,e.costFieldName)),o=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),a=i.computed(()=>e.product.costDate?Dn.format(e.product.costDate,Q.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),l=i.computed(()=>e.currencyRates||e.product.currencySignature===r?e.currencyRates:{[e.product.currencySignature]:e.product.costRub/e.product.cost}),c=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!M.isNil(s.value)),d=i.computed(()=>M.isNil(s.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(s.value))),h=i.computed(()=>{if(e.product.currencySignature===r||!l.value||!l.value[e.product.currencySignature])return null;const m=l.value[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(s.value)*m)}),f=i.computed(()=>M.isNil(o.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(o.value));return(m,u)=>{var _;const p=z.NTag,b=z.NTooltip,y=Af;return i.openBlock(),i.createElementBlock("div",Mf,[t.showTag?(i.openBlock(),i.createBlock(b,{key:0},{trigger:i.withCtx(()=>[i.createVNode(p,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var w;return[i.createTextVNode(i.toDisplayString(((w=n.value)==null?void 0:w.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var w;return[i.createTextVNode(" "+i.toDisplayString(((w=n.value)==null?void 0:w.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[o.value&&o.value!==s.value?(i.openBlock(),i.createElementBlock("span",Vf,i.toDisplayString(f.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(_=n.value)==null?void 0:_.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":c.value&&t.eventEmitter}),onClick:u[0]||(u[0]=()=>{var w;c.value&&((w=t.eventEmitter)==null||w.emit("cost:click",{product:t.product,cost:s.value}))})},i.toDisplayString(d.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),h.value?(i.openBlock(),i.createElementBlock("span",If," ~ "+i.toDisplayString(h.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(a.value)?(i.openBlock(),i.createElementBlock("span",Of,[i.createTextVNode(i.toDisplayString(a.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(b,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(y,{class:"cursor-pointer",onClick:u[1]||(u[1]=w=>{var S;return(S=t.eventEmitter)==null?void 0:S.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Lf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Df(t,e){return i.openBlock(),i.createElementBlock("svg",Lf,[...e[0]||(e[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 Os=i.markRaw({name:"ion-information-circle-outline",render:Df}),Hf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...e[0]||(e[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 Ga=i.markRaw({name:"ion-images",render:Wf}),jf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qf(t,e){return i.openBlock(),i.createElementBlock("svg",jf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const Xf=i.markRaw({name:"ion-bookmark",render:qf});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -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 Ir=function(){return Ir=Object.assign||function(e){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)&&(e[o]=n[o])}return e},Ir.apply(this,arguments)},Kf={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"}},Bn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},zs=500,Gf=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Ir(Ir({},Kf),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=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&&(e+='<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(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(Bn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,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();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):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}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||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;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=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 g=this.getPossibleSwipeDragCords(n),m,u,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),m=p/y,u=b/y}else{var y=(e-n)*n;m=p*y,u=b*y}r&&(f?this.isBeyondPossibleLeft(m,g.minX)?m=g.minX:this.isBeyondPossibleRight(m,g.maxX)&&(m=g.maxX):e>1&&(m<g.minX?m=g.minX:m>g.maxX&&(m=g.maxX)),h?this.isBeyondPossibleTop(u,g.minY)?u=g.minY:this.isBeyondPossibleBottom(u,g.maxY)&&(u=g.maxY):e>1&&(u<g.minY?u=g.minY:u>g.maxY&&(u=g.maxY))),this.setZoomStyles({x:m,y:u,scale:e}),this.left=m,this.top=u,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).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)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},zs),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.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")}},zs+50)},t.prototype.setZoomStyles=function(e){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=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),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},zs+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.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},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(Bn.containerResize+".zoom "+Bn.rotateRight+".zoom "+Bn.rotateLeft+".zoom "+Bn.flipHorizontal+".zoom "+Bn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(Bn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(Bn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(Bn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e: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()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=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=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var f=e.scale-o;e.zoomImage(e.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.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(),f={};f.x=this.left+a,f.y=this.top+l;var g=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,g.minY)?f.y=g.minY:this.isBeyondPossibleBottom(f.y,g.maxY)&&(f.y=g.maxY)),r&&(this.isBeyondPossibleLeft(f.x,g.minX)?f.x=g.minX:this.isBeyondPossibleRight(f.x,g.maxX)&&(f.x=g.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.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-e.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},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){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;e&&(o=o+e*o,a=a+e*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,f={minY:l,maxY:c,minX:d,maxX:h};return f},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(g){if(e.isImageSlide(e.core.index)&&(f=e.core.getSlideItem(e.core.index),(e.$LG(g.target).hasClass("lg-item")||f.get().contains(g.target))&&g.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){g.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);a=m.allowY,o=m.allowX,(o||a)&&(n=e.getSwipeCords(g)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(g){if(g.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(g.target).hasClass("lg-item")||f.get().contains(g.target))){g.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(g);var m=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(h,m))}}),this.core.$inner.on("touchend.lg",function(g){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(g.target).hasClass("lg-item")||f.get().contains(g.target))){if(g.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var m=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,m)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(g){if(e.isImageSlide(e.core.index)){var m=e.core.getSlideItem(e.core.index);if(e.$LG(g.target).hasClass("lg-item")||m.get().contains(g.target)){c=new Date,f=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var u=e.getDragAllowedAxises(0);l=u.allowY,a=u.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(g.target).hasClass("lg-object")&&(a||l)&&(g.preventDefault(),n=e.getDragCords(g),h=e.getPossibleSwipeDragCords(),s=!0,e.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(g){if(s){o=!0,r=e.getDragCords(g);var m=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(f,m)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(g){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(g);var m=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,m)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.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},t})();const Zf={ref:"gallery-container",class:"lightgallery-wrapper"},Qf={},Za=i.defineComponent({...Qf,__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(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.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,{...e.settings}),M.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",Zf,[i.renderSlot(o.$slots,"default")],512))}}),ot=class ot{static init(){ot.isInitialized||(ot.isInitialized=!0,ot.windowResizeHandler(),window.addEventListener("resize",ot.windowResizeHandler))}static destroy(){window.removeEventListener("resize",ot.windowResizeHandler),ot.isInitialized=!1}static getDeviceTypeByResolution(){const e=Q.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ye.phone:window.innerWidth<e.laptop?Ye.tablet:Ye.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return ot.setRefValueDependingOnDeviceResolution(s,e,n,r),ot.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return ot.getDeviceTypeByResolution()===Ye.phone}static isTabletDevice(){return ot.getDeviceTypeByResolution()===Ye.tablet}static isLaptopDevice(){return ot.getDeviceTypeByResolution()===Ye.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(ot.getDeviceTypeByResolution()){case Ye.phone:e.value=n;break;case Ye.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){M.forEach(ot.refsDependingOnDeviceResolution,e=>{ot.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};k(ot,"isInitialized",!1),k(ot,"refsDependingOnDeviceResolution",[]);let wt=ot;const Jf=["href"],eg=["src","alt"],tg={},Qa=i.defineComponent({...tg,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Uf,Gf],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===Ye.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=Ga,g=z.NPopover;return i.openBlock(),i.createBlock(g,{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]=m=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(Za,{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(t.images,(m,u)=>(i.openBlock(),i.createElementBlock("a",{key:u,href:m.image},[i.createElementVNode("img",{src:m.preview,alt:`Изображение #${u+1}`},null,8,eg)],8,Jf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),ng={class:"flex flex-col text-sm"},ig={},rg=i.defineComponent({...ig,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Os,s=z.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",ng,[(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})}}}),sg={class:"flex flex-row justify-between"},og={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},ag={key:0},lg={class:"ml-2 align-sub"},cg={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},dg={class:"@container"},hg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ug={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},fg={class:"text-sc-dark-grey"},gg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},mg={class:"text-gray-600"},pg={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},yg={key:3,class:"underline decoration-dashed"},bg={key:4,class:"sc-product-pack whitespace-nowrap"},_g={class:"text-gray-600"},wg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},xg={class:"text-gray-600"},vg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},kg={key:0},Cg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Sg={},or=i.defineComponent({...Sg,__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},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>M.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 e({showProductImagesPreview:l}),(h,f)=>{var B,S,R,C,T;const g=Xf,m=z.NTooltip,u=Ua,p=Ga,b=z.NText,y=Ka,_=Os,v=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",sg,[i.createVNode(b,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var x,P;return[i.createElementVNode("div",og,[((x=t.product)==null?void 0:x.isFavorite)??!1?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((P=t.product)==null?void 0:P.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(m,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",ag," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",lg,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(Qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",cg,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||(((B=t.productContextButtonsConfig)==null?void 0:B.length)??0)>0?(i.openBlock(),i.createBlock(y,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",dg,[i.createElementVNode("div",hg,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ug,[f[2]||(f[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",fg,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",gg,[f[3]||(f[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",mg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(rg,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",pg,[f[4]||(f[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(_,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",yg," Нет в наличии ")),(R=(S=t.product)==null?void 0:S.properties)!=null&&R.pack?(i.openBlock(),i.createElementBlock("span",bg,[f[5]||(f[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",_g,i.toDisplayString((T=(C=t.product)==null?void 0:C.properties)==null?void 0:T.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",wg,[f[6]||(f[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",xg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(v,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",vg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,x=>(i.openBlock(),i.createBlock(Mr,{key:x.coefficient.slug,product:t.product,"cost-field-name":x.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(Mr,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",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-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",kg,[i.createElementVNode("ul",Cg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(x,P)=>(i.openBlock(),i.createElementBlock("li",{key:P}," ("+i.toDisplayString(P)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(x,P)=>(i.openBlock(),i.createElementBlock("li",{key:P}," ("+i.toDisplayString(P)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Bg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Mr,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Tg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),wt.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(or,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(or,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(M.forEach(t,s=>{M.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),s=>{n.push(Bg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Mr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ka,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},Rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pg(t,e){return i.openBlock(),i.createElementBlock("svg",Rg,[...e[0]||(e[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 Ja=i.markRaw({name:"ion-trash",render:Pg}),$g={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Eg(t,e){return i.openBlock(),i.createElementBlock("svg",$g,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const el=i.markRaw({name:"ion-plus",render:Eg}),Ng={key:0,class:"flex w-fit items-center gap-2"},Fg={key:1,class:"flex flex-wrap gap-1"},Ag={key:0},Mg={key:2},Vg={},ar=i.defineComponent({...Vg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=z.NSpin,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Ng,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",Fg,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Ag,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Mg,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),he={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},Ze={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Ig={class:"flex flex-col gap-4"},Og={class:"flex flex-col gap-2"},zg={class:"mt-8 font-bold"},Lg={class:"grid grow grid-cols-2 items-start gap-2"},Dg={class:"text-sm"},Hg={key:0,class:"text-red-500"},Wg={key:2,class:"text-red-500 text-sm mb-2"},jg={class:"flex flex-col gap-4"},qg={key:1},Xg={class:"text-lg font-semibold"},Yg={class:"flex gap-3"},Ug={},tl=i.defineComponent({...Ug,__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","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var b;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,v,B;const y={"configuratorParams.length":[he.required,he.min(r.settings.stripMinLength),he.max(r.settings.stripMaxLength||Number.MAX_VALUE),he.step(r.settings.lengthStep),Ze.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[he.required,he.min(1),he.step(1),Ze.serverValidation((v=r.validation.quantity)==null?void 0:v.feedback)],marker:[Ze.serverValidation((B=r.validation.marker)==null?void 0:B.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(S,R)=>{var x;const T=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${R}`]=[he.required,he.min(T),he.max(r.settings.maxLineWidth),he.step(r.settings.lineWidthStep),Ze.serverValidation((x=r.validation[`lines_widths[${R+1}]`])==null?void 0:x.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(S,R)=>{var C;y[`configuratorParams.linesAngles.${R}`]=[he.required,he.min(r.settings.minLineAngle),he.max(r.settings.maxLineAngle),he.step(r.settings.lineAngleStep),Ze.serverValidation((C=r.validation[`lines_angles[${R+1}]`])==null?void 0:C.feedback)]}),y}),d=i.ref(r.settings.canSetDopProdaga??!1),h=i.computed(()=>{var S;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,v=((S=l.value.product)==null?void 0:S.costRub)||0;if(!y||!_||v===0)return null;const B=y/100;return(v*_*B).toLocaleString("ru-ru",{minimumFractionDigits:2})}),f=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),g=i.computed(()=>{const y=f.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),m=i.computed(()=>{const{configuratorParams:y}=l.value,_=M.every(y.linesWidths,R=>!!(R&&R>0)),v=M.every(y.linesAngles,R=>!M.isNil(R)),B=!!(l.value.quantity&&l.value.quantity>0),S=y.length>0&&y.length>0;return _&&v&&B&&S&&g.value}),u=()=>{i.nextTick(()=>{var y;(y=o.value)==null||y.validate(_=>{_||(s("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(y,_)=>{const v=new Q.CartItemBase(l.value);v[y]=_,y==="configuratorParams"&&(v.product=new Q.Product),s("update:value",v)};return i.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),i.watch(()=>r.value,y=>{l.value=M.cloneDeep(y)},{deep:!0}),e({validate:(b=o.value)==null?void 0:b.validate,formReference:o}),(y,_)=>{const v=el,B=Ja,S=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"grid gap-2 md:grid-cols-2 md:gap-6",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[i.createElementVNode("div",Ig,[_[22]||(_[22]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=C=>l.value.configuratorParams.startTailType=C),u],options:t.settings.startTailConfigs.map(({label:C},T)=>({label:C,value:T})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Og,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(C,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:"flex items-start gap-2"},[i.createElementVNode("div",zg,i.toDisplayString(T+1),1),i.createElementVNode("div",Lg,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${T}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[T],"onUpdate:value":[x=>l.value.configuratorParams.linesWidths[T]=x,_[2]||(_[2]=x=>u())],parse:i.unref(Gt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=x=>i.unref(_t)(x)),onInput:x=>i.unref(Ke)(t.validation,`lines_widths[${T+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${T}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[T],"onUpdate:value":[x=>l.value.configuratorParams.linesAngles[T]=x,_[4]||(_[4]=x=>u())],parse:i.unref(Gt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=x=>i.unref(_t)(x,!0)),onInput:x=>i.unref(Ke)(t.validation,`lines_angles[${T+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:x=>s("click:add-line",T)},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:x=>s("click:remove-line",T)},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=C=>l.value.configuratorParams.endTailType=C),u],options:t.settings.endTailConfigs.map(({label:C},T)=>({label:C,value:T})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ar,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Dg,[g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Hg," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(f.value)+" мм. ",1))]),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Wg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((R=t.settings.allTemplates)==null?void 0:R.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=C=>s("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",jg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=C=>l.value.configuratorParams.colorSide=C),u],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=C=>l.value.configuratorParams.length=C),_[11]||(_[11]=C=>u())],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=C=>i.unref(_t)(C)),onInput:_[10]||(_[10]=C=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=C=>l.value.quantity=C),_[15]||(_[15]=C=>p("quantity",C??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=C=>i.unref(_t)(C,!1)),onInput:_[14]||(_[14]=C=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=C=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=C=>{l.value.marker=C??null,p("marker",C??null)})},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createBlock(S,{key:0,checked:l.value.dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=C=>{l.value.dopProdaga=C??!1,p("dopProdaga",C??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createElementBlock("div",qg,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Xg,i.toDisplayString(h.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Yg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=C=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}});var nl=Object.defineProperty,Kg=Object.defineProperties,Gg=Object.getOwnPropertyDescriptors,il=Object.getOwnPropertySymbols,Zg=Object.prototype.hasOwnProperty,Qg=Object.prototype.propertyIsEnumerable,rl=t=>{throw TypeError(t)},Ls=(t,e,n)=>e in t?nl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ds=(t,e)=>{for(var n in e||(e={}))Zg.call(e,n)&&Ls(t,n,e[n]);if(il)for(var n of il(e))Qg.call(e,n)&&Ls(t,n,e[n]);return t},Hs=(t,e)=>Kg(t,Gg(e)),sl=(t,e)=>{for(var n in e)nl(t,n,{get:e[n],enumerable:!0})},w=(t,e,n)=>Ls(t,typeof e!="symbol"?e+"":e,n),ol=(t,e,n)=>e.has(t)||rl("Cannot "+n),Pt=(t,e,n)=>(ol(t,e,"read from private field"),n?n.call(t):e.get(t)),al=(t,e,n)=>e.has(t)?rl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Jg=(t,e,n,r)=>(ol(t,e,"write to private field"),e.set(t,n),n),xt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return xt.shim(t),typeof e<"u"&&(xt.Image=e),xt.isHeadless=!0,t}},ll={};sl(ll,{Curve:()=>Vi,getAnchorsFromArcData:()=>nm,getComponentOnCubicBezier:()=>lr,getControlPoints:()=>_l,getCurveBoundingBox:()=>pl,getCurveFromPoints:()=>bl,getCurveLength:()=>ml,getReflection:()=>Xs,integrate:()=>yl,subdivide:()=>qs});var cl={};sl(cl,{HALF_PI:()=>Je,NumArray:()=>dn,TWO_PI:()=>ct,decomposeMatrix:()=>oi,getComputedMatrix:()=>Ws,getEffectiveStrokeWidth:()=>hn,getPoT:()=>ul,lerp:()=>At,mod:()=>Mt,setMatrix:()=>hl,toFixed:()=>Ae});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var dl,ct=Math.PI*2,Je=Math.PI*.5;function oi(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function hl(t){dl=t}function Ws(t,e){e=e&&e.identity()||new dl;let n=t;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;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function At(t,e,n){return n*(e-t)+t}var js=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function ul(t){let e=0;for(;js[e]&&js[e]<t;)e++;return js[e]}function Mt(t,e){for(;t<0;)t+=e;return t%e}var dn=De.Float32Array||Array,em=Math.floor;function Ae(t){return em(t*1e6)/1e6}function hn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Ws(t));const r=oi(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var te={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Y=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];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[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];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(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};w(Y,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(Y,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var fl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Y.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Y.Types.change))}}},Zt=class nr extends Y{constructor(e=0,n=0){super(),w(this,"_x",0),w(this,"_y",0);for(let r in fl)Object.defineProperty(this,r,fl[r]);this.x=e,this.y=n}static add(e,n){return new nr(e.x+n.x,e.y+n.y)}static sub(e,n){return new nr(e.x-n.x,e.y-n.y)}static subtract(e,n){return nr.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(nr.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,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 nr(this.x,this.y)}add(e,n){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+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){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-=n),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,n){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*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){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/=n),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 n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ae(this.x),y:Ae(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};w(Zt,"zero",new Zt),w(Zt,"left",new Zt(-1,0)),w(Zt,"right",new Zt(1,0)),w(Zt,"up",new Zt(0,-1)),w(Zt,"down",new Zt(0,1));var ee=Zt,ke=class Vs extends ee{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=te.move){super(e,n),w(this,"controls",{left:new ee,right:new ee}),w(this,"_command",te.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 gl)Object.defineProperty(this,d,gl[d]);this.command=l,this.relative=!0;const c=Vs.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(Y.Types.change,c),this.controls.right.set(o,a).addEventListener(Y.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Y.Types.change)}}static fromObject(e){return new Vs().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Vs().copy(this)}toObject(){return{x:Ae(this.x),y:Ae(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ae(this.rx),ry:Ae(this.ry),xAxisRotation:Ae(this.xAxisRotation),largeArcFlag:Ae(this.largeArcFlag),sweepFlag:Ae(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},gl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Y.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Y.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Y.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Y.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Y.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Y.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Y.Types.change))}}},tm=0,vt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return tm++}},Vi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function lr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function qs(t,e,n,r,s,o,a,l,c){c=c||Vi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ke(a,l)];const h=[];for(let f=0;f<d;f++){const g=f/d,m=lr(g,t,n,s,a),u=lr(g,e,r,o,l);h.push(new ke(m,u))}return h}function ml(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),g=9*(r-o)+3*(l-e),m=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(g*b+m)*b+u;return Math.sqrt(y*y+_*_)}return yl(p,0,1,c||Vi.RecursionLimit)}function pl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,g,m,u,p,b,y;for(let S=0;S<2;++S){if(S===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,g=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,g=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;m=-g/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*g*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,v=_,B;for(;_--;)m=c[_],B=1-m,d[0][_]=B*B*B*t+3*B*B*m*n+3*B*m*m*s+m*m*m*a,d[1][_]=B*B*B*e+3*B*B*m*r+3*B*m*m*o+m*m*m*l;return d[0][v]=t,d[1][v]=e,d[0][v+1]=a,d[1][v+1]=l,d[0].length=d[1].length=v+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 yl(t,e,n,r){let s=Vi.abscissas[r-2],o=Vi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function bl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Mt(s-1,n):Math.max(s-1,0),l=e?Mt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];_l(c,d,h),d.command=s===0?te.move:te.curve}}function _l(t,e,n){const r=ee.angleBetween(t,e),s=ee.angleBetween(n,e);let o=ee.distanceBetween(t,e),a=ee.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Xs(t,e,n){return new ee(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function nm(t,e,n,r,s,o,a){const l=vt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),g=r*Math.sin(h),m=new ke(f,g);m.command=te.line}}var wl=Array.prototype.slice;function im(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var Z={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!im(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:De.performance&&De.performance.now?De.performance:Date},Vt={hasEventListeners:typeof De.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Vt},unbind:function(t,e,n,r){return Vt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Vt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=De[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=De.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ii=De.document?De.document.createElement("div"):{};Ii.id="help-two-load",Object.defineProperty(Vt,"temp",{enumerable:!0,get:function(){return Z.isElement(Ii)&&!De.document.head.contains(Ii)&&(Ii.style.display="none",De.document.head.appendChild(Ii)),Ii}});var $t=class extends Error{constructor(e){super(),w(this,"name","Two.js"),w(this,"message"),this.message=e}},rm=De.devicePixelRatio||1;function sm(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Ys(t){return rm/sm(t)}var Or=class{constructor(){w(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},dt,Hn=class extends Array{constructor(){super(),al(this,dt,new Y),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 Pt(this,dt)}set _events(e){Jg(this,dt,e)}get _bound(){return Pt(this,dt)._bound}set _bound(e){Pt(this,dt)._bound=e}addEventListener(){return Pt(this,dt).addEventListener.apply(this,arguments)}on(){return Pt(this,dt).on.apply(this,arguments)}bind(){return Pt(this,dt).bind.apply(this,arguments)}removeEventListener(){return Pt(this,dt).removeEventListener.apply(this,arguments)}off(){return Pt(this,dt).off.apply(this,arguments)}unbind(){return Pt(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return Pt(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return Pt(this,dt).trigger.apply(this,arguments)}listen(){return Pt(this,dt).listen.apply(this,arguments)}ignore(){return Pt(this,dt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Y.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Y.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Y.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Y.Types.insert,n),this.trigger(Y.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(Y.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Y.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};dt=new WeakMap;var xl=class Du extends Y{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",vt.Identifier+vt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in vl)Object.defineProperty(this,e,vl[e])}static fromObject(e){const n=new Du().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};w(xl,"Properties",["renderer","id","className"]);var Oi=xl,vl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},zr,kl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(zr=document.createElement("a"));var Qt=class Lt extends Oi{constructor(e,n){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 r in Cl)Object.defineProperty(this,r,Cl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=om.bind(this),this._renderer.flagScale=am.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new ee,typeof n=="function"){const r=(function(){this.unbind(Y.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Y.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Lt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return zr?(zr.href=e,zr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Lt.getAbsoluteURL(e);if(Lt.ImageRegistry.contains(n))return Lt.ImageRegistry.get(n);let r;return xt.Image?(r=new xt.Image,xt.shim(r,"img")):De.document?kl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=Lt.getTag(r);e._flagImage&&(/canvas/i.test(s)?Lt.Register.canvas(e,n):(e._src=!xt.isHeadless&&r.getAttribute("two-src")||r.src,Lt.Register[s](e,n))),e._flagSrc&&(r||(r=Lt.getImage(e.src),e.image=r),s=Lt.getTag(r),Lt.Register[s](e,n))}clone(){const e=new Lt(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 ee?e.offset:new ee().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof ee?e.scale:new ee().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(Y.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Lt.load(this,(function(){this.loaded=!0,this.trigger(Y.Types.change).trigger(Y.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(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};w(Qt,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Qt,"RegularExpressions",kl),w(Qt,"ImageRegistry",new Or),w(Qt,"Register",{canvas:function(t,e){t._src="#"+t.id,Qt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!xt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!xt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new $t("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!xt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Qt.getAbsoluteURL(t._src),!(!xt.isHeadless&&n&&n.getAttribute("two-src"))&&(xt.isHeadless||n.setAttribute("two-src",t.src),Qt.ImageRegistry.add(t.src,n),xt.isHeadless?Qt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(xt.isHeadless)throw new $t("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new $t("unable to load "+t.src)};t._src=Qt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Qt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Me=Qt,Cl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Me.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Me.ImageRegistry.contains(n)?this._image=Me.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Y.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Y.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ee&&this._scale.unbind(Y.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof ee&&this._scale.bind(Y.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function om(){this._flagOffset=!0}function am(){this._flagScale=!0}var Us=class cn extends Oi{constructor(e,n,r){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 s in Sl)Object.defineProperty(this,s,Sl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:cn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:cn.Index<=0?"#fff":"#000",cn.Index=(cn.Index+1)%2}static fromObject(e){const n=new cn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<cn.Properties.length;n++){const r=cn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new cn;return Z.each(cn.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",Z.each(cn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};w(Us,"Index",0),w(Us,"Properties",["offset","opacity","color"]);var Wn=Us,Sl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Ks=class Ri extends Oi{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let n in Bl)Object.defineProperty(this,n,Bl[n]);this._renderer.type="gradient",this._renderer.flagStops=lm.bind(this),this._renderer.bindStops=cm.bind(this),this._renderer.unbindStops=dm.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Wn?s:new Wn().copy(s)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Ri(n);return Z.each(Ri.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return Z.each(Ri.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Y.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}};w(Ks,"Stop",Wn),w(Ks,"Properties",["spread","stops","units"]);var et=Ks,Bl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),this._stops=new Hn((t||[]).slice(0)),this._stops.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._stops)}}};function lm(){this._flagStops=!0}function cm(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function dm(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Gs=class $r extends et{constructor(e,n,r,s,o){super(o),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=hm.bind(this),this.left=new ee,this.right=new ee,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new $r().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$r.Properties.length;n++){const r=$r.Properties[n];r in e&&(this[r]=e[r]instanceof ee?e[r]:new ee().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new $r(this.left._x,this.left._y,this.right._x,this.right._y,n);return Z.each(et.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}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(Y.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};w(Gs,"Stop",Wn),w(Gs,"Properties",["left","right"]);var He=Gs,Tl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof ee&&this._left.unbind(Y.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof ee&&this._right.unbind(Y.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function hm(){this._flagEndPoints=!0}var Zs=class Pi extends et{constructor(e,n,r,s,o,a){super(s),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 l in Rl)Object.defineProperty(this,l,Rl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=um.bind(this),this._renderer.flagFocal=fm.bind(this),this.center=new ee,this.radius=typeof r=="number"?r:1,this.focal=new ee,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof ee?e[r]:new ee().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Pi(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return Z.each(et.Properties.concat(Pi.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return Z.each(Pi.Properties,function(n){e[n]=this[n]},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(Y.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};w(Zs,"Stop",Wn),w(Zs,"Properties",["center","radius","focal"]);var We=Zs,Rl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Y.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Y.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Y.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Y.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function um(){this._flagCenter=!0}function fm(){this._flagFocal=!0}function Pl(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Lr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function $l(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),ml(r,l,s,c,o,d,a,h,n)}function El(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),qs(r,l,s,c,o,d,a,h,n)}function ai(t){switch(t.renderer.type){case"texture":return Me.fromObject(t);case"gradient":return et.fromObject(t);case"linear-gradient":return He.fromObject(t);case"radial-gradient":return We.fromObject(t)}return t}var gm=Math.cos,mm=Math.sin,Nl=Math.tan,Qs=[],Fl=class Dt extends Y{constructor(e,n,r,s,o,a){super(),w(this,"elements",new dn(9)),w(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const R=e;let C,T,x;const P=n[0]||0,$=n[1]||0,A=n[2]||0;return C=R[0]*P+R[1]*$+R[2]*A,T=R[3]*P+R[4]*$+R[5]*A,x=R[6]*P+R[7]*$+R[8]*A,[C,T,x]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],f=e[7],g=e[8],m=n[0],u=n[1],p=n[2],b=n[3],y=n[4],_=n[5],v=n[6],B=n[7],S=n[8];return r=r||new dn(9),r[0]=s*m+o*b+a*v,r[1]=s*u+o*y+a*B,r[2]=s*p+o*_+a*S,r[3]=l*m+c*b+d*v,r[4]=l*u+c*y+d*B,r[5]=l*p+c*_+d*S,r[6]=h*m+f*b+g*v,r[7]=h*u+f*y+g*B,r[8]=h*p+f*_+g*S,r}static fromObject(e){return new Dt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(Y.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(Y.Types.change)}identity(){return this.elements[0]=Dt.Identity[0],this.elements[1]=Dt.Identity[1],this.elements[2]=Dt.Identity[2],this.elements[3]=Dt.Identity[3],this.elements[4]=Dt.Identity[4],this.elements[5]=Dt.Identity[5],this.elements[6]=Dt.Identity[6],this.elements[7]=Dt.Identity[7],this.elements[8]=Dt.Identity[8],this.trigger(Y.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"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(Y.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const O=o[0]*e+o[1]*n+o[2]*r,L=o[3]*e+o[4]*n+o[5]*r,J=o[6]*e+o[7]*n+o[8]*r;return[O,L,J]}const h=this.elements,f=[e,n,r,s,o,a,l,c,d],g=h[0],m=h[1],u=h[2],p=h[3],b=h[4],y=h[5],_=h[6],v=h[7],B=h[8],S=f[0],R=f[1],C=f[2],T=f[3],x=f[4],P=f[5],$=f[6],A=f[7],F=f[8];return this.elements[0]=g*S+m*T+u*$,this.elements[1]=g*R+m*x+u*A,this.elements[2]=g*C+m*P+u*F,this.elements[3]=p*S+b*T+y*$,this.elements[4]=p*R+b*x+y*A,this.elements[5]=p*C+b*P+y*F,this.elements[6]=_*S+v*T+B*$,this.elements[7]=_*R+v*x+B*A,this.elements[8]=_*C+v*P+B*F,this.trigger(Y.Types.change)}inverse(e){const n=this.elements;e=e||new Dt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],f=n[8],g=f*l-c*h,m=-f*a+c*d,u=h*a-l*d;let p=r*g+s*m+o*u;return p?(p=1/p,e.elements[0]=g*p,e.elements[1]=(-f*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=m*p,e.elements[4]=(f*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=u*p,e.elements[7]=(-h*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=gm(e),r=mm(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Nl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Nl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Qs.length=0,this.toTransformArray(e,Qs),Qs.map(Ae).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],g=r[7],m=r[8];if(s){n[0]=o,n[1]=c,n[2]=f,n[3]=a,n[4]=d,n[5]=g,n[6]=l,n[7]=h,n[8]=m;return}return[o,c,f,a,d,g,l,h,m]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],g=r[7],m=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=f,n[7]=g,n[8]=m;return}return[o,a,l,c,d,h,f,g,m]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Dt().copy(this)}};w(Fl,"Identity",[1,0,0,0,1,0,0,0,1]);var zi=Fl;hl(zi);var Al=class Da extends Oi{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 Dr)Object.defineProperty(this,e,Dr[e]);this._renderer.flagMatrix=Ml.bind(this),this.isShape=!0,this.matrix=new zi,this.worldMatrix=new zi,this.position=new ee,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Da().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Dr.position.get.apply(this,arguments)}set translation(e){Dr.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 ee?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 ee?e.scale:new ee(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 n=new Da;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._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 ee?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 ee?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}};w(Al,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var jn=Al,Dr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Y.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Y.Types.change,this._renderer.flagMatrix),Ml.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ee&&this._scale.unbind(Y.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof ee&&this._scale.bind(Y.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Ws(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Ml(){this._flagMatrix=!0}var Li=Math.min,Di=Math.max,pm=Math.ceil,ym=Math.floor,bm=new ee,Js=class ti extends jn{constructor(e,n,r,s){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,"_flagStrokeAttenuation",!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),w(this,"_strokeAttenuation",!0);for(let o in Vl)Object.defineProperty(this,o,Vl[o]);this._renderer.type="path",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,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=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ai(e.fill),r=typeof e.stroke=="string"?e.stroke:ai(e.stroke),s=new ti().copy(Hs(Ds({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}}for(let n=0;n<ti.Properties.length;n++){const r=ti.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ti;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ti.Properties.length;r++){const s=ti.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),Z.each(ti.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];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())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,h=1/0,f=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:m}=oi(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof g=="number"&&typeof m=="number"&&(r=Math.max(g,m)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[g,m]=n.multiply(a.x,a.y),[u,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,v]=n.multiply(b,y),B=l.controls.left.x,S=l.controls.left.y;l.relative&&(B+=l.x,S+=l.y);let[R,C]=n.multiply(B,S);const T=pl(g,m,_,v,R,C,u,p);h=Li(T.min.y-r,h),c=Li(T.min.x-r,c),d=Di(T.max.x+r,d),f=Di(T.max.y+r,f)}else o<=1&&(h=Li(m-r,h),c=Li(g-r,c),d=Di(g+r,d),f=Di(m+r,f)),h=Li(p-r,h),c=Li(u-r,c),d=Di(u+r,d),f=Di(p+r,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,f,g,m,u,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const v=this.vertices.length,B=v-1;let S=null,R=null;for(let ne=0,N=this._lengths.length,V=0;ne<N;ne++){if(V+this._lengths[ne]>=_){this._closed?(r=Mt(ne,v),s=Mt(ne-1,v),ne===0&&(r=s,s=ne)):(r=ne,s=Math.min(Math.max(ne-1,0),B)),S=this.vertices[r],R=this.vertices[s],_-=V,this._lengths[ne]!==0?e=_/this._lengths[ne]:e=0;break}V+=this._lengths[ne]}if(S===null||R===null)return null;if(S){if(!R)return S}else return R;y=R.controls&&R.controls.right,b=S.controls&&S.controls.left,l=R.x,g=R.y,c=(y||R).x,m=(y||R).y,d=(b||S).x,u=(b||S).y,h=S.x,p=S.y,y&&R.relative&&(c+=R.x,m+=R.y),b&&S.relative&&(d+=S.x,u+=S.y),a=lr(e,l,c,d,h),f=lr(e,g,m,u,p);const C=At(l,c,e),T=At(g,m,e),x=At(c,d,e),P=At(m,u,e),$=At(d,h,e),A=At(u,p,e),F=At(C,x,e),O=At(T,P,e),L=At(x,$,e),J=At(P,A,e);return Z.isObject(n)?(n.x=a,n.y=f,n instanceof ke&&(n.controls.left.x=F,n.controls.left.y=O,n.controls.right.x=L,n.controls.right.y=J,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=f,n.controls.right.x-=a,n.controls.right.y-=f)),n.t=e,n):(o=new ke(a,f,F-a,O-f,L-a,J-f,this._curved?te.curve:te.line),o.t=e,o)}plot(){if(this.curved)return bl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?te.move:te.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===te.close;let s=this.vertices[n],o=[],a;return Z.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===te.move){o.push(new ke(s.x,s.y)),c>0&&(o[o.length-1].command=te.line),s=l;return}a=El(l,s,e),o=o.concat(a),Z.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=El(l,s,e),o=o.concat(a),Z.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line})),o.push(new ke(l.x,l.y)),o[o.length-1].command=r?te.close:te.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),Z.each(this.vertices,function(l,c){if(c<=0||l.command===te.move){o=l,this._lengths[c]=0;return}this._lengths[c]=$l(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Lr(this,r*this._length),a=Lr(this,s*this._length),l=pm(o),c=ym(a);let d,h,f,g,m,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ke),u>c&&!h?(m=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(s,m),m.command=this._renderer.collection[u].command,this._renderer.vertices.push(m),h=m,f=this._collection[u-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(ee.zero,1-m.t):this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):u>=l&&u<=c&&(m=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(m),u===c&&Pl(this,s)?(h=m,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):u===l&&Pl(this,r)&&(d=m,d.command=te.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(u=l-1,m=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,m),m.command=te.move,this._renderer.vertices.unshift(m),g=this._collection[u+1],g&&g.controls&&(m.controls.left.clear(),g.relative?this._renderer.collection[u+1].controls.left.copy(g.controls.left).lerp(ee.zero,m.t):(bm.copy(g),this._renderer.collection[u+1].controls.left.copy(g.controls.left).lerp(g,m.t))))}return jn.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=this._flagStrokeAttenuation=!1,jn.prototype.flagReset.call(this),this}};w(Js,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),w(Js,"Utils",{getCurveLength:$l});var Ce=Js,Vl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(Y.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(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Z.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),t instanceof Hn?this._collection=t:this._collection=new Hn(t||[]),this._collection.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Z.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Il(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Ol(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function zl(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Ll(){this._flagFill=!0}function Dl(){this._flagStroke=!0}var Hl=class Er extends Ce{constructor(e,n,r,s){const o=[new ke,new ke,new ke,new ke];super(o,!0,!1,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let a in Wl)Object.defineProperty(this,a,Wl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new ee,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Er().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Er.Properties.length;n++){const r=Er.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof ee&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ke),this.vertices[0].set(-e,-n).sub(this._origin).command=te.move,this.vertices[1].set(e,-n).sub(this._origin).command=te.line,this.vertices[2].set(e,n).sub(this._origin).command=te.line,this.vertices[3].set(-e,n).sub(this._origin).command=te.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=te.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Er(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]instanceof ee?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}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}};w(Hl,"Properties",["width","height","origin"]);var qn=Hl,Wl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Y.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Y.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},jl=class Nr extends qn{constructor(e,n,r,s,o,a){super(n,r,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),this._renderer.type="sprite";for(let l in ql)Object.defineProperty(this,l,ql[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),this.origin=new ee,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Nr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Nr.Properties.length;n++){const r=Nr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Z.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r: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 n=new Nr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",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}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,h,f,g;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)){h=e.image.width,f=e.image.height,s=h/n,o=f/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(Z.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=Z.performance.now()-this._startTime,g=this._lastFrame+1,c=1e3*(g-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=At(this._firstFrame,g,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%n,u=Math.floor(this._index/n),p=-s*m+(h-s)/2,b=-o*u+(f-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};w(jl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Hr=jl,ql={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},eo,Xl=class extends Hn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),al(this,eo,{}),this.attach(e),this.on(Y.Types.insert,this.attach),this.on(Y.Types.remove,this.detach)}get ids(){return Pt(this,eo)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};eo=new WeakMap;var Yl=class $i extends Ce{constructor(e,n,r,s,o,a,l){const c=l||vt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ke);super(d,!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 h in Ul)Object.defineProperty(this,h,Ul[h]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=Mt(e,ct)===Mt(n,ct),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,f,g,m,u,p,b,y,_,v;for(o?c--:a||(c-=2),f=0,g=c-1;f<c;f++){switch(m=f/g,u=l[h],p=m*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),f){case 0:d=te.move;break;default:d=te.curve}u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===te.curve&&(v=s*b/Math.PI,u.controls.left.x=v*Math.cos(p-Je),u.controls.left.y=v*Math.sin(p-Je),u.controls.right.x=v*Math.cos(p+Je),u.controls.right.y=v*Math.sin(p+Je),f===1&&u.controls.left.multiplyScalar(2),f===g&&u.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=te.close,h++):(c--,g=c-1),f=0;f<c;f++)m=f/g,u=l[h],p=(1-m)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=te.curve,f<=0&&(d=o?te.move:te.line),u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===te.curve&&(v=r*b/Math.PI,u.controls.left.x=v*Math.cos(p+Je),u.controls.left.y=v*Math.sin(p+Je),u.controls.right.x=v*Math.cos(p-Je),u.controls.right.y=v*Math.sin(p-Je),f===1&&u.controls.left.multiplyScalar(2),f===g&&u.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=te.line}else o||(l[h].command=te.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=te.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 n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new $i(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Ce.Properties.length;c++){const d=Ce.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];e[r]=this[r]}return e}};w(Yl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var to=Yl,Ul={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},no=Math.cos,io=Math.sin,Kl=class Ei extends Ce{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ke(0,0,0,0,0,0));super(a,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let l in Gl)Object.defineProperty(this,l,Gl[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ct,c=r*no(l),d=r*io(l),h=s*no(l-Je),f=s*io(l-Je),g=s*no(l+Je),m=s*io(l+Je),u=this.vertices[o];u.command=o===0?te.move:te.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Ei(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};w(Kl,"Properties",["radius"]);var Wr=Kl,Gl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ro=Math.cos,so=Math.sin,Zl=class Ni extends Ce{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ke);super(l,!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 c in Ql)Object.defineProperty(this,c,Ql[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ni().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ct,c=r*ro(l),d=s*so(l),h=r*n*ro(l-Je),f=s*n*so(l-Je),g=r*n*ro(l+Je),m=s*n*so(l+Je),u=this.vertices[o];u.command=o===0?te.move:te.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Ni(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];e[r]=this[r]}return e}};w(Zl,"Properties",["width","height"]);var jr=Zl,Ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},_m=Math.ceil,wm=Math.floor,Jl=class ni extends jn{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,"_flagStrokeAttenuation",!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,"_strokeAttenuation",!0),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 n in ec)Object.defineProperty(this,n,ec[n]);this._renderer.type="points",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.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 n=typeof e.fill=="string"?e.fill:ai(e.fill),r=typeof e.stroke=="string"?e.stroke:ai(e.stroke),s=new ni().copy(Hs(Ds({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}for(let n=0;n<ni.Properties.length;n++){const r=ni.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ni;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ni.Properties.length;r++){const s=ni.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),Z.each(ni.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,h=qs(a,l,a,l,c,d,c,d,e);n=n.concat(h)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Lr(this,e*this._length),s=Lr(this,n*this._length),o=_m(r),a=wm(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}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}};w(Jl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var oo=Jl,ec={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(Y.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(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),t instanceof Hn?this._collection=t:this._collection=new Hn(t||[]),this._collection.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},xm=Math.cos,vm=Math.sin,tc=class Fi extends Ce{constructor(e,n,r,s){s=Math.max(s||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 o in nc)Object.defineProperty(this,o,nc[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ct*o+Math.PI/2,l=this._width*xm(a)/2,c=this._height*vm(a)/2;s>=r?this.vertices.push(new ke(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};w(tc,"Properties",["width","height","sides"]);var ao=tc,nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ic=class Ai extends Ce{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ke(0,0,0,0,0,0,l===0?te.move:te.curve));super(a),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 l in rc)Object.defineProperty(this,l,rc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=km.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof ee)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof ee?s:new ee().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof ee?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.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 n=this.width,r=this.height,s=this.radius,o=new Ai(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};w(ic,"Properties",["width","height","radius"]);var qr=ic,rc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof ee&&this._radius.unbind(Y.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof ee&&this._radius.bind(Y.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function km(){this._flagRadius=!0}var Cm=Math.cos,Sm=Math.sin,sc=class Mi extends Ce{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=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 a in oc)Object.defineProperty(this,a,oc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ct*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*Cm(a),d=l*Sm(a);s>=r?this.vertices.push(new ke(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Mi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};w(sc,"Properties",["innerRadius","outerRadius","sides"]);var lo=sc,oc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},co,ac=Math.min,lc=Math.max;De.document&&(co=document.createElement("canvas"));var ho=class Ht extends jn{constructor(e,n,r,s){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,"_flagStrokeAttenuation",!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),w(this,"_strokeAttenuation",!0);for(let o in cc)Object.defineProperty(this,o,cc[o]);if(this._renderer.type="text",this._renderer.flagFill=Bm.bind(this),this._renderer.flagStroke=Tm.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!Z.isObject(s))return this;for(let o=0;o<Ht.Properties.length;o++){const a=Ht.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(co){const n=co.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*Ht.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ai(e.fill),r=typeof e.stroke=="string"?e.stroke:ai(e.stroke),s=new Ht().copy(Hs(Ds({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<Ht.Properties.length;n++){const r=Ht.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Ht(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Ht.Properties.length;r++){const s=Ht.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<Ht.Properties.length;n++){const r=Ht.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=Ht.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[h,f]=n.multiply(r,o),[g,m]=n.multiply(r,a),[u,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=ac(f,m,p,y),r=ac(h,g,u,b),s=lc(h,g,u,b),a=lc(f,m,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}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}};w(ho,"Ratio",.6),w(ho,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var un=ho,cc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Z.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Bm(){this._flagFill=!0}function Tm(){this._flagStroke=!0}var uo=class ir extends qn{constructor(e,n,r,s){super(n,r,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),this._renderer.type="image-sequence";for(let o in dc)Object.defineProperty(this,o,dc[o]);this._renderer.flagTextures=Rm.bind(this),this._renderer.bindTextures=Pm.bind(this),this._renderer.unbindTextures=$m.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(hc.bind(this)):typeof e=="string"&&(this.textures=[hc(e)]),this.origin=new ee,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=ir.DefaultFrameRate,this.index=0}static fromObject(e){const n=new ir().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ir.Properties.length;n++){const r=ir.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Z.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r: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 n=new ir(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,Z.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=Z.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=At(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Me))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};w(uo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(uo,"DefaultFrameRate",30);var fo=uo,dc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),this._textures=new Hn((t||[]).slice(0)),this._textures.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Rm(){this._flagTextures=!0}function Pm(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function $m(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function hc(t){if(t instanceof Me)return t;if(typeof t=="string")return new Me(t)}var Xr=Math.min,Yr=Math.max,go=class ii extends jn{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),w(this,"_strokeAttenuation",!0);for(let n in uc)Object.defineProperty(this,n,uc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new ii;for(let s=0;s<ii.Properties.length;s++){const o=ii.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:ai(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return to.fromObject(s);case"circle":return Wr.fromObject(s);case"element":return Oi.fromObject(s);case"ellipse":return jr.fromObject(s);case"group":return ii.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return fo.fromObject(s);case"path":return Ce.fromObject(s);case"points":return oo.fromObject(s);case"polygon":return ao.fromObject(s);case"rectangle":return qn.fromObject(s);case"rounded-rectangle":return qr.fromObject(s);case"shape":return jn.fromObject(s);case"sprite":return Hr.fromObject(s);case"star":return lo.fromObject(s);case"text":return un.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<ii.Properties.length;n++){const r=ii.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ii,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._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,Z.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.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),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,h=1/0,f=-1/0;const g=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const u=this.children[m];if(!(!u.visible||g.test(u._renderer.type))&&(n=u.getBoundingClientRect(e),s=typeof n.top!="number"||Z.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||Z.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||Z.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||Z.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[v,B]=r.multiply(n.left,n.bottom),[S,R]=r.multiply(n.right,n.bottom);h=Xr(b,_,B,R,h),c=Xr(p,y,v,S,c),d=Yr(p,y,v,S,d),f=Yr(b,_,B,R,f)}else h=Xr(n.top,h),c=Xr(n.left,c),d=Yr(n.right,d),f=Yr(n.bottom,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}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(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}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}};w(go,"Children",Xl),w(go,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var rt=go,uc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=rt.InsertChildren.bind(this),n=rt.RemoveChildren.bind(this),r=rt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Xl(t),this._children.bind(Y.Types.insert,e),this._children.bind(Y.Types.remove,n),this._children.bind(Y.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Z.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function fc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Ur=class extends Ce{constructor(e,n,r,s){const o=[new ke(e,n),new ke(r,s)];super(o);for(let a in gc)Object.defineProperty(this,a,gc[a]);this.vertices[0].command=te.move,this.vertices[1].command=te.line,this.automatic=!1}};w(Ur,"Properties",["left","right"]);var gc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Z.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=te.move;else{const e=new $t("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Z.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=te.line;else{const e=new $t("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},fn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Em={start:"left",middle:"center",end:"right"},mc=["id","class","transform","xmlns","viewBox"],Nm=["x","y","width","height","href","xlink:href"];function Fm(t){return Em[t]}function Am(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function cr(t){return t.replace(/svg:/gi,"").toLowerCase()}function pc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function Mm(t,e){e||(e={});const n=t.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,"");e[l]=c}return e}function Vm(t){const e={},n=Im(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Im(t){const e=t.getAttributeNames();for(let n=0;n<mc.length;n++){const r=mc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Om(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<t.children.length;f++){const g=t.children[f];"translation"in g?g.translation.add(r,s):"x"in g?g.x=r:"y"in g&&(g.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new ee(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new qn(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Wt(t,e,n){const r={},s={},o={};let a,l,c,d,h,f,g,m,u,p,b,y,_,v,B,S,R;if(t===null)return r;if(De.getComputedStyle){const C=De.getComputedStyle(t);for(a=C.length;a--;)c=C[a],d=C[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)f=t.attributes[a],/style/i.test(f.nodeName)?Mm(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&Z.defaults(r,n),Z.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=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(g=oi(l),e._renderer.type){case"linear-gradient":pc(g,e.left),pc(g,e.right);break;case"radial-gradient":e.center.x+=g.translateX,e.center.y+=g.translateY,e.focal.x+=g.translateX,e.focal.y+=g.translateY,e.radius*=Math.max(g.scaleX,g.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;g=oi(l),e.translation.set(g.translateX,g.translateY),e.rotation=Math.PI*(g.rotation/180),e.scale=new ee(g.scaleX,g.scaleY),m=parseFloat((r.x+"").replace("px")),u=parseFloat((r.y+"").replace("px")),m&&(e.translation.x=m),u&&(e.translation.y=u);break;case"visible":if(e instanceof rt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof rt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof rt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof rt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof rt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof rt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(fn.cssBackgroundImage.test(d)&&(p=d.replace(fn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(y=ze.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=cr(y.nodeName),e.mask=ze[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof rt?"_":"")+c,fn.cssBackgroundImage.test(d)?(p=d.replace(fn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(y=ze.defs.current.get(p),y.object||(_=cr(y.nodeName),y.object=ze[_].call(this,y,{})),y=y.object):(b=Lm(this),y=b.getById(p)),e[h]=y):e[h]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(v=e instanceof et,B=e instanceof He,S=e instanceof We,v||B||S)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof un&&(e.family=d);break;case"font-size":e instanceof un&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof un&&(e.weight=d);break;case"font-style":e instanceof un&&(e.style=d);break;case"text-decoration":e instanceof un&&(e.decoration=d);break;case"line-height":e instanceof un&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function zm(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||cr(t.nodeName)==="#text"||e.add(s.id,s)}}function Lm(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new Or,n=t.getElementsByTagName("defs");for(let u=0;u<n.length;u++)zm(n[u],e);const r=ze.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,h=o!==null,f=a!==null,g=l!==null,m=c!==null;return h&&(r.x=parseFloat(o.replace(fn.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(fn.unitSuffix,""))),g&&(r.width=parseFloat(l.replace(fn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(fn.unitSuffix,""))),d&&Om(r,s),delete ze.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new $t("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 $t("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<t.attributes.length;c++){const d=t.attributes[c],h=Nm.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=cr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new rt;Wt.call(this,t,n,e),this.add(n);const r=Vm.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=cr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ke(parseFloat(a),parseFloat(l)))});const s=new Ce(r,!0);return s.stroke="none",s.fill="black",Wt.call(this,t,s,e),s},polyline:function(t,e){const n=ze.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ke,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const f=h.length-1;Z.each(h.slice(0),function(g,m){const u=g.slice(1).trim().match(fn.path),p=g[0],b=p.toLowerCase();let y,_,v,B,S;const R=[];switch(m===0&&(h=[]),b){case"h":case"v":u.length>1&&(y=1);break;case"m":case"l":case"t":u.length>2&&(y=2);break;case"s":case"q":u.length>4&&(y=4);break;case"c":u.length>6&&(y=6);break;case"a":u.length>7&&(y=7);break}if(y){for(_=0,v=u.length,S=0;_<v;_+=y){if(B=p,S>0)switch(p){case"m":B="l";break;case"M":B="L";break}R.push(B+u.slice(_,_+y).join(" ")),S++}h=Array.prototype.concat.apply(h,R)}else h.push(g)}),Z.each(h,function(g,m){let u,p,b;const y=g[0],_=y.toLowerCase();d=g.slice(1).trim().match(fn.path),o=y===_;let v,B,S,R,C,T,x,P,$,A,F,O,L,J,ne,N,V;switch(_){case"z":if(m>=f)s=!0;else{p=l.x,b=l.y,u=new ke(p,b,void 0,void 0,void 0,void 0,te.close);for(let q=r.length-1;q>=0;q--){const X=r[q];if(/m/i.test(X.command)){l=X;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),u=new ke(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?te.move:te.line),o&&u.addSelf(l),l=u;break;case"h":case"v":A=/h/i.test(_)?"x":"y",F=/x/i.test(A)?"y":"x",u=new ke(void 0,void 0,void 0,void 0,void 0,void 0,te.line),u[A]=parseFloat(d[0]),u[F]=l[F],o&&(u[A]+=l[A]),l=u;break;case"c":case"s":v=l.x,B=l.y,c||(c=new ee),/c/i.test(_)?(S=parseFloat(d[0]),R=parseFloat(d[1]),C=parseFloat(d[2]),T=parseFloat(d[3]),x=parseFloat(d[4]),P=parseFloat(d[5])):($=Xs(l,c,o),S=$.x,R=$.y,C=parseFloat(d[0]),T=parseFloat(d[1]),x=parseFloat(d[2]),P=parseFloat(d[3])),o&&(S+=v,R+=B,C+=v,T+=B,x+=v,P+=B),l.controls.right.set(S-l.x,R-l.y),u=new ke(x,P,C-x,T-P,void 0,void 0,te.curve),l=u,c=u.controls.left;break;case"t":case"q":v=l.x,B=l.y,c||(c=new ee),/q/i.test(_)?(S=parseFloat(d[0]),R=parseFloat(d[1]),C=parseFloat(d[0]),T=parseFloat(d[1]),x=parseFloat(d[2]),P=parseFloat(d[3])):($=Xs(l,c,o),S=$.x,R=$.y,C=$.x,T=$.y,x=parseFloat(d[0]),P=parseFloat(d[1])),o&&(S+=v,R+=B,C+=v,T+=B,x+=v,P+=B),l.controls.right.set((S-l.x)*.33,(R-l.y)*.33),u=new ke(x,P,C-x,T-P,void 0,void 0,te.curve),l=u,c=u.controls.left;break;case"a":v=l.x,B=l.y,L=parseFloat(d[0]),J=parseFloat(d[1]),ne=parseFloat(d[2]),N=parseFloat(d[3]),V=parseFloat(d[4]),x=parseFloat(d[5]),P=parseFloat(d[6]),o&&(x+=v,P+=B),O=new ke(x,P),O.command=te.arc,O.rx=L,O.ry=J,O.xAxisRotation=ne,O.largeArcFlag=N,O.sweepFlag=V,u=O,l=O,c=void 0;break}u&&(Array.isArray(u)?r=r.concat(u):r.push(u))})}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},Z.each(n.vertices,function(l){l.subSelf(a.centroid)}),Wt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new Wr(0,0,s);return o.stroke="none",o.fill="black",Wt.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new jr(0,0,s,o);return a.stroke="none",a.fill="black",Wt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!Z.isNaN(n)||!Z.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new qn(0,0,s,o);return c.stroke="none",c.fill="black",Wt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new ee(n,r),d=new qr(0,0,s,o,c);return d.stroke="none",d.fill="black",Wt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Ur(n,r,s,o).noFill();return Wt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.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 g=0;g<t.children.length;g++){const m=t.children[g];let u=m.getAttribute("offset");/%/gi.test(u)&&(u=parseFloat(u.replace(/%/gi,""))/100),u=parseFloat(u);let p=m.getAttribute("stop-color"),b=m.getAttribute("stop-opacity"),y=m.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),h.push(new Wn(u,p,b))}const f=new He(s,o,a,l,h);return f.spread=r,f.units=n,Wt.call(this,t,f,e),f},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));Z.isNaN(l)&&(l=s),Z.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 f=[];for(let m=0;m<t.children.length;m++){const u=t.children[m];let p=u.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=u.getAttribute("stop-color"),y=u.getAttribute("stop-opacity"),_=u.getAttribute("style"),v;b===null&&(v=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=v&&v.length>1?v[1]:void 0),y===null?(v=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=v&&v.length>1?parseFloat(v[1]):1):y=parseFloat(y),f.push(new Wn(p,b,y))}const g=new We(s,o,a,f,l,c);return g.spread=r,g.units=n,Wt.call(this,t,g,e),g},text:function(t,e){const n=Fm(t.getAttribute("text-anchor"))||"left",r=Am(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new un(s);return Wt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new $t("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Hr(r,s,o);return Z.isNaN(a)||(c.width=a),Z.isNaN(l)||(c.height=l),Wt.call(this,t,c,e),c}};function yc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var mo=class Sn extends qn{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),w(this,"_flagTexture",!1),w(this,"_flagMode",!1),w(this,"_texture",null),w(this,"_mode","fill"),this._renderer.type="image";for(let l in _c)Object.defineProperty(this,l,_c[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Sn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Sn.Properties.length;n++){const r=Sn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Sn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case Sn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Sn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Sn.Modes.crop:break;case Sn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case Sn.Modes.stretch:default:e.scale=new ee(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};w(mo,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),w(mo,"Properties",["texture","mode"]);var bc=mo,_c={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},po=[],yo=Math.max,Dm=Math.min,wc=Math.abs,Kr=Math.sin,Gr=Math.cos,Hm=Math.acos,Zr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Be?t:"path"},group:{renderChild:function(t){const e=Be.getRendererType(t._renderer.type);Be[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Qr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,t)}return o&&t.restore(),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,g,m,u,p,b,y,_,v,B,S,R,C,T,x,P,$,A,F,O,L,J,ne,N,V,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,L=this._mask,J=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||J||l===0))return this;if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,g=this._closed,m=this._renderer.vertices,u=m.length,p=u-1,ne=Qr(r),V=this.dashes,ne||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),L){const re=Be.getRendererType(L._renderer.type);Be[re].render.call(L,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Be.getRendererType(a._renderer.type);Be[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Be.getRendererType(s._renderer.type);Be[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this)),f&&(t.miterLimit=f),h&&(t.lineJoin=h),!g&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),V&&V.length>0&&(t.lineDashOffset=V.offset||0,t.setLineDash(V)),t.beginPath();let X,I,W,H,U,fe,oe;for(let re=0;re<u;re++)switch(_=m[re],F=_.x,O=_.y,_.command){case te.close:t.closePath();break;case te.arc:X=_.rx,I=_.ry,W=_.xAxisRotation,H=_.largeArcFlag,U=_.sweepFlag,b=g?Mt(re-1,u):yo(re-1,0),y=m[b],fe=y.x,oe=y.y,Be.renderSvgArcCommand(t,fe,oe,X,I,H,U,W,F,O);break;case te.curve:b=g?Mt(re-1,u):Math.max(re-1,0),y=m[b],x=y.controls&&y.controls.right||ee.zero,P=_.controls&&_.controls.left||ee.zero,y._relative?(C=x.x+y.x,T=x.y+y.y):(C=x.x,T=x.y),_._relative?(S=P.x+_.x,R=P.y+_.y):(S=P.x,R=P.y),t.bezierCurveTo(C,T,S,R,F,O),re>=p&&g&&(v=B,$=_.controls&&_.controls.right||ee.zero,A=v.controls&&v.controls.left||ee.zero,_._relative?(C=$.x+_.x,T=$.y+_.y):(C=$.x,T=$.y),v._relative?(S=A.x+v.x,R=A.y+v.y):(S=A.x,R=A.y),F=v.x,O=v.y,t.bezierCurveTo(C,T,S,R,F,O));break;case te.line:t.lineTo(F,O);break;case te.move:B=_,t.moveTo(F,O);break}return g&&t.closePath(),!J&&!n&&(Be.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),N&&t.restore()),Be.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),N&&t.restore())),ne||t.restore(),J&&!n&&t.clip(),V&&V.length>0&&t.setLineDash(po),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,g,m,u,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,p=Qr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const S=Be.getRendererType(a._renderer.type);Be[S].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const S=Be.getRendererType(s._renderer.type);Be[S].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let v=d*.5,B;this._sizeAttenuation||(B=this.worldMatrix.elements,B=oi(B[0],B[3],B[1],B[4],B[2],B[5]),v/=Math.max(B.scaleX,B.scaleY));for(let S=0;S<f;S++)g=h[S],m=g.x,u=g.y,t.moveTo(m+v,u),t.arc(m,u,v,0,ct);return n||(Be.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Be.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(po),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,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(!e&&(!o||l||s===0))return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,g=this._decoration,m=this._direction,u=Qr(c),p=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Be.alignments[this._alignment]||this._alignment,_=Be.baselines[this._baseline]||this._baseline;let v,B,S,R,C,T,x,P,$,A,F;if(u||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const O=Be.getRendererType(a._renderer.type);Be[O].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=m,f)if(typeof f=="string")t.fillStyle=f;else{const O=Be.getRendererType(f._renderer.type);Be[O].render.call(f,t,this),t.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const O=Be.getRendererType(d._renderer.type);Be[O].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=hn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Be.isHidden.test(f)||(f._renderer&&f._renderer.offset?(T=f._renderer.scale.x,x=f._renderer.scale.y,t.save(),t.translate(-f._renderer.offset.x,-f._renderer.offset.y),t.scale(T,x),v=this._size/f._renderer.scale.y,B=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,v+"px/",B+"px",this._family].join(" "),S=f._renderer.offset.x/f._renderer.scale.x,R=f._renderer.offset.y/f._renderer.scale.y,t.fillText(this.value,S,R),t.restore()):t.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,x=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,x),v=this._size/d._renderer.scale.y,B=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,v+"px/",B+"px",this._family].join(" "),S=d._renderer.offset.x/d._renderer.scale.x,R=d._renderer.offset.y/d._renderer.scale.y,C=h/d._renderer.scale.x,t.lineWidth=C,t.strokeText(this.value,S,R),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(g)){const O=t.measureText(this.value);let L=1;switch(g){case"underline":$=O.actualBoundingBoxDescent,F=O.actualBoundingBoxDescent;break;case"strikethrough":$=0,F=0,L=.5;break}switch(_){case"top":$+=this._size*L,F+=this._size*L;break;case"baseline":case"bottom":$-=this._size*L,F-=this._size*L;break}switch(y){case"left":case"start":P=0,A=O.width;break;case"right":case"end":P=-O.width,A=0;break;default:P=-O.width/2,A=O.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(P,$),t.lineTo(A,F),t.stroke()}return u||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(po),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof ee||(this._renderer.offset=new ee),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof ee?(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 ee||(this._renderer.scale=new ee),this._scale instanceof ee?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=wc(r),s=wc(s);const h=(e-c)/2,f=(n-d)/2,g=Gr(l)*h+Kr(l)*f,m=-Kr(l)*h+Gr(l)*f,u=g*g,p=m*m;let b=r*r,y=s*s;const _=u/b+p/y;if(_>1){const O=Zr(_);r=O*r,s=O*s,b=r*r,y=s*s}const v=b*p+y*u,B=(b*y-v)/v;let S=Zr(yo(0,B));o===a&&(S=-S);const R=S*r*m/s,C=-S*s*g/r,T=Gr(l)*R-Kr(l)*C+(e+c)/2,x=Kr(l)*R+Gr(l)*C+(n+d)/2,P=xc(1,0,(g-R)/r,(m-C)/s),$=xc((g-R)/r,(m-C)/s,(-g-R)/r,(-m-C)/s)%ct,A=P+$;Wm(t,T,x,r,s,P,A,a===0,l)}},ht=class extends Y{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new rt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Ys(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&Z.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Y.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};w(ht,"Utils",Be);function Wm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Vi.Tolerance.epsilon,f=Math.abs(d)<h;let g=Mt(d,ct);g<h&&(f?g=0:g=ct),l===!0&&!f&&(g===ct?g=-ct:g=g-ct);for(let m=0;m<vt.Resolution;m++){const u=m/(vt.Resolution-1),p=o+u*g;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),v=Math.sin(c),B=b-e,S=y-n;b=B*_-S*v+e,y=B*v+S*_+n}t.lineTo(b,y)}}function xc(t,e,n,r){const s=t*n+e*r,o=Zr(t*t+e*e)*Zr(n*n+r*r);let a=Hm(yo(-1,Dm(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Qr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ae={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(t,e){const n=t,r=document.createElementNS(ae.ns,n);return n==="svg"&&(e=Z.defaults(e||{},{version:ae.version})),e&&Object.keys(e).length>0&&ae.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(ae.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?Mt(a-1,n):Math.max(a-1,0),d=t[c];let h,f,g,m,u,p,b,y,_,v,B,S,R,C,T,x=Ae(l.x),P=Ae(l.y);switch(l.command){case te.close:h=te.close;break;case te.arc:B=l.rx,S=l.ry,R=l.xAxisRotation,C=l.largeArcFlag,T=l.sweepFlag,h=te.arc+" "+B+" "+S+" "+R+" "+C+" "+T+" "+x+" "+P;break;case te.curve:b=d.controls&&d.controls.right||ee.zero,y=l.controls&&l.controls.left||ee.zero,d.relative?(g=Ae(b.x+d.x),m=Ae(b.y+d.y)):(g=Ae(b.x),m=Ae(b.y)),l.relative?(u=Ae(y.x+l.x),p=Ae(y.y+l.y)):(u=Ae(y.x),p=Ae(y.y)),h=(a===0?te.move:te.curve)+" "+g+" "+m+" "+u+" "+p+" "+x+" "+P;break;case te.move:s=l,h=te.move+" "+x+" "+P;break;default:h=l.command+" "+x+" "+P}a>=r&&e&&(l.command===te.curve&&(f=s,_=l.controls&&l.controls.right||l,v=f.controls&&f.controls.left||f,l.relative?(g=Ae(_.x+l.x),m=Ae(_.y+l.y)):(g=Ae(_.x),m=Ae(_.y)),f.relative?(u=Ae(v.x+f.x),p=Ae(v.y+f.y)):(u=Ae(v.x),p=Ae(v.y)),x=Ae(f.x),P=Ae(f.y),h+=" C "+g+" "+m+" "+u+" "+p+" "+x+" "+P),l.command!==te.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=te.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=ae.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in ae?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.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})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=ae.getRendererType(t._renderer.type);ae[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ae.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=ae.getRendererType(s._renderer.type);ae[o].render.call(s,t)}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(ae.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(ae.group.removeChild,n),this._flagOrder&&this.children.forEach(ae.group.orderChild,n),this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),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),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=ae.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),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=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=oi(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=ae.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=ae.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ae.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),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=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),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(t,e){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||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?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.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?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||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?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.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?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||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 ee?(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 ee?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?ae.setAttributes(this._renderer.image,r):this._renderer.image=ae.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&ae.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=ae.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.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),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},vc=class extends Y{constructor(t){super(),this.domElement=t.domElement||ae.createElement("svg"),this.scene=new rt,this.scene.parent=this,this.defs=ae.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,ae.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Y.Types.resize,t,e)}render(){return ae.group.render.call(this.scene,this.domElement),ae.defs.update(this.domElement),this}};w(vc,"Utils",ae);var jt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new $t("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var Ir=function(){return Ir=Object.assign||function(e){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)&&(e[o]=n[o])}return e},Ir.apply(this,arguments)},Kf={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"}},Bn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},zs=500,Gf=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Ir(Ir({},Kf),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=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&&(e+='<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(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(Bn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,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();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):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}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||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;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=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 g=this.getPossibleSwipeDragCords(n),m,u,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),m=p/y,u=b/y}else{var y=(e-n)*n;m=p*y,u=b*y}r&&(f?this.isBeyondPossibleLeft(m,g.minX)?m=g.minX:this.isBeyondPossibleRight(m,g.maxX)&&(m=g.maxX):e>1&&(m<g.minX?m=g.minX:m>g.maxX&&(m=g.maxX)),h?this.isBeyondPossibleTop(u,g.minY)?u=g.minY:this.isBeyondPossibleBottom(u,g.maxY)&&(u=g.maxY):e>1&&(u<g.minY?u=g.minY:u>g.maxY&&(u=g.maxY))),this.setZoomStyles({x:m,y:u,scale:e}),this.left=m,this.top=u,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).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)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},zs),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.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")}},zs+50)},t.prototype.setZoomStyles=function(e){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=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),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},zs+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.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},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(Bn.containerResize+".zoom "+Bn.rotateRight+".zoom "+Bn.rotateLeft+".zoom "+Bn.flipHorizontal+".zoom "+Bn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(Bn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(Bn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(Bn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e: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()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=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=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var f=e.scale-o;e.zoomImage(e.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.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(),f={};f.x=this.left+a,f.y=this.top+l;var g=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,g.minY)?f.y=g.minY:this.isBeyondPossibleBottom(f.y,g.maxY)&&(f.y=g.maxY)),r&&(this.isBeyondPossibleLeft(f.x,g.minX)?f.x=g.minX:this.isBeyondPossibleRight(f.x,g.maxX)&&(f.x=g.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.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-e.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},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){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;e&&(o=o+e*o,a=a+e*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,f={minY:l,maxY:c,minX:d,maxX:h};return f},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(g){if(e.isImageSlide(e.core.index)&&(f=e.core.getSlideItem(e.core.index),(e.$LG(g.target).hasClass("lg-item")||f.get().contains(g.target))&&g.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){g.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);a=m.allowY,o=m.allowX,(o||a)&&(n=e.getSwipeCords(g)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(g){if(g.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(g.target).hasClass("lg-item")||f.get().contains(g.target))){g.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(g);var m=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(h,m))}}),this.core.$inner.on("touchend.lg",function(g){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(g.target).hasClass("lg-item")||f.get().contains(g.target))){if(g.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var m=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,m)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(g){if(e.isImageSlide(e.core.index)){var m=e.core.getSlideItem(e.core.index);if(e.$LG(g.target).hasClass("lg-item")||m.get().contains(g.target)){c=new Date,f=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var u=e.getDragAllowedAxises(0);l=u.allowY,a=u.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(g.target).hasClass("lg-object")&&(a||l)&&(g.preventDefault(),n=e.getDragCords(g),h=e.getPossibleSwipeDragCords(),s=!0,e.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(g){if(s){o=!0,r=e.getDragCords(g);var m=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(f,m)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(g){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(g);var m=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,m)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.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},t})();const Zf={ref:"gallery-container",class:"lightgallery-wrapper"},Qf={},Za=i.defineComponent({...Qf,__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(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.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,{...e.settings}),M.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",Zf,[i.renderSlot(o.$slots,"default")],512))}}),ot=class ot{static init(){ot.isInitialized||(ot.isInitialized=!0,ot.windowResizeHandler(),window.addEventListener("resize",ot.windowResizeHandler))}static destroy(){window.removeEventListener("resize",ot.windowResizeHandler),ot.isInitialized=!1}static getDeviceTypeByResolution(){const e=Q.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ye.phone:window.innerWidth<e.laptop?Ye.tablet:Ye.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return ot.setRefValueDependingOnDeviceResolution(s,e,n,r),ot.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return ot.getDeviceTypeByResolution()===Ye.phone}static isTabletDevice(){return ot.getDeviceTypeByResolution()===Ye.tablet}static isLaptopDevice(){return ot.getDeviceTypeByResolution()===Ye.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(ot.getDeviceTypeByResolution()){case Ye.phone:e.value=n;break;case Ye.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){M.forEach(ot.refsDependingOnDeviceResolution,e=>{ot.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};k(ot,"isInitialized",!1),k(ot,"refsDependingOnDeviceResolution",[]);let wt=ot;const Jf=["href"],eg=["src","alt"],tg={},Qa=i.defineComponent({...tg,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Uf,Gf],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===Ye.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=Ga,g=z.NPopover;return i.openBlock(),i.createBlock(g,{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]=m=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(Za,{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(t.images,(m,u)=>(i.openBlock(),i.createElementBlock("a",{key:u,href:m.image},[i.createElementVNode("img",{src:m.preview,alt:`Изображение #${u+1}`},null,8,eg)],8,Jf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),ng={class:"flex flex-col text-sm"},ig={},rg=i.defineComponent({...ig,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Os,s=z.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",ng,[(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})}}}),sg={class:"flex flex-row justify-between"},og={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},ag={key:0},lg={class:"ml-2 align-sub"},cg={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},dg={class:"@container"},hg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ug={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},fg={class:"text-sc-dark-grey"},gg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},mg={class:"text-gray-600"},pg={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},yg={key:3,class:"underline decoration-dashed"},bg={key:4,class:"sc-product-pack whitespace-nowrap"},_g={class:"text-gray-600"},wg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},xg={class:"text-gray-600"},vg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},kg={key:0},Cg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Sg={},or=i.defineComponent({...Sg,__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},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>M.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 e({showProductImagesPreview:l}),(h,f)=>{var S,B,R,C,T;const g=Xf,m=z.NTooltip,u=Ua,p=Ga,b=z.NText,y=Ka,_=Os,w=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",sg,[i.createVNode(b,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var v,P;return[i.createElementVNode("div",og,[((v=t.product)==null?void 0:v.isFavorite)??!1?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((P=t.product)==null?void 0:P.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(m,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",ag," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",lg,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(Qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",cg,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||(((S=t.productContextButtonsConfig)==null?void 0:S.length)??0)>0?(i.openBlock(),i.createBlock(y,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",dg,[i.createElementVNode("div",hg,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ug,[f[2]||(f[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",fg,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",gg,[f[3]||(f[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",mg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(rg,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",pg,[f[4]||(f[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(_,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",yg," Нет в наличии ")),(R=(B=t.product)==null?void 0:B.properties)!=null&&R.pack?(i.openBlock(),i.createElementBlock("span",bg,[f[5]||(f[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",_g,i.toDisplayString((T=(C=t.product)==null?void 0:C.properties)==null?void 0:T.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",wg,[f[6]||(f[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",xg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(w,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",vg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,v=>(i.openBlock(),i.createBlock(Mr,{key:v.coefficient.slug,product:t.product,"cost-field-name":v.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(Mr,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",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-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",kg,[i.createElementVNode("ul",Cg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(v,P)=>(i.openBlock(),i.createElementBlock("li",{key:P}," ("+i.toDisplayString(P)+"): "+i.toDisplayString(v),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(v,P)=>(i.openBlock(),i.createElementBlock("li",{key:P}," ("+i.toDisplayString(P)+"): "+i.toDisplayString(v),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Bg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Mr,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Tg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),wt.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(or,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(or,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(M.forEach(t,s=>{M.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),s=>{n.push(Bg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Mr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ka,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},Rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pg(t,e){return i.openBlock(),i.createElementBlock("svg",Rg,[...e[0]||(e[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 Ja=i.markRaw({name:"ion-trash",render:Pg}),$g={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Eg(t,e){return i.openBlock(),i.createElementBlock("svg",$g,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const el=i.markRaw({name:"ion-plus",render:Eg}),Ng={key:0,class:"flex w-fit items-center gap-2"},Fg={key:1,class:"flex flex-wrap gap-1"},Ag={key:0},Mg={key:2},Vg={},ar=i.defineComponent({...Vg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=z.NSpin,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Ng,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",Fg,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Ag,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Mg,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),he={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},Ze={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Ig={class:"flex flex-col gap-4"},Og={class:"flex flex-col gap-2"},zg={class:"mt-8 font-bold"},Lg={class:"grid grow grid-cols-2 items-start gap-2"},Dg={class:"text-sm"},Hg={key:0,class:"text-red-500"},Wg={key:2,class:"text-red-500 text-sm mb-2"},jg={class:"flex flex-col gap-4"},qg={key:1},Xg={class:"text-lg font-semibold"},Yg={class:"flex gap-3"},Ug={},tl=i.defineComponent({...Ug,__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","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var b;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,w,S;const y={"configuratorParams.length":[he.required,he.min(r.settings.stripMinLength),he.max(r.settings.stripMaxLength||Number.MAX_VALUE),he.step(r.settings.lengthStep),Ze.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[he.required,he.min(1),he.step(1),Ze.serverValidation((w=r.validation.quantity)==null?void 0:w.feedback)],marker:[Ze.serverValidation((S=r.validation.marker)==null?void 0:S.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(B,R)=>{var v;const T=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${R}`]=[he.required,he.min(T),he.max(r.settings.maxLineWidth),he.step(r.settings.lineWidthStep),Ze.serverValidation((v=r.validation[`lines_widths[${R+1}]`])==null?void 0:v.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(B,R)=>{var C;y[`configuratorParams.linesAngles.${R}`]=[he.required,he.min(r.settings.minLineAngle),he.max(r.settings.maxLineAngle),he.step(r.settings.lineAngleStep),Ze.serverValidation((C=r.validation[`lines_angles[${R+1}]`])==null?void 0:C.feedback)]}),y}),d=i.ref(r.settings.canSetDopProdaga??!1),h=i.computed(()=>{var B;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,w=((B=l.value.product)==null?void 0:B.costRub)||0;if(!y||!_||w===0)return null;const S=y/1e3;return(w*_*S).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),f=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),g=i.computed(()=>{const y=f.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),m=i.computed(()=>{const{configuratorParams:y}=l.value,_=M.every(y.linesWidths,R=>!!(R&&R>0)),w=M.every(y.linesAngles,R=>!M.isNil(R)),S=!!(l.value.quantity&&l.value.quantity>0),B=y.length>0&&y.length>0;return _&&w&&S&&B&&g.value}),u=()=>{i.nextTick(()=>{var y;(y=o.value)==null||y.validate(_=>{_||(s("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(y,_)=>{const w=new Q.CartItemBase(l.value);w[y]=_,y==="configuratorParams"&&(w.product=new Q.Product),s("update:value",w)};return i.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),i.watch(()=>r.value,y=>{l.value=M.cloneDeep(y)},{deep:!0}),e({validate:(b=o.value)==null?void 0:b.validate,formReference:o}),(y,_)=>{const w=el,S=Ja,B=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"grid gap-2 md:grid-cols-2 md:gap-6",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[i.createElementVNode("div",Ig,[_[22]||(_[22]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=C=>l.value.configuratorParams.startTailType=C),u],options:t.settings.startTailConfigs.map(({label:C},T)=>({label:C,value:T})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Og,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(C,T)=>(i.openBlock(),i.createElementBlock("div",{key:T,class:"flex items-start gap-2"},[i.createElementVNode("div",zg,i.toDisplayString(T+1),1),i.createElementVNode("div",Lg,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${T}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[T],"onUpdate:value":[v=>l.value.configuratorParams.linesWidths[T]=v,_[2]||(_[2]=v=>u())],parse:i.unref(Gt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=v=>i.unref(_t)(v)),onInput:v=>i.unref(Ke)(t.validation,`lines_widths[${T+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${T}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[T],"onUpdate:value":[v=>l.value.configuratorParams.linesAngles[T]=v,_[4]||(_[4]=v=>u())],parse:i.unref(Gt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=v=>i.unref(_t)(v,!0)),onInput:v=>i.unref(Ke)(t.validation,`lines_angles[${T+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:v=>s("click:add-line",T)},{default:i.withCtx(()=>[i.createVNode(w)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:v=>s("click:remove-line",T)},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=C=>l.value.configuratorParams.endTailType=C),u],options:t.settings.endTailConfigs.map(({label:C},T)=>({label:C,value:T})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ar,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Dg,[g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Hg," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(f.value)+" мм. ",1))]),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Wg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((R=t.settings.allTemplates)==null?void 0:R.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=C=>s("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",jg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=C=>l.value.configuratorParams.colorSide=C),u],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=C=>l.value.configuratorParams.length=C),_[11]||(_[11]=C=>u())],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=C=>i.unref(_t)(C)),onInput:_[10]||(_[10]=C=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=C=>l.value.quantity=C),_[15]||(_[15]=C=>p("quantity",C??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=C=>i.unref(_t)(C,!1)),onInput:_[14]||(_[14]=C=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=C=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=C=>{l.value.marker=C??null,p("marker",C??null)})},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createBlock(B,{key:0,checked:l.value.dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=C=>{l.value.dopProdaga=C??!1,p("dopProdaga",C??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createElementBlock("div",qg,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Xg,i.toDisplayString(h.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Yg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=C=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}});var nl=Object.defineProperty,Kg=Object.defineProperties,Gg=Object.getOwnPropertyDescriptors,il=Object.getOwnPropertySymbols,Zg=Object.prototype.hasOwnProperty,Qg=Object.prototype.propertyIsEnumerable,rl=t=>{throw TypeError(t)},Ls=(t,e,n)=>e in t?nl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ds=(t,e)=>{for(var n in e||(e={}))Zg.call(e,n)&&Ls(t,n,e[n]);if(il)for(var n of il(e))Qg.call(e,n)&&Ls(t,n,e[n]);return t},Hs=(t,e)=>Kg(t,Gg(e)),sl=(t,e)=>{for(var n in e)nl(t,n,{get:e[n],enumerable:!0})},x=(t,e,n)=>Ls(t,typeof e!="symbol"?e+"":e,n),ol=(t,e,n)=>e.has(t)||rl("Cannot "+n),Pt=(t,e,n)=>(ol(t,e,"read from private field"),n?n.call(t):e.get(t)),al=(t,e,n)=>e.has(t)?rl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Jg=(t,e,n,r)=>(ol(t,e,"write to private field"),e.set(t,n),n),xt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return xt.shim(t),typeof e<"u"&&(xt.Image=e),xt.isHeadless=!0,t}},ll={};sl(ll,{Curve:()=>Vi,getAnchorsFromArcData:()=>nm,getComponentOnCubicBezier:()=>lr,getControlPoints:()=>_l,getCurveBoundingBox:()=>pl,getCurveFromPoints:()=>bl,getCurveLength:()=>ml,getReflection:()=>Xs,integrate:()=>yl,subdivide:()=>qs});var cl={};sl(cl,{HALF_PI:()=>Je,NumArray:()=>dn,TWO_PI:()=>ct,decomposeMatrix:()=>oi,getComputedMatrix:()=>Ws,getEffectiveStrokeWidth:()=>hn,getPoT:()=>ul,lerp:()=>At,mod:()=>Mt,setMatrix:()=>hl,toFixed:()=>Ae});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var dl,ct=Math.PI*2,Je=Math.PI*.5;function oi(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function hl(t){dl=t}function Ws(t,e){e=e&&e.identity()||new dl;let n=t;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;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function At(t,e,n){return n*(e-t)+t}var js=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function ul(t){let e=0;for(;js[e]&&js[e]<t;)e++;return js[e]}function Mt(t,e){for(;t<0;)t+=e;return t%e}var dn=De.Float32Array||Array,em=Math.floor;function Ae(t){return em(t*1e6)/1e6}function hn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Ws(t));const r=oi(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var te={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Y=class{constructor(){x(this,"_events",{}),x(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];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[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];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(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};x(Y,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(Y,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var fl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Y.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Y.Types.change))}}},Zt=class nr extends Y{constructor(e=0,n=0){super(),x(this,"_x",0),x(this,"_y",0);for(let r in fl)Object.defineProperty(this,r,fl[r]);this.x=e,this.y=n}static add(e,n){return new nr(e.x+n.x,e.y+n.y)}static sub(e,n){return new nr(e.x-n.x,e.y-n.y)}static subtract(e,n){return nr.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(nr.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,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 nr(this.x,this.y)}add(e,n){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+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){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-=n),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,n){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*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){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/=n),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 n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ae(this.x),y:Ae(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};x(Zt,"zero",new Zt),x(Zt,"left",new Zt(-1,0)),x(Zt,"right",new Zt(1,0)),x(Zt,"up",new Zt(0,-1)),x(Zt,"down",new Zt(0,1));var ee=Zt,ke=class Vs extends ee{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=te.move){super(e,n),x(this,"controls",{left:new ee,right:new ee}),x(this,"_command",te.move),x(this,"_relative",!0),x(this,"_rx",0),x(this,"_ry",0),x(this,"_xAxisRotation",0),x(this,"_largeArcFlag",0),x(this,"_sweepFlag",1);for(let d in gl)Object.defineProperty(this,d,gl[d]);this.command=l,this.relative=!0;const c=Vs.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(Y.Types.change,c),this.controls.right.set(o,a).addEventListener(Y.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Y.Types.change)}}static fromObject(e){return new Vs().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Vs().copy(this)}toObject(){return{x:Ae(this.x),y:Ae(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ae(this.rx),ry:Ae(this.ry),xAxisRotation:Ae(this.xAxisRotation),largeArcFlag:Ae(this.largeArcFlag),sweepFlag:Ae(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},gl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Y.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Y.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Y.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Y.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Y.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Y.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Y.Types.change))}}},tm=0,vt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return tm++}},Vi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function lr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function qs(t,e,n,r,s,o,a,l,c){c=c||Vi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ke(a,l)];const h=[];for(let f=0;f<d;f++){const g=f/d,m=lr(g,t,n,s,a),u=lr(g,e,r,o,l);h.push(new ke(m,u))}return h}function ml(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),g=9*(r-o)+3*(l-e),m=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(g*b+m)*b+u;return Math.sqrt(y*y+_*_)}return yl(p,0,1,c||Vi.RecursionLimit)}function pl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,g,m,u,p,b,y;for(let B=0;B<2;++B){if(B===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,g=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,g=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;m=-g/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*g*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,w=_,S;for(;_--;)m=c[_],S=1-m,d[0][_]=S*S*S*t+3*S*S*m*n+3*S*m*m*s+m*m*m*a,d[1][_]=S*S*S*e+3*S*S*m*r+3*S*m*m*o+m*m*m*l;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=l,d[0].length=d[1].length=w+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 yl(t,e,n,r){let s=Vi.abscissas[r-2],o=Vi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function bl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Mt(s-1,n):Math.max(s-1,0),l=e?Mt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];_l(c,d,h),d.command=s===0?te.move:te.curve}}function _l(t,e,n){const r=ee.angleBetween(t,e),s=ee.angleBetween(n,e);let o=ee.distanceBetween(t,e),a=ee.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Xs(t,e,n){return new ee(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function nm(t,e,n,r,s,o,a){const l=vt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),g=r*Math.sin(h),m=new ke(f,g);m.command=te.line}}var wl=Array.prototype.slice;function im(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var Z={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!im(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:De.performance&&De.performance.now?De.performance:Date},Vt={hasEventListeners:typeof De.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Vt},unbind:function(t,e,n,r){return Vt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Vt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=De[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=De.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ii=De.document?De.document.createElement("div"):{};Ii.id="help-two-load",Object.defineProperty(Vt,"temp",{enumerable:!0,get:function(){return Z.isElement(Ii)&&!De.document.head.contains(Ii)&&(Ii.style.display="none",De.document.head.appendChild(Ii)),Ii}});var $t=class extends Error{constructor(e){super(),x(this,"name","Two.js"),x(this,"message"),this.message=e}},rm=De.devicePixelRatio||1;function sm(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Ys(t){return rm/sm(t)}var Or=class{constructor(){x(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},dt,Hn=class extends Array{constructor(){super(),al(this,dt,new Y),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 Pt(this,dt)}set _events(e){Jg(this,dt,e)}get _bound(){return Pt(this,dt)._bound}set _bound(e){Pt(this,dt)._bound=e}addEventListener(){return Pt(this,dt).addEventListener.apply(this,arguments)}on(){return Pt(this,dt).on.apply(this,arguments)}bind(){return Pt(this,dt).bind.apply(this,arguments)}removeEventListener(){return Pt(this,dt).removeEventListener.apply(this,arguments)}off(){return Pt(this,dt).off.apply(this,arguments)}unbind(){return Pt(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return Pt(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return Pt(this,dt).trigger.apply(this,arguments)}listen(){return Pt(this,dt).listen.apply(this,arguments)}ignore(){return Pt(this,dt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Y.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Y.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Y.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Y.Types.insert,n),this.trigger(Y.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(Y.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Y.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};dt=new WeakMap;var xl=class Du extends Y{constructor(){super(),x(this,"_flagId",!1),x(this,"_flagClassName",!1),x(this,"_renderer",{}),x(this,"_id",vt.Identifier+vt.uniqueId()),x(this,"_className",""),x(this,"classList",[]);for(let e in vl)Object.defineProperty(this,e,vl[e])}static fromObject(e){const n=new Du().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};x(xl,"Properties",["renderer","id","className"]);var Oi=xl,vl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},zr,kl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(zr=document.createElement("a"));var Qt=class Lt extends Oi{constructor(e,n){super(),x(this,"_flagSrc",!1),x(this,"_flagImage",!1),x(this,"_flagVideo",!1),x(this,"_flagLoaded",!1),x(this,"_flagRepeat",!1),x(this,"_flagOffset",!1),x(this,"_flagScale",!1),x(this,"_src",""),x(this,"_image",null),x(this,"_loaded",!1),x(this,"_repeat","no-repeat"),x(this,"_scale",1),x(this,"_offset",null);for(let r in Cl)Object.defineProperty(this,r,Cl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=om.bind(this),this._renderer.flagScale=am.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new ee,typeof n=="function"){const r=(function(){this.unbind(Y.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Y.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Lt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return zr?(zr.href=e,zr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Lt.getAbsoluteURL(e);if(Lt.ImageRegistry.contains(n))return Lt.ImageRegistry.get(n);let r;return xt.Image?(r=new xt.Image,xt.shim(r,"img")):De.document?kl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=Lt.getTag(r);e._flagImage&&(/canvas/i.test(s)?Lt.Register.canvas(e,n):(e._src=!xt.isHeadless&&r.getAttribute("two-src")||r.src,Lt.Register[s](e,n))),e._flagSrc&&(r||(r=Lt.getImage(e.src),e.image=r),s=Lt.getTag(r),Lt.Register[s](e,n))}clone(){const e=new Lt(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 ee?e.offset:new ee().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof ee?e.scale:new ee().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(Y.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Lt.load(this,(function(){this.loaded=!0,this.trigger(Y.Types.change).trigger(Y.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(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(Qt,"Properties",["src","loaded","repeat","scale","offset","image"]),x(Qt,"RegularExpressions",kl),x(Qt,"ImageRegistry",new Or),x(Qt,"Register",{canvas:function(t,e){t._src="#"+t.id,Qt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!xt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!xt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new $t("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!xt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Qt.getAbsoluteURL(t._src),!(!xt.isHeadless&&n&&n.getAttribute("two-src"))&&(xt.isHeadless||n.setAttribute("two-src",t.src),Qt.ImageRegistry.add(t.src,n),xt.isHeadless?Qt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(xt.isHeadless)throw new $t("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new $t("unable to load "+t.src)};t._src=Qt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Qt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Me=Qt,Cl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Me.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Me.ImageRegistry.contains(n)?this._image=Me.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Y.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Y.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ee&&this._scale.unbind(Y.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof ee&&this._scale.bind(Y.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function om(){this._flagOffset=!0}function am(){this._flagScale=!0}var Us=class cn extends Oi{constructor(e,n,r){super(),x(this,"_flagOffset",!0),x(this,"_flagOpacity",!0),x(this,"_flagColor",!0),x(this,"_offset",0),x(this,"_opacity",1),x(this,"_color","#fff");for(let s in Sl)Object.defineProperty(this,s,Sl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:cn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:cn.Index<=0?"#fff":"#000",cn.Index=(cn.Index+1)%2}static fromObject(e){const n=new cn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<cn.Properties.length;n++){const r=cn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new cn;return Z.each(cn.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",Z.each(cn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Us,"Index",0),x(Us,"Properties",["offset","opacity","color"]);var Wn=Us,Sl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Ks=class Ri extends Oi{constructor(e){super(),x(this,"_flagStops",!1),x(this,"_flagSpread",!1),x(this,"_flagUnits",!1),x(this,"_spread",""),x(this,"_units","");for(let n in Bl)Object.defineProperty(this,n,Bl[n]);this._renderer.type="gradient",this._renderer.flagStops=lm.bind(this),this._renderer.bindStops=cm.bind(this),this._renderer.unbindStops=dm.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Wn?s:new Wn().copy(s)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Ri(n);return Z.each(Ri.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return Z.each(Ri.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Y.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}};x(Ks,"Stop",Wn),x(Ks,"Properties",["spread","stops","units"]);var et=Ks,Bl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),this._stops=new Hn((t||[]).slice(0)),this._stops.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._stops)}}};function lm(){this._flagStops=!0}function cm(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function dm(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Gs=class $r extends et{constructor(e,n,r,s,o){super(o),x(this,"_flagEndPoints",!1),x(this,"_left",null),x(this,"_right",null);for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=hm.bind(this),this.left=new ee,this.right=new ee,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new $r().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$r.Properties.length;n++){const r=$r.Properties[n];r in e&&(this[r]=e[r]instanceof ee?e[r]:new ee().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new $r(this.left._x,this.left._y,this.right._x,this.right._y,n);return Z.each(et.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}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(Y.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(Gs,"Stop",Wn),x(Gs,"Properties",["left","right"]);var He=Gs,Tl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof ee&&this._left.unbind(Y.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof ee&&this._right.unbind(Y.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function hm(){this._flagEndPoints=!0}var Zs=class Pi extends et{constructor(e,n,r,s,o,a){super(s),x(this,"_flagRadius",!1),x(this,"_flagCenter",!1),x(this,"_flagFocal",!1),x(this,"_radius",0),x(this,"_center",null),x(this,"_focal",null);for(let l in Rl)Object.defineProperty(this,l,Rl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=um.bind(this),this._renderer.flagFocal=fm.bind(this),this.center=new ee,this.radius=typeof r=="number"?r:1,this.focal=new ee,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof ee?e[r]:new ee().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Pi(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return Z.each(et.Properties.concat(Pi.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return Z.each(Pi.Properties,function(n){e[n]=this[n]},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(Y.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(Zs,"Stop",Wn),x(Zs,"Properties",["center","radius","focal"]);var We=Zs,Rl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Y.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Y.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Y.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Y.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function um(){this._flagCenter=!0}function fm(){this._flagFocal=!0}function Pl(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Lr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function $l(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),ml(r,l,s,c,o,d,a,h,n)}function El(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),qs(r,l,s,c,o,d,a,h,n)}function ai(t){switch(t.renderer.type){case"texture":return Me.fromObject(t);case"gradient":return et.fromObject(t);case"linear-gradient":return He.fromObject(t);case"radial-gradient":return We.fromObject(t)}return t}var gm=Math.cos,mm=Math.sin,Nl=Math.tan,Qs=[],Fl=class Dt extends Y{constructor(e,n,r,s,o,a){super(),x(this,"elements",new dn(9)),x(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const R=e;let C,T,v;const P=n[0]||0,$=n[1]||0,A=n[2]||0;return C=R[0]*P+R[1]*$+R[2]*A,T=R[3]*P+R[4]*$+R[5]*A,v=R[6]*P+R[7]*$+R[8]*A,[C,T,v]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],f=e[7],g=e[8],m=n[0],u=n[1],p=n[2],b=n[3],y=n[4],_=n[5],w=n[6],S=n[7],B=n[8];return r=r||new dn(9),r[0]=s*m+o*b+a*w,r[1]=s*u+o*y+a*S,r[2]=s*p+o*_+a*B,r[3]=l*m+c*b+d*w,r[4]=l*u+c*y+d*S,r[5]=l*p+c*_+d*B,r[6]=h*m+f*b+g*w,r[7]=h*u+f*y+g*S,r[8]=h*p+f*_+g*B,r}static fromObject(e){return new Dt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(Y.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(Y.Types.change)}identity(){return this.elements[0]=Dt.Identity[0],this.elements[1]=Dt.Identity[1],this.elements[2]=Dt.Identity[2],this.elements[3]=Dt.Identity[3],this.elements[4]=Dt.Identity[4],this.elements[5]=Dt.Identity[5],this.elements[6]=Dt.Identity[6],this.elements[7]=Dt.Identity[7],this.elements[8]=Dt.Identity[8],this.trigger(Y.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"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(Y.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const O=o[0]*e+o[1]*n+o[2]*r,L=o[3]*e+o[4]*n+o[5]*r,J=o[6]*e+o[7]*n+o[8]*r;return[O,L,J]}const h=this.elements,f=[e,n,r,s,o,a,l,c,d],g=h[0],m=h[1],u=h[2],p=h[3],b=h[4],y=h[5],_=h[6],w=h[7],S=h[8],B=f[0],R=f[1],C=f[2],T=f[3],v=f[4],P=f[5],$=f[6],A=f[7],F=f[8];return this.elements[0]=g*B+m*T+u*$,this.elements[1]=g*R+m*v+u*A,this.elements[2]=g*C+m*P+u*F,this.elements[3]=p*B+b*T+y*$,this.elements[4]=p*R+b*v+y*A,this.elements[5]=p*C+b*P+y*F,this.elements[6]=_*B+w*T+S*$,this.elements[7]=_*R+w*v+S*A,this.elements[8]=_*C+w*P+S*F,this.trigger(Y.Types.change)}inverse(e){const n=this.elements;e=e||new Dt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],f=n[8],g=f*l-c*h,m=-f*a+c*d,u=h*a-l*d;let p=r*g+s*m+o*u;return p?(p=1/p,e.elements[0]=g*p,e.elements[1]=(-f*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=m*p,e.elements[4]=(f*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=u*p,e.elements[7]=(-h*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=gm(e),r=mm(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Nl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Nl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Qs.length=0,this.toTransformArray(e,Qs),Qs.map(Ae).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],g=r[7],m=r[8];if(s){n[0]=o,n[1]=c,n[2]=f,n[3]=a,n[4]=d,n[5]=g,n[6]=l,n[7]=h,n[8]=m;return}return[o,c,f,a,d,g,l,h,m]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],g=r[7],m=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=f,n[7]=g,n[8]=m;return}return[o,a,l,c,d,h,f,g,m]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Dt().copy(this)}};x(Fl,"Identity",[1,0,0,0,1,0,0,0,1]);var zi=Fl;hl(zi);var Al=class Da extends Oi{constructor(){super(),x(this,"_flagMatrix",!0),x(this,"_flagScale",!1),x(this,"_matrix",null),x(this,"_worldMatrix",null),x(this,"_position",null),x(this,"_rotation",0),x(this,"_scale",1),x(this,"_skewX",0),x(this,"_skewY",0);for(let e in Dr)Object.defineProperty(this,e,Dr[e]);this._renderer.flagMatrix=Ml.bind(this),this.isShape=!0,this.matrix=new zi,this.worldMatrix=new zi,this.position=new ee,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Da().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Dr.position.get.apply(this,arguments)}set translation(e){Dr.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 ee?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 ee?e.scale:new ee(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 n=new Da;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._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 ee?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 ee?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}};x(Al,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var jn=Al,Dr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Y.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Y.Types.change,this._renderer.flagMatrix),Ml.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ee&&this._scale.unbind(Y.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof ee&&this._scale.bind(Y.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Ws(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Ml(){this._flagMatrix=!0}var Li=Math.min,Di=Math.max,pm=Math.ceil,ym=Math.floor,bm=new ee,Js=class ti extends jn{constructor(e,n,r,s){super(),x(this,"_flagVertices",!0),x(this,"_flagLength",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagCap",!0),x(this,"_flagJoin",!0),x(this,"_flagMiter",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_flagMask",!1),x(this,"_flagClip",!1),x(this,"_length",0),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_cap","round"),x(this,"_join","round"),x(this,"_miter",4),x(this,"_closed",!0),x(this,"_curved",!1),x(this,"_automatic",!0),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_mask",null),x(this,"_clip",!1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0);for(let o in Vl)Object.defineProperty(this,o,Vl[o]);this._renderer.type="path",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,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=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ai(e.fill),r=typeof e.stroke=="string"?e.stroke:ai(e.stroke),s=new ti().copy(Hs(Ds({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}}for(let n=0;n<ti.Properties.length;n++){const r=ti.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ti;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ti.Properties.length;r++){const s=ti.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),Z.each(ti.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];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())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,h=1/0,f=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:m}=oi(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof g=="number"&&typeof m=="number"&&(r=Math.max(g,m)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[g,m]=n.multiply(a.x,a.y),[u,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,w]=n.multiply(b,y),S=l.controls.left.x,B=l.controls.left.y;l.relative&&(S+=l.x,B+=l.y);let[R,C]=n.multiply(S,B);const T=pl(g,m,_,w,R,C,u,p);h=Li(T.min.y-r,h),c=Li(T.min.x-r,c),d=Di(T.max.x+r,d),f=Di(T.max.y+r,f)}else o<=1&&(h=Li(m-r,h),c=Li(g-r,c),d=Di(g+r,d),f=Di(m+r,f)),h=Li(p-r,h),c=Li(u-r,c),d=Di(u+r,d),f=Di(p+r,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,f,g,m,u,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const w=this.vertices.length,S=w-1;let B=null,R=null;for(let ne=0,N=this._lengths.length,V=0;ne<N;ne++){if(V+this._lengths[ne]>=_){this._closed?(r=Mt(ne,w),s=Mt(ne-1,w),ne===0&&(r=s,s=ne)):(r=ne,s=Math.min(Math.max(ne-1,0),S)),B=this.vertices[r],R=this.vertices[s],_-=V,this._lengths[ne]!==0?e=_/this._lengths[ne]:e=0;break}V+=this._lengths[ne]}if(B===null||R===null)return null;if(B){if(!R)return B}else return R;y=R.controls&&R.controls.right,b=B.controls&&B.controls.left,l=R.x,g=R.y,c=(y||R).x,m=(y||R).y,d=(b||B).x,u=(b||B).y,h=B.x,p=B.y,y&&R.relative&&(c+=R.x,m+=R.y),b&&B.relative&&(d+=B.x,u+=B.y),a=lr(e,l,c,d,h),f=lr(e,g,m,u,p);const C=At(l,c,e),T=At(g,m,e),v=At(c,d,e),P=At(m,u,e),$=At(d,h,e),A=At(u,p,e),F=At(C,v,e),O=At(T,P,e),L=At(v,$,e),J=At(P,A,e);return Z.isObject(n)?(n.x=a,n.y=f,n instanceof ke&&(n.controls.left.x=F,n.controls.left.y=O,n.controls.right.x=L,n.controls.right.y=J,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=f,n.controls.right.x-=a,n.controls.right.y-=f)),n.t=e,n):(o=new ke(a,f,F-a,O-f,L-a,J-f,this._curved?te.curve:te.line),o.t=e,o)}plot(){if(this.curved)return bl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?te.move:te.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===te.close;let s=this.vertices[n],o=[],a;return Z.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===te.move){o.push(new ke(s.x,s.y)),c>0&&(o[o.length-1].command=te.line),s=l;return}a=El(l,s,e),o=o.concat(a),Z.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=El(l,s,e),o=o.concat(a),Z.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line})),o.push(new ke(l.x,l.y)),o[o.length-1].command=r?te.close:te.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),Z.each(this.vertices,function(l,c){if(c<=0||l.command===te.move){o=l,this._lengths[c]=0;return}this._lengths[c]=$l(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Lr(this,r*this._length),a=Lr(this,s*this._length),l=pm(o),c=ym(a);let d,h,f,g,m,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ke),u>c&&!h?(m=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(s,m),m.command=this._renderer.collection[u].command,this._renderer.vertices.push(m),h=m,f=this._collection[u-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(ee.zero,1-m.t):this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):u>=l&&u<=c&&(m=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(m),u===c&&Pl(this,s)?(h=m,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):u===l&&Pl(this,r)&&(d=m,d.command=te.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(u=l-1,m=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,m),m.command=te.move,this._renderer.vertices.unshift(m),g=this._collection[u+1],g&&g.controls&&(m.controls.left.clear(),g.relative?this._renderer.collection[u+1].controls.left.copy(g.controls.left).lerp(ee.zero,m.t):(bm.copy(g),this._renderer.collection[u+1].controls.left.copy(g.controls.left).lerp(g,m.t))))}return jn.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=this._flagStrokeAttenuation=!1,jn.prototype.flagReset.call(this),this}};x(Js,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(Js,"Utils",{getCurveLength:$l});var Ce=Js,Vl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(Y.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(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Z.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),t instanceof Hn?this._collection=t:this._collection=new Hn(t||[]),this._collection.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Z.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Il(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Ol(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function zl(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Ll(){this._flagFill=!0}function Dl(){this._flagStroke=!0}var Hl=class Er extends Ce{constructor(e,n,r,s){const o=[new ke,new ke,new ke,new ke];super(o,!0,!1,!0),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_width",0),x(this,"_height",0),x(this,"_origin",null),this._renderer.type="rectangle";for(let a in Wl)Object.defineProperty(this,a,Wl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new ee,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Er().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Er.Properties.length;n++){const r=Er.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof ee&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ke),this.vertices[0].set(-e,-n).sub(this._origin).command=te.move,this.vertices[1].set(e,-n).sub(this._origin).command=te.line,this.vertices[2].set(e,n).sub(this._origin).command=te.line,this.vertices[3].set(-e,n).sub(this._origin).command=te.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=te.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Er(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]instanceof ee?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}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}};x(Hl,"Properties",["width","height","origin"]);var qn=Hl,Wl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Y.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Y.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},jl=class Nr extends qn{constructor(e,n,r,s,o,a){super(n,r,0,0),x(this,"_flagTexture",!1),x(this,"_flagColumns",!1),x(this,"_flagRows",!1),x(this,"_flagFrameRate",!1),x(this,"_flagIndex",!1),x(this,"_amount",1),x(this,"_duration",0),x(this,"_startTime",0),x(this,"_playing",!1),x(this,"_firstFrame",0),x(this,"_lastFrame",0),x(this,"_loop",!0),x(this,"_texture",null),x(this,"_columns",1),x(this,"_rows",1),x(this,"_frameRate",0),x(this,"_index",0),x(this,"_origin",null),this._renderer.type="sprite";for(let l in ql)Object.defineProperty(this,l,ql[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),this.origin=new ee,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Nr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Nr.Properties.length;n++){const r=Nr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Z.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r: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 n=new Nr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",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}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,h,f,g;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)){h=e.image.width,f=e.image.height,s=h/n,o=f/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(Z.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=Z.performance.now()-this._startTime,g=this._lastFrame+1,c=1e3*(g-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=At(this._firstFrame,g,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%n,u=Math.floor(this._index/n),p=-s*m+(h-s)/2,b=-o*u+(f-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(jl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Hr=jl,ql={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},eo,Xl=class extends Hn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),al(this,eo,{}),this.attach(e),this.on(Y.Types.insert,this.attach),this.on(Y.Types.remove,this.detach)}get ids(){return Pt(this,eo)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};eo=new WeakMap;var Yl=class $i extends Ce{constructor(e,n,r,s,o,a,l){const c=l||vt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ke);super(d,!0,!1,!0),x(this,"_flagStartAngle",!1),x(this,"_flagEndAngle",!1),x(this,"_flagInnerRadius",!1),x(this,"_flagOuterRadius",!1),x(this,"_startAngle",0),x(this,"_endAngle",ct),x(this,"_innerRadius",0),x(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Ul)Object.defineProperty(this,h,Ul[h]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=Mt(e,ct)===Mt(n,ct),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,f,g,m,u,p,b,y,_,w;for(o?c--:a||(c-=2),f=0,g=c-1;f<c;f++){switch(m=f/g,u=l[h],p=m*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),f){case 0:d=te.move;break;default:d=te.curve}u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===te.curve&&(w=s*b/Math.PI,u.controls.left.x=w*Math.cos(p-Je),u.controls.left.y=w*Math.sin(p-Je),u.controls.right.x=w*Math.cos(p+Je),u.controls.right.y=w*Math.sin(p+Je),f===1&&u.controls.left.multiplyScalar(2),f===g&&u.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=te.close,h++):(c--,g=c-1),f=0;f<c;f++)m=f/g,u=l[h],p=(1-m)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=te.curve,f<=0&&(d=o?te.move:te.line),u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===te.curve&&(w=r*b/Math.PI,u.controls.left.x=w*Math.cos(p+Je),u.controls.left.y=w*Math.sin(p+Je),u.controls.right.x=w*Math.cos(p-Je),u.controls.right.y=w*Math.sin(p-Je),f===1&&u.controls.left.multiplyScalar(2),f===g&&u.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=te.line}else o||(l[h].command=te.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=te.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 n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new $i(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Ce.Properties.length;c++){const d=Ce.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];e[r]=this[r]}return e}};x(Yl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var to=Yl,Ul={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},no=Math.cos,io=Math.sin,Kl=class Ei extends Ce{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ke(0,0,0,0,0,0));super(a,!0,!0,!0),x(this,"_flagRadius",!1),x(this,"_radius",0),this._renderer.type="circle";for(let l in Gl)Object.defineProperty(this,l,Gl[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ct,c=r*no(l),d=r*io(l),h=s*no(l-Je),f=s*io(l-Je),g=s*no(l+Je),m=s*io(l+Je),u=this.vertices[o];u.command=o===0?te.move:te.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Ei(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};x(Kl,"Properties",["radius"]);var Wr=Kl,Gl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ro=Math.cos,so=Math.sin,Zl=class Ni extends Ce{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ke);super(l,!0,!0,!0),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_width",0),x(this,"_height",0),this._renderer.type="ellipse";for(let c in Ql)Object.defineProperty(this,c,Ql[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ni().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ct,c=r*ro(l),d=s*so(l),h=r*n*ro(l-Je),f=s*n*so(l-Je),g=r*n*ro(l+Je),m=s*n*so(l+Je),u=this.vertices[o];u.command=o===0?te.move:te.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Ni(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];e[r]=this[r]}return e}};x(Zl,"Properties",["width","height"]);var jr=Zl,Ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},_m=Math.ceil,wm=Math.floor,Jl=class ni extends jn{constructor(e){super(),x(this,"_flagVertices",!0),x(this,"_flagLength",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagSize",!0),x(this,"_flagSizeAttenuation",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_length",0),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_size",1),x(this,"_sizeAttenuation",!1),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0),x(this,"noFill",Ce.prototype.noFill),x(this,"noStroke",Ce.prototype.noStroke),x(this,"corner",Ce.prototype.corner),x(this,"center",Ce.prototype.center),x(this,"getBoundingClientRect",Ce.prototype.getBoundingClientRect),x(this,"_updateLength",Ce.prototype._updateLength);for(let n in ec)Object.defineProperty(this,n,ec[n]);this._renderer.type="points",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.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 n=typeof e.fill=="string"?e.fill:ai(e.fill),r=typeof e.stroke=="string"?e.stroke:ai(e.stroke),s=new ni().copy(Hs(Ds({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}for(let n=0;n<ni.Properties.length;n++){const r=ni.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ni;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ni.Properties.length;r++){const s=ni.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),Z.each(ni.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,h=qs(a,l,a,l,c,d,c,d,e);n=n.concat(h)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Lr(this,e*this._length),s=Lr(this,n*this._length),o=_m(r),a=wm(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}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}};x(Jl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var oo=Jl,ec={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(Y.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(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),t instanceof Hn?this._collection=t:this._collection=new Hn(t||[]),this._collection.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},xm=Math.cos,vm=Math.sin,tc=class Fi extends Ce{constructor(e,n,r,s){s=Math.max(s||0,3),super(),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_flagSides",!1),x(this,"_radius",0),x(this,"_width",0),x(this,"_height",0),x(this,"_sides",0),this._renderer.type="polygon";for(let o in nc)Object.defineProperty(this,o,nc[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ct*o+Math.PI/2,l=this._width*xm(a)/2,c=this._height*vm(a)/2;s>=r?this.vertices.push(new ke(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};x(tc,"Properties",["width","height","sides"]);var ao=tc,nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ic=class Ai extends Ce{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ke(0,0,0,0,0,0,l===0?te.move:te.curve));super(a),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_flagRadius",!1),x(this,"_width",0),x(this,"_height",0),x(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in rc)Object.defineProperty(this,l,rc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=km.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof ee)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof ee?s:new ee().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof ee?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.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 n=this.width,r=this.height,s=this.radius,o=new Ai(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};x(ic,"Properties",["width","height","radius"]);var qr=ic,rc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof ee&&this._radius.unbind(Y.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof ee&&this._radius.bind(Y.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function km(){this._flagRadius=!0}var Cm=Math.cos,Sm=Math.sin,sc=class Mi extends Ce{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),x(this,"_flagInnerRadius",!1),x(this,"_flagOuterRadius",!1),x(this,"_flagSides",!1),x(this,"_innerRadius",0),x(this,"_outerRadius",0),x(this,"_sides",0),this._renderer.type="star";for(let a in oc)Object.defineProperty(this,a,oc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ct*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*Cm(a),d=l*Sm(a);s>=r?this.vertices.push(new ke(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Mi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};x(sc,"Properties",["innerRadius","outerRadius","sides"]);var lo=sc,oc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},co,ac=Math.min,lc=Math.max;De.document&&(co=document.createElement("canvas"));var ho=class Ht extends jn{constructor(e,n,r,s){super(),x(this,"_flagValue",!0),x(this,"_flagFamily",!0),x(this,"_flagSize",!0),x(this,"_flagLeading",!0),x(this,"_flagAlignment",!0),x(this,"_flagBaseline",!0),x(this,"_flagStyle",!0),x(this,"_flagWeight",!0),x(this,"_flagDecoration",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagMask",!1),x(this,"_flagClip",!1),x(this,"_flagDirection",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_value",""),x(this,"_family","sans-serif"),x(this,"_size",13),x(this,"_leading",17),x(this,"_alignment","center"),x(this,"_baseline","middle"),x(this,"_style","normal"),x(this,"_weight",500),x(this,"_decoration","none"),x(this,"_direction","ltr"),x(this,"_fill","#000"),x(this,"_stroke","none"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_mask",null),x(this,"_clip",!1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0);for(let o in cc)Object.defineProperty(this,o,cc[o]);if(this._renderer.type="text",this._renderer.flagFill=Bm.bind(this),this._renderer.flagStroke=Tm.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!Z.isObject(s))return this;for(let o=0;o<Ht.Properties.length;o++){const a=Ht.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(co){const n=co.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*Ht.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ai(e.fill),r=typeof e.stroke=="string"?e.stroke:ai(e.stroke),s=new Ht().copy(Hs(Ds({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<Ht.Properties.length;n++){const r=Ht.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Ht(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Ht.Properties.length;r++){const s=Ht.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<Ht.Properties.length;n++){const r=Ht.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=Ht.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[h,f]=n.multiply(r,o),[g,m]=n.multiply(r,a),[u,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=ac(f,m,p,y),r=ac(h,g,u,b),s=lc(h,g,u,b),a=lc(f,m,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}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}};x(ho,"Ratio",.6),x(ho,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var un=ho,cc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Z.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Bm(){this._flagFill=!0}function Tm(){this._flagStroke=!0}var uo=class ir extends qn{constructor(e,n,r,s){super(n,r,0,0),x(this,"_flagTextures",!1),x(this,"_flagFrameRate",!1),x(this,"_flagIndex",!1),x(this,"_amount",1),x(this,"_duration",0),x(this,"_index",0),x(this,"_startTime",0),x(this,"_playing",!1),x(this,"_firstFrame",0),x(this,"_lastFrame",0),x(this,"_loop",!0),x(this,"_textures",null),x(this,"_frameRate",0),x(this,"_origin",null),this._renderer.type="image-sequence";for(let o in dc)Object.defineProperty(this,o,dc[o]);this._renderer.flagTextures=Rm.bind(this),this._renderer.bindTextures=Pm.bind(this),this._renderer.unbindTextures=$m.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(hc.bind(this)):typeof e=="string"&&(this.textures=[hc(e)]),this.origin=new ee,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=ir.DefaultFrameRate,this.index=0}static fromObject(e){const n=new ir().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ir.Properties.length;n++){const r=ir.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Z.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r: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 n=new ir(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,Z.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=Z.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=At(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Me))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(uo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(uo,"DefaultFrameRate",30);var fo=uo,dc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),this._textures=new Hn((t||[]).slice(0)),this._textures.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Rm(){this._flagTextures=!0}function Pm(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function $m(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function hc(t){if(t instanceof Me)return t;if(typeof t=="string")return new Me(t)}var Xr=Math.min,Yr=Math.max,go=class ii extends jn{constructor(e){super(),x(this,"_flagAdditions",!1),x(this,"_flagSubtractions",!1),x(this,"_flagOrder",!1),x(this,"_flagOpacity",!0),x(this,"_flagBeginning",!1),x(this,"_flagEnding",!1),x(this,"_flagLength",!1),x(this,"_flagMask",!1),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_cap","round"),x(this,"_join","round"),x(this,"_miter",4),x(this,"_closed",!0),x(this,"_curved",!1),x(this,"_automatic",!0),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_length",0),x(this,"_mask",null),x(this,"_strokeAttenuation",!0);for(let n in uc)Object.defineProperty(this,n,uc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new ii;for(let s=0;s<ii.Properties.length;s++){const o=ii.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:ai(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return to.fromObject(s);case"circle":return Wr.fromObject(s);case"element":return Oi.fromObject(s);case"ellipse":return jr.fromObject(s);case"group":return ii.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return fo.fromObject(s);case"path":return Ce.fromObject(s);case"points":return oo.fromObject(s);case"polygon":return ao.fromObject(s);case"rectangle":return qn.fromObject(s);case"rounded-rectangle":return qr.fromObject(s);case"shape":return jn.fromObject(s);case"sprite":return Hr.fromObject(s);case"star":return lo.fromObject(s);case"text":return un.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<ii.Properties.length;n++){const r=ii.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ii,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._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,Z.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.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),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,h=1/0,f=-1/0;const g=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const u=this.children[m];if(!(!u.visible||g.test(u._renderer.type))&&(n=u.getBoundingClientRect(e),s=typeof n.top!="number"||Z.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||Z.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||Z.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||Z.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[w,S]=r.multiply(n.left,n.bottom),[B,R]=r.multiply(n.right,n.bottom);h=Xr(b,_,S,R,h),c=Xr(p,y,w,B,c),d=Yr(p,y,w,B,d),f=Yr(b,_,S,R,f)}else h=Xr(n.top,h),c=Xr(n.left,c),d=Yr(n.right,d),f=Yr(n.bottom,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}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(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}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}};x(go,"Children",Xl),x(go,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var rt=go,uc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=rt.InsertChildren.bind(this),n=rt.RemoveChildren.bind(this),r=rt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Xl(t),this._children.bind(Y.Types.insert,e),this._children.bind(Y.Types.remove,n),this._children.bind(Y.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Z.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function fc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Ur=class extends Ce{constructor(e,n,r,s){const o=[new ke(e,n),new ke(r,s)];super(o);for(let a in gc)Object.defineProperty(this,a,gc[a]);this.vertices[0].command=te.move,this.vertices[1].command=te.line,this.automatic=!1}};x(Ur,"Properties",["left","right"]);var gc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Z.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=te.move;else{const e=new $t("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Z.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=te.line;else{const e=new $t("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},fn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Em={start:"left",middle:"center",end:"right"},mc=["id","class","transform","xmlns","viewBox"],Nm=["x","y","width","height","href","xlink:href"];function Fm(t){return Em[t]}function Am(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function cr(t){return t.replace(/svg:/gi,"").toLowerCase()}function pc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function Mm(t,e){e||(e={});const n=t.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,"");e[l]=c}return e}function Vm(t){const e={},n=Im(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Im(t){const e=t.getAttributeNames();for(let n=0;n<mc.length;n++){const r=mc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Om(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<t.children.length;f++){const g=t.children[f];"translation"in g?g.translation.add(r,s):"x"in g?g.x=r:"y"in g&&(g.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new ee(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new qn(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Wt(t,e,n){const r={},s={},o={};let a,l,c,d,h,f,g,m,u,p,b,y,_,w,S,B,R;if(t===null)return r;if(De.getComputedStyle){const C=De.getComputedStyle(t);for(a=C.length;a--;)c=C[a],d=C[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)f=t.attributes[a],/style/i.test(f.nodeName)?Mm(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&Z.defaults(r,n),Z.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=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(g=oi(l),e._renderer.type){case"linear-gradient":pc(g,e.left),pc(g,e.right);break;case"radial-gradient":e.center.x+=g.translateX,e.center.y+=g.translateY,e.focal.x+=g.translateX,e.focal.y+=g.translateY,e.radius*=Math.max(g.scaleX,g.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;g=oi(l),e.translation.set(g.translateX,g.translateY),e.rotation=Math.PI*(g.rotation/180),e.scale=new ee(g.scaleX,g.scaleY),m=parseFloat((r.x+"").replace("px")),u=parseFloat((r.y+"").replace("px")),m&&(e.translation.x=m),u&&(e.translation.y=u);break;case"visible":if(e instanceof rt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof rt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof rt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof rt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof rt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof rt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(fn.cssBackgroundImage.test(d)&&(p=d.replace(fn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(y=ze.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=cr(y.nodeName),e.mask=ze[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof rt?"_":"")+c,fn.cssBackgroundImage.test(d)?(p=d.replace(fn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(y=ze.defs.current.get(p),y.object||(_=cr(y.nodeName),y.object=ze[_].call(this,y,{})),y=y.object):(b=Lm(this),y=b.getById(p)),e[h]=y):e[h]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(w=e instanceof et,S=e instanceof He,B=e instanceof We,w||S||B)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof un&&(e.family=d);break;case"font-size":e instanceof un&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof un&&(e.weight=d);break;case"font-style":e instanceof un&&(e.style=d);break;case"text-decoration":e instanceof un&&(e.decoration=d);break;case"line-height":e instanceof un&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function zm(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||cr(t.nodeName)==="#text"||e.add(s.id,s)}}function Lm(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new Or,n=t.getElementsByTagName("defs");for(let u=0;u<n.length;u++)zm(n[u],e);const r=ze.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,h=o!==null,f=a!==null,g=l!==null,m=c!==null;return h&&(r.x=parseFloat(o.replace(fn.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(fn.unitSuffix,""))),g&&(r.width=parseFloat(l.replace(fn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(fn.unitSuffix,""))),d&&Om(r,s),delete ze.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new $t("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 $t("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<t.attributes.length;c++){const d=t.attributes[c],h=Nm.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=cr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new rt;Wt.call(this,t,n,e),this.add(n);const r=Vm.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=cr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ke(parseFloat(a),parseFloat(l)))});const s=new Ce(r,!0);return s.stroke="none",s.fill="black",Wt.call(this,t,s,e),s},polyline:function(t,e){const n=ze.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ke,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const f=h.length-1;Z.each(h.slice(0),function(g,m){const u=g.slice(1).trim().match(fn.path),p=g[0],b=p.toLowerCase();let y,_,w,S,B;const R=[];switch(m===0&&(h=[]),b){case"h":case"v":u.length>1&&(y=1);break;case"m":case"l":case"t":u.length>2&&(y=2);break;case"s":case"q":u.length>4&&(y=4);break;case"c":u.length>6&&(y=6);break;case"a":u.length>7&&(y=7);break}if(y){for(_=0,w=u.length,B=0;_<w;_+=y){if(S=p,B>0)switch(p){case"m":S="l";break;case"M":S="L";break}R.push(S+u.slice(_,_+y).join(" ")),B++}h=Array.prototype.concat.apply(h,R)}else h.push(g)}),Z.each(h,function(g,m){let u,p,b;const y=g[0],_=y.toLowerCase();d=g.slice(1).trim().match(fn.path),o=y===_;let w,S,B,R,C,T,v,P,$,A,F,O,L,J,ne,N,V;switch(_){case"z":if(m>=f)s=!0;else{p=l.x,b=l.y,u=new ke(p,b,void 0,void 0,void 0,void 0,te.close);for(let q=r.length-1;q>=0;q--){const X=r[q];if(/m/i.test(X.command)){l=X;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),u=new ke(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?te.move:te.line),o&&u.addSelf(l),l=u;break;case"h":case"v":A=/h/i.test(_)?"x":"y",F=/x/i.test(A)?"y":"x",u=new ke(void 0,void 0,void 0,void 0,void 0,void 0,te.line),u[A]=parseFloat(d[0]),u[F]=l[F],o&&(u[A]+=l[A]),l=u;break;case"c":case"s":w=l.x,S=l.y,c||(c=new ee),/c/i.test(_)?(B=parseFloat(d[0]),R=parseFloat(d[1]),C=parseFloat(d[2]),T=parseFloat(d[3]),v=parseFloat(d[4]),P=parseFloat(d[5])):($=Xs(l,c,o),B=$.x,R=$.y,C=parseFloat(d[0]),T=parseFloat(d[1]),v=parseFloat(d[2]),P=parseFloat(d[3])),o&&(B+=w,R+=S,C+=w,T+=S,v+=w,P+=S),l.controls.right.set(B-l.x,R-l.y),u=new ke(v,P,C-v,T-P,void 0,void 0,te.curve),l=u,c=u.controls.left;break;case"t":case"q":w=l.x,S=l.y,c||(c=new ee),/q/i.test(_)?(B=parseFloat(d[0]),R=parseFloat(d[1]),C=parseFloat(d[0]),T=parseFloat(d[1]),v=parseFloat(d[2]),P=parseFloat(d[3])):($=Xs(l,c,o),B=$.x,R=$.y,C=$.x,T=$.y,v=parseFloat(d[0]),P=parseFloat(d[1])),o&&(B+=w,R+=S,C+=w,T+=S,v+=w,P+=S),l.controls.right.set((B-l.x)*.33,(R-l.y)*.33),u=new ke(v,P,C-v,T-P,void 0,void 0,te.curve),l=u,c=u.controls.left;break;case"a":w=l.x,S=l.y,L=parseFloat(d[0]),J=parseFloat(d[1]),ne=parseFloat(d[2]),N=parseFloat(d[3]),V=parseFloat(d[4]),v=parseFloat(d[5]),P=parseFloat(d[6]),o&&(v+=w,P+=S),O=new ke(v,P),O.command=te.arc,O.rx=L,O.ry=J,O.xAxisRotation=ne,O.largeArcFlag=N,O.sweepFlag=V,u=O,l=O,c=void 0;break}u&&(Array.isArray(u)?r=r.concat(u):r.push(u))})}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},Z.each(n.vertices,function(l){l.subSelf(a.centroid)}),Wt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new Wr(0,0,s);return o.stroke="none",o.fill="black",Wt.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new jr(0,0,s,o);return a.stroke="none",a.fill="black",Wt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!Z.isNaN(n)||!Z.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new qn(0,0,s,o);return c.stroke="none",c.fill="black",Wt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new ee(n,r),d=new qr(0,0,s,o,c);return d.stroke="none",d.fill="black",Wt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Ur(n,r,s,o).noFill();return Wt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.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 g=0;g<t.children.length;g++){const m=t.children[g];let u=m.getAttribute("offset");/%/gi.test(u)&&(u=parseFloat(u.replace(/%/gi,""))/100),u=parseFloat(u);let p=m.getAttribute("stop-color"),b=m.getAttribute("stop-opacity"),y=m.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),h.push(new Wn(u,p,b))}const f=new He(s,o,a,l,h);return f.spread=r,f.units=n,Wt.call(this,t,f,e),f},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));Z.isNaN(l)&&(l=s),Z.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 f=[];for(let m=0;m<t.children.length;m++){const u=t.children[m];let p=u.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=u.getAttribute("stop-color"),y=u.getAttribute("stop-opacity"),_=u.getAttribute("style"),w;b===null&&(w=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=w&&w.length>1?w[1]:void 0),y===null?(w=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=w&&w.length>1?parseFloat(w[1]):1):y=parseFloat(y),f.push(new Wn(p,b,y))}const g=new We(s,o,a,f,l,c);return g.spread=r,g.units=n,Wt.call(this,t,g,e),g},text:function(t,e){const n=Fm(t.getAttribute("text-anchor"))||"left",r=Am(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new un(s);return Wt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new $t("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Hr(r,s,o);return Z.isNaN(a)||(c.width=a),Z.isNaN(l)||(c.height=l),Wt.call(this,t,c,e),c}};function yc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var mo=class Sn extends qn{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),x(this,"_flagTexture",!1),x(this,"_flagMode",!1),x(this,"_texture",null),x(this,"_mode","fill"),this._renderer.type="image";for(let l in _c)Object.defineProperty(this,l,_c[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Sn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Sn.Properties.length;n++){const r=Sn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Sn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case Sn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Sn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Sn.Modes.crop:break;case Sn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case Sn.Modes.stretch:default:e.scale=new ee(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};x(mo,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),x(mo,"Properties",["texture","mode"]);var bc=mo,_c={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},po=[],yo=Math.max,Dm=Math.min,wc=Math.abs,Kr=Math.sin,Gr=Math.cos,Hm=Math.acos,Zr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Be?t:"path"},group:{renderChild:function(t){const e=Be.getRendererType(t._renderer.type);Be[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Qr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,t)}return o&&t.restore(),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,g,m,u,p,b,y,_,w,S,B,R,C,T,v,P,$,A,F,O,L,J,ne,N,V,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,L=this._mask,J=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||J||l===0))return this;if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,g=this._closed,m=this._renderer.vertices,u=m.length,p=u-1,ne=Qr(r),V=this.dashes,ne||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),L){const re=Be.getRendererType(L._renderer.type);Be[re].render.call(L,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Be.getRendererType(a._renderer.type);Be[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Be.getRendererType(s._renderer.type);Be[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this)),f&&(t.miterLimit=f),h&&(t.lineJoin=h),!g&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),V&&V.length>0&&(t.lineDashOffset=V.offset||0,t.setLineDash(V)),t.beginPath();let X,I,W,H,U,fe,oe;for(let re=0;re<u;re++)switch(_=m[re],F=_.x,O=_.y,_.command){case te.close:t.closePath();break;case te.arc:X=_.rx,I=_.ry,W=_.xAxisRotation,H=_.largeArcFlag,U=_.sweepFlag,b=g?Mt(re-1,u):yo(re-1,0),y=m[b],fe=y.x,oe=y.y,Be.renderSvgArcCommand(t,fe,oe,X,I,H,U,W,F,O);break;case te.curve:b=g?Mt(re-1,u):Math.max(re-1,0),y=m[b],v=y.controls&&y.controls.right||ee.zero,P=_.controls&&_.controls.left||ee.zero,y._relative?(C=v.x+y.x,T=v.y+y.y):(C=v.x,T=v.y),_._relative?(B=P.x+_.x,R=P.y+_.y):(B=P.x,R=P.y),t.bezierCurveTo(C,T,B,R,F,O),re>=p&&g&&(w=S,$=_.controls&&_.controls.right||ee.zero,A=w.controls&&w.controls.left||ee.zero,_._relative?(C=$.x+_.x,T=$.y+_.y):(C=$.x,T=$.y),w._relative?(B=A.x+w.x,R=A.y+w.y):(B=A.x,R=A.y),F=w.x,O=w.y,t.bezierCurveTo(C,T,B,R,F,O));break;case te.line:t.lineTo(F,O);break;case te.move:S=_,t.moveTo(F,O);break}return g&&t.closePath(),!J&&!n&&(Be.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),N&&t.restore()),Be.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),N&&t.restore())),ne||t.restore(),J&&!n&&t.clip(),V&&V.length>0&&t.setLineDash(po),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,g,m,u,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,p=Qr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const B=Be.getRendererType(a._renderer.type);Be[B].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const B=Be.getRendererType(s._renderer.type);Be[B].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let w=d*.5,S;this._sizeAttenuation||(S=this.worldMatrix.elements,S=oi(S[0],S[3],S[1],S[4],S[2],S[5]),w/=Math.max(S.scaleX,S.scaleY));for(let B=0;B<f;B++)g=h[B],m=g.x,u=g.y,t.moveTo(m+w,u),t.arc(m,u,w,0,ct);return n||(Be.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Be.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(po),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,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(!e&&(!o||l||s===0))return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,g=this._decoration,m=this._direction,u=Qr(c),p=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Be.alignments[this._alignment]||this._alignment,_=Be.baselines[this._baseline]||this._baseline;let w,S,B,R,C,T,v,P,$,A,F;if(u||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const O=Be.getRendererType(a._renderer.type);Be[O].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=m,f)if(typeof f=="string")t.fillStyle=f;else{const O=Be.getRendererType(f._renderer.type);Be[O].render.call(f,t,this),t.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const O=Be.getRendererType(d._renderer.type);Be[O].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=hn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Be.isHidden.test(f)||(f._renderer&&f._renderer.offset?(T=f._renderer.scale.x,v=f._renderer.scale.y,t.save(),t.translate(-f._renderer.offset.x,-f._renderer.offset.y),t.scale(T,v),w=this._size/f._renderer.scale.y,S=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,w+"px/",S+"px",this._family].join(" "),B=f._renderer.offset.x/f._renderer.scale.x,R=f._renderer.offset.y/f._renderer.scale.y,t.fillText(this.value,B,R),t.restore()):t.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,v=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,v),w=this._size/d._renderer.scale.y,S=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,w+"px/",S+"px",this._family].join(" "),B=d._renderer.offset.x/d._renderer.scale.x,R=d._renderer.offset.y/d._renderer.scale.y,C=h/d._renderer.scale.x,t.lineWidth=C,t.strokeText(this.value,B,R),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(g)){const O=t.measureText(this.value);let L=1;switch(g){case"underline":$=O.actualBoundingBoxDescent,F=O.actualBoundingBoxDescent;break;case"strikethrough":$=0,F=0,L=.5;break}switch(_){case"top":$+=this._size*L,F+=this._size*L;break;case"baseline":case"bottom":$-=this._size*L,F-=this._size*L;break}switch(y){case"left":case"start":P=0,A=O.width;break;case"right":case"end":P=-O.width,A=0;break;default:P=-O.width/2,A=O.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(P,$),t.lineTo(A,F),t.stroke()}return u||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(po),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof ee||(this._renderer.offset=new ee),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof ee?(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 ee||(this._renderer.scale=new ee),this._scale instanceof ee?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=wc(r),s=wc(s);const h=(e-c)/2,f=(n-d)/2,g=Gr(l)*h+Kr(l)*f,m=-Kr(l)*h+Gr(l)*f,u=g*g,p=m*m;let b=r*r,y=s*s;const _=u/b+p/y;if(_>1){const O=Zr(_);r=O*r,s=O*s,b=r*r,y=s*s}const w=b*p+y*u,S=(b*y-w)/w;let B=Zr(yo(0,S));o===a&&(B=-B);const R=B*r*m/s,C=-B*s*g/r,T=Gr(l)*R-Kr(l)*C+(e+c)/2,v=Kr(l)*R+Gr(l)*C+(n+d)/2,P=xc(1,0,(g-R)/r,(m-C)/s),$=xc((g-R)/r,(m-C)/s,(-g-R)/r,(-m-C)/s)%ct,A=P+$;Wm(t,T,v,r,s,P,A,a===0,l)}},ht=class extends Y{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new rt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Ys(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&Z.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Y.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};x(ht,"Utils",Be);function Wm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Vi.Tolerance.epsilon,f=Math.abs(d)<h;let g=Mt(d,ct);g<h&&(f?g=0:g=ct),l===!0&&!f&&(g===ct?g=-ct:g=g-ct);for(let m=0;m<vt.Resolution;m++){const u=m/(vt.Resolution-1),p=o+u*g;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),w=Math.sin(c),S=b-e,B=y-n;b=S*_-B*w+e,y=S*w+B*_+n}t.lineTo(b,y)}}function xc(t,e,n,r){const s=t*n+e*r,o=Zr(t*t+e*e)*Zr(n*n+r*r);let a=Hm(yo(-1,Dm(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Qr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ae={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(t,e){const n=t,r=document.createElementNS(ae.ns,n);return n==="svg"&&(e=Z.defaults(e||{},{version:ae.version})),e&&Object.keys(e).length>0&&ae.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(ae.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?Mt(a-1,n):Math.max(a-1,0),d=t[c];let h,f,g,m,u,p,b,y,_,w,S,B,R,C,T,v=Ae(l.x),P=Ae(l.y);switch(l.command){case te.close:h=te.close;break;case te.arc:S=l.rx,B=l.ry,R=l.xAxisRotation,C=l.largeArcFlag,T=l.sweepFlag,h=te.arc+" "+S+" "+B+" "+R+" "+C+" "+T+" "+v+" "+P;break;case te.curve:b=d.controls&&d.controls.right||ee.zero,y=l.controls&&l.controls.left||ee.zero,d.relative?(g=Ae(b.x+d.x),m=Ae(b.y+d.y)):(g=Ae(b.x),m=Ae(b.y)),l.relative?(u=Ae(y.x+l.x),p=Ae(y.y+l.y)):(u=Ae(y.x),p=Ae(y.y)),h=(a===0?te.move:te.curve)+" "+g+" "+m+" "+u+" "+p+" "+v+" "+P;break;case te.move:s=l,h=te.move+" "+v+" "+P;break;default:h=l.command+" "+v+" "+P}a>=r&&e&&(l.command===te.curve&&(f=s,_=l.controls&&l.controls.right||l,w=f.controls&&f.controls.left||f,l.relative?(g=Ae(_.x+l.x),m=Ae(_.y+l.y)):(g=Ae(_.x),m=Ae(_.y)),f.relative?(u=Ae(w.x+f.x),p=Ae(w.y+f.y)):(u=Ae(w.x),p=Ae(w.y)),v=Ae(f.x),P=Ae(f.y),h+=" C "+g+" "+m+" "+u+" "+p+" "+v+" "+P),l.command!==te.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=te.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=ae.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in ae?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.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})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=ae.getRendererType(t._renderer.type);ae[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ae.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=ae.getRendererType(s._renderer.type);ae[o].render.call(s,t)}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(ae.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(ae.group.removeChild,n),this._flagOrder&&this.children.forEach(ae.group.orderChild,n),this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),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),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=ae.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),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=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=oi(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=ae.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=ae.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ae.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),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=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),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(t,e){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||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?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.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?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||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?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.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?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||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 ee?(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 ee?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?ae.setAttributes(this._renderer.image,r):this._renderer.image=ae.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&ae.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=ae.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.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),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},vc=class extends Y{constructor(t){super(),this.domElement=t.domElement||ae.createElement("svg"),this.scene=new rt,this.scene.parent=this,this.defs=ae.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,ae.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Y.Types.resize,t,e)}render(){return ae.group.render.call(this.scene,this.domElement),ae.defs.update(this.domElement),this}};x(vc,"Utils",ae);var jt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new $t("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,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},Jr=zi.Multiply,jm=[1,0,0,0,1,0,0,0,1],Xn=new dn(9),qm=ht.Utils,kc=new ee,bo=new dn([0,0,1,0,0,1,0,1,1,0,1,1]),_e={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 zi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)_e.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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 dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee),this._scale instanceof ee?(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){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ht.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.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++)_e.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ht.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,f,g,m,u,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,v=t.renderer.ratio,B=kc.copy(e._renderer.scale).multiply(v),S=e._stroke,R=e._linewidth,C=e._fill,T=e._renderer.opacity||e._opacity,x=e._cap,P=e._join,$=e._miter,A=e._closed,F=e.dashes,O=b.length,L=O-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*B.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*B.y),1);const J=e._renderer.rect.centroid,ne=J.x,N=J.y;if(_.clearRect(0,0,y.width,y.height),C)if(typeof C=="string")_.fillStyle=C;else{const oe=ht.Utils.getRendererType(C._renderer.type);_e[oe].render.call(C,_,e),_.fillStyle=C._renderer.effect}if(S){if(typeof S=="string")_.strokeStyle=S;else{const oe=ht.Utils.getRendererType(S._renderer.type);_e[oe].render.call(S,_,e),_.strokeStyle=S._renderer.effect}R&&(_.lineWidth=hn(e)),$&&(_.miterLimit=$),P&&(_.lineJoin=P),!A&&x&&(_.lineCap=x)}typeof T=="number"&&(_.globalAlpha=T),F&&F.length>0&&(_.lineDashOffset=F.offset||0,_.setLineDash(F));let V,q,X,I,W,H,U,fe;_.save(),_.scale(B.x,B.y),_.translate(ne,N),_.beginPath();for(let oe=0;oe<b.length;oe++){const re=b[oe];switch(m=re.x,u=re.y,re.command){case te.close:_.closePath();break;case te.arc:q=re.rx,X=re.ry,I=re.xAxisRotation,W=re.largeArcFlag,H=re.sweepFlag,n=A?Mt(oe-1,O):Math.max(oe-1,0),r=b[n],U=r.x,fe=r.y,qm.renderSvgArcCommand(_,U,fe,q,X,W,H,I,m,u);break;case te.curve:n=A?Mt(oe-1,O):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||ee.zero,h=re.controls&&re.controls.left||ee.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),_.bezierCurveTo(l,c,o,a,m,u),oe>=L&&A&&(s=V,f=re.controls&&re.controls.right||ee.zero,g=s.controls&&s.controls.left||ee.zero,re._relative?(l=f.x+re.x,c=f.y+re.y):(l=f.x,c=f.y),s._relative?(o=g.x+s.x,a=g.y+s.y):(o=g.x,a=g.y),m=s.x,u=s.y,_.bezierCurveTo(l,c,o,a,m,u));break;case te.line:_.lineTo(m,u);break;case te.move:V=re,_.moveTo(m,u);break}}A&&_.closePath(),_e.isHidden.test(C)||(p=C._renderer&&C._renderer.offset,p&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(S)||(p=S._renderer&&S._renderer.offset,p&&(_.save(),_.translate(-S._renderer.offset.x,-S._renderer.offset.y),_.scale(S._renderer.scale.x,S._renderer.scale.y),_.lineWidth=R/S._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const h=d.x,f=d.y,g=d.controls;let m,u,p,b,y,_;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(y=g.left,_=g.right,!(!y||!_)&&(m=d._relative?y.x+h:y.x,u=d._relative?y.y+f:y.y,p=d._relative?_.x+h:_.x,b=d._relative?_.y+f:_.y,!(!m||!u||!p||!b)&&(o=Math.min(u,b,o),r=Math.min(m,p,r),s=Math.max(m,p,s),a=Math.max(u,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),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(t,e,n){if(!this._visible||!this._opacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ht.Utils.getRendererType(this._renderer.type),o=e[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 He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(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 dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee);let f,g;this._scale instanceof ee?(f=this._scale.x*r._renderer.scale.x,g=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,g=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=g<0?-g:g,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const f=ht.Utils.getRendererType(this._mask._renderer.type);_e[f].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,t,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;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,bo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._size*o;let g=f;_e.isHidden.test(a)||(g+=l),r.width=ul(g),r.height=r.width;const m=g/r.width,u=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ht.Utils.getRendererType(c._renderer.type);_e[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ht.Utils.getRendererType(a._renderer.type);_e[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=hn(e)/m)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(u,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,f/m*.5,0,ct),s.restore(),closed&&s.closePath(),_e.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()),_e.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(t,e,n){if(!this._visible||!this._opacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,g=this._renderer.vertices,m=this._renderer.collection.length,u=this._flagVertices,p=this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(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||f){this._renderer.matrix||(this._renderer.matrix=new dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee);let b,y;this._scale instanceof ee?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=s)}if(u){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,g,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,m),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=kc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._decoration,g=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const m=e._renderer.rect.centroid,u=m.x,p=m.y;let b,y,_,v,B,S,R,C,T,x,P;const $=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),$||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=g,c)if(typeof c=="string")r.fillStyle=c;else{const A=ht.Utils.getRendererType(c._renderer.type);_e[A].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const A=ht.Utils.getRendererType(a._renderer.type);_e[A].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}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(u,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(S=c._renderer.scale.x,R=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(S,R),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,v=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,v),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(S=a._renderer.scale.x,R=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(S,R),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,v=a._renderer.offset.y/a._renderer.scale.y,B=l/a._renderer.scale.x,r.lineWidth=B,r.strokeText(e.value,_,v),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const A=r.measureText(e.value);switch(f){case"underline":T=A.actualBoundingBoxDescent,P=A.actualBoundingBoxDescent;break;case"strikethrough":T=0,P=0;break}C=-A.width/2,x=A.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(C,T),r.lineTo(x,P),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=_e.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ht.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[t._alignment]||t._alignment){case _e.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case _e.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[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 He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(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 dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee);let h,f;this._scale instanceof ee?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ht.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,t,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;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,bo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof ee||(this._renderer.offset=new ee),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 ee?(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 ee||(this._renderer.scale=new ee);let r,s;this._scale instanceof ee?(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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ht.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(_e,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),Z.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new $t("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},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];e[s]=_e.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Or};_e.ctx=_e.canvas.getContext("2d");var Cc=class extends Y{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(_e.canvas=t.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new rt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new dn(jm),scale:1,opacity:1},this._flagMatrix=!0,t=Z.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new $t("unable to create a webgl context. Try using another renderer.");r=jt.create(e,jt.path.vertex,jt.types.vertex),s=jt.create(e,jt.path.fragment,jt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=_e.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,bo,e.STATIC_DRAW),r=jt.create(e,jt.points.vertex,jt.types.vertex),s=jt.create(e,jt.points.fragment,jt.types.fragment),n=this.programs.points=_e.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Ys(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,Z.isObject(this.domElement.style)&&Z.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*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(Y.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Cc,"Utils",_e);var Xm=Z.extend({Error:$t,getRatio:Ys,read:ze,xhr:yc},Z,xt,ll,cl),xe=class Fr{constructor(e){w(this,"_events",new Y),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 n=Z.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Fr.Types.svg,autostart:!1});if(Z.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),Z.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Fr.Types[r])}this.renderer=new Fr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Ym.bind(this),this.fit.domElement=window,this.fit.attached=!0,Z.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),Z.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Vt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=Um.bind(this),Z.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(Y.Types.resize,Km.bind(this)),this.scene=this.renderer.scene,Fr.Instances.push(this),n.autostart&&dr.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,dr.init(),this.trigger(Y.Types.play)}pause(){return this.playing=!1,this.trigger(Y.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;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){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=Z.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Vt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(Y.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(Y.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,n,r,s){const o=new Ur(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ke(e,n,void 0,void 0,void 0,void 0,te.move),new ke(r,s,void 0,void 0,void 0,void 0,te.line),new ke(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,te.line),new ke(r,s,void 0,void 0,void 0,void 0,te.move),new ke(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,te.line)],d=new Ce(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new qn(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new qr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Wr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new jr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new lo(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ke(l,c))}}const r=arguments[n-1],s=new Ce(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new ao(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new to(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new ee(a,l))}}const s=new oo(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ke(c,d))}}const s=arguments[n-1],o=new Ce(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new un(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new He(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new We(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Hr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new bc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new fo(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Me(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new rt;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof rt?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new rt;let s,o,a;const l=(function(c){for(Vt.temp.innerHTML=c,o=0;o<Vt.temp.children.length;o++)s=Vt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Vt.temp.children.length<=1?Vt.temp.children[0]:Vt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(yc(e,l),r):(l(e),r)}};w(xe,"NextFrameId",vt.NextFrameId),w(xe,"Types",vt.Types),w(xe,"Version",vt.Version),w(xe,"PublishDate",vt.PublishDate),w(xe,"Identifier",vt.Identifier),w(xe,"Resolution",vt.Resolution),w(xe,"AutoCalculateImportedMatrices",vt.AutoCalculateImportedMatrices),w(xe,"Instances",vt.Instances),w(xe,"uniqueId",vt.uniqueId),w(xe,"Anchor",ke),w(xe,"Collection",Hn),w(xe,"Events",Y),w(xe,"Group",rt),w(xe,"Matrix",zi),w(xe,"Path",Ce),w(xe,"Registry",Or),w(xe,"Element",Oi),w(xe,"Shape",jn),w(xe,"Text",un),w(xe,"Vector",ee),w(xe,"Gradient",et),w(xe,"Image",bc),w(xe,"ImageSequence",fo),w(xe,"LinearGradient",He),w(xe,"RadialGradient",We),w(xe,"Sprite",Hr),w(xe,"Stop",Wn),w(xe,"Texture",Me),w(xe,"ArcSegment",to),w(xe,"Circle",Wr),w(xe,"Ellipse",jr),w(xe,"Line",Ur),w(xe,"Points",oo),w(xe,"Polygon",ao),w(xe,"Rectangle",qn),w(xe,"RoundedRectangle",qr),w(xe,"Star",lo),w(xe,"CanvasRenderer",ht),w(xe,"SVGRenderer",vc),w(xe,"WebGLRenderer",Cc),w(xe,"Commands",te),w(xe,"Utils",Xm);var gn=xe;function Ym(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function Um(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function Km(t,e){this.width=t,this.height=e,this.trigger(Y.Types.resize,t,e)}var dr=Vt.getRequestAnimationFrame();function Sc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=dr(Sc)}dr.init=function(){Sc(),dr.init=function(){}};let mn;typeof window<"u"?mn=window:typeof global<"u"?mn=global:typeof self<"u"&&(mn=self);let Bc;const li=Math.PI*2,st=Math.PI*.5;function Gm(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Zm(t){Bc=t}function Qm(t,e){e=e&&e.identity()||new Bc;let n=t;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;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function qt(t,e,n){return n*(e-t)+t}function Hi(t,e){for(;t<0;)t+=e;return t%e}const Tc=mn.Float32Array||Array,Jm=Math.floor;function pn(t){return Jm(t*1e6)/1e6}const ge={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){k(this,"_events",{});k(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];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[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];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(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.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 Rc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(G.Types.change))}}},at=class at extends G{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in Rc)Object.defineProperty(this,s,Rc[s]);this.x=n,this.y=r}static add(n,r){return new at(n.x+r.x,n.y+r.y)}static sub(n,r){return new at(n.x-r.x,n.y-r.y)}static subtract(n,r){return at.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(at.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 at(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:pn(this.x),y:pn(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(at,"zero",new at),k(at,"left",new at(-1,0)),k(at,"right",new at(1,0)),k(at,"up",new at(0,-1)),k(at,"down",new at(0,1));let pe=at;class Re extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=ge.move){super(n,r);k(this,"controls",{left:new pe,right:new pe});k(this,"_command",ge.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 Pc)Object.defineProperty(this,h,Pc[h]);this.command=c,this.relative=!0;const d=Re.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 Re().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 Re().copy(this)}toObject(){return{x:pn(this.x),y:pn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:pn(this.rx),ry:pn(this.ry),xAxisRotation:pn(this.xAxisRotation),largeArcFlag:pn(this.largeArcFlag),sweepFlag:pn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Pc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}}};let ep=0;const _o={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return ep++}},es={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ts(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function $c(t,e,n,r,s,o,a,l,c){c=c||es.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const h=[];for(let f=0;f<d;f++){const g=f/d,m=ts(g,t,n,s,a),u=ts(g,e,r,o,l);h.push(new Re(m,u))}return h}function tp(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),g=9*(r-o)+3*(l-e),m=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(g*b+m)*b+u;return Math.sqrt(y*y+_*_)}return ip(p,0,1,c||es.RecursionLimit)}function np(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,g,m,u,p,b,y;for(let S=0;S<2;++S){if(S===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,g=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,g=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;m=-g/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*g*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,v=_,B;for(;_--;)m=c[_],B=1-m,d[0][_]=B*B*B*t+3*B*B*m*n+3*B*m*m*s+m*m*m*a,d[1][_]=B*B*B*e+3*B*B*m*r+3*B*m*m*o+m*m*m*l;return d[0][v]=t,d[1][v]=e,d[0][v+1]=a,d[1][v+1]=l,d[0].length=d[1].length=v+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 ip(t,e,n,r){let s=es.abscissas[r-2],o=es.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function rp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Hi(s-1,n):Math.max(s-1,0),l=e?Hi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];sp(c,d,h),d.command=s===0?ge.move:ge.curve}}function sp(t,e,n){const r=pe.angleBetween(t,e),s=pe.angleBetween(n,e);let o=pe.distanceBetween(t,e),a=pe.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=st:l-=st,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let hr=(Ci=class extends G{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",_o.Identifier+_o.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Ec)Object.defineProperty(this,n,Ec[n])}static fromObject(n){const r=new Ci().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},k(Ci,"Properties",["renderer","id","className"]),Ci);const Ec={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class ns extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class op{constructor(){k(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let is;const Nc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};mn.document&&(is=document.createElement("a"));const qe=class qe extends hr{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 Fc)Object.defineProperty(this,s,Fc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=ap.bind(this),this._renderer.flagScale=lp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,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 qe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return is?(is.href=n,is.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=qe.getAbsoluteURL(n);if(qe.ImageRegistry.contains(r))return qe.ImageRegistry.get(r);let s;return mn.document?Nc.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=qe.getTag(s);n._flagImage&&(/canvas/i.test(o)?qe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,qe.Register[o](n,r))),n._flagSrc&&(s||(s=qe.getImage(n.src),n.image=s),o=qe.getTag(s),qe.Register[o](n,r))}clone(){const n=new qe(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 pe?n.offset:new pe().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe().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,qe.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(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(qe,"Properties",["src","loaded","repeat","scale","offset","image"]),k(qe,"RegularExpressions",Nc),k(qe,"ImageRegistry",new op),k(qe,"Register",{canvas:function(n,r){n._src="#"+n.id,qe.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 ns("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=qe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),qe.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 ns("unable to load "+n.src)};n._src=qe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),qe.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 je=qe;const Fc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=je.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}je.ImageRegistry.contains(n)?this._image=je.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(G.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function ap(){this._flagOffset=!0}function lp(){this._flagScale=!0}class ci extends Array{constructor(){super();La(this,lt,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 Rt(this,lt)}set _events(n){Lu(this,lt,n)}get _bound(){return Rt(this,lt)._bound}set _bound(n){Rt(this,lt)._bound=n}addEventListener(){return Rt(this,lt).addEventListener.apply(this,arguments)}on(){return Rt(this,lt).on.apply(this,arguments)}bind(){return Rt(this,lt).bind.apply(this,arguments)}removeEventListener(){return Rt(this,lt).removeEventListener.apply(this,arguments)}off(){return Rt(this,lt).off.apply(this,arguments)}unbind(){return Rt(this,lt).unbind.apply(this,arguments)}dispatchEvent(){return Rt(this,lt).dispatchEvent.apply(this,arguments)}trigger(){return Rt(this,lt).trigger.apply(this,arguments)}listen(){return Rt(this,lt).listen.apply(this,arguments)}ignore(){return Rt(this,lt).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}}lt=new WeakMap;const Ac=Array.prototype.slice;function cp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const $e={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!cp(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:mn.performance&&mn.performance.now?mn.performance:Date},Nt=class Nt extends hr{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 Mc)Object.defineProperty(this,o,Mc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Nt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Nt.Index<=0?"#fff":"#000",Nt.Index=(Nt.Index+1)%2}static fromObject(n){const r=new Nt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nt.Properties.length;r++){const s=Nt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Nt;return $e.each(Nt.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",$e.each(Nt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Nt,"Index",0),k(Nt,"Properties",["offset","opacity","color"]);let di=Nt;const Mc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},xn=class xn extends hr{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 Vc)Object.defineProperty(this,r,Vc[r]);this._renderer.type="gradient",this._renderer.flagStops=dp.bind(this),this._renderer.bindStops=hp.bind(this),this._renderer.unbindStops=up.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 di?o:new di().copy(o)));const s=new xn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new xn(r);return $e.each(xn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return $e.each(xn.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(xn,"Stop",di),k(xn,"Properties",["spread","stops","units"]);let tt=xn;const Vc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(G.Types.insert,e).unbind(G.Types.remove,n),this._stops=new ci((t||[]).slice(0)),this._stops.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._stops)}}};function dp(){this._flagStops=!0}function hp(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function up(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const Qn=class Qn extends tt{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in Ic)Object.defineProperty(this,l,Ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=fp.bind(this),this.left=new pe,this.right=new pe,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 Qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Qn.Properties.length;r++){const s=Qn.Properties[r];s in n&&(this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Qn(this.left._x,this.left._y,this.right._x,this.right._y,r);return $e.each(tt.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(Qn,"Stop",di),k(Qn,"Properties",["left","right"]);let kt=Qn;const Ic={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof pe&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function fp(){this._flagEndPoints=!0}const vn=class vn extends tt{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 Oc)Object.defineProperty(this,c,Oc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=gp.bind(this),this._renderer.flagFocal=mp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,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 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&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().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 vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return $e.each(tt.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return $e.each(vn.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(vn,"Stop",di),k(vn,"Properties",["center","radius","focal"]);let Ct=vn;const Oc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(G.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function gp(){this._flagCenter=!0}function mp(){this._flagFocal=!0}function zc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function rs(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Lc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),tp(r,l,s,c,o,d,a,h,n)}function Dc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),$c(r,l,s,c,o,d,a,h,n)}function hi(t){switch(t.renderer.type){case"texture":return je.fromObject(t);case"gradient":return tt.fromObject(t);case"linear-gradient":return kt.fromObject(t);case"radial-gradient":return Ct.fromObject(t)}return t}const pp=Math.cos,yp=Math.sin,Hc=Math.tan,wo=[],Bt=class Bt extends G{constructor(n,r,s,o,a,l){super();k(this,"elements",new Tc(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 C=n;let T,x,P;const $=r[0]||0,A=r[1]||0,F=r[2]||0;return T=C[0]*$+C[1]*A+C[2]*F,x=C[3]*$+C[4]*A+C[5]*F,P=C[6]*$+C[7]*A+C[8]*F,[T,x,P]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],g=n[7],m=n[8],u=r[0],p=r[1],b=r[2],y=r[3],_=r[4],v=r[5],B=r[6],S=r[7],R=r[8];return s=s||new Tc(9),s[0]=o*u+a*y+l*B,s[1]=o*p+a*_+l*S,s[2]=o*b+a*v+l*R,s[3]=c*u+d*y+h*B,s[4]=c*p+d*_+h*S,s[5]=c*b+d*v+h*R,s[6]=f*u+g*y+m*B,s[7]=f*p+g*_+m*S,s[8]=f*b+g*v+m*R,s}static fromObject(n){return new Bt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[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]=Bt.Identity[0],this.elements[1]=Bt.Identity[1],this.elements[2]=Bt.Identity[2],this.elements[3]=Bt.Identity[3],this.elements[4]=Bt.Identity[4],this.elements[5]=Bt.Identity[5],this.elements[6]=Bt.Identity[6],this.elements[7]=Bt.Identity[7],this.elements[8]=Bt.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 L=a[0]*n+a[1]*r+a[2]*s,J=a[3]*n+a[4]*r+a[5]*s,ne=a[6]*n+a[7]*r+a[8]*s;return[L,J,ne]}const f=this.elements,g=[n,r,s,o,a,l,c,d,h],m=f[0],u=f[1],p=f[2],b=f[3],y=f[4],_=f[5],v=f[6],B=f[7],S=f[8],R=g[0],C=g[1],T=g[2],x=g[3],P=g[4],$=g[5],A=g[6],F=g[7],O=g[8];return this.elements[0]=m*R+u*x+p*A,this.elements[1]=m*C+u*P+p*F,this.elements[2]=m*T+u*$+p*O,this.elements[3]=b*R+y*x+_*A,this.elements[4]=b*C+y*P+_*F,this.elements[5]=b*T+y*$+_*O,this.elements[6]=v*R+B*x+S*A,this.elements[7]=v*C+B*P+S*F,this.elements[8]=v*T+B*$+S*O,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new Bt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],g=r[8],m=g*c-d*f,u=-g*l+d*h,p=f*l-c*h;let b=s*m+o*u+a*p;return b?(b=1/b,n.elements[0]=m*b,n.elements[1]=(-g*o+a*f)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=u*b,n.elements[4]=(g*s-a*h)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-f*s+o*h)*b,n.elements[8]=(c*s-o*l)*b,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=pp(n),s=yp(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=Hc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Hc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return wo.length=0,this.toTransformArray(n,wo),wo.map(pn).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],f=s[5];if(n){const g=s[6],m=s[7],u=s[8];if(o){r[0]=a,r[1]=d,r[2]=g,r[3]=l,r[4]=h,r[5]=m,r[6]=c,r[7]=f,r[8]=u;return}return[a,d,g,l,h,m,c,f,u]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const g=s[6],m=s[7],u=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=g,r[7]=m,r[8]=u;return}return[a,l,c,d,h,f,g,m,u]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Bt().copy(this)}};k(Bt,"Identity",[1,0,0,0,1,0,0,0,1]);let ur=Bt;Zm(ur);const Pr=class Pr extends hr{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 ss)Object.defineProperty(this,n,ss[n]);this._renderer.flagMatrix=Wc.bind(this),this.isShape=!0,this.matrix=new ur,this.worldMatrix=new ur,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Pr().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 ss.position.get.apply(this,arguments)}set translation(n){ss.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 pe?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 pe?n.scale:new pe(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 Pr;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 pe?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 pe?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(Pr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Tn=Pr;const ss={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(G.Types.change,this._renderer.flagMatrix),Wc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&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(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Qm(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Wc(){this._flagMatrix=!0}const Wi=Math.min,ji=Math.max,bp=Math.ceil,_p=Math.floor,wp=new pe,tn=class tn extends Tn{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,"_flagStrokeAttenuation",!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);k(this,"_strokeAttenuation",!0);for(let a in jc)Object.defineProperty(this,a,jc[a]);this._renderer.type="path",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Kc.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:hi(n.fill),s=typeof n.stroke=="string"?n.stroke:hi(n.stroke),o=new tn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}}for(let r=0;r<tn.Properties.length;r++){const s=tn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new tn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<tn.Properties.length;s++){const o=tn.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()),$e.each(tn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}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,f=1/0,g=-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:m,scaleY:u}=Gm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof m=="number"&&typeof u=="number"&&(s=Math.max(m,u)*(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[m,u]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[v,B]=r.multiply(y,_),S=c.controls.left.x,R=c.controls.left.y;c.relative&&(S+=c.x,R+=c.y);let[C,T]=r.multiply(S,R);const x=np(m,u,v,B,C,T,p,b);f=Wi(x.min.y-s,f),d=Wi(x.min.x-s,d),h=ji(x.max.x+s,h),g=ji(x.max.y+s,g)}else a<=1&&(f=Wi(u-s,f),d=Wi(m-s,d),h=ji(m+s,h),g=ji(u+s,g)),f=Wi(b-s,f),d=Wi(p-s,d),h=ji(p+s,h),g=ji(b+s,g)}return{top:f,left:d,right:h,bottom:g,width:h-d,height:g-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,g,m,u,p,b,y,_,v=this.length*Math.min(Math.max(n,0),1);const B=this.vertices.length,S=B-1;let R=null,C=null;for(let N=0,V=this._lengths.length,q=0;N<V;N++){if(q+this._lengths[N]>=v){this._closed?(s=Hi(N,B),o=Hi(N-1,B),N===0&&(s=o,o=N)):(s=N,o=Math.min(Math.max(N-1,0),S)),R=this.vertices[s],C=this.vertices[o],v-=q,this._lengths[N]!==0?n=v/this._lengths[N]:n=0;break}q+=this._lengths[N]}if(R===null||C===null)return null;if(R){if(!C)return R}else return C;_=C.controls&&C.controls.right,y=R.controls&&R.controls.left,c=C.x,m=C.y,d=(_||C).x,u=(_||C).y,h=(y||R).x,p=(y||R).y,f=R.x,b=R.y,_&&C.relative&&(d+=C.x,u+=C.y),y&&R.relative&&(h+=R.x,p+=R.y),l=ts(n,c,d,h,f),g=ts(n,m,u,p,b);const T=qt(c,d,n),x=qt(m,u,n),P=qt(d,h,n),$=qt(u,p,n),A=qt(h,f,n),F=qt(p,b,n),O=qt(T,P,n),L=qt(x,$,n),J=qt(P,A,n),ne=qt($,F,n);return $e.isObject(r)?(r.x=l,r.y=g,r instanceof Re&&(r.controls.left.x=O,r.controls.left.y=L,r.controls.right.x=J,r.controls.right.y=ne,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=g,r.controls.right.x-=l,r.controls.right.y-=g)),r.t=n,r):(a=new Re(l,g,O-l,L-g,J-l,ne-g,this._curved?ge.curve:ge.line),a.t=n,a)}plot(){if(this.curved)return rp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?ge.move:ge.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===ge.close;let o=this.vertices[r],a=[],l;return $e.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===ge.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=ge.line),o=c;return}l=Dc(c,o,n),a=a.concat(l),$e.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Dc(c,o,n),a=a.concat(l),$e.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?ge.close:ge.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=[]),$e.each(this.vertices,function(c,d){if(d<=0||c.command===ge.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Lc(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=rs(this,s*this._length),l=rs(this,o*this._length),c=bp(a),d=_p(l);let h,f,g,m,u,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Re),p>d&&!f?(u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,u),u.command=this._renderer.collection[p].command,this._renderer.vertices.push(u),f=u,g=this._collection[p-1],g&&g.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u),g.relative?this._renderer.collection[p-1].controls.right.copy(g.controls.right).lerp(pe.zero,1-u.t):this._renderer.collection[p-1].controls.right.copy(g.controls.right).lerp(g,1-u.t))):p>=c&&p<=d&&(u=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(u),p===d&&zc(this,o)?(f=u,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):p===c&&zc(this,s)&&(h=u,h.command=ge.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,u),u.command=ge.move,this._renderer.vertices.unshift(u),m=this._collection[p+1],m&&m.controls&&(u.controls.left.clear(),m.relative?this._renderer.collection[p+1].controls.left.copy(m.controls.left).lerp(pe.zero,u.t):(wp.copy(m),this._renderer.collection[p+1].controls.left.copy(m.controls.left).lerp(m,u.t))))}return Tn.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=this._flagStrokeAttenuation=!1,Tn.prototype.flagReset.call(this),this}};k(tn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),k(tn,"Utils",{getCurveLength:Lc});let Ee=tn;const jc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&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(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";$e.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ci?this._collection=t:this._collection=new ci(t||[]),this._collection.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function qc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Xc(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Yc(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Uc(){this._flagFill=!0}function Kc(){this._flagStroke=!0}const xp=Math.ceil,vp=Math.floor,kn=class kn extends Tn{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,"_flagStrokeAttenuation",!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,"_strokeAttenuation",!0);k(this,"noFill",Ee.prototype.noFill);k(this,"noStroke",Ee.prototype.noStroke);k(this,"corner",Ee.prototype.corner);k(this,"center",Ee.prototype.center);k(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);k(this,"_updateLength",Ee.prototype._updateLength);for(let r in Gc)Object.defineProperty(this,r,Gc[r]);this._renderer.type="points",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Kc.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:hi(n.fill),s=typeof n.stroke=="string"?n.stroke:hi(n.stroke),o=new kn().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 Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new kn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<kn.Properties.length;s++){const o=kn.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()),$e.each(kn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}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,f=$c(l,c,l,c,d,h,d,h,n);r=r.concat(f)}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=rs(this,n*this._length),o=rs(this,r*this._length),a=xp(s),l=vp(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(kn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let os=kn;const Gc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&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(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ci?this._collection=t:this._collection=new ci(t||[]),this._collection.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class Zc extends ci{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);La(this,Fs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Rt(this,Fs)}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}}Fs=new WeakMap;const Nn=class Nn extends Ee{constructor(n,r,s,o,a,l,c){const d=c||_o.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Re);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",li);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in Qc)Object.defineProperty(this,f,Qc[f]);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 Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.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=Hi(n,li)===Hi(r,li),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,g,m,u,p,b,y,_,v,B;for(a?d--:l||(d-=2),g=0,m=d-1;g<d;g++){switch(u=g/m,p=c[f],b=u*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),v=o*Math.sin(b),g){case 0:h=ge.move;break;default:h=ge.curve}p.command=h,p.x=_,p.y=v,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(B=o*y/Math.PI,p.controls.left.x=B*Math.cos(b-st),p.controls.left.y=B*Math.sin(b-st),p.controls.right.x=B*Math.cos(b+st),p.controls.right.y=B*Math.sin(b+st),g===1&&p.controls.left.multiplyScalar(2),g===m&&p.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=ge.close,f++):(d--,m=d-1),g=0;g<d;g++)u=g/m,p=c[f],b=(1-u)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),v=s*Math.sin(b),h=ge.curve,g<=0&&(h=a?ge.move:ge.line),p.command=h,p.x=_,p.y=v,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(B=s*y/Math.PI,p.controls.left.x=B*Math.cos(b+st),p.controls.left.y=B*Math.sin(b+st),p.controls.right.x=B*Math.cos(b-st),p.controls.right.y=B*Math.sin(b-st),g===1&&p.controls.left.multiplyScalar(2),g===m&&p.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=ge.line}else a||(c[f].command=ge.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=ge.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 Nn(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<Ee.Properties.length;d++){const h=Ee.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<Nn.Properties.length;r++){const s=Nn.Properties[r];n[s]=this[s]}return n}};k(Nn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let xo=Nn;const Qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},vo=Math.cos,ko=Math.sin,Fn=class Fn extends Ee{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Re(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 Jc)Object.defineProperty(this,c,Jc[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 Fn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Fn.Properties.length;r++){const s=Fn.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*li,d=s*vo(c),h=s*ko(c),f=o*vo(c-st),g=o*ko(c-st),m=o*vo(c+st),u=o*ko(c+st),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,g),p.controls.right.set(m,u)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Fn(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<Ee.Properties.length;s++){const o=Ee.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<Fn.Properties.length;r++){const s=Fn.Properties[r];n[s]=this[s]}return n}};k(Fn,"Properties",["radius"]);let Co=Fn;const Jc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},So=Math.cos,Bo=Math.sin,An=class An extends Ee{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 Re);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 ed)Object.defineProperty(this,d,ed[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 An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.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*li,d=s*So(c),h=o*Bo(c),f=s*r*So(c-st),g=o*r*Bo(c-st),m=s*r*So(c+st),u=o*r*Bo(c+st),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,g),p.controls.right.set(m,u)}}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 An(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<Ee.Properties.length;l++){const c=Ee.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<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};k(An,"Properties",["width","height"]);let To=An;const ed={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},kp=Math.cos,Cp=Math.sin,Mn=class Mn extends Ee{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 td)Object.defineProperty(this,a,td[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 Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.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=li*a+Math.PI/2,c=this._width*kp(l)/2,d=this._height*Cp(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ge.move:ge.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 Mn(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<Ee.Properties.length;s++){const o=Ee.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<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};k(Mn,"Properties",["width","height","sides"]);let Ro=Mn;const td={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Si=class Si extends Ee{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in nd)Object.defineProperty(this,l,nd[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new pe,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Si().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(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 Re),this.vertices[0].set(-n,-r).sub(this._origin).command=ge.move,this.vertices[1].set(n,-r).sub(this._origin).command=ge.line,this.vertices[2].set(n,r).sub(this._origin).command=ge.line,this.vertices[3].set(-n,r).sub(this._origin).command=ge.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=ge.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Si(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<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):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(Si,"Properties",["width","height","origin"]);let fr=Si;const nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(G.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Vn=class Vn extends Ee{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 Re(0,0,0,0,0,0,c===0?ge.move:ge.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 id)Object.defineProperty(this,c,id[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Sp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof pe)&&(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 pe?o:new pe().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 pe?(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<Ee.Properties.length;l++){const c=Ee.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 Po=Vn;const id={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof pe&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Sp(){this._flagRadius=!0}const Bp=Math.cos,Tp=Math.sin,In=class In extends Ee{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 rd)Object.defineProperty(this,l,rd[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 In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.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=li*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Bp(l),h=c*Tp(l);o>=s?this.vertices.push(new Re(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?ge.move:ge.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 In(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<Ee.Properties.length;l++){const c=Ee.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<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n}};k(In,"Properties",["innerRadius","outerRadius","sides"]);let $o=In;const rd={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Eo;const sd=Math.min,od=Math.max;mn.document&&(Eo=document.createElement("canvas"));const pt=class pt extends Tn{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,"_flagStrokeAttenuation",!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);k(this,"_strokeAttenuation",!0);for(let a in ad)Object.defineProperty(this,a,ad[a]);if(this._renderer.type="text",this._renderer.flagFill=Rp.bind(this),this._renderer.flagStroke=Pp.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,!$e.isObject(o))return this;for(let a=0;a<pt.Properties.length;a++){const l=pt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Eo){const r=Eo.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*pt.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:hi(n.fill),s=typeof n.stroke=="string"?n.stroke:hi(n.stroke),o=new pt().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<pt.Properties.length;r++){const s=pt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new pt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<pt.Properties.length;s++){const o=pt.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<pt.Properties.length;r++){const s=pt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}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}=pt.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[f,g]=r.multiply(s,a),[m,u]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=sd(g,u,b,_),s=sd(f,m,p,y),o=od(f,m,p,y),l=od(g,u,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(pt,"Ratio",.6),k(pt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let qi=pt;const ad={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Rp(){this._flagFill=!0}function Pp(){this._flagStroke=!0}const On=class On extends fr{constructor(n,r,s,o){super(r,s,0,0);k(this,"_flagTextures",!1);k(this,"_flagFrameRate",!1);k(this,"_flagIndex",!1);k(this,"_amount",1);k(this,"_duration",0);k(this,"_index",0);k(this,"_startTime",0);k(this,"_playing",!1);k(this,"_firstFrame",0);k(this,"_lastFrame",0);k(this,"_loop",!0);k(this,"_textures",null);k(this,"_frameRate",0);k(this,"_origin",null);this._renderer.type="image-sequence";for(let a in ld)Object.defineProperty(this,a,ld[a]);this._renderer.flagTextures=$p.bind(this),this._renderer.bindTextures=Ep.bind(this),this._renderer.unbindTextures=Np.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(cd.bind(this)):typeof n=="string"&&(this.textures=[cd(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=On.DefaultFrameRate,this.index=0}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])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=$e.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s: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(n){const r=new On(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,h;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,$e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=$e.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=qt(this._firstFrame,h,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof je))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(On,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),k(On,"DefaultFrameRate",30);let No=On;const ld={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(G.Types.insert,e).unbind(G.Types.remove,n),this._textures=new ci((t||[]).slice(0)),this._textures.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function $p(){this._flagTextures=!0}function Ep(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Np(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function cd(t){if(t instanceof je)return t;if(typeof t=="string")return new je(t)}const Bi=class Bi extends fr{constructor(n,r,s,o,a,l){super(r,s,0,0);k(this,"_flagTexture",!1);k(this,"_flagColumns",!1);k(this,"_flagRows",!1);k(this,"_flagFrameRate",!1);k(this,"_flagIndex",!1);k(this,"_amount",1);k(this,"_duration",0);k(this,"_startTime",0);k(this,"_playing",!1);k(this,"_firstFrame",0);k(this,"_lastFrame",0);k(this,"_loop",!0);k(this,"_texture",null);k(this,"_columns",1);k(this,"_rows",1);k(this,"_frameRate",0);k(this,"_index",0);k(this,"_origin",null);this._renderer.type="sprite";for(let c in dd)Object.defineProperty(this,c,dd[c]);this.noStroke(),this.noFill(),n instanceof je?this.texture=n:typeof n=="string"&&(this.texture=new je(n)),this.origin=new pe,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bi.Properties.length;r++){const s=Bi.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=$e.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s: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(n){const r=new Bi(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,h,f,g,m;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){f=n.image.width,g=n.image.height,o=f/r,a=g/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&($e.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=$e.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=qt(this._firstFrame,m,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const u=this._index%r,p=Math.floor(this._index/r),b=-o*u+(f-o)/2,y=-a*p+(g-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(Bi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Fo=Bi;const dd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},as=Math.min,ls=Math.max,nn=class nn extends Tn{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);k(this,"_strokeAttenuation",!0);for(let r in hd)Object.defineProperty(this,r,hd[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++)ud.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)ud.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new nn;for(let o=0;o<nn.Properties.length;o++){const a=nn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:hi(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 xo.fromObject(o);case"circle":return Co.fromObject(o);case"element":return hr.fromObject(o);case"ellipse":return To.fromObject(o);case"group":return nn.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return No.fromObject(o);case"path":return Ee.fromObject(o);case"points":return os.fromObject(o);case"polygon":return Ro.fromObject(o);case"rectangle":return fr.fromObject(o);case"rounded-rectangle":return Po.fromObject(o);case"shape":return Tn.fromObject(o);case"sprite":return Fo.fromObject(o);case"star":return $o.fromObject(o);case"text":return qi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new nn,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,$e.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}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,f=1/0,g=-1/0;const m=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let u=0;u<this.children.length;u++){const p=this.children[u];if(!(!p.visible||m.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||$e.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||$e.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||$e.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||$e.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,v]=s.multiply(r.right,r.top),[B,S]=s.multiply(r.left,r.bottom),[R,C]=s.multiply(r.right,r.bottom);f=as(y,v,S,C,f),d=as(b,_,B,R,d),h=ls(b,_,B,R,h),g=ls(y,v,S,C,g)}else f=as(r.top,f),d=as(r.left,d),h=ls(r.right,h),g=ls(r.bottom,g)}return{top:f,left:d,right:h,bottom:g,width:h-d,height:g-f}}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(nn,"Children",Zc),k(nn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Rn=nn;const hd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=Rn.InsertChildren.bind(this),n=Rn.RemoveChildren.bind(this),r=Rn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Zc(t),this._children.bind(G.Types.insert,e),this._children.bind(G.Types.remove,n),this._children.bind(G.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function ud(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class cs extends Ee{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in fd)Object.defineProperty(this,a,fd[a]);this.vertices[0].command=ge.move,this.vertices[1].command=ge.line,this.automatic=!1}}k(cs,"Properties",["left","right"]);const fd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if($e.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ge.move;else{const e=new ns("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if($e.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ge.line;else{const e=new ns("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Ao{constructor(e=0,n=0){this.x=e,this.y=n}}class yn{constructor(e=10,n=0,r="A"){k(this,"start",new Ao);k(this,"end",new Ao);this.width=e,this.angle=n,this.label=r}}const Oe={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"}},Fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ap(t,e){return i.openBlock(),i.createElementBlock("svg",Fp,[...e[0]||(e[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 ds=i.markRaw({name:"ion-close",render:Ap}),Mp={class:"mr-3 flex flex-col gap-2"},Vp=["onClick"],Ip={class:"h-full p-2"},Op={},zp=i.defineComponent({...Op,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((h,f)=>{var m;const g=(m=s.value)==null?void 0:m.at(f);g&&a("init-draw-template",g,h)}),(d=n.settings.customTemplates)==null||d.forEach((h,f)=>{var m;const g=(m=o.value)==null?void 0:m.at(f);g&&a("init-draw-template",g,h)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((h,f)=>{var g;if(!(d!=null&&d.includes(h))){const m=(g=o.value)==null?void 0:g.at(f);m&&a("init-draw-template",m,h)}}),d.length>c.length&&d.forEach((h,f)=>{var m;const g=(m=o.value)==null?void 0:m.at(f);g&&(g.innerHTML="",a("init-draw-template",g,h))})})},{deep:!0}),(c,d)=>{const h=ds;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Mp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(f,g)=>(i.openBlock(),i.createElementBlock("div",{key:`${f.id}-${g}`,class:"group relative"},[i.createVNode(i.unref(z.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":g===t.selectTemplateIndex}]),onClick:m=>a("template:select",g)},[i.createElementVNode("div",Ip,[i.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Vp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:m=>l(g)},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),gd=si(zp,[["__scopeId","data-v-69dd9f78"]]),Lp={class:"flex gap-3"},Dp={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Hp={ref:"drawing-container",class:"size-full"},Wp={},md=i.defineComponent({...Wp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((N,V)=>new yn(n.value.configuratorParams.linesWidths[V],N,`A-${V+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),g=i.computed(()=>{var N,V;return n.value.configuratorParams.startTailType&&((N=n.settings.startTailConfigs)!=null&&N[n.value.configuratorParams.startTailType])?(V=n.settings.startTailConfigs)==null?void 0:V[n.value.configuratorParams.startTailType].points:[]}),m=i.computed(()=>{var V;const N=n.value.configuratorParams.endTailType!==void 0&&((V=n.settings.endTailConfigs)==null?void 0:V[n.value.configuratorParams.endTailType]);return!N||!N.points?[]:N.points.map((q,X)=>Array.isArray(q)?new yn(q[0],q[1],`A-${X+1}`):new yn(q.width,q.angle,`A-${X+1}`))}),u=(N,V=!1)=>{N[0].start.x=0,N[0].start.y=0;let q=0;for(let X=0;X<N.length;X++){const I=N[X],W=N[X-1]??new yn(0,q);q+=!V||X>1?W.angle:0;const H=(!V||X>0?I.angle:0)+q;if(N[X].end.x=I.width*Math.cos(H*Math.PI/180)+N[X].start.x,N[X].end.y=I.width*Math.sin(H*Math.PI/180)+N[X].start.y,X<N.length-1){const U=X+1;N[U].start.x=N[X].end.x,N[U].start.y=N[X].end.y}}return N},p=(N,V,q,X,I=!1)=>{let W=u([...q,...X]);V.length>0&&(W=[...u(V),...W]);let H=0,U=0,fe=0,oe=0;W.forEach(Fe=>{H=Math.min(H,Fe.start.x,Fe.end.x),U=Math.min(U,Fe.start.y,Fe.end.y),fe=Math.max(fe,Fe.start.x,Fe.end.x),oe=Math.max(oe,Fe.start.y,Fe.end.y)});let re,Ne;H===0&&U===0&&fe===0&&oe===0?(re=1,Ne=1):(re=N.width/Math.abs(fe-H),Ne=(I?N.height:N.height-Oe.colorSideLabel.size)/Math.abs(oe-U));const Le=Math.min(re,Ne);return H=H<0?-H*Le:0,U=U<0?-U*Le:0,[Le,H,U]},b=N=>{const V=new os([N]);return V._size=Oe.anchorPoint.size,V.fill=Oe.anchorPoint.color,V.stroke="transparent",V._linewidth=Oe.anchorPoint.strokeSize,l.push(V),V},y=(N,V)=>{if(l=[],n.settings.allowChangeFirstPoint){const q=N[0],X=new pe(q.vertices[0].x,q.vertices[0].y);X.bind(G.Types.change,()=>{q.vertices[0].copy(X)});const I=b(X);V.add(I)}N.forEach((q,X)=>{const I=N[X+1],W=new pe(q.vertices[1].x,q.vertices[1].y);W.bind(G.Types.change,()=>{q.vertices[1].copy(W),I!==void 0&&I.vertices[0].copy(W)});const H=b(W);V.add(H)})},_=N=>N*(Math.PI/180),v=(N,V,q)=>{const X=V.vertices.length-1;N.position.x=V.vertices[X].x,N.position.y=V.vertices[X].y;const I=Math.atan2(V.vertices[X].y-V.vertices[0].y,V.vertices[X].x-V.vertices[0].x);N.rotation=_(q)+I},B=(N,V,q)=>{if(V.vertices[0]===void 0)return;N.position.x=V.vertices[0].x,N.position.y=V.vertices[0].y;const X=V.vertices.length-1,I=Math.atan2(V.vertices[X].y-V.vertices[0].y,V.vertices[X].x-V.vertices[0].x);N.rotation=_(q)+I},S=(N,V,q)=>{const X=new Rn;if(N.length===0)return X;const I=[];return[...N].reverse().forEach((W,H)=>{H!==0&&W.angle>0&&(W.angle*=-1),I.push(W)}),N=u(I,!0),B(X,V,N[0].angle),[V.vertices[0],V.vertices[1]].forEach(W=>{W.bind(G.Types.change,()=>{B(X,V,N[0].angle)})}),N.forEach(W=>{const H=W.start.x*q,U=W.end.x*q,fe=W.start.y*q,oe=W.end.y*q,re=new cs(H,fe,U,oe);re.linewidth=Oe.line.size,re.stroke=Oe.line.color,X.add(re)}),X},R=(N,V,q)=>{const X=new Rn;return N.length===0||(N=u(N,!0),v(X,V,N[0].angle),[V.vertices[0],V.vertices[1]].forEach(I=>{I.bind(G.Types.change,()=>{v(X,V,N[0].angle)})}),N.forEach(I=>{const W=I.start.x*q,H=I.end.x*q,U=I.start.y*q,fe=I.end.y*q,oe=new cs(W,U,H,fe);oe.linewidth=Oe.line.size,oe.stroke=Oe.line.color,X.add(oe)})),X},C=(N,V,q,X)=>{const I=V.vertices[0].x+(V.vertices[1].x-V.vertices[0].x)/2-8*Math.sin(N.angle*Math.PI/180),W=V.vertices[0].y+(V.vertices[1].y-V.vertices[0].y)/2-8*Math.cos(N.angle*Math.PI/180),H=new qi(N.label,I+10,W-10);let U;H.size=Oe.lineLabel.size,H.weight=600,H.fill=Oe.lineLabel.color,H.id+=1,H.rotation=Oe.lineLabel.rotation,X>0&&(U=new qi(`${N.angle}°`,V.vertices[0].x+25,V.vertices[0].y-25),U.size=Oe.angleLabel.size,U.weight=600,U.fill=Oe.angleLabel.color,U.rotation=Oe.angleLabel.rotation,U.id+=X,o.push(U),q.add(U)),q.add(H),x(H,V,0,U),x(H,V,1)},T=()=>{const{size:N}=Oe.colorSideLabel,V=0,q=0,X=f.value?N/2:N/2-N,I=f.value?N/2-N:N/2,W=new Rn;if(!c)return W;const H=5,U=Math.atan2(I-X,q-V),fe=[new Re(V,X,0,0,0,0,gn.Commands.move),new Re(q,I,0,0,0,0,gn.Commands.line),new Re(q-H*Math.cos(U-Math.PI/4),I-H*Math.sin(U-Math.PI/4),0,0,0,0,gn.Commands.line),new Re(q,I,0,0,0,0,gn.Commands.move),new Re(q-H*Math.cos(U+Math.PI/4),I-H*Math.sin(U+Math.PI/4),0,0,0,0,gn.Commands.line)],oe=new Ee(fe,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=N/7,oe.stroke=Oe.colorSideLabel.color,W.add(oe);const re=new qi(f.value?"Цвет снизу":"Цвет сверху",10,0);re.size=N,re.weight=600,re.fill=Oe.colorSideLabel.color,re.alignment="left",W.add(re);const Ne=W.getBoundingClientRect();return W.position.x=(c.width-Ne.width)*d+10,W.position.y=f.value?c.height+Ne.height*2:Ne.height/2,W},x=(N,V,q,X)=>{V.vertices[q].bind(G.Types.change,()=>{const I=V.vertices.length-1,W=Math.atan2(V.vertices[0].y-V.vertices[I].y,V.vertices[0].x-V.vertices[I].x)*180/Math.PI,H=V.vertices[0].x+(V.vertices[I].x-V.vertices[0].x)/2-8*Math.sin(W*Math.PI/180),U=V.vertices[0].y+(V.vertices[I].y-V.vertices[0].y)/2-8*Math.cos(W*Math.PI/180);N.position.x=H+10,N.position.y=U-10,N.rotation=-.5,X&&(X.position.x=V.vertices[0].x+25,X.position.y=V.vertices[0].y-25)})},P=(N,V,q,X,I=!1)=>{var Ut;if(N.clear(),q.length===0){N.update();return}const W=u(q),[H,U,fe]=p(N,V,W,X,I),oe=new Rn,re=new Array,Ne=new Array;I||(o=[],a=[]),W.forEach((Te,rn)=>{const sn=Te.start.x*H+U,Tt=Te.end.x*H+U,Ot=Te.start.y*H+fe,on=Te.end.y*H+fe,bt=new cs(sn,Ot,Tt,on);bt.linewidth=I?Oe.previewLine.size:Oe.line.size,bt.stroke=I?Oe.previewLine.color:Oe.line.color,a.push(bt),re.push(bt),oe.add(bt),!I&&Te.label!==""&&C(Te,bt,oe,rn)});const Le=re.at(-1);let Fe=oe.getBoundingClientRect();if(!I){const Te=T();Ne.push(Te)}if(V.length>0){const Te=S(V,re[0],H);oe.add(Te)}if(X.length>0&&Le){const Te=R(X,Le,H);oe.add(Te)}if(Ne.push(oe),N.makeGroup(Ne),Fe=oe.getBoundingClientRect(),oe.position.x=0-Fe.left+(N.width-Fe.width)/(2*(I?1:d)),oe.position.y=0-Fe.top+(N.height-Fe.height)/(2*(I?1:d)),N.update(),!I){const Te=((Ut=n.value.configuratorParams)==null?void 0:Ut.colorSide)==="top";oe.position.y=oe.position.y+Oe.colorSideLabel.size*Number(Te),y(re,oe),N.update()}},$=(N,V)=>{if(N&&!V.isNewRec()){const q=new gn({width:N.scrollWidth,height:N.scrollHeight});q.appendTo(N),P(q,[],V.points,[],!0)}},A=()=>{c&&P(c,g.value,h.value,m.value,!1)},F=N=>N*(180/Math.PI),O=(N,V)=>{const q=N[1].x-N[0].x,X=N[1].y-N[0].y,I=V[1].x-V[0].x,W=V[1].y-V[0].y;let H=Math.atan2(q*W-X*I,q*I+X*W);return H=F(H),Math.round(H)*-1},L=N=>{const V=a.map((q,X,I)=>{const W=I[X-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let H=Math.ceil(q._length/N/n.settings.lineWidthStep)*n.settings.lineWidthStep;const U=o[X-1];H<(I.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(H=I.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),H>n.settings.maxLineWidth&&(H=n.settings.maxLineWidth);const fe=O(q.vertices,W.vertices);return U&&(U.value=`${fe}°`),new yn(H,fe,`A-${X+1}`)});r("pointer:move",V)},J=N=>{let V=null,q;const X=U=>{V=l.find(fe=>{const oe=fe.renderer;return(oe==null?void 0:oe.elem)===U.target}),[q]=p(N,g.value,h.value.map(fe=>fe),m.value)},I=U=>{if(V){const fe=V.renderer,oe=fe==null?void 0:fe.elem;if(!oe)return;const re=oe.getBoundingClientRect();V.vertices[0].x-=re.x-(U instanceof MouseEvent?U.clientX:U.targetTouches[0].clientX)+Oe.anchorPoint.size/2,V.vertices[0].y-=re.y-(U instanceof MouseEvent?U.clientY:U.targetTouches[0].clientY)+Oe.anchorPoint.size/2,L(q),N.update()}},W=()=>{V&&r("pointer:up",h.value),V=null},H=s.value;H&&(H.addEventListener("touchstart",X,{passive:!0}),H.addEventListener("touchend",W,{passive:!0}),H.addEventListener("mousedown",X),H.addEventListener("mouseup",W),H.addEventListener("mousemove",I),H.addEventListener("touchmove",I,{passive:!0}))},ne=(N,V)=>{r("remove-custom-template",N,V)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{A()},{deep:!0,immediate:!0}),J(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(N,V)=>(i.openBlock(),i.createElementBlock("div",Lp,[i.createVNode(gd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":V[0]||(V[0]=q=>r("template:select",q)),onInitDrawTemplate:$,onRemoveCustomTemplate:ne},null,8,["select-template-index","settings"]),i.createElementVNode("div",Dp,[i.createElementVNode("div",Hp,null,512)])]))}});class Xi extends Q.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)=>M.isArray(s)?new yn(s[0],s[1],`A-${o+1}`):new yn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new yn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Mo extends Xi{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class pd{constructor(e){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");k(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Xi(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Mo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Mo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Xi(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Xi({label:"-- Новая конфигурация --",points:[new yn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Xi(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const jp={class:"flex max-w-[50rem] flex-col gap-3"},qp={},yd=i.defineComponent({...qp,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new pd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),f=i.ref(0),g=i.useTemplateRef("kozyrek-configurator-params-form");i.computed(()=>{const x=M.every(l.value.configuratorParams.linesWidths,F=>!!(F&&F>0)),P=M.every(l.value.configuratorParams.linesAngles,F=>!M.isNil(F)),$=!!(l.value.quantity&&l.value.quantity>0),A=l.value.configuratorParams.length>0&&l.value.configuratorParams.length>0;return x&&P&&$&&A});const m=(x=0)=>{var $;const P=($=c.value.allTemplates)==null?void 0:$.at(x);P!==void 0&&(f.value=x,l.value.configuratorParams.linesWidths=P.points.map(A=>M.isArray(A)?A[0]:A.width),l.value.configuratorParams.linesAngles=P.points.map(A=>M.isArray(A)?A[1]:A.angle),v()),y(l.value.configuratorParams)},u=async()=>{const x=prompt("Введите название шаблона:");if(!x)return;a.value=!0;const P={label:x,points:l.value.configuratorParams.linesWidths.map((A,F)=>[A,l.value.configuratorParams.linesAngles[F]])},$=A=>{A&&(c.value.addCustomTemplate(P),f.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:P,callback:$})},p=async(x,P)=>{var F;const $=(F=c.value.allTemplates)==null?void 0:F.at(x);if(!$||!$.isCustom)return;const A=O=>{O&&(c.value.removeCustomTemplate($.id),m()),P==null||P()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:$.id,callback:A})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async x=>{var P,$;l.value.product=new Q.Product,($=(P=g.value)==null?void 0:P.formReference)==null||$.validate(A=>{A||(v(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:x,validationFieldResultData:h.value,callback:F=>{F?l.value.product=F:h.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(M.noop)},_=async()=>{var x,P;(P=(x=g.value)==null?void 0:x.formReference)==null||P.validate($=>{$||(o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1,i.nextTick(()=>{var A,F;(F=(A=g.value)==null?void 0:A.formReference)==null||F.restoreValidation()})}))}).catch(M.noop)},v=()=>{const x={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((P,$)=>{x[`lines_widths[${$+1}]`]={},x[`lines_angles[${$+1}]`]={}}),h.value=x},B=x=>{d.value.linesWidths=x.map(P=>P.width),d.value.linesAngles=x.map(P=>P.angle)},S=x=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,v(),b(),y(l.value.configuratorParams)},R=(x,P)=>{d.value.linesWidths=x,d.value.linesAngles=P},C=x=>{const P=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(x+1,0,P),l.value.configuratorParams.linesAngles.splice(x+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],v(),b(),y(l.value.configuratorParams)},T=x=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(x,1),l.value.configuratorParams.linesAngles.splice(x,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],v(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{m()}),i.watch(()=>n.cartItem,x=>{l.value=new Q.CartItemBase(x),m()}),(x,P)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",jp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:P[0]||(P[0]=A=>r("click:view-switch"))},{default:i.withCtx(()=>[...P[3]||(P[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(md,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":S,"onPointer:move":B,"onTemplate:select":m,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(tl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":P[1]||(P[1]=A=>l.value=A),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":P[2]||(P[2]=A=>y(A)),"onUpdate:preview":R,onSubmit:_,"onClick:saveTemplate":u,"onClick:addLine":C,"onClick:removeLine":T},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Xp={},Yi=i.defineComponent({...Xp,__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},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=M.debounce(()=>s("update:value",o.value),a.value),c=m=>{o.value=m,l()};i.watch(()=>r.value,m=>{o.value=m});const d=i.ref(null);return e({focus:()=>{var m;return(m=d.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=d.value)==null?void 0:m.blur()},select:()=>{var m;return(m=d.value)==null?void 0:m.select()}}),(m,u)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:u[0]||(u[0]=p=>s("keydown",p)),onInput:u[1]||(u[1]=p=>s("input",p))},{prefix:i.withCtx(()=>[i.renderSlot(m.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),Yp={key:0,class:"flex items-baseline gap-1"},Up={key:0,class:"flex items-baseline gap-1"},Kp={key:1},Gp={class:"text-lg font-semibold"},Zp={key:2,class:"text-red-500 text-sm mb-2"},Qp={class:"flex gap-3"},Jp={},bd=i.defineComponent({...Jp,__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(t,{expose:e,emit:n}){var C;const r=t,s=n,o=i.computed(()=>wt.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),h=i.ref(M.cloneDeep(r.value)),f=i.computed(()=>r.settings.widthOverlaps[h.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.heightOverlaps[h.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.maxWidths[h.value.configuratorParams.netType]),u=i.computed(()=>r.settings.maxHeights[h.value.configuratorParams.netType]),p=i.computed(()=>h.value.configuratorParams.width?h.value.configuratorParams.width+f.value:0),b=i.computed(()=>h.value.configuratorParams.height?h.value.configuratorParams.height+g.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[he.required,he.min(r.settings.minWidth-f.value),he.max(m.value-f.value),he.step(1),Ze.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[he.required,he.min(r.settings.minHeight-g.value),he.max(u.value-g.value),he.step(1),Ze.serverValidation(r.validation.height.feedback)],quantity:[he.required,he.min(1),he.step(1),Ze.serverValidation(r.validation.quantity.feedback)],marker:[Ze.serverValidation(r.validation.marker.feedback)]})),v=i.computed(()=>{var F;const T=p.value,x=b.value,{quantity:P}=r.value,$=((F=r.value.product)==null?void 0:F.costRub)||0;if(!T||!x||!P||$===0)return null;const A=T*x/1e6;return($*P*A).toLocaleString("ru-ru",{minimumFractionDigits:2})}),B=i.computed(()=>{const T=p.value,x=b.value,P=!!(T&&T>=r.settings.minWidth&&T<=r.settings.maxWidths[h.value.configuratorParams.netType]),$=!!(x&&x>=r.settings.minHeight&&x<=r.settings.maxHeights[h.value.configuratorParams.netType]),A=!!(r.value.quantity&&r.value.quantity>0);return P&&$&&A}),S=(T,x)=>{var A,F;const P=h.value.configuratorParams;T&&T in P&&(P[T]=x);const $={...P,width:p.value??0,height:b.value??0};T==="width"&&((A=l.value)==null||A.validate().catch(M.noop)),T==="height"&&((F=c.value)==null||F.validate().catch(M.noop)),i.nextTick(()=>{var L,J;!((L=l.value)!=null&&L.validationErrored)&&!((J=c.value)!=null&&J.validationErrored)&&$.height&&$.width&&s("update:params",$),R("configuratorParams",$)})},R=(T,x)=>{const P=new Q.CartItemBase(r.value);P[T]=x,T==="configuratorParams"&&(P.product=new Q.Product),s("update:value",P)};return i.watch(()=>r.value,T=>{const x=M.cloneDeep(i.toRaw(T)),P=x.configuratorParams.mountType,$=r.settings.widthOverlaps[P]??0,A=r.settings.heightOverlaps[P]??0;x.configuratorParams.width&&x.configuratorParams.width>0&&(x.configuratorParams.width-=$),x.configuratorParams.height&&x.configuratorParams.height>0&&(x.configuratorParams.height-=A),h.value=x},{deep:!0}),i.onMounted(()=>{var T;(T=d.value)==null||T.select()}),e({validate:(C=a.value)==null?void 0:C.validate,formReference:a}),(T,x)=>{const P=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:h.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96",onKeydown:x[25]||(x[25]=i.withKeys(i.withModifiers($=>s("submit",h.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.netType,"onUpdate:value":[x[0]||(x[0]=$=>h.value.configuratorParams.netType=$),x[1]||(x[1]=$=>S("netType",$))],options:t.settings.netType.map($=>({label:t.settings.descriptions.net_type[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.color,"onUpdate:value":[x[2]||(x[2]=$=>h.value.configuratorParams.color=$),x[3]||(x[3]=$=>S("color",$))],options:t.settings.color.map($=>({label:t.settings.descriptions.color[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.mountType,"onUpdate:value":[x[4]||(x[4]=$=>h.value.configuratorParams.mountType=$),x[5]||(x[5]=$=>S("mountType",$))],options:t.settings.mountType.map($=>({label:t.settings.descriptions.mount_type[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Yp,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[10]||(x[10]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[26]||(x[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-reference",value:h.value.configuratorParams.width,"onUpdate:value":[x[6]||(x[6]=$=>h.value.configuratorParams.width=$),x[9]||(x[9]=$=>S("width",$))],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[7]||(x[7]=$=>i.unref(_t)($)),onInput:x[8]||(x[8]=$=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-g.value} ${u.value?" до "+(u.value-g.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Up,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[15]||(x[15]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[27]||(x[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{value:h.value.configuratorParams.height,"onUpdate:value":[x[11]||(x[11]=$=>h.value.configuratorParams.height=$),x[14]||(x[14]=$=>S("height",$))],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[12]||(x[12]=$=>i.unref(_t)($)),onInput:x[13]||(x[13]=$=>i.unref(Ke)(t.validation,"height"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:h.value.quantity,"onUpdate:value":[x[16]||(x[16]=$=>h.value.quantity=$),x[19]||(x[19]=$=>R("quantity",$??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[17]||(x[17]=$=>i.unref(_t)($,!1)),onInput:x[18]||(x[18]=$=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:x[20]||(x[20]=$=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":x[21]||(x[21]=$=>{h.value.marker=$??null,R("marker",$??null)})},null,8,["value"])]),_:1}),y.value?(i.openBlock(),i.createBlock(P,{key:0,checked:h.value.dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[22]||(x[22]=$=>{h.value.dopProdaga=$??!1,R("dopProdaga",$??!1)})},{default:i.withCtx(()=>[...x[28]||(x[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ar,{"is-product-searching":t.isProductSearching,product:h.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),v.value?(i.openBlock(),i.createElementBlock("div",Kp,[x[29]||(x[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Gp,i.toDisplayString(v.value)+" ₽",1)])):i.createCommentVNode("",!0),B.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Zp," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Qp,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!B.value||h.value.product.isNewRec(),type:"primary",class:"self-start",onClick:x[23]||(x[23]=$=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:x[24]||(x[24]=$=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...x[30]||(x[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),ey="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",ty="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",ny="/img/configurators/mosquitto/measurement-instructions/mount.png",iy="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ry="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",sy={class:"flex flex-col gap-6"},oy={class:"flex gap-4"},ay={class:"flex flex-col gap-2"},ly={class:"flex gap-4"},cy={class:"flex flex-col gap-2"},dy={class:"flex gap-4"},hy={class:"flex flex-col gap-2"},uy={},_d=i.defineComponent({...uy,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=wt.initRefDependingOnDeviceResolution("small","small","medium"),r=wt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.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",sy,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),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:ey,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:ty,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",oy,[l[9]||(l[9]=i.createElementVNode("img",{src:ny,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",ay,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",ly,[l[15]||(l[15]=i.createElementVNode("img",{src:iy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",cy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",dy,[l[21]||(l[21]=i.createElementVNode("img",{src:ry,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",hy,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),fy={class:"flex flex-col items-center justify-between rounded-xl"},gy={class:"img-preview relative flex justify-center"},my={},py=i.defineComponent({...my,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",fy,[i.createElementVNode("div",gy,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.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)])]),_:1})])}}}),Vo=si(py,[["__scopeId","data-v-a67fd61e"]]),yy={class:"grid md:grid-cols-2"},by={},wd=i.defineComponent({...by,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>wt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),h=i.ref(!1),f=i.ref(!1),g=async u=>{var p,b;l.value.product=new Q.Product,(b=(p=c.value)==null?void 0:p.formReference)==null||b.validate(y=>{y||(h.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:u,validationFieldResultData:d.value,callback:_=>{_?l.value.product=_:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},h.value=!1}}))}).catch(M.noop)},m=()=>{f.value=!0,r("submit",l.value,d.value,()=>{f.value=!1})};return i.watch(()=>n.cartItem,u=>{l.value=u},{deep:!0}),(u,p)=>{const b=ds;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(_d,{show:a.value,"onUpdate:show":p[0]||(p[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",yy,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":p[4]||(p[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:p[2]||(p[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Vo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[3]||(p[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Vo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[1]||(p[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(bd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":p[5]||(p[5]=y=>l.value=y),validation:d.value,settings:t.settings,"is-product-searching":h.value,"is-submit-processing":f.value,"onUpdate:params":p[6]||(p[6]=y=>g(y)),onSubmit:p[7]||(p[7]=y=>m()),"onClick:instructionsToggle":p[8]||(p[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":p[9]||(p[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),_y={},xd=i.defineComponent({..._y,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},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:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var g;return!((g=c.value)!=null&&g.validationErrored)}),h=g=>{l.value=g,s("update:value",g,r.index,a)},f=()=>{var g;(g=o.value)==null||g.select()};return i.watch(()=>r.value,g=>{l.value=g}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(g,m)=>{const u=el,p=Ja;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(ar,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:h},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(Gt),placeholder:"Введите ширину",onKeydown:m[0]||(m[0]=b=>i.unref(_t)(b)),onInput:m[1]||(m[1]=b=>i.unref(Ke)(t.validation,`linesWidths.${t.index}`)),"onUpdate:value":h},null,8,["value","parse"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[2]||(m[2]=b=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[3]||(m[3]=b=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),wy={class:"my-2 flex w-full flex-col"},xy={key:1},vy={class:"text-lg font-semibold"},ky={class:"flex gap-3"},Cy={},vd=i.defineComponent({...Cy,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var y;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const _={length:[he.required,he.min(r.settings.minLength),he.max(r.settings.maxLength),he.step(r.settings.lengthStep),Ze.serverValidation(r.validation.length.feedback)],quantity:[he.required,he.min(1),Ze.serverValidation(r.validation.quantity.feedback)],marker:[Ze.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(v,B)=>{var S;_[`configuratorParams.linesWidths.${B}`]=[he.required,he.min(r.settings.minLineWidth),he.step(r.settings.lineWidthStep),Ze.serverValidation((S=r.validation[`linesWidths.${B}`])==null?void 0:S.feedback)]}),_}),d=i.ref(r.settings.canSetDopProdaga??!1),h=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((_,v)=>(_??0)+(v??0),0)),f=i.computed(()=>r.settings.width-h.value),g=i.computed(()=>!r.value.some(({product:_})=>!_||_.isNewRec())),m=i.computed(()=>_=>f.value===0?void 0:[{label:`${(f.value>0?"Остаток +":"Излишек ")+f.value} мм.`,key:f.value+_}]),u=i.computed(()=>{const{length:_}=r.value[0];return!_||h.value!==r.settings.width?null:(M.reduce(r.value,(B,S)=>{var C;const R=((C=S.product)==null?void 0:C.costRub)||0;return B+R},0)*r.value[0].quantity*_).toLocaleString("ru-ru",{minimumFractionDigits:2})}),p=(_,v,B)=>{var R,C,T;l.value[v].product.id=-1;const{configuratorParams:S}=l.value[v];S.linesWidths[v]=_,b("configuratorParams",S),(T=(C=(R=a.value)==null?void 0:R.at(v))==null?void 0:C.formItemReference)==null||T.validate().catch(M.noop),i.nextTick(()=>{var x,P;(P=(x=a.value)==null?void 0:x.at(v))!=null&&P.isValid&&s("update:params",S,v,B)})},b=(_,v)=>{l.value.forEach(B=>{B[_]=v}),s("update:value",l.value)};return i.watch(()=>r.value,_=>{l.value=M.cloneDeep(_)},{deep:!0}),e({validate:(y=o.value)==null?void 0:y.validate,formReference:o}),(_,v)=>{const B=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2",onKeydown:v[15]||(v[15]=i.withKeys(i.withModifiers(S=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var S;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(R,C)=>(i.openBlock(),i.createBlock(xd,{key:C,ref_for:!0,ref:"line-items-reference",value:R.configuratorParams.linesWidths.at(C)??null,"auto-focus":!0,index:C,path:`configuratorParams.linesWidths.${C}`,product:R.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(R.configuratorParams.linesWidths.at(C)??0),"add-line-button-disabled":f.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(T=>T.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":p,"onClick:addLine":v[0]||(v[0]=T=>s("click:add-line",T)),"onClick:removeLine":v[1]||(v[1]=T=>s("click:remove-line",T))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",wy,[f.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),g.value&&l.value.length===t.settings.maxLinesCount&&f.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...v[16]||(v[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[v[17]||(v[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:f.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{disabled:t.isSubmitProcessing||!g.value||f.value<=0||l.value.length>=t.settings.maxLinesCount||t.value.some(R=>R.product.isNewRec()),type:"primary",class:"self-center",onClick:v[2]||(v[2]=R=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...v[18]||(v[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[v[3]||(v[3]=R=>l.value[0].length=R),v[6]||(v[6]=R=>b("length",R))],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[4]||(v[4]=R=>i.unref(_t)(R,!1)),onInput:v[5]||(v[5]=R=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[v[7]||(v[7]=R=>l.value[0].quantity=R),v[10]||(v[10]=R=>b("quantity",R))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[8]||(v[8]=R=>i.unref(_t)(R,!1)),onInput:v[9]||(v[9]=R=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:v[11]||(v[11]=R=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":v[12]||(v[12]=R=>{l.value[0].marker=R??null,b("marker",R??null)})},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createBlock(B,{key:0,checked:l.value[0].dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[13]||(v[13]=R=>{l.value[0].dopProdaga=R??!1,b("dopProdaga",R??!1)})},{default:i.withCtx(()=>[...v[19]||(v[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",xy,[v[20]||(v[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",vy,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",ky,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||f.value!=0||!((S=l.value[0])!=null&&S.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:v[14]||(v[14]=R=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),Sy={class:"flex grow flex-col"},By=["src"],Ty={class:"w-full"},Ry={},kd=i.defineComponent({...Ry,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Sy,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,By),i.createElementVNode("div",Ty,[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)])]))}}),Py={class:"flex flex-col gap-2"},$y={class:"w-104 flex grow flex-col px-5"},Ey={},Cd=i.defineComponent({...Ey,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>o.value[0].configuratorParams.linesWidths.reduce((m,u)=>(m??0)+(u??0),0)),d=m=>{m===void 0&&(m=o.value.length-1);const u=o.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(m+1,0,null),o.value.forEach(b=>{b.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const p=new Q.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});o.value=o.value.toSpliced(m+1,0,p)},h=m=>{const u=o.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(m,1),o.value.forEach(p=>{p.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),o.value=o.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},f=async(m,u,p)=>{const b={linesWidths:m.linesWidths.at(u)};p.value=!0,a.value[`linesWidths.${u}`]={},o.value[u].product=new Q.Product,n.eventEmitter.emit("configurator:search-product",{category:o.value[u].category,params:b,validationFieldResultData:a.value,callback:y=>{y?(o.value[u].product=y,u===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&c.value&&c.value<n.settings.width&&d()):(o.value[u].product=new Q.Product,a.value[`linesWidths.${u}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},p.value=!1),p.value=!1}})},g=async()=>{var m,u;(u=(m=s.value)==null?void 0:m.formReference)==null||u.validate(p=>{if(!p){l.value=!0;const b=o.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var y,_;(_=(y=s.value)==null?void 0:y.formReference)==null||_.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,m=>{o.value=m.map(u=>new Q.CartItemBase(u))}),(m,u)=>{const p=z.NButton;return i.openBlock(),i.createElementBlock("div",Py,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[3]||(u[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",$y,[i.createVNode(kd,{value:o.value,"onUpdate:value":u[1]||(u[1]=b=>o.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(vd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":u[2]||(u[2]=b=>o.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":f,onSubmit:g,"onClick:addLine":d,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing"])])])}}}),Ny={class:"flex flex-col gap-3"},Fy={},Sd=i.defineComponent({...Fy,__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","submit"],setup(t,{expose:e,emit:n}){var m;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[he.required,he.min(r.settings.minWidth),...r.settings.maxWidth?[he.max(r.settings.maxWidth)]:[],he.step(1),Ze.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[he.required,he.min(r.settings.minLength),he.max(r.settings.maxLength),he.step(1),Ze.serverValidation(r.validation.length.feedback)],quantity:[he.required,he.min(1),he.step(1),Ze.serverValidation(r.validation.quantity.feedback)],marker:[Ze.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),h=()=>{s("update:params",l.value.configuratorParams),f("configuratorParams",l.value.configuratorParams)},f=(u,p)=>{const b=new Q.CartItemBase(r.value);b[u]=p,u==="configuratorParams"&&(b.product=new Q.Product),s("update:value",b)},g=()=>{var u;(u=a.value)==null||u.select()};return i.watch(()=>r.value,u=>{l.value=M.cloneDeep(u)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{g()})}),e({validate:(m=o.value)==null?void 0:m.validate,formReference:o}),(u,p)=>{const b=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),h],class:"w-full",parse:i.unref(Gt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(_t)(y)),onInput:p[2]||(p[2]=y=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),h],placeholder:"Введите длину",parse:i.unref(Gt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(_t)(y)),onInput:p[5]||(p[5]=y=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(_t)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(Ke)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>f("quantity",y??0))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>f("marker",y??null))},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.dopProdaga=y??!1,f("dopProdaga",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ar,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Ny,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),Ay={class:"flex flex-col gap-2 w-72"},My={},Bd=i.defineComponent({...My,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=async f=>{var g,m;o.value.product=new Q.Product,(m=(g=s.value)==null?void 0:g.formReference)==null||m.validate(u=>{u||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:p=>{p?o.value.product=p:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},h=async()=>{var f,g;(g=(f=s.value)==null?void 0:f.formReference)==null||g.validate(m=>{m||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var u,p;(p=(u=s.value)==null?void 0:u.formReference)==null||p.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,f=>{o.value=new Q.CartItemBase(f)},{deep:!0}),(f,g)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",Ay,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=u=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Sd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=u=>o.value=u),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=u=>d(u)),onSubmit:g[3]||(g[3]=u=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Vy={key:0,class:"flex justify-center p-4"},Iy={key:1,class:"p-4 text-center text-red-500"},Oy={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},zy={key:3,class:"p-4 text-center text-gray-500"},Td=i.defineComponent({__name:"dynamic-configurator",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function]},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function]},categoryContextButtonsConfig:{type:Function},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configuratorSettings}),o=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configurator}),a=i.ref(null),l=i.ref(null),c=()=>{var g,m;if(!s.value){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:e.categoryItem,configurator:o.value,quantity:1};switch(o.value){case"kozyrek":{const u=s.value;a.value=new Q.CartItemBase({...f,configuratorParams:{length:u.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(u.startTailConfigs,p=>p.isDefault)?(g=u.startTailConfigs)==null?void 0:g.findIndex(p=>p.isDefault):void 0,endTailType:M.some(u.endTailConfigs,p=>p.isDefault)?(m=u.endTailConfigs)==null?void 0:m.findIndex(p=>p.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const u=s.value;a.value=new Q.CartItemBase({...f,configuratorParams:{width:0,height:0,netType:u.netType[0]||"",color:u.color[0]||"",mountType:u.mountType[0]||""}});break}case"strip":{const u=s.value;l.value=[new Q.CartItemBase({...f,length:u.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const u=s.value;a.value=new Q.CartItemBase({...f,configuratorParams:{width:u.minWidth,length:u.minLength}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${o.value}.`}a.value&&(a.value.marker=void 0)},d=(f,g,m)=>{const u=p=>{m==null||m(),p&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:u,validation:g})},h=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})};return i.onMounted(()=>{c()}),(f,g)=>{const m=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",Vy,[i.createVNode(m,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",Iy,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),s.value!==null&&(a.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",Oy,[o.value==="kozyrek"?(i.openBlock(),i.createBlock(yd,{key:0,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="mosquitto"?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="strip"?(i.openBlock(),i.createBlock(Cd,{key:2,"event-emitter":t.eventEmitter,settings:s.value,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):o.value==="metal_for_doors"?(i.openBlock(),i.createBlock(Bd,{key:3,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",zy,' Конфигуратор "'+i.toDisplayString(o.value)+'" не поддерживается. ',1))],64)}}}),Ly={key:0,class:"pt-0.5"},Dy={key:0},Hy={class:"line-through"},Wy={key:0},jy={key:1},qy={class:"flex flex-row gap-1"},Xy={key:0},Yy={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Uy={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ky={key:2,class:"flex flex-col"},Gy={},Zy=i.defineComponent({...Gy,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},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},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Ar,"medium"),r=i.computed(()=>{var H;return(H=e==null?void 0:e.filteredItems)==null?void 0:H[e.categoryItem.id]}),s=i.computed(()=>{var H,U;return M.isArray((H=e.categoryItem)==null?void 0:H.categories)&&((U=e.categoryItem.categories)==null?void 0:U.length)>0}),o=i.computed(()=>{var H;return M.isArray((H=e.categoryItem)==null?void 0:H.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([H,U])=>`${U} руб./${$(H)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(H=>{var fe;const U=(fe=r.value)==null?void 0:fe.products;return M.isArray(U)&&U.includes(H.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),f=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),g=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=i.computed(()=>{var H,U;return((H=e.categoryItem.properties)==null?void 0:H.configurator)!==void 0&&((U=e.categoryItem.properties)==null?void 0:U.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),u=i.computed(()=>{var H,U;return((H=e.categoryItem.properties)==null?void 0:H.configurator)!==void 0&&((U=e.categoryItem.properties)==null?void 0:U.configuratorSettings)!==void 0&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new Q.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),v=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),B=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),S=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),R=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),C=i.computed(()=>X.value&&wt.getDeviceTypeByResolution()===Ye.laptop?"auto":"fixed"),T=i.useTemplateRef("collapse-item-reference"),x=i.computed(()=>{var H,U;return(U=(H=e.categoryItem.properties)==null?void 0:H.templateCost)==null?void 0:U.priceCoefficient}),P=i.computed(()=>{var H,U;return(U=(H=e.categoryItem.properties)==null?void 0:H.templateCost)==null?void 0:U.increasePercent}),$=(H,U="ru-RU")=>0 .toLocaleString(U,{style:"currency",currency:H,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=H=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:H,target:T.value})},F=(H,U)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:U,isLoadingState:y,target:T.value})},O=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:T.value})},L=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:T.value})},J=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:T.value})},ne=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:T.value})},N=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:T.value})},V=H=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:H,target:T.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},X=i.ref(0),I=i.computed(()=>X.value&&o.value.length>0?Tg(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),W=M.debounce(()=>{X.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",W)}),window.addEventListener("resize",W),W(),(H,U)=>{const fe=z.NCheckbox,oe=uf,re=z.NTooltip,Ne=cf,Le=z.NTag,Fe=of,Ut=nf,Te=z.NButton,rn=Ju,sn=Xa,Tt=qa,Ot=ja,on=Wa,bt=z.NDropdown,zn=z.NDataTable,an=z.NAlert,Kt=z.NSpin;return i.openBlock(),i.createBlock(Ya,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":F},{"pre-arrow":i.withCtx(()=>{var Pe,K;return[v.value?(i.openBlock(),i.createElementBlock("div",Ly,[i.createVNode(fe,{checked:B.value,indeterminate:R.value,disabled:S.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Pe=b.value)!=null&&Pe.isDisabled)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[U[1]||(U[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((K=b.value)==null?void 0:K.isFavorite)??!1?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ne,{class:"pt-1.5"})]),default:i.withCtx(()=>[U[2]||(U[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Pe,K,se,Ie,Jn;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Pe=b.value)==null?void 0:Pe.isDisabled})},[i.createVNode(re,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[U[3]||(U[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:U[0]||(U[0]=i.withModifiers((...Qe)=>i.unref(M.noop)&&i.unref(M.noop)(...Qe),["prevent","stop"]))},[(K=t.categoryItem.properties)!=null&&K.m2Price?(i.openBlock(),i.createBlock(Le,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((se=t.categoryItem.properties)==null?void 0:se.templateCost)&&t.categoryItem.properties.m2PriceRetail&&P.value}),round:""},{default:i.withCtx(()=>{var Qe;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Qe=t.categoryItem.properties)!=null&&Qe.templateCost&&t.categoryItem.properties.m2PriceRetail&&P.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[P.value?(i.openBlock(),i.createBlock(Le,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[P.value?(i.openBlock(),i.createElementBlock("span",Dy,i.toDisplayString(P.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(Le,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",Hy,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Ie=t.categoryItem.properties)!=null&&Ie.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x.value||P.value?(i.openBlock(),i.createBlock(Le,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Qe;return[x.value?(i.openBlock(),i.createElementBlock("span",Wy,i.toDisplayString((Qe=x.value)==null?void 0:Qe.name),1)):i.createCommentVNode("",!0),P.value?(i.openBlock(),i.createElementBlock("span",jy,i.toDisplayString(P.value>0?"+":"")+i.toDisplayString(P.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Le,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((Jn=b.value)!=null&&Jn.manager)?(i.openBlock(),i.createBlock(Le,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ne},{default:i.withCtx(()=>[i.createVNode(re,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Qe,zt;return[i.createElementVNode("span",qy,[i.createVNode(Fe),i.createTextVNode(" "+i.toDisplayString((zt=(Qe=b.value)==null?void 0:Qe.manager)==null?void 0:zt.name),1)])]}),default:i.withCtx(()=>{var Qe,zt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((zt=(Qe=b.value)==null?void 0:Qe.manager)==null?void 0:zt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Xy,[i.createElementVNode("ul",Yy,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Pe,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Pe,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Pe;return[i.createElementVNode("div",Uy,[d.value?(i.openBlock(),i.createBlock(re,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:O},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createBlock(oe,{key:1})):(i.openBlock(),i.createBlock(Ut,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Pe=b.value)!=null&&Pe.manager)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:J},{default:i.withCtx(()=>[i.createVNode(rn)]),_:1},8,["size"])]),default:i.withCtx(()=>{var K,se,Ie;return[(K=b.value)!=null&&K.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ie=(se=b.value)==null?void 0:se.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,disabled:f.value==="disabled",size:i.unref(n),onClick:L},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isRequired?(i.openBlock(),i.createBlock(Tt,{key:1})):(i.openBlock(),i.createBlock(sn,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[U[4]||(U[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(re,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary",onClick:N},{default:i.withCtx(()=>[i.createVNode(Ot)]),_:1},8,["size"])]),default:i.withCtx(()=>[U[5]||(U[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(bt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:V},{default:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(on)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(H.$slots,"default",{},()=>{var Pe;return[s.value?(i.openBlock(),i.createBlock(Pd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Pe=r.value)==null?void 0:Pe.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(Td,{key:1,"event-emitter":t.eventEmitter,"category-item":t.categoryItem},null,8,["event-emitter","category-item"])):c.value?(i.openBlock(),i.createElementBlock("div",Ky,[m.value?(i.openBlock(),i.createBlock(Te,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:i.withCtx(()=>[...U[6]||(U[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(zn,{columns:I.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":K=>K.id,"table-layout":C.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(an,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(an,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Kt,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...U[7]||(U[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Qy=si(Zy,[["__scopeId","data-v-9320b350"]]),Jy={class:"sc-collapse flex w-full flex-col"},e0={},Rd=i.defineComponent({...e0,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,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",Jy,[i.renderSlot(o.$slots,"default")]))}}),t0={},Pd=i.defineComponent({...t0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},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},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Ar,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(M.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=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Rd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Qy,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.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),!t.hasProducts&&!t.loading&&t.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)}}}),n0={},$d=i.defineComponent({...n0,__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(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=new Q.Reference,l=i.computed(()=>{const m=o.value?[]:a,u=M.isUndefined(r.value)?m:r.value;return M.isArray(u)?u.map(p=>p.id):u==null?void 0:u.id}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=m=>{var u;if(M.isArray(m)){const p=m.length>0?m.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=m===a.id||(u=c.value.find(b=>b.value===m))==null?void 0:u.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var m;return(m=h.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=h.value)==null?void 0:m.blur()}}),(m,u)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),i0={},r0=i.defineComponent({...i0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var v,B;const n=t,r=e,s=()=>{const S=Q.PriceCoefficient.getRetailPriceCoefficient();return M.unset(S,"isNewRec"),S},o=S=>!S||S.id===s().id,a=i.computed(()=>{var S;return((S=n.catalogItem)==null?void 0:S.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=S=>{var R,C,T,x;return S.id===s().id?(R=l.value)==null?void 0:R.getRetailCost():(x=(T=(C=l.value)==null?void 0:C.priceCoefficients)==null?void 0:T.find(P=>P.coefficient.id===S.id))==null?void 0:x.cost},d=i.computed(()=>{var R;const S=[...((R=Q.useReferencesStore().priceCoefficientsReference)==null?void 0:R.map(C=>structuredClone(i.toRaw(C))))??[],s()];return a.value&&S.forEach(C=>{var x;const T=c(C);T?C.name+=` (${T} ${(x=l.value)==null?void 0:x.currency})`:C.name=""}),S.filter(C=>C.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null),g=i.ref(null),m=i.computed(()=>{var S,R;return(R=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:R.find(C=>C.coefficient.slug===Q.PriceCoefficientEnum.K0)}),u=i.ref(void 0),p=()=>{var R,C,T;u.value=void 0;let S=Number.parseFloat(((R=f.value)==null?void 0:R.replace(",","."))??"");if(S=Number.isNaN(S)?void 0:S,a.value)if(h.value||f.value){const x=s(),P=c(h.value??x)??0,$=P+P*((S??0)/100);g.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format($),$>(((C=l.value)==null?void 0:C.getRetailCost())??$)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&$<(((T=m.value)==null?void 0:T.cost)??0)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else g.value=null;r("update:value",{value:Number.isNaN(S)?void 0:S,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},b=S=>{M.isArray(S)||(h.value=S,f.value=null,!h.value&&f.value&&(h.value=s()),p())},y=()=>{h.value||(h.value=s()),p()},_=S=>{var C,T,x,P,$,A;const R=Number.parseFloat((S==null?void 0:S.replace(",","."))??"");if(a.value){let F=0;if(R<=0)h.value=void 0,f.value=null;else if(m.value&&R<(((C=m.value)==null?void 0:C.cost)??0))h.value=(T=m.value)==null?void 0:T.coefficient,F=(R-m.value.cost)*100/m.value.cost,u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(R>(((x=l.value)==null?void 0:x.getRetailCost())??R)){h.value=s();const O=((P=l.value)==null?void 0:P.getRetailCost())??0;F=(R-O)*100/O,u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const O=(A=($=l.value)==null?void 0:$.priceCoefficients)==null?void 0:A.filter(L=>L.cost<R);if(O&&O.length>0){const L=O.at(-1);h.value=L==null?void 0:L.coefficient,F=(R-((L==null?void 0:L.cost)??0))*100/((L==null?void 0:L.cost)??1)}u.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(F),r("update:value",{value:Number.isNaN(F)?void 0:F,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:void 0})};return i.onMounted(()=>{var S,R,C,T;n.calculationType===Q.CalculationTypeEnum.m2Cost?g.value=((R=(S=n.value)==null?void 0:S.value)==null?void 0:R.toString())??null:!((C=n.value)!=null&&C.coefficient)&&((T=n.value)!=null&&T.value)&&(h.value=s()),p()}),(S,R)=>{var x,P,$;const C=z.NInput,T=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((x=u.value)==null?void 0:x.feedback)??t.feedback),feedback:((P=u.value)==null?void 0:P.feedback)??t.feedback,"validation-status":(($=u.value)==null?void 0:$.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(Q.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(Q.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(T,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode($d,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(C,{value:f.value,"onUpdate:value":[R[0]||(R[0]=A=>f.value=A),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[R[3]||(R[3]=i.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[R[2]||(R[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(Q.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(C,{key:1,value:g.value,"onUpdate:value":[R[1]||(R[1]=A=>g.value=A),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var A;return[i.createTextVNode(i.toDisplayString((A=l.value)==null?void 0:A.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),s0={key:0,class:"flex flex-row gap-2.5"},o0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},a0={},Ed=i.defineComponent({...a0,__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}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=wt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=wt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},f=(m="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let u=!1;s("closing",m,()=>{u=!0}),u||(o.value=!1,s("update:show",o.value))},g=()=>{s("accept",u=>{a.value=u})};return i.watch(()=>r.show,m=>{m?h():f("other")}),i.watch(()=>r.processing,m=>{a.value=m}),e({open:h,close:f,acceptHandler:g}),(m,u)=>{const p=z.NButton,b=z.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":m.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:u[1]||(u[1]=y=>f("header")),onEsc:u[2]||(u[2]=y=>f("esc")),onMaskClick:u[3]||(u[3]=y=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(m.$slots,"default")]),_:2},[m.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(m.$slots,"header")]),key:"0"}:void 0,m.$slots.action||m.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[m.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",s0,[i.renderSlot(m.$slots,"extra-action")])):i.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",o0,[i.renderSlot(m.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:g},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:u[0]||(u[0]=y=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),l0={class:"text-sm"},c0={},d0=i.defineComponent({...c0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var C,T;return((T=(C=o.value)==null?void 0:C.properties)==null?void 0:T.isLengthConfigurator)??!1}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),h=i.ref(null),f=n,g=()=>({length:{},quantity:{},marker:{}}),m=i.ref(g()),u=i.ref(!1),p=i.computed(()=>{var $,A,F,O;if(!o.value)return{};const C=Q.UnitsHelper.getProductLengthMultiplicity(o.value),T=Q.UnitsHelper.getProductMultiplicity(o.value),x=((A=($=o.value)==null?void 0:$.properties)==null?void 0:A.minLength)||C,P=(O=(F=o.value)==null?void 0:F.properties)==null?void 0:O.maxLength;return{length:[he.required,he.min(x??.1),he.max(P),he.step(C),Ze.serverValidation(m.value.length.feedback)],quantity:[he.required,he.min(T),he.step(T),Ze.serverValidation(m.value.quantity.feedback)],marker:[Ze.serverValidation(m.value.marker.feedback)]}}),b=i.computed(()=>{var C,T,x;return o.value?((C=o.value.properties)==null?void 0:C.lengthStep)??((T=o.value.properties)!=null&&T.ignoreMinCountCheck?0:((x=o.value.properties)==null?void 0:x.minCount)??0):0}),y=i.computed(()=>{var x,P,$,A,F,O,L,J,ne;if(!o.value)return"";const C=((P=(x=o.value)==null?void 0:x.properties)==null?void 0:P.minLength)??((A=($=o.value)==null?void 0:$.properties)!=null&&A.ignoreMinCountCheck?0:(O=(F=o.value)==null?void 0:F.properties)==null?void 0:O.minCount),T=(J=(L=o.value)==null?void 0:L.properties)==null?void 0:J.maxLength;return C||T?`(${C?`от ${C}`:""}${C&&T?" ":""}${T?`до ${T}`:""} ${(ne=o.value)==null?void 0:ne.unit})`:""}),_=C=>{var A,F;if(!((F=(A=o.value)==null?void 0:A.properties)!=null&&F.isLengthConfigurator)||!h.value||M.isNil(C)||b.value===0)return;const T=C/b.value,x=Math.round(T),P=Q.UnitsHelper.getProductMultiplicity(o.value),$=Math.max(x,P);h.value.quantity=$},v=C=>{var $,A,F,O;if(!((A=($=o.value)==null?void 0:$.properties)!=null&&A.isLengthConfigurator)||!h.value||M.isNil(C)||b.value===0)return;const T=C*b.value,x=((F=o.value.properties)==null?void 0:F.minLength)||Q.UnitsHelper.getProductLengthMultiplicity(o.value),P=(O=o.value.properties)==null?void 0:O.maxLength;x!==void 0&&T<x?h.value.length=x:P!==void 0&&T>P?h.value.length=P:h.value.length=T},B=async C=>{var T;try{await((T=r.value)==null?void 0:T.validate(x=>{if(!x){if(!o.value||!h.value)return;Q.UnitsHelper.productIsMeasurable(o.value)||delete h.value.length,a.value&&b.value&&(h.value.length=b.value),u.value=!0,f("submit",h.value,m.value,()=>{u.value=!1,C(!1),i.nextTick(()=>{var P;(P=r.value)==null||P.validate(M.noop).catch(M.noop)})})}}))}catch{}},S=()=>{o.value=null,l.value=void 0,h.value=null,m.value=g()};return e({show:(C,T)=>{var x,P,$,A,F;if(o.value=C,l.value=T==null?void 0:T.cartItemData,c.value=T==null?void 0:T.orderId,d.value=(T==null?void 0:T.canSetDopProdaga)??!1,h.value=new Q.CartItemBase((T==null?void 0:T.cartItemData)??new Q.CartItemBase({product:C,quantity:Q.UnitsHelper.productIsMeasurable(o.value)?1:((x=C==null?void 0:C.properties)==null?void 0:x.minCount)??1,length:((P=C==null?void 0:C.properties)==null?void 0:P.minLength)||(($=C==null?void 0:C.properties)!=null&&$.ignoreMinCountCheck?0:(A=C==null?void 0:C.properties)==null?void 0:A.minCount)||0})),(F=C==null?void 0:C.properties)!=null&&F.isLengthConfigurator&&h.value&&b.value>0){const O=b.value,L=h.value.quantity||1;h.value.length=L*O}},closeDialog:S}),(C,T)=>{var L;const x=z.NInputNumber,P=z.NFormItem,$=z.NInputGroupLabel,A=z.NInputGroup,F=z.NInput,O=z.NCheckbox;return i.openBlock(),i.createBlock(Ed,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(o.value)&&!i.unref(M.isNil)(h.value),title:`${l.value?"Изменение":"Добавление"} товара ${(L=o.value)==null?void 0:L.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:u.value,"modal-width":500,onAccept:B,onClosing:S},{default:i.withCtx(()=>{var J;return[o.value&&h.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:h.value,rules:p.value,class:"flex flex-col gap-2",onKeydown:i.withKeys(i.withModifiers((J=s.value)==null?void 0:J.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>{var ne;return[i.unref(Q.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(P,{key:0,path:"length",label:`Метраж, ${y.value+o.value.unit}`},{default:i.withCtx(()=>[i.createVNode(x,{value:h.value.length,"onUpdate:value":[T[0]||(T[0]=N=>h.value.length=N),_],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:T[1]||(T[1]=N=>i.unref(Ha)(N,".",!1)),onInput:T[2]||(T[2]=N=>i.unref(Ke)(m.value,"length"))},null,8,["value","parse"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(P,{path:"quantity",label:`Количество, ${(ne=o.value)==null?void 0:ne.quantityUnit}`},{default:i.withCtx(()=>[i.createVNode(A,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(x,{value:h.value.quantity,"onUpdate:value":[T[3]||(T[3]=N=>h.value.quantity=N),v],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:T[4]||(T[4]=N=>i.unref(_t)(N,!1)),onInput:T[5]||(T[5]=N=>i.unref(Ke)(m.value,"quantity"))},null,8,["value"]),a.value?(i.openBlock(),i.createBlock($,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(o.value.unit),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!m.value.quantity.feedback&&i.unref(Q.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",l0,"Количество должно быть кратно "+i.toDisplayString(i.unref(Q.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),i.unref(Q.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(P,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(F,{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:T[6]||(T[6]=N=>i.unref(Ke)(m.value,"marker")),"onUpdate:value":T[7]||(T[7]=N=>h.value.marker=N??null)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(O,{key:2,checked:h.value.dopProdaga,"onUpdate:checked":T[8]||(T[8]=N=>h.value.dopProdaga=N),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...T[9]||(T[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]}),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),h0={class:"flex flex-row gap-1"},u0={class:"sc-client-name flex flex-col gap-1 text-base"},f0=["href"],g0={key:1,class:"text-sc-grey"},m0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},p0={key:0},y0={key:1,class:"text-sm"},b0={},hs=i.defineComponent({...b0,__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(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Dn.format(n.client.lastLoginAt,Q.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Os,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",h0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",u0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",g0," [ Деактивирован ] "))],8,f0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",m0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",p0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",y0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),_0={class:"text-base"},w0={},Nd=i.defineComponent({...w0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",_0,i.toDisplayString(t.contragent.name),1))}}),x0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v0(t,e){return i.openBlock(),i.createElementBlock("svg",x0,[...e[0]||(e[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 k0=i.markRaw({name:"tabler-mail",render:v0}),C0=["href"],S0={},B0=i.defineComponent({...S0,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=k0;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,C0)],2)}}}),T0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function R0(t,e){return i.openBlock(),i.createElementBlock("svg",T0,[...e[0]||(e[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 Fd=i.markRaw({name:"fa6-brands-viber",render:R0}),P0={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},$0=["id"],E0=["id"],N0=["fill"],F0=["fill"];function A0(t,e){return i.openBlock(),i.createElementBlock("svg",P0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,$0),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,E0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",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,N0),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",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,F0),e[2]||(e[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 Ad=i.markRaw({name:"logos-whatsapp-icon",render:A0,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),M0={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},V0=["id"],I0=["fill"];function O0(t,e){return i.openBlock(),i.createElementBlock("svg",M0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,V0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",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,I0),e[1]||(e[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 Md=i.markRaw({name:"logos-telegram",render:O0,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),z0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function L0(t,e){return i.openBlock(),i.createElementBlock("svg",z0,[...e[0]||(e[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 Vd=i.markRaw({name:"ion-call",render:L0}),D0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H0(t,e){return i.openBlock(),i.createElementBlock("svg",D0,[...e[0]||(e[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 W0=i.markRaw({name:"tabler-phone-call",render:H0}),j0={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},q0=["href"],X0=["href"],Y0=["href"],U0=["href"],K0={},G0=i.defineComponent({...K0,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?rr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=W0,h=Vd,f=Md,g=Ad,m=Fd;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]=u=>a.value=!a.value),onFocusout:c[1]||(c[1]=u=>a.value=!1),onMouseleave:c[2]||(c[2]=u=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.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",j0,[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,q0)):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(f)],8,X0)):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(g)],8,Y0)):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(m)],8,U0)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Z0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q0(t,e){return i.openBlock(),i.createElementBlock("svg",Z0,[...e[0]||(e[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 J0=i.markRaw({name:"mdi-envelope",render:Q0}),eb={class:"flex flex-col gap-1"},tb={key:0,class:"mb-2 flex flex-col text-base"},nb={key:0,class:"text-sc-dark-grey text-sm"},ib={key:1,class:"whitespace-nowrap text-sm"},rb={key:2,class:"whitespace-nowrap text-sm"},sb={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},ob=["href"],ab=["href"],lb=["href"],cb=["href"],db=["href"],hb={key:0,class:"flex flex-col text-base"},ub={key:0,class:"text-sc-dark-grey text-sm"},fb={key:1,class:"mt-2 text-sm"},gb={key:0,class:"-mt-1"},mb={},pb=i.defineComponent({...mb,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?rr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const h=Vd,f=Md,g=Ad,m=Fd,u=J0,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",eb,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,v,B,S;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=R=>l.value=!0),onFocusin:d[1]||(d[1]=R=>l.value=!0),onMouseleave:d[2]||(d[2]=R=>l.value=!1),onFocusout:d[3]||(d[3]=R=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(v=t.contact)!=null&&v.position)?(i.openBlock(),i.createElementBlock("div",tb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(B=t.contact)!=null&&B.position?(i.openBlock(),i.createElementBlock("span",nb,i.toDisplayString((S=t.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",ib,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",rb,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",sb,[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,ob)):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(f)],8,ab)):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(g)],8,lb)):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(m)],8,cb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(u)],8,db)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,v,B,S;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",hb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",ub,i.toDisplayString((v=t.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(B=t.contact)!=null&&B.comment?(i.openBlock(),i.createElementBlock("div",fb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((S=t.contact)==null?void 0:S.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",gb,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class yb{constructor(e){k(this,"minHeight");k(this,"maxHeights");k(this,"minWidth");k(this,"maxWidths");k(this,"netType");k(this,"color");k(this,"mountType");k(this,"descriptions");k(this,"crossbarCount");k(this,"heightOverlaps");k(this,"widthOverlaps");k(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Is.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Is.objectToSnake(e.heightOverlaps),this.widthOverlaps=Is.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}const bb={class:"flex flex-wrap gap-2"},_b={class:"flex flex-col"},wb={class:"flex flex-col"},xb={},vb=i.defineComponent({...xb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Q.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return M.forOwn(Q.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?Dn.startOfDay(new Date(a)):void 0,to:l?Dn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,g,m,u,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",bb,[i.createVNode(d,{value:((f=(h=t.dateRange)==null?void 0:h.from)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(g=t.disabled)==null?void 0:g.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",_b,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var v,B;return o((v=b==null?void 0:b.from)==null?void 0:v.getTime(),(B=b==null?void 0:b.to)==null?void 0:B.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((u=(m=t.dateRange)==null?void 0:m.to)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",wb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var v,B;return o((v=b==null?void 0:b.from)==null?void 0:v.getTime(),(B=b==null?void 0:b.to)==null?void 0:B.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),kb={class:"sc-lbl-date text-nowrap"},Cb={},Io=i.defineComponent({...Cb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Dn.format(e.date,Q.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Dn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",kb,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),Sb={class:"flex flex-row gap-2.5"},Bb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},Tb={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Rb={class:"mb-0.5 sm:mb-0 sm:ml-3"},Pb={},$b=i.defineComponent({...Pb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ds,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",Sb,[i.createElementVNode("div",Bb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",Tb,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",Rb,[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=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),Eb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Nb(t,e){return i.openBlock(),i.createElementBlock("svg",Eb,[...e[0]||(e[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 Fb=i.markRaw({name:"ion-download-outline",render:Nb}),Ab={},Mb=i.defineComponent({...Ab,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=Fb;return i.openBlock(),i.createBlock(i.unref(z.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Vb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ib(t,e){return i.openBlock(),i.createElementBlock("svg",Vb,[...e[0]||(e[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 Ob=i.markRaw({name:"ion-checkmark-done-sharp",render:Ib}),zb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Lb(t,e){return i.openBlock(),i.createElementBlock("svg",zb,[...e[0]||(e[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 Db=i.markRaw({name:"ion-options-outline",render:Lb}),Hb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Wb={class:"flex-auto"},jb={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"},qb={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"},Xb={},Oo=i.defineComponent({...Xb,__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(t,{emit:e}){const n=e,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=Db,f=z.NButton,g=z.NPopover,m=Ob,u=ds;return i.openBlock(),i.createElementBlock("div",Hb,[i.createElementVNode("div",Wb,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",jb,[i.createElementVNode("div",qb,[t.showEditButton?(i.openBlock(),i.createBlock(g,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.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))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(g,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(g,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),Yb={},Id=i.defineComponent({...Yb,__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(t,{emit:e}){const n=t,r=e,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 i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(Oo,{key:1,disabled:t.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(Oo,{key:0,disabled:t.disabled,"show-edit-button":t.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"]))]))}}),Ub={},Kb=i.defineComponent({...Ub,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=M.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(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Gb={},Zb=i.defineComponent({...Gb,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof rr.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=rr.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof rr.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(Hu.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),Qb=si(Zb,[["__scopeId","data-v-751dbb0e"]]),Jb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e_(t,e){return i.openBlock(),i.createElementBlock("svg",Jb,[...e[0]||(e[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 t_=i.markRaw({name:"tabler-external-link",render:e_}),n_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},i_=["href"],r_={},s_=i.defineComponent({...r_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=t_,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",n_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,i_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),o_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function a_(t,e){return i.openBlock(),i.createElementBlock("svg",o_,[...e[0]||(e[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 l_=i.markRaw({name:"ion-remove-circle-outline",render:a_});let us=[];const Od=new WeakMap;function c_(){us.forEach(t=>t(...Od.get(t))),us=[]}function zd(t,...e){Od.set(t,e),!us.includes(t)&&us.push(t)===1&&requestAnimationFrame(c_)}function gr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function mr(t){return t.composedPath()[0]||null}function pr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function yr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Jt(t,e){const n=t.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]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Ld={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 d_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function h_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/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 bn="^\\s*",_n="\\s*$",Yn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",It="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ui="([0-9A-Fa-f])",fi="([0-9A-Fa-f]{2})",Dd=new RegExp(`${bn}hsl\\s*\\(${It},${Yn},${Yn}\\)${_n}`),Hd=new RegExp(`${bn}hsv\\s*\\(${It},${Yn},${Yn}\\)${_n}`),Wd=new RegExp(`${bn}hsla\\s*\\(${It},${Yn},${Yn},${It}\\)${_n}`),jd=new RegExp(`${bn}hsva\\s*\\(${It},${Yn},${Yn},${It}\\)${_n}`),u_=new RegExp(`${bn}rgb\\s*\\(${It},${It},${It}\\)${_n}`),f_=new RegExp(`${bn}rgba\\s*\\(${It},${It},${It},${It}\\)${_n}`),g_=new RegExp(`${bn}#${ui}${ui}${ui}${_n}`),m_=new RegExp(`${bn}#${fi}${fi}${fi}${_n}`),p_=new RegExp(`${bn}#${ui}${ui}${ui}${ui}${_n}`),y_=new RegExp(`${bn}#${fi}${fi}${fi}${fi}${_n}`);function Et(t){return parseInt(t,16)}function b_(t){try{let e;if(e=Wd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),mi(e[13])];if(e=Dd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function __(t){try{let e;if(e=jd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),mi(e[13])];if(e=Hd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function gi(t){try{let e;if(e=m_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),1];if(e=u_.exec(t))return[ut(e[1]),ut(e[5]),ut(e[9]),1];if(e=f_.exec(t))return[ut(e[1]),ut(e[5]),ut(e[9]),mi(e[13])];if(e=g_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),1];if(e=y_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),mi(Et(e[4])/255)];if(e=p_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),mi(Et(e[4]+e[4])/255)];if(t in Ld)return gi(Ld[t]);if(Dd.test(t)||Wd.test(t)){const[n,r,s,o]=b_(t);return[...h_(n,r,s),o]}else if(Hd.test(t)||jd.test(t)){const[n,r,s,o]=__(t);return[...d_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function w_(t){return t>1?1:t<0?0:t}function zo(t,e,n,r){return`rgba(${ut(t)}, ${ut(e)}, ${ut(n)}, ${w_(r)})`}function Lo(t,e,n,r,s){return ut((t*e*(1-r)+n*r)/s)}function x_(t,e){Array.isArray(t)||(t=gi(t)),Array.isArray(e)||(e=gi(e));const n=t[3],r=e[3],s=mi(n+r-n*r);return zo(Lo(t[0],n,e[0],r,s),Lo(t[1],n,e[1],r,s),Lo(t[2],n,e[2],r,s),s)}function Ve(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:gi(t);return typeof e.alpha=="number"?zo(n,r,s,e.alpha):zo(n,r,s,o)}function fs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:gi(t),{lightness:a=1,alpha:l=1}=e;return v_([n*a,r*a,s*a,o*l])}function mi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function gs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function ut(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Un(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function v_(t){const[e,n,r]=t;return 3 in t?`rgba(${ut(e)}, ${ut(n)}, ${ut(r)}, ${mi(t[3])})`:`rgba(${ut(e)}, ${ut(n)}, ${ut(r)}, 1)`}function k_(t=8){return Math.random().toString(16).slice(2,2+t)}function qd(t){return Array.isArray(t)?t:[t]}const Do={STOP:"STOP"};function Xd(t,e){const n=e(t);t.children!==void 0&&n!==Do.STOP&&t.children.forEach(r=>Xd(r,e))}function C_(t,e={}){const{preserveGroup:n=!1}=e,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(t),r}function S_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function B_(t){return t.children}function T_(t){return t.key}function R_(){return!1}function P_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function $_(t){return t.disabled===!0}function E_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function N_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Ho(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Wo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function F_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function A_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function M_(t){return(t==null?void 0:t.type)==="group"}function V_(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class I_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function O_(t,e,n,r){return ms(e.concat(t),n,r,!1)}function z_(t,e){const n=new Set;return t.forEach(r=>{const s=e.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 L_(t,e,n,r){const s=ms(e,n,r,!1),o=ms(t,n,r,!0),a=z_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function jo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:F_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:A_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let f;s!==void 0?f=L_(s,n,e,d):r!==void 0?f=O_(r,n,e,d):f=ms(n,e,d,!1);const g=c==="parent",m=c==="child"||l,u=f,p=new Set,b=Math.max.apply(null,Array.from(h.keys()));for(let y=b;y>=0;y-=1){const _=y===0,v=h.get(y);for(const B of v){if(B.isLeaf)continue;const{key:S,shallowLoaded:R}=B;if(m&&R&&B.children.forEach(P=>{!P.disabled&&!P.isLeaf&&P.shallowLoaded&&u.has(P.key)&&u.delete(P.key)}),B.disabled||!R)continue;let C=!0,T=!1,x=!0;for(const P of B.children){const $=P.key;if(!P.disabled){if(x&&(x=!1),u.has($))T=!0;else if(p.has($)){T=!0,C=!1;break}else if(C=!1,T)break}}C&&!x?(g&&B.children.forEach(P=>{!P.disabled&&u.has(P.key)&&u.delete(P.key)}),u.add(S)):T&&p.add(S),_&&m&&u.has(S)&&u.delete(S)}}return{checkedKeys:Array.from(u),indeterminateKeys:Array.from(p)}}function ms(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&Xd(d,h=>{if(h.disabled)return Do.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),E_(h.rawNode,o))){if(r)return Do.STOP;if(!n)throw new I_}})}),l}function D_(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==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&&(e||!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 H_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function W_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Yd(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?j_:W_,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=qo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=q_(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(t),l}function j_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function q_(t){return t.parent}function qo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;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=qo(d,e);if(h!==null)return h}else return d}}return null}const X_={getChild(){return this.ignored?null:qo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Yd(this,"next",t)},getPrev(t={}){return Yd(this,"prev",t)}};function Y_(t,e){const n=e?new Set(e):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(t),r}function U_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var K_={};function Ud(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;K_.NODE_ENV!=="production"&&N_(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===t.length,f.parent=o,!f.ignored){const g=s(c);Array.isArray(g)&&(f.children=Ud(g,e,n,r,s,f,a+1))}l.push(f),e.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function G_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=$_,getIgnored:a=R_,getIsGroup:l=M_,getKey:c=T_}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:B_,h=e.ignoreEmptyChildren?B=>{const S=d(B);return Array.isArray(S)?S.length?S:null:S}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return S_(this.rawNode,h)},get shallowLoaded(){return P_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(B){return U_(this,B)}},X_),g=Ud(t,r,s,f,h);function m(B){if(B==null)return null;const S=r.get(B);return S&&!S.isGroup&&!S.ignored?S:null}function u(B){if(B==null)return null;const S=r.get(B);return S&&!S.ignored?S:null}function p(B,S){const R=u(B);return R?R.getPrev(S):null}function b(B,S){const R=u(B);return R?R.getNext(S):null}function y(B){const S=u(B);return S?S.getParent():null}function _(B){const S=u(B);return S?S.getChild():null}const v={treeNodes:g,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(B){return Y_(g,B)},getNode:m,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return H_(g)},getPath(B,S={}){return D_(B,S,v)},getCheckedKeys(B,S={}){const{cascade:R=!0,leafOnly:C=!1,checkStrategy:T="all",allowNotLoaded:x=!1}=S;return jo({checkedKeys:Ho(B),indeterminateKeys:Wo(B),cascade:R,leafOnly:C,checkStrategy:T,allowNotLoaded:x},v)},check(B,S,R={}){const{cascade:C=!0,leafOnly:T=!1,checkStrategy:x="all",allowNotLoaded:P=!1}=R;return jo({checkedKeys:Ho(S),indeterminateKeys:Wo(S),keysToCheck:B==null?[]:qd(B),cascade:C,leafOnly:T,checkStrategy:x,allowNotLoaded:P},v)},uncheck(B,S,R={}){const{cascade:C=!0,leafOnly:T=!1,checkStrategy:x="all",allowNotLoaded:P=!1}=R;return jo({checkedKeys:Ho(S),indeterminateKeys:Wo(S),keysToUncheck:B==null?[]:qd(B),cascade:C,leafOnly:T,checkStrategy:x,allowNotLoaded:P},v)},getNonLeafKeys(B={}){return C_(g,B)}};return v}function ps(t){return t.composedPath()[0]}const Z_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Q_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(ps(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(ps(a))},o=a=>{r&&(e.contains(ps(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Kd(t,e,n){const r=Z_[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=Q_(t,e,n)),o}function J_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Kd(t,e,n);return Object.keys(s).forEach(o=>{St(o,document,s[o],r)}),!0}return!1}function e1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Kd(t,e,n);return Object.keys(s).forEach(o=>{nt(o,document,s[o],r)}),!0}return!1}function t1(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(C,T,x){const P=C[T];return C[T]=function(){return x.apply(C,arguments),P.apply(C,arguments)},C}function o(C,T){C[T]=Event.prototype[T]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var C;return(C=a.get(this))!==null&&C!==void 0?C:null}function d(C,T){l!==void 0&&Object.defineProperty(C,"currentTarget",{configurable:!0,enumerable:!0,get:T??l.get})}const h={bubble:{},capture:{}},f={};function g(){const C=function(T){const{type:x,eventPhase:P,bubbles:$}=T,A=ps(T);if(P===2)return;const F=P===1?"capture":"bubble";let O=A;const L=[];for(;O===null&&(O=window),L.push(O),O!==window;)O=O.parentNode||null;const J=h.capture[x],ne=h.bubble[x];if(s(T,"stopPropagation",n),s(T,"stopImmediatePropagation",r),d(T,c),F==="capture"){if(J===void 0)return;for(let N=L.length-1;N>=0&&!t.has(T);--N){const V=L[N],q=J.get(V);if(q!==void 0){a.set(T,V);for(const X of q){if(e.has(T))break;X(T)}}if(N===0&&!$&&ne!==void 0){const X=ne.get(V);if(X!==void 0)for(const I of X){if(e.has(T))break;I(T)}}}}else if(F==="bubble"){if(ne===void 0)return;for(let N=0;N<L.length&&!t.has(T);++N){const V=L[N],q=ne.get(V);if(q!==void 0){a.set(T,V);for(const X of q){if(e.has(T))break;X(T)}}}}o(T,"stopPropagation"),o(T,"stopImmediatePropagation"),d(T)};return C.displayName="evtdUnifiedHandler",C}function m(){const C=function(T){const{type:x,eventPhase:P}=T;if(P!==2)return;const $=f[x];$!==void 0&&$.forEach(A=>A(T))};return C.displayName="evtdUnifiedWindowEventHandler",C}const u=g(),p=m();function b(C,T){const x=h[C];return x[T]===void 0&&(x[T]=new Map,window.addEventListener(T,u,C==="capture")),x[T]}function y(C){return f[C]===void 0&&(f[C]=new Set,window.addEventListener(C,p)),f[C]}function _(C,T){let x=C.get(T);return x===void 0&&C.set(T,x=new Set),x}function v(C,T,x,P){const $=h[T][x];if($!==void 0){const A=$.get(C);if(A!==void 0&&A.has(P))return!0}return!1}function B(C,T){const x=f[C];return!!(x!==void 0&&x.has(T))}function S(C,T,x,P){let $;if(typeof P=="object"&&P.once===!0?$=J=>{R(C,T,$,P),x(J)}:$=x,J_(C,T,$,P))return;const F=P===!0||typeof P=="object"&&P.capture===!0?"capture":"bubble",O=b(F,C),L=_(O,T);if(L.has($)||L.add($),T===window){const J=y(C);J.has($)||J.add($)}}function R(C,T,x,P){if(e1(C,T,x,P))return;const A=P===!0||typeof P=="object"&&P.capture===!0,F=A?"capture":"bubble",O=b(F,C),L=_(O,T);if(T===window&&!v(T,A?"bubble":"capture",C,x)&&B(C,x)){const ne=f[C];ne.delete(x),ne.size===0&&(window.removeEventListener(C,p),f[C]=void 0)}L.has(x)&&L.delete(x),L.size===0&&O.delete(T),O.size===0&&(window.removeEventListener(C,u,F==="capture"),h[F][C]=void 0)}return{on:S,off:R}}const{on:St,off:nt}=t1(),Ui="@@mmoContext",n1={mounted(t,{value:e}){t[Ui]={handler:void 0},typeof e=="function"&&(t[Ui].handler=e,St("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ui];typeof e=="function"?n.handler?n.handler!==e&&(nt("mousemoveoutside",t,n.handler),n.handler=e,St("mousemoveoutside",t,e)):(t[Ui].handler=e,St("mousemoveoutside",t,e)):n.handler&&(nt("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ui];e&&nt("mousemoveoutside",t,e),t[Ui].handler=void 0}},Ki="@@coContext",ys={mounted(t,{value:e,modifiers:n}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,St("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Ki];typeof e=="function"?r.handler?r.handler!==e&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,St("clickoutside",t,e,{capture:n.capture})):(t[Ki].handler=e,St("clickoutside",t,e,{capture:n.capture})):r.handler&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Ki];n&&nt("clickoutside",t,n,{capture:e.capture}),t[Ki].handler=void 0}};function i1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class r1{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&i1("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Xo=new r1,Gi="@@ziContext",Gd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Gi]={enabled:!!s,initialized:!1},s&&(Xo.ensureZIndex(t,r),t[Gi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Gi].enabled;s&&!o&&(Xo.ensureZIndex(t,r),t[Gi].initialized=!0),t[Gi].enabled=!!s},unmounted(t,e){if(!t[Gi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Xo.unregister(t,r)}};function s1(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Xt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const o1=typeof window<"u";let Zi,br;(()=>{var t,e;Zi=o1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,br=!1,Zi!==void 0?Zi.then(()=>{br=!0}):br=!0})();function a1(t){if(br)return;let e=!1;i.onMounted(()=>{br||Zi==null||Zi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Yo(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function bs(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function Zd(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const l1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function c1(){return l1}function Uo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Ko(t,e=!0,n=[]){return t.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,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ko(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Kn=null;function Jd(){if(Kn===null&&(Kn=document.getElementById("v-binder-view-measurer"),Kn===null)){Kn=document.createElement("div"),Kn.id="v-binder-view-measurer";const{style:t}=Kn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Kn)}return Kn.getBoundingClientRect()}function d1(t,e){const n=Jd();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Go(t){const e=t.getBoundingClientRect(),n=Jd();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function h1(t){return t.nodeType===9?null:t.parentNode}function eh(t){if(t===null)return null;const e=h1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return eh(e)}const th=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=eh(y),y!==null;)o.push(y);for(const _ of o)St("scroll",_,f,!0)},l=()=>{for(const y of o)nt("scroll",y,f,!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()},f=()=>{zd(g)},g=()=>{c.forEach(y=>y())},m=new Set,u=y=>{m.size===0&&St("resize",window,b),m.has(y)||m.add(y)},p=y=>{m.has(y)&&m.delete(y),m.size===0&&nt("resize",window,b)},b=()=>{m.forEach(y=>y())};return i.onBeforeUnmount(()=>{nt("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:u,removeResizeListener:p}},render(){return Uo("binder",this.$slots)}}),nh=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(Qd("follower",this.$slots),[[e]]):Qd("follower",this.$slots)}}),u1="@css-render/vue3-ssr";function f1(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},Jr=zi.Multiply,jm=[1,0,0,0,1,0,0,0,1],Xn=new dn(9),qm=ht.Utils,kc=new ee,bo=new dn([0,0,1,0,0,1,0,1,1,0,1,1]),_e={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 zi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)_e.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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 dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee),this._scale instanceof ee?(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){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ht.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.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++)_e.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ht.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,f,g,m,u,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,w=t.renderer.ratio,S=kc.copy(e._renderer.scale).multiply(w),B=e._stroke,R=e._linewidth,C=e._fill,T=e._renderer.opacity||e._opacity,v=e._cap,P=e._join,$=e._miter,A=e._closed,F=e.dashes,O=b.length,L=O-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*S.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*S.y),1);const J=e._renderer.rect.centroid,ne=J.x,N=J.y;if(_.clearRect(0,0,y.width,y.height),C)if(typeof C=="string")_.fillStyle=C;else{const oe=ht.Utils.getRendererType(C._renderer.type);_e[oe].render.call(C,_,e),_.fillStyle=C._renderer.effect}if(B){if(typeof B=="string")_.strokeStyle=B;else{const oe=ht.Utils.getRendererType(B._renderer.type);_e[oe].render.call(B,_,e),_.strokeStyle=B._renderer.effect}R&&(_.lineWidth=hn(e)),$&&(_.miterLimit=$),P&&(_.lineJoin=P),!A&&v&&(_.lineCap=v)}typeof T=="number"&&(_.globalAlpha=T),F&&F.length>0&&(_.lineDashOffset=F.offset||0,_.setLineDash(F));let V,q,X,I,W,H,U,fe;_.save(),_.scale(S.x,S.y),_.translate(ne,N),_.beginPath();for(let oe=0;oe<b.length;oe++){const re=b[oe];switch(m=re.x,u=re.y,re.command){case te.close:_.closePath();break;case te.arc:q=re.rx,X=re.ry,I=re.xAxisRotation,W=re.largeArcFlag,H=re.sweepFlag,n=A?Mt(oe-1,O):Math.max(oe-1,0),r=b[n],U=r.x,fe=r.y,qm.renderSvgArcCommand(_,U,fe,q,X,W,H,I,m,u);break;case te.curve:n=A?Mt(oe-1,O):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||ee.zero,h=re.controls&&re.controls.left||ee.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),_.bezierCurveTo(l,c,o,a,m,u),oe>=L&&A&&(s=V,f=re.controls&&re.controls.right||ee.zero,g=s.controls&&s.controls.left||ee.zero,re._relative?(l=f.x+re.x,c=f.y+re.y):(l=f.x,c=f.y),s._relative?(o=g.x+s.x,a=g.y+s.y):(o=g.x,a=g.y),m=s.x,u=s.y,_.bezierCurveTo(l,c,o,a,m,u));break;case te.line:_.lineTo(m,u);break;case te.move:V=re,_.moveTo(m,u);break}}A&&_.closePath(),_e.isHidden.test(C)||(p=C._renderer&&C._renderer.offset,p&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(B)||(p=B._renderer&&B._renderer.offset,p&&(_.save(),_.translate(-B._renderer.offset.x,-B._renderer.offset.y),_.scale(B._renderer.scale.x,B._renderer.scale.y),_.lineWidth=R/B._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const h=d.x,f=d.y,g=d.controls;let m,u,p,b,y,_;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(y=g.left,_=g.right,!(!y||!_)&&(m=d._relative?y.x+h:y.x,u=d._relative?y.y+f:y.y,p=d._relative?_.x+h:_.x,b=d._relative?_.y+f:_.y,!(!m||!u||!p||!b)&&(o=Math.min(u,b,o),r=Math.min(m,p,r),s=Math.max(m,p,s),a=Math.max(u,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),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(t,e,n){if(!this._visible||!this._opacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ht.Utils.getRendererType(this._renderer.type),o=e[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 He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(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 dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee);let f,g;this._scale instanceof ee?(f=this._scale.x*r._renderer.scale.x,g=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,g=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=g<0?-g:g,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const f=ht.Utils.getRendererType(this._mask._renderer.type);_e[f].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,t,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;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,bo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._size*o;let g=f;_e.isHidden.test(a)||(g+=l),r.width=ul(g),r.height=r.width;const m=g/r.width,u=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ht.Utils.getRendererType(c._renderer.type);_e[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ht.Utils.getRendererType(a._renderer.type);_e[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=hn(e)/m)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(u,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,f/m*.5,0,ct),s.restore(),closed&&s.closePath(),_e.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()),_e.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(t,e,n){if(!this._visible||!this._opacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,g=this._renderer.vertices,m=this._renderer.collection.length,u=this._flagVertices,p=this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(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||f){this._renderer.matrix||(this._renderer.matrix=new dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee);let b,y;this._scale instanceof ee?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=s)}if(u){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,g,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,m),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=kc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._decoration,g=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const m=e._renderer.rect.centroid,u=m.x,p=m.y;let b,y,_,w,S,B,R,C,T,v,P;const $=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),$||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=g,c)if(typeof c=="string")r.fillStyle=c;else{const A=ht.Utils.getRendererType(c._renderer.type);_e[A].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const A=ht.Utils.getRendererType(a._renderer.type);_e[A].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}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(u,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(B=c._renderer.scale.x,R=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(B,R),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,w=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,w),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(B=a._renderer.scale.x,R=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(B,R),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,w=a._renderer.offset.y/a._renderer.scale.y,S=l/a._renderer.scale.x,r.lineWidth=S,r.strokeText(e.value,_,w),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const A=r.measureText(e.value);switch(f){case"underline":T=A.actualBoundingBoxDescent,P=A.actualBoundingBoxDescent;break;case"strikethrough":T=0,P=0;break}C=-A.width/2,v=A.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(C,T),r.lineTo(v,P),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=_e.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ht.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[t._alignment]||t._alignment){case _e.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case _e.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[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 He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(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 dn(9)),this._matrix.toTransformArray(!0,Xn),Jr(Xn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ee||(this._renderer.scale=new ee);let h,f;this._scale instanceof ee?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ht.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,t,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;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,bo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=e.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=t.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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;Z.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof ee||(this._renderer.offset=new ee),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 ee?(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 ee||(this._renderer.scale=new ee);let r,s;this._scale instanceof ee?(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 Z.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ht.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(_e,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),Z.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new $t("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},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];e[s]=_e.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Or};_e.ctx=_e.canvas.getContext("2d");var Cc=class extends Y{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(_e.canvas=t.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new rt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new dn(jm),scale:1,opacity:1},this._flagMatrix=!0,t=Z.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new $t("unable to create a webgl context. Try using another renderer.");r=jt.create(e,jt.path.vertex,jt.types.vertex),s=jt.create(e,jt.path.fragment,jt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=_e.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,bo,e.STATIC_DRAW),r=jt.create(e,jt.points.vertex,jt.types.vertex),s=jt.create(e,jt.points.fragment,jt.types.fragment),n=this.programs.points=_e.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Ys(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,Z.isObject(this.domElement.style)&&Z.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*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(Y.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};x(Cc,"Utils",_e);var Xm=Z.extend({Error:$t,getRatio:Ys,read:ze,xhr:yc},Z,xt,ll,cl),xe=class Fr{constructor(e){x(this,"_events",new Y),x(this,"type",""),x(this,"renderer",null),x(this,"scene",null),x(this,"width",0),x(this,"height",0),x(this,"frameCount",0),x(this,"timeDelta",0),x(this,"playing",!1);const n=Z.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Fr.Types.svg,autostart:!1});if(Z.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),Z.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Fr.Types[r])}this.renderer=new Fr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Ym.bind(this),this.fit.domElement=window,this.fit.attached=!0,Z.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),Z.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Vt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=Um.bind(this),Z.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(Y.Types.resize,Km.bind(this)),this.scene=this.renderer.scene,Fr.Instances.push(this),n.autostart&&dr.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,dr.init(),this.trigger(Y.Types.play)}pause(){return this.playing=!1,this.trigger(Y.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;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){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=Z.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Vt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(Y.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(Y.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,n,r,s){const o=new Ur(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ke(e,n,void 0,void 0,void 0,void 0,te.move),new ke(r,s,void 0,void 0,void 0,void 0,te.line),new ke(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,te.line),new ke(r,s,void 0,void 0,void 0,void 0,te.move),new ke(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,te.line)],d=new Ce(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new qn(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new qr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Wr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new jr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new lo(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ke(l,c))}}const r=arguments[n-1],s=new Ce(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new ao(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new to(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new ee(a,l))}}const s=new oo(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ke(c,d))}}const s=arguments[n-1],o=new Ce(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new un(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new He(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new We(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Hr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new bc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new fo(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Me(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new rt;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof rt?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new rt;let s,o,a;const l=(function(c){for(Vt.temp.innerHTML=c,o=0;o<Vt.temp.children.length;o++)s=Vt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Vt.temp.children.length<=1?Vt.temp.children[0]:Vt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(yc(e,l),r):(l(e),r)}};x(xe,"NextFrameId",vt.NextFrameId),x(xe,"Types",vt.Types),x(xe,"Version",vt.Version),x(xe,"PublishDate",vt.PublishDate),x(xe,"Identifier",vt.Identifier),x(xe,"Resolution",vt.Resolution),x(xe,"AutoCalculateImportedMatrices",vt.AutoCalculateImportedMatrices),x(xe,"Instances",vt.Instances),x(xe,"uniqueId",vt.uniqueId),x(xe,"Anchor",ke),x(xe,"Collection",Hn),x(xe,"Events",Y),x(xe,"Group",rt),x(xe,"Matrix",zi),x(xe,"Path",Ce),x(xe,"Registry",Or),x(xe,"Element",Oi),x(xe,"Shape",jn),x(xe,"Text",un),x(xe,"Vector",ee),x(xe,"Gradient",et),x(xe,"Image",bc),x(xe,"ImageSequence",fo),x(xe,"LinearGradient",He),x(xe,"RadialGradient",We),x(xe,"Sprite",Hr),x(xe,"Stop",Wn),x(xe,"Texture",Me),x(xe,"ArcSegment",to),x(xe,"Circle",Wr),x(xe,"Ellipse",jr),x(xe,"Line",Ur),x(xe,"Points",oo),x(xe,"Polygon",ao),x(xe,"Rectangle",qn),x(xe,"RoundedRectangle",qr),x(xe,"Star",lo),x(xe,"CanvasRenderer",ht),x(xe,"SVGRenderer",vc),x(xe,"WebGLRenderer",Cc),x(xe,"Commands",te),x(xe,"Utils",Xm);var gn=xe;function Ym(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function Um(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function Km(t,e){this.width=t,this.height=e,this.trigger(Y.Types.resize,t,e)}var dr=Vt.getRequestAnimationFrame();function Sc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=dr(Sc)}dr.init=function(){Sc(),dr.init=function(){}};let mn;typeof window<"u"?mn=window:typeof global<"u"?mn=global:typeof self<"u"&&(mn=self);let Bc;const li=Math.PI*2,st=Math.PI*.5;function Gm(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Zm(t){Bc=t}function Qm(t,e){e=e&&e.identity()||new Bc;let n=t;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;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function qt(t,e,n){return n*(e-t)+t}function Hi(t,e){for(;t<0;)t+=e;return t%e}const Tc=mn.Float32Array||Array,Jm=Math.floor;function pn(t){return Jm(t*1e6)/1e6}const ge={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){k(this,"_events",{});k(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];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[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];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(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.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 Rc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(G.Types.change))}}},at=class at extends G{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in Rc)Object.defineProperty(this,s,Rc[s]);this.x=n,this.y=r}static add(n,r){return new at(n.x+r.x,n.y+r.y)}static sub(n,r){return new at(n.x-r.x,n.y-r.y)}static subtract(n,r){return at.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(at.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 at(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:pn(this.x),y:pn(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(at,"zero",new at),k(at,"left",new at(-1,0)),k(at,"right",new at(1,0)),k(at,"up",new at(0,-1)),k(at,"down",new at(0,1));let pe=at;class Re extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=ge.move){super(n,r);k(this,"controls",{left:new pe,right:new pe});k(this,"_command",ge.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 Pc)Object.defineProperty(this,h,Pc[h]);this.command=c,this.relative=!0;const d=Re.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 Re().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 Re().copy(this)}toObject(){return{x:pn(this.x),y:pn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:pn(this.rx),ry:pn(this.ry),xAxisRotation:pn(this.xAxisRotation),largeArcFlag:pn(this.largeArcFlag),sweepFlag:pn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Pc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}}};let ep=0;const _o={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return ep++}},es={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ts(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function $c(t,e,n,r,s,o,a,l,c){c=c||es.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const h=[];for(let f=0;f<d;f++){const g=f/d,m=ts(g,t,n,s,a),u=ts(g,e,r,o,l);h.push(new Re(m,u))}return h}function tp(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),g=9*(r-o)+3*(l-e),m=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(g*b+m)*b+u;return Math.sqrt(y*y+_*_)}return ip(p,0,1,c||es.RecursionLimit)}function np(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,g,m,u,p,b,y;for(let B=0;B<2;++B){if(B===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,g=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,g=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;m=-g/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*g*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,w=_,S;for(;_--;)m=c[_],S=1-m,d[0][_]=S*S*S*t+3*S*S*m*n+3*S*m*m*s+m*m*m*a,d[1][_]=S*S*S*e+3*S*S*m*r+3*S*m*m*o+m*m*m*l;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=l,d[0].length=d[1].length=w+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 ip(t,e,n,r){let s=es.abscissas[r-2],o=es.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function rp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Hi(s-1,n):Math.max(s-1,0),l=e?Hi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];sp(c,d,h),d.command=s===0?ge.move:ge.curve}}function sp(t,e,n){const r=pe.angleBetween(t,e),s=pe.angleBetween(n,e);let o=pe.distanceBetween(t,e),a=pe.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=st:l-=st,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let hr=(Ci=class extends G{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",_o.Identifier+_o.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Ec)Object.defineProperty(this,n,Ec[n])}static fromObject(n){const r=new Ci().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},k(Ci,"Properties",["renderer","id","className"]),Ci);const Ec={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class ns extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class op{constructor(){k(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let is;const Nc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};mn.document&&(is=document.createElement("a"));const qe=class qe extends hr{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 Fc)Object.defineProperty(this,s,Fc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=ap.bind(this),this._renderer.flagScale=lp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,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 qe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return is?(is.href=n,is.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=qe.getAbsoluteURL(n);if(qe.ImageRegistry.contains(r))return qe.ImageRegistry.get(r);let s;return mn.document?Nc.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=qe.getTag(s);n._flagImage&&(/canvas/i.test(o)?qe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,qe.Register[o](n,r))),n._flagSrc&&(s||(s=qe.getImage(n.src),n.image=s),o=qe.getTag(s),qe.Register[o](n,r))}clone(){const n=new qe(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 pe?n.offset:new pe().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe().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,qe.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(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(qe,"Properties",["src","loaded","repeat","scale","offset","image"]),k(qe,"RegularExpressions",Nc),k(qe,"ImageRegistry",new op),k(qe,"Register",{canvas:function(n,r){n._src="#"+n.id,qe.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 ns("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=qe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),qe.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 ns("unable to load "+n.src)};n._src=qe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),qe.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 je=qe;const Fc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=je.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}je.ImageRegistry.contains(n)?this._image=je.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(G.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function ap(){this._flagOffset=!0}function lp(){this._flagScale=!0}class ci extends Array{constructor(){super();La(this,lt,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 Rt(this,lt)}set _events(n){Lu(this,lt,n)}get _bound(){return Rt(this,lt)._bound}set _bound(n){Rt(this,lt)._bound=n}addEventListener(){return Rt(this,lt).addEventListener.apply(this,arguments)}on(){return Rt(this,lt).on.apply(this,arguments)}bind(){return Rt(this,lt).bind.apply(this,arguments)}removeEventListener(){return Rt(this,lt).removeEventListener.apply(this,arguments)}off(){return Rt(this,lt).off.apply(this,arguments)}unbind(){return Rt(this,lt).unbind.apply(this,arguments)}dispatchEvent(){return Rt(this,lt).dispatchEvent.apply(this,arguments)}trigger(){return Rt(this,lt).trigger.apply(this,arguments)}listen(){return Rt(this,lt).listen.apply(this,arguments)}ignore(){return Rt(this,lt).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}}lt=new WeakMap;const Ac=Array.prototype.slice;function cp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const $e={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!cp(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:mn.performance&&mn.performance.now?mn.performance:Date},Nt=class Nt extends hr{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 Mc)Object.defineProperty(this,o,Mc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Nt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Nt.Index<=0?"#fff":"#000",Nt.Index=(Nt.Index+1)%2}static fromObject(n){const r=new Nt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nt.Properties.length;r++){const s=Nt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Nt;return $e.each(Nt.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",$e.each(Nt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Nt,"Index",0),k(Nt,"Properties",["offset","opacity","color"]);let di=Nt;const Mc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},xn=class xn extends hr{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 Vc)Object.defineProperty(this,r,Vc[r]);this._renderer.type="gradient",this._renderer.flagStops=dp.bind(this),this._renderer.bindStops=hp.bind(this),this._renderer.unbindStops=up.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 di?o:new di().copy(o)));const s=new xn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new xn(r);return $e.each(xn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return $e.each(xn.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(xn,"Stop",di),k(xn,"Properties",["spread","stops","units"]);let tt=xn;const Vc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(G.Types.insert,e).unbind(G.Types.remove,n),this._stops=new ci((t||[]).slice(0)),this._stops.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._stops)}}};function dp(){this._flagStops=!0}function hp(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function up(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const Qn=class Qn extends tt{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in Ic)Object.defineProperty(this,l,Ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=fp.bind(this),this.left=new pe,this.right=new pe,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 Qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Qn.Properties.length;r++){const s=Qn.Properties[r];s in n&&(this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Qn(this.left._x,this.left._y,this.right._x,this.right._y,r);return $e.each(tt.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(Qn,"Stop",di),k(Qn,"Properties",["left","right"]);let kt=Qn;const Ic={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof pe&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function fp(){this._flagEndPoints=!0}const vn=class vn extends tt{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 Oc)Object.defineProperty(this,c,Oc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=gp.bind(this),this._renderer.flagFocal=mp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,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 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&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().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 vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return $e.each(tt.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return $e.each(vn.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(vn,"Stop",di),k(vn,"Properties",["center","radius","focal"]);let Ct=vn;const Oc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(G.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function gp(){this._flagCenter=!0}function mp(){this._flagFocal=!0}function zc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function rs(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Lc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),tp(r,l,s,c,o,d,a,h,n)}function Dc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,g=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(g||t).x,d=(g||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),g&&t._relative&&(o+=t.x,d+=t.y),$c(r,l,s,c,o,d,a,h,n)}function hi(t){switch(t.renderer.type){case"texture":return je.fromObject(t);case"gradient":return tt.fromObject(t);case"linear-gradient":return kt.fromObject(t);case"radial-gradient":return Ct.fromObject(t)}return t}const pp=Math.cos,yp=Math.sin,Hc=Math.tan,wo=[],Bt=class Bt extends G{constructor(n,r,s,o,a,l){super();k(this,"elements",new Tc(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 C=n;let T,v,P;const $=r[0]||0,A=r[1]||0,F=r[2]||0;return T=C[0]*$+C[1]*A+C[2]*F,v=C[3]*$+C[4]*A+C[5]*F,P=C[6]*$+C[7]*A+C[8]*F,[T,v,P]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],g=n[7],m=n[8],u=r[0],p=r[1],b=r[2],y=r[3],_=r[4],w=r[5],S=r[6],B=r[7],R=r[8];return s=s||new Tc(9),s[0]=o*u+a*y+l*S,s[1]=o*p+a*_+l*B,s[2]=o*b+a*w+l*R,s[3]=c*u+d*y+h*S,s[4]=c*p+d*_+h*B,s[5]=c*b+d*w+h*R,s[6]=f*u+g*y+m*S,s[7]=f*p+g*_+m*B,s[8]=f*b+g*w+m*R,s}static fromObject(n){return new Bt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[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]=Bt.Identity[0],this.elements[1]=Bt.Identity[1],this.elements[2]=Bt.Identity[2],this.elements[3]=Bt.Identity[3],this.elements[4]=Bt.Identity[4],this.elements[5]=Bt.Identity[5],this.elements[6]=Bt.Identity[6],this.elements[7]=Bt.Identity[7],this.elements[8]=Bt.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 L=a[0]*n+a[1]*r+a[2]*s,J=a[3]*n+a[4]*r+a[5]*s,ne=a[6]*n+a[7]*r+a[8]*s;return[L,J,ne]}const f=this.elements,g=[n,r,s,o,a,l,c,d,h],m=f[0],u=f[1],p=f[2],b=f[3],y=f[4],_=f[5],w=f[6],S=f[7],B=f[8],R=g[0],C=g[1],T=g[2],v=g[3],P=g[4],$=g[5],A=g[6],F=g[7],O=g[8];return this.elements[0]=m*R+u*v+p*A,this.elements[1]=m*C+u*P+p*F,this.elements[2]=m*T+u*$+p*O,this.elements[3]=b*R+y*v+_*A,this.elements[4]=b*C+y*P+_*F,this.elements[5]=b*T+y*$+_*O,this.elements[6]=w*R+S*v+B*A,this.elements[7]=w*C+S*P+B*F,this.elements[8]=w*T+S*$+B*O,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new Bt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],g=r[8],m=g*c-d*f,u=-g*l+d*h,p=f*l-c*h;let b=s*m+o*u+a*p;return b?(b=1/b,n.elements[0]=m*b,n.elements[1]=(-g*o+a*f)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=u*b,n.elements[4]=(g*s-a*h)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-f*s+o*h)*b,n.elements[8]=(c*s-o*l)*b,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=pp(n),s=yp(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=Hc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Hc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return wo.length=0,this.toTransformArray(n,wo),wo.map(pn).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],f=s[5];if(n){const g=s[6],m=s[7],u=s[8];if(o){r[0]=a,r[1]=d,r[2]=g,r[3]=l,r[4]=h,r[5]=m,r[6]=c,r[7]=f,r[8]=u;return}return[a,d,g,l,h,m,c,f,u]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const g=s[6],m=s[7],u=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=g,r[7]=m,r[8]=u;return}return[a,l,c,d,h,f,g,m,u]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Bt().copy(this)}};k(Bt,"Identity",[1,0,0,0,1,0,0,0,1]);let ur=Bt;Zm(ur);const Pr=class Pr extends hr{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 ss)Object.defineProperty(this,n,ss[n]);this._renderer.flagMatrix=Wc.bind(this),this.isShape=!0,this.matrix=new ur,this.worldMatrix=new ur,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Pr().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 ss.position.get.apply(this,arguments)}set translation(n){ss.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 pe?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 pe?n.scale:new pe(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 Pr;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 pe?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 pe?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(Pr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Tn=Pr;const ss={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(G.Types.change,this._renderer.flagMatrix),Wc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&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(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Qm(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Wc(){this._flagMatrix=!0}const Wi=Math.min,ji=Math.max,bp=Math.ceil,_p=Math.floor,wp=new pe,tn=class tn extends Tn{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,"_flagStrokeAttenuation",!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);k(this,"_strokeAttenuation",!0);for(let a in jc)Object.defineProperty(this,a,jc[a]);this._renderer.type="path",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Kc.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:hi(n.fill),s=typeof n.stroke=="string"?n.stroke:hi(n.stroke),o=new tn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}}for(let r=0;r<tn.Properties.length;r++){const s=tn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new tn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<tn.Properties.length;s++){const o=tn.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()),$e.each(tn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}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,f=1/0,g=-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:m,scaleY:u}=Gm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof m=="number"&&typeof u=="number"&&(s=Math.max(m,u)*(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[m,u]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[w,S]=r.multiply(y,_),B=c.controls.left.x,R=c.controls.left.y;c.relative&&(B+=c.x,R+=c.y);let[C,T]=r.multiply(B,R);const v=np(m,u,w,S,C,T,p,b);f=Wi(v.min.y-s,f),d=Wi(v.min.x-s,d),h=ji(v.max.x+s,h),g=ji(v.max.y+s,g)}else a<=1&&(f=Wi(u-s,f),d=Wi(m-s,d),h=ji(m+s,h),g=ji(u+s,g)),f=Wi(b-s,f),d=Wi(p-s,d),h=ji(p+s,h),g=ji(b+s,g)}return{top:f,left:d,right:h,bottom:g,width:h-d,height:g-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,g,m,u,p,b,y,_,w=this.length*Math.min(Math.max(n,0),1);const S=this.vertices.length,B=S-1;let R=null,C=null;for(let N=0,V=this._lengths.length,q=0;N<V;N++){if(q+this._lengths[N]>=w){this._closed?(s=Hi(N,S),o=Hi(N-1,S),N===0&&(s=o,o=N)):(s=N,o=Math.min(Math.max(N-1,0),B)),R=this.vertices[s],C=this.vertices[o],w-=q,this._lengths[N]!==0?n=w/this._lengths[N]:n=0;break}q+=this._lengths[N]}if(R===null||C===null)return null;if(R){if(!C)return R}else return C;_=C.controls&&C.controls.right,y=R.controls&&R.controls.left,c=C.x,m=C.y,d=(_||C).x,u=(_||C).y,h=(y||R).x,p=(y||R).y,f=R.x,b=R.y,_&&C.relative&&(d+=C.x,u+=C.y),y&&R.relative&&(h+=R.x,p+=R.y),l=ts(n,c,d,h,f),g=ts(n,m,u,p,b);const T=qt(c,d,n),v=qt(m,u,n),P=qt(d,h,n),$=qt(u,p,n),A=qt(h,f,n),F=qt(p,b,n),O=qt(T,P,n),L=qt(v,$,n),J=qt(P,A,n),ne=qt($,F,n);return $e.isObject(r)?(r.x=l,r.y=g,r instanceof Re&&(r.controls.left.x=O,r.controls.left.y=L,r.controls.right.x=J,r.controls.right.y=ne,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=g,r.controls.right.x-=l,r.controls.right.y-=g)),r.t=n,r):(a=new Re(l,g,O-l,L-g,J-l,ne-g,this._curved?ge.curve:ge.line),a.t=n,a)}plot(){if(this.curved)return rp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?ge.move:ge.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===ge.close;let o=this.vertices[r],a=[],l;return $e.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===ge.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=ge.line),o=c;return}l=Dc(c,o,n),a=a.concat(l),$e.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Dc(c,o,n),a=a.concat(l),$e.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?ge.close:ge.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=[]),$e.each(this.vertices,function(c,d){if(d<=0||c.command===ge.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Lc(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=rs(this,s*this._length),l=rs(this,o*this._length),c=bp(a),d=_p(l);let h,f,g,m,u,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Re),p>d&&!f?(u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,u),u.command=this._renderer.collection[p].command,this._renderer.vertices.push(u),f=u,g=this._collection[p-1],g&&g.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u),g.relative?this._renderer.collection[p-1].controls.right.copy(g.controls.right).lerp(pe.zero,1-u.t):this._renderer.collection[p-1].controls.right.copy(g.controls.right).lerp(g,1-u.t))):p>=c&&p<=d&&(u=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(u),p===d&&zc(this,o)?(f=u,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):p===c&&zc(this,s)&&(h=u,h.command=ge.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,u),u.command=ge.move,this._renderer.vertices.unshift(u),m=this._collection[p+1],m&&m.controls&&(u.controls.left.clear(),m.relative?this._renderer.collection[p+1].controls.left.copy(m.controls.left).lerp(pe.zero,u.t):(wp.copy(m),this._renderer.collection[p+1].controls.left.copy(m.controls.left).lerp(m,u.t))))}return Tn.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=this._flagStrokeAttenuation=!1,Tn.prototype.flagReset.call(this),this}};k(tn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),k(tn,"Utils",{getCurveLength:Lc});let Ee=tn;const jc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&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(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";$e.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ci?this._collection=t:this._collection=new ci(t||[]),this._collection.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function qc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Xc(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Yc(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Uc(){this._flagFill=!0}function Kc(){this._flagStroke=!0}const xp=Math.ceil,vp=Math.floor,kn=class kn extends Tn{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,"_flagStrokeAttenuation",!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,"_strokeAttenuation",!0);k(this,"noFill",Ee.prototype.noFill);k(this,"noStroke",Ee.prototype.noStroke);k(this,"corner",Ee.prototype.corner);k(this,"center",Ee.prototype.center);k(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);k(this,"_updateLength",Ee.prototype._updateLength);for(let r in Gc)Object.defineProperty(this,r,Gc[r]);this._renderer.type="points",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Kc.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:hi(n.fill),s=typeof n.stroke=="string"?n.stroke:hi(n.stroke),o=new kn().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 Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new kn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<kn.Properties.length;s++){const o=kn.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()),$e.each(kn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}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,f=$c(l,c,l,c,d,h,d,h,n);r=r.concat(f)}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=rs(this,n*this._length),o=rs(this,r*this._length),a=xp(s),l=vp(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(kn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let os=kn;const Gc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&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(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ci?this._collection=t:this._collection=new ci(t||[]),this._collection.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class Zc extends ci{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);La(this,Fs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Rt(this,Fs)}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}}Fs=new WeakMap;const Nn=class Nn extends Ee{constructor(n,r,s,o,a,l,c){const d=c||_o.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Re);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",li);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in Qc)Object.defineProperty(this,f,Qc[f]);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 Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.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=Hi(n,li)===Hi(r,li),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,g,m,u,p,b,y,_,w,S;for(a?d--:l||(d-=2),g=0,m=d-1;g<d;g++){switch(u=g/m,p=c[f],b=u*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),w=o*Math.sin(b),g){case 0:h=ge.move;break;default:h=ge.curve}p.command=h,p.x=_,p.y=w,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(S=o*y/Math.PI,p.controls.left.x=S*Math.cos(b-st),p.controls.left.y=S*Math.sin(b-st),p.controls.right.x=S*Math.cos(b+st),p.controls.right.y=S*Math.sin(b+st),g===1&&p.controls.left.multiplyScalar(2),g===m&&p.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=ge.close,f++):(d--,m=d-1),g=0;g<d;g++)u=g/m,p=c[f],b=(1-u)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),w=s*Math.sin(b),h=ge.curve,g<=0&&(h=a?ge.move:ge.line),p.command=h,p.x=_,p.y=w,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(S=s*y/Math.PI,p.controls.left.x=S*Math.cos(b+st),p.controls.left.y=S*Math.sin(b+st),p.controls.right.x=S*Math.cos(b-st),p.controls.right.y=S*Math.sin(b-st),g===1&&p.controls.left.multiplyScalar(2),g===m&&p.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=ge.line}else a||(c[f].command=ge.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=ge.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 Nn(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<Ee.Properties.length;d++){const h=Ee.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<Nn.Properties.length;r++){const s=Nn.Properties[r];n[s]=this[s]}return n}};k(Nn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let xo=Nn;const Qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},vo=Math.cos,ko=Math.sin,Fn=class Fn extends Ee{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Re(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 Jc)Object.defineProperty(this,c,Jc[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 Fn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Fn.Properties.length;r++){const s=Fn.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*li,d=s*vo(c),h=s*ko(c),f=o*vo(c-st),g=o*ko(c-st),m=o*vo(c+st),u=o*ko(c+st),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,g),p.controls.right.set(m,u)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Fn(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<Ee.Properties.length;s++){const o=Ee.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<Fn.Properties.length;r++){const s=Fn.Properties[r];n[s]=this[s]}return n}};k(Fn,"Properties",["radius"]);let Co=Fn;const Jc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},So=Math.cos,Bo=Math.sin,An=class An extends Ee{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 Re);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 ed)Object.defineProperty(this,d,ed[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 An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.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*li,d=s*So(c),h=o*Bo(c),f=s*r*So(c-st),g=o*r*Bo(c-st),m=s*r*So(c+st),u=o*r*Bo(c+st),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,g),p.controls.right.set(m,u)}}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 An(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<Ee.Properties.length;l++){const c=Ee.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<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};k(An,"Properties",["width","height"]);let To=An;const ed={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},kp=Math.cos,Cp=Math.sin,Mn=class Mn extends Ee{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 td)Object.defineProperty(this,a,td[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 Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.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=li*a+Math.PI/2,c=this._width*kp(l)/2,d=this._height*Cp(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ge.move:ge.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 Mn(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<Ee.Properties.length;s++){const o=Ee.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<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};k(Mn,"Properties",["width","height","sides"]);let Ro=Mn;const td={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Si=class Si extends Ee{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in nd)Object.defineProperty(this,l,nd[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new pe,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Si().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(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 Re),this.vertices[0].set(-n,-r).sub(this._origin).command=ge.move,this.vertices[1].set(n,-r).sub(this._origin).command=ge.line,this.vertices[2].set(n,r).sub(this._origin).command=ge.line,this.vertices[3].set(-n,r).sub(this._origin).command=ge.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=ge.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Si(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<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):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(Si,"Properties",["width","height","origin"]);let fr=Si;const nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(G.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Vn=class Vn extends Ee{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 Re(0,0,0,0,0,0,c===0?ge.move:ge.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 id)Object.defineProperty(this,c,id[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Sp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof pe)&&(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 pe?o:new pe().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 pe?(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<Ee.Properties.length;l++){const c=Ee.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 Po=Vn;const id={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof pe&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Sp(){this._flagRadius=!0}const Bp=Math.cos,Tp=Math.sin,In=class In extends Ee{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 rd)Object.defineProperty(this,l,rd[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 In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.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=li*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Bp(l),h=c*Tp(l);o>=s?this.vertices.push(new Re(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?ge.move:ge.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 In(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<Ee.Properties.length;l++){const c=Ee.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<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n}};k(In,"Properties",["innerRadius","outerRadius","sides"]);let $o=In;const rd={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Eo;const sd=Math.min,od=Math.max;mn.document&&(Eo=document.createElement("canvas"));const pt=class pt extends Tn{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,"_flagStrokeAttenuation",!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);k(this,"_strokeAttenuation",!0);for(let a in ad)Object.defineProperty(this,a,ad[a]);if(this._renderer.type="text",this._renderer.flagFill=Rp.bind(this),this._renderer.flagStroke=Pp.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,!$e.isObject(o))return this;for(let a=0;a<pt.Properties.length;a++){const l=pt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Eo){const r=Eo.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*pt.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:hi(n.fill),s=typeof n.stroke=="string"?n.stroke:hi(n.stroke),o=new pt().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<pt.Properties.length;r++){const s=pt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new pt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<pt.Properties.length;s++){const o=pt.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<pt.Properties.length;r++){const s=pt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}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}=pt.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[f,g]=r.multiply(s,a),[m,u]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=sd(g,u,b,_),s=sd(f,m,p,y),o=od(f,m,p,y),l=od(g,u,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(pt,"Ratio",.6),k(pt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let qi=pt;const ad={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Rp(){this._flagFill=!0}function Pp(){this._flagStroke=!0}const On=class On extends fr{constructor(n,r,s,o){super(r,s,0,0);k(this,"_flagTextures",!1);k(this,"_flagFrameRate",!1);k(this,"_flagIndex",!1);k(this,"_amount",1);k(this,"_duration",0);k(this,"_index",0);k(this,"_startTime",0);k(this,"_playing",!1);k(this,"_firstFrame",0);k(this,"_lastFrame",0);k(this,"_loop",!0);k(this,"_textures",null);k(this,"_frameRate",0);k(this,"_origin",null);this._renderer.type="image-sequence";for(let a in ld)Object.defineProperty(this,a,ld[a]);this._renderer.flagTextures=$p.bind(this),this._renderer.bindTextures=Ep.bind(this),this._renderer.unbindTextures=Np.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(cd.bind(this)):typeof n=="string"&&(this.textures=[cd(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=On.DefaultFrameRate,this.index=0}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])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=$e.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s: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(n){const r=new On(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,h;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,$e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=$e.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=qt(this._firstFrame,h,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof je))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(On,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),k(On,"DefaultFrameRate",30);let No=On;const ld={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(G.Types.insert,e).unbind(G.Types.remove,n),this._textures=new ci((t||[]).slice(0)),this._textures.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function $p(){this._flagTextures=!0}function Ep(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Np(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function cd(t){if(t instanceof je)return t;if(typeof t=="string")return new je(t)}const Bi=class Bi extends fr{constructor(n,r,s,o,a,l){super(r,s,0,0);k(this,"_flagTexture",!1);k(this,"_flagColumns",!1);k(this,"_flagRows",!1);k(this,"_flagFrameRate",!1);k(this,"_flagIndex",!1);k(this,"_amount",1);k(this,"_duration",0);k(this,"_startTime",0);k(this,"_playing",!1);k(this,"_firstFrame",0);k(this,"_lastFrame",0);k(this,"_loop",!0);k(this,"_texture",null);k(this,"_columns",1);k(this,"_rows",1);k(this,"_frameRate",0);k(this,"_index",0);k(this,"_origin",null);this._renderer.type="sprite";for(let c in dd)Object.defineProperty(this,c,dd[c]);this.noStroke(),this.noFill(),n instanceof je?this.texture=n:typeof n=="string"&&(this.texture=new je(n)),this.origin=new pe,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bi.Properties.length;r++){const s=Bi.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=$e.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s: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(n){const r=new Bi(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,h,f,g,m;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){f=n.image.width,g=n.image.height,o=f/r,a=g/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&($e.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=$e.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=qt(this._firstFrame,m,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const u=this._index%r,p=Math.floor(this._index/r),b=-o*u+(f-o)/2,y=-a*p+(g-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(Bi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Fo=Bi;const dd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},as=Math.min,ls=Math.max,nn=class nn extends Tn{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);k(this,"_strokeAttenuation",!0);for(let r in hd)Object.defineProperty(this,r,hd[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++)ud.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)ud.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new nn;for(let o=0;o<nn.Properties.length;o++){const a=nn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:hi(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 xo.fromObject(o);case"circle":return Co.fromObject(o);case"element":return hr.fromObject(o);case"ellipse":return To.fromObject(o);case"group":return nn.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return No.fromObject(o);case"path":return Ee.fromObject(o);case"points":return os.fromObject(o);case"polygon":return Ro.fromObject(o);case"rectangle":return fr.fromObject(o);case"rounded-rectangle":return Po.fromObject(o);case"shape":return Tn.fromObject(o);case"sprite":return Fo.fromObject(o);case"star":return $o.fromObject(o);case"text":return qi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new nn,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,$e.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}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,f=1/0,g=-1/0;const m=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let u=0;u<this.children.length;u++){const p=this.children[u];if(!(!p.visible||m.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||$e.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||$e.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||$e.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||$e.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,w]=s.multiply(r.right,r.top),[S,B]=s.multiply(r.left,r.bottom),[R,C]=s.multiply(r.right,r.bottom);f=as(y,w,B,C,f),d=as(b,_,S,R,d),h=ls(b,_,S,R,h),g=ls(y,w,B,C,g)}else f=as(r.top,f),d=as(r.left,d),h=ls(r.right,h),g=ls(r.bottom,g)}return{top:f,left:d,right:h,bottom:g,width:h-d,height:g-f}}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(nn,"Children",Zc),k(nn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Rn=nn;const hd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=Rn.InsertChildren.bind(this),n=Rn.RemoveChildren.bind(this),r=Rn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Zc(t),this._children.bind(G.Types.insert,e),this._children.bind(G.Types.remove,n),this._children.bind(G.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function ud(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class cs extends Ee{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in fd)Object.defineProperty(this,a,fd[a]);this.vertices[0].command=ge.move,this.vertices[1].command=ge.line,this.automatic=!1}}k(cs,"Properties",["left","right"]);const fd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if($e.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ge.move;else{const e=new ns("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if($e.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ge.line;else{const e=new ns("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Ao{constructor(e=0,n=0){this.x=e,this.y=n}}class yn{constructor(e=10,n=0,r="A"){k(this,"start",new Ao);k(this,"end",new Ao);this.width=e,this.angle=n,this.label=r}}const Oe={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"}},Fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ap(t,e){return i.openBlock(),i.createElementBlock("svg",Fp,[...e[0]||(e[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 ds=i.markRaw({name:"ion-close",render:Ap}),Mp={class:"mr-3 flex flex-col gap-2"},Vp=["onClick"],Ip={class:"h-full p-2"},Op={},zp=i.defineComponent({...Op,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((h,f)=>{var m;const g=(m=s.value)==null?void 0:m.at(f);g&&a("init-draw-template",g,h)}),(d=n.settings.customTemplates)==null||d.forEach((h,f)=>{var m;const g=(m=o.value)==null?void 0:m.at(f);g&&a("init-draw-template",g,h)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((h,f)=>{var g;if(!(d!=null&&d.includes(h))){const m=(g=o.value)==null?void 0:g.at(f);m&&a("init-draw-template",m,h)}}),d.length>c.length&&d.forEach((h,f)=>{var m;const g=(m=o.value)==null?void 0:m.at(f);g&&(g.innerHTML="",a("init-draw-template",g,h))})})},{deep:!0}),(c,d)=>{const h=ds;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Mp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(f,g)=>(i.openBlock(),i.createElementBlock("div",{key:`${f.id}-${g}`,class:"group relative"},[i.createVNode(i.unref(z.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":g===t.selectTemplateIndex}]),onClick:m=>a("template:select",g)},[i.createElementVNode("div",Ip,[i.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Vp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:m=>l(g)},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),gd=si(zp,[["__scopeId","data-v-69dd9f78"]]),Lp={class:"flex gap-3"},Dp={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Hp={ref:"drawing-container",class:"size-full"},Wp={},md=i.defineComponent({...Wp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((N,V)=>new yn(n.value.configuratorParams.linesWidths[V],N,`A-${V+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),g=i.computed(()=>{var N,V;return n.value.configuratorParams.startTailType&&((N=n.settings.startTailConfigs)!=null&&N[n.value.configuratorParams.startTailType])?(V=n.settings.startTailConfigs)==null?void 0:V[n.value.configuratorParams.startTailType].points:[]}),m=i.computed(()=>{var V;const N=n.value.configuratorParams.endTailType!==void 0&&((V=n.settings.endTailConfigs)==null?void 0:V[n.value.configuratorParams.endTailType]);return!N||!N.points?[]:N.points.map((q,X)=>Array.isArray(q)?new yn(q[0],q[1],`A-${X+1}`):new yn(q.width,q.angle,`A-${X+1}`))}),u=(N,V=!1)=>{N[0].start.x=0,N[0].start.y=0;let q=0;for(let X=0;X<N.length;X++){const I=N[X],W=N[X-1]??new yn(0,q);q+=!V||X>1?W.angle:0;const H=(!V||X>0?I.angle:0)+q;if(N[X].end.x=I.width*Math.cos(H*Math.PI/180)+N[X].start.x,N[X].end.y=I.width*Math.sin(H*Math.PI/180)+N[X].start.y,X<N.length-1){const U=X+1;N[U].start.x=N[X].end.x,N[U].start.y=N[X].end.y}}return N},p=(N,V,q,X,I=!1)=>{let W=u([...q,...X]);V.length>0&&(W=[...u(V),...W]);let H=0,U=0,fe=0,oe=0;W.forEach(Fe=>{H=Math.min(H,Fe.start.x,Fe.end.x),U=Math.min(U,Fe.start.y,Fe.end.y),fe=Math.max(fe,Fe.start.x,Fe.end.x),oe=Math.max(oe,Fe.start.y,Fe.end.y)});let re,Ne;H===0&&U===0&&fe===0&&oe===0?(re=1,Ne=1):(re=N.width/Math.abs(fe-H),Ne=(I?N.height:N.height-Oe.colorSideLabel.size)/Math.abs(oe-U));const Le=Math.min(re,Ne);return H=H<0?-H*Le:0,U=U<0?-U*Le:0,[Le,H,U]},b=N=>{const V=new os([N]);return V._size=Oe.anchorPoint.size,V.fill=Oe.anchorPoint.color,V.stroke="transparent",V._linewidth=Oe.anchorPoint.strokeSize,l.push(V),V},y=(N,V)=>{if(l=[],n.settings.allowChangeFirstPoint){const q=N[0],X=new pe(q.vertices[0].x,q.vertices[0].y);X.bind(G.Types.change,()=>{q.vertices[0].copy(X)});const I=b(X);V.add(I)}N.forEach((q,X)=>{const I=N[X+1],W=new pe(q.vertices[1].x,q.vertices[1].y);W.bind(G.Types.change,()=>{q.vertices[1].copy(W),I!==void 0&&I.vertices[0].copy(W)});const H=b(W);V.add(H)})},_=N=>N*(Math.PI/180),w=(N,V,q)=>{const X=V.vertices.length-1;N.position.x=V.vertices[X].x,N.position.y=V.vertices[X].y;const I=Math.atan2(V.vertices[X].y-V.vertices[0].y,V.vertices[X].x-V.vertices[0].x);N.rotation=_(q)+I},S=(N,V,q)=>{if(V.vertices[0]===void 0)return;N.position.x=V.vertices[0].x,N.position.y=V.vertices[0].y;const X=V.vertices.length-1,I=Math.atan2(V.vertices[X].y-V.vertices[0].y,V.vertices[X].x-V.vertices[0].x);N.rotation=_(q)+I},B=(N,V,q)=>{const X=new Rn;if(N.length===0)return X;const I=[];return[...N].reverse().forEach((W,H)=>{H!==0&&W.angle>0&&(W.angle*=-1),I.push(W)}),N=u(I,!0),S(X,V,N[0].angle),[V.vertices[0],V.vertices[1]].forEach(W=>{W.bind(G.Types.change,()=>{S(X,V,N[0].angle)})}),N.forEach(W=>{const H=W.start.x*q,U=W.end.x*q,fe=W.start.y*q,oe=W.end.y*q,re=new cs(H,fe,U,oe);re.linewidth=Oe.line.size,re.stroke=Oe.line.color,X.add(re)}),X},R=(N,V,q)=>{const X=new Rn;return N.length===0||(N=u(N,!0),w(X,V,N[0].angle),[V.vertices[0],V.vertices[1]].forEach(I=>{I.bind(G.Types.change,()=>{w(X,V,N[0].angle)})}),N.forEach(I=>{const W=I.start.x*q,H=I.end.x*q,U=I.start.y*q,fe=I.end.y*q,oe=new cs(W,U,H,fe);oe.linewidth=Oe.line.size,oe.stroke=Oe.line.color,X.add(oe)})),X},C=(N,V,q,X)=>{const I=V.vertices[0].x+(V.vertices[1].x-V.vertices[0].x)/2-8*Math.sin(N.angle*Math.PI/180),W=V.vertices[0].y+(V.vertices[1].y-V.vertices[0].y)/2-8*Math.cos(N.angle*Math.PI/180),H=new qi(N.label,I+10,W-10);let U;H.size=Oe.lineLabel.size,H.weight=600,H.fill=Oe.lineLabel.color,H.id+=1,H.rotation=Oe.lineLabel.rotation,X>0&&(U=new qi(`${N.angle}°`,V.vertices[0].x+25,V.vertices[0].y-25),U.size=Oe.angleLabel.size,U.weight=600,U.fill=Oe.angleLabel.color,U.rotation=Oe.angleLabel.rotation,U.id+=X,o.push(U),q.add(U)),q.add(H),v(H,V,0,U),v(H,V,1)},T=()=>{const{size:N}=Oe.colorSideLabel,V=0,q=0,X=f.value?N/2:N/2-N,I=f.value?N/2-N:N/2,W=new Rn;if(!c)return W;const H=5,U=Math.atan2(I-X,q-V),fe=[new Re(V,X,0,0,0,0,gn.Commands.move),new Re(q,I,0,0,0,0,gn.Commands.line),new Re(q-H*Math.cos(U-Math.PI/4),I-H*Math.sin(U-Math.PI/4),0,0,0,0,gn.Commands.line),new Re(q,I,0,0,0,0,gn.Commands.move),new Re(q-H*Math.cos(U+Math.PI/4),I-H*Math.sin(U+Math.PI/4),0,0,0,0,gn.Commands.line)],oe=new Ee(fe,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=N/7,oe.stroke=Oe.colorSideLabel.color,W.add(oe);const re=new qi(f.value?"Цвет снизу":"Цвет сверху",10,0);re.size=N,re.weight=600,re.fill=Oe.colorSideLabel.color,re.alignment="left",W.add(re);const Ne=W.getBoundingClientRect();return W.position.x=(c.width-Ne.width)*d+10,W.position.y=f.value?c.height+Ne.height*2:Ne.height/2,W},v=(N,V,q,X)=>{V.vertices[q].bind(G.Types.change,()=>{const I=V.vertices.length-1,W=Math.atan2(V.vertices[0].y-V.vertices[I].y,V.vertices[0].x-V.vertices[I].x)*180/Math.PI,H=V.vertices[0].x+(V.vertices[I].x-V.vertices[0].x)/2-8*Math.sin(W*Math.PI/180),U=V.vertices[0].y+(V.vertices[I].y-V.vertices[0].y)/2-8*Math.cos(W*Math.PI/180);N.position.x=H+10,N.position.y=U-10,N.rotation=-.5,X&&(X.position.x=V.vertices[0].x+25,X.position.y=V.vertices[0].y-25)})},P=(N,V,q,X,I=!1)=>{var Ut;if(N.clear(),q.length===0){N.update();return}const W=u(q),[H,U,fe]=p(N,V,W,X,I),oe=new Rn,re=new Array,Ne=new Array;I||(o=[],a=[]),W.forEach((Te,rn)=>{const sn=Te.start.x*H+U,Tt=Te.end.x*H+U,Ot=Te.start.y*H+fe,on=Te.end.y*H+fe,bt=new cs(sn,Ot,Tt,on);bt.linewidth=I?Oe.previewLine.size:Oe.line.size,bt.stroke=I?Oe.previewLine.color:Oe.line.color,a.push(bt),re.push(bt),oe.add(bt),!I&&Te.label!==""&&C(Te,bt,oe,rn)});const Le=re.at(-1);let Fe=oe.getBoundingClientRect();if(!I){const Te=T();Ne.push(Te)}if(V.length>0){const Te=B(V,re[0],H);oe.add(Te)}if(X.length>0&&Le){const Te=R(X,Le,H);oe.add(Te)}if(Ne.push(oe),N.makeGroup(Ne),Fe=oe.getBoundingClientRect(),oe.position.x=0-Fe.left+(N.width-Fe.width)/(2*(I?1:d)),oe.position.y=0-Fe.top+(N.height-Fe.height)/(2*(I?1:d)),N.update(),!I){const Te=((Ut=n.value.configuratorParams)==null?void 0:Ut.colorSide)==="top";oe.position.y=oe.position.y+Oe.colorSideLabel.size*Number(Te),y(re,oe),N.update()}},$=(N,V)=>{if(N&&!V.isNewRec()){const q=new gn({width:N.scrollWidth,height:N.scrollHeight});q.appendTo(N),P(q,[],V.points,[],!0)}},A=()=>{c&&P(c,g.value,h.value,m.value,!1)},F=N=>N*(180/Math.PI),O=(N,V)=>{const q=N[1].x-N[0].x,X=N[1].y-N[0].y,I=V[1].x-V[0].x,W=V[1].y-V[0].y;let H=Math.atan2(q*W-X*I,q*I+X*W);return H=F(H),Math.round(H)*-1},L=N=>{const V=a.map((q,X,I)=>{const W=I[X-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let H=Math.ceil(q._length/N/n.settings.lineWidthStep)*n.settings.lineWidthStep;const U=o[X-1];H<(I.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(H=I.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),H>n.settings.maxLineWidth&&(H=n.settings.maxLineWidth);const fe=O(q.vertices,W.vertices);return U&&(U.value=`${fe}°`),new yn(H,fe,`A-${X+1}`)});r("pointer:move",V)},J=N=>{let V=null,q;const X=U=>{V=l.find(fe=>{const oe=fe.renderer;return(oe==null?void 0:oe.elem)===U.target}),[q]=p(N,g.value,h.value.map(fe=>fe),m.value)},I=U=>{if(V){const fe=V.renderer,oe=fe==null?void 0:fe.elem;if(!oe)return;const re=oe.getBoundingClientRect();V.vertices[0].x-=re.x-(U instanceof MouseEvent?U.clientX:U.targetTouches[0].clientX)+Oe.anchorPoint.size/2,V.vertices[0].y-=re.y-(U instanceof MouseEvent?U.clientY:U.targetTouches[0].clientY)+Oe.anchorPoint.size/2,L(q),N.update()}},W=()=>{V&&r("pointer:up",h.value),V=null},H=s.value;H&&(H.addEventListener("touchstart",X,{passive:!0}),H.addEventListener("touchend",W,{passive:!0}),H.addEventListener("mousedown",X),H.addEventListener("mouseup",W),H.addEventListener("mousemove",I),H.addEventListener("touchmove",I,{passive:!0}))},ne=(N,V)=>{r("remove-custom-template",N,V)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{A()},{deep:!0,immediate:!0}),J(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(N,V)=>(i.openBlock(),i.createElementBlock("div",Lp,[i.createVNode(gd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":V[0]||(V[0]=q=>r("template:select",q)),onInitDrawTemplate:$,onRemoveCustomTemplate:ne},null,8,["select-template-index","settings"]),i.createElementVNode("div",Dp,[i.createElementVNode("div",Hp,null,512)])]))}});class Xi extends Q.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)=>M.isArray(s)?new yn(s[0],s[1],`A-${o+1}`):new yn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new yn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Mo extends Xi{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class pd{constructor(e){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");k(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Xi(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Mo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Mo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Xi(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Xi({label:"-- Новая конфигурация --",points:[new yn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Xi(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const jp={class:"flex max-w-[50rem] flex-col gap-3"},qp={},yd=i.defineComponent({...qp,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new pd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),f=i.ref(0),g=i.useTemplateRef("kozyrek-configurator-params-form");i.computed(()=>{const v=M.every(l.value.configuratorParams.linesWidths,F=>!!(F&&F>0)),P=M.every(l.value.configuratorParams.linesAngles,F=>!M.isNil(F)),$=!!(l.value.quantity&&l.value.quantity>0),A=l.value.configuratorParams.length>0&&l.value.configuratorParams.length>0;return v&&P&&$&&A});const m=(v=0)=>{var $;const P=($=c.value.allTemplates)==null?void 0:$.at(v);P!==void 0&&(f.value=v,l.value.configuratorParams.linesWidths=P.points.map(A=>M.isArray(A)?A[0]:A.width),l.value.configuratorParams.linesAngles=P.points.map(A=>M.isArray(A)?A[1]:A.angle),w()),y(l.value.configuratorParams)},u=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const P={label:v,points:l.value.configuratorParams.linesWidths.map((A,F)=>[A,l.value.configuratorParams.linesAngles[F]])},$=A=>{A&&(c.value.addCustomTemplate(P),f.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:P,callback:$})},p=async(v,P)=>{var F;const $=(F=c.value.allTemplates)==null?void 0:F.at(v);if(!$||!$.isCustom)return;const A=O=>{O&&(c.value.removeCustomTemplate($.id),m()),P==null||P()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:$.id,callback:A})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async v=>{var P,$;l.value.product=new Q.Product,($=(P=g.value)==null?void 0:P.formReference)==null||$.validate(A=>{A||(w(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:v,validationFieldResultData:h.value,callback:F=>{F?l.value.product=F:h.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(M.noop)},_=async()=>{var v,P;(P=(v=g.value)==null?void 0:v.formReference)==null||P.validate($=>{$||(o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1,i.nextTick(()=>{var A,F;(F=(A=g.value)==null?void 0:A.formReference)==null||F.restoreValidation()})}))}).catch(M.noop)},w=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((P,$)=>{v[`lines_widths[${$+1}]`]={},v[`lines_angles[${$+1}]`]={}}),h.value=v},S=v=>{d.value.linesWidths=v.map(P=>P.width),d.value.linesAngles=v.map(P=>P.angle)},B=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,w(),b(),y(l.value.configuratorParams)},R=(v,P)=>{d.value.linesWidths=v,d.value.linesAngles=P},C=v=>{const P=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(v+1,0,P),l.value.configuratorParams.linesAngles.splice(v+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],w(),b(),y(l.value.configuratorParams)},T=v=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(v,1),l.value.configuratorParams.linesAngles.splice(v,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],w(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{m()}),i.watch(()=>n.cartItem,v=>{l.value=new Q.CartItemBase(v),m()}),(v,P)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",jp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:P[0]||(P[0]=A=>r("click:view-switch"))},{default:i.withCtx(()=>[...P[3]||(P[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(md,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":B,"onPointer:move":S,"onTemplate:select":m,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(tl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":P[1]||(P[1]=A=>l.value=A),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":P[2]||(P[2]=A=>y(A)),"onUpdate:preview":R,onSubmit:_,"onClick:saveTemplate":u,"onClick:addLine":C,"onClick:removeLine":T},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Xp={},Yi=i.defineComponent({...Xp,__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},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=M.debounce(()=>s("update:value",o.value),a.value),c=m=>{o.value=m,l()};i.watch(()=>r.value,m=>{o.value=m});const d=i.ref(null);return e({focus:()=>{var m;return(m=d.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=d.value)==null?void 0:m.blur()},select:()=>{var m;return(m=d.value)==null?void 0:m.select()}}),(m,u)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:u[0]||(u[0]=p=>s("keydown",p)),onInput:u[1]||(u[1]=p=>s("input",p))},{prefix:i.withCtx(()=>[i.renderSlot(m.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),Yp={key:0,class:"flex items-baseline gap-1"},Up={key:0,class:"flex items-baseline gap-1"},Kp={key:1},Gp={class:"text-lg font-semibold"},Zp={key:2,class:"text-red-500 text-sm mb-2"},Qp={class:"flex gap-3"},Jp={},bd=i.defineComponent({...Jp,__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(t,{expose:e,emit:n}){var C;const r=t,s=n,o=i.computed(()=>wt.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),h=i.ref(M.cloneDeep(r.value)),f=i.computed(()=>r.settings.widthOverlaps[h.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.heightOverlaps[h.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.maxWidths[h.value.configuratorParams.netType]),u=i.computed(()=>r.settings.maxHeights[h.value.configuratorParams.netType]),p=i.computed(()=>h.value.configuratorParams.width?h.value.configuratorParams.width+f.value:0),b=i.computed(()=>h.value.configuratorParams.height?h.value.configuratorParams.height+g.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[he.required,he.min(r.settings.minWidth-f.value),he.max(m.value-f.value),he.step(1),Ze.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[he.required,he.min(r.settings.minHeight-g.value),he.max(u.value-g.value),he.step(1),Ze.serverValidation(r.validation.height.feedback)],quantity:[he.required,he.min(1),he.step(1),Ze.serverValidation(r.validation.quantity.feedback)],marker:[Ze.serverValidation(r.validation.marker.feedback)]})),w=i.computed(()=>{var F;const T=p.value,v=b.value,{quantity:P}=r.value,$=((F=r.value.product)==null?void 0:F.costRub)||0;if(!T||!v||!P||$===0)return null;const A=T*v/1e6;return($*P*A).toLocaleString("ru-ru",{minimumFractionDigits:2})}),S=i.computed(()=>{const T=p.value,v=b.value,P=!!(T&&T>=r.settings.minWidth&&T<=r.settings.maxWidths[h.value.configuratorParams.netType]),$=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[h.value.configuratorParams.netType]),A=!!(r.value.quantity&&r.value.quantity>0);return P&&$&&A}),B=(T,v)=>{var A,F;const P=h.value.configuratorParams;T&&T in P&&(P[T]=v);const $={...P,width:p.value??0,height:b.value??0};T==="width"&&((A=l.value)==null||A.validate().catch(M.noop)),T==="height"&&((F=c.value)==null||F.validate().catch(M.noop)),i.nextTick(()=>{var L,J;!((L=l.value)!=null&&L.validationErrored)&&!((J=c.value)!=null&&J.validationErrored)&&$.height&&$.width&&s("update:params",$),R("configuratorParams",$)})},R=(T,v)=>{const P=new Q.CartItemBase(r.value);P[T]=v,T==="configuratorParams"&&(P.product=new Q.Product),s("update:value",P)};return i.watch(()=>r.value,T=>{const v=M.cloneDeep(i.toRaw(T)),P=v.configuratorParams.mountType,$=r.settings.widthOverlaps[P]??0,A=r.settings.heightOverlaps[P]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=$),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=A),h.value=v},{deep:!0}),i.onMounted(()=>{var T;(T=d.value)==null||T.select()}),e({validate:(C=a.value)==null?void 0:C.validate,formReference:a}),(T,v)=>{const P=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:h.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96",onKeydown:v[25]||(v[25]=i.withKeys(i.withModifiers($=>s("submit",h.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=$=>h.value.configuratorParams.netType=$),v[1]||(v[1]=$=>B("netType",$))],options:t.settings.netType.map($=>({label:t.settings.descriptions.net_type[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=$=>h.value.configuratorParams.color=$),v[3]||(v[3]=$=>B("color",$))],options:t.settings.color.map($=>({label:t.settings.descriptions.color[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=$=>h.value.configuratorParams.mountType=$),v[5]||(v[5]=$=>B("mountType",$))],options:t.settings.mountType.map($=>({label:t.settings.descriptions.mount_type[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Yp,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...v[26]||(v[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-reference",value:h.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=$=>h.value.configuratorParams.width=$),v[9]||(v[9]=$=>B("width",$))],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=$=>i.unref(_t)($)),onInput:v[8]||(v[8]=$=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-g.value} ${u.value?" до "+(u.value-g.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Up,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...v[27]||(v[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{value:h.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=$=>h.value.configuratorParams.height=$),v[14]||(v[14]=$=>B("height",$))],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=$=>i.unref(_t)($)),onInput:v[13]||(v[13]=$=>i.unref(Ke)(t.validation,"height"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:h.value.quantity,"onUpdate:value":[v[16]||(v[16]=$=>h.value.quantity=$),v[19]||(v[19]=$=>R("quantity",$??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=$=>i.unref(_t)($,!1)),onInput:v[18]||(v[18]=$=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=$=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":v[21]||(v[21]=$=>{h.value.marker=$??null,R("marker",$??null)})},null,8,["value"])]),_:1}),y.value?(i.openBlock(),i.createBlock(P,{key:0,checked:h.value.dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[22]||(v[22]=$=>{h.value.dopProdaga=$??!1,R("dopProdaga",$??!1)})},{default:i.withCtx(()=>[...v[28]||(v[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ar,{"is-product-searching":t.isProductSearching,product:h.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),w.value?(i.openBlock(),i.createElementBlock("div",Kp,[v[29]||(v[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Gp,i.toDisplayString(w.value)+" ₽",1)])):i.createCommentVNode("",!0),S.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Zp," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Qp,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!S.value||h.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[23]=$=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=$=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...v[30]||(v[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),ey="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",ty="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",ny="/img/configurators/mosquitto/measurement-instructions/mount.png",iy="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ry="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",sy={class:"flex flex-col gap-6"},oy={class:"flex gap-4"},ay={class:"flex flex-col gap-2"},ly={class:"flex gap-4"},cy={class:"flex flex-col gap-2"},dy={class:"flex gap-4"},hy={class:"flex flex-col gap-2"},uy={},_d=i.defineComponent({...uy,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=wt.initRefDependingOnDeviceResolution("small","small","medium"),r=wt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.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",sy,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),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:ey,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:ty,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",oy,[l[9]||(l[9]=i.createElementVNode("img",{src:ny,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",ay,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",ly,[l[15]||(l[15]=i.createElementVNode("img",{src:iy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",cy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",dy,[l[21]||(l[21]=i.createElementVNode("img",{src:ry,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",hy,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),fy={class:"flex flex-col items-center justify-between rounded-xl"},gy={class:"img-preview relative flex justify-center"},my={},py=i.defineComponent({...my,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",fy,[i.createElementVNode("div",gy,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.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)])]),_:1})])}}}),Vo=si(py,[["__scopeId","data-v-a67fd61e"]]),yy={class:"grid md:grid-cols-2"},by={},wd=i.defineComponent({...by,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>wt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),h=i.ref(!1),f=i.ref(!1),g=async u=>{var p,b;l.value.product=new Q.Product,(b=(p=c.value)==null?void 0:p.formReference)==null||b.validate(y=>{y||(h.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:u,validationFieldResultData:d.value,callback:_=>{_?l.value.product=_:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},h.value=!1}}))}).catch(M.noop)},m=()=>{f.value=!0,r("submit",l.value,d.value,()=>{f.value=!1})};return i.watch(()=>n.cartItem,u=>{l.value=u},{deep:!0}),(u,p)=>{const b=ds;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(_d,{show:a.value,"onUpdate:show":p[0]||(p[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",yy,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":p[4]||(p[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:p[2]||(p[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Vo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[3]||(p[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Vo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[1]||(p[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(bd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":p[5]||(p[5]=y=>l.value=y),validation:d.value,settings:t.settings,"is-product-searching":h.value,"is-submit-processing":f.value,"onUpdate:params":p[6]||(p[6]=y=>g(y)),onSubmit:p[7]||(p[7]=y=>m()),"onClick:instructionsToggle":p[8]||(p[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":p[9]||(p[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),_y={},xd=i.defineComponent({..._y,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},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:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var g;return!((g=c.value)!=null&&g.validationErrored)}),h=g=>{l.value=g,s("update:value",g,r.index,a)},f=()=>{var g;(g=o.value)==null||g.select()};return i.watch(()=>r.value,g=>{l.value=g}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(g,m)=>{const u=el,p=Ja;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(ar,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:h},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(Gt),placeholder:"Введите ширину",onKeydown:m[0]||(m[0]=b=>i.unref(_t)(b)),onInput:m[1]||(m[1]=b=>i.unref(Ke)(t.validation,`linesWidths.${t.index}`)),"onUpdate:value":h},null,8,["value","parse"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[2]||(m[2]=b=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[3]||(m[3]=b=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),wy={class:"my-2 flex w-full flex-col"},xy={key:1},vy={class:"text-lg font-semibold"},ky={class:"flex gap-3"},Cy={},vd=i.defineComponent({...Cy,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var y;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const _={length:[he.required,he.min(r.settings.minLength),he.max(r.settings.maxLength),he.step(r.settings.lengthStep),Ze.serverValidation(r.validation.length.feedback)],quantity:[he.required,he.min(1),Ze.serverValidation(r.validation.quantity.feedback)],marker:[Ze.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(w,S)=>{var B;_[`configuratorParams.linesWidths.${S}`]=[he.required,he.min(r.settings.minLineWidth),he.step(r.settings.lineWidthStep),Ze.serverValidation((B=r.validation[`linesWidths.${S}`])==null?void 0:B.feedback)]}),_}),d=i.ref(r.settings.canSetDopProdaga??!1),h=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((_,w)=>(_??0)+(w??0),0)),f=i.computed(()=>r.settings.width-h.value),g=i.computed(()=>!r.value.some(({product:_})=>!_||_.isNewRec())),m=i.computed(()=>_=>f.value===0?void 0:[{label:`${(f.value>0?"Остаток +":"Излишек ")+f.value} мм.`,key:f.value+_}]),u=i.computed(()=>{const{length:_}=r.value[0];return!_||h.value!==r.settings.width?null:(M.reduce(r.value,(S,B)=>{var C;const R=((C=B.product)==null?void 0:C.costRub)||0;return S+R},0)*r.value[0].quantity*_).toLocaleString("ru-ru",{minimumFractionDigits:2})}),p=(_,w,S)=>{var R,C,T;l.value[w].product.id=-1;const{configuratorParams:B}=l.value[w];B.linesWidths[w]=_,b("configuratorParams",B),(T=(C=(R=a.value)==null?void 0:R.at(w))==null?void 0:C.formItemReference)==null||T.validate().catch(M.noop),i.nextTick(()=>{var v,P;(P=(v=a.value)==null?void 0:v.at(w))!=null&&P.isValid&&s("update:params",B,w,S)})},b=(_,w)=>{l.value.forEach(S=>{S[_]=w}),s("update:value",l.value)};return i.watch(()=>r.value,_=>{l.value=M.cloneDeep(_)},{deep:!0}),e({validate:(y=o.value)==null?void 0:y.validate,formReference:o}),(_,w)=>{const S=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2",onKeydown:w[15]||(w[15]=i.withKeys(i.withModifiers(B=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var B;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(R,C)=>(i.openBlock(),i.createBlock(xd,{key:C,ref_for:!0,ref:"line-items-reference",value:R.configuratorParams.linesWidths.at(C)??null,"auto-focus":!0,index:C,path:`configuratorParams.linesWidths.${C}`,product:R.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(R.configuratorParams.linesWidths.at(C)??0),"add-line-button-disabled":f.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(T=>T.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":p,"onClick:addLine":w[0]||(w[0]=T=>s("click:add-line",T)),"onClick:removeLine":w[1]||(w[1]=T=>s("click:remove-line",T))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",wy,[f.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),g.value&&l.value.length===t.settings.maxLinesCount&&f.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...w[16]||(w[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[w[17]||(w[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:f.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{disabled:t.isSubmitProcessing||!g.value||f.value<=0||l.value.length>=t.settings.maxLinesCount||t.value.some(R=>R.product.isNewRec()),type:"primary",class:"self-center",onClick:w[2]||(w[2]=R=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...w[18]||(w[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[w[3]||(w[3]=R=>l.value[0].length=R),w[6]||(w[6]=R=>b("length",R))],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:w[4]||(w[4]=R=>i.unref(_t)(R,!1)),onInput:w[5]||(w[5]=R=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[w[7]||(w[7]=R=>l.value[0].quantity=R),w[10]||(w[10]=R=>b("quantity",R))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:w[8]||(w[8]=R=>i.unref(_t)(R,!1)),onInput:w[9]||(w[9]=R=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:w[11]||(w[11]=R=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":w[12]||(w[12]=R=>{l.value[0].marker=R??null,b("marker",R??null)})},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createBlock(S,{key:0,checked:l.value[0].dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":w[13]||(w[13]=R=>{l.value[0].dopProdaga=R??!1,b("dopProdaga",R??!1)})},{default:i.withCtx(()=>[...w[19]||(w[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",xy,[w[20]||(w[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",vy,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",ky,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||f.value!=0||!((B=l.value[0])!=null&&B.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:w[14]||(w[14]=R=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),Sy={class:"flex grow flex-col"},By=["src"],Ty={class:"w-full"},Ry={},kd=i.defineComponent({...Ry,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Sy,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,By),i.createElementVNode("div",Ty,[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)])]))}}),Py={class:"flex flex-col gap-2"},$y={class:"w-104 flex grow flex-col px-5"},Ey={},Cd=i.defineComponent({...Ey,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>o.value[0].configuratorParams.linesWidths.reduce((m,u)=>(m??0)+(u??0),0)),d=m=>{m===void 0&&(m=o.value.length-1);const u=o.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(m+1,0,null),o.value.forEach(b=>{b.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const p=new Q.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});o.value=o.value.toSpliced(m+1,0,p)},h=m=>{const u=o.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(m,1),o.value.forEach(p=>{p.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),o.value=o.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},f=async(m,u,p)=>{const b={linesWidths:m.linesWidths.at(u)};p.value=!0,a.value[`linesWidths.${u}`]={},o.value[u].product=new Q.Product,n.eventEmitter.emit("configurator:search-product",{category:o.value[u].category,params:b,validationFieldResultData:a.value,callback:y=>{y?(o.value[u].product=y,u===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&c.value&&c.value<n.settings.width&&d()):(o.value[u].product=new Q.Product,a.value[`linesWidths.${u}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},p.value=!1),p.value=!1}})},g=async()=>{var m,u;(u=(m=s.value)==null?void 0:m.formReference)==null||u.validate(p=>{if(!p){l.value=!0;const b=o.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var y,_;(_=(y=s.value)==null?void 0:y.formReference)==null||_.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,m=>{o.value=m.map(u=>new Q.CartItemBase(u))}),(m,u)=>{const p=z.NButton;return i.openBlock(),i.createElementBlock("div",Py,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[3]||(u[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",$y,[i.createVNode(kd,{value:o.value,"onUpdate:value":u[1]||(u[1]=b=>o.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(vd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":u[2]||(u[2]=b=>o.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":f,onSubmit:g,"onClick:addLine":d,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing"])])])}}}),Ny={class:"flex flex-col gap-3"},Fy={},Sd=i.defineComponent({...Fy,__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","submit"],setup(t,{expose:e,emit:n}){var m;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[he.required,he.min(r.settings.minWidth),...r.settings.maxWidth?[he.max(r.settings.maxWidth)]:[],he.step(1),Ze.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[he.required,he.min(r.settings.minLength),he.max(r.settings.maxLength),he.step(1),Ze.serverValidation(r.validation.length.feedback)],quantity:[he.required,he.min(1),he.step(1),Ze.serverValidation(r.validation.quantity.feedback)],marker:[Ze.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),h=()=>{s("update:params",l.value.configuratorParams),f("configuratorParams",l.value.configuratorParams)},f=(u,p)=>{const b=new Q.CartItemBase(r.value);b[u]=p,u==="configuratorParams"&&(b.product=new Q.Product),s("update:value",b)},g=()=>{var u;(u=a.value)==null||u.select()};return i.watch(()=>r.value,u=>{l.value=M.cloneDeep(u)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{g()})}),e({validate:(m=o.value)==null?void 0:m.validate,formReference:o}),(u,p)=>{const b=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),h],class:"w-full",parse:i.unref(Gt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(_t)(y)),onInput:p[2]||(p[2]=y=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),h],placeholder:"Введите длину",parse:i.unref(Gt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(_t)(y)),onInput:p[5]||(p[5]=y=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(_t)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(Ke)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>f("quantity",y??0))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>f("marker",y??null))},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.dopProdaga??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.dopProdaga=y??!1,f("dopProdaga",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ar,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Ny,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),Ay={class:"flex flex-col gap-2 w-72"},My={},Bd=i.defineComponent({...My,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=async f=>{var g,m;o.value.product=new Q.Product,(m=(g=s.value)==null?void 0:g.formReference)==null||m.validate(u=>{u||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:p=>{p?o.value.product=p:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},h=async()=>{var f,g;(g=(f=s.value)==null?void 0:f.formReference)==null||g.validate(m=>{m||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var u,p;(p=(u=s.value)==null?void 0:u.formReference)==null||p.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,f=>{o.value=new Q.CartItemBase(f)},{deep:!0}),(f,g)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",Ay,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=u=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Sd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=u=>o.value=u),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=u=>d(u)),onSubmit:g[3]||(g[3]=u=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Vy={key:0,class:"flex justify-center p-4"},Iy={key:1,class:"p-4 text-center text-red-500"},Oy={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},zy={key:3,class:"p-4 text-center text-gray-500"},Td=i.defineComponent({__name:"dynamic-configurator",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function]},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function]},categoryContextButtonsConfig:{type:Function},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configuratorSettings}),o=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configurator}),a=i.ref(null),l=i.ref(null),c=()=>{var g,m;if(!s.value){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:e.categoryItem,configurator:o.value,quantity:1};switch(o.value){case"kozyrek":{const u=s.value;a.value=new Q.CartItemBase({...f,configuratorParams:{length:u.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(u.startTailConfigs,p=>p.isDefault)?(g=u.startTailConfigs)==null?void 0:g.findIndex(p=>p.isDefault):void 0,endTailType:M.some(u.endTailConfigs,p=>p.isDefault)?(m=u.endTailConfigs)==null?void 0:m.findIndex(p=>p.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const u=s.value;a.value=new Q.CartItemBase({...f,configuratorParams:{width:0,height:0,netType:u.netType[0]||"",color:u.color[0]||"",mountType:u.mountType[0]||""}});break}case"strip":{const u=s.value;l.value=[new Q.CartItemBase({...f,length:u.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const u=s.value;a.value=new Q.CartItemBase({...f,configuratorParams:{width:u.minWidth,length:u.minLength}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${o.value}.`}a.value&&(a.value.marker=void 0)},d=(f,g,m)=>{const u=p=>{m==null||m(),p&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:u,validation:g})},h=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})};return i.onMounted(()=>{c()}),(f,g)=>{const m=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",Vy,[i.createVNode(m,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",Iy,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),s.value!==null&&(a.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",Oy,[o.value==="kozyrek"?(i.openBlock(),i.createBlock(yd,{key:0,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="mosquitto"?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="strip"?(i.openBlock(),i.createBlock(Cd,{key:2,"event-emitter":t.eventEmitter,settings:s.value,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):o.value==="metal_for_doors"?(i.openBlock(),i.createBlock(Bd,{key:3,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",zy,' Конфигуратор "'+i.toDisplayString(o.value)+'" не поддерживается. ',1))],64)}}}),Ly={key:0,class:"pt-0.5"},Dy={key:0},Hy={class:"line-through"},Wy={key:0},jy={key:1},qy={class:"flex flex-row gap-1"},Xy={key:0},Yy={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Uy={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ky={key:2,class:"flex flex-col"},Gy={},Zy=i.defineComponent({...Gy,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},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},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Ar,"medium"),r=i.computed(()=>{var H;return(H=e==null?void 0:e.filteredItems)==null?void 0:H[e.categoryItem.id]}),s=i.computed(()=>{var H,U;return M.isArray((H=e.categoryItem)==null?void 0:H.categories)&&((U=e.categoryItem.categories)==null?void 0:U.length)>0}),o=i.computed(()=>{var H;return M.isArray((H=e.categoryItem)==null?void 0:H.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([H,U])=>`${U} руб./${$(H)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(H=>{var fe;const U=(fe=r.value)==null?void 0:fe.products;return M.isArray(U)&&U.includes(H.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),f=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),g=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=i.computed(()=>{var H,U;return((H=e.categoryItem.properties)==null?void 0:H.configurator)!==void 0&&((U=e.categoryItem.properties)==null?void 0:U.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),u=i.computed(()=>{var H,U;return((H=e.categoryItem.properties)==null?void 0:H.configurator)!==void 0&&((U=e.categoryItem.properties)==null?void 0:U.configuratorSettings)!==void 0&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new Q.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),w=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),S=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),B=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),R=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),C=i.computed(()=>X.value&&wt.getDeviceTypeByResolution()===Ye.laptop?"auto":"fixed"),T=i.useTemplateRef("collapse-item-reference"),v=i.computed(()=>{var H,U;return(U=(H=e.categoryItem.properties)==null?void 0:H.templateCost)==null?void 0:U.priceCoefficient}),P=i.computed(()=>{var H,U;return(U=(H=e.categoryItem.properties)==null?void 0:H.templateCost)==null?void 0:U.increasePercent}),$=(H,U="ru-RU")=>0 .toLocaleString(U,{style:"currency",currency:H,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=H=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:H,target:T.value})},F=(H,U)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:U,isLoadingState:y,target:T.value})},O=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:T.value})},L=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:T.value})},J=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:T.value})},ne=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:T.value})},N=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:T.value})},V=H=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:H,target:T.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},X=i.ref(0),I=i.computed(()=>X.value&&o.value.length>0?Tg(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),W=M.debounce(()=>{X.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",W)}),window.addEventListener("resize",W),W(),(H,U)=>{const fe=z.NCheckbox,oe=uf,re=z.NTooltip,Ne=cf,Le=z.NTag,Fe=of,Ut=nf,Te=z.NButton,rn=Ju,sn=Xa,Tt=qa,Ot=ja,on=Wa,bt=z.NDropdown,zn=z.NDataTable,an=z.NAlert,Kt=z.NSpin;return i.openBlock(),i.createBlock(Ya,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":F},{"pre-arrow":i.withCtx(()=>{var Pe,K;return[w.value?(i.openBlock(),i.createElementBlock("div",Ly,[i.createVNode(fe,{checked:S.value,indeterminate:R.value,disabled:B.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Pe=b.value)!=null&&Pe.isDisabled)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[U[1]||(U[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((K=b.value)==null?void 0:K.isFavorite)??!1?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ne,{class:"pt-1.5"})]),default:i.withCtx(()=>[U[2]||(U[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Pe,K,se,Ie,Jn;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Pe=b.value)==null?void 0:Pe.isDisabled})},[i.createVNode(re,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[U[3]||(U[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:U[0]||(U[0]=i.withModifiers((...Qe)=>i.unref(M.noop)&&i.unref(M.noop)(...Qe),["prevent","stop"]))},[(K=t.categoryItem.properties)!=null&&K.m2Price?(i.openBlock(),i.createBlock(Le,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((se=t.categoryItem.properties)==null?void 0:se.templateCost)&&t.categoryItem.properties.m2PriceRetail&&P.value}),round:""},{default:i.withCtx(()=>{var Qe;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Qe=t.categoryItem.properties)!=null&&Qe.templateCost&&t.categoryItem.properties.m2PriceRetail&&P.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[P.value?(i.openBlock(),i.createBlock(Le,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[P.value?(i.openBlock(),i.createElementBlock("span",Dy,i.toDisplayString(P.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(Le,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",Hy,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Ie=t.categoryItem.properties)!=null&&Ie.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[v.value||P.value?(i.openBlock(),i.createBlock(Le,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Qe;return[v.value?(i.openBlock(),i.createElementBlock("span",Wy,i.toDisplayString((Qe=v.value)==null?void 0:Qe.name),1)):i.createCommentVNode("",!0),P.value?(i.openBlock(),i.createElementBlock("span",jy,i.toDisplayString(P.value>0?"+":"")+i.toDisplayString(P.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Le,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((Jn=b.value)!=null&&Jn.manager)?(i.openBlock(),i.createBlock(Le,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ne},{default:i.withCtx(()=>[i.createVNode(re,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Qe,zt;return[i.createElementVNode("span",qy,[i.createVNode(Fe),i.createTextVNode(" "+i.toDisplayString((zt=(Qe=b.value)==null?void 0:Qe.manager)==null?void 0:zt.name),1)])]}),default:i.withCtx(()=>{var Qe,zt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((zt=(Qe=b.value)==null?void 0:Qe.manager)==null?void 0:zt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Xy,[i.createElementVNode("ul",Yy,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Pe,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Pe,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Pe;return[i.createElementVNode("div",Uy,[d.value?(i.openBlock(),i.createBlock(re,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:O},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createBlock(oe,{key:1})):(i.openBlock(),i.createBlock(Ut,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Pe=b.value)!=null&&Pe.manager)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:J},{default:i.withCtx(()=>[i.createVNode(rn)]),_:1},8,["size"])]),default:i.withCtx(()=>{var K,se,Ie;return[(K=b.value)!=null&&K.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ie=(se=b.value)==null?void 0:se.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,disabled:f.value==="disabled",size:i.unref(n),onClick:L},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isRequired?(i.openBlock(),i.createBlock(Tt,{key:1})):(i.openBlock(),i.createBlock(sn,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[U[4]||(U[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(re,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary",onClick:N},{default:i.withCtx(()=>[i.createVNode(Ot)]),_:1},8,["size"])]),default:i.withCtx(()=>[U[5]||(U[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(bt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:V},{default:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(on)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(H.$slots,"default",{},()=>{var Pe;return[s.value?(i.openBlock(),i.createBlock(Pd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Pe=r.value)==null?void 0:Pe.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(Td,{key:1,"event-emitter":t.eventEmitter,"category-item":t.categoryItem},null,8,["event-emitter","category-item"])):c.value?(i.openBlock(),i.createElementBlock("div",Ky,[m.value?(i.openBlock(),i.createBlock(Te,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:i.withCtx(()=>[...U[6]||(U[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(zn,{columns:I.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":K=>K.id,"table-layout":C.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(an,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(an,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Kt,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...U[7]||(U[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Qy=si(Zy,[["__scopeId","data-v-9320b350"]]),Jy={class:"sc-collapse flex w-full flex-col"},e0={},Rd=i.defineComponent({...e0,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,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",Jy,[i.renderSlot(o.$slots,"default")]))}}),t0={},Pd=i.defineComponent({...t0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},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},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Ar,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(M.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=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Rd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Qy,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.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),!t.hasProducts&&!t.loading&&t.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)}}}),n0={},$d=i.defineComponent({...n0,__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(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=new Q.Reference,l=i.computed(()=>{const m=o.value?[]:a,u=M.isUndefined(r.value)?m:r.value;return M.isArray(u)?u.map(p=>p.id):u==null?void 0:u.id}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=m=>{var u;if(M.isArray(m)){const p=m.length>0?m.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=m===a.id||(u=c.value.find(b=>b.value===m))==null?void 0:u.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var m;return(m=h.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=h.value)==null?void 0:m.blur()}}),(m,u)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),i0={},r0=i.defineComponent({...i0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var w,S;const n=t,r=e,s=()=>{const B=Q.PriceCoefficient.getRetailPriceCoefficient();return M.unset(B,"isNewRec"),B},o=B=>!B||B.id===s().id,a=i.computed(()=>{var B;return((B=n.catalogItem)==null?void 0:B.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=B=>{var R,C,T,v;return B.id===s().id?(R=l.value)==null?void 0:R.getRetailCost():(v=(T=(C=l.value)==null?void 0:C.priceCoefficients)==null?void 0:T.find(P=>P.coefficient.id===B.id))==null?void 0:v.cost},d=i.computed(()=>{var R;const B=[...((R=Q.useReferencesStore().priceCoefficientsReference)==null?void 0:R.map(C=>structuredClone(i.toRaw(C))))??[],s()];return a.value&&B.forEach(C=>{var v;const T=c(C);T?C.name+=` (${T} ${(v=l.value)==null?void 0:v.currency})`:C.name=""}),B.filter(C=>C.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((S=(w=n.value)==null?void 0:w.value)==null?void 0:S.toString())??null),g=i.ref(null),m=i.computed(()=>{var B,R;return(R=(B=l.value)==null?void 0:B.priceCoefficients)==null?void 0:R.find(C=>C.coefficient.slug===Q.PriceCoefficientEnum.K0)}),u=i.ref(void 0),p=()=>{var R,C,T;u.value=void 0;let B=Number.parseFloat(((R=f.value)==null?void 0:R.replace(",","."))??"");if(B=Number.isNaN(B)?void 0:B,a.value)if(h.value||f.value){const v=s(),P=c(h.value??v)??0,$=P+P*((B??0)/100);g.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format($),$>(((C=l.value)==null?void 0:C.getRetailCost())??$)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&$<(((T=m.value)==null?void 0:T.cost)??0)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else g.value=null;r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},b=B=>{M.isArray(B)||(h.value=B,f.value=null,!h.value&&f.value&&(h.value=s()),p())},y=()=>{h.value||(h.value=s()),p()},_=B=>{var C,T,v,P,$,A;const R=Number.parseFloat((B==null?void 0:B.replace(",","."))??"");if(a.value){let F=0;if(R<=0)h.value=void 0,f.value=null;else if(m.value&&R<(((C=m.value)==null?void 0:C.cost)??0))h.value=(T=m.value)==null?void 0:T.coefficient,F=(R-m.value.cost)*100/m.value.cost,u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(R>(((v=l.value)==null?void 0:v.getRetailCost())??R)){h.value=s();const O=((P=l.value)==null?void 0:P.getRetailCost())??0;F=(R-O)*100/O,u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const O=(A=($=l.value)==null?void 0:$.priceCoefficients)==null?void 0:A.filter(L=>L.cost<R);if(O&&O.length>0){const L=O.at(-1);h.value=L==null?void 0:L.coefficient,F=(R-((L==null?void 0:L.cost)??0))*100/((L==null?void 0:L.cost)??1)}u.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(F),r("update:value",{value:Number.isNaN(F)?void 0:F,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:void 0})};return i.onMounted(()=>{var B,R,C,T;n.calculationType===Q.CalculationTypeEnum.m2Cost?g.value=((R=(B=n.value)==null?void 0:B.value)==null?void 0:R.toString())??null:!((C=n.value)!=null&&C.coefficient)&&((T=n.value)!=null&&T.value)&&(h.value=s()),p()}),(B,R)=>{var v,P,$;const C=z.NInput,T=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((v=u.value)==null?void 0:v.feedback)??t.feedback),feedback:((P=u.value)==null?void 0:P.feedback)??t.feedback,"validation-status":(($=u.value)==null?void 0:$.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(Q.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(Q.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(T,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode($d,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(C,{value:f.value,"onUpdate:value":[R[0]||(R[0]=A=>f.value=A),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[R[3]||(R[3]=i.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[R[2]||(R[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(Q.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(C,{key:1,value:g.value,"onUpdate:value":[R[1]||(R[1]=A=>g.value=A),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var A;return[i.createTextVNode(i.toDisplayString((A=l.value)==null?void 0:A.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),s0={key:0,class:"flex flex-row gap-2.5"},o0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},a0={},Ed=i.defineComponent({...a0,__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}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=wt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=wt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},f=(m="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let u=!1;s("closing",m,()=>{u=!0}),u||(o.value=!1,s("update:show",o.value))},g=()=>{s("accept",u=>{a.value=u})};return i.watch(()=>r.show,m=>{m?h():f("other")}),i.watch(()=>r.processing,m=>{a.value=m}),e({open:h,close:f,acceptHandler:g}),(m,u)=>{const p=z.NButton,b=z.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":m.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:u[1]||(u[1]=y=>f("header")),onEsc:u[2]||(u[2]=y=>f("esc")),onMaskClick:u[3]||(u[3]=y=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(m.$slots,"default")]),_:2},[m.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(m.$slots,"header")]),key:"0"}:void 0,m.$slots.action||m.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[m.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",s0,[i.renderSlot(m.$slots,"extra-action")])):i.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",o0,[i.renderSlot(m.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:g},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:u[0]||(u[0]=y=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),l0={class:"text-sm"},c0={},d0=i.defineComponent({...c0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var C,T;return((T=(C=o.value)==null?void 0:C.properties)==null?void 0:T.isLengthConfigurator)??!1}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),h=i.ref(null),f=n,g=()=>({length:{},quantity:{},marker:{}}),m=i.ref(g()),u=i.ref(!1),p=i.computed(()=>{var $,A,F,O;if(!o.value)return{};const C=Q.UnitsHelper.getProductLengthMultiplicity(o.value),T=Q.UnitsHelper.getProductMultiplicity(o.value),v=((A=($=o.value)==null?void 0:$.properties)==null?void 0:A.minLength)||C,P=(O=(F=o.value)==null?void 0:F.properties)==null?void 0:O.maxLength;return{length:[he.required,he.min(v??.1),he.max(P),he.step(C),Ze.serverValidation(m.value.length.feedback)],quantity:[he.required,he.min(T),he.step(T),Ze.serverValidation(m.value.quantity.feedback)],marker:[Ze.serverValidation(m.value.marker.feedback)]}}),b=i.computed(()=>{var C,T,v;return o.value?((C=o.value.properties)==null?void 0:C.lengthStep)??((T=o.value.properties)!=null&&T.ignoreMinCountCheck?0:((v=o.value.properties)==null?void 0:v.minCount)??0):0}),y=i.computed(()=>{var v,P,$,A,F,O,L,J,ne;if(!o.value)return"";const C=((P=(v=o.value)==null?void 0:v.properties)==null?void 0:P.minLength)??((A=($=o.value)==null?void 0:$.properties)!=null&&A.ignoreMinCountCheck?0:(O=(F=o.value)==null?void 0:F.properties)==null?void 0:O.minCount),T=(J=(L=o.value)==null?void 0:L.properties)==null?void 0:J.maxLength;return C||T?`(${C?`от ${C}`:""}${C&&T?" ":""}${T?`до ${T}`:""} ${(ne=o.value)==null?void 0:ne.unit})`:""}),_=C=>{var A,F;if(!((F=(A=o.value)==null?void 0:A.properties)!=null&&F.isLengthConfigurator)||!h.value||M.isNil(C)||b.value===0)return;const T=C/b.value,v=Math.round(T),P=Q.UnitsHelper.getProductMultiplicity(o.value),$=Math.max(v,P);h.value.quantity=$},w=C=>{var $,A,F,O;if(!((A=($=o.value)==null?void 0:$.properties)!=null&&A.isLengthConfigurator)||!h.value||M.isNil(C)||b.value===0)return;const T=C*b.value,v=((F=o.value.properties)==null?void 0:F.minLength)||Q.UnitsHelper.getProductLengthMultiplicity(o.value),P=(O=o.value.properties)==null?void 0:O.maxLength;v!==void 0&&T<v?h.value.length=v:P!==void 0&&T>P?h.value.length=P:h.value.length=T},S=async C=>{var T;try{await((T=r.value)==null?void 0:T.validate(v=>{if(!v){if(!o.value||!h.value)return;Q.UnitsHelper.productIsMeasurable(o.value)||delete h.value.length,a.value&&b.value&&(h.value.length=b.value),u.value=!0,f("submit",h.value,m.value,()=>{u.value=!1,C(!1),i.nextTick(()=>{var P;(P=r.value)==null||P.validate(M.noop).catch(M.noop)})})}}))}catch{}},B=()=>{o.value=null,l.value=void 0,h.value=null,m.value=g()};return e({show:(C,T)=>{var v,P,$,A,F;if(o.value=C,l.value=T==null?void 0:T.cartItemData,c.value=T==null?void 0:T.orderId,d.value=(T==null?void 0:T.canSetDopProdaga)??!1,h.value=new Q.CartItemBase((T==null?void 0:T.cartItemData)??new Q.CartItemBase({product:C,quantity:Q.UnitsHelper.productIsMeasurable(o.value)?1:((v=C==null?void 0:C.properties)==null?void 0:v.minCount)??1,length:((P=C==null?void 0:C.properties)==null?void 0:P.minLength)||(($=C==null?void 0:C.properties)!=null&&$.ignoreMinCountCheck?0:(A=C==null?void 0:C.properties)==null?void 0:A.minCount)||0})),(F=C==null?void 0:C.properties)!=null&&F.isLengthConfigurator&&h.value&&b.value>0){const O=b.value,L=h.value.quantity||1;h.value.length=L*O}},closeDialog:B}),(C,T)=>{var L;const v=z.NInputNumber,P=z.NFormItem,$=z.NInputGroupLabel,A=z.NInputGroup,F=z.NInput,O=z.NCheckbox;return i.openBlock(),i.createBlock(Ed,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(o.value)&&!i.unref(M.isNil)(h.value),title:`${l.value?"Изменение":"Добавление"} товара ${(L=o.value)==null?void 0:L.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:u.value,"modal-width":500,onAccept:S,onClosing:B},{default:i.withCtx(()=>{var J;return[o.value&&h.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:h.value,rules:p.value,class:"flex flex-col gap-2",onKeydown:i.withKeys(i.withModifiers((J=s.value)==null?void 0:J.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>{var ne;return[i.unref(Q.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(P,{key:0,path:"length",label:`Метраж, ${y.value+o.value.unit}`},{default:i.withCtx(()=>[i.createVNode(v,{value:h.value.length,"onUpdate:value":[T[0]||(T[0]=N=>h.value.length=N),_],parse:i.unref(Gt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:T[1]||(T[1]=N=>i.unref(Ha)(N,".",!1)),onInput:T[2]||(T[2]=N=>i.unref(Ke)(m.value,"length"))},null,8,["value","parse"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(P,{path:"quantity",label:`Количество, ${(ne=o.value)==null?void 0:ne.quantityUnit}`},{default:i.withCtx(()=>[i.createVNode(A,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(v,{value:h.value.quantity,"onUpdate:value":[T[3]||(T[3]=N=>h.value.quantity=N),w],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:T[4]||(T[4]=N=>i.unref(_t)(N,!1)),onInput:T[5]||(T[5]=N=>i.unref(Ke)(m.value,"quantity"))},null,8,["value"]),a.value?(i.openBlock(),i.createBlock($,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(o.value.unit),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!m.value.quantity.feedback&&i.unref(Q.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",l0,"Количество должно быть кратно "+i.toDisplayString(i.unref(Q.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),i.unref(Q.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(P,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(F,{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:T[6]||(T[6]=N=>i.unref(Ke)(m.value,"marker")),"onUpdate:value":T[7]||(T[7]=N=>h.value.marker=N??null)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(O,{key:2,checked:h.value.dopProdaga,"onUpdate:checked":T[8]||(T[8]=N=>h.value.dopProdaga=N),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...T[9]||(T[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]}),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),h0={class:"flex flex-row gap-1"},u0={class:"sc-client-name flex flex-col gap-1 text-base"},f0=["href"],g0={key:1,class:"text-sc-grey"},m0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},p0={key:0},y0={key:1,class:"text-sm"},b0={},hs=i.defineComponent({...b0,__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(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Dn.format(n.client.lastLoginAt,Q.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Os,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",h0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",u0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",g0," [ Деактивирован ] "))],8,f0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",m0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",p0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",y0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),_0={class:"text-base"},w0={},Nd=i.defineComponent({...w0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",_0,i.toDisplayString(t.contragent.name),1))}}),x0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v0(t,e){return i.openBlock(),i.createElementBlock("svg",x0,[...e[0]||(e[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 k0=i.markRaw({name:"tabler-mail",render:v0}),C0=["href"],S0={},B0=i.defineComponent({...S0,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=k0;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,C0)],2)}}}),T0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function R0(t,e){return i.openBlock(),i.createElementBlock("svg",T0,[...e[0]||(e[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 Fd=i.markRaw({name:"fa6-brands-viber",render:R0}),P0={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},$0=["id"],E0=["id"],N0=["fill"],F0=["fill"];function A0(t,e){return i.openBlock(),i.createElementBlock("svg",P0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,$0),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,E0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",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,N0),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",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,F0),e[2]||(e[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 Ad=i.markRaw({name:"logos-whatsapp-icon",render:A0,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),M0={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},V0=["id"],I0=["fill"];function O0(t,e){return i.openBlock(),i.createElementBlock("svg",M0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,V0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",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,I0),e[1]||(e[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 Md=i.markRaw({name:"logos-telegram",render:O0,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),z0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function L0(t,e){return i.openBlock(),i.createElementBlock("svg",z0,[...e[0]||(e[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 Vd=i.markRaw({name:"ion-call",render:L0}),D0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H0(t,e){return i.openBlock(),i.createElementBlock("svg",D0,[...e[0]||(e[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 W0=i.markRaw({name:"tabler-phone-call",render:H0}),j0={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},q0=["href"],X0=["href"],Y0=["href"],U0=["href"],K0={},G0=i.defineComponent({...K0,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?rr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=W0,h=Vd,f=Md,g=Ad,m=Fd;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]=u=>a.value=!a.value),onFocusout:c[1]||(c[1]=u=>a.value=!1),onMouseleave:c[2]||(c[2]=u=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.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",j0,[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,q0)):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(f)],8,X0)):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(g)],8,Y0)):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(m)],8,U0)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Z0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q0(t,e){return i.openBlock(),i.createElementBlock("svg",Z0,[...e[0]||(e[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 J0=i.markRaw({name:"mdi-envelope",render:Q0}),eb={class:"flex flex-col gap-1"},tb={key:0,class:"mb-2 flex flex-col text-base"},nb={key:0,class:"text-sc-dark-grey text-sm"},ib={key:1,class:"whitespace-nowrap text-sm"},rb={key:2,class:"whitespace-nowrap text-sm"},sb={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},ob=["href"],ab=["href"],lb=["href"],cb=["href"],db=["href"],hb={key:0,class:"flex flex-col text-base"},ub={key:0,class:"text-sc-dark-grey text-sm"},fb={key:1,class:"mt-2 text-sm"},gb={key:0,class:"-mt-1"},mb={},pb=i.defineComponent({...mb,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?rr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const h=Vd,f=Md,g=Ad,m=Fd,u=J0,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",eb,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,w,S,B;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=R=>l.value=!0),onFocusin:d[1]||(d[1]=R=>l.value=!0),onMouseleave:d[2]||(d[2]=R=>l.value=!1),onFocusout:d[3]||(d[3]=R=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(w=t.contact)!=null&&w.position)?(i.openBlock(),i.createElementBlock("div",tb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(S=t.contact)!=null&&S.position?(i.openBlock(),i.createElementBlock("span",nb,i.toDisplayString((B=t.contact)==null?void 0:B.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",ib,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",rb,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",sb,[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,ob)):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(f)],8,ab)):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(g)],8,lb)):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(m)],8,cb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(u)],8,db)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,w,S,B;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",hb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",ub,i.toDisplayString((w=t.contact)==null?void 0:w.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(S=t.contact)!=null&&S.comment?(i.openBlock(),i.createElementBlock("div",fb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((B=t.contact)==null?void 0:B.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",gb,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class yb{constructor(e){k(this,"minHeight");k(this,"maxHeights");k(this,"minWidth");k(this,"maxWidths");k(this,"netType");k(this,"color");k(this,"mountType");k(this,"descriptions");k(this,"crossbarCount");k(this,"heightOverlaps");k(this,"widthOverlaps");k(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Is.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Is.objectToSnake(e.heightOverlaps),this.widthOverlaps=Is.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}const bb={class:"flex flex-wrap gap-2"},_b={class:"flex flex-col"},wb={class:"flex flex-col"},xb={},vb=i.defineComponent({...xb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Q.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return M.forOwn(Q.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?Dn.startOfDay(new Date(a)):void 0,to:l?Dn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,g,m,u,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",bb,[i.createVNode(d,{value:((f=(h=t.dateRange)==null?void 0:h.from)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(g=t.disabled)==null?void 0:g.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",_b,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var w,S;return o((w=b==null?void 0:b.from)==null?void 0:w.getTime(),(S=b==null?void 0:b.to)==null?void 0:S.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((u=(m=t.dateRange)==null?void 0:m.to)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",wb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var w,S;return o((w=b==null?void 0:b.from)==null?void 0:w.getTime(),(S=b==null?void 0:b.to)==null?void 0:S.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),kb={class:"sc-lbl-date text-nowrap"},Cb={},Io=i.defineComponent({...Cb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Dn.format(e.date,Q.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Dn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",kb,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),Sb={class:"flex flex-row gap-2.5"},Bb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},Tb={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Rb={class:"mb-0.5 sm:mb-0 sm:ml-3"},Pb={},$b=i.defineComponent({...Pb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ds,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",Sb,[i.createElementVNode("div",Bb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",Tb,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",Rb,[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=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),Eb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Nb(t,e){return i.openBlock(),i.createElementBlock("svg",Eb,[...e[0]||(e[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 Fb=i.markRaw({name:"ion-download-outline",render:Nb}),Ab={},Mb=i.defineComponent({...Ab,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=Fb;return i.openBlock(),i.createBlock(i.unref(z.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Vb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ib(t,e){return i.openBlock(),i.createElementBlock("svg",Vb,[...e[0]||(e[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 Ob=i.markRaw({name:"ion-checkmark-done-sharp",render:Ib}),zb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Lb(t,e){return i.openBlock(),i.createElementBlock("svg",zb,[...e[0]||(e[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 Db=i.markRaw({name:"ion-options-outline",render:Lb}),Hb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Wb={class:"flex-auto"},jb={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"},qb={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"},Xb={},Oo=i.defineComponent({...Xb,__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(t,{emit:e}){const n=e,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=Db,f=z.NButton,g=z.NPopover,m=Ob,u=ds;return i.openBlock(),i.createElementBlock("div",Hb,[i.createElementVNode("div",Wb,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",jb,[i.createElementVNode("div",qb,[t.showEditButton?(i.openBlock(),i.createBlock(g,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.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))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(g,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(g,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),Yb={},Id=i.defineComponent({...Yb,__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(t,{emit:e}){const n=t,r=e,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 i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(Oo,{key:1,disabled:t.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(Oo,{key:0,disabled:t.disabled,"show-edit-button":t.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"]))]))}}),Ub={},Kb=i.defineComponent({...Ub,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=M.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(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Gb={},Zb=i.defineComponent({...Gb,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof rr.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=rr.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof rr.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(Hu.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),Qb=si(Zb,[["__scopeId","data-v-751dbb0e"]]),Jb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e_(t,e){return i.openBlock(),i.createElementBlock("svg",Jb,[...e[0]||(e[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 t_=i.markRaw({name:"tabler-external-link",render:e_}),n_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},i_=["href"],r_={},s_=i.defineComponent({...r_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=t_,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",n_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,i_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),o_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function a_(t,e){return i.openBlock(),i.createElementBlock("svg",o_,[...e[0]||(e[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 l_=i.markRaw({name:"ion-remove-circle-outline",render:a_});let us=[];const Od=new WeakMap;function c_(){us.forEach(t=>t(...Od.get(t))),us=[]}function zd(t,...e){Od.set(t,e),!us.includes(t)&&us.push(t)===1&&requestAnimationFrame(c_)}function gr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function mr(t){return t.composedPath()[0]||null}function pr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function yr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Jt(t,e){const n=t.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]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Ld={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 d_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function h_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/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 bn="^\\s*",_n="\\s*$",Yn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",It="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ui="([0-9A-Fa-f])",fi="([0-9A-Fa-f]{2})",Dd=new RegExp(`${bn}hsl\\s*\\(${It},${Yn},${Yn}\\)${_n}`),Hd=new RegExp(`${bn}hsv\\s*\\(${It},${Yn},${Yn}\\)${_n}`),Wd=new RegExp(`${bn}hsla\\s*\\(${It},${Yn},${Yn},${It}\\)${_n}`),jd=new RegExp(`${bn}hsva\\s*\\(${It},${Yn},${Yn},${It}\\)${_n}`),u_=new RegExp(`${bn}rgb\\s*\\(${It},${It},${It}\\)${_n}`),f_=new RegExp(`${bn}rgba\\s*\\(${It},${It},${It},${It}\\)${_n}`),g_=new RegExp(`${bn}#${ui}${ui}${ui}${_n}`),m_=new RegExp(`${bn}#${fi}${fi}${fi}${_n}`),p_=new RegExp(`${bn}#${ui}${ui}${ui}${ui}${_n}`),y_=new RegExp(`${bn}#${fi}${fi}${fi}${fi}${_n}`);function Et(t){return parseInt(t,16)}function b_(t){try{let e;if(e=Wd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),mi(e[13])];if(e=Dd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function __(t){try{let e;if(e=jd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),mi(e[13])];if(e=Hd.exec(t))return[gs(e[1]),Un(e[5]),Un(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function gi(t){try{let e;if(e=m_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),1];if(e=u_.exec(t))return[ut(e[1]),ut(e[5]),ut(e[9]),1];if(e=f_.exec(t))return[ut(e[1]),ut(e[5]),ut(e[9]),mi(e[13])];if(e=g_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),1];if(e=y_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),mi(Et(e[4])/255)];if(e=p_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),mi(Et(e[4]+e[4])/255)];if(t in Ld)return gi(Ld[t]);if(Dd.test(t)||Wd.test(t)){const[n,r,s,o]=b_(t);return[...h_(n,r,s),o]}else if(Hd.test(t)||jd.test(t)){const[n,r,s,o]=__(t);return[...d_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function w_(t){return t>1?1:t<0?0:t}function zo(t,e,n,r){return`rgba(${ut(t)}, ${ut(e)}, ${ut(n)}, ${w_(r)})`}function Lo(t,e,n,r,s){return ut((t*e*(1-r)+n*r)/s)}function x_(t,e){Array.isArray(t)||(t=gi(t)),Array.isArray(e)||(e=gi(e));const n=t[3],r=e[3],s=mi(n+r-n*r);return zo(Lo(t[0],n,e[0],r,s),Lo(t[1],n,e[1],r,s),Lo(t[2],n,e[2],r,s),s)}function Ve(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:gi(t);return typeof e.alpha=="number"?zo(n,r,s,e.alpha):zo(n,r,s,o)}function fs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:gi(t),{lightness:a=1,alpha:l=1}=e;return v_([n*a,r*a,s*a,o*l])}function mi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function gs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function ut(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Un(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function v_(t){const[e,n,r]=t;return 3 in t?`rgba(${ut(e)}, ${ut(n)}, ${ut(r)}, ${mi(t[3])})`:`rgba(${ut(e)}, ${ut(n)}, ${ut(r)}, 1)`}function k_(t=8){return Math.random().toString(16).slice(2,2+t)}function qd(t){return Array.isArray(t)?t:[t]}const Do={STOP:"STOP"};function Xd(t,e){const n=e(t);t.children!==void 0&&n!==Do.STOP&&t.children.forEach(r=>Xd(r,e))}function C_(t,e={}){const{preserveGroup:n=!1}=e,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(t),r}function S_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function B_(t){return t.children}function T_(t){return t.key}function R_(){return!1}function P_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function $_(t){return t.disabled===!0}function E_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function N_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Ho(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Wo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function F_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function A_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function M_(t){return(t==null?void 0:t.type)==="group"}function V_(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class I_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function O_(t,e,n,r){return ms(e.concat(t),n,r,!1)}function z_(t,e){const n=new Set;return t.forEach(r=>{const s=e.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 L_(t,e,n,r){const s=ms(e,n,r,!1),o=ms(t,n,r,!0),a=z_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function jo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:F_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:A_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let f;s!==void 0?f=L_(s,n,e,d):r!==void 0?f=O_(r,n,e,d):f=ms(n,e,d,!1);const g=c==="parent",m=c==="child"||l,u=f,p=new Set,b=Math.max.apply(null,Array.from(h.keys()));for(let y=b;y>=0;y-=1){const _=y===0,w=h.get(y);for(const S of w){if(S.isLeaf)continue;const{key:B,shallowLoaded:R}=S;if(m&&R&&S.children.forEach(P=>{!P.disabled&&!P.isLeaf&&P.shallowLoaded&&u.has(P.key)&&u.delete(P.key)}),S.disabled||!R)continue;let C=!0,T=!1,v=!0;for(const P of S.children){const $=P.key;if(!P.disabled){if(v&&(v=!1),u.has($))T=!0;else if(p.has($)){T=!0,C=!1;break}else if(C=!1,T)break}}C&&!v?(g&&S.children.forEach(P=>{!P.disabled&&u.has(P.key)&&u.delete(P.key)}),u.add(B)):T&&p.add(B),_&&m&&u.has(B)&&u.delete(B)}}return{checkedKeys:Array.from(u),indeterminateKeys:Array.from(p)}}function ms(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&Xd(d,h=>{if(h.disabled)return Do.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),E_(h.rawNode,o))){if(r)return Do.STOP;if(!n)throw new I_}})}),l}function D_(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==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&&(e||!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 H_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function W_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Yd(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?j_:W_,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=qo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=q_(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(t),l}function j_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function q_(t){return t.parent}function qo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;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=qo(d,e);if(h!==null)return h}else return d}}return null}const X_={getChild(){return this.ignored?null:qo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Yd(this,"next",t)},getPrev(t={}){return Yd(this,"prev",t)}};function Y_(t,e){const n=e?new Set(e):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(t),r}function U_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var K_={};function Ud(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;K_.NODE_ENV!=="production"&&N_(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===t.length,f.parent=o,!f.ignored){const g=s(c);Array.isArray(g)&&(f.children=Ud(g,e,n,r,s,f,a+1))}l.push(f),e.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function G_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=$_,getIgnored:a=R_,getIsGroup:l=M_,getKey:c=T_}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:B_,h=e.ignoreEmptyChildren?S=>{const B=d(S);return Array.isArray(B)?B.length?B:null:B}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return S_(this.rawNode,h)},get shallowLoaded(){return P_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(S){return U_(this,S)}},X_),g=Ud(t,r,s,f,h);function m(S){if(S==null)return null;const B=r.get(S);return B&&!B.isGroup&&!B.ignored?B:null}function u(S){if(S==null)return null;const B=r.get(S);return B&&!B.ignored?B:null}function p(S,B){const R=u(S);return R?R.getPrev(B):null}function b(S,B){const R=u(S);return R?R.getNext(B):null}function y(S){const B=u(S);return B?B.getParent():null}function _(S){const B=u(S);return B?B.getChild():null}const w={treeNodes:g,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(S){return Y_(g,S)},getNode:m,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return H_(g)},getPath(S,B={}){return D_(S,B,w)},getCheckedKeys(S,B={}){const{cascade:R=!0,leafOnly:C=!1,checkStrategy:T="all",allowNotLoaded:v=!1}=B;return jo({checkedKeys:Ho(S),indeterminateKeys:Wo(S),cascade:R,leafOnly:C,checkStrategy:T,allowNotLoaded:v},w)},check(S,B,R={}){const{cascade:C=!0,leafOnly:T=!1,checkStrategy:v="all",allowNotLoaded:P=!1}=R;return jo({checkedKeys:Ho(B),indeterminateKeys:Wo(B),keysToCheck:S==null?[]:qd(S),cascade:C,leafOnly:T,checkStrategy:v,allowNotLoaded:P},w)},uncheck(S,B,R={}){const{cascade:C=!0,leafOnly:T=!1,checkStrategy:v="all",allowNotLoaded:P=!1}=R;return jo({checkedKeys:Ho(B),indeterminateKeys:Wo(B),keysToUncheck:S==null?[]:qd(S),cascade:C,leafOnly:T,checkStrategy:v,allowNotLoaded:P},w)},getNonLeafKeys(S={}){return C_(g,S)}};return w}function ps(t){return t.composedPath()[0]}const Z_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Q_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(ps(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(ps(a))},o=a=>{r&&(e.contains(ps(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Kd(t,e,n){const r=Z_[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=Q_(t,e,n)),o}function J_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Kd(t,e,n);return Object.keys(s).forEach(o=>{St(o,document,s[o],r)}),!0}return!1}function e1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Kd(t,e,n);return Object.keys(s).forEach(o=>{nt(o,document,s[o],r)}),!0}return!1}function t1(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(C,T,v){const P=C[T];return C[T]=function(){return v.apply(C,arguments),P.apply(C,arguments)},C}function o(C,T){C[T]=Event.prototype[T]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var C;return(C=a.get(this))!==null&&C!==void 0?C:null}function d(C,T){l!==void 0&&Object.defineProperty(C,"currentTarget",{configurable:!0,enumerable:!0,get:T??l.get})}const h={bubble:{},capture:{}},f={};function g(){const C=function(T){const{type:v,eventPhase:P,bubbles:$}=T,A=ps(T);if(P===2)return;const F=P===1?"capture":"bubble";let O=A;const L=[];for(;O===null&&(O=window),L.push(O),O!==window;)O=O.parentNode||null;const J=h.capture[v],ne=h.bubble[v];if(s(T,"stopPropagation",n),s(T,"stopImmediatePropagation",r),d(T,c),F==="capture"){if(J===void 0)return;for(let N=L.length-1;N>=0&&!t.has(T);--N){const V=L[N],q=J.get(V);if(q!==void 0){a.set(T,V);for(const X of q){if(e.has(T))break;X(T)}}if(N===0&&!$&&ne!==void 0){const X=ne.get(V);if(X!==void 0)for(const I of X){if(e.has(T))break;I(T)}}}}else if(F==="bubble"){if(ne===void 0)return;for(let N=0;N<L.length&&!t.has(T);++N){const V=L[N],q=ne.get(V);if(q!==void 0){a.set(T,V);for(const X of q){if(e.has(T))break;X(T)}}}}o(T,"stopPropagation"),o(T,"stopImmediatePropagation"),d(T)};return C.displayName="evtdUnifiedHandler",C}function m(){const C=function(T){const{type:v,eventPhase:P}=T;if(P!==2)return;const $=f[v];$!==void 0&&$.forEach(A=>A(T))};return C.displayName="evtdUnifiedWindowEventHandler",C}const u=g(),p=m();function b(C,T){const v=h[C];return v[T]===void 0&&(v[T]=new Map,window.addEventListener(T,u,C==="capture")),v[T]}function y(C){return f[C]===void 0&&(f[C]=new Set,window.addEventListener(C,p)),f[C]}function _(C,T){let v=C.get(T);return v===void 0&&C.set(T,v=new Set),v}function w(C,T,v,P){const $=h[T][v];if($!==void 0){const A=$.get(C);if(A!==void 0&&A.has(P))return!0}return!1}function S(C,T){const v=f[C];return!!(v!==void 0&&v.has(T))}function B(C,T,v,P){let $;if(typeof P=="object"&&P.once===!0?$=J=>{R(C,T,$,P),v(J)}:$=v,J_(C,T,$,P))return;const F=P===!0||typeof P=="object"&&P.capture===!0?"capture":"bubble",O=b(F,C),L=_(O,T);if(L.has($)||L.add($),T===window){const J=y(C);J.has($)||J.add($)}}function R(C,T,v,P){if(e1(C,T,v,P))return;const A=P===!0||typeof P=="object"&&P.capture===!0,F=A?"capture":"bubble",O=b(F,C),L=_(O,T);if(T===window&&!w(T,A?"bubble":"capture",C,v)&&S(C,v)){const ne=f[C];ne.delete(v),ne.size===0&&(window.removeEventListener(C,p),f[C]=void 0)}L.has(v)&&L.delete(v),L.size===0&&O.delete(T),O.size===0&&(window.removeEventListener(C,u,F==="capture"),h[F][C]=void 0)}return{on:B,off:R}}const{on:St,off:nt}=t1(),Ui="@@mmoContext",n1={mounted(t,{value:e}){t[Ui]={handler:void 0},typeof e=="function"&&(t[Ui].handler=e,St("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ui];typeof e=="function"?n.handler?n.handler!==e&&(nt("mousemoveoutside",t,n.handler),n.handler=e,St("mousemoveoutside",t,e)):(t[Ui].handler=e,St("mousemoveoutside",t,e)):n.handler&&(nt("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ui];e&&nt("mousemoveoutside",t,e),t[Ui].handler=void 0}},Ki="@@coContext",ys={mounted(t,{value:e,modifiers:n}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,St("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Ki];typeof e=="function"?r.handler?r.handler!==e&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,St("clickoutside",t,e,{capture:n.capture})):(t[Ki].handler=e,St("clickoutside",t,e,{capture:n.capture})):r.handler&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Ki];n&&nt("clickoutside",t,n,{capture:e.capture}),t[Ki].handler=void 0}};function i1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class r1{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&i1("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Xo=new r1,Gi="@@ziContext",Gd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Gi]={enabled:!!s,initialized:!1},s&&(Xo.ensureZIndex(t,r),t[Gi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Gi].enabled;s&&!o&&(Xo.ensureZIndex(t,r),t[Gi].initialized=!0),t[Gi].enabled=!!s},unmounted(t,e){if(!t[Gi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Xo.unregister(t,r)}};function s1(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Xt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const o1=typeof window<"u";let Zi,br;(()=>{var t,e;Zi=o1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,br=!1,Zi!==void 0?Zi.then(()=>{br=!0}):br=!0})();function a1(t){if(br)return;let e=!1;i.onMounted(()=>{br||Zi==null||Zi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Yo(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function bs(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function Zd(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const l1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function c1(){return l1}function Uo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Ko(t,e=!0,n=[]){return t.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,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ko(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Kn=null;function Jd(){if(Kn===null&&(Kn=document.getElementById("v-binder-view-measurer"),Kn===null)){Kn=document.createElement("div"),Kn.id="v-binder-view-measurer";const{style:t}=Kn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Kn)}return Kn.getBoundingClientRect()}function d1(t,e){const n=Jd();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Go(t){const e=t.getBoundingClientRect(),n=Jd();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function h1(t){return t.nodeType===9?null:t.parentNode}function eh(t){if(t===null)return null;const e=h1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return eh(e)}const th=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=eh(y),y!==null;)o.push(y);for(const _ of o)St("scroll",_,f,!0)},l=()=>{for(const y of o)nt("scroll",y,f,!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()},f=()=>{zd(g)},g=()=>{c.forEach(y=>y())},m=new Set,u=y=>{m.size===0&&St("resize",window,b),m.has(y)||m.add(y)},p=y=>{m.has(y)&&m.delete(y),m.size===0&&nt("resize",window,b)},b=()=>{m.forEach(y=>y())};return i.onBeforeUnmount(()=>{nt("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:u,removeResizeListener:p}},render(){return Uo("binder",this.$slots)}}),nh=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(Qd("follower",this.$slots),[[e]]):Qd("follower",this.$slots)}}),u1="@css-render/vue3-ssr";function f1(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
105
|
</style>`}function g1(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(f1(t,e)))}const m1=typeof document<"u";function pi(){if(m1)return;const t=i.inject(u1,null);if(t!==null)return{adapter:(e,n)=>g1(e,n,t),context:t}}function ih(t,e){console.error(`[vueuc/${t}]: ${e}`)}function p1(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const rh=/\s*,(?![^(]*\))\s*/g,y1=/\s+/g;function b1(t,e){const n=[];return e.split(rh).forEach(r=>{let s=p1(r);if(s){if(s===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function _1(t,e){const n=[];return e.split(rh).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function w1(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=b1(e,n):e=_1(e,n))}),e.join(", ").replace(y1," ")}function sh(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function _s(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function x1(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ws(t){return t?/^\s*@(s|m)/.test(t):!1}const v1=/[A-Z]/g;function oh(t){return t.replace(v1,e=>"-"+e.toLowerCase())}function k1(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(n=>e+` ${oh(n[0])}: ${n[1]};`).join(`
|
|
@@ -113,7 +113,7 @@ ${s}
|
|
|
113
113
|
`);return}l=oh(l),c!=null&&a.push(` ${l}${k1(c)}`)}),t&&a.push("}"),a.join(`
|
|
114
114
|
`)}function Zo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Zo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Zo(s,e,n):s&&n(s)}else r&&n(r)})}function lh(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")ws(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});ws(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")ws(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});ws(d)?a=d:e.push(d)}const l=w1(e),c=ah(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&Zo(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=ah(l,{raw:d},r,s);n.push(h)}else lh(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function S1(t,e,n){const r=[];return lh(t,[],r,e,n),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function Qo(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function B1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(sh),e.els=[];else{const o=_s(n,r);o&&s.includes(o)&&(sh(o),e.els=s.filter(a=>a!==o))}}function ch(t,e){t.push(e)}function T1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Qo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=_s(n,l);if(h!==null&&!o)return h;const f=h??x1(n);if(d===void 0&&(d=e.render(r)),f.textContent=d,h!==null)return h;if(a){const g=l.querySelector(`meta[name="${a}"]`);if(g)return l.insertBefore(f,g),ch(e.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),ch(e.els,f),f}function R1(t){return S1(this,this.instance,t)}function P1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return T1(this.instance,this,e,r,s,o,a,l,n)}function $1(t={}){const{id:e,parent:n}=t;B1(this.instance,this,e,n)}const xs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:R1,mount:P1,unmount:$1}},E1=function(t,e,n,r){return Array.isArray(e)?xs(t,{$:null},null,e):Array.isArray(n)?xs(t,e,null,n):Array.isArray(r)?xs(t,e,n,r):xs(t,e,n,null)};function dh(t={}){const e={c:((...n)=>E1(e,...n)),use:(n,...r)=>n.install(e,...r),find:_s,context:{},config:t};return e}function N1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return _s(t)!==null}const{c:Gn}=dh(),Jo="vueuc-style";function hh(t){return t&-t}class uh{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=hh(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=hh(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function fh(t){return typeof t=="string"?document.querySelector(t):t()||null}const F1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:s1(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Uo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Uo("lazy-teleport",this.$slots)):null}}),vs={top:"bottom",bottom:"top",left:"right",right:"left"},gh={start:"end",center:"center",end:"start"},ea={top:"height",bottom:"height",left:"width",right:"width"},A1={"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"},M1={"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"},V1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},mh={top:!0,bottom:!1,left:!0,right:!1},ph={top:"end",bottom:"start",left:"end",right:"start"};function I1(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const h=(m,u,p)=>{let b=0,y=0;const _=n[m]-e[u]-e[m];return _>0&&r&&(p?y=mh[u]?_:-_:b=mh[u]?_:-_),{left:b,top:y}},f=a==="left"||a==="right";if(c!=="center"){const m=V1[t],u=vs[m],p=ea[m];if(n[p]>e[p]){if(e[m]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[m]<b||e[u]<b?e[m]<e[u]?(c=gh[l],d=h(p,u,f)):d=h(p,m,f):c="center"}}else n[p]<e[p]&&e[u]<0&&e[m]>e[u]&&(c=gh[l])}else{const m=a==="bottom"||a==="top"?"left":"top",u=vs[m],p=ea[m],b=(n[p]-e[p])/2;(e[m]<b||e[u]<b)&&(e[m]>e[u]?(c=ph[m],d=h(p,m,f)):(c=ph[u],d=h(p,u,f)))}let g=a;return e[a]<n[ea[a]]&&e[a]<e[vs[a]]&&(g=vs[a]),{placement:c!=="center"?`${g}-${c}`:g,left:d.left,top:d.top}}function O1(t,e){return e?M1[t]:A1[t]}function z1(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const L1=Gn([Gn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Gn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Gn("> *",{pointerEvents:"all"})])]),yh=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(t){const e=i.inject("VBinder"),n=Xt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:g}=t;g.includes("scroll")&&e.addScrollListener(c),g.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=pi();L1.mount({id:"vueuc/binder",head:!0,anchorMetaName:Jo,ssr:l}),i.onBeforeUnmount(()=>{a()}),a1(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const g=r.value;if(g===null)return;const m=e.targetRef,{x:u,y:p,overlap:b}=t,y=u!==void 0&&p!==void 0?d1(u,p):Go(m);g.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),g.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:v,placement:B,internalShift:S,flip:R}=t;g.setAttribute("v-placement",B),b?g.setAttribute("v-overlap",""):g.removeAttribute("v-overlap");const{style:C}=g;_==="target"?C.width=`${y.width}px`:_!==void 0?C.width=_:C.width="",v==="target"?C.minWidth=`${y.width}px`:v!==void 0?C.minWidth=v:C.minWidth="";const T=Go(g),x=Go(s.value),{left:P,top:$,placement:A}=I1(B,y,T,S,R,b),F=O1(A,b),{left:O,top:L,transform:J}=z1(A,x,y,$,P,b);g.setAttribute("v-placement",A),g.style.setProperty("--v-offset-left",`${Math.round(P)}px`),g.style.setProperty("--v-offset-top",`${Math.round($)}px`),g.style.transform=`translateX(${O}) translateY(${L}) ${J}`,g.style.setProperty("--v-transform-origin",F),g.style.transformOrigin=F};i.watch(n,g=>{g?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(g=>console.error(g))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(g=>{i.watch(i.toRef(t,g),c)}),["teleportDisabled"].forEach(g=>{i.watch(i.toRef(t,g),d)}),i.watch(i.toRef(t,"syncTrigger"),g=>{g.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),g.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const h=bs(),f=Xt(()=>{const{to:g}=t;if(g!==void 0)return g;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h(F1,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[Gd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var yi=[],D1=function(){return yi.some(function(t){return t.activeTargets.length>0})},H1=function(){return yi.some(function(t){return t.skippedTargets.length>0})},bh="ResizeObserver loop completed with undelivered notifications.",W1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:bh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=bh),window.dispatchEvent(t)},_r;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(_r||(_r={}));var bi=function(t){return Object.freeze(t)},j1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,bi(this)}return t})(),_h=(function(){function t(e,n,r,s){return this.x=e,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,bi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),ta=function(t){return t instanceof SVGElement&&"getBBox"in t},wh=function(t){if(ta(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},xh=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},q1=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},wr=typeof window<"u"?window:{},ks=new WeakMap,vh=/auto|scroll/,X1=/^tb|vertical/,Y1=/msie|trident/i.test(wr.navigator&&wr.navigator.userAgent),wn=function(t){return parseFloat(t||"0")},Qi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new j1((n?e:t)||0,(n?t:e)||0)},kh=bi({devicePixelContentBoxSize:Qi(),borderBoxSize:Qi(),contentBoxSize:Qi(),contentRect:new _h(0,0,0,0)}),Ch=function(t,e){if(e===void 0&&(e=!1),ks.has(t)&&!e)return ks.get(t);if(wh(t))return ks.set(t,kh),kh;var n=getComputedStyle(t),r=ta(t)&&t.ownerSVGElement&&t.getBBox(),s=!Y1&&n.boxSizing==="border-box",o=X1.test(n.writingMode||""),a=!r&&vh.test(n.overflowY||""),l=!r&&vh.test(n.overflowX||""),c=r?0:wn(n.paddingTop),d=r?0:wn(n.paddingRight),h=r?0:wn(n.paddingBottom),f=r?0:wn(n.paddingLeft),g=r?0:wn(n.borderTopWidth),m=r?0:wn(n.borderRightWidth),u=r?0:wn(n.borderBottomWidth),p=r?0:wn(n.borderLeftWidth),b=f+d,y=c+h,_=p+m,v=g+u,B=l?t.offsetHeight-v-t.clientHeight:0,S=a?t.offsetWidth-_-t.clientWidth:0,R=s?b+_:0,C=s?y+v:0,T=r?r.width:wn(n.width)-R-S,x=r?r.height:wn(n.height)-C-B,P=T+b+S+_,$=x+y+B+v,A=bi({devicePixelContentBoxSize:Qi(Math.round(T*devicePixelRatio),Math.round(x*devicePixelRatio),o),borderBoxSize:Qi(P,$,o),contentBoxSize:Qi(T,x,o),contentRect:new _h(f,c,T,x)});return ks.set(t,A),A},Sh=function(t,e,n){var r=Ch(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case _r.DEVICE_PIXEL_CONTENT_BOX:return a;case _r.BORDER_BOX:return s;default:return o}},U1=(function(){function t(e){var n=Ch(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=bi([n.borderBoxSize]),this.contentBoxSize=bi([n.contentBoxSize]),this.devicePixelContentBoxSize=bi([n.devicePixelContentBoxSize])}return t})(),Bh=function(t){if(wh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},K1=function(){var t=1/0,e=[];yi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new U1(d.target),f=Bh(d.target);l.push(h),d.lastReportedSize=Sh(d.target,d.observedBox),f<t&&(t=f)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},Th=function(t){yi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Bh(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},G1=function(){var t=0;for(Th(t);D1();)t=K1(),Th(t);return H1()&&W1(),t>0},na,Rh=[],Z1=function(){return Rh.splice(0).forEach(function(t){return t()})},Q1=function(t){if(!na){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Z1()}).observe(n,r),na=function(){n.textContent="".concat(e?e--:e++)}}Rh.push(t),na()},J1=function(t){Q1(function(){requestAnimationFrame(t)})},Cs=0,ew=function(){return!!Cs},tw=250,nw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ph=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],$h=function(t){return t===void 0&&(t=0),Date.now()+t},ia=!1,iw=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=tw),!ia){ia=!0;var r=$h(e);J1(function(){var s=!1;try{s=G1()}finally{if(ia=!1,e=r-$h(),!ew())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,nw)};document.body?n():wr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ph.forEach(function(n){return wr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Ph.forEach(function(n){return wr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),ra=new iw,Eh=function(t){!Cs&&t>0&&ra.start(),Cs+=t,!Cs&&ra.stop()},rw=function(t){return!ta(t)&&!q1(t)&&getComputedStyle(t).display==="inline"},sw=(function(){function t(e,n){this.target=e,this.observedBox=n||_r.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Sh(this.target,this.observedBox,!0);return rw(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),ow=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Ss=new WeakMap,Nh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Bs=(function(){function t(){}return t.connect=function(e,n){var r=new ow(e,n);Ss.set(e,r)},t.observe=function(e,n,r){var s=Ss.get(e),o=s.observationTargets.length===0;Nh(s.observationTargets,n)<0&&(o&&yi.push(s),s.observationTargets.push(new sw(n,r&&r.box)),Eh(1),ra.schedule())},t.unobserve=function(e,n){var r=Ss.get(e),s=Nh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&yi.splice(yi.indexOf(r),1),r.observationTargets.splice(s,1),Eh(-1))},t.disconnect=function(e){var n=this,r=Ss.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),aw=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Bs.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Bs.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Bs.unobserve(this,e)},t.prototype.disconnect=function(){Bs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class lw{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||aw)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const xr=new lw,Ts=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){ih("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){ih("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(xr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&xr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Rs;function cw(){return typeof document>"u"?!1:(Rs===void 0&&("matchMedia"in window?Rs=window.matchMedia("(pointer:coarse)").matches:Rs=!1),Rs)}let sa;function Fh(){return typeof document>"u"?1:(sa===void 0&&(sa="chrome"in window?window.devicePixelRatio:1),sa)}const Ah="VVirtualListXScroll";function dw({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const h=new uh(d.length,0);return d.forEach((f,g)=>{h.add(g,f.width)}),h}),a=Xt(()=>{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=Xt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Ah,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Mh=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ah);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),hw=Gn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Gn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Gn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),uw=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(t){const e=pi();hw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Jo,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:F,defaultScrollKey:O}=t;F!=null?b({index:F}):O!=null&&b({key:O})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:m.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Xt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let F=0;return t.columns.forEach(O=>{F+=O.width}),F}),o=i.computed(()=>{const F=new Map,{keyField:O}=t;return t.items.forEach((L,J)=>{F.set(L[O],J)}),F}),{scrollLeftRef:a,listWidthRef:l}=dw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:F,itemSize:O,keyField:L}=t,J=new uh(F.length,O);return F.forEach((ne,N)=>{const V=ne[L],q=h.get(V);q!==void 0&&J.add(N,q)}),J}),g=i.ref(0),m=i.ref(0),u=Xt(()=>Math.max(f.value.getBound(m.value-pr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:F}=d;if(F===void 0)return[];const{items:O,itemSize:L}=t,J=u.value,ne=Math.min(J+Math.ceil(F/L+1),O.length-1),N=[];for(let V=J;V<=ne;++V)N.push(O[V]);return N}),b=(F,O)=>{if(typeof F=="number"){B(F,O,"auto");return}const{left:L,top:J,index:ne,key:N,position:V,behavior:q,debounce:X=!0}=F;if(L!==void 0||J!==void 0)B(L,J,q);else if(ne!==void 0)v(ne,q,X);else if(N!==void 0){const I=o.value.get(N);I!==void 0&&v(I,q,X)}else V==="bottom"?B(0,Number.MAX_SAFE_INTEGER,q):V==="top"&&B(0,0,q)};let y,_=null;function v(F,O,L){const{value:J}=f,ne=J.sum(F)+pr(t.paddingTop);if(!L)c.value.scrollTo({left:0,top:ne,behavior:O});else{y=F,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:N,offsetHeight:V}=c.value;if(ne>N){const q=J.get(F);ne+q<=N+V||c.value.scrollTo({left:0,top:ne+q-V,behavior:O})}else c.value.scrollTo({left:0,top:ne,behavior:O})}}function B(F,O,L){c.value.scrollTo({left:F,top:O,behavior:L})}function S(F,O){var L,J,ne;if(n||t.ignoreItemResize||A(O.target))return;const{value:N}=f,V=o.value.get(F),q=N.get(V),X=(ne=(J=(L=O.borderBoxSize)===null||L===void 0?void 0:L[0])===null||J===void 0?void 0:J.blockSize)!==null&&ne!==void 0?ne:O.contentRect.height;if(X===q)return;X-t.itemSize===0?h.delete(F):h.set(F,X-t.itemSize);const W=X-q;if(W===0)return;N.add(V,W);const H=c.value;if(H!=null){if(y===void 0){const U=N.sum(V);H.scrollTop>U&&H.scrollBy(0,W)}else if(V<y)H.scrollBy(0,W);else if(V===y){const U=N.sum(V);X+U>H.scrollTop+H.offsetHeight&&H.scrollBy(0,W)}$()}g.value++}const R=!cw();let C=!1;function T(F){var O;(O=t.onScroll)===null||O===void 0||O.call(t,F),(!R||!C)&&$()}function x(F){var O;if((O=t.onWheel)===null||O===void 0||O.call(t,F),R){const L=c.value;if(L!=null){if(F.deltaX===0&&(L.scrollTop===0&&F.deltaY<=0||L.scrollTop+L.offsetHeight>=L.scrollHeight&&F.deltaY>=0))return;F.preventDefault(),L.scrollTop+=F.deltaY/Fh(),L.scrollLeft+=F.deltaX/Fh(),$(),C=!0,zd(()=>{C=!1})}}}function P(F){if(n||A(F.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(F.contentRect.height===d.value)return}else if(F.contentRect.height===d.value&&F.contentRect.width===l.value)return;d.value=F.contentRect.height,l.value=F.contentRect.width;const{onResize:O}=t;O!==void 0&&O(F)}function $(){const{value:F}=c;F!=null&&(m.value=F.scrollTop,a.value=F.scrollLeft)}function A(F){let O=F;for(;O!==null;){if(O.style.display==="none")return!0;O=O.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:F}=t,O=yr(f.value.sum());return g.value,[t.itemsStyle,{boxSizing:"content-box",width:yr(s.value),height:F?"":O,minHeight:F?O:"",paddingTop:yr(t.paddingTop),paddingBottom:yr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(g.value,{transform:`translateY(${yr(f.value.sum(u.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:P,handleListScroll:T,handleListWheel:x,handleItemResize:S}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Ts,{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[e],h=n.get(d),f=a!=null?i.h(Mh,{index:h,item:c}):void 0,g=l!=null?i.h(Mh,{index:h,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:g,index:h})[0];return t?i.h(Ts,{key:d,onResize:u=>this.handleItemResize(d,u)},{default:()=>m}):(m.key=d,m)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Pn="v-hidden",fw=Gn("[v-hidden]",{display:"none!important"}),Vh=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(Pn)&&h.removeAttribute(Pn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const v of f)v.hasAttribute(Pn)&&v.removeAttribute(Pn);const g=l.offsetWidth,m=[],u=e.tail?d==null?void 0:d():null;let p=u?u.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let v=0;v<y-1;++v){if(v<0)continue;const B=f[v];if(b){B.hasAttribute(Pn)||B.setAttribute(Pn,"");continue}else B.hasAttribute(Pn)&&B.removeAttribute(Pn);const S=B.offsetWidth;if(p+=S,m[v]=S,p>g){const{updateCounter:R}=t;for(let C=v;C>=0;--C){const T=y-1-C;R!==void 0?R(T):h.textContent=`${T}`;const x=h.offsetWidth;if(p-=m[C],p+x<=g||C===0){b=!0,v=C-1,u&&(v===-1?(u.style.maxWidth=`${g-x}px`,u.style.boxSizing="border-box"):u.style.maxWidth="");const{onUpdateCount:P}=t;P&&P(T);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(Pn,""))}const o=pi();return fw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Jo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Ih(t){return t instanceof HTMLElement}function Oh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||Oh(n)))return!0}return!1}function zh(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||zh(n)))return!0}return!1}function Lh(t){if(!gw(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function gw(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let vr=[];const mw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=k_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return vr[vr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(f(),St("keydown",document,c)):(nt("keydown",document,c),s&&g())},{immediate:!0})}),i.onBeforeUnmount(()=>{nt("keydown",document,c),s&&g()});function d(b){if(!o&&l()){const y=h();if(y===null||y.contains(mr(b)))return;m("first")}}function h(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!t.disabled){if(vr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?m("first"):(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function g(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),vr=vr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function m(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const v=h();if(v==null||v===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const B=b==="first"?Oh(v):zh(v);o=!1,B||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function u(b){if(o)return;const y=h();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?m("last"):m("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:u,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function hC(t){return t}const oa="n-internal-select-menu",Dh="n-internal-select-menu-body",Hh="n-drawer-body",Wh="n-modal-body",jh="n-popover-body",qh="__disabled__";function $n(t){const e=i.inject(Wh,null),n=i.inject(Hh,null),r=i.inject(jh,null),s=i.inject(Dh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{St("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{nt("fullscreenchange",document,a)})}return Xt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?qh:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}$n.tdkey=qh,$n.propTo={type:[String,Object,Boolean],default:void 0};function pw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Xh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&xr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&xr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&xr.unregisterHandler(n)}))}function Yh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const yw=/^(\d|\.)+$/,Uh=/(\d|\.)+/;function aa(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(yw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Uh.exec(t);return s?t.replace(Uh,String((Number(s[0])+n)*e)):t}return t}function Kh(t){const{left:e,right:n,top:r,bottom:s}=Jt(t);return`${r} ${e} ${s} ${n}`}var Gh={};function bw(t){let e=".",n="__",r="--",s;if(t){let u=t.blockPrefix;u&&(e=u),u=t.elementPrefix,u&&(n=u),u=t.modifierPrefix,u&&(r=u)}const o={install(u){s=u.c;const p=u.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(u){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return u=typeof u=="string"?u:u({context:y,props:_}),y.bem.b=u,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(u){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return u=typeof u=="string"?u:u({context:b,props:y}),b.bem.els=u.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=u.split(",").map(B=>B.trim());function _(B){return y.map(S=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${B!==void 0?`${n}${B}`:""}${r}${S}`).join(", ")}const v=p.bem.els;if(v!==null){if(Gh.NODE_ENV!=="production"&&v.length>=2)throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`);return _(v[0])}else return _()}}}function d(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=p.bem.els;if(Gh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${u})`}}}return Object.assign(o,{cB:((...u)=>s(a(u[0]),u[1],u[2])),cE:((...u)=>s(l(u[0]),u[1],u[2])),cM:((...u)=>s(c(u[0]),u[1],u[2])),cNotM:((...u)=>s(d(u[0]),u[1],u[2]))}),o}const _w=".n-",ww="__",xw="--",Zh=dh(),Qh=bw({blockPrefix:_w,elementPrefix:ww,modifierPrefix:xw});Zh.use(Qh);const{c:le,find:fC}=Zh,{cB:me,cE:be,cM:Se,cNotM:en}=Qh,vw=(...t)=>le(">",[me(...t)]);function Ue(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let la;function kw(){return la===void 0&&(la=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),la}const Cw=new WeakSet;function Sw(t){Cw.add(t)}function Jh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const eu=new Set;function Zn(t,e){const n=`[naive/${t}]: ${e}`;eu.has(n)||(eu.add(n),console.error(n))}function tu(t,e){console.error(`[naive/${t}]: ${e}`)}function nu(t,e){throw new Error(`[naive/${t}]: ${e}`)}function ft(t,...e){if(Array.isArray(t))t.forEach(n=>ft(n,...e));else return t(...e)}function ca(t,e=!0,n=[]){return t.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)){ca(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ca(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function Bw(t,e="default",n=void 0){const r=t[e];if(!r)return tu("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ca(r(n));return s.length===1?s[0]:(tu("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Tw(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function da(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function Ji(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ha(t,e){return t&&Ps(t())||e()}function _i(t,e){const n=t&&Ps(t());return e(n||null)}function iu(t){return!(t&&Ps(t()))}const ua=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),wi="n-config-provider",Rw="n";function xi(t={},e={defaultBordered:!0}){const n=i.inject(wi,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}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Rw),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function vi(t,e,n,r){n||nu("useThemeClass","cssVarsRef is not passed");const s=i.inject(wi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=pi();let d;const h=`__${t}`,f=()=>{let g=h;const m=e?e.value:void 0,u=o==null?void 0:o.value;u&&(g+=`-${u}`),m&&(g+=`-${m}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(g+=`-${Qo(JSON.stringify(p))}`),b&&(g+=`-${Qo(JSON.stringify(b))}`),l.value=g,d=()=>{const y=n.value;let _="";for(const v in y)_+=`${v}: ${y[v]};`;le(`.${g}`,_).mount({id:g,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const ru="n-form-item";function Pw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(ru,null);i.provide(ru,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;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 $w={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'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:t=>`Total ${t} items`,selected:t=>`${t} 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"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function fa(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function kr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function Cr(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Nw(l,f=>f.test(a)):Ew(l,f=>f.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function Ew(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Nw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Fw(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Aw={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"}},Mw=(t,e,n)=>{let r;const s=Aw[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Vw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Iw=(t,e,n,r)=>Vw[t],Ow={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Lw={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"]},Dw={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"]},Hw={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"}},Ww={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"}},jw={ordinalNumber:(t,e)=>{const n=Number(t),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:kr({values:Ow,defaultWidth:"wide"}),quarter:kr({values:zw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:kr({values:Lw,defaultWidth:"wide"}),day:kr({values:Dw,defaultWidth:"wide"}),dayPeriod:kr({values:Hw,defaultWidth:"wide",formattingValues:Ww,defaultFormattingWidth:"wide"})},qw=/^(\d+)(th|st|nd|rd)?/i,Xw=/\d+/i,Yw={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},Uw={any:[/^b/i,/^(a|c)/i]},Kw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Gw={any:[/1/i,/2/i,/3/i,/4/i]},Zw={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},Qw={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]},Jw={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},ex={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]},tx={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},nx={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}},ix={ordinalNumber:Fw({matchPattern:qw,parsePattern:Xw,valueCallback:t=>parseInt(t,10)}),era:Cr({matchPatterns:Yw,defaultMatchWidth:"wide",parsePatterns:Uw,defaultParseWidth:"any"}),quarter:Cr({matchPatterns:Kw,defaultMatchWidth:"wide",parsePatterns:Gw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Cr({matchPatterns:Zw,defaultMatchWidth:"wide",parsePatterns:Qw,defaultParseWidth:"any"}),day:Cr({matchPatterns:Jw,defaultMatchWidth:"wide",parsePatterns:ex,defaultParseWidth:"any"}),dayPeriod:Cr({matchPatterns:tx,defaultMatchWidth:"any",parsePatterns:nx,defaultParseWidth:"any"})},rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ox={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ax={date:fa({formats:rx,defaultWidth:"full"}),time:fa({formats:sx,defaultWidth:"full"}),dateTime:fa({formats:ox,defaultWidth:"full"})},lx={name:"en-US",locale:{code:"en-US",formatDistance:Mw,formatLong:ax,formatRelative:Iw,localize:jw,match:ix,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function su(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(wi,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:$w[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:lx}),localeRef:r}}const Sr="naive-ui-style";function Br(t,e,n){if(!e)return;const r=pi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(wi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(N1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:Sr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const Tr={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:cx,fontFamily:dx,lineHeight:hx}=Tr,ou=le("body",`
|
|
116
|
+
`)}function Qo(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function B1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(sh),e.els=[];else{const o=_s(n,r);o&&s.includes(o)&&(sh(o),e.els=s.filter(a=>a!==o))}}function ch(t,e){t.push(e)}function T1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Qo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=_s(n,l);if(h!==null&&!o)return h;const f=h??x1(n);if(d===void 0&&(d=e.render(r)),f.textContent=d,h!==null)return h;if(a){const g=l.querySelector(`meta[name="${a}"]`);if(g)return l.insertBefore(f,g),ch(e.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),ch(e.els,f),f}function R1(t){return S1(this,this.instance,t)}function P1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return T1(this.instance,this,e,r,s,o,a,l,n)}function $1(t={}){const{id:e,parent:n}=t;B1(this.instance,this,e,n)}const xs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:R1,mount:P1,unmount:$1}},E1=function(t,e,n,r){return Array.isArray(e)?xs(t,{$:null},null,e):Array.isArray(n)?xs(t,e,null,n):Array.isArray(r)?xs(t,e,n,r):xs(t,e,n,null)};function dh(t={}){const e={c:((...n)=>E1(e,...n)),use:(n,...r)=>n.install(e,...r),find:_s,context:{},config:t};return e}function N1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return _s(t)!==null}const{c:Gn}=dh(),Jo="vueuc-style";function hh(t){return t&-t}class uh{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=hh(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=hh(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function fh(t){return typeof t=="string"?document.querySelector(t):t()||null}const F1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:s1(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Uo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Uo("lazy-teleport",this.$slots)):null}}),vs={top:"bottom",bottom:"top",left:"right",right:"left"},gh={start:"end",center:"center",end:"start"},ea={top:"height",bottom:"height",left:"width",right:"width"},A1={"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"},M1={"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"},V1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},mh={top:!0,bottom:!1,left:!0,right:!1},ph={top:"end",bottom:"start",left:"end",right:"start"};function I1(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const h=(m,u,p)=>{let b=0,y=0;const _=n[m]-e[u]-e[m];return _>0&&r&&(p?y=mh[u]?_:-_:b=mh[u]?_:-_),{left:b,top:y}},f=a==="left"||a==="right";if(c!=="center"){const m=V1[t],u=vs[m],p=ea[m];if(n[p]>e[p]){if(e[m]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[m]<b||e[u]<b?e[m]<e[u]?(c=gh[l],d=h(p,u,f)):d=h(p,m,f):c="center"}}else n[p]<e[p]&&e[u]<0&&e[m]>e[u]&&(c=gh[l])}else{const m=a==="bottom"||a==="top"?"left":"top",u=vs[m],p=ea[m],b=(n[p]-e[p])/2;(e[m]<b||e[u]<b)&&(e[m]>e[u]?(c=ph[m],d=h(p,m,f)):(c=ph[u],d=h(p,u,f)))}let g=a;return e[a]<n[ea[a]]&&e[a]<e[vs[a]]&&(g=vs[a]),{placement:c!=="center"?`${g}-${c}`:g,left:d.left,top:d.top}}function O1(t,e){return e?M1[t]:A1[t]}function z1(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const L1=Gn([Gn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Gn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Gn("> *",{pointerEvents:"all"})])]),yh=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(t){const e=i.inject("VBinder"),n=Xt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:g}=t;g.includes("scroll")&&e.addScrollListener(c),g.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=pi();L1.mount({id:"vueuc/binder",head:!0,anchorMetaName:Jo,ssr:l}),i.onBeforeUnmount(()=>{a()}),a1(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const g=r.value;if(g===null)return;const m=e.targetRef,{x:u,y:p,overlap:b}=t,y=u!==void 0&&p!==void 0?d1(u,p):Go(m);g.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),g.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:w,placement:S,internalShift:B,flip:R}=t;g.setAttribute("v-placement",S),b?g.setAttribute("v-overlap",""):g.removeAttribute("v-overlap");const{style:C}=g;_==="target"?C.width=`${y.width}px`:_!==void 0?C.width=_:C.width="",w==="target"?C.minWidth=`${y.width}px`:w!==void 0?C.minWidth=w:C.minWidth="";const T=Go(g),v=Go(s.value),{left:P,top:$,placement:A}=I1(S,y,T,B,R,b),F=O1(A,b),{left:O,top:L,transform:J}=z1(A,v,y,$,P,b);g.setAttribute("v-placement",A),g.style.setProperty("--v-offset-left",`${Math.round(P)}px`),g.style.setProperty("--v-offset-top",`${Math.round($)}px`),g.style.transform=`translateX(${O}) translateY(${L}) ${J}`,g.style.setProperty("--v-transform-origin",F),g.style.transformOrigin=F};i.watch(n,g=>{g?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(g=>console.error(g))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(g=>{i.watch(i.toRef(t,g),c)}),["teleportDisabled"].forEach(g=>{i.watch(i.toRef(t,g),d)}),i.watch(i.toRef(t,"syncTrigger"),g=>{g.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),g.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const h=bs(),f=Xt(()=>{const{to:g}=t;if(g!==void 0)return g;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h(F1,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[Gd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var yi=[],D1=function(){return yi.some(function(t){return t.activeTargets.length>0})},H1=function(){return yi.some(function(t){return t.skippedTargets.length>0})},bh="ResizeObserver loop completed with undelivered notifications.",W1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:bh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=bh),window.dispatchEvent(t)},_r;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(_r||(_r={}));var bi=function(t){return Object.freeze(t)},j1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,bi(this)}return t})(),_h=(function(){function t(e,n,r,s){return this.x=e,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,bi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),ta=function(t){return t instanceof SVGElement&&"getBBox"in t},wh=function(t){if(ta(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},xh=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},q1=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},wr=typeof window<"u"?window:{},ks=new WeakMap,vh=/auto|scroll/,X1=/^tb|vertical/,Y1=/msie|trident/i.test(wr.navigator&&wr.navigator.userAgent),wn=function(t){return parseFloat(t||"0")},Qi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new j1((n?e:t)||0,(n?t:e)||0)},kh=bi({devicePixelContentBoxSize:Qi(),borderBoxSize:Qi(),contentBoxSize:Qi(),contentRect:new _h(0,0,0,0)}),Ch=function(t,e){if(e===void 0&&(e=!1),ks.has(t)&&!e)return ks.get(t);if(wh(t))return ks.set(t,kh),kh;var n=getComputedStyle(t),r=ta(t)&&t.ownerSVGElement&&t.getBBox(),s=!Y1&&n.boxSizing==="border-box",o=X1.test(n.writingMode||""),a=!r&&vh.test(n.overflowY||""),l=!r&&vh.test(n.overflowX||""),c=r?0:wn(n.paddingTop),d=r?0:wn(n.paddingRight),h=r?0:wn(n.paddingBottom),f=r?0:wn(n.paddingLeft),g=r?0:wn(n.borderTopWidth),m=r?0:wn(n.borderRightWidth),u=r?0:wn(n.borderBottomWidth),p=r?0:wn(n.borderLeftWidth),b=f+d,y=c+h,_=p+m,w=g+u,S=l?t.offsetHeight-w-t.clientHeight:0,B=a?t.offsetWidth-_-t.clientWidth:0,R=s?b+_:0,C=s?y+w:0,T=r?r.width:wn(n.width)-R-B,v=r?r.height:wn(n.height)-C-S,P=T+b+B+_,$=v+y+S+w,A=bi({devicePixelContentBoxSize:Qi(Math.round(T*devicePixelRatio),Math.round(v*devicePixelRatio),o),borderBoxSize:Qi(P,$,o),contentBoxSize:Qi(T,v,o),contentRect:new _h(f,c,T,v)});return ks.set(t,A),A},Sh=function(t,e,n){var r=Ch(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case _r.DEVICE_PIXEL_CONTENT_BOX:return a;case _r.BORDER_BOX:return s;default:return o}},U1=(function(){function t(e){var n=Ch(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=bi([n.borderBoxSize]),this.contentBoxSize=bi([n.contentBoxSize]),this.devicePixelContentBoxSize=bi([n.devicePixelContentBoxSize])}return t})(),Bh=function(t){if(wh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},K1=function(){var t=1/0,e=[];yi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new U1(d.target),f=Bh(d.target);l.push(h),d.lastReportedSize=Sh(d.target,d.observedBox),f<t&&(t=f)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},Th=function(t){yi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Bh(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},G1=function(){var t=0;for(Th(t);D1();)t=K1(),Th(t);return H1()&&W1(),t>0},na,Rh=[],Z1=function(){return Rh.splice(0).forEach(function(t){return t()})},Q1=function(t){if(!na){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Z1()}).observe(n,r),na=function(){n.textContent="".concat(e?e--:e++)}}Rh.push(t),na()},J1=function(t){Q1(function(){requestAnimationFrame(t)})},Cs=0,ew=function(){return!!Cs},tw=250,nw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ph=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],$h=function(t){return t===void 0&&(t=0),Date.now()+t},ia=!1,iw=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=tw),!ia){ia=!0;var r=$h(e);J1(function(){var s=!1;try{s=G1()}finally{if(ia=!1,e=r-$h(),!ew())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,nw)};document.body?n():wr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ph.forEach(function(n){return wr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Ph.forEach(function(n){return wr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),ra=new iw,Eh=function(t){!Cs&&t>0&&ra.start(),Cs+=t,!Cs&&ra.stop()},rw=function(t){return!ta(t)&&!q1(t)&&getComputedStyle(t).display==="inline"},sw=(function(){function t(e,n){this.target=e,this.observedBox=n||_r.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Sh(this.target,this.observedBox,!0);return rw(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),ow=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Ss=new WeakMap,Nh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Bs=(function(){function t(){}return t.connect=function(e,n){var r=new ow(e,n);Ss.set(e,r)},t.observe=function(e,n,r){var s=Ss.get(e),o=s.observationTargets.length===0;Nh(s.observationTargets,n)<0&&(o&&yi.push(s),s.observationTargets.push(new sw(n,r&&r.box)),Eh(1),ra.schedule())},t.unobserve=function(e,n){var r=Ss.get(e),s=Nh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&yi.splice(yi.indexOf(r),1),r.observationTargets.splice(s,1),Eh(-1))},t.disconnect=function(e){var n=this,r=Ss.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),aw=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Bs.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Bs.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Bs.unobserve(this,e)},t.prototype.disconnect=function(){Bs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class lw{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||aw)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const xr=new lw,Ts=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){ih("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){ih("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(xr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&xr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Rs;function cw(){return typeof document>"u"?!1:(Rs===void 0&&("matchMedia"in window?Rs=window.matchMedia("(pointer:coarse)").matches:Rs=!1),Rs)}let sa;function Fh(){return typeof document>"u"?1:(sa===void 0&&(sa="chrome"in window?window.devicePixelRatio:1),sa)}const Ah="VVirtualListXScroll";function dw({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const h=new uh(d.length,0);return d.forEach((f,g)=>{h.add(g,f.width)}),h}),a=Xt(()=>{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=Xt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Ah,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Mh=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ah);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),hw=Gn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Gn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Gn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),uw=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(t){const e=pi();hw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Jo,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:F,defaultScrollKey:O}=t;F!=null?b({index:F}):O!=null&&b({key:O})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:m.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Xt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let F=0;return t.columns.forEach(O=>{F+=O.width}),F}),o=i.computed(()=>{const F=new Map,{keyField:O}=t;return t.items.forEach((L,J)=>{F.set(L[O],J)}),F}),{scrollLeftRef:a,listWidthRef:l}=dw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:F,itemSize:O,keyField:L}=t,J=new uh(F.length,O);return F.forEach((ne,N)=>{const V=ne[L],q=h.get(V);q!==void 0&&J.add(N,q)}),J}),g=i.ref(0),m=i.ref(0),u=Xt(()=>Math.max(f.value.getBound(m.value-pr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:F}=d;if(F===void 0)return[];const{items:O,itemSize:L}=t,J=u.value,ne=Math.min(J+Math.ceil(F/L+1),O.length-1),N=[];for(let V=J;V<=ne;++V)N.push(O[V]);return N}),b=(F,O)=>{if(typeof F=="number"){S(F,O,"auto");return}const{left:L,top:J,index:ne,key:N,position:V,behavior:q,debounce:X=!0}=F;if(L!==void 0||J!==void 0)S(L,J,q);else if(ne!==void 0)w(ne,q,X);else if(N!==void 0){const I=o.value.get(N);I!==void 0&&w(I,q,X)}else V==="bottom"?S(0,Number.MAX_SAFE_INTEGER,q):V==="top"&&S(0,0,q)};let y,_=null;function w(F,O,L){const{value:J}=f,ne=J.sum(F)+pr(t.paddingTop);if(!L)c.value.scrollTo({left:0,top:ne,behavior:O});else{y=F,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:N,offsetHeight:V}=c.value;if(ne>N){const q=J.get(F);ne+q<=N+V||c.value.scrollTo({left:0,top:ne+q-V,behavior:O})}else c.value.scrollTo({left:0,top:ne,behavior:O})}}function S(F,O,L){c.value.scrollTo({left:F,top:O,behavior:L})}function B(F,O){var L,J,ne;if(n||t.ignoreItemResize||A(O.target))return;const{value:N}=f,V=o.value.get(F),q=N.get(V),X=(ne=(J=(L=O.borderBoxSize)===null||L===void 0?void 0:L[0])===null||J===void 0?void 0:J.blockSize)!==null&&ne!==void 0?ne:O.contentRect.height;if(X===q)return;X-t.itemSize===0?h.delete(F):h.set(F,X-t.itemSize);const W=X-q;if(W===0)return;N.add(V,W);const H=c.value;if(H!=null){if(y===void 0){const U=N.sum(V);H.scrollTop>U&&H.scrollBy(0,W)}else if(V<y)H.scrollBy(0,W);else if(V===y){const U=N.sum(V);X+U>H.scrollTop+H.offsetHeight&&H.scrollBy(0,W)}$()}g.value++}const R=!cw();let C=!1;function T(F){var O;(O=t.onScroll)===null||O===void 0||O.call(t,F),(!R||!C)&&$()}function v(F){var O;if((O=t.onWheel)===null||O===void 0||O.call(t,F),R){const L=c.value;if(L!=null){if(F.deltaX===0&&(L.scrollTop===0&&F.deltaY<=0||L.scrollTop+L.offsetHeight>=L.scrollHeight&&F.deltaY>=0))return;F.preventDefault(),L.scrollTop+=F.deltaY/Fh(),L.scrollLeft+=F.deltaX/Fh(),$(),C=!0,zd(()=>{C=!1})}}}function P(F){if(n||A(F.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(F.contentRect.height===d.value)return}else if(F.contentRect.height===d.value&&F.contentRect.width===l.value)return;d.value=F.contentRect.height,l.value=F.contentRect.width;const{onResize:O}=t;O!==void 0&&O(F)}function $(){const{value:F}=c;F!=null&&(m.value=F.scrollTop,a.value=F.scrollLeft)}function A(F){let O=F;for(;O!==null;){if(O.style.display==="none")return!0;O=O.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:F}=t,O=yr(f.value.sum());return g.value,[t.itemsStyle,{boxSizing:"content-box",width:yr(s.value),height:F?"":O,minHeight:F?O:"",paddingTop:yr(t.paddingTop),paddingBottom:yr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(g.value,{transform:`translateY(${yr(f.value.sum(u.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:P,handleListScroll:T,handleListWheel:v,handleItemResize:B}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Ts,{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[e],h=n.get(d),f=a!=null?i.h(Mh,{index:h,item:c}):void 0,g=l!=null?i.h(Mh,{index:h,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:g,index:h})[0];return t?i.h(Ts,{key:d,onResize:u=>this.handleItemResize(d,u)},{default:()=>m}):(m.key=d,m)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Pn="v-hidden",fw=Gn("[v-hidden]",{display:"none!important"}),Vh=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(Pn)&&h.removeAttribute(Pn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const w of f)w.hasAttribute(Pn)&&w.removeAttribute(Pn);const g=l.offsetWidth,m=[],u=e.tail?d==null?void 0:d():null;let p=u?u.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let w=0;w<y-1;++w){if(w<0)continue;const S=f[w];if(b){S.hasAttribute(Pn)||S.setAttribute(Pn,"");continue}else S.hasAttribute(Pn)&&S.removeAttribute(Pn);const B=S.offsetWidth;if(p+=B,m[w]=B,p>g){const{updateCounter:R}=t;for(let C=w;C>=0;--C){const T=y-1-C;R!==void 0?R(T):h.textContent=`${T}`;const v=h.offsetWidth;if(p-=m[C],p+v<=g||C===0){b=!0,w=C-1,u&&(w===-1?(u.style.maxWidth=`${g-v}px`,u.style.boxSizing="border-box"):u.style.maxWidth="");const{onUpdateCount:P}=t;P&&P(T);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(Pn,""))}const o=pi();return fw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Jo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Ih(t){return t instanceof HTMLElement}function Oh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||Oh(n)))return!0}return!1}function zh(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||zh(n)))return!0}return!1}function Lh(t){if(!gw(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function gw(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let vr=[];const mw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=k_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return vr[vr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(f(),St("keydown",document,c)):(nt("keydown",document,c),s&&g())},{immediate:!0})}),i.onBeforeUnmount(()=>{nt("keydown",document,c),s&&g()});function d(b){if(!o&&l()){const y=h();if(y===null||y.contains(mr(b)))return;m("first")}}function h(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!t.disabled){if(vr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?m("first"):(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function g(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),vr=vr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function m(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const w=h();if(w==null||w===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const S=b==="first"?Oh(w):zh(w);o=!1,S||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function u(b){if(o)return;const y=h();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?m("last"):m("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:u,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function hC(t){return t}const oa="n-internal-select-menu",Dh="n-internal-select-menu-body",Hh="n-drawer-body",Wh="n-modal-body",jh="n-popover-body",qh="__disabled__";function $n(t){const e=i.inject(Wh,null),n=i.inject(Hh,null),r=i.inject(jh,null),s=i.inject(Dh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{St("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{nt("fullscreenchange",document,a)})}return Xt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?qh:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}$n.tdkey=qh,$n.propTo={type:[String,Object,Boolean],default:void 0};function pw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Xh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&xr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&xr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&xr.unregisterHandler(n)}))}function Yh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const yw=/^(\d|\.)+$/,Uh=/(\d|\.)+/;function aa(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(yw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Uh.exec(t);return s?t.replace(Uh,String((Number(s[0])+n)*e)):t}return t}function Kh(t){const{left:e,right:n,top:r,bottom:s}=Jt(t);return`${r} ${e} ${s} ${n}`}var Gh={};function bw(t){let e=".",n="__",r="--",s;if(t){let u=t.blockPrefix;u&&(e=u),u=t.elementPrefix,u&&(n=u),u=t.modifierPrefix,u&&(r=u)}const o={install(u){s=u.c;const p=u.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(u){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return u=typeof u=="string"?u:u({context:y,props:_}),y.bem.b=u,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(u){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return u=typeof u=="string"?u:u({context:b,props:y}),b.bem.els=u.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=u.split(",").map(S=>S.trim());function _(S){return y.map(B=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${S!==void 0?`${n}${S}`:""}${r}${B}`).join(", ")}const w=p.bem.els;if(w!==null){if(Gh.NODE_ENV!=="production"&&w.length>=2)throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`);return _(w[0])}else return _()}}}function d(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=p.bem.els;if(Gh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${u})`}}}return Object.assign(o,{cB:((...u)=>s(a(u[0]),u[1],u[2])),cE:((...u)=>s(l(u[0]),u[1],u[2])),cM:((...u)=>s(c(u[0]),u[1],u[2])),cNotM:((...u)=>s(d(u[0]),u[1],u[2]))}),o}const _w=".n-",ww="__",xw="--",Zh=dh(),Qh=bw({blockPrefix:_w,elementPrefix:ww,modifierPrefix:xw});Zh.use(Qh);const{c:le,find:fC}=Zh,{cB:me,cE:be,cM:Se,cNotM:en}=Qh,vw=(...t)=>le(">",[me(...t)]);function Ue(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let la;function kw(){return la===void 0&&(la=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),la}const Cw=new WeakSet;function Sw(t){Cw.add(t)}function Jh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const eu=new Set;function Zn(t,e){const n=`[naive/${t}]: ${e}`;eu.has(n)||(eu.add(n),console.error(n))}function tu(t,e){console.error(`[naive/${t}]: ${e}`)}function nu(t,e){throw new Error(`[naive/${t}]: ${e}`)}function ft(t,...e){if(Array.isArray(t))t.forEach(n=>ft(n,...e));else return t(...e)}function ca(t,e=!0,n=[]){return t.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)){ca(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ca(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function Bw(t,e="default",n=void 0){const r=t[e];if(!r)return tu("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ca(r(n));return s.length===1?s[0]:(tu("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Tw(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function da(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function Ji(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ha(t,e){return t&&Ps(t())||e()}function _i(t,e){const n=t&&Ps(t());return e(n||null)}function iu(t){return!(t&&Ps(t()))}const ua=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),wi="n-config-provider",Rw="n";function xi(t={},e={defaultBordered:!0}){const n=i.inject(wi,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}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Rw),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function vi(t,e,n,r){n||nu("useThemeClass","cssVarsRef is not passed");const s=i.inject(wi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=pi();let d;const h=`__${t}`,f=()=>{let g=h;const m=e?e.value:void 0,u=o==null?void 0:o.value;u&&(g+=`-${u}`),m&&(g+=`-${m}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(g+=`-${Qo(JSON.stringify(p))}`),b&&(g+=`-${Qo(JSON.stringify(b))}`),l.value=g,d=()=>{const y=n.value;let _="";for(const w in y)_+=`${w}: ${y[w]};`;le(`.${g}`,_).mount({id:g,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const ru="n-form-item";function Pw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(ru,null);i.provide(ru,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;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 $w={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'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:t=>`Total ${t} items`,selected:t=>`${t} 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"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function fa(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function kr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function Cr(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Nw(l,f=>f.test(a)):Ew(l,f=>f.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function Ew(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Nw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Fw(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Aw={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"}},Mw=(t,e,n)=>{let r;const s=Aw[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Vw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Iw=(t,e,n,r)=>Vw[t],Ow={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Lw={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"]},Dw={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"]},Hw={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"}},Ww={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"}},jw={ordinalNumber:(t,e)=>{const n=Number(t),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:kr({values:Ow,defaultWidth:"wide"}),quarter:kr({values:zw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:kr({values:Lw,defaultWidth:"wide"}),day:kr({values:Dw,defaultWidth:"wide"}),dayPeriod:kr({values:Hw,defaultWidth:"wide",formattingValues:Ww,defaultFormattingWidth:"wide"})},qw=/^(\d+)(th|st|nd|rd)?/i,Xw=/\d+/i,Yw={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},Uw={any:[/^b/i,/^(a|c)/i]},Kw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Gw={any:[/1/i,/2/i,/3/i,/4/i]},Zw={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},Qw={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]},Jw={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},ex={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]},tx={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},nx={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}},ix={ordinalNumber:Fw({matchPattern:qw,parsePattern:Xw,valueCallback:t=>parseInt(t,10)}),era:Cr({matchPatterns:Yw,defaultMatchWidth:"wide",parsePatterns:Uw,defaultParseWidth:"any"}),quarter:Cr({matchPatterns:Kw,defaultMatchWidth:"wide",parsePatterns:Gw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Cr({matchPatterns:Zw,defaultMatchWidth:"wide",parsePatterns:Qw,defaultParseWidth:"any"}),day:Cr({matchPatterns:Jw,defaultMatchWidth:"wide",parsePatterns:ex,defaultParseWidth:"any"}),dayPeriod:Cr({matchPatterns:tx,defaultMatchWidth:"any",parsePatterns:nx,defaultParseWidth:"any"})},rx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ox={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ax={date:fa({formats:rx,defaultWidth:"full"}),time:fa({formats:sx,defaultWidth:"full"}),dateTime:fa({formats:ox,defaultWidth:"full"})},lx={name:"en-US",locale:{code:"en-US",formatDistance:Mw,formatLong:ax,formatRelative:Iw,localize:jw,match:ix,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function su(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(wi,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:$w[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:lx}),localeRef:r}}const Sr="naive-ui-style";function Br(t,e,n){if(!e)return;const r=pi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(wi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(N1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:Sr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const Tr={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:cx,fontFamily:dx,lineHeight:hx}=Tr,ou=le("body",`
|
|
117
117
|
margin: 0;
|
|
118
118
|
font-size: ${cx};
|
|
119
119
|
font-family: ${dx};
|
|
@@ -123,7 +123,7 @@ ${s}
|
|
|
123
123
|
`,[le("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var ux={};function $s(t,e,n){if(!e){ux.NODE_ENV!=="production"&&nu("use-style","No style is specified.");return}const r=pi(),s=i.inject(wi,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Sr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ou.mount({id:"n-global",head:!0,anchorMetaName:Sr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function pC(t){return t}function gt(t,e,n,r,s,o){const a=pi(),l=i.inject(wi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:Sr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ou.mount({id:"n-global",head:!0,anchorMetaName:Sr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:f,peers:g={}}={},themeOverrides:m={},builtinThemeOverrides:u={}}=s,{common:p,peers:b}=m,{common:y=void 0,[t]:{common:_=void 0,self:
|
|
126
|
+
`)]);var ux={};function $s(t,e,n){if(!e){ux.NODE_ENV!=="production"&&nu("use-style","No style is specified.");return}const r=pi(),s=i.inject(wi,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Sr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ou.mount({id:"n-global",head:!0,anchorMetaName:Sr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function pC(t){return t}function gt(t,e,n,r,s,o){const a=pi(),l=i.inject(wi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:Sr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ou.mount({id:"n-global",head:!0,anchorMetaName:Sr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:f,peers:g={}}={},themeOverrides:m={},builtinThemeOverrides:u={}}=s,{common:p,peers:b}=m,{common:y=void 0,[t]:{common:_=void 0,self:w=void 0,peers:S={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:B=void 0,[t]:R={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:C,peers:T={}}=R,v=M.merge({},h||_||y||r.common,B,C,p),P=M.merge((d=f||w||r.self)===null||d===void 0?void 0:d(v),u,R,m);return{common:v,self:P,peers:M.merge({},r.peers,S,g),peerOverrides:M.merge({},u.peers,T,b)}})}gt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const fx=me("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -294,7 +294,7 @@ ${s}
|
|
|
294
294
|
pointer-events: all;
|
|
295
295
|
background-color: var(--n-scrollbar-color);
|
|
296
296
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
|
297
|
-
`,[Tx(),le("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Fx=Object.assign(Object.assign({},gt.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"}}),fu=i.defineComponent({name:"Scrollbar",props:Fx,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=xi(t),s=Br("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),u=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),v=i.ref(!1);let B=!1,S=!1,R,C,T=0,x=0,P=0,$=0;const A=c1(),F=gt("Scrollbar","-scrollbar",Nx,pa,t,e),O=i.computed(()=>{const{value:E}=g,{value:j}=h,{value:ie}=u;return E===null||j===null||ie===null?0:Math.min(E,ie*E/j+pr(F.value.self.width)*1.5)}),L=i.computed(()=>`${O.value}px`),J=i.computed(()=>{const{value:E}=m,{value:j}=f,{value:ie}=p;return E===null||j===null||ie===null?0:ie*E/j+pr(F.value.self.height)*1.5}),ne=i.computed(()=>`${J.value}px`),N=i.computed(()=>{const{value:E}=g,{value:j}=b,{value:ie}=h,{value:ce}=u;if(E===null||ie===null||ce===null)return 0;{const de=ie-E;return de?j/de*(ce-O.value):0}}),V=i.computed(()=>`${N.value}px`),q=i.computed(()=>{const{value:E}=m,{value:j}=y,{value:ie}=f,{value:ce}=p;if(E===null||ie===null||ce===null)return 0;{const de=ie-E;return de?j/de*(ce-J.value):0}}),X=i.computed(()=>`${q.value}px`),I=i.computed(()=>{const{value:E}=g,{value:j}=h;return E!==null&&j!==null&&j>E}),W=i.computed(()=>{const{value:E}=m,{value:j}=f;return E!==null&&j!==null&&j>E}),H=i.computed(()=>{const{trigger:E}=t;return E==="none"||_.value}),U=i.computed(()=>{const{trigger:E}=t;return E==="none"||v.value}),fe=i.computed(()=>{const{container:E}=t;return E?E():a.value}),oe=i.computed(()=>{const{content:E}=t;return E?E():l.value}),re=(E,j)=>{if(!t.scrollable)return;if(typeof E=="number"){Te(E,j??0,0,!1,"auto");return}const{left:ie,top:ce,index:de,elSize:ye,position:we,behavior:ve,el:Xe,debounce:Cn=!0}=E;(ie!==void 0||ce!==void 0)&&Te(ie??0,ce??0,0,!1,ve),Xe!==void 0?Te(0,Xe.offsetTop,Xe.offsetHeight,Cn,ve):de!==void 0&&ye!==void 0?Te(0,de*ye,ye,Cn,ve):we==="bottom"?Te(0,Number.MAX_SAFE_INTEGER,0,!1,ve):we==="top"&&Te(0,0,0,!1,ve)},Ne=pw(()=>{t.container||re({top:b.value,left:y.value})}),Le=()=>{Ne.isDeactivated||se()},Fe=E=>{if(Ne.isDeactivated)return;const{onResize:j}=t;j&&j(E),se()},Ut=(E,j)=>{if(!t.scrollable)return;const{value:ie}=fe;ie&&(typeof E=="object"?ie.scrollBy(E):ie.scrollBy(E,j||0))};function Te(E,j,ie,ce,de){const{value:ye}=fe;if(ye){if(ce){const{scrollTop:we,offsetHeight:ve}=ye;if(j>we){j+ie<=we+ve||ye.scrollTo({left:E,top:j+ie-ve,behavior:de});return}}ye.scrollTo({left:E,top:j,behavior:de})}}function rn(){bt(),zn(),se()}function sn(){Tt()}function Tt(){Ot(),on()}function Ot(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{v.value=!1},t.duration)}function on(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{_.value=!1},t.duration)}function bt(){R!==void 0&&window.clearTimeout(R),_.value=!0}function zn(){C!==void 0&&window.clearTimeout(C),v.value=!0}function an(E){const{onScroll:j}=t;j&&j(E),Kt()}function Kt(){const{value:E}=fe;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1))}function Pe(){const{value:E}=oe;E&&(h.value=E.offsetHeight,f.value=E.offsetWidth);const{value:j}=fe;j&&(g.value=j.offsetHeight,m.value=j.offsetWidth);const{value:ie}=d,{value:ce}=c;ie&&(p.value=ie.offsetWidth),ce&&(u.value=ce.offsetHeight)}function K(){const{value:E}=fe;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1),g.value=E.offsetHeight,m.value=E.offsetWidth,h.value=E.scrollHeight,f.value=E.scrollWidth);const{value:j}=d,{value:ie}=c;j&&(p.value=j.offsetWidth),ie&&(u.value=ie.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?K():(Pe(),Kt()))}function Ie(E){var j;return!(!((j=o.value)===null||j===void 0)&&j.contains(mr(E)))}function Jn(E){E.preventDefault(),E.stopPropagation(),S=!0,St("mousemove",window,Qe,!0),St("mouseup",window,zt,!0),x=y.value,P=s!=null&&s.value?window.innerWidth-E.clientX:E.clientX}function Qe(E){if(!S)return;R!==void 0&&window.clearTimeout(R),C!==void 0&&window.clearTimeout(C);const{value:j}=m,{value:ie}=f,{value:ce}=J;if(j===null||ie===null)return;const ye=(s!=null&&s.value?window.innerWidth-E.clientX-P:E.clientX-P)*(ie-j)/(j-ce),we=ie-j;let ve=x+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Xe}=fe;if(Xe){Xe.scrollLeft=ve*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Cn}=t;Cn&&Cn(ve)}}function zt(E){E.preventDefault(),E.stopPropagation(),nt("mousemove",window,Qe,!0),nt("mouseup",window,zt,!0),S=!1,se(),Ie(E)&&Tt()}function er(E){E.preventDefault(),E.stopPropagation(),B=!0,St("mousemove",window,ei,!0),St("mouseup",window,Ti,!0),T=b.value,$=E.clientY}function ei(E){if(!B)return;R!==void 0&&window.clearTimeout(R),C!==void 0&&window.clearTimeout(C);const{value:j}=g,{value:ie}=h,{value:ce}=O;if(j===null||ie===null)return;const ye=(E.clientY-$)*(ie-j)/(j-ce),we=ie-j;let ve=T+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Xe}=fe;Xe&&(Xe.scrollTop=ve)}function Ti(E){E.preventDefault(),E.stopPropagation(),nt("mousemove",window,ei,!0),nt("mouseup",window,Ti,!0),B=!1,se(),Ie(E)&&Tt()}i.watchEffect(()=>{const{value:E}=W,{value:j}=I,{value:ie}=e,{value:ce}=d,{value:de}=c;ce&&(E?ce.classList.remove(`${ie}-scrollbar-rail--disabled`):ce.classList.add(`${ie}-scrollbar-rail--disabled`)),de&&(j?de.classList.remove(`${ie}-scrollbar-rail--disabled`):de.classList.add(`${ie}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{R!==void 0&&window.clearTimeout(R),C!==void 0&&window.clearTimeout(C),nt("mousemove",window,ei,!0),nt("mouseup",window,Ti,!0)});const tr=i.computed(()=>{const{common:{cubicBezierEaseInOut:E},self:{color:j,colorHover:ie,height:ce,width:de,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ve,railInsetVerticalRight:Xe,railInsetVerticalLeft:Cn,railColor:ka}}=F.value,{top:Ca,right:Sa,bottom:Ba,left:Ta}=Jt(we),{top:Ra,right:Pa,bottom:$a,left:Ea}=Jt(ve),{top:Na,right:Fa,bottom:Aa,left:Ma}=Jt(s!=null&&s.value?Kh(Xe):Xe),{top:Va,right:Ia,bottom:Oa,left:za}=Jt(s!=null&&s.value?Kh(Cn):Cn);return{"--n-scrollbar-bezier":E,"--n-scrollbar-color":j,"--n-scrollbar-color-hover":ie,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":de,"--n-scrollbar-height":ce,"--n-scrollbar-rail-top-horizontal-top":Ca,"--n-scrollbar-rail-right-horizontal-top":Sa,"--n-scrollbar-rail-bottom-horizontal-top":Ba,"--n-scrollbar-rail-left-horizontal-top":Ta,"--n-scrollbar-rail-top-horizontal-bottom":Ra,"--n-scrollbar-rail-right-horizontal-bottom":Pa,"--n-scrollbar-rail-bottom-horizontal-bottom":$a,"--n-scrollbar-rail-left-horizontal-bottom":Ea,"--n-scrollbar-rail-top-vertical-right":Na,"--n-scrollbar-rail-right-vertical-right":Fa,"--n-scrollbar-rail-bottom-vertical-right":Aa,"--n-scrollbar-rail-left-vertical-right":Ma,"--n-scrollbar-rail-top-vertical-left":Va,"--n-scrollbar-rail-right-vertical-left":Ia,"--n-scrollbar-rail-bottom-vertical-left":Oa,"--n-scrollbar-rail-left-vertical-left":za,"--n-scrollbar-rail-color":ka}}),ln=n?vi("scrollbar",void 0,tr,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Ut,sync:se,syncUnifiedContainer:K,handleMouseEnterWrapper:rn,handleMouseLeaveWrapper:sn}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:I,needXBar:W,yBarSizePx:L,xBarSizePx:ne,yBarTopPx:V,xBarLeftPx:X,isShowXBar:H,isShowYBar:U,isIos:A,handleScroll:an,handleContentResize:Le,handleContainerResize:Fe,handleYScrollMouseDown:er,handleXScrollMouseDown:Jn,cssVars:n?void 0:tr,themeClass:ln==null?void 0:ln.themeClass,onRender:ln==null?void 0:ln.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",h=(m,u)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[u||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ua: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})),f=()=>{var m,u;return(m=this.onRender)===null||m===void 0||m.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?(u=e.default)===null||u===void 0?void 0:u.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Ts,{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]},e)})),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?ua: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}))])},g=this.container?f():i.h(Ts,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,g,h(this.themeClass,this.cssVars)):g}}),Ax=fu,Mx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Vx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Mx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const gu={name:"Empty",common:ki,self:Vx},Ix=me("empty",`
|
|
297
|
+
`,[Tx(),le("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Fx=Object.assign(Object.assign({},gt.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"}}),fu=i.defineComponent({name:"Scrollbar",props:Fx,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=xi(t),s=Br("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),u=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),w=i.ref(!1);let S=!1,B=!1,R,C,T=0,v=0,P=0,$=0;const A=c1(),F=gt("Scrollbar","-scrollbar",Nx,pa,t,e),O=i.computed(()=>{const{value:E}=g,{value:j}=h,{value:ie}=u;return E===null||j===null||ie===null?0:Math.min(E,ie*E/j+pr(F.value.self.width)*1.5)}),L=i.computed(()=>`${O.value}px`),J=i.computed(()=>{const{value:E}=m,{value:j}=f,{value:ie}=p;return E===null||j===null||ie===null?0:ie*E/j+pr(F.value.self.height)*1.5}),ne=i.computed(()=>`${J.value}px`),N=i.computed(()=>{const{value:E}=g,{value:j}=b,{value:ie}=h,{value:ce}=u;if(E===null||ie===null||ce===null)return 0;{const de=ie-E;return de?j/de*(ce-O.value):0}}),V=i.computed(()=>`${N.value}px`),q=i.computed(()=>{const{value:E}=m,{value:j}=y,{value:ie}=f,{value:ce}=p;if(E===null||ie===null||ce===null)return 0;{const de=ie-E;return de?j/de*(ce-J.value):0}}),X=i.computed(()=>`${q.value}px`),I=i.computed(()=>{const{value:E}=g,{value:j}=h;return E!==null&&j!==null&&j>E}),W=i.computed(()=>{const{value:E}=m,{value:j}=f;return E!==null&&j!==null&&j>E}),H=i.computed(()=>{const{trigger:E}=t;return E==="none"||_.value}),U=i.computed(()=>{const{trigger:E}=t;return E==="none"||w.value}),fe=i.computed(()=>{const{container:E}=t;return E?E():a.value}),oe=i.computed(()=>{const{content:E}=t;return E?E():l.value}),re=(E,j)=>{if(!t.scrollable)return;if(typeof E=="number"){Te(E,j??0,0,!1,"auto");return}const{left:ie,top:ce,index:de,elSize:ye,position:we,behavior:ve,el:Xe,debounce:Cn=!0}=E;(ie!==void 0||ce!==void 0)&&Te(ie??0,ce??0,0,!1,ve),Xe!==void 0?Te(0,Xe.offsetTop,Xe.offsetHeight,Cn,ve):de!==void 0&&ye!==void 0?Te(0,de*ye,ye,Cn,ve):we==="bottom"?Te(0,Number.MAX_SAFE_INTEGER,0,!1,ve):we==="top"&&Te(0,0,0,!1,ve)},Ne=pw(()=>{t.container||re({top:b.value,left:y.value})}),Le=()=>{Ne.isDeactivated||se()},Fe=E=>{if(Ne.isDeactivated)return;const{onResize:j}=t;j&&j(E),se()},Ut=(E,j)=>{if(!t.scrollable)return;const{value:ie}=fe;ie&&(typeof E=="object"?ie.scrollBy(E):ie.scrollBy(E,j||0))};function Te(E,j,ie,ce,de){const{value:ye}=fe;if(ye){if(ce){const{scrollTop:we,offsetHeight:ve}=ye;if(j>we){j+ie<=we+ve||ye.scrollTo({left:E,top:j+ie-ve,behavior:de});return}}ye.scrollTo({left:E,top:j,behavior:de})}}function rn(){bt(),zn(),se()}function sn(){Tt()}function Tt(){Ot(),on()}function Ot(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{w.value=!1},t.duration)}function on(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{_.value=!1},t.duration)}function bt(){R!==void 0&&window.clearTimeout(R),_.value=!0}function zn(){C!==void 0&&window.clearTimeout(C),w.value=!0}function an(E){const{onScroll:j}=t;j&&j(E),Kt()}function Kt(){const{value:E}=fe;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1))}function Pe(){const{value:E}=oe;E&&(h.value=E.offsetHeight,f.value=E.offsetWidth);const{value:j}=fe;j&&(g.value=j.offsetHeight,m.value=j.offsetWidth);const{value:ie}=d,{value:ce}=c;ie&&(p.value=ie.offsetWidth),ce&&(u.value=ce.offsetHeight)}function K(){const{value:E}=fe;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1),g.value=E.offsetHeight,m.value=E.offsetWidth,h.value=E.scrollHeight,f.value=E.scrollWidth);const{value:j}=d,{value:ie}=c;j&&(p.value=j.offsetWidth),ie&&(u.value=ie.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?K():(Pe(),Kt()))}function Ie(E){var j;return!(!((j=o.value)===null||j===void 0)&&j.contains(mr(E)))}function Jn(E){E.preventDefault(),E.stopPropagation(),B=!0,St("mousemove",window,Qe,!0),St("mouseup",window,zt,!0),v=y.value,P=s!=null&&s.value?window.innerWidth-E.clientX:E.clientX}function Qe(E){if(!B)return;R!==void 0&&window.clearTimeout(R),C!==void 0&&window.clearTimeout(C);const{value:j}=m,{value:ie}=f,{value:ce}=J;if(j===null||ie===null)return;const ye=(s!=null&&s.value?window.innerWidth-E.clientX-P:E.clientX-P)*(ie-j)/(j-ce),we=ie-j;let ve=v+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Xe}=fe;if(Xe){Xe.scrollLeft=ve*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Cn}=t;Cn&&Cn(ve)}}function zt(E){E.preventDefault(),E.stopPropagation(),nt("mousemove",window,Qe,!0),nt("mouseup",window,zt,!0),B=!1,se(),Ie(E)&&Tt()}function er(E){E.preventDefault(),E.stopPropagation(),S=!0,St("mousemove",window,ei,!0),St("mouseup",window,Ti,!0),T=b.value,$=E.clientY}function ei(E){if(!S)return;R!==void 0&&window.clearTimeout(R),C!==void 0&&window.clearTimeout(C);const{value:j}=g,{value:ie}=h,{value:ce}=O;if(j===null||ie===null)return;const ye=(E.clientY-$)*(ie-j)/(j-ce),we=ie-j;let ve=T+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Xe}=fe;Xe&&(Xe.scrollTop=ve)}function Ti(E){E.preventDefault(),E.stopPropagation(),nt("mousemove",window,ei,!0),nt("mouseup",window,Ti,!0),S=!1,se(),Ie(E)&&Tt()}i.watchEffect(()=>{const{value:E}=W,{value:j}=I,{value:ie}=e,{value:ce}=d,{value:de}=c;ce&&(E?ce.classList.remove(`${ie}-scrollbar-rail--disabled`):ce.classList.add(`${ie}-scrollbar-rail--disabled`)),de&&(j?de.classList.remove(`${ie}-scrollbar-rail--disabled`):de.classList.add(`${ie}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{R!==void 0&&window.clearTimeout(R),C!==void 0&&window.clearTimeout(C),nt("mousemove",window,ei,!0),nt("mouseup",window,Ti,!0)});const tr=i.computed(()=>{const{common:{cubicBezierEaseInOut:E},self:{color:j,colorHover:ie,height:ce,width:de,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ve,railInsetVerticalRight:Xe,railInsetVerticalLeft:Cn,railColor:ka}}=F.value,{top:Ca,right:Sa,bottom:Ba,left:Ta}=Jt(we),{top:Ra,right:Pa,bottom:$a,left:Ea}=Jt(ve),{top:Na,right:Fa,bottom:Aa,left:Ma}=Jt(s!=null&&s.value?Kh(Xe):Xe),{top:Va,right:Ia,bottom:Oa,left:za}=Jt(s!=null&&s.value?Kh(Cn):Cn);return{"--n-scrollbar-bezier":E,"--n-scrollbar-color":j,"--n-scrollbar-color-hover":ie,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":de,"--n-scrollbar-height":ce,"--n-scrollbar-rail-top-horizontal-top":Ca,"--n-scrollbar-rail-right-horizontal-top":Sa,"--n-scrollbar-rail-bottom-horizontal-top":Ba,"--n-scrollbar-rail-left-horizontal-top":Ta,"--n-scrollbar-rail-top-horizontal-bottom":Ra,"--n-scrollbar-rail-right-horizontal-bottom":Pa,"--n-scrollbar-rail-bottom-horizontal-bottom":$a,"--n-scrollbar-rail-left-horizontal-bottom":Ea,"--n-scrollbar-rail-top-vertical-right":Na,"--n-scrollbar-rail-right-vertical-right":Fa,"--n-scrollbar-rail-bottom-vertical-right":Aa,"--n-scrollbar-rail-left-vertical-right":Ma,"--n-scrollbar-rail-top-vertical-left":Va,"--n-scrollbar-rail-right-vertical-left":Ia,"--n-scrollbar-rail-bottom-vertical-left":Oa,"--n-scrollbar-rail-left-vertical-left":za,"--n-scrollbar-rail-color":ka}}),ln=n?vi("scrollbar",void 0,tr,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Ut,sync:se,syncUnifiedContainer:K,handleMouseEnterWrapper:rn,handleMouseLeaveWrapper:sn}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:I,needXBar:W,yBarSizePx:L,xBarSizePx:ne,yBarTopPx:V,xBarLeftPx:X,isShowXBar:H,isShowYBar:U,isIos:A,handleScroll:an,handleContentResize:Le,handleContainerResize:Fe,handleYScrollMouseDown:er,handleXScrollMouseDown:Jn,cssVars:n?void 0:tr,themeClass:ln==null?void 0:ln.themeClass,onRender:ln==null?void 0:ln.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",h=(m,u)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[u||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ua: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})),f=()=>{var m,u;return(m=this.onRender)===null||m===void 0||m.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?(u=e.default)===null||u===void 0?void 0:u.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Ts,{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]},e)})),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?ua: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}))])},g=this.container?f():i.h(Ts,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,g,h(this.themeClass,this.cssVars)):g}}),Ax=fu,Mx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Vx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Mx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const gu={name:"Empty",common:ki,self:Vx},Ix=me("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
@@ -317,7 +317,7 @@ ${s}
|
|
|
317
317
|
transition: color .3s var(--n-bezier);
|
|
318
318
|
margin-top: 12px;
|
|
319
319
|
color: var(--n-extra-text-color);
|
|
320
|
-
`)]),Ox=Object.assign(Object.assign({},gt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),zx=i.defineComponent({name:"Empty",props:Ox,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=xi(t),s=gt("Empty","-empty",Ix,gu,t,e),{localeRef:o}=su("Empty"),a=i.computed(()=>{var h,f,g;return(h=t.description)!==null&&h!==void 0?h:(g=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||g===void 0?void 0:g.description}),l=i.computed(()=>{var h,f;return((f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i.h(bx,null))}),c=i.computed(()=>{const{size:h}=t,{common:{cubicBezierEaseInOut:f},self:{[Ue("iconSize",h)]:g,[Ue("fontSize",h)]:m,textColor:u,iconColor:p,extraTextColor:b}}=s.value;return{"--n-icon-size":g,"--n-font-size":m,"--n-bezier":f,"--n-text-color":u,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?vi("empty",i.computed(()=>{let h="";const{size:f}=t;return h+=f[0],h}),c,t):void 0;return{mergedClsPrefix:e,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:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h(Rr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),Lx={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 Dx(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:m,fontSizeLarge:u,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:
|
|
320
|
+
`)]),Ox=Object.assign(Object.assign({},gt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),zx=i.defineComponent({name:"Empty",props:Ox,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=xi(t),s=gt("Empty","-empty",Ix,gu,t,e),{localeRef:o}=su("Empty"),a=i.computed(()=>{var h,f,g;return(h=t.description)!==null&&h!==void 0?h:(g=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||g===void 0?void 0:g.description}),l=i.computed(()=>{var h,f;return((f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i.h(bx,null))}),c=i.computed(()=>{const{size:h}=t,{common:{cubicBezierEaseInOut:f},self:{[Ue("iconSize",h)]:g,[Ue("fontSize",h)]:m,textColor:u,iconColor:p,extraTextColor:b}}=s.value;return{"--n-icon-size":g,"--n-font-size":m,"--n-bezier":f,"--n-text-color":u,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?vi("empty",i.computed(()=>{let h="";const{size:f}=t;return h+=f[0],h}),c,t):void 0;return{mergedClsPrefix:e,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:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h(Rr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),Lx={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 Dx(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:m,fontSizeLarge:u,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:w,heightHuge:S}=t;return Object.assign(Object.assign({},Lx),{optionFontSizeTiny:f,optionFontSizeSmall:g,optionFontSizeMedium:m,optionFontSizeLarge:u,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:w,optionHeightHuge:S,borderRadius:e,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 mu={name:"InternalSelectMenu",common:ki,peers:{Scrollbar:pa,Empty:gu},self:Dx},pu=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(oa);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=e?e(s,!1):Ji(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${t}-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 Hx(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(Rr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(gx)}):null})}const yu=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:f,handleOptionMouseEnter:g}=i.inject(oa),m=Xt(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function u(y){const{tmNode:_}=t;_.disabled||f(y,_)}function p(y){const{tmNode:_}=t;_.disabled||g(y,_)}function b(y){const{tmNode:_}=t,{value:w}=m;_.disabled||w||g(y,_)}return{multiple:r,isGrouped:Xt(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:m,isSelected:Xt(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const w=t.tmNode.rawNode[c.value];if(_){const{value:S}=s;return S.has(w)}else return y===w}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:u}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:f}=this,g=Hx(n,t),m=c?[c(e,n),o&&g]:[Ji(e[this.labelField],e,n),o&&g],u=a==null?void 0:a(e),p=i.h("div",Object.assign({},u,{class:[`${t}-base-select-option`,e.class,u==null?void 0:u.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:s,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:o}],style:[(u==null?void 0:u.style)||"",e.style||""],onClick:da([d,u==null?void 0:u.onClick]),onMouseenter:da([h,u==null?void 0:u.onMouseenter]),onMousemove:da([f,u==null?void 0:u.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},m));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:bu,cubicBezierEaseOut:_u}=Tr;function wu({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[le("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${bu}, transform ${e} ${bu} ${s&&`,${s}`}`}),le("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${_u}, transform ${e} ${_u} ${s&&`,${s}`}`}),le("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),le("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Wx=me("base-select-menu",`
|
|
321
321
|
line-height: 1.5;
|
|
322
322
|
outline: none;
|
|
323
323
|
z-index: 0;
|
|
@@ -424,7 +424,7 @@ ${s}
|
|
|
424
424
|
top: calc(50% - 7px);
|
|
425
425
|
color: var(--n-option-check-color);
|
|
426
426
|
transition: color .3s var(--n-bezier);
|
|
427
|
-
`,[wu({enterScale:"0.5"})])])]),jx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},gt.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(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=xi(t),r=Br("InternalSelectMenu",n,e),s=gt("InternalSelectMenu","-internal-select-menu",Wx,mu,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>V_(c.value)),h=i.ref(null);function f(){const{treeMate:I}=t;let W=null;const{value:H}=t;H===null?W=I.getFirstAvailableNode():(t.multiple?W=I.getNode((H||[])[(H||[]).length-1]):W=I.getNode(H),(!W||W.disabled)&&(W=I.getFirstAvailableNode())),O(W||null)}function g(){const{value:I}=h;I&&!t.treeMate.getNode(I.key)&&(h.value=null)}let m;i.watch(()=>t.show,I=>{I?m=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?f():g(),i.nextTick(L)):g()},{immediate:!0}):m==null||m()},{immediate:!0}),i.onBeforeUnmount(()=>{m==null||m()});const u=i.computed(()=>pr(s.value.self[Ue("optionHeight",t.size)])),p=i.computed(()=>Jt(s.value.self[Ue("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const I=c.value;return I&&I.length===0});function _(I){const{onToggle:W}=t;W&&W(I)}function
|
|
427
|
+
`,[wu({enterScale:"0.5"})])])]),jx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},gt.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(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=xi(t),r=Br("InternalSelectMenu",n,e),s=gt("InternalSelectMenu","-internal-select-menu",Wx,mu,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>V_(c.value)),h=i.ref(null);function f(){const{treeMate:I}=t;let W=null;const{value:H}=t;H===null?W=I.getFirstAvailableNode():(t.multiple?W=I.getNode((H||[])[(H||[]).length-1]):W=I.getNode(H),(!W||W.disabled)&&(W=I.getFirstAvailableNode())),O(W||null)}function g(){const{value:I}=h;I&&!t.treeMate.getNode(I.key)&&(h.value=null)}let m;i.watch(()=>t.show,I=>{I?m=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?f():g(),i.nextTick(L)):g()},{immediate:!0}):m==null||m()},{immediate:!0}),i.onBeforeUnmount(()=>{m==null||m()});const u=i.computed(()=>pr(s.value.self[Ue("optionHeight",t.size)])),p=i.computed(()=>Jt(s.value.self[Ue("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const I=c.value;return I&&I.length===0});function _(I){const{onToggle:W}=t;W&&W(I)}function w(I){const{onScroll:W}=t;W&&W(I)}function S(I){var W;(W=l.value)===null||W===void 0||W.sync(),w(I)}function B(){var I;(I=l.value)===null||I===void 0||I.sync()}function R(){const{value:I}=h;return I||null}function C(I,W){W.disabled||O(W,!1)}function T(I,W){W.disabled||_(W)}function v(I){var W;gr(I,"action")||(W=t.onKeyup)===null||W===void 0||W.call(t,I)}function P(I){var W;gr(I,"action")||(W=t.onKeydown)===null||W===void 0||W.call(t,I)}function $(I){var W;(W=t.onMousedown)===null||W===void 0||W.call(t,I),!t.focusable&&I.preventDefault()}function A(){const{value:I}=h;I&&O(I.getNext({loop:!0}),!0)}function F(){const{value:I}=h;I&&O(I.getPrev({loop:!0}),!0)}function O(I,W=!1){h.value=I,W&&L()}function L(){var I,W;const H=h.value;if(!H)return;const U=d.value(H.key);U!==null&&(t.virtualScroll?(I=a.value)===null||I===void 0||I.scrollTo({index:U}):(W=l.value)===null||W===void 0||W.scrollTo({index:U,elSize:u.value}))}function J(I){var W,H;!((W=o.value)===null||W===void 0)&&W.contains(I.target)&&((H=t.onFocus)===null||H===void 0||H.call(t,I))}function ne(I){var W,H;!((W=o.value)===null||W===void 0)&&W.contains(I.relatedTarget)||(H=t.onBlur)===null||H===void 0||H.call(t,I)}i.provide(oa,{handleOptionMouseEnter:C,handleOptionClick:T,valueSetRef:b,pendingTmNodeRef:h,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(Dh,o),i.onMounted(()=>{const{value:I}=l;I&&I.sync()});const N=i.computed(()=>{const{size:I}=t,{common:{cubicBezierEaseInOut:W},self:{height:H,borderRadius:U,color:fe,groupHeaderTextColor:oe,actionDividerColor:re,optionTextColorPressed:Ne,optionTextColor:Le,optionTextColorDisabled:Fe,optionTextColorActive:Ut,optionOpacityDisabled:Te,optionCheckColor:rn,actionTextColor:sn,optionColorPending:Tt,optionColorActive:Ot,loadingColor:on,loadingSize:bt,optionColorActivePending:zn,[Ue("optionFontSize",I)]:an,[Ue("optionHeight",I)]:Kt,[Ue("optionPadding",I)]:Pe}}=s.value;return{"--n-height":H,"--n-action-divider-color":re,"--n-action-text-color":sn,"--n-bezier":W,"--n-border-radius":U,"--n-color":fe,"--n-option-font-size":an,"--n-group-header-text-color":oe,"--n-option-check-color":rn,"--n-option-color-pending":Tt,"--n-option-color-active":Ot,"--n-option-color-active-pending":zn,"--n-option-height":Kt,"--n-option-opacity-disabled":Te,"--n-option-text-color":Le,"--n-option-text-color-active":Ut,"--n-option-text-color-disabled":Fe,"--n-option-text-color-pressed":Ne,"--n-option-padding":Pe,"--n-option-padding-left":Jt(Pe,"left"),"--n-option-padding-right":Jt(Pe,"right"),"--n-loading-color":on,"--n-loading-size":bt}}),{inlineThemeDisabled:V}=t,q=V?vi("internal-select-menu",i.computed(()=>t.size[0]),N,t):void 0,X={selfRef:o,next:A,prev:F,getPendingTmNode:R};return Xh(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:u,padding:p,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:w,handleFocusin:J,handleFocusout:ne,handleKeyUp:v,handleKeyDown:P,handleMouseDown:$,handleVirtualListResize:B,handleVirtualListScroll:S,cssVars:V?void 0:N,themeClass:q==null?void 0:q.themeClass,onRender:q==null?void 0:q.onRender},X)},render(){const{$slots:t,virtualScroll:e,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},_i(t.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(cu,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},ha(t.empty,()=>[i.h(zx,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(fu,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(uw,{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(pu,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(yu,{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(pu,{key:a.key,clsPrefix:n,tmNode:a}):i.h(yu,{clsPrefix:n,key:a.key,tmNode:a})))}),_i(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(Cx,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),qx={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Xx(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},qx),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const xu={name:"Popover",common:ki,peers:{Scrollbar:pa},self:Xx},ya={top:"bottom",bottom:"top",left:"right",right:"left"},it="var(--n-arrow-height) * 1.414",Yx=le([me("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -540,7 +540,7 @@ ${s}
|
|
|
540
540
|
${n}: 100%;
|
|
541
541
|
${ya[n]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[me("popover-arrow",e)])])])}const vu=Object.assign(Object.assign({},gt.props),{to:$n.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 Ux({arrowClass:t,arrowStyle:e,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`,t],style:e}))}const Kx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:vu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=xi(t),l=gt("Popover","-popover",Yx,xu,t,s),c=Br("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),f=i.ref(null),g=i.ref(t.show),m=i.ref(!1);i.watchEffect(()=>{const{show:x}=t;x&&!kw()&&!t.internalDeactivateImmediately&&(m.value=!0)});const u=i.computed(()=>{const{trigger:x,onClickoutside:P}=t,$=[],{positionManuallyRef:{value:A}}=h;return A||(x==="click"&&!P&&$.push([ys,R,void 0,{capture:!0}]),x==="hover"&&$.push([n1,S])),P&&$.push([ys,R,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&$.push([i.vShow,t.show]),$}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:x,cubicBezierEaseIn:P,cubicBezierEaseOut:$},self:{space:A,spaceArrow:F,padding:O,fontSize:L,textColor:J,dividerColor:ne,color:N,boxShadow:V,borderRadius:q,arrowHeight:X,arrowOffset:I,arrowOffsetVertical:W}}=l.value;return{"--n-box-shadow":V,"--n-bezier":x,"--n-bezier-ease-in":P,"--n-bezier-ease-out":$,"--n-font-size":L,"--n-text-color":J,"--n-color":N,"--n-divider-color":ne,"--n-border-radius":q,"--n-arrow-height":X,"--n-arrow-offset":I,"--n-arrow-offset-vertical":W,"--n-padding":O,"--n-space":A,"--n-space-arrow":F}}),b=i.computed(()=>{const x=t.width==="trigger"?void 0:aa(t.width),P=[];x&&P.push({width:x});const{maxWidth:$,minWidth:A}=t;return $&&P.push({maxWidth:aa($)}),A&&P.push({maxWidth:aa(A)}),o||P.push(p.value),P}),y=o?vi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),x=>{t.animated||(x?g.value=!0:g.value=!1)});function _(){var x;(x=d.value)===null||x===void 0||x.syncPosition()}function v(x){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter(x)}function B(x){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave(x)}function S(x){t.trigger==="hover"&&!C().contains(mr(x))&&h.handleMouseMoveOutside(x)}function R(x){(t.trigger==="click"&&!C().contains(mr(x))||t.onClickoutside)&&h.handleClickOutside(x)}function C(){return h.getTriggerElement()}i.provide(jh,f),i.provide(Hh,null),i.provide(Wh,null);function T(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let P;const $=h.internalRenderBodyRef.value,{value:A}=s;if($)P=$([`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${A}-popover-shared--overlap`,t.showArrow&&`${A}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],f,b.value,v,B);else{const{value:F}=h.extraClassRef,{internalTrapFocus:O}=t,L=!iu(e.header)||!iu(e.footer),J=()=>{var ne,N;const V=L?i.h(i.Fragment,null,_i(e.header,I=>I?i.h("div",{class:[`${A}-popover__header`,t.headerClass],style:t.headerStyle},I):null),_i(e.default,I=>I?i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e):null),_i(e.footer,I=>I?i.h("div",{class:[`${A}-popover__footer`,t.footerClass],style:t.footerStyle},I):null)):t.scrollable?(ne=e.default)===null||ne===void 0?void 0:ne.call(e):i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(Ax,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:L?void 0:`${A}-popover__content ${(N=t.contentClass)!==null&&N!==void 0?N:""}`,contentStyle:L?void 0:t.contentStyle},{default:()=>V}):V,X=t.showArrow?Ux({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:A}):null;return[q,X]};P=i.h("div",i.mergeProps({class:[`${A}-popover`,`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,F.map(ne=>`${A}-${ne}`),{[`${A}-popover--scrollable`]:t.scrollable,[`${A}-popover--show-header-or-footer`]:L,[`${A}-popover--raw`]:t.raw,[`${A}-popover-shared--overlap`]:t.overlap,[`${A}-popover-shared--show-arrow`]:t.showArrow,[`${A}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:f,style:b.value,onKeydown:h.handleKeydown,onMouseenter:v,onMouseleave:B},n),O?i.h(mw,{active:t.show,autoFocus:!0},{default:J}):J())}return i.withDirectives(P,u.value)}return{displayed:m,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:$n(t),followerEnabled:g,renderContentNode:T}},render(){return i.h(yh,{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===$n.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Gx={};const Zx=Object.keys(vu),Qx={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Jx(t,e,n){Qx[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const ev={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:$n.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},tv=Object.assign(Object.assign(Object.assign({},gt.props),ev),{internalOnAfterLeave:Function,internalRenderBody:Function}),nv=i.defineComponent({name:"Popover",inheritAttrs:!1,props:tv,slots:Object,__popover__:!0,setup(t){Gx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&Zn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&Zn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&Zn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&Zn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&Zn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=bs(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Yo(r,s),a=Xt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:L}=t;return!!(L!=null&&L())},c=()=>l()?!1:o.value,d=Zd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let f=null;const g=i.ref(null),m=i.ref(null),u=Xt(()=>t.x!==void 0&&t.y!==void 0);function p(L){const{"onUpdate:show":J,onUpdateShow:ne,onShow:N,onHide:V}=t;s.value=L,J&&ft(J,L),ne&&ft(ne,L),L&&N&&ft(N,!0),L&&V&&ft(V,!1)}function b(){f&&f.syncPosition()}function y(){const{value:L}=g;L&&(window.clearTimeout(L),g.value=null)}function _(){const{value:L}=m;L&&(window.clearTimeout(L),m.value=null)}function v(){const L=l();if(t.trigger==="focus"&&!L){if(c())return;p(!0)}}function B(){const L=l();if(t.trigger==="focus"&&!L){if(!c())return;p(!1)}}function S(){const L=l();if(t.trigger==="hover"&&!L){if(_(),g.value!==null||c())return;const J=()=>{p(!0),g.value=null},{delay:ne}=t;ne===0?J():g.value=window.setTimeout(J,ne)}}function R(){const L=l();if(t.trigger==="hover"&&!L){if(y(),m.value!==null||!c())return;const J=()=>{p(!1),m.value=null},{duration:ne}=t;ne===0?J():m.value=window.setTimeout(J,ne)}}function C(){R()}function T(L){var J;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,L))}function x(){if(t.trigger==="click"&&!l()){y(),_();const L=!c();p(L)}}function P(L){t.internalTrapFocus&&L.key==="Escape"&&(y(),_(),p(!1))}function $(L){s.value=L}function A(){var L;return(L=n.value)===null||L===void 0?void 0:L.targetRef}function F(L){f=L}return i.provide("NPopover",{getTriggerElement:A,handleKeydown:P,handleMouseEnter:S,handleMouseLeave:R,handleClickOutside:T,handleMouseMoveOutside:C,setBodyInstance:F,positionManuallyRef:u,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:u,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:$,handleClick:x,handleMouseEnter:S,handleMouseLeave:R,handleFocus:v,handleBlur:B,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=Bw(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(!((t=r.type)===null||t===void 0)&&t.__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)})}};Jx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(th,{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}}),[[Gd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(nh,null,{default:()=>r}),i.h(Kx,Tw(this.$props,Zx,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)}})]}})}}),iv={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 rv(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:g,closeIconColor:m,closeIconColorHover:u,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:v,fontSizeMedium:B,heightMini:S,heightTiny:R,heightSmall:C,heightMedium:T,closeColorHover:x,closeColorPressed:P,buttonColor2Hover:$,buttonColor2Pressed:A,fontWeightStrong:F}=t;return Object.assign(Object.assign({},iv),{closeBorderRadius:b,heightTiny:S,heightSmall:R,heightMedium:C,heightLarge:T,borderRadius:b,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:B,fontWeightStrong:F,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:$,colorPressedCheckable:A,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:g,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:x,closeColorPressed:P,borderPrimary:`1px solid ${Ve(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ve(s,{alpha:.12}),colorBorderedPrimary:Ve(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ve(s,{alpha:.12}),closeColorPressedPrimary:Ve(s,{alpha:.18}),borderInfo:`1px solid ${Ve(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ve(o,{alpha:.12}),colorBorderedInfo:Ve(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ve(o,{alpha:.12}),closeColorPressedInfo:Ve(o,{alpha:.18}),borderSuccess:`1px solid ${Ve(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ve(a,{alpha:.12}),colorBorderedSuccess:Ve(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ve(a,{alpha:.12}),closeColorPressedSuccess:Ve(a,{alpha:.18}),borderWarning:`1px solid ${Ve(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ve(l,{alpha:.15}),colorBorderedWarning:Ve(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ve(l,{alpha:.12}),closeColorPressedWarning:Ve(l,{alpha:.18}),borderError:`1px solid ${Ve(c,{alpha:.23})}`,textColorError:c,colorError:Ve(c,{alpha:.1}),colorBorderedError:Ve(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ve(c,{alpha:.12}),closeColorPressedError:Ve(c,{alpha:.18})})}const sv={common:ki,self:rv},ov={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},av=me("tag",`
|
|
543
|
+
`,[me("popover-arrow",e)])])])}const vu=Object.assign(Object.assign({},gt.props),{to:$n.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 Ux({arrowClass:t,arrowStyle:e,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`,t],style:e}))}const Kx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:vu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=xi(t),l=gt("Popover","-popover",Yx,xu,t,s),c=Br("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),f=i.ref(null),g=i.ref(t.show),m=i.ref(!1);i.watchEffect(()=>{const{show:v}=t;v&&!kw()&&!t.internalDeactivateImmediately&&(m.value=!0)});const u=i.computed(()=>{const{trigger:v,onClickoutside:P}=t,$=[],{positionManuallyRef:{value:A}}=h;return A||(v==="click"&&!P&&$.push([ys,R,void 0,{capture:!0}]),v==="hover"&&$.push([n1,B])),P&&$.push([ys,R,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&$.push([i.vShow,t.show]),$}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:P,cubicBezierEaseOut:$},self:{space:A,spaceArrow:F,padding:O,fontSize:L,textColor:J,dividerColor:ne,color:N,boxShadow:V,borderRadius:q,arrowHeight:X,arrowOffset:I,arrowOffsetVertical:W}}=l.value;return{"--n-box-shadow":V,"--n-bezier":v,"--n-bezier-ease-in":P,"--n-bezier-ease-out":$,"--n-font-size":L,"--n-text-color":J,"--n-color":N,"--n-divider-color":ne,"--n-border-radius":q,"--n-arrow-height":X,"--n-arrow-offset":I,"--n-arrow-offset-vertical":W,"--n-padding":O,"--n-space":A,"--n-space-arrow":F}}),b=i.computed(()=>{const v=t.width==="trigger"?void 0:aa(t.width),P=[];v&&P.push({width:v});const{maxWidth:$,minWidth:A}=t;return $&&P.push({maxWidth:aa($)}),A&&P.push({maxWidth:aa(A)}),o||P.push(p.value),P}),y=o?vi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),v=>{t.animated||(v?g.value=!0:g.value=!1)});function _(){var v;(v=d.value)===null||v===void 0||v.syncPosition()}function w(v){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter(v)}function S(v){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave(v)}function B(v){t.trigger==="hover"&&!C().contains(mr(v))&&h.handleMouseMoveOutside(v)}function R(v){(t.trigger==="click"&&!C().contains(mr(v))||t.onClickoutside)&&h.handleClickOutside(v)}function C(){return h.getTriggerElement()}i.provide(jh,f),i.provide(Hh,null),i.provide(Wh,null);function T(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let P;const $=h.internalRenderBodyRef.value,{value:A}=s;if($)P=$([`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${A}-popover-shared--overlap`,t.showArrow&&`${A}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],f,b.value,w,S);else{const{value:F}=h.extraClassRef,{internalTrapFocus:O}=t,L=!iu(e.header)||!iu(e.footer),J=()=>{var ne,N;const V=L?i.h(i.Fragment,null,_i(e.header,I=>I?i.h("div",{class:[`${A}-popover__header`,t.headerClass],style:t.headerStyle},I):null),_i(e.default,I=>I?i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e):null),_i(e.footer,I=>I?i.h("div",{class:[`${A}-popover__footer`,t.footerClass],style:t.footerStyle},I):null)):t.scrollable?(ne=e.default)===null||ne===void 0?void 0:ne.call(e):i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(Ax,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:L?void 0:`${A}-popover__content ${(N=t.contentClass)!==null&&N!==void 0?N:""}`,contentStyle:L?void 0:t.contentStyle},{default:()=>V}):V,X=t.showArrow?Ux({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:A}):null;return[q,X]};P=i.h("div",i.mergeProps({class:[`${A}-popover`,`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,F.map(ne=>`${A}-${ne}`),{[`${A}-popover--scrollable`]:t.scrollable,[`${A}-popover--show-header-or-footer`]:L,[`${A}-popover--raw`]:t.raw,[`${A}-popover-shared--overlap`]:t.overlap,[`${A}-popover-shared--show-arrow`]:t.showArrow,[`${A}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:f,style:b.value,onKeydown:h.handleKeydown,onMouseenter:w,onMouseleave:S},n),O?i.h(mw,{active:t.show,autoFocus:!0},{default:J}):J())}return i.withDirectives(P,u.value)}return{displayed:m,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:$n(t),followerEnabled:g,renderContentNode:T}},render(){return i.h(yh,{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===$n.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Gx={};const Zx=Object.keys(vu),Qx={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Jx(t,e,n){Qx[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const ev={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:$n.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},tv=Object.assign(Object.assign(Object.assign({},gt.props),ev),{internalOnAfterLeave:Function,internalRenderBody:Function}),nv=i.defineComponent({name:"Popover",inheritAttrs:!1,props:tv,slots:Object,__popover__:!0,setup(t){Gx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&Zn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&Zn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&Zn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&Zn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&Zn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=bs(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Yo(r,s),a=Xt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:L}=t;return!!(L!=null&&L())},c=()=>l()?!1:o.value,d=Zd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let f=null;const g=i.ref(null),m=i.ref(null),u=Xt(()=>t.x!==void 0&&t.y!==void 0);function p(L){const{"onUpdate:show":J,onUpdateShow:ne,onShow:N,onHide:V}=t;s.value=L,J&&ft(J,L),ne&&ft(ne,L),L&&N&&ft(N,!0),L&&V&&ft(V,!1)}function b(){f&&f.syncPosition()}function y(){const{value:L}=g;L&&(window.clearTimeout(L),g.value=null)}function _(){const{value:L}=m;L&&(window.clearTimeout(L),m.value=null)}function w(){const L=l();if(t.trigger==="focus"&&!L){if(c())return;p(!0)}}function S(){const L=l();if(t.trigger==="focus"&&!L){if(!c())return;p(!1)}}function B(){const L=l();if(t.trigger==="hover"&&!L){if(_(),g.value!==null||c())return;const J=()=>{p(!0),g.value=null},{delay:ne}=t;ne===0?J():g.value=window.setTimeout(J,ne)}}function R(){const L=l();if(t.trigger==="hover"&&!L){if(y(),m.value!==null||!c())return;const J=()=>{p(!1),m.value=null},{duration:ne}=t;ne===0?J():m.value=window.setTimeout(J,ne)}}function C(){R()}function T(L){var J;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,L))}function v(){if(t.trigger==="click"&&!l()){y(),_();const L=!c();p(L)}}function P(L){t.internalTrapFocus&&L.key==="Escape"&&(y(),_(),p(!1))}function $(L){s.value=L}function A(){var L;return(L=n.value)===null||L===void 0?void 0:L.targetRef}function F(L){f=L}return i.provide("NPopover",{getTriggerElement:A,handleKeydown:P,handleMouseEnter:B,handleMouseLeave:R,handleClickOutside:T,handleMouseMoveOutside:C,setBodyInstance:F,positionManuallyRef:u,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:u,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:$,handleClick:v,handleMouseEnter:B,handleMouseLeave:R,handleFocus:w,handleBlur:S,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=Bw(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(!((t=r.type)===null||t===void 0)&&t.__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)})}};Jx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(th,{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}}),[[Gd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(nh,null,{default:()=>r}),i.h(Kx,Tw(this.$props,Zx,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)}})]}})}}),iv={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 rv(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:g,closeIconColor:m,closeIconColorHover:u,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:w,fontSizeMedium:S,heightMini:B,heightTiny:R,heightSmall:C,heightMedium:T,closeColorHover:v,closeColorPressed:P,buttonColor2Hover:$,buttonColor2Pressed:A,fontWeightStrong:F}=t;return Object.assign(Object.assign({},iv),{closeBorderRadius:b,heightTiny:B,heightSmall:R,heightMedium:C,heightLarge:T,borderRadius:b,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:w,fontSizeLarge:S,fontWeightStrong:F,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:$,colorPressedCheckable:A,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:g,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:v,closeColorPressed:P,borderPrimary:`1px solid ${Ve(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ve(s,{alpha:.12}),colorBorderedPrimary:Ve(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ve(s,{alpha:.12}),closeColorPressedPrimary:Ve(s,{alpha:.18}),borderInfo:`1px solid ${Ve(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ve(o,{alpha:.12}),colorBorderedInfo:Ve(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ve(o,{alpha:.12}),closeColorPressedInfo:Ve(o,{alpha:.18}),borderSuccess:`1px solid ${Ve(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ve(a,{alpha:.12}),colorBorderedSuccess:Ve(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ve(a,{alpha:.12}),closeColorPressedSuccess:Ve(a,{alpha:.18}),borderWarning:`1px solid ${Ve(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ve(l,{alpha:.15}),colorBorderedWarning:Ve(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ve(l,{alpha:.12}),closeColorPressedWarning:Ve(l,{alpha:.18}),borderError:`1px solid ${Ve(c,{alpha:.23})}`,textColorError:c,colorError:Ve(c,{alpha:.1}),colorBorderedError:Ve(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ve(c,{alpha:.12}),closeColorPressedError:Ve(c,{alpha:.18})})}const sv={common:ki,self:rv},ov={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},av=me("tag",`
|
|
544
544
|
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
|
|
545
545
|
white-space: nowrap;
|
|
546
546
|
position: relative;
|
|
@@ -610,7 +610,7 @@ ${s}
|
|
|
610
610
|
`,[en("disabled",[le("&:hover","background-color: var(--n-color-hover-checkable);",[en("checked","color: var(--n-text-color-hover-checkable);")]),le("&:active","background-color: var(--n-color-pressed-checkable);",[en("checked","color: var(--n-text-color-pressed-checkable);")])]),Se("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[en("disabled",[le("&:hover","background-color: var(--n-color-checked-hover);"),le("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var lv={};const cv=Object.assign(Object.assign(Object.assign({},gt.props),ov),{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}),dv="n-tag",ba=i.defineComponent({name:"Tag",props:cv,slots:Object,setup(t){lv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&Zn("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=xi(t),a=gt("Tag","-tag",av,sv,t,r);i.provide(dv,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:m,onCheckedChange:u,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!m),b&&b(!m),u&&u(!m)}}function c(m){if(t.triggerClickOnClose||m.stopPropagation(),!t.disabled){const{onClose:u}=t;u&&ft(u,m)}}const d={setTextContent(m){const{value:u}=e;u&&(u.textContent=m)}},h=Br("Tag",o,r),f=i.computed(()=>{const{type:m,size:u,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:
|
|
613
|
+
`,[en("disabled",[le("&:hover","background-color: var(--n-color-checked-hover);"),le("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var lv={};const cv=Object.assign(Object.assign(Object.assign({},gt.props),ov),{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}),dv="n-tag",ba=i.defineComponent({name:"Tag",props:cv,slots:Object,setup(t){lv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&Zn("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=xi(t),a=gt("Tag","-tag",av,sv,t,r);i.provide(dv,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:m,onCheckedChange:u,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!m),b&&b(!m),u&&u(!m)}}function c(m){if(t.triggerClickOnClose||m.stopPropagation(),!t.disabled){const{onClose:u}=t;u&&ft(u,m)}}const d={setTextContent(m){const{value:u}=e;u&&(u.textContent=m)}},h=Br("Tag",o,r),f=i.computed(()=>{const{type:m,size:u,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:w,borderRadius:S,opacityDisabled:B,textColorCheckable:R,textColorHoverCheckable:C,textColorPressedCheckable:T,textColorChecked:v,colorCheckable:P,colorHoverCheckable:$,colorPressedCheckable:A,colorChecked:F,colorCheckedHover:O,colorCheckedPressed:L,closeBorderRadius:J,fontWeightStrong:ne,[Ue("colorBordered",m)]:N,[Ue("closeSize",u)]:V,[Ue("closeIconSize",u)]:q,[Ue("fontSize",u)]:X,[Ue("height",u)]:I,[Ue("color",m)]:W,[Ue("textColor",m)]:H,[Ue("border",m)]:U,[Ue("closeIconColor",m)]:fe,[Ue("closeIconColorHover",m)]:oe,[Ue("closeIconColorPressed",m)]:re,[Ue("closeColorHover",m)]:Ne,[Ue("closeColorPressed",m)]:Le}}=a.value,Fe=Jt(w);return{"--n-font-weight-strong":ne,"--n-avatar-size-override":`calc(${I} - 8px)`,"--n-bezier":y,"--n-border-radius":S,"--n-border":U,"--n-close-icon-size":q,"--n-close-color-pressed":Le,"--n-close-color-hover":Ne,"--n-close-border-radius":J,"--n-close-icon-color":fe,"--n-close-icon-color-hover":oe,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":fe,"--n-close-margin-top":Fe.top,"--n-close-margin-right":Fe.right,"--n-close-margin-bottom":Fe.bottom,"--n-close-margin-left":Fe.left,"--n-close-size":V,"--n-color":p||(n.value?N:W),"--n-color-checkable":P,"--n-color-checked":F,"--n-color-checked-hover":O,"--n-color-checked-pressed":L,"--n-color-hover-checkable":$,"--n-color-pressed-checkable":A,"--n-font-size":X,"--n-height":I,"--n-opacity-disabled":B,"--n-padding":_,"--n-text-color":b||H,"--n-text-color-checkable":R,"--n-text-color-checked":v,"--n-text-color-hover-checkable":C,"--n-text-color-pressed-checkable":T}}),g=s?vi("tag",i.computed(()=>{let m="";const{type:u,size:p,color:{color:b,textColor:y}={}}=t;return m+=u[0],m+=p[0],b&&(m+=`a${Yh(b)}`),y&&(m+=`b${Yh(y)}`),n.value&&(m+="c"),m}),f,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:f,themeClass:g==null?void 0:g.themeClass,onRender:g==null?void 0:g.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=_i(c.avatar,f=>f&&i.h("div",{class:`${n}-tag__avatar`},f)),h=_i(c.icon,f=>f&&i.h("div",{class:`${n}-tag__icon`},f));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"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&s?i.h(kx,{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)}}),hv=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(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(cu,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(xx,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(Rr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>ha(e.default,()=>[i.h(mx,null)])})}):null})}}}),uv={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function fv(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:f,borderColor:g,iconColor:m,iconColorDisabled:u,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:w,fontSizeTiny:S,fontSizeSmall:B,fontSizeMedium:R,fontSizeLarge:C,heightTiny:T,heightSmall:v,heightMedium:P,heightLarge:$,fontWeight:A}=t;return Object.assign(Object.assign({},uv),{fontSizeTiny:S,fontSizeSmall:B,fontSizeMedium:R,fontSizeLarge:C,heightTiny:T,heightSmall:v,heightMedium:P,heightLarge:$,borderRadius:e,fontWeight:A,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:w,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${g}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Ve(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Ve(a,{alpha:.2})}`,caretColor:a,arrowColor:m,arrowColorDisabled:u,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 ${Ve(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Ve(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Ve(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:p,clearColorHover:b,clearColorPressed:y})}const ku={name:"InternalSelection",common:ki,peers:{Popover:xu},self:fv},gv=le([me("base-selection",`
|
|
614
614
|
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
|
|
615
615
|
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
|
|
616
616
|
position: relative;
|
|
@@ -810,7 +810,7 @@ ${s}
|
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),mv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},gt.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(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=xi(t),r=Br("InternalSelection",n,e),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),f=i.ref(null),g=i.ref(null),m=i.ref(null),u=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=gt("InternalSelection","-internal-selection",gv,ku,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),v=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Ji(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),B=i.computed(()=>{const K=t.selectedOption;if(K)return K[t.labelField]}),S=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function R(){var K;const{value:se}=s;if(se){const{value:Ie}=o;Ie&&(Ie.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((K=g.value)===null||K===void 0||K.sync({showAllItemsBeforeCalculate:!1})))}}function C(){const{value:K}=m;K&&(K.style.display="none")}function T(){const{value:K}=m;K&&(K.style.display="inline-block")}i.watch(i.toRef(t,"active"),K=>{K||C()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(R)});function x(K){const{onFocus:se}=t;se&&se(K)}function P(K){const{onBlur:se}=t;se&&se(K)}function $(K){const{onDeleteOption:se}=t;se&&se(K)}function A(K){const{onClear:se}=t;se&&se(K)}function F(K){const{onPatternInput:se}=t;se&&se(K)}function O(K){var se;(!K.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)))&&x(K)}function L(K){var se;!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)||P(K)}function J(K){A(K)}function ne(){b.value=!0}function N(){b.value=!1}function V(K){!t.active||!t.filterable||K.target!==o.value&&K.preventDefault()}function q(K){$(K)}const X=i.ref(!1);function I(K){if(K.key==="Backspace"&&!X.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let W=null;function H(K){const{value:se}=s;if(se){const Ie=K.target.value;se.textContent=Ie,R()}t.ignoreComposition&&X.value?W=K:F(K)}function U(){X.value=!0}function fe(){X.value=!1,t.ignoreComposition&&F(W),W=null}function oe(K){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,K)}function re(K){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,K)}function Ne(){var K,se;if(t.filterable)p.value=!1,(K=d.value)===null||K===void 0||K.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ie}=l;Ie==null||Ie.blur()}else{const{value:Ie}=c;Ie==null||Ie.blur()}}function Le(){var K,se,Ie;t.filterable?(p.value=!1,(K=d.value)===null||K===void 0||K.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ie=c.value)===null||Ie===void 0||Ie.focus()}function Fe(){const{value:K}=o;K&&(T(),K.focus())}function Ut(){const{value:K}=o;K&&K.blur()}function Te(K){const{value:se}=h;se&&se.setTextContent(`+${K}`)}function rn(){const{value:K}=f;return K}function sn(){return o.value}let Tt=null;function Ot(){Tt!==null&&window.clearTimeout(Tt)}function on(){t.active||(Ot(),Tt=window.setTimeout(()=>{S.value&&(u.value=!0)},100))}function bt(){Ot()}function zn(K){K||(Ot(),u.value=!1)}i.watch(S,K=>{K||(u.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const K=d.value;K&&(t.disabled?K.removeAttribute("tabindex"):K.tabIndex=p.value?-1:0)})}),Xh(a,t.onResize);const{inlineThemeDisabled:an}=t,Kt=i.computed(()=>{const{size:K}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ie,borderRadius:Jn,color:Qe,placeholderColor:zt,textColor:er,paddingSingle:ei,paddingMultiple:Ti,caretColor:tr,colorDisabled:ln,textColorDisabled:Ln,placeholderColorDisabled:E,colorActive:j,boxShadowFocus:ie,boxShadowActive:ce,boxShadowHover:de,border:ye,borderFocus:we,borderHover:ve,borderActive:Xe,arrowColor:Cn,arrowColorDisabled:ka,loadingColor:Ca,colorActiveWarning:Sa,boxShadowFocusWarning:Ba,boxShadowActiveWarning:Ta,boxShadowHoverWarning:Ra,borderWarning:Pa,borderFocusWarning:$a,borderHoverWarning:Ea,borderActiveWarning:Na,colorActiveError:Fa,boxShadowFocusError:Aa,boxShadowActiveError:Ma,boxShadowHoverError:Va,borderError:Ia,borderFocusError:Oa,borderHoverError:za,borderActiveError:eC,clearColor:tC,clearColorHover:nC,clearColorPressed:iC,clearSize:rC,arrowSize:sC,[Ue("height",K)]:oC,[Ue("fontSize",K)]:aC}}=y.value,As=Jt(ei),Ms=Jt(Ti);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Xe,"--n-border-focus":we,"--n-border-hover":ve,"--n-border-radius":Jn,"--n-box-shadow-active":ce,"--n-box-shadow-focus":ie,"--n-box-shadow-hover":de,"--n-caret-color":tr,"--n-color":Qe,"--n-color-active":j,"--n-color-disabled":ln,"--n-font-size":aC,"--n-height":oC,"--n-padding-single-top":As.top,"--n-padding-multiple-top":Ms.top,"--n-padding-single-right":As.right,"--n-padding-multiple-right":Ms.right,"--n-padding-single-left":As.left,"--n-padding-multiple-left":Ms.left,"--n-padding-single-bottom":As.bottom,"--n-padding-multiple-bottom":Ms.bottom,"--n-placeholder-color":zt,"--n-placeholder-color-disabled":E,"--n-text-color":er,"--n-text-color-disabled":Ln,"--n-arrow-color":Cn,"--n-arrow-color-disabled":ka,"--n-loading-color":Ca,"--n-color-active-warning":Sa,"--n-box-shadow-focus-warning":Ba,"--n-box-shadow-active-warning":Ta,"--n-box-shadow-hover-warning":Ra,"--n-border-warning":Pa,"--n-border-focus-warning":$a,"--n-border-hover-warning":Ea,"--n-border-active-warning":Na,"--n-color-active-error":Fa,"--n-box-shadow-focus-error":Aa,"--n-box-shadow-active-error":Ma,"--n-box-shadow-hover-error":Va,"--n-border-error":Ia,"--n-border-focus-error":Oa,"--n-border-hover-error":za,"--n-border-active-error":eC,"--n-clear-size":rC,"--n-clear-color":tC,"--n-clear-color-hover":nC,"--n-clear-color-pressed":iC,"--n-arrow-size":sC,"--n-font-weight":Ie}}),Pe=an?vi("internal-selection",i.computed(()=>t.size[0]),Kt,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:v,label:B,selected:S,showTagsPanel:u,isComposing:X,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:g,inputTagElRef:m,handleMouseDown:V,handleFocusin:O,handleClear:J,handleMouseEnter:ne,handleMouseLeave:N,handleDeleteOption:q,handlePatternKeyDown:I,handlePatternInputInput:H,handlePatternInputBlur:re,handlePatternInputFocus:oe,handleMouseEnterCounter:on,handleMouseLeaveCounter:bt,handleFocusout:L,handleCompositionEnd:fe,handleCompositionStart:U,onPopoverUpdateShow:zn,focus:Le,focusInput:Fe,blur:Ne,blurInput:Ut,updateCounter:Te,getCounter:rn,getTail:sn,renderLabel:t.renderLabel,cssVars:an?void 0:Kt,themeClass:Pe==null?void 0:Pe.themeClass,onRender:Pe==null?void 0:Pe.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const g=o==="responsive",m=typeof o=="number",u=g||m,p=i.h(ua,null,{default:()=>i.h(hv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=F=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:F.value},h?h({option:F,handleClose:()=>{this.handleDeleteOption(F)}}):i.h(ba,{size:n,closable:!F.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(F)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(F,!0):Ji(F[y],F,!0)})),v=()=>(m?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),B=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,S=g?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(ba,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(m){const F=this.selectedOptions.length-o;F>0&&(R=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(ba,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${F}`})))}const C=g?s?i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:S,tail:()=>B}):i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:S}):m&&R?v().concat(R):v(),T=u?()=>i.h("div",{class:`${l}-base-selection-popover`},g?v():this.selectedOptions.map(_)):void 0,x=u?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,$=(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,A=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},C,g?null:B,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},C,p);b=i.h(i.Fragment,null,u?i.h(nv,Object.assign({},x,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>A,default:T}):A,$)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,v=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Jh(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})),v?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:()=>{}}):f?f(this.selectedOption,!0):Ji(this.label,this.selectedOption,!0))):null,_?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,p)}else b=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:Jh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Ji(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)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-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},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function pv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const yv={name:"Select",common:ki,peers:{InternalSelection:ku,InternalSelectMenu:mu},self:pv},bv=le([me("select",`
|
|
813
|
+
`)])])]),mv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},gt.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(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=xi(t),r=Br("InternalSelection",n,e),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),f=i.ref(null),g=i.ref(null),m=i.ref(null),u=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=gt("InternalSelection","-internal-selection",gv,ku,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),w=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Ji(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),S=i.computed(()=>{const K=t.selectedOption;if(K)return K[t.labelField]}),B=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function R(){var K;const{value:se}=s;if(se){const{value:Ie}=o;Ie&&(Ie.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((K=g.value)===null||K===void 0||K.sync({showAllItemsBeforeCalculate:!1})))}}function C(){const{value:K}=m;K&&(K.style.display="none")}function T(){const{value:K}=m;K&&(K.style.display="inline-block")}i.watch(i.toRef(t,"active"),K=>{K||C()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(R)});function v(K){const{onFocus:se}=t;se&&se(K)}function P(K){const{onBlur:se}=t;se&&se(K)}function $(K){const{onDeleteOption:se}=t;se&&se(K)}function A(K){const{onClear:se}=t;se&&se(K)}function F(K){const{onPatternInput:se}=t;se&&se(K)}function O(K){var se;(!K.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)))&&v(K)}function L(K){var se;!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)||P(K)}function J(K){A(K)}function ne(){b.value=!0}function N(){b.value=!1}function V(K){!t.active||!t.filterable||K.target!==o.value&&K.preventDefault()}function q(K){$(K)}const X=i.ref(!1);function I(K){if(K.key==="Backspace"&&!X.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let W=null;function H(K){const{value:se}=s;if(se){const Ie=K.target.value;se.textContent=Ie,R()}t.ignoreComposition&&X.value?W=K:F(K)}function U(){X.value=!0}function fe(){X.value=!1,t.ignoreComposition&&F(W),W=null}function oe(K){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,K)}function re(K){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,K)}function Ne(){var K,se;if(t.filterable)p.value=!1,(K=d.value)===null||K===void 0||K.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ie}=l;Ie==null||Ie.blur()}else{const{value:Ie}=c;Ie==null||Ie.blur()}}function Le(){var K,se,Ie;t.filterable?(p.value=!1,(K=d.value)===null||K===void 0||K.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ie=c.value)===null||Ie===void 0||Ie.focus()}function Fe(){const{value:K}=o;K&&(T(),K.focus())}function Ut(){const{value:K}=o;K&&K.blur()}function Te(K){const{value:se}=h;se&&se.setTextContent(`+${K}`)}function rn(){const{value:K}=f;return K}function sn(){return o.value}let Tt=null;function Ot(){Tt!==null&&window.clearTimeout(Tt)}function on(){t.active||(Ot(),Tt=window.setTimeout(()=>{B.value&&(u.value=!0)},100))}function bt(){Ot()}function zn(K){K||(Ot(),u.value=!1)}i.watch(B,K=>{K||(u.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const K=d.value;K&&(t.disabled?K.removeAttribute("tabindex"):K.tabIndex=p.value?-1:0)})}),Xh(a,t.onResize);const{inlineThemeDisabled:an}=t,Kt=i.computed(()=>{const{size:K}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ie,borderRadius:Jn,color:Qe,placeholderColor:zt,textColor:er,paddingSingle:ei,paddingMultiple:Ti,caretColor:tr,colorDisabled:ln,textColorDisabled:Ln,placeholderColorDisabled:E,colorActive:j,boxShadowFocus:ie,boxShadowActive:ce,boxShadowHover:de,border:ye,borderFocus:we,borderHover:ve,borderActive:Xe,arrowColor:Cn,arrowColorDisabled:ka,loadingColor:Ca,colorActiveWarning:Sa,boxShadowFocusWarning:Ba,boxShadowActiveWarning:Ta,boxShadowHoverWarning:Ra,borderWarning:Pa,borderFocusWarning:$a,borderHoverWarning:Ea,borderActiveWarning:Na,colorActiveError:Fa,boxShadowFocusError:Aa,boxShadowActiveError:Ma,boxShadowHoverError:Va,borderError:Ia,borderFocusError:Oa,borderHoverError:za,borderActiveError:eC,clearColor:tC,clearColorHover:nC,clearColorPressed:iC,clearSize:rC,arrowSize:sC,[Ue("height",K)]:oC,[Ue("fontSize",K)]:aC}}=y.value,As=Jt(ei),Ms=Jt(Ti);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Xe,"--n-border-focus":we,"--n-border-hover":ve,"--n-border-radius":Jn,"--n-box-shadow-active":ce,"--n-box-shadow-focus":ie,"--n-box-shadow-hover":de,"--n-caret-color":tr,"--n-color":Qe,"--n-color-active":j,"--n-color-disabled":ln,"--n-font-size":aC,"--n-height":oC,"--n-padding-single-top":As.top,"--n-padding-multiple-top":Ms.top,"--n-padding-single-right":As.right,"--n-padding-multiple-right":Ms.right,"--n-padding-single-left":As.left,"--n-padding-multiple-left":Ms.left,"--n-padding-single-bottom":As.bottom,"--n-padding-multiple-bottom":Ms.bottom,"--n-placeholder-color":zt,"--n-placeholder-color-disabled":E,"--n-text-color":er,"--n-text-color-disabled":Ln,"--n-arrow-color":Cn,"--n-arrow-color-disabled":ka,"--n-loading-color":Ca,"--n-color-active-warning":Sa,"--n-box-shadow-focus-warning":Ba,"--n-box-shadow-active-warning":Ta,"--n-box-shadow-hover-warning":Ra,"--n-border-warning":Pa,"--n-border-focus-warning":$a,"--n-border-hover-warning":Ea,"--n-border-active-warning":Na,"--n-color-active-error":Fa,"--n-box-shadow-focus-error":Aa,"--n-box-shadow-active-error":Ma,"--n-box-shadow-hover-error":Va,"--n-border-error":Ia,"--n-border-focus-error":Oa,"--n-border-hover-error":za,"--n-border-active-error":eC,"--n-clear-size":rC,"--n-clear-color":tC,"--n-clear-color-hover":nC,"--n-clear-color-pressed":iC,"--n-arrow-size":sC,"--n-font-weight":Ie}}),Pe=an?vi("internal-selection",i.computed(()=>t.size[0]),Kt,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:w,label:S,selected:B,showTagsPanel:u,isComposing:X,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:g,inputTagElRef:m,handleMouseDown:V,handleFocusin:O,handleClear:J,handleMouseEnter:ne,handleMouseLeave:N,handleDeleteOption:q,handlePatternKeyDown:I,handlePatternInputInput:H,handlePatternInputBlur:re,handlePatternInputFocus:oe,handleMouseEnterCounter:on,handleMouseLeaveCounter:bt,handleFocusout:L,handleCompositionEnd:fe,handleCompositionStart:U,onPopoverUpdateShow:zn,focus:Le,focusInput:Fe,blur:Ne,blurInput:Ut,updateCounter:Te,getCounter:rn,getTail:sn,renderLabel:t.renderLabel,cssVars:an?void 0:Kt,themeClass:Pe==null?void 0:Pe.themeClass,onRender:Pe==null?void 0:Pe.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const g=o==="responsive",m=typeof o=="number",u=g||m,p=i.h(ua,null,{default:()=>i.h(hv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=F=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:F.value},h?h({option:F,handleClose:()=>{this.handleDeleteOption(F)}}):i.h(ba,{size:n,closable:!F.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(F)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(F,!0):Ji(F[y],F,!0)})),w=()=>(m?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),S=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,B=g?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(ba,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(m){const F=this.selectedOptions.length-o;F>0&&(R=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(ba,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${F}`})))}const C=g?s?i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:w,counter:B,tail:()=>S}):i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:w,counter:B}):m&&R?w().concat(R):w(),T=u?()=>i.h("div",{class:`${l}-base-selection-popover`},g?w():this.selectedOptions.map(_)):void 0,v=u?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,$=(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,A=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},C,g?null:S,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},C,p);b=i.h(i.Fragment,null,u?i.h(nv,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>A,default:T}):A,$)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,w=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Jh(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})),w?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:()=>{}}):f?f(this.selectedOption,!0):Ji(this.label,this.selectedOption,!0))):null,_?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,p)}else b=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:Jh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Ji(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)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-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},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function pv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const yv={name:"Select",common:ki,peers:{InternalSelection:ku,InternalSelectMenu:mu},self:pv},bv=le([me("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,5 +819,5 @@ ${s}
|
|
|
819
819
|
`),me("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[wu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Es(t){return t.type==="group"}function Cu(t){return t.type==="ignored"}function _a(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function _v(t,e){return{getIsGroup:Es,getIgnored:Cu,getKey(r){return Es(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function wv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Es(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Cu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function xv(t,e,n){const r=new Map;return t.forEach(s=>{Es(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var vv={};const kv=Object.assign(Object.assign({},gt.props),{to:$n.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}),Cv=i.defineComponent({name:"Select",props:kv,slots:Object,setup(t){vv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&Zn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&Zn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=xi(t),o=gt("Select","-select",bv,yv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Yo(l,a),d=i.ref(!1),h=i.ref(""),f=Zd(t,["items","options"]),g=i.ref([]),m=i.ref([]),u=i.computed(()=>m.value.concat(g.value).concat(f.value)),p=i.computed(()=>{const{filter:E}=t;if(E)return E;const{labelField:j,valueField:ie}=t;return(ce,de)=>{if(!de)return!1;const ye=de[j];if(typeof ye=="string")return _a(ce,ye);const we=de[ie];return typeof we=="string"?_a(ce,we):typeof we=="number"?_a(ce,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return f.value;{const{value:E}=u,{value:j}=h;return!j.length||!t.filterable?E:wv(E,p.value,j,t.childrenField)}}),y=i.computed(()=>{const{valueField:E,childrenField:j}=t,ie=_v(E,j);return G_(b.value,ie)}),_=i.computed(()=>xv(u.value,t.valueField,t.childrenField)),v=i.ref(!1),B=Yo(i.toRef(t,"show"),v),S=i.ref(null),R=i.ref(null),C=i.ref(null),{localeRef:T}=su("Select"),x=i.computed(()=>{var E;return(E=t.placeholder)!==null&&E!==void 0?E:T.value.placeholder}),P=[],$=i.ref(new Map),A=i.computed(()=>{const{fallbackOption:E}=t;if(E===void 0){const{labelField:j,valueField:ie}=t;return ce=>({[j]:String(ce),[ie]:ce})}return E===!1?!1:j=>Object.assign(E(j),{value:j})});function F(E){const j=t.remote,{value:ie}=$,{value:ce}=_,{value:de}=A,ye=[];return E.forEach(we=>{if(ce.has(we))ye.push(ce.get(we));else if(j&&ie.has(we))ye.push(ie.get(we));else if(de){const ve=de(we);ve&&ye.push(ve)}}),ye}const O=i.computed(()=>{if(t.multiple){const{value:E}=c;return Array.isArray(E)?F(E):[]}return null}),L=i.computed(()=>{const{value:E}=c;return!t.multiple&&!Array.isArray(E)?E===null?null:F([E])[0]||null:null}),J=Pw(t),{mergedSizeRef:ne,mergedDisabledRef:N,mergedStatusRef:V}=J;function q(E,j){const{onChange:ie,"onUpdate:value":ce,onUpdateValue:de}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=J;ie&&ft(ie,E,j),de&&ft(de,E,j),ce&&ft(ce,E,j),a.value=E,ye(),we()}function X(E){const{onBlur:j}=t,{nTriggerFormBlur:ie}=J;j&&ft(j,E),ie()}function I(){const{onClear:E}=t;E&&ft(E)}function W(E){const{onFocus:j,showOnFocus:ie}=t,{nTriggerFormFocus:ce}=J;j&&ft(j,E),ce(),ie&&re()}function H(E){const{onSearch:j}=t;j&&ft(j,E)}function U(E){const{onScroll:j}=t;j&&ft(j,E)}function fe(){var E;const{remote:j,multiple:ie}=t;if(j){const{value:ce}=$;if(ie){const{valueField:de}=t;(E=O.value)===null||E===void 0||E.forEach(ye=>{ce.set(ye[de],ye)})}else{const de=L.value;de&&ce.set(de[t.valueField],de)}}}function oe(E){const{onUpdateShow:j,"onUpdate:show":ie}=t;j&&ft(j,E),ie&&ft(ie,E),v.value=E}function re(){N.value||(oe(!0),v.value=!0,t.filterable&&ei())}function Ne(){oe(!1)}function Le(){h.value="",m.value=P}const Fe=i.ref(!1);function Ut(){t.filterable&&(Fe.value=!0)}function Te(){t.filterable&&(Fe.value=!1,B.value||Le())}function rn(){N.value||(B.value?t.filterable?ei():Ne():re())}function sn(E){var j,ie;!((ie=(j=C.value)===null||j===void 0?void 0:j.selfRef)===null||ie===void 0)&&ie.contains(E.relatedTarget)||(d.value=!1,X(E),Ne())}function Tt(E){W(E),d.value=!0}function Ot(){d.value=!0}function on(E){var j;!((j=S.value)===null||j===void 0)&&j.$el.contains(E.relatedTarget)||(d.value=!1,X(E),Ne())}function bt(){var E;(E=S.value)===null||E===void 0||E.focus(),Ne()}function zn(E){var j;B.value&&(!((j=S.value)===null||j===void 0)&&j.$el.contains(mr(E))||Ne())}function an(E){if(!Array.isArray(E))return[];if(A.value)return Array.from(E);{const{remote:j}=t,{value:ie}=_;if(j){const{value:ce}=$;return E.filter(de=>ie.has(de)||ce.has(de))}else return E.filter(ce=>ie.has(ce))}}function Kt(E){Pe(E.rawNode)}function Pe(E){if(N.value)return;const{tag:j,remote:ie,clearFilterAfterSelect:ce,valueField:de}=t;if(j&&!ie){const{value:ye}=m,we=ye[0]||null;if(we){const ve=g.value;ve.length?ve.push(we):g.value=[we],m.value=P}}if(ie&&$.value.set(E[de],E),t.multiple){const ye=an(c.value),we=ye.findIndex(ve=>ve===E[de]);if(~we){if(ye.splice(we,1),j&&!ie){const ve=K(E[de]);~ve&&(g.value.splice(ve,1),ce&&(h.value=""))}}else ye.push(E[de]),ce&&(h.value="");q(ye,F(ye))}else{if(j&&!ie){const ye=K(E[de]);~ye?g.value=[g.value[ye]]:g.value=P}er(),Ne(),q(E[de],E)}}function K(E){return g.value.findIndex(ie=>ie[t.valueField]===E)}function se(E){B.value||re();const{value:j}=E.target;h.value=j;const{tag:ie,remote:ce}=t;if(H(j),ie&&!ce){if(!j){m.value=P;return}const{onCreate:de}=t,ye=de?de(j):{[t.labelField]:j,[t.valueField]:j},{valueField:we,labelField:ve}=t;f.value.some(Xe=>Xe[we]===ye[we]||Xe[ve]===ye[ve])||g.value.some(Xe=>Xe[we]===ye[we]||Xe[ve]===ye[ve])?m.value=P:m.value=[ye]}}function Ie(E){E.stopPropagation();const{multiple:j}=t;!j&&t.filterable&&Ne(),I(),j?q([],[]):q(null,null)}function Jn(E){!gr(E,"action")&&!gr(E,"empty")&&!gr(E,"header")&&E.preventDefault()}function Qe(E){U(E)}function zt(E){var j,ie,ce,de,ye;if(!t.keyboard){E.preventDefault();return}switch(E.key){case" ":if(t.filterable)break;E.preventDefault();case"Enter":if(!(!((j=S.value)===null||j===void 0)&&j.isComposing)){if(B.value){const we=(ie=C.value)===null||ie===void 0?void 0:ie.getPendingTmNode();we?Kt(we):t.filterable||(Ne(),er())}else if(re(),t.tag&&Fe.value){const we=m.value[0];if(we){const ve=we[t.valueField],{value:Xe}=c;t.multiple&&Array.isArray(Xe)&&Xe.includes(ve)||Pe(we)}}}E.preventDefault();break;case"ArrowUp":if(E.preventDefault(),t.loading)return;B.value&&((ce=C.value)===null||ce===void 0||ce.prev());break;case"ArrowDown":if(E.preventDefault(),t.loading)return;B.value?(de=C.value)===null||de===void 0||de.next():re();break;case"Escape":B.value&&(Sw(E),Ne()),(ye=S.value)===null||ye===void 0||ye.focus();break}}function er(){var E;(E=S.value)===null||E===void 0||E.focus()}function ei(){var E;(E=S.value)===null||E===void 0||E.focusInput()}function Ti(){var E;B.value&&((E=R.value)===null||E===void 0||E.syncPosition())}fe(),i.watch(i.toRef(t,"options"),fe);const tr={focus:()=>{var E;(E=S.value)===null||E===void 0||E.focus()},focusInput:()=>{var E;(E=S.value)===null||E===void 0||E.focusInput()},blur:()=>{var E;(E=S.value)===null||E===void 0||E.blur()},blurInput:()=>{var E;(E=S.value)===null||E===void 0||E.blurInput()}},ln=i.computed(()=>{const{self:{menuBoxShadow:E}}=o.value;return{"--n-menu-box-shadow":E}}),Ln=s?vi("select",void 0,ln,t):void 0;return Object.assign(Object.assign({},tr),{mergedStatus:V,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:bs(),triggerRef:S,menuRef:C,pattern:h,uncontrolledShow:v,mergedShow:B,adjustedTo:$n(t),uncontrolledValue:a,mergedValue:c,followerRef:R,localizedPlaceholder:x,selectedOption:L,selectedOptions:O,mergedSize:ne,mergedDisabled:N,focused:d,activeWithoutMenuOpen:Fe,inlineThemeDisabled:s,onTriggerInputFocus:Ut,onTriggerInputBlur:Te,handleTriggerOrMenuResize:Ti,handleMenuFocus:Ot,handleMenuBlur:on,handleMenuTabOut:bt,handleTriggerClick:rn,handleToggle:Kt,handleDeleteOption:Pe,handlePatternInput:se,handleClear:Ie,handleTriggerBlur:sn,handleTriggerFocus:Tt,handleKeydown:zt,handleMenuAfterLeave:Le,handleMenuClickOutside:zn,handleMenuScroll:Qe,handleMenuKeydown:zt,handleMenuMousedown:Jn,mergedTheme:o,cssVars:s?void 0:ln,themeClass:Ln==null?void 0:Ln.themeClass,onRender:Ln==null?void 0:Ln.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(th,null,{default:()=>[i.h(nh,null,{default:()=>i.h(mv,{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 t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(yh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===$n.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 t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(jx,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.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],[ys,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ys,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Sv={},Su=i.defineComponent({...Sv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.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(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(v=>{if(M.isEmpty(v))return;const B=o.value?r.value:r.value?[r.value]:[],S=v.filter(R=>!B.some(C=>C.id===R.id));l.value=r.optionsListConverter([...B,...S])}).finally(()=>{d.value=!1}))};let g="";const m=M.debounce(()=>f(g),800),u=_=>{g=_,m()},p=_=>{var v;if(M.isArray(_)){const B=_.length>0?_.map(S=>{var R;return i.toRaw((R=l.value.find(C=>C.value===S))==null?void 0:R.item)}):[];s("update:value",B)}else if(_>0){const B=i.toRaw((v=l.value.find(S=>S.value===_))==null?void 0:v.item);s("update:value",B)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,v)=>(i.openBlock(),i.createBlock(i.unref(Cv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:u,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),Bv={},Bu=i.defineComponent({...Bv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?Q.HttpRequester.getInstance(Q.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?Q.HttpRequester.getInstance(Q.ProductDataProvider).publicSimpleSearch(f):new Promise(g=>{g([])}),l=f=>r.searchType==="categories"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,g=>g!=null&&g.isNewRec()?"-":g.name):r.searchType==="products"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,g=>g!=null&&g.isNewRec()?"-":`[${g.code}] ${g.name}`):[],c=(f,g)=>{if(r.renderLabel)return r.renderLabel(f,g);if(r.searchType==="products"){const m=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},m.code),i.h("span",{},[m.name])])}if(r.searchType==="categories"){const m=f.item;return i.h("div",{},[m.name])}};return e({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(Su,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":g[0]||(g[0]=m=>s("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Tv={class:"col-span-2 flex flex-row gap-2.5"},Rv={class:"flex-1"},Pv={class:"text-sc-grey"},$v={class:"ml-2.5"},Ev={key:0,class:"flex-none"},Nv={},Fv=i.defineComponent({...Nv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(g=>i.toRaw(g)),...(M.isArray(f)?f:[f]).filter(g=>!a.value.some(m=>m.id===g.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(g=>g.id===f.id?f:i.toRaw(g)),l())},h=f=>{a.value=a.value.filter(g=>g.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,g)=>{const m=z.NListItem,u=l_,p=z.NButton,b=z.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Bu,{value:s.value,"onUpdate:value":[g[0]||(g[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(m,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...g[1]||(g[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(m,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(y)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Tv,[i.createElementVNode("span",Rv,[i.createElementVNode("span",Pv,i.toDisplayString(y.code),1),i.createElementVNode("span",$v,i.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Ev,[i.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Av={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mv(t,e){return i.openBlock(),i.createElementBlock("svg",Av,[...e[0]||(e[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 Vv=i.markRaw({name:"tabler-truck-filled",render:Mv}),Iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ov(t,e){return i.openBlock(),i.createElementBlock("svg",Iv,[...e[0]||(e[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 zv=i.markRaw({name:"tabler-truck-delivery",render:Ov}),Lv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Dv(t,e){return i.openBlock(),i.createElementBlock("svg",Lv,[...e[0]||(e[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 Hv=i.markRaw({name:"tabler-truck-loading",render:Dv}),Wv={class:"flex flex-col gap-1"},jv={key:0,class:"flex flex-row gap-1 text-base"},qv={key:1,class:"text-sc-dark-grey text-sm"},Xv={class:"text-sc-grey mr-1.5"},Yv={key:0},Uv={key:1},Kv={key:2},Gv={},Ns=i.defineComponent({...Gv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=Q.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Dn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,f,g,m,u,p,b;const a=Hv,l=zv,c=Vv;return i.openBlock(),i.createElementBlock("div",Wv,[t.showType?(i.openBlock(),i.createElementBlock("span",jv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((g=e.value)==null?void 0:g.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",qv,[i.createElementVNode("span",Xv,i.toDisplayString(n.value),1),(u=(m=t.delivery)==null?void 0:m.address)!=null&&u.address?(i.openBlock(),i.createElementBlock("span",Yv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",Uv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Kv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Zv={class:"flex flex-col gap-2.5"},Qv={class:"text-base"},Jv=["href"],ek={class:"text-sc-grey"},tk={},Tu=i.defineComponent({...tk,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ge.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ge.Status)?(c=(l=Q.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Ge.CreatedAt)),o=i.computed(()=>e.fields.includes(Ge.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ge.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Zv,[i.createElementVNode("span",Qv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Jv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Io,{date:t.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(" - ",-1)),i.createElementVNode("span",ek,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(hs,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ns,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),nk={},Ru=i.defineComponent({...nk,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Q.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.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)}}}),ik={class:"flex flex-row gap-1.5"},rk={class:"flex-none text-nowrap"},sk={class:"flex flex-1 flex-col"},ok={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},ak={key:0},lk={key:1},ck={},Pu=i.defineComponent({...ck,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",ik,[i.createElementVNode("span",rk,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",sk,[i.createVNode(or,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",ok,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",ak,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",lk,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)])])]))}}),dk={},hk=i.defineComponent({...dk,__name:"order-items-list",props:{order:{}},setup(t){const e=()=>{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(or,{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(wt.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Pu,{product:o,index:a})}];case Ye.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=z.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:t.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),$u=si(hk,[["__scopeId","data-v-b15b9b70"]]),uk={class:"text-base"},fk={},wa=i.defineComponent({...fk,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",uk,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))}}),gk={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},mk={class:"col-span-2"},pk={class:"col-span-2"},yk={class:"btn btn-primary",href:"{{ invoice }}"},bk={},Eu=i.defineComponent({...bk,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",gk,[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(wa,{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(hs,{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(Nd,{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",mk,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(Ru,{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(Ns,{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",pk,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(wa,{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",yk," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),_k={key:0},wk={class:"text-sc-dark-grey my-2 text-center"},xk={key:1,class:"text-sc-dark-grey my-2 text-center"},vk={key:2},kk={class:"text-sc-dark-grey mt-4 text-right font-bold"},Ck={class:"text-sc-primary"},Sk={},Nu=i.defineComponent({...Sk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new Q.Order(e.order)),s=()=>{n.value=!0,Q.HttpRequester.getInstance(Q.OrdersDataProvider).getOrder(e.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=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",_k,[i.createElementVNode("div",wk,[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",xk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",vk,[i.createVNode($u,{order:r.value},null,8,["order"]),i.createElementVNode("div",kk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Ck,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Eu,{order:r.value},null,8,["order"])]))}}}),Bk={},Tk=i.defineComponent({...Bk,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Q.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ge.CreatedAt,Ge.Id,Ge.DeliveryInfo,Ge.Status,Ge.SalesDirections,Ge.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:M.constant(!0),renderExpand:v=>i.h(Nu,{order:v,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ge.CreatedAt,resizable:!0,minWidth:100,render:v=>i.h(Io,{date:v.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ge.Id,resizable:!0,minWidth:70,render:v=>i.h("a",{href:e.orderUrl.replace(":id",v.id.toString()),target:"_blank",class:"text-base"},v.id)},{title:"Клиент",key:Ge.ClientInfo,resizable:!0,render:v=>i.h(hs,{client:v.client})},{title:"Тип доставки",key:Ge.DeliveryInfo,resizable:!0,render:v=>i.h(Ns,{delivery:v.delivery})},{title:"Статус",key:Ge.Status,resizable:!0,minWidth:90,render:v=>{var B,S;return i.h("span",{class:"text-base"},[((S=(B=a.value)==null?void 0:B.find(R=>R.id===(v.status??-1)))==null?void 0:S.name)??""])}},{title:"Напр. продаж",key:Ge.SalesDirections,resizable:!0,minWidth:70,render:v=>i.h("span",{class:"text-base"},[v.salesDirection.name])},{title:"Закреплено за",key:Ge.AttachedUser,resizable:!0,render:v=>{var B;return i.h("span",{class:"text-base"},[(B=v==null?void 0:v.attachedUser)==null?void 0:B.name])}}];switch(wt.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:v=>i.h(Tu,{order:v,fields:p,orderUrl:e.orderUrl})}];case Ye.laptop:return[y,...p.map(v=>_.find(B=>B.key===v)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new Q.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,Q.HttpRequester.getInstance(Q.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},f=p=>{d.value.page=p,h()},g=p=>{d.value.pageSize=p,h()},m=p=>{M.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},u=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{u(),window.addEventListener("resize",u),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",u)}),(p,b)=>{const y=z.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.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":f,"onUpdate:pageSize":g,"onUpdate:sorter":m},null,8,["columns","data","row-key","pagination","loading"])}}}),Rk=si(Tk,[["__scopeId","data-v-7c4554f4"]]),Pk=["href"],$k={class:"text-sc-dark-grey"},Ek={},Nk=i.defineComponent({...Ek,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Dn.format(n.order.createdAt,Q.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{M.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(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,Pk),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",$k,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),Fk={class:"sc-page flex flex-col"},Ak={class:"my-2 flex flex-row items-end"},Mk={class:"sc-title grow"},Vk={key:0,class:"sc-title-buttons flex-1 grow-0"},Ik={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Ok={key:0,class:"sc-title-extra mt-2 sm:mt-4"},zk={},Fu=i.defineComponent({...zk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",Fk,[i.createElementVNode("div",Ak,[i.createElementVNode("div",Mk,[i.renderSlot(e.$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})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",Vk,[i.createElementVNode("div",Ik,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Ok,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Lk={class:"overflow-hidden transition-all duration-300"},Dk={class:"text-lg font-medium leading-none"},Hk={},Au=i.defineComponent({...Hk,__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(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(wt.getDeviceTypeByResolution()){case Ye.phone:return window.innerWidth*.66;case Ye.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?M.isUndefined(n.drawerWidth)?s.value=a():s.value=M.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=z.NDrawerContent,f=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Lk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=g=>o.value=g),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",Dk,i.toDisplayString(t.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)}}}),Wk={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},jk={key:0},qk={class:"sc-page-preview-panel grow"},Xk={key:1,class:"sc-page-preview-panel-extra flex-none"},Yk={},Uk=i.defineComponent({...Yk,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Fu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Wk,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",jk,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",qk,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Xk,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Au,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),Kk={},Gk=i.defineComponent({...Kk,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var u;return M.isArray(r.value)?r.value.map(p=>p.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{const u=new Q.Curator({id:-1,name:"",contacts:{},curatedDirection:new Q.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[u]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new Q.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,u=>{const p=M.some(o.value?r.value:[r.value],["id",u.id])?` (${u.curatedDirection.name}) `:"";return u.curatedDirection.isNewRec()?u.name:`${u.name}${p}`})),d=i.computed(()=>c.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),h=i.useTemplateRef("select-component"),f=u=>{if(M.isArray(u)){const p=u.length>0?u.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=u>0?l.value.find(b=>b.id===u):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var u,p;(p=(u=h.value)==null?void 0:u.$forceUpdate)==null||p.call(u)},{deep:!0}),e({focus:()=>{var u;return(u=h.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blurInput()}}),(u,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Zk={},Qk=i.defineComponent({...Zk,__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},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var u;return M.isArray(r.value)?r.value.map(p=>p.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>r.showEmptyValue?[Q.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let u=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=M.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),u=u.filter(_=>(r.showEmptyValue?Q.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Ft.convertReferencesToSelectOptionsList(u,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),h=i.useTemplateRef("select-component"),f=u=>{if(M.isArray(u)){const p=u.length>0?u.filter(b=>!M.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=u>0&&!M.some(r.disabledManagerReferenceList,["id",u])?l.value.find(b=>b.id===u):new Q.Manager;s("update:value",p??new Q.Manager)}};return i.watch(()=>r.value,()=>{var u,p;(p=(u=h.value)==null?void 0:u.$forceUpdate)==null||p.call(u)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,u=>{if(u.length>0&&r.value)if(o.value){const p=r.value;M.some(p,b=>M.some(u,["id",b.id]))&&s("update:value",p.filter(b=>!M.some(u,["id",b.id])))}else{const p=r.value;M.some(u,["id",p.id])&&s("update:value",new Q.Manager)}}),e({focus:()=>{var u;return(u=h.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blurInput()}}),(u,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Jk={class:"m-0.5 flex flex-col p-0.5"},e2={class:"flex flex-row gap-1"},t2={key:0},n2={key:1},i2={key:2},r2={key:3},s2={class:"flex flex-row gap-1"},o2={key:0},a2={key:1},l2={key:2},c2={key:3},d2={},Mu=i.defineComponent({...d2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Jk,[i.createElementVNode("span",e2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",t2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",n2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",i2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",r2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",s2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",o2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",a2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",l2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",c2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),xa={clearable:!1,value:"",field:void 0,disabled:!1},h2={},u2=i.defineComponent({...h2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...xa,minTermLength:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Q.HttpRequester.getInstance(Q.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Mu,{addr:y,selected:b},{default:M.constant("-")})},g=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},m=i.ref(null);function u(){m.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),f2={class:"m-0.5 flex flex-col p-0.5"},g2={class:"font-medium"},m2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},p2={key:0},y2={key:1},b2={},Vu=i.defineComponent({...b2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",f2,[i.createElementVNode("span",g2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",m2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",p2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",y2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),_2={},w2=i.defineComponent({..._2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...xa,minTermLength:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Q.HttpRequester.getInstance(Q.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Vu,{bank:y,selected:b},{default:M.constant("-")})},g=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},m=i.ref(null);function u(){m.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),x2={class:"font-medium"},v2={key:0,class:"flex flex-row gap-2"},k2={key:0,class:"text-xs font-light text-blue-800"},C2={key:1,class:"text-sc-dark-grey text-xs font-light"},S2={},Iu=i.defineComponent({...S2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.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",x2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",v2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),B2={},T2=i.defineComponent({...B2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...xa,minTermLength:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const h=M.debounce(()=>f(),800),f=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Q.HttpRequester.getInstance(Q.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},g=(b,y)=>{const _=l.value.find(v=>v.id===b.value)||{};return i.h(Iu,{org:_,selected:y},{default:M.constant("-")})},m=b=>{h.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},u=i.ref(null);function p(){u.value.focus()}return e({focus:p}),(b,y)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[y[0]||(y[0]=v=>o.value=v),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":g,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),R2={},P2=i.defineComponent({...R2,__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(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=z.NButton,h=z.NPopover,f=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.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(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=g=>s.value=g),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.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)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=g=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),$2={key:0,class:"whitespace-pre-line"},E2={key:1,class:"text-sc-dark-grey"},N2={},F2=i.defineComponent({...N2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,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=z.NInput;return i.openBlock(),i.createBlock(Id,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",E2," - Комментарий отсутствует - "))])]),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"])}}}),A2={},M2=i.defineComponent({...A2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),V2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function I2(t,e){return i.openBlock(),i.createElementBlock("svg",V2,[...e[0]||(e[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 O2=i.markRaw({name:"ion-warning",render:I2}),z2={},L2=i.defineComponent({...z2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=O2,s=z.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"])}}}),yt=class yt{static init(e,n){yt.messagesService&&yt.notificationsService||(yt.messagesService=e,yt.notificationsService=n)}static getMessagesService(){if(!yt.messagesService)throw new Error("UI provider is not initialized.");return yt.messagesService}static getNotificationsService(){if(!yt.notificationsService)throw new Error("UI provider is not initialized.");return yt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(M.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";yt.notificationsService?yt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Q.FieldValidationResultData(e.errors[o].toString(),"error"):yt.messagesService?yt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};k(yt,"messagesService"),k(yt,"notificationsService");let va=yt;const D2=i.computed(()=>Q.useReferencesStore().deliveryTypeReference??[]),H2=i.computed(()=>Q.useReferencesStore().managersList??[]),W2=i.computed(()=>Q.useReferencesStore().opfReference??[]),j2=i.computed(()=>Q.useReferencesStore().partnerGroupsReference??[]),q2=i.computed(()=>Q.useReferencesStore().priceCoefficientsReference??[]),X2=i.computed(()=>Q.useReferencesStore().productFilesTypesReference??[]),Y2=i.computed(()=>Q.useReferencesStore().resourceTypesReference),U2=i.computed(()=>Q.useReferencesStore().salesDirectionsReference??[]),K2=i.computed(()=>Q.useReferencesStore().warehousesReference??[]),G2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(Q.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),Z2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(Q.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),Q2=t=>Q.HttpRequester.getInstance(Q.ReferenceDataProvider).searchCity(t),J2=t=>Ft.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());D.AddProductToCartDialog=d0,D.ConfiguratorSettingsKozyrek=pd,D.ConfiguratorSettingsMosquito=yb,D.ContentHelper=ri,D.KozyrekLine=yn,D.KozyrekTailTemplate=Mo,D.KozyrekTemplate=Xi,D.OrdersTableFields=Ge,D.Point=Ao,D.ScAddressSuggestion=u2,D.ScAddressSuggestionLabel=Mu,D.ScBankSuggestion=w2,D.ScBankSuggestionLabel=Vu,D.ScBaseDialog=Ed,D.ScButtonWithConfirmAction=P2,D.ScCategoryCollapse=Pd,D.ScClientNameWithShortInfo=hs,D.ScCollapse=Rd,D.ScCollapseItem=Ya,D.ScCommentEditor=F2,D.ScConfiguratorsProductInfo=ar,D.ScContragentWithShortInfo=Nd,D.ScCuratorSelect=Gk,D.ScDateRange=vb,D.ScDateTimeLabel=Io,D.ScDebouncedInput=Kb,D.ScDebouncedInputNumber=Yi,D.ScDebt=M2,D.ScDialogHeader=$b,D.ScDynamicConfigurator=Td,D.ScEmail=B0,D.ScExternalLink=s_,D.ScImageGallery=Qa,D.ScInlineEditableItem=Id,D.ScInlineView=Oo,D.ScKozyrekConfigurator=yd,D.ScKozyrekConfiguratorParamsForm=tl,D.ScKozyrekConfiguratorPreview=md,D.ScKozyrekConfiguratorTemplates=gd,D.ScLightGallery=Za,D.ScManagerSelect=Qk,D.ScMetalForDoorsConfigurator=Bd,D.ScMetalForDoorsConfiguratorForm=Sd,D.ScMosquitoConfigurator=wd,D.ScMosquitoConfiguratorForm=bd,D.ScMosquitoConfiguratorMeasurementInstructions=_d,D.ScMosquitoConfiguratorPreview=Vo,D.ScOrderCommonInfo=Tu,D.ScOrderDeliveryLabel=Ns,D.ScOrderDetails=Eu,D.ScOrderInfo=Nu,D.ScOrderItemsList=$u,D.ScOrderPayment=Ru,D.ScOrderProductInfo=Pu,D.ScOrdersList=Rk,D.ScOrgSuggestion=T2,D.ScOrgSuggestionLabel=Iu,D.ScPage=Fu,D.ScPageWithSlidingPanel=Uk,D.ScPersonContactsBlock=pb,D.ScPhone=G0,D.ScPhoneInput=Qb,D.ScProductName=or,D.ScProductsList=Fv,D.ScReferenceSelect=$d,D.ScSearchableProductSelect=Bu,D.ScSearchableReferenceSelect=Su,D.ScSetClientPriceFormItem=r0,D.ScShortTextOrderInfo=Nk,D.ScSingleFileUploadSelector=Mb,D.ScSlidingContentWithDrawer=Au,D.ScStripConfigurator=Cd,D.ScStripConfiguratorForm=vd,D.ScStripConfiguratorLineItem=xd,D.ScStripConfiguratorPreview=kd,D.ScUserShortInfo=wa,D.ScWarningIcon=L2,D.SelectOptionHelper=Ft,D.UiNotificationProvider=va,D.WindowResolutionEnum=Ye,D.WindowResolutionProvider=wt,D.channelPrimaryInterestOptionsList=G2,D.componentSizeInjectionKey=Ar,D.deliveryTypeReferenceList=D2,D.handleFloatInput=Ha,D.handleIntegerInput=_t,D.managersReferenceList=H2,D.naiveUiTheme=Pf,D.opfReferenceList=W2,D.parse=Gt,D.partnerGroupReferenceList=j2,D.priceCoefficientsReferenceList=q2,D.productFilesTypesReferenceList=X2,D.renderConfig=Oe,D.resetInputValidation=Ke,D.resourceReferencesList=Y2,D.salesDirectionsReferenceList=U2,D.searchCityReferenceDataHandler=Q2,D.searchCityReferenceLabelRenderer=J2,D.sourcePrimaryInterestOptionsList=Z2,D.warehousesReferenceList=K2,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[wu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Es(t){return t.type==="group"}function Cu(t){return t.type==="ignored"}function _a(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function _v(t,e){return{getIsGroup:Es,getIgnored:Cu,getKey(r){return Es(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function wv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Es(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Cu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function xv(t,e,n){const r=new Map;return t.forEach(s=>{Es(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var vv={};const kv=Object.assign(Object.assign({},gt.props),{to:$n.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}),Cv=i.defineComponent({name:"Select",props:kv,slots:Object,setup(t){vv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&Zn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&Zn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=xi(t),o=gt("Select","-select",bv,yv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Yo(l,a),d=i.ref(!1),h=i.ref(""),f=Zd(t,["items","options"]),g=i.ref([]),m=i.ref([]),u=i.computed(()=>m.value.concat(g.value).concat(f.value)),p=i.computed(()=>{const{filter:E}=t;if(E)return E;const{labelField:j,valueField:ie}=t;return(ce,de)=>{if(!de)return!1;const ye=de[j];if(typeof ye=="string")return _a(ce,ye);const we=de[ie];return typeof we=="string"?_a(ce,we):typeof we=="number"?_a(ce,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return f.value;{const{value:E}=u,{value:j}=h;return!j.length||!t.filterable?E:wv(E,p.value,j,t.childrenField)}}),y=i.computed(()=>{const{valueField:E,childrenField:j}=t,ie=_v(E,j);return G_(b.value,ie)}),_=i.computed(()=>xv(u.value,t.valueField,t.childrenField)),w=i.ref(!1),S=Yo(i.toRef(t,"show"),w),B=i.ref(null),R=i.ref(null),C=i.ref(null),{localeRef:T}=su("Select"),v=i.computed(()=>{var E;return(E=t.placeholder)!==null&&E!==void 0?E:T.value.placeholder}),P=[],$=i.ref(new Map),A=i.computed(()=>{const{fallbackOption:E}=t;if(E===void 0){const{labelField:j,valueField:ie}=t;return ce=>({[j]:String(ce),[ie]:ce})}return E===!1?!1:j=>Object.assign(E(j),{value:j})});function F(E){const j=t.remote,{value:ie}=$,{value:ce}=_,{value:de}=A,ye=[];return E.forEach(we=>{if(ce.has(we))ye.push(ce.get(we));else if(j&&ie.has(we))ye.push(ie.get(we));else if(de){const ve=de(we);ve&&ye.push(ve)}}),ye}const O=i.computed(()=>{if(t.multiple){const{value:E}=c;return Array.isArray(E)?F(E):[]}return null}),L=i.computed(()=>{const{value:E}=c;return!t.multiple&&!Array.isArray(E)?E===null?null:F([E])[0]||null:null}),J=Pw(t),{mergedSizeRef:ne,mergedDisabledRef:N,mergedStatusRef:V}=J;function q(E,j){const{onChange:ie,"onUpdate:value":ce,onUpdateValue:de}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=J;ie&&ft(ie,E,j),de&&ft(de,E,j),ce&&ft(ce,E,j),a.value=E,ye(),we()}function X(E){const{onBlur:j}=t,{nTriggerFormBlur:ie}=J;j&&ft(j,E),ie()}function I(){const{onClear:E}=t;E&&ft(E)}function W(E){const{onFocus:j,showOnFocus:ie}=t,{nTriggerFormFocus:ce}=J;j&&ft(j,E),ce(),ie&&re()}function H(E){const{onSearch:j}=t;j&&ft(j,E)}function U(E){const{onScroll:j}=t;j&&ft(j,E)}function fe(){var E;const{remote:j,multiple:ie}=t;if(j){const{value:ce}=$;if(ie){const{valueField:de}=t;(E=O.value)===null||E===void 0||E.forEach(ye=>{ce.set(ye[de],ye)})}else{const de=L.value;de&&ce.set(de[t.valueField],de)}}}function oe(E){const{onUpdateShow:j,"onUpdate:show":ie}=t;j&&ft(j,E),ie&&ft(ie,E),w.value=E}function re(){N.value||(oe(!0),w.value=!0,t.filterable&&ei())}function Ne(){oe(!1)}function Le(){h.value="",m.value=P}const Fe=i.ref(!1);function Ut(){t.filterable&&(Fe.value=!0)}function Te(){t.filterable&&(Fe.value=!1,S.value||Le())}function rn(){N.value||(S.value?t.filterable?ei():Ne():re())}function sn(E){var j,ie;!((ie=(j=C.value)===null||j===void 0?void 0:j.selfRef)===null||ie===void 0)&&ie.contains(E.relatedTarget)||(d.value=!1,X(E),Ne())}function Tt(E){W(E),d.value=!0}function Ot(){d.value=!0}function on(E){var j;!((j=B.value)===null||j===void 0)&&j.$el.contains(E.relatedTarget)||(d.value=!1,X(E),Ne())}function bt(){var E;(E=B.value)===null||E===void 0||E.focus(),Ne()}function zn(E){var j;S.value&&(!((j=B.value)===null||j===void 0)&&j.$el.contains(mr(E))||Ne())}function an(E){if(!Array.isArray(E))return[];if(A.value)return Array.from(E);{const{remote:j}=t,{value:ie}=_;if(j){const{value:ce}=$;return E.filter(de=>ie.has(de)||ce.has(de))}else return E.filter(ce=>ie.has(ce))}}function Kt(E){Pe(E.rawNode)}function Pe(E){if(N.value)return;const{tag:j,remote:ie,clearFilterAfterSelect:ce,valueField:de}=t;if(j&&!ie){const{value:ye}=m,we=ye[0]||null;if(we){const ve=g.value;ve.length?ve.push(we):g.value=[we],m.value=P}}if(ie&&$.value.set(E[de],E),t.multiple){const ye=an(c.value),we=ye.findIndex(ve=>ve===E[de]);if(~we){if(ye.splice(we,1),j&&!ie){const ve=K(E[de]);~ve&&(g.value.splice(ve,1),ce&&(h.value=""))}}else ye.push(E[de]),ce&&(h.value="");q(ye,F(ye))}else{if(j&&!ie){const ye=K(E[de]);~ye?g.value=[g.value[ye]]:g.value=P}er(),Ne(),q(E[de],E)}}function K(E){return g.value.findIndex(ie=>ie[t.valueField]===E)}function se(E){S.value||re();const{value:j}=E.target;h.value=j;const{tag:ie,remote:ce}=t;if(H(j),ie&&!ce){if(!j){m.value=P;return}const{onCreate:de}=t,ye=de?de(j):{[t.labelField]:j,[t.valueField]:j},{valueField:we,labelField:ve}=t;f.value.some(Xe=>Xe[we]===ye[we]||Xe[ve]===ye[ve])||g.value.some(Xe=>Xe[we]===ye[we]||Xe[ve]===ye[ve])?m.value=P:m.value=[ye]}}function Ie(E){E.stopPropagation();const{multiple:j}=t;!j&&t.filterable&&Ne(),I(),j?q([],[]):q(null,null)}function Jn(E){!gr(E,"action")&&!gr(E,"empty")&&!gr(E,"header")&&E.preventDefault()}function Qe(E){U(E)}function zt(E){var j,ie,ce,de,ye;if(!t.keyboard){E.preventDefault();return}switch(E.key){case" ":if(t.filterable)break;E.preventDefault();case"Enter":if(!(!((j=B.value)===null||j===void 0)&&j.isComposing)){if(S.value){const we=(ie=C.value)===null||ie===void 0?void 0:ie.getPendingTmNode();we?Kt(we):t.filterable||(Ne(),er())}else if(re(),t.tag&&Fe.value){const we=m.value[0];if(we){const ve=we[t.valueField],{value:Xe}=c;t.multiple&&Array.isArray(Xe)&&Xe.includes(ve)||Pe(we)}}}E.preventDefault();break;case"ArrowUp":if(E.preventDefault(),t.loading)return;S.value&&((ce=C.value)===null||ce===void 0||ce.prev());break;case"ArrowDown":if(E.preventDefault(),t.loading)return;S.value?(de=C.value)===null||de===void 0||de.next():re();break;case"Escape":S.value&&(Sw(E),Ne()),(ye=B.value)===null||ye===void 0||ye.focus();break}}function er(){var E;(E=B.value)===null||E===void 0||E.focus()}function ei(){var E;(E=B.value)===null||E===void 0||E.focusInput()}function Ti(){var E;S.value&&((E=R.value)===null||E===void 0||E.syncPosition())}fe(),i.watch(i.toRef(t,"options"),fe);const tr={focus:()=>{var E;(E=B.value)===null||E===void 0||E.focus()},focusInput:()=>{var E;(E=B.value)===null||E===void 0||E.focusInput()},blur:()=>{var E;(E=B.value)===null||E===void 0||E.blur()},blurInput:()=>{var E;(E=B.value)===null||E===void 0||E.blurInput()}},ln=i.computed(()=>{const{self:{menuBoxShadow:E}}=o.value;return{"--n-menu-box-shadow":E}}),Ln=s?vi("select",void 0,ln,t):void 0;return Object.assign(Object.assign({},tr),{mergedStatus:V,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:bs(),triggerRef:B,menuRef:C,pattern:h,uncontrolledShow:w,mergedShow:S,adjustedTo:$n(t),uncontrolledValue:a,mergedValue:c,followerRef:R,localizedPlaceholder:v,selectedOption:L,selectedOptions:O,mergedSize:ne,mergedDisabled:N,focused:d,activeWithoutMenuOpen:Fe,inlineThemeDisabled:s,onTriggerInputFocus:Ut,onTriggerInputBlur:Te,handleTriggerOrMenuResize:Ti,handleMenuFocus:Ot,handleMenuBlur:on,handleMenuTabOut:bt,handleTriggerClick:rn,handleToggle:Kt,handleDeleteOption:Pe,handlePatternInput:se,handleClear:Ie,handleTriggerBlur:sn,handleTriggerFocus:Tt,handleKeydown:zt,handleMenuAfterLeave:Le,handleMenuClickOutside:zn,handleMenuScroll:Qe,handleMenuKeydown:zt,handleMenuMousedown:Jn,mergedTheme:o,cssVars:s?void 0:ln,themeClass:Ln==null?void 0:Ln.themeClass,onRender:Ln==null?void 0:Ln.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(th,null,{default:()=>[i.h(nh,null,{default:()=>i.h(mv,{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 t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(yh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===$n.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 t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(jx,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.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],[ys,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ys,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Sv={},Su=i.defineComponent({...Sv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.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(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(w=>{if(M.isEmpty(w))return;const S=o.value?r.value:r.value?[r.value]:[],B=w.filter(R=>!S.some(C=>C.id===R.id));l.value=r.optionsListConverter([...S,...B])}).finally(()=>{d.value=!1}))};let g="";const m=M.debounce(()=>f(g),800),u=_=>{g=_,m()},p=_=>{var w;if(M.isArray(_)){const S=_.length>0?_.map(B=>{var R;return i.toRaw((R=l.value.find(C=>C.value===B))==null?void 0:R.item)}):[];s("update:value",S)}else if(_>0){const S=i.toRaw((w=l.value.find(B=>B.value===_))==null?void 0:w.item);s("update:value",S)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,w)=>(i.openBlock(),i.createBlock(i.unref(Cv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:u,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),Bv={},Bu=i.defineComponent({...Bv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?Q.HttpRequester.getInstance(Q.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?Q.HttpRequester.getInstance(Q.ProductDataProvider).publicSimpleSearch(f):new Promise(g=>{g([])}),l=f=>r.searchType==="categories"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,g=>g!=null&&g.isNewRec()?"-":g.name):r.searchType==="products"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,g=>g!=null&&g.isNewRec()?"-":`[${g.code}] ${g.name}`):[],c=(f,g)=>{if(r.renderLabel)return r.renderLabel(f,g);if(r.searchType==="products"){const m=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},m.code),i.h("span",{},[m.name])])}if(r.searchType==="categories"){const m=f.item;return i.h("div",{},[m.name])}};return e({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(Su,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":g[0]||(g[0]=m=>s("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Tv={class:"col-span-2 flex flex-row gap-2.5"},Rv={class:"flex-1"},Pv={class:"text-sc-grey"},$v={class:"ml-2.5"},Ev={key:0,class:"flex-none"},Nv={},Fv=i.defineComponent({...Nv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(g=>i.toRaw(g)),...(M.isArray(f)?f:[f]).filter(g=>!a.value.some(m=>m.id===g.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(g=>g.id===f.id?f:i.toRaw(g)),l())},h=f=>{a.value=a.value.filter(g=>g.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,g)=>{const m=z.NListItem,u=l_,p=z.NButton,b=z.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Bu,{value:s.value,"onUpdate:value":[g[0]||(g[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(m,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...g[1]||(g[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(m,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(y)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Tv,[i.createElementVNode("span",Rv,[i.createElementVNode("span",Pv,i.toDisplayString(y.code),1),i.createElementVNode("span",$v,i.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Ev,[i.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Av={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mv(t,e){return i.openBlock(),i.createElementBlock("svg",Av,[...e[0]||(e[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 Vv=i.markRaw({name:"tabler-truck-filled",render:Mv}),Iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ov(t,e){return i.openBlock(),i.createElementBlock("svg",Iv,[...e[0]||(e[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 zv=i.markRaw({name:"tabler-truck-delivery",render:Ov}),Lv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Dv(t,e){return i.openBlock(),i.createElementBlock("svg",Lv,[...e[0]||(e[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 Hv=i.markRaw({name:"tabler-truck-loading",render:Dv}),Wv={class:"flex flex-col gap-1"},jv={key:0,class:"flex flex-row gap-1 text-base"},qv={key:1,class:"text-sc-dark-grey text-sm"},Xv={class:"text-sc-grey mr-1.5"},Yv={key:0},Uv={key:1},Kv={key:2},Gv={},Ns=i.defineComponent({...Gv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=Q.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Dn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,f,g,m,u,p,b;const a=Hv,l=zv,c=Vv;return i.openBlock(),i.createElementBlock("div",Wv,[t.showType?(i.openBlock(),i.createElementBlock("span",jv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((g=e.value)==null?void 0:g.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",qv,[i.createElementVNode("span",Xv,i.toDisplayString(n.value),1),(u=(m=t.delivery)==null?void 0:m.address)!=null&&u.address?(i.openBlock(),i.createElementBlock("span",Yv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",Uv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Kv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Zv={class:"flex flex-col gap-2.5"},Qv={class:"text-base"},Jv=["href"],ek={class:"text-sc-grey"},tk={},Tu=i.defineComponent({...tk,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ge.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ge.Status)?(c=(l=Q.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Ge.CreatedAt)),o=i.computed(()=>e.fields.includes(Ge.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ge.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Zv,[i.createElementVNode("span",Qv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Jv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Io,{date:t.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(" - ",-1)),i.createElementVNode("span",ek,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(hs,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ns,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),nk={},Ru=i.defineComponent({...nk,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Q.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.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)}}}),ik={class:"flex flex-row gap-1.5"},rk={class:"flex-none text-nowrap"},sk={class:"flex flex-1 flex-col"},ok={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},ak={key:0},lk={key:1},ck={},Pu=i.defineComponent({...ck,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",ik,[i.createElementVNode("span",rk,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",sk,[i.createVNode(or,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",ok,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",ak,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",lk,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)])])]))}}),dk={},hk=i.defineComponent({...dk,__name:"order-items-list",props:{order:{}},setup(t){const e=()=>{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(or,{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(wt.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Pu,{product:o,index:a})}];case Ye.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=z.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:t.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),$u=si(hk,[["__scopeId","data-v-b15b9b70"]]),uk={class:"text-base"},fk={},wa=i.defineComponent({...fk,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",uk,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))}}),gk={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},mk={class:"col-span-2"},pk={class:"col-span-2"},yk={class:"btn btn-primary",href:"{{ invoice }}"},bk={},Eu=i.defineComponent({...bk,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",gk,[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(wa,{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(hs,{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(Nd,{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",mk,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(Ru,{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(Ns,{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",pk,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(wa,{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",yk," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),_k={key:0},wk={class:"text-sc-dark-grey my-2 text-center"},xk={key:1,class:"text-sc-dark-grey my-2 text-center"},vk={key:2},kk={class:"text-sc-dark-grey mt-4 text-right font-bold"},Ck={class:"text-sc-primary"},Sk={},Nu=i.defineComponent({...Sk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new Q.Order(e.order)),s=()=>{n.value=!0,Q.HttpRequester.getInstance(Q.OrdersDataProvider).getOrder(e.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=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",_k,[i.createElementVNode("div",wk,[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",xk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",vk,[i.createVNode($u,{order:r.value},null,8,["order"]),i.createElementVNode("div",kk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Ck,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Eu,{order:r.value},null,8,["order"])]))}}}),Bk={},Tk=i.defineComponent({...Bk,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Q.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ge.CreatedAt,Ge.Id,Ge.DeliveryInfo,Ge.Status,Ge.SalesDirections,Ge.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:M.constant(!0),renderExpand:w=>i.h(Nu,{order:w,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ge.CreatedAt,resizable:!0,minWidth:100,render:w=>i.h(Io,{date:w.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ge.Id,resizable:!0,minWidth:70,render:w=>i.h("a",{href:e.orderUrl.replace(":id",w.id.toString()),target:"_blank",class:"text-base"},w.id)},{title:"Клиент",key:Ge.ClientInfo,resizable:!0,render:w=>i.h(hs,{client:w.client})},{title:"Тип доставки",key:Ge.DeliveryInfo,resizable:!0,render:w=>i.h(Ns,{delivery:w.delivery})},{title:"Статус",key:Ge.Status,resizable:!0,minWidth:90,render:w=>{var S,B;return i.h("span",{class:"text-base"},[((B=(S=a.value)==null?void 0:S.find(R=>R.id===(w.status??-1)))==null?void 0:B.name)??""])}},{title:"Напр. продаж",key:Ge.SalesDirections,resizable:!0,minWidth:70,render:w=>i.h("span",{class:"text-base"},[w.salesDirection.name])},{title:"Закреплено за",key:Ge.AttachedUser,resizable:!0,render:w=>{var S;return i.h("span",{class:"text-base"},[(S=w==null?void 0:w.attachedUser)==null?void 0:S.name])}}];switch(wt.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:w=>i.h(Tu,{order:w,fields:p,orderUrl:e.orderUrl})}];case Ye.laptop:return[y,...p.map(w=>_.find(S=>S.key===w)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new Q.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,Q.HttpRequester.getInstance(Q.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},f=p=>{d.value.page=p,h()},g=p=>{d.value.pageSize=p,h()},m=p=>{M.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},u=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{u(),window.addEventListener("resize",u),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",u)}),(p,b)=>{const y=z.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.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":f,"onUpdate:pageSize":g,"onUpdate:sorter":m},null,8,["columns","data","row-key","pagination","loading"])}}}),Rk=si(Tk,[["__scopeId","data-v-7c4554f4"]]),Pk=["href"],$k={class:"text-sc-dark-grey"},Ek={},Nk=i.defineComponent({...Ek,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Dn.format(n.order.createdAt,Q.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{M.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(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,Pk),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",$k,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),Fk={class:"sc-page flex flex-col"},Ak={class:"my-2 flex flex-row items-end"},Mk={class:"sc-title grow"},Vk={key:0,class:"sc-title-buttons flex-1 grow-0"},Ik={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Ok={key:0,class:"sc-title-extra mt-2 sm:mt-4"},zk={},Fu=i.defineComponent({...zk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",Fk,[i.createElementVNode("div",Ak,[i.createElementVNode("div",Mk,[i.renderSlot(e.$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})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",Vk,[i.createElementVNode("div",Ik,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Ok,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Lk={class:"overflow-hidden transition-all duration-300"},Dk={class:"text-lg font-medium leading-none"},Hk={},Au=i.defineComponent({...Hk,__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(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(wt.getDeviceTypeByResolution()){case Ye.phone:return window.innerWidth*.66;case Ye.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?M.isUndefined(n.drawerWidth)?s.value=a():s.value=M.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=z.NDrawerContent,f=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Lk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=g=>o.value=g),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",Dk,i.toDisplayString(t.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)}}}),Wk={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},jk={key:0},qk={class:"sc-page-preview-panel grow"},Xk={key:1,class:"sc-page-preview-panel-extra flex-none"},Yk={},Uk=i.defineComponent({...Yk,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Fu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Wk,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",jk,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",qk,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Xk,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Au,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),Kk={},Gk=i.defineComponent({...Kk,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var u;return M.isArray(r.value)?r.value.map(p=>p.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{const u=new Q.Curator({id:-1,name:"",contacts:{},curatedDirection:new Q.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[u]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new Q.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,u=>{const p=M.some(o.value?r.value:[r.value],["id",u.id])?` (${u.curatedDirection.name}) `:"";return u.curatedDirection.isNewRec()?u.name:`${u.name}${p}`})),d=i.computed(()=>c.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),h=i.useTemplateRef("select-component"),f=u=>{if(M.isArray(u)){const p=u.length>0?u.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=u>0?l.value.find(b=>b.id===u):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var u,p;(p=(u=h.value)==null?void 0:u.$forceUpdate)==null||p.call(u)},{deep:!0}),e({focus:()=>{var u;return(u=h.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blurInput()}}),(u,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Zk={},Qk=i.defineComponent({...Zk,__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},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var u;return M.isArray(r.value)?r.value.map(p=>p.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>r.showEmptyValue?[Q.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let u=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=M.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),u=u.filter(_=>(r.showEmptyValue?Q.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Ft.convertReferencesToSelectOptionsList(u,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),h=i.useTemplateRef("select-component"),f=u=>{if(M.isArray(u)){const p=u.length>0?u.filter(b=>!M.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=u>0&&!M.some(r.disabledManagerReferenceList,["id",u])?l.value.find(b=>b.id===u):new Q.Manager;s("update:value",p??new Q.Manager)}};return i.watch(()=>r.value,()=>{var u,p;(p=(u=h.value)==null?void 0:u.$forceUpdate)==null||p.call(u)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,u=>{if(u.length>0&&r.value)if(o.value){const p=r.value;M.some(p,b=>M.some(u,["id",b.id]))&&s("update:value",p.filter(b=>!M.some(u,["id",b.id])))}else{const p=r.value;M.some(u,["id",p.id])&&s("update:value",new Q.Manager)}}),e({focus:()=>{var u;return(u=h.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blurInput()}}),(u,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Jk={class:"m-0.5 flex flex-col p-0.5"},e2={class:"flex flex-row gap-1"},t2={key:0},n2={key:1},i2={key:2},r2={key:3},s2={class:"flex flex-row gap-1"},o2={key:0},a2={key:1},l2={key:2},c2={key:3},d2={},Mu=i.defineComponent({...d2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Jk,[i.createElementVNode("span",e2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",t2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",n2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",i2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",r2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",s2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",o2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",a2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",l2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",c2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),xa={clearable:!1,value:"",field:void 0,disabled:!1},h2={},u2=i.defineComponent({...h2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...xa,minTermLength:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Q.HttpRequester.getInstance(Q.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Mu,{addr:y,selected:b},{default:M.constant("-")})},g=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},m=i.ref(null);function u(){m.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),f2={class:"m-0.5 flex flex-col p-0.5"},g2={class:"font-medium"},m2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},p2={key:0},y2={key:1},b2={},Vu=i.defineComponent({...b2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",f2,[i.createElementVNode("span",g2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",m2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",p2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",y2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),_2={},w2=i.defineComponent({..._2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...xa,minTermLength:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Q.HttpRequester.getInstance(Q.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Vu,{bank:y,selected:b},{default:M.constant("-")})},g=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},m=i.ref(null);function u(){m.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),x2={class:"font-medium"},v2={key:0,class:"flex flex-row gap-2"},k2={key:0,class:"text-xs font-light text-blue-800"},C2={key:1,class:"text-sc-dark-grey text-xs font-light"},S2={},Iu=i.defineComponent({...S2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.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",x2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",v2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),B2={},T2=i.defineComponent({...B2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...xa,minTermLength:()=>{var t,e;return((e=(t=Q.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const h=M.debounce(()=>f(),800),f=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Q.HttpRequester.getInstance(Q.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},g=(b,y)=>{const _=l.value.find(w=>w.id===b.value)||{};return i.h(Iu,{org:_,selected:y},{default:M.constant("-")})},m=b=>{h.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},u=i.ref(null);function p(){u.value.focus()}return e({focus:p}),(b,y)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[y[0]||(y[0]=w=>o.value=w),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":g,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),R2={},P2=i.defineComponent({...R2,__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(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=z.NButton,h=z.NPopover,f=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.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(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=g=>s.value=g),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.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)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=g=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),$2={key:0,class:"whitespace-pre-line"},E2={key:1,class:"text-sc-dark-grey"},N2={},F2=i.defineComponent({...N2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,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=z.NInput;return i.openBlock(),i.createBlock(Id,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",E2," - Комментарий отсутствует - "))])]),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"])}}}),A2={},M2=i.defineComponent({...A2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),V2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function I2(t,e){return i.openBlock(),i.createElementBlock("svg",V2,[...e[0]||(e[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 O2=i.markRaw({name:"ion-warning",render:I2}),z2={},L2=i.defineComponent({...z2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=O2,s=z.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"])}}}),yt=class yt{static init(e,n){yt.messagesService&&yt.notificationsService||(yt.messagesService=e,yt.notificationsService=n)}static getMessagesService(){if(!yt.messagesService)throw new Error("UI provider is not initialized.");return yt.messagesService}static getNotificationsService(){if(!yt.notificationsService)throw new Error("UI provider is not initialized.");return yt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(M.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";yt.notificationsService?yt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Q.FieldValidationResultData(e.errors[o].toString(),"error"):yt.messagesService?yt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};k(yt,"messagesService"),k(yt,"notificationsService");let va=yt;const D2=i.computed(()=>Q.useReferencesStore().deliveryTypeReference??[]),H2=i.computed(()=>Q.useReferencesStore().managersList??[]),W2=i.computed(()=>Q.useReferencesStore().opfReference??[]),j2=i.computed(()=>Q.useReferencesStore().partnerGroupsReference??[]),q2=i.computed(()=>Q.useReferencesStore().priceCoefficientsReference??[]),X2=i.computed(()=>Q.useReferencesStore().productFilesTypesReference??[]),Y2=i.computed(()=>Q.useReferencesStore().resourceTypesReference),U2=i.computed(()=>Q.useReferencesStore().salesDirectionsReference??[]),K2=i.computed(()=>Q.useReferencesStore().warehousesReference??[]),G2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(Q.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),Z2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(Q.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),Q2=t=>Q.HttpRequester.getInstance(Q.ReferenceDataProvider).searchCity(t),J2=t=>Ft.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());D.AddProductToCartDialog=d0,D.ConfiguratorSettingsKozyrek=pd,D.ConfiguratorSettingsMosquito=yb,D.ContentHelper=ri,D.KozyrekLine=yn,D.KozyrekTailTemplate=Mo,D.KozyrekTemplate=Xi,D.OrdersTableFields=Ge,D.Point=Ao,D.ScAddressSuggestion=u2,D.ScAddressSuggestionLabel=Mu,D.ScBankSuggestion=w2,D.ScBankSuggestionLabel=Vu,D.ScBaseDialog=Ed,D.ScButtonWithConfirmAction=P2,D.ScCategoryCollapse=Pd,D.ScClientNameWithShortInfo=hs,D.ScCollapse=Rd,D.ScCollapseItem=Ya,D.ScCommentEditor=F2,D.ScConfiguratorsProductInfo=ar,D.ScContragentWithShortInfo=Nd,D.ScCuratorSelect=Gk,D.ScDateRange=vb,D.ScDateTimeLabel=Io,D.ScDebouncedInput=Kb,D.ScDebouncedInputNumber=Yi,D.ScDebt=M2,D.ScDialogHeader=$b,D.ScDynamicConfigurator=Td,D.ScEmail=B0,D.ScExternalLink=s_,D.ScImageGallery=Qa,D.ScInlineEditableItem=Id,D.ScInlineView=Oo,D.ScKozyrekConfigurator=yd,D.ScKozyrekConfiguratorParamsForm=tl,D.ScKozyrekConfiguratorPreview=md,D.ScKozyrekConfiguratorTemplates=gd,D.ScLightGallery=Za,D.ScManagerSelect=Qk,D.ScMetalForDoorsConfigurator=Bd,D.ScMetalForDoorsConfiguratorForm=Sd,D.ScMosquitoConfigurator=wd,D.ScMosquitoConfiguratorForm=bd,D.ScMosquitoConfiguratorMeasurementInstructions=_d,D.ScMosquitoConfiguratorPreview=Vo,D.ScOrderCommonInfo=Tu,D.ScOrderDeliveryLabel=Ns,D.ScOrderDetails=Eu,D.ScOrderInfo=Nu,D.ScOrderItemsList=$u,D.ScOrderPayment=Ru,D.ScOrderProductInfo=Pu,D.ScOrdersList=Rk,D.ScOrgSuggestion=T2,D.ScOrgSuggestionLabel=Iu,D.ScPage=Fu,D.ScPageWithSlidingPanel=Uk,D.ScPersonContactsBlock=pb,D.ScPhone=G0,D.ScPhoneInput=Qb,D.ScProductName=or,D.ScProductsList=Fv,D.ScReferenceSelect=$d,D.ScSearchableProductSelect=Bu,D.ScSearchableReferenceSelect=Su,D.ScSetClientPriceFormItem=r0,D.ScShortTextOrderInfo=Nk,D.ScSingleFileUploadSelector=Mb,D.ScSlidingContentWithDrawer=Au,D.ScStripConfigurator=Cd,D.ScStripConfiguratorForm=vd,D.ScStripConfiguratorLineItem=xd,D.ScStripConfiguratorPreview=kd,D.ScUserShortInfo=wa,D.ScWarningIcon=L2,D.SelectOptionHelper=Ft,D.UiNotificationProvider=va,D.WindowResolutionEnum=Ye,D.WindowResolutionProvider=wt,D.channelPrimaryInterestOptionsList=G2,D.componentSizeInjectionKey=Ar,D.deliveryTypeReferenceList=D2,D.handleFloatInput=Ha,D.handleIntegerInput=_t,D.managersReferenceList=H2,D.naiveUiTheme=Pf,D.opfReferenceList=W2,D.parse=Gt,D.partnerGroupReferenceList=j2,D.priceCoefficientsReferenceList=q2,D.productFilesTypesReferenceList=X2,D.renderConfig=Oe,D.resetInputValidation=Ke,D.resourceReferencesList=Y2,D.salesDirectionsReferenceList=U2,D.searchCityReferenceDataHandler=Q2,D.searchCityReferenceLabelRenderer=J2,D.sourcePrimaryInterestOptionsList=Z2,D.warehousesReferenceList=K2,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})}));
|
|
823
823
|
//# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map
|