@snabcentr/vue-ui-lib 2.25.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +2 -2
- package/dist/release_notes.tmp +2 -2
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +375 -351
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +2 -2
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/components/catalog/category-collapse-item.vue.d.ts +87 -1
- package/dist/src/components/collapse/collapse-item.vue.d.ts +18 -1
- package/dist/src/components/inline/inline-view.vue.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(L,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],H):(L=typeof globalThis<"u"?globalThis:L||self,H(L.SC_VueUiLib={},L["lodash-es"],L.Vue,L["naive-ui"],L["@snabcentr/common-lib"],L["date-fns"],L["libphonenumber-js"],L["vue-tel-input"]))})(this,function(L,H,i,I,U,Tn,Xi,Wh){"use strict";var Vk=Object.defineProperty;var Lh=L=>{throw TypeError(L)};var Ok=(L,H,i)=>H in L?Vk(L,H,{enumerable:!0,configurable:!0,writable:!0,value:i}):L[H]=i;var x=(L,H,i)=>Ok(L,typeof H!="symbol"?H+"":H,i),Dh=(L,H,i)=>H.has(L)||Lh("Cannot "+i);var Tt=(L,H,i)=>(Dh(L,H,"read from private field"),i?i.call(L):H.get(L)),pa=(L,H,i)=>H.has(L)?Lh("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(L):H.set(L,i),Hh=(L,H,i,I)=>(Dh(L,H,"write to private field"),I?I.call(L,i):H.set(L,i),i);var mi,lt,xs;var Ke=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ke||{}),qe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(qe||{});class Dn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&H.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Dn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Dn.isVnodeEmpty(t()):!1}}class zt{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return zt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return zt.convertReferencesToOptionsList(t,n,r,s,o)}}const jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)]))}const ga=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Xh}),qh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yh(e,t){return i.openBlock(),i.createElementBlock("svg",qh,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)]))}const ma=i.markRaw({name:"tabler-edit",render:Yh}),Uh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 Kh=i.markRaw({name:"fluent-pin32-regular",render:Gh}),Zh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(e,t){return i.openBlock(),i.createElementBlock("svg",Zh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 Qh=i.markRaw({name:"ion-eye-outline",render:Jh}),eu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)]))}const nu=i.markRaw({name:"fluent-pin32-filled",render:tu}),iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ru(e,t){return i.openBlock(),i.createElementBlock("svg",iu,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)]))}const _a=i.markRaw({name:"ion-cart-outline",render:ru}),su={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ou(e,t){return i.openBlock(),i.createElementBlock("svg",su,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 au=i.markRaw({name:"ion-bookmark-outline",render:ou}),lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cu(e,t){return i.openBlock(),i.createElementBlock("svg",lu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 du=i.markRaw({name:"ion-eye-off-sharp",render:cu}),hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uu(e,t){return i.openBlock(),i.createElementBlock("svg",hu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const fu=i.markRaw({name:"ion-chevron-forward-outline",render:uu}),pu=["data-name"],gu={class:"sc-collapse-item-header flex flex-row gap-2.5"},mu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},_u={key:0},yu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},bu={class:"flex flex-1 flex-col"},wu={key:0,class:"sc-collapse-item-sub-title flex-1"},vu={key:1,class:"sc-collapse-item-title-extra flex-none"},ku={key:0,class:"sc-collapse-item-content"},xu={},Cu=i.defineComponent({...xu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{emit:t}){const n=e,r=t,s=i.inject("itemHeaderClickHandler",H.noop),o=i.inject("defaultExpandedNames",[]),a=i.inject("expandedNames",[]),l=H.some(o,u=>u===n.name),c=i.computed(()=>H.some(a,u=>u===n.name)),d=i.ref(l),h=()=>{n.disabled||(d.value=c.value||!d.value,r("header:click",n.name,d.value),s(n.name,d.value))};return(u,p)=>{const f=fu;return i.openBlock(),i.createElementBlock("div",{"data-name":u.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":u.disabled})},[i.createElementVNode("div",gu,[i.createElementVNode("div",mu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":d.value}),onClick:h},[i.renderSlot(u.$slots,"arrow",{},()=>[i.createVNode(f)],!0)],2)]),i.unref(Dn).hasSlotContent(u.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",_u,[i.createElementVNode("div",yu,[i.renderSlot(u.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",bu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(u.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(u.title),1)],!0)]),i.unref(Dn).hasSlotContent(u.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",wu,[i.renderSlot(u.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Dn).hasSlotContent(u.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vu,[i.renderSlot(u.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[c.value||d.value?(i.openBlock(),i.createElementBlock("div",ku,[i.renderSlot(u.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pu)}}}),Hn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ya=Hn(Cu,[["__scopeId","data-v-a72ddc14"]]),xr=Symbol(),Su={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"}},Bu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Tu={},ba=i.defineComponent({...Tu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>H.isNil(t.productContextButtonsConfig)?[]:H.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=_a,h=I.NButton,u=I.NTooltip,p=ma,f=ga,g=I.NDropdown;return i.openBlock(),i.createElementBlock("div",Bu,[(i.unref(H.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(u,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину "))]),_:1,__:[0]})):i.createCommentVNode("",!0),(i.unref(H.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(u,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Eu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $u(e,t){return i.openBlock(),i.createElementBlock("svg",Eu,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)]))}const Nu=i.markRaw({name:"tabler-history",render:$u}),Ru={class:"flex flex-row gap-1"},Pu={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Fu={key:1,class:"flex flex-row text-nowrap text-sm"},Mu={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Au={},Cr=i.defineComponent({...Au,__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(e){const t=e,n=i.computed(()=>H.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:H.get(t.product,t.costFieldName)),s=i.computed(()=>t.additionalThroughFieldName?H.get(t.product,t.additionalThroughFieldName):void 0),o=i.computed(()=>t.product.costDate?Tn.format(t.product.costDate,U.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(H.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!H.isNil(r.value)),l=i.computed(()=>H.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const h=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>H.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var m;const p=I.NTag,f=I.NTooltip,g=Nu;return i.openBlock(),i.createElementBlock("div",Ru,[h.showTag?(i.openBlock(),i.createBlock(f,{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 _;return[i.createTextVNode(i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var _;return[i.createTextVNode(" "+i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value?(i.openBlock(),i.createElementBlock("span",Pu,i.toDisplayString(d.value)+" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(m=n.value)==null?void 0:m.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&h.eventEmitter}),onClick:u[0]||(u[0]=()=>{var _;a.value&&((_=h.eventEmitter)==null||_.emit("cost:click",{product:h.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Fu," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(h.showQuantityUnit?`₽/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),h.showCostDate&&!i.unref(H.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Mu,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),h.showPriceHistory&&h.eventEmitter?(i.openBlock(),i.createBlock(f,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:u[1]||(u[1]=_=>{var y;return(y=h.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:h.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vu(e,t){return i.openBlock(),i.createElementBlock("svg",Iu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)]))}const Bs=i.markRaw({name:"ion-information-circle-outline",render:Vu}),Ou={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zu(e,t){return i.openBlock(),i.createElementBlock("svg",Ou,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)]))}const wa=i.markRaw({name:"ion-images",render:zu});/*!
|
|
1
|
+
(function(L,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],H):(L=typeof globalThis<"u"?globalThis:L||self,H(L.SC_VueUiLib={},L["lodash-es"],L.Vue,L["naive-ui"],L["@snabcentr/common-lib"],L["date-fns"],L["libphonenumber-js"],L["vue-tel-input"]))})(this,function(L,H,i,I,U,Tn,Xi,Wh){"use strict";var Vk=Object.defineProperty;var Lh=L=>{throw TypeError(L)};var Ok=(L,H,i)=>H in L?Vk(L,H,{enumerable:!0,configurable:!0,writable:!0,value:i}):L[H]=i;var x=(L,H,i)=>Ok(L,typeof H!="symbol"?H+"":H,i),Dh=(L,H,i)=>H.has(L)||Lh("Cannot "+i);var Tt=(L,H,i)=>(Dh(L,H,"read from private field"),i?i.call(L):H.get(L)),pa=(L,H,i)=>H.has(L)?Lh("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(L):H.set(L,i),Hh=(L,H,i,I)=>(Dh(L,H,"write to private field"),I?I.call(L,i):H.set(L,i),i);var mi,lt,xs;var Ke=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ke||{}),qe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(qe||{});class Dn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&H.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Dn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Dn.isVnodeEmpty(t()):!1}}class zt{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return zt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return zt.convertReferencesToOptionsList(t,n,r,s,o)}}const jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)]))}const ga=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Xh}),qh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yh(e,t){return i.openBlock(),i.createElementBlock("svg",qh,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)]))}const ma=i.markRaw({name:"tabler-edit",render:Yh}),Uh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 Kh=i.markRaw({name:"fluent-pin32-regular",render:Gh}),Zh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(e,t){return i.openBlock(),i.createElementBlock("svg",Zh,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 Qh=i.markRaw({name:"ion-eye-outline",render:Jh}),eu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)]))}const nu=i.markRaw({name:"fluent-pin32-filled",render:tu}),iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ru(e,t){return i.openBlock(),i.createElementBlock("svg",iu,t[0]||(t[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)]))}const _a=i.markRaw({name:"ion-cart-outline",render:ru}),su={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ou(e,t){return i.openBlock(),i.createElementBlock("svg",su,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 au=i.markRaw({name:"ion-bookmark-outline",render:ou}),lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cu(e,t){return i.openBlock(),i.createElementBlock("svg",lu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 du=i.markRaw({name:"ion-eye-off-sharp",render:cu}),hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uu(e,t){return i.openBlock(),i.createElementBlock("svg",hu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const fu=i.markRaw({name:"ion-chevron-forward-outline",render:uu}),pu=["data-name"],gu={class:"sc-collapse-item-header flex flex-row gap-2.5"},mu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},_u={key:0},yu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},bu={class:"flex flex-1 flex-col"},wu={key:0,class:"sc-collapse-item-sub-title flex-1"},vu={key:1,class:"sc-collapse-item-title-extra flex-none"},ku={key:0,class:"sc-collapse-item-content"},xu={},Cu=i.defineComponent({...xu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.inject("itemHeaderClickHandler",H.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=H.some(a,m=>m===r.name),d=i.computed(()=>H.some(l,m=>m===r.name)),h=i.ref(c),u=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return t({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||u()},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)}),(m,_)=>{const y=fu;return i.openBlock(),i.createElementBlock("div",{"data-name":m.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":m.disabled})},[i.createElementVNode("div",gu,[i.createElementVNode("div",mu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:u},[i.renderSlot(m.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(Dn).hasSlotContent(m.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",_u,[i.createElementVNode("div",yu,[i.renderSlot(m.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",bu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:u},[i.renderSlot(m.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(m.title),1)],!0)]),i.unref(Dn).hasSlotContent(m.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",wu,[i.renderSlot(m.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Dn).hasSlotContent(m.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vu,[i.renderSlot(m.$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",ku,[i.renderSlot(m.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pu)}}}),Hn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ya=Hn(Cu,[["__scopeId","data-v-415a3dda"]]),xr=Symbol(),Su={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"}},Bu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Tu={},ba=i.defineComponent({...Tu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>H.isNil(t.productContextButtonsConfig)?[]:H.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=_a,h=I.NButton,u=I.NTooltip,p=ma,f=ga,g=I.NDropdown;return i.openBlock(),i.createElementBlock("div",Bu,[(i.unref(H.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(u,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину "))]),_:1,__:[0]})):i.createCommentVNode("",!0),(i.unref(H.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(u,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Eu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $u(e,t){return i.openBlock(),i.createElementBlock("svg",Eu,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)]))}const Nu=i.markRaw({name:"tabler-history",render:$u}),Ru={class:"flex flex-row gap-1"},Pu={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Fu={key:1,class:"flex flex-row text-nowrap text-sm"},Mu={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Au={},Cr=i.defineComponent({...Au,__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(e){const t=e,n=i.computed(()=>H.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:H.get(t.product,t.costFieldName)),s=i.computed(()=>t.additionalThroughFieldName?H.get(t.product,t.additionalThroughFieldName):void 0),o=i.computed(()=>t.product.costDate?Tn.format(t.product.costDate,U.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(H.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!H.isNil(r.value)),l=i.computed(()=>H.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const h=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>H.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var m;const p=I.NTag,f=I.NTooltip,g=Nu;return i.openBlock(),i.createElementBlock("div",Ru,[h.showTag?(i.openBlock(),i.createBlock(f,{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 _;return[i.createTextVNode(i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var _;return[i.createTextVNode(" "+i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value?(i.openBlock(),i.createElementBlock("span",Pu,i.toDisplayString(d.value)+" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(m=n.value)==null?void 0:m.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&h.eventEmitter}),onClick:u[0]||(u[0]=()=>{var _;a.value&&((_=h.eventEmitter)==null||_.emit("cost:click",{product:h.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Fu," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(h.showQuantityUnit?`₽/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),h.showCostDate&&!i.unref(H.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Mu,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),h.showPriceHistory&&h.eventEmitter?(i.openBlock(),i.createBlock(f,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:u[1]||(u[1]=_=>{var y;return(y=h.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:h.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vu(e,t){return i.openBlock(),i.createElementBlock("svg",Iu,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)]))}const Bs=i.markRaw({name:"ion-information-circle-outline",render:Vu}),Ou={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zu(e,t){return i.openBlock(),i.createElementBlock("svg",Ou,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)]))}const wa=i.markRaw({name:"ion-images",render:zu});/*!
|
|
2
2
|
* lightgallery | 2.8.3 | March 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 Br=function(){return Br=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)},Hu={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"}},un={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ts=500,Wu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Br(Br({},Hu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(un.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var p=this.getPossibleSwipeDragCords(n),f,g,m=o-this.pageX,_=a-this.pageY;if(t-n>1){var y=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(y+(n<0?-1:1)),_=(n<0?-_:_)+this.top*(y+(n<0?-1:1)),f=m/y,g=_/y}else{var y=(t-n)*n;f=m*y,g=_*y}r&&(u?this.isBeyondPossibleLeft(f,p.minX)?f=p.minX:this.isBeyondPossibleRight(f,p.maxX)&&(f=p.maxX):t>1&&(f<p.minX?f=p.minX:f>p.maxX&&(f=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:f,y:g,scale:t}),this.left=f,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},Ts),setTimeout(function(){var r=t.getCurrentImageActualSizeScale();if(t.scale>=r){var s=t.getDragAllowedAxises(t.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),t.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ts+50)},e.prototype.setZoomStyles=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=t.scale,r.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),s.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var o="translate3d("+t.x+"px, "+t.y+"px, 0)";n.css("transform",o)},e.prototype.setActualSize=function(t,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(t),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ts+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(un.containerResize+".zoom "+un.rotateRight+".zoom "+un.rotateLeft+".zoom "+un.flipHorizontal+".zoom "+un.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(un.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(un.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(un.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var u=t.scale-o;t.zoomImage(t.scale,Math.round((u+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,p.minY)?u.y=p.minY:this.isBeyondPossibleBottom(u.y,p.maxY)&&(u.y=p.maxY)),r&&(this.isBeyondPossibleLeft(u.x,p.minX)?u.x=p.minX:this.isBeyondPossibleRight(u.x,p.maxX)&&(u.x=p.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-t.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;t&&(o=o+t*o,a=a+t*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var f=t.getDragAllowedAxises(0);a=f.allowY,o=f.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var f=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,f))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var f=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,f)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var f=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target)){c=new Date,u=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(p){if(s){o=!0,r=t.getDragCords(p);var f=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,f)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var f=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,f)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}();const ju={ref:"gallery-container",class:"lightgallery-wrapper"},Xu={},va=i.defineComponent({...Xu,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...t.settings}),H.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",ju,[i.renderSlot(o.$slots,"default")],512))}}),st=class st{static init(){st.isInitialized||(st.isInitialized=!0,st.windowResizeHandler(),window.addEventListener("resize",st.windowResizeHandler))}static destroy(){window.removeEventListener("resize",st.windowResizeHandler),st.isInitialized=!1}static getDeviceTypeByResolution(){const t=U.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<t.tablet?qe.phone:window.innerWidth<t.laptop?qe.tablet:qe.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return st.setRefValueDependingOnDeviceResolution(s,t,n,r),st.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return st.getDeviceTypeByResolution()===qe.phone}static isTabletDevice(){return st.getDeviceTypeByResolution()===qe.tablet}static isLaptopDevice(){return st.getDeviceTypeByResolution()===qe.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(st.getDeviceTypeByResolution()){case qe.phone:t.value=n;break;case qe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){H.forEach(st.refsDependingOnDeviceResolution,t=>{st.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};x(st,"isInitialized",!1),x(st,"refsDependingOnDeviceResolution",[]);let wt=st;const qu=["href"],Yu=["src","alt"],Uu={},ka=i.defineComponent({...Uu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Du,Wu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===qe.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const u=wa,p=I.NPopover;return i.openBlock(),i.createBlock(p,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(va,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,Yu)],8,qu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Gu={class:"flex flex-col text-sm"},Ku={},Zu=i.defineComponent({...Ku,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Bs,s=I.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Gu,[(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})}}}),Ju={class:"flex flex-row justify-between"},Qu={key:0},ef={class:"ml-2 align-sub"},tf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},nf={class:"@container"},rf={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},sf={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},of={class:"text-sc-dark-grey"},af={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},lf={class:"text-gray-600"},cf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},df={key:3,class:"underline decoration-dashed"},hf={key:4,class:"sc-product-pack whitespace-nowrap"},uf={class:"text-gray-600"},ff={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},pf={class:"text-gray-600"},gf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},mf={key:0},_f={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},yf={},Yi=i.defineComponent({...yf,__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,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>H.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>H.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>H.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return t({showProductImagesPreview:l}),(h,u)=>{var y,b,S,C,v;const p=wa,f=I.NText,g=ba,m=Bs,_=I.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Ju,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Qu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",ef,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ka,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",tf,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((y=h.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",nf,[i.createElementVNode("div",rf,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",sf,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",of,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",af,[u[1]||(u[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",lf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Zu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",cf,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",df," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",hf,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",uf,i.toDisplayString((v=(C=h.product)==null?void 0:C.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",ff,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",pf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",gf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Cr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"show-cost-date":h.showCostDate,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","show-cost-date","currency-rates"]))),128)),i.createVNode(Cr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":h.showCostDate,"show-price-history":h.showPriceHistory,"currency-rates":h.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}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",mf,[i.createElementVNode("ul",_f,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),bf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(Cr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),wf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(wt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})}),t.showProductCosts&&(H.forEach(e,s=>{H.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),H.forEach(H.sortBy(r,["slug"]),s=>{n.push(bf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Cr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||!H.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ba,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},vf={key:0,class:"pt-0.5"},kf={class:"flex flex-row gap-1"},xf={key:0},Cf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Sf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Bf={},Tf=i.defineComponent({...Bf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>{var $;return($=t==null?void 0:t.filteredItems)==null?void 0:$[t.categoryItem.id]}),s=i.computed(()=>{var $,X;return H.isArray(($=t.categoryItem)==null?void 0:$.categories)&&((X=t.categoryItem.categories)==null?void 0:X.length)>0}),o=i.computed(()=>{var $;return H.isArray(($=t.categoryItem)==null?void 0:$.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([$,X])=>`${X} руб./${C($)}`).join(", ")),l=i.computed(()=>H.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter($=>{var X,F;return(F=(X=r.value)==null?void 0:X.products)==null?void 0:F.includes($.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>H.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>H.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),u=i.computed(()=>H.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>H.isNil(t.categoryContextButtonsConfig)?[]:H.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),f=i.computed(()=>new U.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),_=i.computed(()=>!H.isUndefined(t.selectedCategoriesItems)),y=i.computed(()=>(t.selectedCategoriesItems??[]).some($=>$.id===t.categoryItem.id)),b=i.computed(()=>q.value&&wt.getDeviceTypeByResolution()===qe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),C=($,X="ru-RU")=>0 .toLocaleString(X,{style:"currency",currency:$,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),v=$=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:$,target:S.value})},B=($,X)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:X,isLoadingState:g,target:S.value})},k=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem,target:S.value})},E=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem,target:S.value})},P=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem,target:S.value})},R=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem,target:S.value})},j=$=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:$,target:S.value})},q=i.ref(0),M=i.computed(()=>q.value&&o.value.length>0?wf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),A=H.debounce(()=>{q.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",A)}),window.addEventListener("resize",A),A(),($,X)=>{const F=I.NCheckbox,N=du,W=I.NTooltip,z=au,G=_a,V=I.NTag,O=nu,J=Qh,he=I.NButton,ie=Kh,ge=ma,re=ga,Fe=I.NDropdown,Me=I.NDataTable,Ge=I.NAlert,Le=I.NSpin;return i.openBlock(),i.createBlock(ya,{name:$.categoryItem.id,"data-id":$.categoryItem.id,"onHeader:click":B},{"pre-arrow":i.withCtx(()=>{var Pe,$e,ot;return[_.value?(i.openBlock(),i.createElementBlock("div",vf,[i.createVNode(F,{checked:y.value,"onUpdate:checked":v},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((Pe=f.value)!=null&&Pe.isDisabled)?(i.openBlock(),i.createBlock(W,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[1]||(X[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),(($e=f.value)==null?void 0:$e.isFavorite)??!1?(i.openBlock(),i.createBlock(W,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[2]||(X[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((ot=f.value)==null?void 0:ot.isRequired)??!1?(i.openBlock(),i.createBlock(W,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(G,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[3]||(X[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Pe,$e,ot;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":$.categoryItem.isHidden,"text-gray-400":(Pe=f.value)==null?void 0:Pe.isDisabled})},[i.createVNode(W,{disabled:!$.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString($.categoryItem.name),1)]),default:i.withCtx(()=>[X[4]||(X[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:X[0]||(X[0]=i.withModifiers((...De)=>i.unref(H.noop)&&i.unref(H.noop)(...De),["prevent","stop"]))},[($e=$.categoryItem.properties)!=null&&$e.m2Price?(i.openBlock(),i.createBlock(V,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString($.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(V,{key:1,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((ot=f.value)!=null&&ot.manager)?(i.openBlock(),i.createBlock(V,{key:2,size:i.unref(n),closable:!0,round:"",onClose:P},{default:i.withCtx(()=>[i.createVNode(W,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var De,ct;return[i.createElementVNode("span",kf,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString((ct=(De=f.value)==null?void 0:De.manager)==null?void 0:ct.name),1)])]}),default:i.withCtx(()=>{var De,ct;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((ct=(De=f.value)==null?void 0:De.manager)==null?void 0:ct.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[$.showSlugs||$.showProperties?(i.openBlock(),i.createElementBlock("div",xf,[i.createElementVNode("ul",Cf,[$.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:$.categoryItem.id,slug:$.categoryItem.slug},(Pe,$e)=>(i.openBlock(),i.createElementBlock("li",{key:$e}," ("+i.toDisplayString($e)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0),$.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList($.categoryItem.properties,(Pe,$e)=>(i.openBlock(),i.createElementBlock("li",{key:$e}," ("+i.toDisplayString($e)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Pe;return[i.createElementVNode("div",Sf,[d.value?(i.openBlock(),i.createBlock(W,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:k},{default:i.withCtx(()=>{var $e;return[($e=f.value)!=null&&$e.isDisabled?(i.openBlock(),i.createBlock(N,{key:1})):(i.openBlock(),i.createBlock(J,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var $e;return[($e=f.value)!=null&&$e.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(f.value.hidingComment?`. Причина: '${f.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Pe=f.value)!=null&&Pe.manager)?(i.openBlock(),i.createBlock(W,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:E},{default:i.withCtx(()=>[i.createVNode(ie)]),_:1},8,["size"])]),default:i.withCtx(()=>{var $e,ot,De;return[($e=f.value)!=null&&$e.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(ot=f.value)==null?void 0:ot.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(W,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary",onClick:R},{default:i.withCtx(()=>[i.createVNode(ge)]),_:1},8,["size"])]),default:i.withCtx(()=>[X[5]||(X[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Fe,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:j},{default:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(re)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot($.$slots,"default",{},()=>{var Pe;return[s.value?(i.openBlock(),i.createBlock(Ca,{key:0,"categories-items":$.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":$.eventEmitter,"filtered-items":r.value?((Pe=r.value)==null?void 0:Pe.categories)??{}:void 0,"selected-categories-items":$.selectedCategoriesItems,"selected-products-items":$.selectedProductsItems,"show-slugs":$.showSlugs,"show-properties":$.showProperties,"show-product-costs":$.showProductCosts,"allow-name-click":$.allowNameClick,"allow-price-click":$.allowPriceClick,"show-price-history":$.showPriceHistory,"show-cost-date":$.showCostDate,"show-product-add-to-cart-button":$.showProductAddToCartButton,"show-product-edit-button":$.showProductEditButton,"product-context-buttons-config":$.productContextButtonsConfig,"show-hide-for-client-button":$.showHideForClientButton,"show-pin-button":$.showPinButton,"show-category-edit-button":$.showCategoryEditButton,"category-context-buttons-config":$.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Me,{key:1,columns:M.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":$e=>$e.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(Ge,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(Ge,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Le,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>X[6]||(X[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Ef=Hn(Tf,[["__scopeId","data-v-cd2bea6a"]]),$f={class:"sc-collapse flex w-full flex-col"},Nf={},xa=i.defineComponent({...Nf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",$f,[i.renderSlot(o.$slots,"default")]))}}),Rf={},Ca=i.defineComponent({...Rf,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>H.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(H.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=I.NSpin,c=I.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Ef,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-cost-date":o.showCostDate,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0),!o.hasProducts&&!o.loading&&o.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Pf={class:"text-sm"},Ff={class:"text-sm"},Mf={},Af=i.defineComponent({...Mf,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,u,p,f,g;const n=e,r=i.ref(new U.CartItemBase(n.cartItem??new U.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(u=n.product)==null?void 0:u.properties)!=null&&p.ignoreMinCountCheck?0:(g=(f=n.product)==null?void 0:f.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,C,v,B,k,E,P;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((C=(S=n.product)==null?void 0:S.properties)!=null&&C.ignoreMinCountCheck?0:(B=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),_=(E=(k=n.product)==null?void 0:k.properties)==null?void 0:E.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{U.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(I.NInputNumber),{value:r.value.length,"onUpdate:value":_[0]||(_[0]=S=>r.value.length=S),max:((y=m.product.properties)==null?void 0:y.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Pf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(U.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ff,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInput),{value:r.value.marker,"onUpdate:value":_[2]||(_[2]=y=>r.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:_[3]||(_[3]=y=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),If={},Sa=i.defineComponent({...If,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>H.isArray(r.value)),a=new U.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=H.isUndefined(r.value)?f:r.value;return H.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>zt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=f=>{var g;if(H.isArray(f)){const m=f.length>0?f.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=f===a.id||(g=c.value.find(_=>_.value===f))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(I.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":f.consistentMenuWidth,disabled:f.disabled||c.value.length===0,filterable:f.filterable,"max-tag-count":f.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Vf={},Of=i.defineComponent({...Vf,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,C;const n=e,r=t,s=()=>{const v=U.PriceCoefficient.getRetailPriceCoefficient();return H.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,E,P;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():(P=(E=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:E.find(R=>R.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=U.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const E=c(k);E?k.name+=` (${E} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((C=(S=n.value)==null?void 0:S.value)==null?void 0:C.toString())??null),p=i.ref(null),f=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===U.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,E;g.value=void 0;let v=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||u.value){const P=s(),R=c(h.value??P)??0,j=R+R*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(j),j>(((k=l.value)==null?void 0:k.getRetailCost())??j)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&j<(((E=f.value)==null?void 0:E.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},_=v=>{H.isArray(v)||(h.value=v,!h.value&&u.value&&(h.value=s()),m())},y=()=>{h.value||(h.value=s()),m()},b=v=>{var k,E,P,R,j,q;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let M=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((k=f.value)==null?void 0:k.cost)??0))h.value=(E=f.value)==null?void 0:E.coefficient,M=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.getRetailCost())??B)){h.value=s();const A=((R=l.value)==null?void 0:R.getRetailCost())??0;M=(B-A)*100/A,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const A=(q=(j=l.value)==null?void 0:j.priceCoefficients)==null?void 0:q.filter($=>$.cost<B);if(A&&A.length>0){const $=A.at(-1);h.value=$==null?void 0:$.coefficient,M=(B-(($==null?void 0:$.cost)??0))*100/(($==null?void 0:$.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(M),r("update:value",{value:Number.isNaN(M)?void 0:M,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{m()}),(v,B)=>{var P,R,j;const k=I.NInput,E=I.NInputGroup;return i.openBlock(),i.createBlock(i.unref(I.NFormItem),{"show-label":!i.unref(H.isNil)(v.label),label:v.label,"show-feedback":!i.unref(H.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((R=g.value)==null?void 0:R.feedback)??v.feedback,"validation-status":((j=g.value)==null?void 0:j.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"grid-cols-1":!a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost,"grid-cols-3":a.value&&v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full gap-2"])},[v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(E,{key:0,class:i.normalizeClass({"col-span-2":a.value})},{default:i.withCtx(()=>[i.createVNode(Sa,{value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":_},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:u.value,"onUpdate:value":[B[0]||(B[0]=q=>u.value=q),y],clearable:v.clearable,disabled:v.disabled,placeholder:""},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%"))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + "))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=q=>p.value=q),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var q;return[i.createTextVNode(i.toDisplayString((q=l.value)==null?void 0:q.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),zf={class:"flex flex-row gap-1"},Lf={class:"sc-client-name flex flex-col gap-1 text-base"},Df=["href"],Hf={key:1,class:"text-sc-grey"},Wf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},jf={key:0},Xf={key:1,class:"text-sm"},qf={},Tr=i.defineComponent({...qf,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Tn.format(n.client.lastLoginAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{H.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Bs,d=I.NButton,h=I.NPopover;return i.openBlock(),i.createElementBlock("div",zf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(H.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Lf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",Hf," [ Деактивирован ] "))],8,Df),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Wf," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",jf,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Xf," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Yf={class:"text-base"},Uf={},Ba=i.defineComponent({...Uf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",Yf,i.toDisplayString(t.contragent.name),1))}}),Gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Kf(e,t){return i.openBlock(),i.createElementBlock("svg",Gf,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)]))}const Zf=i.markRaw({name:"tabler-mail",render:Kf}),Jf=["href"],Qf={},ep=i.defineComponent({...Qf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=Zf;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,Jf)],2)}}}),tp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function np(e,t){return i.openBlock(),i.createElementBlock("svg",tp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)]))}const Ta=i.markRaw({name:"fa6-brands-viber",render:np}),ip={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},rp=["id"],sp=["id"],op=["fill"],ap=["fill"];function lp(e,t){return i.openBlock(),i.createElementBlock("svg",ip,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon0,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)]),8,rp),i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon1,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)]),8,sp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon0+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,op),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon1+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,ap),t[2]||(t[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ea=i.markRaw({name:"logos-whatsapp-icon",render:lp,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),cp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},dp=["id"],hp=["fill"];function up(e,t){return i.openBlock(),i.createElementBlock("svg",cp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosTelegram0,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)]),8,dp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosTelegram0+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,hp),t[1]||(t[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const $a=i.markRaw({name:"logos-telegram",render:up,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pp(e,t){return i.openBlock(),i.createElementBlock("svg",fp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)]))}const Na=i.markRaw({name:"ion-call",render:pp}),gp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mp(e,t){return i.openBlock(),i.createElementBlock("svg",gp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)]))}const _p=i.markRaw({name:"tabler-phone-call",render:mp}),yp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},bp=["href"],wp=["href"],vp=["href"],kp=["href"],xp={},Cp=i.defineComponent({...xp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Xi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return H.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return H.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return H.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=_p,h=Na,u=$a,p=Ea,f=Ta;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":l.showPhoneIcon})},[l.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",yp,[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,bp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,wp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(p)],8,vp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(f)],8,kp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bp(e,t){return i.openBlock(),i.createElementBlock("svg",Sp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)]))}const Tp=i.markRaw({name:"mdi-envelope",render:Bp}),Ep={class:"flex flex-col gap-1"},$p={key:0,class:"mb-2 flex flex-col text-base"},Np={key:0,class:"text-sc-dark-grey text-sm"},Rp={key:1,class:"whitespace-nowrap text-sm"},Pp={key:2,class:"whitespace-nowrap text-sm"},Fp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Mp=["href"],Ap=["href"],Ip=["href"],Vp=["href"],Op=["href"],zp={key:0,class:"flex flex-col text-base"},Lp={key:0,class:"text-sc-dark-grey text-sm"},Dp={key:1,class:"mt-2 text-sm"},Hp={key:0,class:"-mt-1"},Wp={},jp=i.defineComponent({...Wp,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Xi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return H.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return H.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return H.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var _,y;const h=Na,u=$a,p=Ea,f=Ta,g=Tp,m=I.NPopover;return i.openBlock(),i.createElementBlock("div",Ep,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,C,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",$p,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(C=c.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",Np,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Rp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Pp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Fp,[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,Mp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Ap)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(p)],8,Ip)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(f)],8,Vp)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Op)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,C,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",zp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Lp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=c.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",Dp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Hp,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=c.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}}),Xp={key:0,class:"flex w-fit items-center gap-2"},qp={key:1,class:"flex flex-wrap gap-1"},Yp={key:0},Up={},Ui=i.defineComponent({...Up,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=I.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Xp,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",qp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Yp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Gp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Kp(e,t){return i.openBlock(),i.createElementBlock("svg",Gp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)]))}const Er=i.markRaw({name:"ion-close",render:Kp}),Zp={class:"mr-3 flex flex-col gap-2"},Jp=["onClick"],Qp={class:"h-full p-2"},eg={},tg=i.defineComponent({...eg,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=Er;return i.openBlock(),i.createBlock(i.unref(I.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(I.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Qp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Jp)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Ra=Hn(tg,[["__scopeId","data-v-828c3059"]]),ng={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ig(e,t){return i.openBlock(),i.createElementBlock("svg",ng,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)]))}const Pa=i.markRaw({name:"ion-trash",render:ig}),rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sg(e,t){return i.openBlock(),i.createElementBlock("svg",rg,t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const Fa=i.markRaw({name:"ion-plus",render:sg}),og={class:"flex flex-col gap-4"},ag={class:"flex flex-col gap-2"},lg={class:"mt-8 font-bold"},cg={class:"grid grow grid-cols-2 items-start gap-2"},dg={class:"flex flex-col gap-4"},hg={class:"flex gap-3"},ug={},Ma=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","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new U.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=H.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Fa,u=Pa,p=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var f,g,m,_,y,b,S,C,v;return[i.createElementVNode("div",og,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ag,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var E,P,R,j,q,M;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",lg,i.toDisplayString(k+1),1),i.createElementVNode("div",cg,[i.createVNode(i.unref(I.NFormItem),{label:"Ширина, мм",required:!0,feedback:((E=c.validation[`lines_widths[${k+1}]`])==null?void 0:E.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${k+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[A=>s.value.linesWidths[k]=A,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:A=>A%c.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((j=c.validation[`lines_angles[${k+1}]`])==null?void 0:j.feedback)||"","show-feedback":((q=c.validation[`lines_angles[${k+1}]`])==null?void 0:q.showFeedback)||!1,"validation-status":(M=c.validation[`lines_angles[${k+1}]`])==null?void 0:M.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[A=>s.value.linesAngles[k]=A,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:A=>A%c.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(I.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"medium",onClick:A=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:A=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ")])),_:1,__:[9]},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",dg,[i.createVNode(i.unref(I.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((f=c.validation.length)==null?void 0:f.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((_=c.validation.quantity)==null?void 0:_.showFeedback)||!1,feedback:((y=c.validation.quantity)==null?void 0:y.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((C=c.validation.marker)==null?void 0:C.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",hg,[i.createVNode(i.unref(I.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Aa=Object.defineProperty,fg=Object.defineProperties,pg=Object.getOwnPropertyDescriptors,Ia=Object.getOwnPropertySymbols,gg=Object.prototype.hasOwnProperty,mg=Object.prototype.propertyIsEnumerable,Es=(e,t,n)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$s=(e,t)=>{for(var n in t||(t={}))gg.call(t,n)&&Es(e,n,t[n]);if(Ia)for(var n of Ia(t))mg.call(t,n)&&Es(e,n,t[n]);return e},Ns=(e,t)=>fg(e,pg(t)),Va=(e,t)=>{for(var n in t)Aa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Es(e,typeof t!="symbol"?t+"":t,n),n),Oa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Et=(e,t,n)=>(Oa(e,t,"read from private field"),n?n.call(e):t.get(e)),za=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_g=(e,t,n,r)=>(Oa(e,t,"write to private field"),t.set(e,n),n),vt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return vt.shim(e),typeof t<"u"&&(vt.Image=t),vt.isHeadless=!0,e}},La={};Va(La,{Curve:()=>xi,getAnchorsFromArcData:()=>wg,getComponentOnCubicBezier:()=>Gi,getControlPoints:()=>Ja,getCurveBoundingBox:()=>Ga,getCurveFromPoints:()=>Za,getCurveLength:()=>Ua,getReflection:()=>Fs,integrate:()=>Ka,subdivide:()=>Ps});var Da={};Va(Da,{HALF_PI:()=>Je,NumArray:()=>Zt,TWO_PI:()=>ht,decomposeMatrix:()=>ki,getComputedMatrix:()=>ja,getPoT:()=>Xa,lerp:()=>Ft,mod:()=>Mt,setMatrix:()=>Wa,toFixed:()=>Ne});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var Ha,ht=Math.PI*2,Je=Math.PI*.5;function ki(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function Wa(e){Ha=e}function ja(e,t){t=t&&t.identity()||new Ha;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Ft(e,t,n){return n*(t-e)+e}var Rs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Xa(e){let t=0;for(;Rs[t]&&Rs[t]<e;)t++;return Rs[t]}function Mt(e,t){for(;e<0;)e+=t;return e%t}var Zt=He.Float32Array||Array,yg=Math.floor;function Ne(e){return yg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Y=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}};w(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 qa={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(Y.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(Y.Types.change))}}},Xt=class extends Y{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in qa)Object.defineProperty(this,n,qa[n]);this.x=e,this.y=t}static add(e,t){return new Xt(e.x+t.x,e.y+t.y)}static sub(e,t){return new Xt(e.x-t.x,e.y-t.y)}static subtract(e,t){return Xt.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(Xt.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new Xt(this.x,this.y)}add(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ne(this.x),y:Ne(this.y)}}rotate(e){const t=this.x,n=this.y,r=Math.cos(e),s=Math.sin(e);return this.x=t*r-n*s,this.y=t*s+n*r,this}},Z=Xt;w(Z,"zero",new Xt),w(Z,"left",new Xt(-1,0)),w(Z,"right",new Xt(1,0)),w(Z,"up",new Xt(0,-1)),w(Z,"down",new Xt(0,1));var ve=class extends Z{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ee.move){super(t,n),w(this,"controls",{left:new Z,right:new Z}),w(this,"_command",ee.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in Ya)Object.defineProperty(this,d,Ya[d]);this.command=l,this.relative=!0;const c=ve.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(t){return n;function n(){t._bound&&t.dispatchEvent(Y.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().copy(this)}toObject(){return{x:Ne(this.x),y:Ne(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ne(this.rx),ry:Ne(this.ry),xAxisRotation:Ne(this.xAxisRotation),largeArcFlag:Ne(this.largeArcFlag),sweepFlag:Ne(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},Ya={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(Y.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(Y.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(Y.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(Y.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(Y.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(Y.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(Y.Types.change))}}},bg=0,kt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.18",PublishDate:"2025-04-07T22:33:48.746Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return bg++}},xi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Gi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ps(e,t,n,r,s,o,a,l,c){c=c||xi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Gi(p,e,n,s,a),g=Gi(p,t,r,o,l);h.push(new ve(f,g))}return h}function Ua(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(p*_+f)*_+g;return Math.sqrt(y*y+b*b)}return Ka(m,0,1,c||xi.RecursionLimit)}function Ga(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}_=u*u-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,C;for(;b--;)f=c[b],C=1-f,d[0][b]=C*C*C*e+3*C*C*f*n+3*C*f*f*s+f*f*f*a,d[1][b]=C*C*C*t+3*C*C*f*r+3*C*f*f*o+f*f*f*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ka(e,t,n,r){let s=xi.abscissas[r-2],o=xi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Za(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Mt(s-1,n):Math.max(s-1,0),l=t?Mt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ja(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ja(e,t,n){const r=Z.angleBetween(e,t),s=Z.angleBetween(n,t);let o=Z.distanceBetween(e,t),a=Z.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function Fs(e,t,n){return new Z(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function wg(e,t,n,r,s,o,a){const l=kt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),p=r*Math.sin(h),f=new ve(u,p);f.command=ee.line}}var Qa=Array.prototype.slice;function vg(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!vg(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:He.performance&&He.performance.now?He.performance:Date},At={hasEventListeners:typeof He.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),At},unbind:function(e,t,n,r){return At.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),At},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=He.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=He[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=He.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},Ci=He.document?He.document.createElement("div"):{};Ci.id="help-two-load",Object.defineProperty(At,"temp",{enumerable:!0,get:function(){return ae.isElement(Ci)&&!He.document.head.contains(Ci)&&(Ci.style.display="none",He.document.head.appendChild(Ci)),Ci}});var $t=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},kg=He.devicePixelRatio||1;function xg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ms(e){return kg/xg(e)}var $r=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},ut,En=class extends Array{constructor(){super(),za(this,ut,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 Et(this,ut)}set _events(t){_g(this,ut,t)}get _bound(){return Et(this,ut)._bound}set _bound(t){Et(this,ut)._bound=t}addEventListener(){return Et(this,ut).addEventListener.apply(this,arguments)}on(){return Et(this,ut).on.apply(this,arguments)}bind(){return Et(this,ut).bind.apply(this,arguments)}removeEventListener(){return Et(this,ut).removeEventListener.apply(this,arguments)}off(){return Et(this,ut).off.apply(this,arguments)}unbind(){return Et(this,ut).unbind.apply(this,arguments)}dispatchEvent(){return Et(this,ut).dispatchEvent.apply(this,arguments)}trigger(){return Et(this,ut).trigger.apply(this,arguments)}listen(){return Et(this,ut).listen.apply(this,arguments)}ignore(){return Et(this,ut).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(Y.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(Y.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(Y.Types.remove,t),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 t}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(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};ut=new WeakMap;var el=class extends Y{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",kt.Identifier+kt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in tl)Object.defineProperty(this,e,tl[e])}static fromObject(e){const t=new el().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Wn=el;w(Wn,"Properties",["renderer","id","className"]);var tl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Nr,nl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Nr=document.createElement("a"));var Qe=class extends Wn{constructor(e,t){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let n in il)Object.defineProperty(this,n,il[n]);if(this._renderer.type="texture",this._renderer.flagOffset=Cg.bind(this),this._renderer.flagScale=Sg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof t=="function"){const n=(function(){this.unbind(Y.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(Y.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new Qe().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Nr?(Nr.href=e,Nr.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=Qe.getAbsoluteURL(e);if(Qe.ImageRegistry.contains(t))return Qe.ImageRegistry.get(t);let n;return vt.Image?(n=new vt.Image,vt.shim(n,"img")):He.document?nl.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=Qe.getTag(n);e._flagImage&&(/canvas/i.test(r)?Qe.Register.canvas(e,t):(e._src=!vt.isHeadless&&n.getAttribute("two-src")||n.src,Qe.Register[r](e,t))),e._flagSrc&&(n||(n=Qe.getImage(e.src),e.image=n),r=Qe.getTag(n),Qe.Register[r](e,t))}clone(){const e=new Qe(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(Y.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Qe.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("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Be=Qe;w(Be,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Be,"RegularExpressions",nl),w(Be,"ImageRegistry",new $r),w(Be,"Register",{canvas:function(e,t){e._src="#"+e.id,Qe.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!vt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!vt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new $t("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!vt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Qe.getAbsoluteURL(e._src),!(!vt.isHeadless&&n&&n.getAttribute("two-src"))&&(vt.isHeadless||n.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,n),vt.isHeadless?Qe.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(vt.isHeadless)throw new $t("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new $t("unable to load "+e.src)};e._src=Qe.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var il={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Be.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Be.ImageRegistry.contains(n)?this._image=Be.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(Y.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(Y.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Z&&this._scale.bind(Y.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Cg(){this._flagOffset=!0}function Sg(){this._flagScale=!0}var qt=class extends Wn{constructor(e,t,n){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let r in rl)Object.defineProperty(this,r,rl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:qt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:qt.Index<=0?"#fff":"#000",qt.Index=(qt.Index+1)%2}static fromObject(e){const t=new qt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<qt.Properties.length;t++){const n=qt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new qt;return ae.each(qt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ae.each(qt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Jt=qt;w(Jt,"Index",0),w(Jt,"Properties",["offset","opacity","color"]);var rl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},jn=class extends Wn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in sl)Object.defineProperty(this,t,sl[t]);this._renderer.type="gradient",this._renderer.flagStops=Bg.bind(this),this._renderer.bindStops=Tg.bind(this),this._renderer.unbindStops=Eg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof Jt?r:new Jt().copy(r)));const n=new jn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new jn(t);return ae.each(jn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<jn.Properties.length;t++){const n=jn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(jn.Properties,t=>{e[t]=this[t]},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}},Ue=jn;w(Ue,"Stop",Jt),w(Ue,"Properties",["spread","stops","units"]);var sl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),this._stops=new En((e||[]).slice(0)),this._stops.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._stops)}}};function Bg(){this._flagStops=!0}function Tg(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Eg(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ki=class extends Ue{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in ol)Object.defineProperty(this,o,ol[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=$g.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ki(this.left._x,this.left._y,this.right._x,this.right._y,t);return ae.each(Ue.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Ie=Ki;w(Ie,"Stop",Jt),w(Ie,"Properties",["left","right"]);var ol={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Z&&this._left.unbind(Y.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof Z&&this._right.unbind(Y.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function $g(){this._flagEndPoints=!0}var Xn=class extends Ue{constructor(e,t,n,r,s,o){super(r),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let a in al)Object.defineProperty(this,a,al[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Ng.bind(this),this._renderer.flagFocal=Rg.bind(this),this.center=new Z,this.radius=typeof n=="number"?n:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Xn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Xn.Properties.length;t++){const n=Xn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Xn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(Ue.Properties.concat(Xn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Xn.Properties,function(t){e[t]=this[t]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ve=Xn;w(Ve,"Stop",Jt),w(Ve,"Properties",["center","radius","focal"]);var al={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(Y.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(Y.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(Y.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(Y.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Ng(){this._flagCenter=!0}function Rg(){this._flagFocal=!0}function ll(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Rr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function cl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ua(r,l,s,c,o,d,a,h,n)}function dl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ps(r,l,s,c,o,d,a,h,n)}function qn(e){switch(e.renderer.type){case"texture":return Be.fromObject(e);case"gradient":return Ue.fromObject(e);case"linear-gradient":return Ie.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var Pg=Math.cos,Fg=Math.sin,hl=Math.tan,As=[],It=class extends Y{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Zt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,E;const P=t[0]||0,R=t[1]||0,j=t[2]||0;return B=v[0]*P+v[1]*R+v[2]*j,k=v[3]*P+v[4]*R+v[5]*j,E=v[6]*P+v[7]*R+v[8]*j,[B,k,E]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],u=e[8],p=t[0],f=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],C=t[8];return n=n||new Zt(9),n[0]=r*p+s*m+o*b,n[1]=r*f+s*_+o*S,n[2]=r*g+s*y+o*C,n[3]=a*p+l*m+c*b,n[4]=a*f+l*_+c*S,n[5]=a*g+l*y+c*C,n[6]=d*p+h*m+u*b,n[7]=d*f+h*_+u*S,n[8]=d*g+h*y+u*C,n}static fromObject(e){return new It().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,this.trigger(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]=It.Identity[0],this.elements[1]=It.Identity[1],this.elements[2]=It.Identity[2],this.elements[3]=It.Identity[3],this.elements[4]=It.Identity[4],this.elements[5]=It.Identity[5],this.elements[6]=It.Identity[6],this.elements[7]=It.Identity[7],this.elements[8]=It.Identity[8],this.trigger(Y.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(Y.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const M=s[0]*e+s[1]*t+s[2]*n,A=s[3]*e+s[4]*t+s[5]*n,$=s[6]*e+s[7]*t+s[8]*n;return[M,A,$]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],p=d[1],f=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],C=h[0],v=h[1],B=h[2],k=h[3],E=h[4],P=h[5],R=h[6],j=h[7],q=h[8];return this.elements[0]=u*C+p*k+f*R,this.elements[1]=u*v+p*E+f*j,this.elements[2]=u*B+p*P+f*q,this.elements[3]=g*C+m*k+_*R,this.elements[4]=g*v+m*E+_*j,this.elements[5]=g*B+m*P+_*q,this.elements[6]=y*C+b*k+S*R,this.elements[7]=y*v+b*E+S*j,this.elements[8]=y*B+b*P+S*q,this.trigger(Y.Types.change)}inverse(e){const t=this.elements;e=e||new It;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],u=h*a-l*d,p=-h*o+l*c,f=d*o-a*c;let g=n*u+r*p+s*f;return g?(g=1/g,e.elements[0]=u*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=f*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Pg(e),n=Fg(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=hl(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=hl(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return As.length=0,this.toTransformArray(e,As),As.map(Ne).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=u,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,u,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=u,t[8]=p;return}return[s,o,a,l,c,d,h,u,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new It().copy(this)}},Yn=It;w(Yn,"Identity",[1,0,0,0,1,0,0,0,1]),Wa(Yn);var Is=class extends Wn{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 Pr)Object.defineProperty(this,e,Pr[e]);this._renderer.flagMatrix=ul.bind(this),this.isShape=!0,this.matrix=new Yn,this.worldMatrix=new Yn,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Is().copy(e);return"id"in e&&(t.id=e.id),t}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Pr.position.get.apply(this,arguments)}set translation(e){Pr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof Z?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const t=new Is;return t.position.copy(this.position),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof Z?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Z?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}},fn=Is;w(fn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Pr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(Y.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(Y.Types.change,this._renderer.flagMatrix),ul.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Z&&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(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return ja(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ul(){this._flagMatrix=!0}var Si=Math.min,Bi=Math.max,Mg=Math.ceil,Ag=Math.floor,Ig=new Z,$n=class extends fn{constructor(e,t,n,r){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in fl)Object.defineProperty(this,s,fl[s]);this._renderer.type="path",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new $n().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<$n.Properties.length;t++){const n=$n.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new $n;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<$n.Properties.length;n++){const r=$n.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),ae.each($n.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:u,scaleY:p}=ki(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof p=="number"&&(n=Math.max(u,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[u,p]=t.multiply(o.x,o.y),[f,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,_=o.controls.right.y;o.relative&&(m+=o.x,_+=o.y);let[y,b]=t.multiply(m,_),S=a.controls.left.x,C=a.controls.left.y;a.relative&&(S+=a.x,C+=a.y);let[v,B]=t.multiply(S,C);const k=Ga(u,p,y,b,v,B,f,g);d=Si(k.min.y-n,d),l=Si(k.min.x-n,l),c=Bi(k.max.x+n,c),h=Bi(k.max.y+n,h)}else s<=1&&(d=Si(p-n,d),l=Si(u-n,l),c=Bi(u+n,c),h=Bi(p+n,h)),d=Si(g-n,d),l=Si(f-n,l),c=Bi(f+n,c),h=Bi(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let C=null,v=null;for(let X=0,F=this._lengths.length,N=0;X<F;X++){if(N+this._lengths[X]>=y){this._closed?(n=Mt(X,b),r=Mt(X-1,b),X===0&&(n=r,r=X)):(n=X,r=Math.min(Math.max(X-1,0),S)),C=this.vertices[n],v=this.vertices[r],y-=N,this._lengths[X]!==0?e=y/this._lengths[X]:e=0;break}N+=this._lengths[X]}if(C===null||v===null)return null;if(C){if(!v)return C}else return v;_=v.controls&&v.controls.right,m=C.controls&&C.controls.left,a=v.x,u=v.y,l=(_||v).x,p=(_||v).y,c=(m||C).x,f=(m||C).y,d=C.x,g=C.y,_&&v.relative&&(l+=v.x,p+=v.y),m&&C.relative&&(c+=C.x,f+=C.y),o=Gi(e,a,l,c,d),h=Gi(e,u,p,f,g);const B=Ft(a,l,e),k=Ft(u,p,e),E=Ft(l,c,e),P=Ft(p,f,e),R=Ft(c,d,e),j=Ft(f,g,e),q=Ft(B,E,e),M=Ft(k,P,e),A=Ft(E,R,e),$=Ft(P,j,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=q,t.controls.left.y=M,t.controls.right.x=A,t.controls.right.y=$,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,q-o,M-h,A-o,$-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Za(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ee.move:ee.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ee.close;let r=this.vertices[t],s=[],o;return ae.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ee.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ee.line),r=a;return}o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ee.close:ee.line),r=a},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,t){t||this._update();const r=this.vertices.length-1;let s=this.vertices[r],o=0;return typeof this._lengths>"u"&&(this._lengths=[]),ae.each(this.vertices,function(a,l){if(l<=0||a.command===ee.move){s=a,this._lengths[l]=0;return}this._lengths[l]=cl(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Rr(this,n*this._length),o=Rr(this,r*this._length),a=Mg(s),l=Ag(o);let c,d,h,u,p,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>l&&!d?(p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,p),p.command=this._renderer.collection[f].command,this._renderer.vertices.push(p),d=p,h=this._collection[f-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(Z.zero,1-p.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):f>=a&&f<=l&&(p=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(p),f===l&&ll(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):f===a&&ll(this,n)&&(c=p,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(f=a-1,p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(n,p),p.command=ee.move,this._renderer.vertices.unshift(p),u=this._collection[f+1],u&&u.controls&&(p.controls.left.clear(),u.relative?this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(Z.zero,p.t):(Ig.copy(u),this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(u,p.t))))}return fn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,fn.prototype.flagReset.call(this),this}},xe=$n;w(xe,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(xe,"Utils",{getCurveLength:cl});var fl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),e instanceof En?this._collection=e:this._collection=new En(e||[]),this._collection.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function pl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function gl(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ml(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function _l(){this._flagFill=!0}function yl(){this._flagStroke=!0}var Zi=class extends xe{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in bl)Object.defineProperty(this,o,bl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Zi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zi.Properties.length;t++){const n=Zi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ee.move,this.vertices[1].set(e,-t).sub(this._origin).command=ee.line,this.vertices[2].set(e,t).sub(this._origin).command=ee.line,this.vertices[3].set(-e,t).sub(this._origin).command=ee.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ee.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Zi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}},Nn=Zi;w(Nn,"Properties",["width","height"]);var bl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(Y.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(Y.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ji=class extends Nn{constructor(e,t,n,r,s,o){super(t,n,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this.noStroke(),this.noFill(),e instanceof Be?this.texture=e:typeof e=="string"&&(this.texture=new Be(e)),this.origin=new Z,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ji().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ji.Properties.length;t++){const n=Ji.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const t=new Ji(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,u;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ae.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=ae.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Ft(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,f=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*f+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Fr=Ji;w(Fr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wl={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},Vs,vl=class extends En{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),za(this,Vs,{}),this.attach(t),this.on(Y.Types.insert,this.attach),this.on(Y.Types.remove,this.detach)}get ids(){return Et(this,Vs)}attach(t){for(let n=0;n<t.length;n++){const r=t[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(t){for(let n=0;n<t.length;n++)delete this.ids[t[n].id];return this}};Vs=new WeakMap;var Un=class extends xe{constructor(e,t,n,r,s,o,a){const l=a||kt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ht),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in kl)Object.defineProperty(this,d,kl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Un().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=Mt(e,ht)===Mt(t,ht),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,p,f,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(p=h/u,f=a[d],g=p*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=ee.move;break;default:c=ee.curve}f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=r*m/Math.PI,f.controls.left.x=b*Math.cos(g-Je),f.controls.left.y=b*Math.sin(g-Je),f.controls.right.x=b*Math.cos(g+Je),f.controls.right.y=b*Math.sin(g+Je),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,u=l-1),h=0;h<l;h++)p=h/u,f=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=ee.curve,h<=0&&(c=s?ee.move:ee.line),f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=n*m/Math.PI,f.controls.left.x=b*Math.cos(g+Je),f.controls.left.y=b*Math.sin(g+Je),f.controls.right.x=b*Math.cos(g-Je),f.controls.right.y=b*Math.sin(g-Je),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ee.line}else s||(a[d].command=ee.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ee.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new Un(0,0,t,n,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<xe.Properties.length;l++){const c=xe.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Mr=Un;w(Mr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var kl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Os=Math.cos,zs=Math.sin,Gn=class extends xe{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in xl)Object.defineProperty(this,a,xl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Gn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ht,l=n*Os(a),c=n*zs(a),d=r*Os(a-Je),h=r*zs(a-Je),u=r*Os(a+Je),p=r*zs(a+Je),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Gn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Qi=Gn;w(Qi,"Properties",["radius"]);var xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Ls=Math.cos,Ds=Math.sin,Kn=class extends xe{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let l in Cl)Object.defineProperty(this,l,Cl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ht,l=n*Ls(a),c=r*Ds(a),d=n*t*Ls(a-Je),h=r*t*Ds(a-Je),u=n*t*Ls(a+Je),p=r*t*Ds(a+Je),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Kn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},er=Kn;w(er,"Properties",["width","height"]);var Cl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Vg=Math.ceil,Og=Math.floor,Rn=class extends fn{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"noFill",xe.prototype.noFill),w(this,"noStroke",xe.prototype.noStroke),w(this,"corner",xe.prototype.corner),w(this,"center",xe.prototype.center),w(this,"getBoundingClientRect",xe.prototype.getBoundingClientRect),w(this,"_updateLength",xe.prototype._updateLength);for(let t in Sl)Object.defineProperty(this,t,Sl[t]);this._renderer.type="points",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new Rn().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Rn.Properties.length;t++){const n=Rn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Rn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Rn.Properties.length;n++){const r=Rn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Rn.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ps(o,a,o,a,l,c,l,c,e);t=t.concat(d)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=Rr(this,e*this._length),r=Rr(this,t*this._length),s=Vg(n),o=Og(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}},Ar=Rn;w(Ar,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var Sl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),e instanceof En?this._collection=e:this._collection=new En(e||[]),this._collection.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},zg=Math.cos,Lg=Math.sin,Zn=class extends xe{constructor(e,t,n,r){r=Math.max(r||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let s in Bl)Object.defineProperty(this,s,Bl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ht*s+Math.PI/2,a=this._width*zg(o)/2,l=this._height*Lg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Zn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Ir=Zn;w(Ir,"Properties",["width","height","sides"]);var Bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Jn=class extends xe{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ee.move:ee.curve));super(o),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Dg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Jn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Z?r:new Z().copy(r):typeof r=="number"&&(this[n]=r)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,t=this._height;let n,r;this._radius instanceof Z?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=this.width,n=this.height,r=this.radius,s=new Jn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},tr=Jn;w(tr,"Properties",["width","height","radius"]);var Tl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof Z&&this._radius.unbind(Y.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Z&&this._radius.bind(Y.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Dg(){this._flagRadius=!0}var Hg=Math.cos,Wg=Math.sin,Qn=class extends xe{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let o in El)Object.defineProperty(this,o,El[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ht*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Hg(o),c=a*Wg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new Qn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];e[n]=this[n]}return e}},Vr=Qn;w(Vr,"Properties",["innerRadius","outerRadius","sides"]);var El={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Hs,$l=Math.min,Nl=Math.max;He.document&&(Hs=document.createElement("canvas"));var Vt=class extends fn{constructor(e,t,n,r){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in Rl)Object.defineProperty(this,s,Rl[s]);if(this._renderer.type="text",this._renderer.flagFill=jg.bind(this),this._renderer.flagStroke=Xg.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!ae.isObject(r))return this;for(let s=0;s<Vt.Properties.length;s++){const o=Vt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Hs){const t=Hs.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Vt.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new Vt().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Vt.Properties.length;t++){const n=Vt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Vt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Vt.Properties.length;n++){const r=Vt.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Vt.Properties.length;t++){const n=Vt.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Vt.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[u,p]=t.multiply(n,o),[f,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=$l(h,p,g,_),n=$l(d,u,f,m),r=Nl(d,u,f,m),o=Nl(h,p,g,_),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}},Lt=Vt;w(Lt,"Ratio",.6),w(Lt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Rl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function jg(){this._flagFill=!0}function Xg(){this._flagStroke=!0}var Or=Math.min,zr=Math.max,Ti=class extends fn{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null);for(let t in Pl)Object.defineProperty(this,t,Pl[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Ti;for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:qn(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Mr.fromObject(r);case"circle":return Qi.fromObject(r);case"ellipse":return er.fromObject(r);case"points":return Ar.fromObject(r);case"polygon":return Ir.fromObject(r);case"rectangle":return Nn.fromObject(r);case"rounded-rectangle":return tr.fromObject(r);case"star":return Vr.fromObject(r);case"path":return xe.fromObject(r);case"text":return Lt.fromObject(r);case"group":return Ti.fromObject(r);case"shape":return fn.fromObject(r);case"element":return Wn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Ti,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,ae.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const u=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const f=this.children[p];if(!(!f.visible||u.test(f._renderer.type))&&(t=f.getBoundingClientRect(e),r=typeof t.top!="number"||ae.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||ae.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||ae.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||ae.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[_,y]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[C,v]=n.multiply(t.right,t.bottom);d=Or(m,y,S,v,d),l=Or(g,_,b,C,l),c=zr(g,_,b,C,c),h=zr(m,y,S,v,h)}else d=Or(t.top,d),l=Or(t.left,l),c=zr(t.right,c),h=zr(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}},Ze=Ti;w(Ze,"Children",vl),w(Ze,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var Pl={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ze.InsertChildren.bind(this),n=Ze.RemoveChildren.bind(this),r=Ze.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new vl(e),this._children.bind(Y.Types.insert,t),this._children.bind(Y.Types.remove,n),this._children.bind(Y.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Fl(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Ws=class extends xe{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Ml)Object.defineProperty(this,a,Ml[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Ml={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new $t("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new $t("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Qt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},qg={start:"left",middle:"center",end:"right"},Al=["id","class","transform","xmlns","viewBox"],Yg=["x","y","width","height","href","xlink:href"];function Ug(e){return qg[e]}function Gg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function nr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Il(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function Kg(e,t){t||(t={});const n=e.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");t[l]=c}return t}function Zg(e){const t={},n=Jg(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function Jg(e){const t=e.getAttributeNames();for(let n=0;n<Al.length;n++){const r=Al[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function Qg(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let u=0;u<e.children.length;u++){const p=e.children[u];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Z(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new Nn(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Dt(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,p,f,g,m,_,y,b,S,C,v,B;if(e===null)return r;if(He.getComputedStyle){const k=He.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?Kg(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ae.defaults(r,n),ae.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=ki(l),t._renderer.type){case"linear-gradient":Il(p,t.left),Il(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=ki(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Z(p.scaleX,p.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(t.translation.x=f),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ze){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ze){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ze){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ze){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ze){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ze){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(Qt.cssBackgroundImage.test(d)&&(m=d.replace(Qt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(y=ze.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=nr(y.nodeName),t.mask=ze[b].call(this,y,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ze?"_":"")+c,Qt.cssBackgroundImage.test(d)?(m=d.replace(Qt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(y=ze.defs.current.get(m),y.object||(b=nr(y.nodeName),y.object=ze[b].call(this,y,{})),y=y.object):(_=tm(this),y=_.getById(m)),t[h]=y):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof Ue,C=t instanceof Ie,v=t instanceof Ve,S||C||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Lt&&(t.family=d);break;case"font-size":t instanceof Lt&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Lt&&(t.weight=d);break;case"font-style":t instanceof Lt&&(t.style=d);break;case"text-decoration":t instanceof Lt&&(t.decoration=d);break;case"line-height":t instanceof Lt&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function em(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||nr(e.nodeName)==="#text"||t.add(s.id,s)}}function tm(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new $r,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)em(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,u=a!==null,p=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(Qt.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(Qt.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(Qt.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(Qt.unitSuffix,""))),d&&Qg(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new $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<e.attributes.length;c++){const d=e.attributes[c],h=Yg.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=nr(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ze;Dt.call(this,e,n,t),this.add(n);const r=Zg.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=nr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new xe(r,!0);return s.stroke="none",s.fill="black",Dt.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;ae.each(h.slice(0),function(p,f){const g=p.slice(1).trim().match(Qt.path),m=p[0],_=m.toLowerCase();let y,b,S,C,v;const B=[];switch(f===0&&(h=[]),_){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(b=0,S=g.length,v=0;b<S;b+=y){if(C=m,v>0)switch(m){case"m":C="l";break;case"M":C="L";break}B.push(C+g.slice(b,b+y).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),ae.each(h,function(p,f){let g,m,_;const y=p[0],b=y.toLowerCase();d=p.slice(1).trim().match(Qt.path),o=y===b;let S,C,v,B,k,E,P,R,j,q,M,A,$,X,F,N,W;switch(b){case"z":if(f>=u)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,ee.close);for(let z=r.length-1;z>=0;z--){const G=r[z];if(/m/i.test(G.command)){l=G;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),_=parseFloat(d[1]),g=new ve(m,_,void 0,void 0,void 0,void 0,/m/i.test(b)?ee.move:ee.line),o&&g.addSelf(l),l=g;break;case"h":case"v":q=/h/i.test(b)?"x":"y",M=/x/i.test(q)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[q]=parseFloat(d[0]),g[M]=l[M],o&&(g[q]+=l[q]),l=g;break;case"c":case"s":S=l.x,C=l.y,c||(c=new Z),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),E=parseFloat(d[3]),P=parseFloat(d[4]),R=parseFloat(d[5])):(j=Fs(l,c,o),v=j.x,B=j.y,k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])),o&&(v+=S,B+=C,k+=S,E+=C,P+=S,R+=C),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,R,k-P,E-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,C=l.y,c||(c=new Z),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])):(j=Fs(l,c,o),v=j.x,B=j.y,k=j.x,E=j.y,P=parseFloat(d[0]),R=parseFloat(d[1])),o&&(v+=S,B+=C,k+=S,E+=C,P+=S,R+=C),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,R,k-P,E-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,C=l.y,$=parseFloat(d[0]),X=parseFloat(d[1]),F=parseFloat(d[2]),N=parseFloat(d[3]),W=parseFloat(d[4]),P=parseFloat(d[5]),R=parseFloat(d[6]),o&&(P+=S,R+=C),A=new ve(P,R),A.command=ee.arc,A.rx=$,A.ry=X,A.xAxisRotation=F,A.largeArcFlag=N,A.sweepFlag=W,g=A,l=A,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new xe(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Dt.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Qi(0,0,s);return o.stroke="none",o.fill="black",Dt.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new er(0,0,s,o);return a.stroke="none",a.fill="black",Dt.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!ae.isNaN(n)||!ae.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Nn(0,0,s,o);return c.stroke="none",c.fill="black",Dt.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new tr(0,0,s,o,c);return d.stroke="none",d.fill="black",Dt.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Ws(n,r,s,o).noFill();return Dt.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let p=0;p<e.children.length;p++){const f=e.children[p];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=f.getAttribute("stop-color"),_=f.getAttribute("stop-opacity"),y=f.getAttribute("style"),b;m===null&&(b=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),_===null?(b=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=b&&b.length>1?parseFloat(b[1]):1):_=parseFloat(_),h.push(new Jt(g,m,_))}const u=new Ie(s,o,a,l,h);return u.spread=r,u.units=n,Dt.call(this,e,u,t),u},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));ae.isNaN(l)&&(l=s),ae.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<e.children.length;f++){const g=e.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let _=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;_===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,_=S&&S.length>1?S[1]:void 0),y===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),u.push(new Jt(m,_,y))}const p=new Ve(s,o,a,u,l,c);return p.spread=r,p.units=n,Dt.call(this,e,p,t),p},text:function(e,t){const n=Ug(e.getAttribute("text-anchor"))||"left",r=Gg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Lt(s);return Dt.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new $t("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Fr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Dt.call(this,e,c,t),c}};function Vl(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ei=class extends Nn{constructor(e,t,n,r){super(t,n,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null);for(let s in Ol)Object.defineProperty(this,s,Ol[s]);this._renderer.flagTextures=nm.bind(this),this._renderer.bindTextures=im.bind(this),this._renderer.unbindTextures=rm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(zl.bind(this)):this.textures=[zl(e)],this.origin=new Z,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ei.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ei.Properties.length;t++){const n=Ei.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const t=new Ei(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ae.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=ae.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Ft(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Be))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Lr=Ei;w(Lr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Lr,"DefaultFrameRate",30);var Ol={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),this._textures=new En((e||[]).slice(0)),this._textures.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function nm(){this._flagTextures=!0}function im(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rm(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function zl(e){if(e instanceof Be)return e;if(typeof e=="string")return new Be(e)}var js=[],Xs=Math.max,sm=Math.min,Ll=Math.abs,Dr=Math.sin,Hr=Math.cos,om=Math.acos,Wr=Math.sqrt,Se={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Se?e:"path"},group:{renderChild:function(e){const t=Se.getRendererType(e._renderer.type);Se[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;this._update();const t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=jr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Se.getRendererType(r._renderer.type);Se[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Se.getRendererType(l._renderer.type);Se[c].render.call(l,e)}return o&&e.restore(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b,S,C,v,B,k,E,P,R,j,q,M,A,$,X,F,N,W,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,$=this._mask,X=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||X||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,p=this._closed,f=this._renderer.vertices,g=f.length,m=g-1,F=jr(r),W=this.dashes,F||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),$){const re=Se.getRendererType($._renderer.type);Se[re].render.call($,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const re=Se.getRendererType(a._renderer.type);Se[re].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const re=Se.getRendererType(s._renderer.type);Se[re].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),W&&W.length>0&&(e.lineDashOffset=W.offset||0,e.setLineDash(W)),e.beginPath();let G,V,O,J,he,ie,ge;for(let re=0;re<g;re++)switch(b=f[re],M=b.x,A=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:G=b.rx,V=b.ry,O=b.xAxisRotation,J=b.largeArcFlag,he=b.sweepFlag,_=p?Mt(re-1,g):Xs(re-1,0),y=f[_],ie=y.x,ge=y.y,Se.renderSvgArcCommand(e,ie,ge,G,V,J,he,O,M,A);break;case ee.curve:_=p?Mt(re-1,g):Math.max(re-1,0),y=f[_],P=y.controls&&y.controls.right||Z.zero,R=b.controls&&b.controls.left||Z.zero,y._relative?(k=P.x+y.x,E=P.y+y.y):(k=P.x,E=P.y),b._relative?(v=R.x+b.x,B=R.y+b.y):(v=R.x,B=R.y),e.bezierCurveTo(k,E,v,B,M,A),re>=m&&p&&(S=C,j=b.controls&&b.controls.right||Z.zero,q=S.controls&&S.controls.left||Z.zero,b._relative?(k=j.x+b.x,E=j.y+b.y):(k=j.x,E=j.y),S._relative?(v=q.x+S.x,B=q.y+S.y):(v=q.x,B=q.y),M=S.x,A=S.y,e.bezierCurveTo(k,E,v,B,M,A));break;case ee.line:e.lineTo(M,A);break;case ee.move:C=b,e.moveTo(M,A);break}return p&&e.closePath(),!X&&!n&&(Se.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),N&&e.restore()),Se.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),N&&e.restore())),F||e.restore(),X&&!n&&e.clip(),W&&W.length>0&&e.setLineDash(js),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,m=jr(r),y=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Se.getRendererType(a._renderer.type);Se[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Se.getRendererType(s._renderer.type);Se[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),e.beginPath();let S=d*.5,C;this._sizeAttenuation||(C=this.worldMatrix.elements,C=ki(C[0],C[3],C[1],C[4],C[2],C[5]),S/=Math.max(C.scaleX,C.scaleY));for(let v=0;v<u;v++)p=h[v],f=p.x,g=p.y,e.moveTo(f+S,g),e.arc(f,g,S,0,ht);return n||(Se.isHidden.test(a)||(_=a._renderer&&a._renderer.offset,_&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),_&&e.restore()),Se.isHidden.test(s)||(_=s._renderer&&s._renderer.offset,_&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),_&&e.restore())),m||e.restore(),y&&y.length>0&&e.setLineDash(js),this.flagReset()}},text:{render:function(e,t,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!t&&(!o||l||s===0))return this;this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,p=this._decoration,f=this._direction,g=jr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Se.alignments[this._alignment]||this._alignment,b=Se.baselines[this._baseline]||this._baseline;let S,C,v,B,k,E,P,R,j,q,M;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const A=Se.getRendererType(a._renderer.type);Se[A].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=y,e.textBaseline=b,e.direction=f,u)if(typeof u=="string")e.fillStyle=u;else{const A=Se.getRendererType(u._renderer.type);Se[A].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const A=Se.getRendererType(d._renderer.type);Se[A].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),!l&&!n&&(Se.isHidden.test(u)||(u._renderer&&u._renderer.offset?(E=u._renderer.scale.x,P=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale(E,P),S=this._size/u._renderer.scale.y,C=this._leading/u._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Se.isHidden.test(d)||(d._renderer&&d._renderer.offset?(E=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(E,P),S=this._size/d._renderer.scale.y,C=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const A=e.measureText(this.value);let $=1;switch(p){case"underline":j=A.actualBoundingBoxDescent,M=A.actualBoundingBoxDescent;break;case"strikethrough":j=0,M=0,$=.5;break}switch(b){case"top":j+=this._size*$,M+=this._size*$;break;case"baseline":case"bottom":j-=this._size*$,M-=this._size*$;break}switch(y){case"left":case"start":R=0,q=A.width;break;case"right":case"end":R=-A.width,q=0;break;default:R=-A.width/2,q=A.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,j),e.lineTo(q,M),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(js),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return this.flagReset()}}},texture:{render:function(e){this._update();const t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ll(r),s=Ll(s);const h=(t-c)/2,u=(n-d)/2,p=Hr(l)*h+Dr(l)*u,f=-Dr(l)*h+Hr(l)*u,g=p*p,m=f*f;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const A=Wr(b);r=A*r,s=A*s,_=r*r,y=s*s}const S=_*m+y*g,C=(_*y-S)/S;let v=Wr(Xs(0,C));o===a&&(v=-v);const B=v*r*f/s,k=-v*s*p/r,E=Hr(l)*B-Dr(l)*k+(t+c)/2,P=Dr(l)*B+Hr(l)*k+(n+d)/2,R=Dl(1,0,(p-B)/r,(f-k)/s),j=Dl((p-B)/r,(f-k)/s,(-p-B)/r,(-f-k)/s)%ht,q=R+j;am(e,E,P,r,s,R,q,a===0,l)}},ft=class extends Y{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ze,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ms(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(Y.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Se.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ft,"Utils",Se);function am(e,t,n,r,s,o,a,l,c){const d=a-o,h=xi.Tolerance.epsilon,u=Math.abs(d)<h;let p=Mt(d,ht);p<h&&(u?p=0:p=ht),l===!0&&!u&&(p===ht?p=-ht:p=p-ht);for(let f=0;f<kt.Resolution;f++){const g=f/(kt.Resolution-1),m=o+g*p;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),C=_-t,v=y-n;_=C*b-v*S+t,y=C*S+v*b+n}e.lineTo(_,y)}}function Dl(e,t,n,r){const s=e*n+t*r,o=Wr(e*e+t*t)*Wr(n*n+r*r);let a=om(Xs(-1,sm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function jr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var se={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(e,t){const n=e,r=document.createElementNS(se.ns,n);return n==="svg"&&(t=ae.defaults(t||{},{version:se.version})),t&&Object.keys(t).length>0&&se.setAttributes(r,t),r},setAttributes:function(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(se.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?Mt(a-1,n):Math.max(a-1,0),d=e[c];let h,u,p,f,g,m,_,y,b,S,C,v,B,k,E,P=Ne(l.x),R=Ne(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:C=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,E=l.sweepFlag,h=ee.arc+" "+C+" "+v+" "+B+" "+k+" "+E+" "+P+" "+R;break;case ee.curve:_=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(p=Ne(_.x+d.x),f=Ne(_.y+d.y)):(p=Ne(_.x),f=Ne(_.y)),l.relative?(g=Ne(y.x+l.x),m=Ne(y.y+l.y)):(g=Ne(y.x),m=Ne(y.y)),h=(a===0?ee.move:ee.curve)+" "+p+" "+f+" "+g+" "+m+" "+P+" "+R;break;case ee.move:s=l,h=ee.move+" "+P+" "+R;break;default:h=l.command+" "+P+" "+R}a>=r&&t&&(l.command===ee.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(p=Ne(b.x+l.x),f=Ne(b.y+l.y)):(p=Ne(b.x),f=Ne(b.y)),u.relative?(g=Ne(S.x+u.x),m=Ne(S.y+u.y)):(g=Ne(S.x),m=Ne(S.y)),P=Ne(u.x),R=Ne(u.y),h+=" C "+p+" "+f+" "+g+" "+m+" "+P+" "+R),l.command!==ee.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(e,t){let n="";const r=t*.5;for(let s=0;s<e.length;s++){const o=e[s].x,a=e[s].y-r;n+=ee.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(e,t){let n=e._renderer.clip;return n||(n=e._renderer.clip=se.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in se?e:"path"},defs:{update:function(e){const{defs:t}=e;if(t._flagUpdate){const n=Array.prototype.slice.call(t.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;e.querySelector(a)||t.removeChild(s)}t._flagUpdate=!1}}},group:{appendChild:function(e){const t=e._renderer.elem;if(!t)return;const n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){const t=e._renderer.elem;!t||t.parentNode!=this.elem||!t.nodeName||e._clip||this.elem.removeChild(t)},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){const t=se.getRendererType(e._renderer.type);se[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;this._update(),this._renderer.elem||(this._renderer.elem=se.createElement("g",{id:this.id}),e.appendChild(this._renderer.elem));const t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=se.getRendererType(s._renderer.type);se[o].render.call(s,e)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(se.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(se.group.removeChild,n),this._flagOrder&&this.children.forEach(se.group.orderChild,n),this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices){const r=se.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this._flagCap&&(t["stroke-linecap"]=this._cap),this._flagJoin&&(t["stroke-linejoin"]=this._join),this._flagMiter&&(t["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=ki(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=se.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}return this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this.flagReset()}},text:{render:function(e){this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagFamily&&(t["font-family"]=this._family),this._flagSize&&(t["font-size"]=this._size),this._flagLeading&&(t["line-height"]=this._leading),this._flagAlignment&&(t["text-anchor"]=se.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=se.baselines[this._baseline]||this._baseline),this._flagStyle&&(t["font-style"]=this._style),this._flagWeight&&(t["font-weight"]=this._weight),this._flagDecoration&&(t["text-decoration"]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},texture:{render:function(e,t){t||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof Z?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Z?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?se.setAttributes(this._renderer.image,r):this._renderer.image=se.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&se.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=se.createElement("pattern",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),this.flagReset()}}},Hl=class extends Y{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ze,this.scene.parent=this,this.defs=se.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,se.setAttributes(this.domElement,{width:e,height:t}),this.trigger(Y.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(Hl,"Utils",se);var Ht={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new $t("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var Br=function(){return Br=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)},Hu={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"}},un={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ts=500,Wu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Br(Br({},Hu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(un.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var p=this.getPossibleSwipeDragCords(n),f,g,m=o-this.pageX,_=a-this.pageY;if(t-n>1){var y=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(y+(n<0?-1:1)),_=(n<0?-_:_)+this.top*(y+(n<0?-1:1)),f=m/y,g=_/y}else{var y=(t-n)*n;f=m*y,g=_*y}r&&(u?this.isBeyondPossibleLeft(f,p.minX)?f=p.minX:this.isBeyondPossibleRight(f,p.maxX)&&(f=p.maxX):t>1&&(f<p.minX?f=p.minX:f>p.maxX&&(f=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:f,y:g,scale:t}),this.left=f,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},Ts),setTimeout(function(){var r=t.getCurrentImageActualSizeScale();if(t.scale>=r){var s=t.getDragAllowedAxises(t.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),t.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ts+50)},e.prototype.setZoomStyles=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=t.scale,r.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),s.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var o="translate3d("+t.x+"px, "+t.y+"px, 0)";n.css("transform",o)},e.prototype.setActualSize=function(t,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(t),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ts+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(un.containerResize+".zoom "+un.rotateRight+".zoom "+un.rotateLeft+".zoom "+un.flipHorizontal+".zoom "+un.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(un.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(un.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(un.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var u=t.scale-o;t.zoomImage(t.scale,Math.round((u+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,p.minY)?u.y=p.minY:this.isBeyondPossibleBottom(u.y,p.maxY)&&(u.y=p.maxY)),r&&(this.isBeyondPossibleLeft(u.x,p.minX)?u.x=p.minX:this.isBeyondPossibleRight(u.x,p.maxX)&&(u.x=p.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-t.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;t&&(o=o+t*o,a=a+t*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var f=t.getDragAllowedAxises(0);a=f.allowY,o=f.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var f=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,f))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var f=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,f)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var f=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target)){c=new Date,u=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(p){if(s){o=!0,r=t.getDragCords(p);var f=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,f)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var f=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,f)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}();const ju={ref:"gallery-container",class:"lightgallery-wrapper"},Xu={},va=i.defineComponent({...Xu,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...t.settings}),H.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",ju,[i.renderSlot(o.$slots,"default")],512))}}),st=class st{static init(){st.isInitialized||(st.isInitialized=!0,st.windowResizeHandler(),window.addEventListener("resize",st.windowResizeHandler))}static destroy(){window.removeEventListener("resize",st.windowResizeHandler),st.isInitialized=!1}static getDeviceTypeByResolution(){const t=U.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<t.tablet?qe.phone:window.innerWidth<t.laptop?qe.tablet:qe.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return st.setRefValueDependingOnDeviceResolution(s,t,n,r),st.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return st.getDeviceTypeByResolution()===qe.phone}static isTabletDevice(){return st.getDeviceTypeByResolution()===qe.tablet}static isLaptopDevice(){return st.getDeviceTypeByResolution()===qe.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(st.getDeviceTypeByResolution()){case qe.phone:t.value=n;break;case qe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){H.forEach(st.refsDependingOnDeviceResolution,t=>{st.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};x(st,"isInitialized",!1),x(st,"refsDependingOnDeviceResolution",[]);let wt=st;const qu=["href"],Yu=["src","alt"],Uu={},ka=i.defineComponent({...Uu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Du,Wu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===qe.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const u=wa,p=I.NPopover;return i.openBlock(),i.createBlock(p,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(va,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,Yu)],8,qu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Gu={class:"flex flex-col text-sm"},Ku={},Zu=i.defineComponent({...Ku,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Bs,s=I.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Gu,[(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})}}}),Ju={class:"flex flex-row justify-between"},Qu={key:0},ef={class:"ml-2 align-sub"},tf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},nf={class:"@container"},rf={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},sf={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},of={class:"text-sc-dark-grey"},af={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},lf={class:"text-gray-600"},cf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},df={key:3,class:"underline decoration-dashed"},hf={key:4,class:"sc-product-pack whitespace-nowrap"},uf={class:"text-gray-600"},ff={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},pf={class:"text-gray-600"},gf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},mf={key:0},_f={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},yf={},Yi=i.defineComponent({...yf,__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,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>H.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>H.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>H.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return t({showProductImagesPreview:l}),(h,u)=>{var y,b,S,C,v;const p=wa,f=I.NText,g=ba,m=Bs,_=I.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Ju,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Qu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",ef,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ka,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",tf,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((y=h.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",nf,[i.createElementVNode("div",rf,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",sf,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",of,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",af,[u[1]||(u[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",lf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Zu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",cf,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",df," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",hf,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",uf,i.toDisplayString((v=(C=h.product)==null?void 0:C.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",ff,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",pf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",gf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Cr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"show-cost-date":h.showCostDate,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","show-cost-date","currency-rates"]))),128)),i.createVNode(Cr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":h.showCostDate,"show-price-history":h.showPriceHistory,"currency-rates":h.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}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",mf,[i.createElementVNode("ul",_f,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),bf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(Cr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),wf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(wt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})}),t.showProductCosts&&(H.forEach(e,s=>{H.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),H.forEach(H.sortBy(r,["slug"]),s=>{n.push(bf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Cr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||!H.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ba,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},vf={key:0,class:"pt-0.5"},kf={class:"flex flex-row gap-1"},xf={key:0},Cf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Sf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Bf={},Tf=i.defineComponent({...Bf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>{var $;return($=t==null?void 0:t.filteredItems)==null?void 0:$[t.categoryItem.id]}),s=i.computed(()=>{var $,X;return H.isArray(($=t.categoryItem)==null?void 0:$.categories)&&((X=t.categoryItem.categories)==null?void 0:X.length)>0}),o=i.computed(()=>{var $;return H.isArray(($=t.categoryItem)==null?void 0:$.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([$,X])=>`${X} руб./${C($)}`).join(", ")),l=i.computed(()=>H.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter($=>{var X,F;return(F=(X=r.value)==null?void 0:X.products)==null?void 0:F.includes($.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>H.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>H.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),u=i.computed(()=>H.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>H.isNil(t.categoryContextButtonsConfig)?[]:H.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),f=i.computed(()=>new U.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),_=i.computed(()=>!H.isUndefined(t.selectedCategoriesItems)),y=i.computed(()=>(t.selectedCategoriesItems??[]).some($=>$.id===t.categoryItem.id)),b=i.computed(()=>q.value&&wt.getDeviceTypeByResolution()===qe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),C=($,X="ru-RU")=>0 .toLocaleString(X,{style:"currency",currency:$,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),v=$=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:$,target:S.value})},B=($,X)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:X,isLoadingState:g,target:S.value})},k=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem,target:S.value})},E=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem,target:S.value})},P=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem,target:S.value})},R=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem,target:S.value})},j=$=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:$,target:S.value})},q=i.ref(0),M=i.computed(()=>q.value&&o.value.length>0?wf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),A=H.debounce(()=>{q.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",A)}),window.addEventListener("resize",A),A(),($,X)=>{const F=I.NCheckbox,N=du,W=I.NTooltip,z=au,G=_a,V=I.NTag,O=nu,J=Qh,he=I.NButton,ie=Kh,ge=ma,re=ga,Fe=I.NDropdown,Me=I.NDataTable,Ge=I.NAlert,Le=I.NSpin;return i.openBlock(),i.createBlock(ya,{ref:"collapse-item-reference",name:$.categoryItem.id,"data-id":$.categoryItem.id,"onHeader:click":B},{"pre-arrow":i.withCtx(()=>{var Pe,$e,ot;return[_.value?(i.openBlock(),i.createElementBlock("div",vf,[i.createVNode(F,{checked:y.value,"onUpdate:checked":v},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((Pe=f.value)!=null&&Pe.isDisabled)?(i.openBlock(),i.createBlock(W,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[1]||(X[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),(($e=f.value)==null?void 0:$e.isFavorite)??!1?(i.openBlock(),i.createBlock(W,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[2]||(X[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((ot=f.value)==null?void 0:ot.isRequired)??!1?(i.openBlock(),i.createBlock(W,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(G,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[3]||(X[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Pe,$e,ot;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":$.categoryItem.isHidden,"text-gray-400":(Pe=f.value)==null?void 0:Pe.isDisabled})},[i.createVNode(W,{disabled:!$.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString($.categoryItem.name),1)]),default:i.withCtx(()=>[X[4]||(X[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:X[0]||(X[0]=i.withModifiers((...De)=>i.unref(H.noop)&&i.unref(H.noop)(...De),["prevent","stop"]))},[($e=$.categoryItem.properties)!=null&&$e.m2Price?(i.openBlock(),i.createBlock(V,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString($.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(V,{key:1,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((ot=f.value)!=null&&ot.manager)?(i.openBlock(),i.createBlock(V,{key:2,size:i.unref(n),closable:!0,round:"",onClose:P},{default:i.withCtx(()=>[i.createVNode(W,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var De,ct;return[i.createElementVNode("span",kf,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString((ct=(De=f.value)==null?void 0:De.manager)==null?void 0:ct.name),1)])]}),default:i.withCtx(()=>{var De,ct;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((ct=(De=f.value)==null?void 0:De.manager)==null?void 0:ct.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[$.showSlugs||$.showProperties?(i.openBlock(),i.createElementBlock("div",xf,[i.createElementVNode("ul",Cf,[$.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:$.categoryItem.id,slug:$.categoryItem.slug},(Pe,$e)=>(i.openBlock(),i.createElementBlock("li",{key:$e}," ("+i.toDisplayString($e)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0),$.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList($.categoryItem.properties,(Pe,$e)=>(i.openBlock(),i.createElementBlock("li",{key:$e}," ("+i.toDisplayString($e)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Pe;return[i.createElementVNode("div",Sf,[d.value?(i.openBlock(),i.createBlock(W,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:k},{default:i.withCtx(()=>{var $e;return[($e=f.value)!=null&&$e.isDisabled?(i.openBlock(),i.createBlock(N,{key:1})):(i.openBlock(),i.createBlock(J,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var $e;return[($e=f.value)!=null&&$e.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(f.value.hidingComment?`. Причина: '${f.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Pe=f.value)!=null&&Pe.manager)?(i.openBlock(),i.createBlock(W,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:E},{default:i.withCtx(()=>[i.createVNode(ie)]),_:1},8,["size"])]),default:i.withCtx(()=>{var $e,ot,De;return[($e=f.value)!=null&&$e.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(ot=f.value)==null?void 0:ot.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(W,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary",onClick:R},{default:i.withCtx(()=>[i.createVNode(ge)]),_:1},8,["size"])]),default:i.withCtx(()=>[X[5]||(X[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Fe,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:j},{default:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(re)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot($.$slots,"default",{},()=>{var Pe;return[s.value?(i.openBlock(),i.createBlock(Ca,{key:0,"categories-items":$.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":$.eventEmitter,"filtered-items":r.value?((Pe=r.value)==null?void 0:Pe.categories)??{}:void 0,"selected-categories-items":$.selectedCategoriesItems,"selected-products-items":$.selectedProductsItems,"show-slugs":$.showSlugs,"show-properties":$.showProperties,"show-product-costs":$.showProductCosts,"allow-name-click":$.allowNameClick,"allow-price-click":$.allowPriceClick,"show-price-history":$.showPriceHistory,"show-cost-date":$.showCostDate,"show-product-add-to-cart-button":$.showProductAddToCartButton,"show-product-edit-button":$.showProductEditButton,"product-context-buttons-config":$.productContextButtonsConfig,"show-hide-for-client-button":$.showHideForClientButton,"show-pin-button":$.showPinButton,"show-category-edit-button":$.showCategoryEditButton,"category-context-buttons-config":$.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Me,{key:1,columns:M.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":$e=>$e.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(Ge,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(Ge,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Le,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>X[6]||(X[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Ef=Hn(Tf,[["__scopeId","data-v-89e65ae0"]]),$f={class:"sc-collapse flex w-full flex-col"},Nf={},xa=i.defineComponent({...Nf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",$f,[i.renderSlot(o.$slots,"default")]))}}),Rf={},Ca=i.defineComponent({...Rf,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>H.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(H.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=I.NSpin,c=I.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Ef,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-cost-date":o.showCostDate,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0),!o.hasProducts&&!o.loading&&o.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Pf={class:"text-sm"},Ff={class:"text-sm"},Mf={},Af=i.defineComponent({...Mf,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,u,p,f,g;const n=e,r=i.ref(new U.CartItemBase(n.cartItem??new U.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(u=n.product)==null?void 0:u.properties)!=null&&p.ignoreMinCountCheck?0:(g=(f=n.product)==null?void 0:f.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,C,v,B,k,E,P;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((C=(S=n.product)==null?void 0:S.properties)!=null&&C.ignoreMinCountCheck?0:(B=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),_=(E=(k=n.product)==null?void 0:k.properties)==null?void 0:E.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{U.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(I.NInputNumber),{value:r.value.length,"onUpdate:value":_[0]||(_[0]=S=>r.value.length=S),max:((y=m.product.properties)==null?void 0:y.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Pf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(U.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ff,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInput),{value:r.value.marker,"onUpdate:value":_[2]||(_[2]=y=>r.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:_[3]||(_[3]=y=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),If={},Sa=i.defineComponent({...If,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>H.isArray(r.value)),a=new U.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=H.isUndefined(r.value)?f:r.value;return H.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>zt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=f=>{var g;if(H.isArray(f)){const m=f.length>0?f.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=f===a.id||(g=c.value.find(_=>_.value===f))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(I.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":f.consistentMenuWidth,disabled:f.disabled||c.value.length===0,filterable:f.filterable,"max-tag-count":f.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Vf={},Of=i.defineComponent({...Vf,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,C;const n=e,r=t,s=()=>{const v=U.PriceCoefficient.getRetailPriceCoefficient();return H.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,E,P;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():(P=(E=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:E.find(R=>R.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=U.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const E=c(k);E?k.name+=` (${E} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((C=(S=n.value)==null?void 0:S.value)==null?void 0:C.toString())??null),p=i.ref(null),f=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===U.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,E;g.value=void 0;let v=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||u.value){const P=s(),R=c(h.value??P)??0,j=R+R*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(j),j>(((k=l.value)==null?void 0:k.getRetailCost())??j)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&j<(((E=f.value)==null?void 0:E.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},_=v=>{H.isArray(v)||(h.value=v,!h.value&&u.value&&(h.value=s()),m())},y=()=>{h.value||(h.value=s()),m()},b=v=>{var k,E,P,R,j,q;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let M=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((k=f.value)==null?void 0:k.cost)??0))h.value=(E=f.value)==null?void 0:E.coefficient,M=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.getRetailCost())??B)){h.value=s();const A=((R=l.value)==null?void 0:R.getRetailCost())??0;M=(B-A)*100/A,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const A=(q=(j=l.value)==null?void 0:j.priceCoefficients)==null?void 0:q.filter($=>$.cost<B);if(A&&A.length>0){const $=A.at(-1);h.value=$==null?void 0:$.coefficient,M=(B-(($==null?void 0:$.cost)??0))*100/(($==null?void 0:$.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(M),r("update:value",{value:Number.isNaN(M)?void 0:M,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{m()}),(v,B)=>{var P,R,j;const k=I.NInput,E=I.NInputGroup;return i.openBlock(),i.createBlock(i.unref(I.NFormItem),{"show-label":!i.unref(H.isNil)(v.label),label:v.label,"show-feedback":!i.unref(H.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((R=g.value)==null?void 0:R.feedback)??v.feedback,"validation-status":((j=g.value)==null?void 0:j.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"grid-cols-1":!a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost,"grid-cols-3":a.value&&v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full gap-2"])},[v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(E,{key:0,class:i.normalizeClass({"col-span-2":a.value})},{default:i.withCtx(()=>[i.createVNode(Sa,{value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":_},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:u.value,"onUpdate:value":[B[0]||(B[0]=q=>u.value=q),y],clearable:v.clearable,disabled:v.disabled,placeholder:""},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%"))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + "))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=q=>p.value=q),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var q;return[i.createTextVNode(i.toDisplayString((q=l.value)==null?void 0:q.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),zf={class:"flex flex-row gap-1"},Lf={class:"sc-client-name flex flex-col gap-1 text-base"},Df=["href"],Hf={key:1,class:"text-sc-grey"},Wf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},jf={key:0},Xf={key:1,class:"text-sm"},qf={},Tr=i.defineComponent({...qf,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Tn.format(n.client.lastLoginAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{H.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Bs,d=I.NButton,h=I.NPopover;return i.openBlock(),i.createElementBlock("div",zf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(H.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Lf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",Hf," [ Деактивирован ] "))],8,Df),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Wf," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",jf,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Xf," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Yf={class:"text-base"},Uf={},Ba=i.defineComponent({...Uf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",Yf,i.toDisplayString(t.contragent.name),1))}}),Gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Kf(e,t){return i.openBlock(),i.createElementBlock("svg",Gf,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)]))}const Zf=i.markRaw({name:"tabler-mail",render:Kf}),Jf=["href"],Qf={},ep=i.defineComponent({...Qf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=Zf;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,Jf)],2)}}}),tp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function np(e,t){return i.openBlock(),i.createElementBlock("svg",tp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)]))}const Ta=i.markRaw({name:"fa6-brands-viber",render:np}),ip={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},rp=["id"],sp=["id"],op=["fill"],ap=["fill"];function lp(e,t){return i.openBlock(),i.createElementBlock("svg",ip,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon0,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)]),8,rp),i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon1,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)]),8,sp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon0+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,op),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon1+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,ap),t[2]||(t[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ea=i.markRaw({name:"logos-whatsapp-icon",render:lp,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),cp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},dp=["id"],hp=["fill"];function up(e,t){return i.openBlock(),i.createElementBlock("svg",cp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosTelegram0,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)]),8,dp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosTelegram0+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,hp),t[1]||(t[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const $a=i.markRaw({name:"logos-telegram",render:up,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pp(e,t){return i.openBlock(),i.createElementBlock("svg",fp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)]))}const Na=i.markRaw({name:"ion-call",render:pp}),gp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mp(e,t){return i.openBlock(),i.createElementBlock("svg",gp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)]))}const _p=i.markRaw({name:"tabler-phone-call",render:mp}),yp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},bp=["href"],wp=["href"],vp=["href"],kp=["href"],xp={},Cp=i.defineComponent({...xp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Xi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return H.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return H.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return H.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=_p,h=Na,u=$a,p=Ea,f=Ta;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":l.showPhoneIcon})},[l.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",yp,[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,bp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,wp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(p)],8,vp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(f)],8,kp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bp(e,t){return i.openBlock(),i.createElementBlock("svg",Sp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)]))}const Tp=i.markRaw({name:"mdi-envelope",render:Bp}),Ep={class:"flex flex-col gap-1"},$p={key:0,class:"mb-2 flex flex-col text-base"},Np={key:0,class:"text-sc-dark-grey text-sm"},Rp={key:1,class:"whitespace-nowrap text-sm"},Pp={key:2,class:"whitespace-nowrap text-sm"},Fp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Mp=["href"],Ap=["href"],Ip=["href"],Vp=["href"],Op=["href"],zp={key:0,class:"flex flex-col text-base"},Lp={key:0,class:"text-sc-dark-grey text-sm"},Dp={key:1,class:"mt-2 text-sm"},Hp={key:0,class:"-mt-1"},Wp={},jp=i.defineComponent({...Wp,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Xi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return H.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return H.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return H.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var _,y;const h=Na,u=$a,p=Ea,f=Ta,g=Tp,m=I.NPopover;return i.openBlock(),i.createElementBlock("div",Ep,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,C,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",$p,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(C=c.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",Np,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Rp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Pp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Fp,[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,Mp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Ap)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(p)],8,Ip)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(f)],8,Vp)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Op)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,C,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",zp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Lp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=c.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",Dp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Hp,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=c.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}}),Xp={key:0,class:"flex w-fit items-center gap-2"},qp={key:1,class:"flex flex-wrap gap-1"},Yp={key:0},Up={},Ui=i.defineComponent({...Up,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=I.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Xp,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",qp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Yp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Gp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Kp(e,t){return i.openBlock(),i.createElementBlock("svg",Gp,t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)]))}const Er=i.markRaw({name:"ion-close",render:Kp}),Zp={class:"mr-3 flex flex-col gap-2"},Jp=["onClick"],Qp={class:"h-full p-2"},eg={},tg=i.defineComponent({...eg,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=Er;return i.openBlock(),i.createBlock(i.unref(I.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(I.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Qp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Jp)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Ra=Hn(tg,[["__scopeId","data-v-828c3059"]]),ng={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ig(e,t){return i.openBlock(),i.createElementBlock("svg",ng,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)]))}const Pa=i.markRaw({name:"ion-trash",render:ig}),rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sg(e,t){return i.openBlock(),i.createElementBlock("svg",rg,t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const Fa=i.markRaw({name:"ion-plus",render:sg}),og={class:"flex flex-col gap-4"},ag={class:"flex flex-col gap-2"},lg={class:"mt-8 font-bold"},cg={class:"grid grow grid-cols-2 items-start gap-2"},dg={class:"flex flex-col gap-4"},hg={class:"flex gap-3"},ug={},Ma=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","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new U.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=H.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Fa,u=Pa,p=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var f,g,m,_,y,b,S,C,v;return[i.createElementVNode("div",og,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ag,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var E,P,R,j,q,M;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",lg,i.toDisplayString(k+1),1),i.createElementVNode("div",cg,[i.createVNode(i.unref(I.NFormItem),{label:"Ширина, мм",required:!0,feedback:((E=c.validation[`lines_widths[${k+1}]`])==null?void 0:E.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${k+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[A=>s.value.linesWidths[k]=A,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:A=>A%c.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((j=c.validation[`lines_angles[${k+1}]`])==null?void 0:j.feedback)||"","show-feedback":((q=c.validation[`lines_angles[${k+1}]`])==null?void 0:q.showFeedback)||!1,"validation-status":(M=c.validation[`lines_angles[${k+1}]`])==null?void 0:M.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[A=>s.value.linesAngles[k]=A,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:A=>A%c.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(I.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"medium",onClick:A=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:A=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ")])),_:1,__:[9]},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",dg,[i.createVNode(i.unref(I.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((f=c.validation.length)==null?void 0:f.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((_=c.validation.quantity)==null?void 0:_.showFeedback)||!1,feedback:((y=c.validation.quantity)==null?void 0:y.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((C=c.validation.marker)==null?void 0:C.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",hg,[i.createVNode(i.unref(I.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Aa=Object.defineProperty,fg=Object.defineProperties,pg=Object.getOwnPropertyDescriptors,Ia=Object.getOwnPropertySymbols,gg=Object.prototype.hasOwnProperty,mg=Object.prototype.propertyIsEnumerable,Es=(e,t,n)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$s=(e,t)=>{for(var n in t||(t={}))gg.call(t,n)&&Es(e,n,t[n]);if(Ia)for(var n of Ia(t))mg.call(t,n)&&Es(e,n,t[n]);return e},Ns=(e,t)=>fg(e,pg(t)),Va=(e,t)=>{for(var n in t)Aa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Es(e,typeof t!="symbol"?t+"":t,n),n),Oa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Et=(e,t,n)=>(Oa(e,t,"read from private field"),n?n.call(e):t.get(e)),za=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_g=(e,t,n,r)=>(Oa(e,t,"write to private field"),t.set(e,n),n),vt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return vt.shim(e),typeof t<"u"&&(vt.Image=t),vt.isHeadless=!0,e}},La={};Va(La,{Curve:()=>xi,getAnchorsFromArcData:()=>wg,getComponentOnCubicBezier:()=>Gi,getControlPoints:()=>Ja,getCurveBoundingBox:()=>Ga,getCurveFromPoints:()=>Za,getCurveLength:()=>Ua,getReflection:()=>Fs,integrate:()=>Ka,subdivide:()=>Ps});var Da={};Va(Da,{HALF_PI:()=>Je,NumArray:()=>Zt,TWO_PI:()=>ht,decomposeMatrix:()=>ki,getComputedMatrix:()=>ja,getPoT:()=>Xa,lerp:()=>Ft,mod:()=>Mt,setMatrix:()=>Wa,toFixed:()=>Ne});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var Ha,ht=Math.PI*2,Je=Math.PI*.5;function ki(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function Wa(e){Ha=e}function ja(e,t){t=t&&t.identity()||new Ha;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Ft(e,t,n){return n*(t-e)+e}var Rs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Xa(e){let t=0;for(;Rs[t]&&Rs[t]<e;)t++;return Rs[t]}function Mt(e,t){for(;e<0;)e+=t;return e%t}var Zt=He.Float32Array||Array,yg=Math.floor;function Ne(e){return yg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Y=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}};w(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 qa={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(Y.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(Y.Types.change))}}},Xt=class extends Y{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in qa)Object.defineProperty(this,n,qa[n]);this.x=e,this.y=t}static add(e,t){return new Xt(e.x+t.x,e.y+t.y)}static sub(e,t){return new Xt(e.x-t.x,e.y-t.y)}static subtract(e,t){return Xt.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(Xt.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new Xt(this.x,this.y)}add(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ne(this.x),y:Ne(this.y)}}rotate(e){const t=this.x,n=this.y,r=Math.cos(e),s=Math.sin(e);return this.x=t*r-n*s,this.y=t*s+n*r,this}},Z=Xt;w(Z,"zero",new Xt),w(Z,"left",new Xt(-1,0)),w(Z,"right",new Xt(1,0)),w(Z,"up",new Xt(0,-1)),w(Z,"down",new Xt(0,1));var ve=class extends Z{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ee.move){super(t,n),w(this,"controls",{left:new Z,right:new Z}),w(this,"_command",ee.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in Ya)Object.defineProperty(this,d,Ya[d]);this.command=l,this.relative=!0;const c=ve.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(t){return n;function n(){t._bound&&t.dispatchEvent(Y.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().copy(this)}toObject(){return{x:Ne(this.x),y:Ne(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ne(this.rx),ry:Ne(this.ry),xAxisRotation:Ne(this.xAxisRotation),largeArcFlag:Ne(this.largeArcFlag),sweepFlag:Ne(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},Ya={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(Y.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(Y.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(Y.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(Y.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(Y.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(Y.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(Y.Types.change))}}},bg=0,kt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.18",PublishDate:"2025-04-07T22:33:48.746Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return bg++}},xi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Gi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ps(e,t,n,r,s,o,a,l,c){c=c||xi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Gi(p,e,n,s,a),g=Gi(p,t,r,o,l);h.push(new ve(f,g))}return h}function Ua(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(p*_+f)*_+g;return Math.sqrt(y*y+b*b)}return Ka(m,0,1,c||xi.RecursionLimit)}function Ga(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}_=u*u-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,C;for(;b--;)f=c[b],C=1-f,d[0][b]=C*C*C*e+3*C*C*f*n+3*C*f*f*s+f*f*f*a,d[1][b]=C*C*C*t+3*C*C*f*r+3*C*f*f*o+f*f*f*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ka(e,t,n,r){let s=xi.abscissas[r-2],o=xi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Za(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Mt(s-1,n):Math.max(s-1,0),l=t?Mt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ja(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ja(e,t,n){const r=Z.angleBetween(e,t),s=Z.angleBetween(n,t);let o=Z.distanceBetween(e,t),a=Z.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function Fs(e,t,n){return new Z(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function wg(e,t,n,r,s,o,a){const l=kt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),p=r*Math.sin(h),f=new ve(u,p);f.command=ee.line}}var Qa=Array.prototype.slice;function vg(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!vg(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:He.performance&&He.performance.now?He.performance:Date},At={hasEventListeners:typeof He.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),At},unbind:function(e,t,n,r){return At.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),At},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=He.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=He[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=He.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},Ci=He.document?He.document.createElement("div"):{};Ci.id="help-two-load",Object.defineProperty(At,"temp",{enumerable:!0,get:function(){return ae.isElement(Ci)&&!He.document.head.contains(Ci)&&(Ci.style.display="none",He.document.head.appendChild(Ci)),Ci}});var $t=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},kg=He.devicePixelRatio||1;function xg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ms(e){return kg/xg(e)}var $r=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},ut,En=class extends Array{constructor(){super(),za(this,ut,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 Et(this,ut)}set _events(t){_g(this,ut,t)}get _bound(){return Et(this,ut)._bound}set _bound(t){Et(this,ut)._bound=t}addEventListener(){return Et(this,ut).addEventListener.apply(this,arguments)}on(){return Et(this,ut).on.apply(this,arguments)}bind(){return Et(this,ut).bind.apply(this,arguments)}removeEventListener(){return Et(this,ut).removeEventListener.apply(this,arguments)}off(){return Et(this,ut).off.apply(this,arguments)}unbind(){return Et(this,ut).unbind.apply(this,arguments)}dispatchEvent(){return Et(this,ut).dispatchEvent.apply(this,arguments)}trigger(){return Et(this,ut).trigger.apply(this,arguments)}listen(){return Et(this,ut).listen.apply(this,arguments)}ignore(){return Et(this,ut).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(Y.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(Y.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(Y.Types.remove,t),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 t}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(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};ut=new WeakMap;var el=class extends Y{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",kt.Identifier+kt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in tl)Object.defineProperty(this,e,tl[e])}static fromObject(e){const t=new el().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Wn=el;w(Wn,"Properties",["renderer","id","className"]);var tl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Nr,nl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Nr=document.createElement("a"));var Qe=class extends Wn{constructor(e,t){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let n in il)Object.defineProperty(this,n,il[n]);if(this._renderer.type="texture",this._renderer.flagOffset=Cg.bind(this),this._renderer.flagScale=Sg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof t=="function"){const n=(function(){this.unbind(Y.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(Y.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new Qe().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Nr?(Nr.href=e,Nr.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=Qe.getAbsoluteURL(e);if(Qe.ImageRegistry.contains(t))return Qe.ImageRegistry.get(t);let n;return vt.Image?(n=new vt.Image,vt.shim(n,"img")):He.document?nl.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=Qe.getTag(n);e._flagImage&&(/canvas/i.test(r)?Qe.Register.canvas(e,t):(e._src=!vt.isHeadless&&n.getAttribute("two-src")||n.src,Qe.Register[r](e,t))),e._flagSrc&&(n||(n=Qe.getImage(e.src),e.image=n),r=Qe.getTag(n),Qe.Register[r](e,t))}clone(){const e=new Qe(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(Y.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Qe.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("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Be=Qe;w(Be,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Be,"RegularExpressions",nl),w(Be,"ImageRegistry",new $r),w(Be,"Register",{canvas:function(e,t){e._src="#"+e.id,Qe.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!vt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!vt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new $t("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!vt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Qe.getAbsoluteURL(e._src),!(!vt.isHeadless&&n&&n.getAttribute("two-src"))&&(vt.isHeadless||n.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,n),vt.isHeadless?Qe.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(vt.isHeadless)throw new $t("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new $t("unable to load "+e.src)};e._src=Qe.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var il={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Be.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Be.ImageRegistry.contains(n)?this._image=Be.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(Y.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(Y.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Z&&this._scale.bind(Y.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Cg(){this._flagOffset=!0}function Sg(){this._flagScale=!0}var qt=class extends Wn{constructor(e,t,n){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let r in rl)Object.defineProperty(this,r,rl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:qt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:qt.Index<=0?"#fff":"#000",qt.Index=(qt.Index+1)%2}static fromObject(e){const t=new qt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<qt.Properties.length;t++){const n=qt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new qt;return ae.each(qt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ae.each(qt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Jt=qt;w(Jt,"Index",0),w(Jt,"Properties",["offset","opacity","color"]);var rl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},jn=class extends Wn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in sl)Object.defineProperty(this,t,sl[t]);this._renderer.type="gradient",this._renderer.flagStops=Bg.bind(this),this._renderer.bindStops=Tg.bind(this),this._renderer.unbindStops=Eg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof Jt?r:new Jt().copy(r)));const n=new jn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new jn(t);return ae.each(jn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<jn.Properties.length;t++){const n=jn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(jn.Properties,t=>{e[t]=this[t]},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}},Ue=jn;w(Ue,"Stop",Jt),w(Ue,"Properties",["spread","stops","units"]);var sl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),this._stops=new En((e||[]).slice(0)),this._stops.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._stops)}}};function Bg(){this._flagStops=!0}function Tg(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Eg(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ki=class extends Ue{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in ol)Object.defineProperty(this,o,ol[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=$g.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ki(this.left._x,this.left._y,this.right._x,this.right._y,t);return ae.each(Ue.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Ie=Ki;w(Ie,"Stop",Jt),w(Ie,"Properties",["left","right"]);var ol={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Z&&this._left.unbind(Y.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof Z&&this._right.unbind(Y.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function $g(){this._flagEndPoints=!0}var Xn=class extends Ue{constructor(e,t,n,r,s,o){super(r),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let a in al)Object.defineProperty(this,a,al[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Ng.bind(this),this._renderer.flagFocal=Rg.bind(this),this.center=new Z,this.radius=typeof n=="number"?n:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Xn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Xn.Properties.length;t++){const n=Xn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Xn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(Ue.Properties.concat(Xn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Xn.Properties,function(t){e[t]=this[t]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ve=Xn;w(Ve,"Stop",Jt),w(Ve,"Properties",["center","radius","focal"]);var al={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(Y.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(Y.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(Y.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(Y.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Ng(){this._flagCenter=!0}function Rg(){this._flagFocal=!0}function ll(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Rr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function cl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ua(r,l,s,c,o,d,a,h,n)}function dl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ps(r,l,s,c,o,d,a,h,n)}function qn(e){switch(e.renderer.type){case"texture":return Be.fromObject(e);case"gradient":return Ue.fromObject(e);case"linear-gradient":return Ie.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var Pg=Math.cos,Fg=Math.sin,hl=Math.tan,As=[],It=class extends Y{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Zt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,E;const P=t[0]||0,R=t[1]||0,j=t[2]||0;return B=v[0]*P+v[1]*R+v[2]*j,k=v[3]*P+v[4]*R+v[5]*j,E=v[6]*P+v[7]*R+v[8]*j,[B,k,E]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],u=e[8],p=t[0],f=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],C=t[8];return n=n||new Zt(9),n[0]=r*p+s*m+o*b,n[1]=r*f+s*_+o*S,n[2]=r*g+s*y+o*C,n[3]=a*p+l*m+c*b,n[4]=a*f+l*_+c*S,n[5]=a*g+l*y+c*C,n[6]=d*p+h*m+u*b,n[7]=d*f+h*_+u*S,n[8]=d*g+h*y+u*C,n}static fromObject(e){return new It().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,this.trigger(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]=It.Identity[0],this.elements[1]=It.Identity[1],this.elements[2]=It.Identity[2],this.elements[3]=It.Identity[3],this.elements[4]=It.Identity[4],this.elements[5]=It.Identity[5],this.elements[6]=It.Identity[6],this.elements[7]=It.Identity[7],this.elements[8]=It.Identity[8],this.trigger(Y.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(Y.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const M=s[0]*e+s[1]*t+s[2]*n,A=s[3]*e+s[4]*t+s[5]*n,$=s[6]*e+s[7]*t+s[8]*n;return[M,A,$]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],p=d[1],f=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],C=h[0],v=h[1],B=h[2],k=h[3],E=h[4],P=h[5],R=h[6],j=h[7],q=h[8];return this.elements[0]=u*C+p*k+f*R,this.elements[1]=u*v+p*E+f*j,this.elements[2]=u*B+p*P+f*q,this.elements[3]=g*C+m*k+_*R,this.elements[4]=g*v+m*E+_*j,this.elements[5]=g*B+m*P+_*q,this.elements[6]=y*C+b*k+S*R,this.elements[7]=y*v+b*E+S*j,this.elements[8]=y*B+b*P+S*q,this.trigger(Y.Types.change)}inverse(e){const t=this.elements;e=e||new It;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],u=h*a-l*d,p=-h*o+l*c,f=d*o-a*c;let g=n*u+r*p+s*f;return g?(g=1/g,e.elements[0]=u*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=f*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Pg(e),n=Fg(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=hl(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=hl(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return As.length=0,this.toTransformArray(e,As),As.map(Ne).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=u,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,u,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=u,t[8]=p;return}return[s,o,a,l,c,d,h,u,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new It().copy(this)}},Yn=It;w(Yn,"Identity",[1,0,0,0,1,0,0,0,1]),Wa(Yn);var Is=class extends Wn{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 Pr)Object.defineProperty(this,e,Pr[e]);this._renderer.flagMatrix=ul.bind(this),this.isShape=!0,this.matrix=new Yn,this.worldMatrix=new Yn,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Is().copy(e);return"id"in e&&(t.id=e.id),t}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Pr.position.get.apply(this,arguments)}set translation(e){Pr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof Z?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const t=new Is;return t.position.copy(this.position),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof Z?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Z?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}},fn=Is;w(fn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Pr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(Y.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(Y.Types.change,this._renderer.flagMatrix),ul.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Z&&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(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return ja(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ul(){this._flagMatrix=!0}var Si=Math.min,Bi=Math.max,Mg=Math.ceil,Ag=Math.floor,Ig=new Z,$n=class extends fn{constructor(e,t,n,r){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in fl)Object.defineProperty(this,s,fl[s]);this._renderer.type="path",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new $n().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<$n.Properties.length;t++){const n=$n.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new $n;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<$n.Properties.length;n++){const r=$n.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),ae.each($n.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:u,scaleY:p}=ki(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof p=="number"&&(n=Math.max(u,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[u,p]=t.multiply(o.x,o.y),[f,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,_=o.controls.right.y;o.relative&&(m+=o.x,_+=o.y);let[y,b]=t.multiply(m,_),S=a.controls.left.x,C=a.controls.left.y;a.relative&&(S+=a.x,C+=a.y);let[v,B]=t.multiply(S,C);const k=Ga(u,p,y,b,v,B,f,g);d=Si(k.min.y-n,d),l=Si(k.min.x-n,l),c=Bi(k.max.x+n,c),h=Bi(k.max.y+n,h)}else s<=1&&(d=Si(p-n,d),l=Si(u-n,l),c=Bi(u+n,c),h=Bi(p+n,h)),d=Si(g-n,d),l=Si(f-n,l),c=Bi(f+n,c),h=Bi(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let C=null,v=null;for(let X=0,F=this._lengths.length,N=0;X<F;X++){if(N+this._lengths[X]>=y){this._closed?(n=Mt(X,b),r=Mt(X-1,b),X===0&&(n=r,r=X)):(n=X,r=Math.min(Math.max(X-1,0),S)),C=this.vertices[n],v=this.vertices[r],y-=N,this._lengths[X]!==0?e=y/this._lengths[X]:e=0;break}N+=this._lengths[X]}if(C===null||v===null)return null;if(C){if(!v)return C}else return v;_=v.controls&&v.controls.right,m=C.controls&&C.controls.left,a=v.x,u=v.y,l=(_||v).x,p=(_||v).y,c=(m||C).x,f=(m||C).y,d=C.x,g=C.y,_&&v.relative&&(l+=v.x,p+=v.y),m&&C.relative&&(c+=C.x,f+=C.y),o=Gi(e,a,l,c,d),h=Gi(e,u,p,f,g);const B=Ft(a,l,e),k=Ft(u,p,e),E=Ft(l,c,e),P=Ft(p,f,e),R=Ft(c,d,e),j=Ft(f,g,e),q=Ft(B,E,e),M=Ft(k,P,e),A=Ft(E,R,e),$=Ft(P,j,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=q,t.controls.left.y=M,t.controls.right.x=A,t.controls.right.y=$,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,q-o,M-h,A-o,$-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Za(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ee.move:ee.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ee.close;let r=this.vertices[t],s=[],o;return ae.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ee.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ee.line),r=a;return}o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ee.close:ee.line),r=a},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,t){t||this._update();const r=this.vertices.length-1;let s=this.vertices[r],o=0;return typeof this._lengths>"u"&&(this._lengths=[]),ae.each(this.vertices,function(a,l){if(l<=0||a.command===ee.move){s=a,this._lengths[l]=0;return}this._lengths[l]=cl(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Rr(this,n*this._length),o=Rr(this,r*this._length),a=Mg(s),l=Ag(o);let c,d,h,u,p,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>l&&!d?(p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,p),p.command=this._renderer.collection[f].command,this._renderer.vertices.push(p),d=p,h=this._collection[f-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(Z.zero,1-p.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):f>=a&&f<=l&&(p=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(p),f===l&&ll(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):f===a&&ll(this,n)&&(c=p,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(f=a-1,p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(n,p),p.command=ee.move,this._renderer.vertices.unshift(p),u=this._collection[f+1],u&&u.controls&&(p.controls.left.clear(),u.relative?this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(Z.zero,p.t):(Ig.copy(u),this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(u,p.t))))}return fn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,fn.prototype.flagReset.call(this),this}},xe=$n;w(xe,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(xe,"Utils",{getCurveLength:cl});var fl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),e instanceof En?this._collection=e:this._collection=new En(e||[]),this._collection.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function pl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function gl(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ml(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function _l(){this._flagFill=!0}function yl(){this._flagStroke=!0}var Zi=class extends xe{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in bl)Object.defineProperty(this,o,bl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Zi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zi.Properties.length;t++){const n=Zi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ee.move,this.vertices[1].set(e,-t).sub(this._origin).command=ee.line,this.vertices[2].set(e,t).sub(this._origin).command=ee.line,this.vertices[3].set(-e,t).sub(this._origin).command=ee.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ee.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Zi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}},Nn=Zi;w(Nn,"Properties",["width","height"]);var bl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(Y.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(Y.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ji=class extends Nn{constructor(e,t,n,r,s,o){super(t,n,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this.noStroke(),this.noFill(),e instanceof Be?this.texture=e:typeof e=="string"&&(this.texture=new Be(e)),this.origin=new Z,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ji().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ji.Properties.length;t++){const n=Ji.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const t=new Ji(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,u;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ae.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=ae.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Ft(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,f=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*f+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Fr=Ji;w(Fr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wl={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},Vs,vl=class extends En{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),za(this,Vs,{}),this.attach(t),this.on(Y.Types.insert,this.attach),this.on(Y.Types.remove,this.detach)}get ids(){return Et(this,Vs)}attach(t){for(let n=0;n<t.length;n++){const r=t[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(t){for(let n=0;n<t.length;n++)delete this.ids[t[n].id];return this}};Vs=new WeakMap;var Un=class extends xe{constructor(e,t,n,r,s,o,a){const l=a||kt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ht),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in kl)Object.defineProperty(this,d,kl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Un().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=Mt(e,ht)===Mt(t,ht),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,p,f,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(p=h/u,f=a[d],g=p*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=ee.move;break;default:c=ee.curve}f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=r*m/Math.PI,f.controls.left.x=b*Math.cos(g-Je),f.controls.left.y=b*Math.sin(g-Je),f.controls.right.x=b*Math.cos(g+Je),f.controls.right.y=b*Math.sin(g+Je),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,u=l-1),h=0;h<l;h++)p=h/u,f=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=ee.curve,h<=0&&(c=s?ee.move:ee.line),f.command=c,f.x=_,f.y=y,f.controls.left.clear(),f.controls.right.clear(),f.command===ee.curve&&(b=n*m/Math.PI,f.controls.left.x=b*Math.cos(g+Je),f.controls.left.y=b*Math.sin(g+Je),f.controls.right.x=b*Math.cos(g-Je),f.controls.right.y=b*Math.sin(g-Je),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ee.line}else s||(a[d].command=ee.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ee.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new Un(0,0,t,n,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<xe.Properties.length;l++){const c=xe.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Mr=Un;w(Mr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var kl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Os=Math.cos,zs=Math.sin,Gn=class extends xe{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in xl)Object.defineProperty(this,a,xl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Gn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ht,l=n*Os(a),c=n*zs(a),d=r*Os(a-Je),h=r*zs(a-Je),u=r*Os(a+Je),p=r*zs(a+Je),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Gn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Qi=Gn;w(Qi,"Properties",["radius"]);var xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Ls=Math.cos,Ds=Math.sin,Kn=class extends xe{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let l in Cl)Object.defineProperty(this,l,Cl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ht,l=n*Ls(a),c=r*Ds(a),d=n*t*Ls(a-Je),h=r*t*Ds(a-Je),u=n*t*Ls(a+Je),p=r*t*Ds(a+Je),f=this.vertices[s];f.command=s===0?ee.move:ee.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Kn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},er=Kn;w(er,"Properties",["width","height"]);var Cl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Vg=Math.ceil,Og=Math.floor,Rn=class extends fn{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"noFill",xe.prototype.noFill),w(this,"noStroke",xe.prototype.noStroke),w(this,"corner",xe.prototype.corner),w(this,"center",xe.prototype.center),w(this,"getBoundingClientRect",xe.prototype.getBoundingClientRect),w(this,"_updateLength",xe.prototype._updateLength);for(let t in Sl)Object.defineProperty(this,t,Sl[t]);this._renderer.type="points",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new Rn().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Rn.Properties.length;t++){const n=Rn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Rn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Rn.Properties.length;n++){const r=Rn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Rn.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ps(o,a,o,a,l,c,l,c,e);t=t.concat(d)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=Rr(this,e*this._length),r=Rr(this,t*this._length),s=Vg(n),o=Og(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}},Ar=Rn;w(Ar,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var Sl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),e instanceof En?this._collection=e:this._collection=new En(e||[]),this._collection.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},zg=Math.cos,Lg=Math.sin,Zn=class extends xe{constructor(e,t,n,r){r=Math.max(r||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let s in Bl)Object.defineProperty(this,s,Bl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ht*s+Math.PI/2,a=this._width*zg(o)/2,l=this._height*Lg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Zn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Ir=Zn;w(Ir,"Properties",["width","height","sides"]);var Bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Jn=class extends xe{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ee.move:ee.curve));super(o),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Dg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Jn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Z?r:new Z().copy(r):typeof r=="number"&&(this[n]=r)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,t=this._height;let n,r;this._radius instanceof Z?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=this.width,n=this.height,r=this.radius,s=new Jn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},tr=Jn;w(tr,"Properties",["width","height","radius"]);var Tl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof Z&&this._radius.unbind(Y.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Z&&this._radius.bind(Y.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Dg(){this._flagRadius=!0}var Hg=Math.cos,Wg=Math.sin,Qn=class extends xe{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let o in El)Object.defineProperty(this,o,El[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ht*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Hg(o),c=a*Wg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new Qn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];e[n]=this[n]}return e}},Vr=Qn;w(Vr,"Properties",["innerRadius","outerRadius","sides"]);var El={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Hs,$l=Math.min,Nl=Math.max;He.document&&(Hs=document.createElement("canvas"));var Vt=class extends fn{constructor(e,t,n,r){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in Rl)Object.defineProperty(this,s,Rl[s]);if(this._renderer.type="text",this._renderer.flagFill=jg.bind(this),this._renderer.flagStroke=Xg.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!ae.isObject(r))return this;for(let s=0;s<Vt.Properties.length;s++){const o=Vt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Hs){const t=Hs.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Vt.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new Vt().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Vt.Properties.length;t++){const n=Vt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Vt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Vt.Properties.length;n++){const r=Vt.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Vt.Properties.length;t++){const n=Vt.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Vt.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[u,p]=t.multiply(n,o),[f,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=$l(h,p,g,_),n=$l(d,u,f,m),r=Nl(d,u,f,m),o=Nl(h,p,g,_),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}},Lt=Vt;w(Lt,"Ratio",.6),w(Lt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Rl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function jg(){this._flagFill=!0}function Xg(){this._flagStroke=!0}var Or=Math.min,zr=Math.max,Ti=class extends fn{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null);for(let t in Pl)Object.defineProperty(this,t,Pl[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Ti;for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:qn(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Mr.fromObject(r);case"circle":return Qi.fromObject(r);case"ellipse":return er.fromObject(r);case"points":return Ar.fromObject(r);case"polygon":return Ir.fromObject(r);case"rectangle":return Nn.fromObject(r);case"rounded-rectangle":return tr.fromObject(r);case"star":return Vr.fromObject(r);case"path":return xe.fromObject(r);case"text":return Lt.fromObject(r);case"group":return Ti.fromObject(r);case"shape":return fn.fromObject(r);case"element":return Wn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Ti,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,ae.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const u=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const f=this.children[p];if(!(!f.visible||u.test(f._renderer.type))&&(t=f.getBoundingClientRect(e),r=typeof t.top!="number"||ae.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||ae.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||ae.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||ae.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[_,y]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[C,v]=n.multiply(t.right,t.bottom);d=Or(m,y,S,v,d),l=Or(g,_,b,C,l),c=zr(g,_,b,C,c),h=zr(m,y,S,v,h)}else d=Or(t.top,d),l=Or(t.left,l),c=zr(t.right,c),h=zr(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}},Ze=Ti;w(Ze,"Children",vl),w(Ze,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var Pl={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ze.InsertChildren.bind(this),n=Ze.RemoveChildren.bind(this),r=Ze.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new vl(e),this._children.bind(Y.Types.insert,t),this._children.bind(Y.Types.remove,n),this._children.bind(Y.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Fl(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Ws=class extends xe{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Ml)Object.defineProperty(this,a,Ml[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Ml={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new $t("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new $t("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Qt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},qg={start:"left",middle:"center",end:"right"},Al=["id","class","transform","xmlns","viewBox"],Yg=["x","y","width","height","href","xlink:href"];function Ug(e){return qg[e]}function Gg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function nr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Il(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function Kg(e,t){t||(t={});const n=e.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");t[l]=c}return t}function Zg(e){const t={},n=Jg(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function Jg(e){const t=e.getAttributeNames();for(let n=0;n<Al.length;n++){const r=Al[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function Qg(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let u=0;u<e.children.length;u++){const p=e.children[u];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Z(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new Nn(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Dt(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,p,f,g,m,_,y,b,S,C,v,B;if(e===null)return r;if(He.getComputedStyle){const k=He.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?Kg(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ae.defaults(r,n),ae.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=ki(l),t._renderer.type){case"linear-gradient":Il(p,t.left),Il(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=ki(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Z(p.scaleX,p.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(t.translation.x=f),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ze){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ze){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ze){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ze){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ze){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ze){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(Qt.cssBackgroundImage.test(d)&&(m=d.replace(Qt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(y=ze.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=nr(y.nodeName),t.mask=ze[b].call(this,y,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ze?"_":"")+c,Qt.cssBackgroundImage.test(d)?(m=d.replace(Qt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(y=ze.defs.current.get(m),y.object||(b=nr(y.nodeName),y.object=ze[b].call(this,y,{})),y=y.object):(_=tm(this),y=_.getById(m)),t[h]=y):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof Ue,C=t instanceof Ie,v=t instanceof Ve,S||C||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Lt&&(t.family=d);break;case"font-size":t instanceof Lt&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Lt&&(t.weight=d);break;case"font-style":t instanceof Lt&&(t.style=d);break;case"text-decoration":t instanceof Lt&&(t.decoration=d);break;case"line-height":t instanceof Lt&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function em(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||nr(e.nodeName)==="#text"||t.add(s.id,s)}}function tm(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new $r,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)em(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,u=a!==null,p=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(Qt.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(Qt.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(Qt.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(Qt.unitSuffix,""))),d&&Qg(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new $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<e.attributes.length;c++){const d=e.attributes[c],h=Yg.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=nr(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ze;Dt.call(this,e,n,t),this.add(n);const r=Zg.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=nr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new xe(r,!0);return s.stroke="none",s.fill="black",Dt.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;ae.each(h.slice(0),function(p,f){const g=p.slice(1).trim().match(Qt.path),m=p[0],_=m.toLowerCase();let y,b,S,C,v;const B=[];switch(f===0&&(h=[]),_){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(b=0,S=g.length,v=0;b<S;b+=y){if(C=m,v>0)switch(m){case"m":C="l";break;case"M":C="L";break}B.push(C+g.slice(b,b+y).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),ae.each(h,function(p,f){let g,m,_;const y=p[0],b=y.toLowerCase();d=p.slice(1).trim().match(Qt.path),o=y===b;let S,C,v,B,k,E,P,R,j,q,M,A,$,X,F,N,W;switch(b){case"z":if(f>=u)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,ee.close);for(let z=r.length-1;z>=0;z--){const G=r[z];if(/m/i.test(G.command)){l=G;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),_=parseFloat(d[1]),g=new ve(m,_,void 0,void 0,void 0,void 0,/m/i.test(b)?ee.move:ee.line),o&&g.addSelf(l),l=g;break;case"h":case"v":q=/h/i.test(b)?"x":"y",M=/x/i.test(q)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[q]=parseFloat(d[0]),g[M]=l[M],o&&(g[q]+=l[q]),l=g;break;case"c":case"s":S=l.x,C=l.y,c||(c=new Z),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),E=parseFloat(d[3]),P=parseFloat(d[4]),R=parseFloat(d[5])):(j=Fs(l,c,o),v=j.x,B=j.y,k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])),o&&(v+=S,B+=C,k+=S,E+=C,P+=S,R+=C),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,R,k-P,E-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,C=l.y,c||(c=new Z),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])):(j=Fs(l,c,o),v=j.x,B=j.y,k=j.x,E=j.y,P=parseFloat(d[0]),R=parseFloat(d[1])),o&&(v+=S,B+=C,k+=S,E+=C,P+=S,R+=C),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,R,k-P,E-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,C=l.y,$=parseFloat(d[0]),X=parseFloat(d[1]),F=parseFloat(d[2]),N=parseFloat(d[3]),W=parseFloat(d[4]),P=parseFloat(d[5]),R=parseFloat(d[6]),o&&(P+=S,R+=C),A=new ve(P,R),A.command=ee.arc,A.rx=$,A.ry=X,A.xAxisRotation=F,A.largeArcFlag=N,A.sweepFlag=W,g=A,l=A,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new xe(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Dt.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Qi(0,0,s);return o.stroke="none",o.fill="black",Dt.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new er(0,0,s,o);return a.stroke="none",a.fill="black",Dt.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!ae.isNaN(n)||!ae.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Nn(0,0,s,o);return c.stroke="none",c.fill="black",Dt.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new tr(0,0,s,o,c);return d.stroke="none",d.fill="black",Dt.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Ws(n,r,s,o).noFill();return Dt.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let p=0;p<e.children.length;p++){const f=e.children[p];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=f.getAttribute("stop-color"),_=f.getAttribute("stop-opacity"),y=f.getAttribute("style"),b;m===null&&(b=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),_===null?(b=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=b&&b.length>1?parseFloat(b[1]):1):_=parseFloat(_),h.push(new Jt(g,m,_))}const u=new Ie(s,o,a,l,h);return u.spread=r,u.units=n,Dt.call(this,e,u,t),u},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));ae.isNaN(l)&&(l=s),ae.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<e.children.length;f++){const g=e.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let _=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;_===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,_=S&&S.length>1?S[1]:void 0),y===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),u.push(new Jt(m,_,y))}const p=new Ve(s,o,a,u,l,c);return p.spread=r,p.units=n,Dt.call(this,e,p,t),p},text:function(e,t){const n=Ug(e.getAttribute("text-anchor"))||"left",r=Gg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Lt(s);return Dt.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new $t("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Fr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Dt.call(this,e,c,t),c}};function Vl(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ei=class extends Nn{constructor(e,t,n,r){super(t,n,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null);for(let s in Ol)Object.defineProperty(this,s,Ol[s]);this._renderer.flagTextures=nm.bind(this),this._renderer.bindTextures=im.bind(this),this._renderer.unbindTextures=rm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(zl.bind(this)):this.textures=[zl(e)],this.origin=new Z,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ei.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ei.Properties.length;t++){const n=Ei.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const t=new Ei(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ae.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=ae.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Ft(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Be))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Lr=Ei;w(Lr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Lr,"DefaultFrameRate",30);var Ol={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),this._textures=new En((e||[]).slice(0)),this._textures.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function nm(){this._flagTextures=!0}function im(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rm(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function zl(e){if(e instanceof Be)return e;if(typeof e=="string")return new Be(e)}var js=[],Xs=Math.max,sm=Math.min,Ll=Math.abs,Dr=Math.sin,Hr=Math.cos,om=Math.acos,Wr=Math.sqrt,Se={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Se?e:"path"},group:{renderChild:function(e){const t=Se.getRendererType(e._renderer.type);Se[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;this._update();const t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=jr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Se.getRendererType(r._renderer.type);Se[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Se.getRendererType(l._renderer.type);Se[c].render.call(l,e)}return o&&e.restore(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b,S,C,v,B,k,E,P,R,j,q,M,A,$,X,F,N,W,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,$=this._mask,X=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||X||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,p=this._closed,f=this._renderer.vertices,g=f.length,m=g-1,F=jr(r),W=this.dashes,F||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),$){const re=Se.getRendererType($._renderer.type);Se[re].render.call($,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const re=Se.getRendererType(a._renderer.type);Se[re].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const re=Se.getRendererType(s._renderer.type);Se[re].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),W&&W.length>0&&(e.lineDashOffset=W.offset||0,e.setLineDash(W)),e.beginPath();let G,V,O,J,he,ie,ge;for(let re=0;re<g;re++)switch(b=f[re],M=b.x,A=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:G=b.rx,V=b.ry,O=b.xAxisRotation,J=b.largeArcFlag,he=b.sweepFlag,_=p?Mt(re-1,g):Xs(re-1,0),y=f[_],ie=y.x,ge=y.y,Se.renderSvgArcCommand(e,ie,ge,G,V,J,he,O,M,A);break;case ee.curve:_=p?Mt(re-1,g):Math.max(re-1,0),y=f[_],P=y.controls&&y.controls.right||Z.zero,R=b.controls&&b.controls.left||Z.zero,y._relative?(k=P.x+y.x,E=P.y+y.y):(k=P.x,E=P.y),b._relative?(v=R.x+b.x,B=R.y+b.y):(v=R.x,B=R.y),e.bezierCurveTo(k,E,v,B,M,A),re>=m&&p&&(S=C,j=b.controls&&b.controls.right||Z.zero,q=S.controls&&S.controls.left||Z.zero,b._relative?(k=j.x+b.x,E=j.y+b.y):(k=j.x,E=j.y),S._relative?(v=q.x+S.x,B=q.y+S.y):(v=q.x,B=q.y),M=S.x,A=S.y,e.bezierCurveTo(k,E,v,B,M,A));break;case ee.line:e.lineTo(M,A);break;case ee.move:C=b,e.moveTo(M,A);break}return p&&e.closePath(),!X&&!n&&(Se.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),N&&e.restore()),Se.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),N&&e.restore())),F||e.restore(),X&&!n&&e.clip(),W&&W.length>0&&e.setLineDash(js),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,_,y,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,m=jr(r),y=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Se.getRendererType(a._renderer.type);Se[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Se.getRendererType(s._renderer.type);Se[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),e.beginPath();let S=d*.5,C;this._sizeAttenuation||(C=this.worldMatrix.elements,C=ki(C[0],C[3],C[1],C[4],C[2],C[5]),S/=Math.max(C.scaleX,C.scaleY));for(let v=0;v<u;v++)p=h[v],f=p.x,g=p.y,e.moveTo(f+S,g),e.arc(f,g,S,0,ht);return n||(Se.isHidden.test(a)||(_=a._renderer&&a._renderer.offset,_&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),_&&e.restore()),Se.isHidden.test(s)||(_=s._renderer&&s._renderer.offset,_&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),_&&e.restore())),m||e.restore(),y&&y.length>0&&e.setLineDash(js),this.flagReset()}},text:{render:function(e,t,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!t&&(!o||l||s===0))return this;this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,p=this._decoration,f=this._direction,g=jr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Se.alignments[this._alignment]||this._alignment,b=Se.baselines[this._baseline]||this._baseline;let S,C,v,B,k,E,P,R,j,q,M;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const A=Se.getRendererType(a._renderer.type);Se[A].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=y,e.textBaseline=b,e.direction=f,u)if(typeof u=="string")e.fillStyle=u;else{const A=Se.getRendererType(u._renderer.type);Se[A].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const A=Se.getRendererType(d._renderer.type);Se[A].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),!l&&!n&&(Se.isHidden.test(u)||(u._renderer&&u._renderer.offset?(E=u._renderer.scale.x,P=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale(E,P),S=this._size/u._renderer.scale.y,C=this._leading/u._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Se.isHidden.test(d)||(d._renderer&&d._renderer.offset?(E=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(E,P),S=this._size/d._renderer.scale.y,C=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const A=e.measureText(this.value);let $=1;switch(p){case"underline":j=A.actualBoundingBoxDescent,M=A.actualBoundingBoxDescent;break;case"strikethrough":j=0,M=0,$=.5;break}switch(b){case"top":j+=this._size*$,M+=this._size*$;break;case"baseline":case"bottom":j-=this._size*$,M-=this._size*$;break}switch(y){case"left":case"start":R=0,q=A.width;break;case"right":case"end":R=-A.width,q=0;break;default:R=-A.width/2,q=A.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,j),e.lineTo(q,M),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(js),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return this.flagReset()}}},texture:{render:function(e){this._update();const t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ll(r),s=Ll(s);const h=(t-c)/2,u=(n-d)/2,p=Hr(l)*h+Dr(l)*u,f=-Dr(l)*h+Hr(l)*u,g=p*p,m=f*f;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const A=Wr(b);r=A*r,s=A*s,_=r*r,y=s*s}const S=_*m+y*g,C=(_*y-S)/S;let v=Wr(Xs(0,C));o===a&&(v=-v);const B=v*r*f/s,k=-v*s*p/r,E=Hr(l)*B-Dr(l)*k+(t+c)/2,P=Dr(l)*B+Hr(l)*k+(n+d)/2,R=Dl(1,0,(p-B)/r,(f-k)/s),j=Dl((p-B)/r,(f-k)/s,(-p-B)/r,(-f-k)/s)%ht,q=R+j;am(e,E,P,r,s,R,q,a===0,l)}},ft=class extends Y{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ze,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ms(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(Y.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Se.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ft,"Utils",Se);function am(e,t,n,r,s,o,a,l,c){const d=a-o,h=xi.Tolerance.epsilon,u=Math.abs(d)<h;let p=Mt(d,ht);p<h&&(u?p=0:p=ht),l===!0&&!u&&(p===ht?p=-ht:p=p-ht);for(let f=0;f<kt.Resolution;f++){const g=f/(kt.Resolution-1),m=o+g*p;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),C=_-t,v=y-n;_=C*b-v*S+t,y=C*S+v*b+n}e.lineTo(_,y)}}function Dl(e,t,n,r){const s=e*n+t*r,o=Wr(e*e+t*t)*Wr(n*n+r*r);let a=om(Xs(-1,sm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function jr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var se={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(e,t){const n=e,r=document.createElementNS(se.ns,n);return n==="svg"&&(t=ae.defaults(t||{},{version:se.version})),t&&Object.keys(t).length>0&&se.setAttributes(r,t),r},setAttributes:function(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(se.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?Mt(a-1,n):Math.max(a-1,0),d=e[c];let h,u,p,f,g,m,_,y,b,S,C,v,B,k,E,P=Ne(l.x),R=Ne(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:C=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,E=l.sweepFlag,h=ee.arc+" "+C+" "+v+" "+B+" "+k+" "+E+" "+P+" "+R;break;case ee.curve:_=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(p=Ne(_.x+d.x),f=Ne(_.y+d.y)):(p=Ne(_.x),f=Ne(_.y)),l.relative?(g=Ne(y.x+l.x),m=Ne(y.y+l.y)):(g=Ne(y.x),m=Ne(y.y)),h=(a===0?ee.move:ee.curve)+" "+p+" "+f+" "+g+" "+m+" "+P+" "+R;break;case ee.move:s=l,h=ee.move+" "+P+" "+R;break;default:h=l.command+" "+P+" "+R}a>=r&&t&&(l.command===ee.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(p=Ne(b.x+l.x),f=Ne(b.y+l.y)):(p=Ne(b.x),f=Ne(b.y)),u.relative?(g=Ne(S.x+u.x),m=Ne(S.y+u.y)):(g=Ne(S.x),m=Ne(S.y)),P=Ne(u.x),R=Ne(u.y),h+=" C "+p+" "+f+" "+g+" "+m+" "+P+" "+R),l.command!==ee.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(e,t){let n="";const r=t*.5;for(let s=0;s<e.length;s++){const o=e[s].x,a=e[s].y-r;n+=ee.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(e,t){let n=e._renderer.clip;return n||(n=e._renderer.clip=se.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in se?e:"path"},defs:{update:function(e){const{defs:t}=e;if(t._flagUpdate){const n=Array.prototype.slice.call(t.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;e.querySelector(a)||t.removeChild(s)}t._flagUpdate=!1}}},group:{appendChild:function(e){const t=e._renderer.elem;if(!t)return;const n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){const t=e._renderer.elem;!t||t.parentNode!=this.elem||!t.nodeName||e._clip||this.elem.removeChild(t)},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){const t=se.getRendererType(e._renderer.type);se[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;this._update(),this._renderer.elem||(this._renderer.elem=se.createElement("g",{id:this.id}),e.appendChild(this._renderer.elem));const t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=se.getRendererType(s._renderer.type);se[o].render.call(s,e)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(se.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(se.group.removeChild,n),this._flagOrder&&this.children.forEach(se.group.orderChild,n),this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices){const r=se.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this._flagCap&&(t["stroke-linecap"]=this._cap),this._flagJoin&&(t["stroke-linejoin"]=this._join),this._flagMiter&&(t["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=ki(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=se.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}return this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this.flagReset()}},text:{render:function(e){this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagFamily&&(t["font-family"]=this._family),this._flagSize&&(t["font-size"]=this._size),this._flagLeading&&(t["line-height"]=this._leading),this._flagAlignment&&(t["text-anchor"]=se.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=se.baselines[this._baseline]||this._baseline),this._flagStyle&&(t["font-style"]=this._style),this._flagWeight&&(t["font-weight"]=this._weight),this._flagDecoration&&(t["text-decoration"]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(e,t){t||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},texture:{render:function(e,t){t||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof Z?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Z?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?se.setAttributes(this._renderer.image,r):this._renderer.image=se.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&se.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=se.createElement("pattern",n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),this.flagReset()}}},Hl=class extends Y{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ze,this.scene.parent=this,this.defs=se.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,se.setAttributes(this.domElement,{width:e,height:t}),this.trigger(Y.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(Hl,"Utils",se);var Ht={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new $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
|
|