@snabcentr/vue-ui-lib 3.5.1 → 3.5.2
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 +1 -1
- package/dist/sc-vue-ui-lib.js +2284 -2258
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +24 -24
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/components/configurators/configurators-product-info.vue.d.ts +10 -1
- package/dist/src/components/configurators/kozyrek/kozyrek-configurator-params-form.vue.d.ts +1 -1
- package/dist/src/components/configurators/kozyrek/kozyrek-configurator.vue.d.ts +2 -2
- package/dist/src/components/configurators/metal-for-doors/metal-for-doors-configurator-form.vue.d.ts +6 -6
- package/dist/src/components/configurators/metal-for-doors/metal-for-doors-configurator.vue.d.ts +2 -2
- package/dist/src/components/configurators/mosquito/mosquito-configurator-form.vue.d.ts +1 -1
- package/dist/src/components/configurators/mosquito/mosquito-configurator.vue.d.ts +4 -3
- package/dist/src/components/configurators/strip/strip-configurator-form.vue.d.ts +1 -1
- package/dist/src/components/configurators/strip/strip-configurator.vue.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(H,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],F):(H=typeof globalThis<"u"?globalThis:H||self,F(H.SC_VueUiLib={},H["lodash-es"],H.Vue,H["naive-ui"],H["@snabcentr/common-lib"],H["date-fns"],H["libphonenumber-js"],H["ts-case-convert"],H["vue-tel-input"]))})(this,(function(H,F,i,z,Z,Ln,sr,Os,Hu){"use strict";var rC=Object.defineProperty;var Ou=H=>{throw TypeError(H)};var sC=(H,F,i)=>F in H?rC(H,F,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[F]=i;var v=(H,F,i)=>sC(H,typeof F!="symbol"?F+"":F,i),zu=(H,F,i)=>F.has(H)||Ou("Cannot "+i);var Rt=(H,F,i)=>(zu(H,F,"read from private field"),i?i.call(H):F.get(H)),Da=(H,F,i)=>F.has(H)?Ou("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(H):F.set(H,i),Lu=(H,F,i,z)=>(zu(H,F,"write to private field"),z?z.call(H,i):F.set(H,i),i);var ki,ct,As;var Ze=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Ze||{}),Ue=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ue||{});class ni{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&F.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ni.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ni.isVnodeEmpty(e()):!1}}const ii=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},ln=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},Ut=t=>t?Number.parseFloat(t.replace(",",".")):null,Ke=(t,e)=>{t[e]={}};class Ft{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(F.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=F.isString(r.key)?F.get(d,r.key):r.key(c),f=F.isString(r.label)?F.get(d,r.label):r.label(c);return{type:"group",label:F.isEmpty(f)?"- Не определено -":f,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Wu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ju(t,e){return i.openBlock(),i.createElementBlock("svg",Wu,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Wa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:ju}),qu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xu(t,e){return i.openBlock(),i.createElementBlock("svg",qu,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const ja=i.markRaw({name:"tabler-edit",render:Xu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const qa=i.markRaw({name:"ion-checkmark-done-circle",render:Uu}),Gu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ku(t,e){return i.openBlock(),i.createElementBlock("svg",Gu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Xa=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Ku}),Zu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Qu(t,e){return i.openBlock(),i.createElementBlock("svg",Zu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const Ju=i.markRaw({name:"fluent-pin32-regular",render:Qu}),ef={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tf(t,e){return i.openBlock(),i.createElementBlock("svg",ef,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const nf=i.markRaw({name:"ion-eye-outline",render:tf}),rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const of=i.markRaw({name:"fluent-pin32-filled",render:sf}),af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const Ya=i.markRaw({name:"ion-bookmark-outline",render:lf}),cf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function df(t,e){return i.openBlock(),i.createElementBlock("svg",cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const hf=i.markRaw({name:"ion-eye-off-sharp",render:df}),uf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ff(t,e){return i.openBlock(),i.createElementBlock("svg",uf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const gf=i.markRaw({name:"ion-chevron-forward-outline",render:ff}),mf=["data-name"],pf={class:"sc-collapse-item-header flex flex-row gap-2.5"},yf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},bf={key:0},_f={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},wf={class:"flex flex-1 flex-col"},xf={key:0,class:"sc-collapse-item-sub-title flex-1"},vf={key:1,class:"sc-collapse-item-title-extra flex-none"},kf={key:0,class:"sc-collapse-item-content"},Cf={},Sf=i.defineComponent({...Cf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",F.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=F.some(a,p=>p===r.name),d=i.computed(()=>F.some(l,p=>p===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,b)=>{const y=gf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",pf,[i.createElementVNode("div",yf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ni).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",bf,[i.createElementVNode("div",_f,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",wf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ni).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",xf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ni).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",kf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,mf)}}}),ri=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Ua=ri(Sf,[["__scopeId","data-v-415a3dda"]]),Bf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Tf(t,e){return i.openBlock(),i.createElementBlock("svg",Bf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Rf=i.markRaw({name:"ion-cart-outline",render:Tf}),Mr=Symbol(),$f={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"}},Pf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ef={},Ga=i.defineComponent({...Ef,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>F.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>F.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>F.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>F.isNil(e.productContextButtonsConfig)?[]:F.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=f=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:f})};return(f,m)=>{var w;const g=Xa,u=qa,p=z.NButton,b=z.NTooltip,y=ja,_=Rf,R=Wa,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Pf,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(u,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((w=a.value)==null?void 0:w.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(R)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Nf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ff(t,e){return i.openBlock(),i.createElementBlock("svg",Nf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Af=i.markRaw({name:"tabler-history",render:Ff}),Mf={class:"flex flex-row gap-1"},Vf={key:0,class:"flex flex-row text-nowrap text-sm line-through"},If={key:1,class:"flex flex-row text-nowrap text-sm"},Of={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},zf={},Vr=i.defineComponent({...zf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){const e=t,n=i.computed(()=>F.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:F.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?F.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Ln.format(e.product.costDate,Z.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(F.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!F.isNil(r.value)),l=i.computed(()=>F.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>F.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,f)=>{var p;const m=z.NTag,g=z.NTooltip,u=Af;return i.openBlock(),i.createElementBlock("div",Mf,[t.showTag?(i.openBlock(),i.createBlock(g,{key:0},{trigger:i.withCtx(()=>[i.createVNode(m,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var b;return[i.createTextVNode(i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var b;return[i.createTextVNode(" "+i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Vf,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:f[0]||(f[0]=()=>{var b;a.value&&((b=t.eventEmitter)==null||b.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",If," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(F.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Of,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(g,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"cursor-pointer",onClick:f[1]||(f[1]=b=>{var y;return(y=t.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Lf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Df(t,e){return i.openBlock(),i.createElementBlock("svg",Lf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const zs=i.markRaw({name:"ion-information-circle-outline",render:Df}),Hf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Ka=i.markRaw({name:"ion-images",render:Wf});/*!
|
|
1
|
+
(function(H,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],F):(H=typeof globalThis<"u"?globalThis:H||self,F(H.SC_VueUiLib={},H["lodash-es"],H.Vue,H["naive-ui"],H["@snabcentr/common-lib"],H["date-fns"],H["libphonenumber-js"],H["ts-case-convert"],H["vue-tel-input"]))})(this,(function(H,F,i,z,K,Ln,sr,Os,Hu){"use strict";var sC=Object.defineProperty;var Ou=H=>{throw TypeError(H)};var oC=(H,F,i)=>F in H?sC(H,F,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[F]=i;var v=(H,F,i)=>oC(H,typeof F!="symbol"?F+"":F,i),zu=(H,F,i)=>F.has(H)||Ou("Cannot "+i);var Rt=(H,F,i)=>(zu(H,F,"read from private field"),i?i.call(H):F.get(H)),Da=(H,F,i)=>F.has(H)?Ou("Cannot add the same private member more than once"):F instanceof WeakSet?F.add(H):F.set(H,i),Lu=(H,F,i,z)=>(zu(H,F,"write to private field"),z?z.call(H,i):F.set(H,i),i);var ki,ct,As;var Ze=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Ze||{}),Ue=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ue||{});class ni{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&F.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ni.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ni.isVnodeEmpty(e()):!1}}const ii=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},ln=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},Ut=t=>t?Number.parseFloat(t.replace(",",".")):null,Ke=(t,e)=>{t[e]={}};class Ft{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(F.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=F.isString(r.key)?F.get(d,r.key):r.key(c),f=F.isString(r.label)?F.get(d,r.label):r.label(c);return{type:"group",label:F.isEmpty(f)?"- Не определено -":f,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Ft.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Wu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ju(t,e){return i.openBlock(),i.createElementBlock("svg",Wu,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Wa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:ju}),qu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xu(t,e){return i.openBlock(),i.createElementBlock("svg",qu,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const ja=i.markRaw({name:"tabler-edit",render:Xu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const qa=i.markRaw({name:"ion-checkmark-done-circle",render:Uu}),Gu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ku(t,e){return i.openBlock(),i.createElementBlock("svg",Gu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Xa=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Ku}),Zu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Qu(t,e){return i.openBlock(),i.createElementBlock("svg",Zu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const Ju=i.markRaw({name:"fluent-pin32-regular",render:Qu}),ef={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tf(t,e){return i.openBlock(),i.createElementBlock("svg",ef,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const nf=i.markRaw({name:"ion-eye-outline",render:tf}),rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const of=i.markRaw({name:"fluent-pin32-filled",render:sf}),af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const Ya=i.markRaw({name:"ion-bookmark-outline",render:lf}),cf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function df(t,e){return i.openBlock(),i.createElementBlock("svg",cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const hf=i.markRaw({name:"ion-eye-off-sharp",render:df}),uf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ff(t,e){return i.openBlock(),i.createElementBlock("svg",uf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const gf=i.markRaw({name:"ion-chevron-forward-outline",render:ff}),mf=["data-name"],pf={class:"sc-collapse-item-header flex flex-row gap-2.5"},yf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},bf={key:0},_f={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},wf={class:"flex flex-1 flex-col"},xf={key:0,class:"sc-collapse-item-sub-title flex-1"},vf={key:1,class:"sc-collapse-item-title-extra flex-none"},kf={key:0,class:"sc-collapse-item-content"},Cf={},Sf=i.defineComponent({...Cf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",F.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=F.some(a,p=>p===r.name),d=i.computed(()=>F.some(l,p=>p===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,b)=>{const y=gf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",pf,[i.createElementVNode("div",yf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ni).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",bf,[i.createElementVNode("div",_f,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",wf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ni).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",xf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ni).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",kf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,mf)}}}),ri=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Ua=ri(Sf,[["__scopeId","data-v-415a3dda"]]),Bf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Tf(t,e){return i.openBlock(),i.createElementBlock("svg",Bf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Rf=i.markRaw({name:"ion-cart-outline",render:Tf}),Mr=Symbol(),$f={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"}},Pf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ef={},Ga=i.defineComponent({...Ef,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>F.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>F.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>F.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>F.isNil(e.productContextButtonsConfig)?[]:F.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=f=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:f})};return(f,m)=>{var w;const g=Xa,u=qa,p=z.NButton,b=z.NTooltip,y=ja,_=Rf,R=Wa,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Pf,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(u,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((w=a.value)==null?void 0:w.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(R)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Nf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ff(t,e){return i.openBlock(),i.createElementBlock("svg",Nf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Af=i.markRaw({name:"tabler-history",render:Ff}),Mf={class:"flex flex-row gap-1"},Vf={key:0,class:"flex flex-row text-nowrap text-sm line-through"},If={key:1,class:"flex flex-row text-nowrap text-sm"},Of={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},zf={},Vr=i.defineComponent({...zf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){const e=t,n=i.computed(()=>F.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:F.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?F.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Ln.format(e.product.costDate,K.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(F.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!F.isNil(r.value)),l=i.computed(()=>F.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>F.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,f)=>{var p;const m=z.NTag,g=z.NTooltip,u=Af;return i.openBlock(),i.createElementBlock("div",Mf,[t.showTag?(i.openBlock(),i.createBlock(g,{key:0},{trigger:i.withCtx(()=>[i.createVNode(m,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var b;return[i.createTextVNode(i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var b;return[i.createTextVNode(" "+i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Vf,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:f[0]||(f[0]=()=>{var b;a.value&&((b=t.eventEmitter)==null||b.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",If," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(F.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Of,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(g,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"cursor-pointer",onClick:f[1]||(f[1]=b=>{var y;return(y=t.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Lf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Df(t,e){return i.openBlock(),i.createElementBlock("svg",Lf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const zs=i.markRaw({name:"ion-information-circle-outline",render:Df}),Hf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Ka=i.markRaw({name:"ion-images",render:Wf});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
38
38
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
39
39
|
PERFORMANCE OF THIS SOFTWARE.
|
|
40
|
-
***************************************************************************** */var Or=function(){return Or=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Or.apply(this,arguments)},Xf={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"}},Sn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ls=500,Yf=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Or(Or({},Xf),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(Sn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(n),g,u,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),g=p/y,u=b/y}else{var y=(e-n)*n;g=p*y,u=b*y}r&&(f?this.isBeyondPossibleLeft(g,m.minX)?g=m.minX:this.isBeyondPossibleRight(g,m.maxX)&&(g=m.maxX):e>1&&(g<m.minX?g=m.minX:g>m.maxX&&(g=m.maxX)),h?this.isBeyondPossibleTop(u,m.minY)?u=m.minY:this.isBeyondPossibleBottom(u,m.maxY)&&(u=m.maxY):e>1&&(u<m.minY?u=m.minY:u>m.maxY&&(u=m.maxY))),this.setZoomStyles({x:g,y:u,scale:e}),this.left=g,this.top=u,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Ls),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ls+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ls+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(Sn.containerResize+".zoom "+Sn.rotateRight+".zoom "+Sn.rotateLeft+".zoom "+Sn.flipHorizontal+".zoom "+Sn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(Sn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(Sn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(Sn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var f=e.scale-o;e.zoomImage(e.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),f={};f.x=this.left+a,f.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,m.minY)?f.y=m.minY:this.isBeyondPossibleBottom(f.y,m.maxY)&&(f.y=m.maxY)),r&&(this.isBeyondPossibleLeft(f.x,m.minX)?f.x=m.minX:this.isBeyondPossibleRight(f.x,m.maxX)&&(f.x=m.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;e&&(o=o+e*o,a=a+e*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,f={minY:l,maxY:c,minX:d,maxX:h};return f},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(f=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,o=g.allowX,(o||a)&&(n=e.getSwipeCords(m)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(m){if(m.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var g=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(h,g))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target))){if(m.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||g.get().contains(m.target)){c=new Date,f=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var u=e.getDragAllowedAxises(0);l=u.allowY,a=u.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),h=e.getPossibleSwipeDragCords(),s=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(m){if(s){o=!0,r=e.getDragCords(m);var g=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(f,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(m){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(m);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Uf={ref:"gallery-container",class:"lightgallery-wrapper"},Gf={},Za=i.defineComponent({...Gf,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...e.settings}),F.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",Uf,[i.renderSlot(o.$slots,"default")],512))}}),at=class at{static init(){at.isInitialized||(at.isInitialized=!0,at.windowResizeHandler(),window.addEventListener("resize",at.windowResizeHandler))}static destroy(){window.removeEventListener("resize",at.windowResizeHandler),at.isInitialized=!1}static getDeviceTypeByResolution(){const e=Z.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ue.phone:window.innerWidth<e.laptop?Ue.tablet:Ue.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return at.setRefValueDependingOnDeviceResolution(s,e,n,r),at.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return at.getDeviceTypeByResolution()===Ue.phone}static isTabletDevice(){return at.getDeviceTypeByResolution()===Ue.tablet}static isLaptopDevice(){return at.getDeviceTypeByResolution()===Ue.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(at.getDeviceTypeByResolution()){case Ue.phone:e.value=n;break;case Ue.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){F.forEach(at.refsDependingOnDeviceResolution,e=>{at.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};v(at,"isInitialized",!1),v(at,"refsDependingOnDeviceResolution",[]);let wt=at;const Kf=["href"],Zf=["src","alt"],Qf={},Qa=i.defineComponent({...Qf,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[qf,Yf],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===Ue.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=Ka,m=z.NPopover;return i.openBlock(),i.createBlock(m,{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]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(Za,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,u)=>(i.openBlock(),i.createElementBlock("a",{key:u,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${u+1}`},null,8,Zf)],8,Kf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Jf={class:"flex flex-col text-sm"},eg={},tg=i.defineComponent({...eg,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=zs,s=z.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Jf,[(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})}}}),ng={class:"flex flex-row justify-between"},ig={key:1},rg={class:"ml-2 align-sub"},sg={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},og={class:"@container"},ag={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},lg={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},cg={class:"text-sc-dark-grey"},dg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},hg={class:"text-gray-600"},ug={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},fg={key:3,class:"underline decoration-dashed"},gg={key:4,class:"sc-product-pack whitespace-nowrap"},mg={class:"text-gray-600"},pg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},yg={class:"text-gray-600"},bg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},_g={key:0},wg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},xg={},ar=i.defineComponent({...xg,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>F.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>F.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>F.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,f)=>{var R,k,w,C,S;const m=Ya,g=z.NTooltip,u=Ka,p=z.NText,b=Ga,y=zs,_=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",ng,[i.createVNode(p,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var T;return[((T=t.product)==null?void 0:T.isFavorite)??!1?(i.openBlock(),i.createBlock(g,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{class:"!text-black mr-2 pt-1.5 align-sub"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",ig," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",rg,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(Qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",sg,[i.createVNode(u)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||((R=t.productContextButtonsConfig)==null?void 0:R.length)>0?(i.openBlock(),i.createBlock(b,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",og,[i.createElementVNode("div",ag,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",lg,[f[1]||(f[1]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",cg,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",dg,[f[2]||(f[2]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",hg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(tg,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",ug,[f[3]||(f[3]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(y,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",fg," Нет в наличии ")),(w=(k=t.product)==null?void 0:k.properties)!=null&&w.pack?(i.openBlock(),i.createElementBlock("span",gg,[f[4]||(f[4]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",mg,i.toDisplayString((S=(C=t.product)==null?void 0:C.properties)==null?void 0:S.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",pg,[f[5]||(f[5]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",yg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",bg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,T=>(i.openBlock(),i.createBlock(Vr,{key:T.coefficient.slug,product:t.product,"cost-field-name":T.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(Vr,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",_g,[i.createElementVNode("ul",wg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(T,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(T),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(T,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(T),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),vg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Vr,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),kg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(F.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),wt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(F.forEach(t,s=>{F.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),F.forEach(F.sortBy(r,["slug"]),s=>{n.push(vg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Vr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!F.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ga,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},Cg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sg(t,e){return i.openBlock(),i.createElementBlock("svg",Cg,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Ja=i.markRaw({name:"ion-trash",render:Sg}),Bg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Tg(t,e){return i.openBlock(),i.createElementBlock("svg",Bg,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const el=i.markRaw({name:"ion-plus",render:Tg}),Rg={key:0,class:"flex w-fit items-center gap-2"},$g={key:1,class:"flex flex-wrap gap-1"},Pg={key:0},Eg={},lr=i.defineComponent({...Eg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=z.NSpin;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Rg,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",$g,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Pg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),ue={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},Qe={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Ng={class:"flex flex-col gap-4"},Fg={class:"flex flex-col gap-2"},Ag={class:"mt-8 font-bold"},Mg={class:"grid grow grid-cols-2 items-start gap-2"},Vg={class:"text-sm"},Ig={class:"font-medium"},Og={key:0,class:"text-red-500"},zg={key:2,class:"text-red-500 text-sm mb-2"},Lg={class:"flex flex-col gap-4"},Dg={key:0},Hg={class:"text-lg font-semibold"},Wg={class:"flex gap-3"},jg={},tl=i.defineComponent({...jg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var p;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(F.cloneDeep(r.value)),c=i.computed(()=>{var y,_,R;const b={"configuratorParams.length":[ue.required,ue.min(r.settings.stripMinLength),ue.max(r.settings.stripMaxLength||Number.MAX_VALUE),ue.step(r.settings.lengthStep),Qe.serverValidation((y=r.validation.length)==null?void 0:y.feedback)],quantity:[ue.required,ue.min(1),ue.step(1),Qe.serverValidation((_=r.validation.quantity)==null?void 0:_.feedback)],marker:[Qe.serverValidation((R=r.validation.marker)==null?void 0:R.feedback)]};return F.forEach(l.value.configuratorParams.linesWidths,(k,w)=>{var T;const S=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;b[`configuratorParams.linesWidths.${w}`]=[ue.required,ue.min(S),ue.max(r.settings.maxLineWidth),ue.step(r.settings.lineWidthStep),Qe.serverValidation((T=r.validation[`lines_widths[${w+1}]`])==null?void 0:T.feedback)]}),F.forEach(l.value.configuratorParams.linesAngles,(k,w)=>{var C;b[`configuratorParams.linesAngles.${w}`]=[ue.required,ue.min(r.settings.minLineAngle),ue.max(r.settings.maxLineAngle),ue.step(r.settings.lineAngleStep),Qe.serverValidation((C=r.validation[`lines_angles[${w+1}]`])==null?void 0:C.feedback)]}),b}),d=i.computed(()=>{var k;const{length:b}=l.value.configuratorParams,{quantity:y}=l.value,_=((k=l.value.product)==null?void 0:k.costRub)||0;if(!b||!y||_===0)return null;const R=b/100;return(_*y*R).toLocaleString("ru-ru",{minimumFractionDigits:2})}),h=i.computed(()=>F.reduce(l.value.configuratorParams.linesWidths,(b,y)=>b+(y||0),0)),f=i.computed(()=>{const b=h.value;return b>=r.settings.stripMinWidth&&b<=r.settings.stripMaxWidth}),m=i.computed(()=>{const{configuratorParams:b}=l.value,y=F.every(b.linesWidths,w=>!!(w&&w>0)),_=F.every(b.linesAngles,w=>!F.isNil(w)),R=!!(l.value.quantity&&l.value.quantity>0),k=b.length>0&&b.length>0;return y&&_&&R&&k&&f.value}),g=()=>{i.nextTick(()=>{var b;(b=o.value)==null||b.validate(y=>{y||(s("update:params",l.value.configuratorParams),u("configuratorParams",l.value.configuratorParams))}).catch(F.noop)})},u=(b,y)=>{const _=new Z.CartItemBase(l.value);_[b]=y,s("update:value",_)};return i.watch(()=>r.previewParams,b=>{l.value.configuratorParams.linesWidths=b.linesWidths,l.value.configuratorParams.linesAngles=b.linesAngles},{deep:!0}),i.watch(()=>r.value,b=>{l.value=F.cloneDeep(b)},{deep:!0}),e({validate:(p=o.value)==null?void 0:p.validate,formReference:o}),(b,y)=>{const _=el,R=Ja;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var k;return[i.createElementVNode("div",Ng,[y[20]||(y[20]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[y[0]||(y[0]=w=>l.value.configuratorParams.startTailType=w),g],options:t.settings.startTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Fg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,C)=>(i.openBlock(),i.createElementBlock("div",{key:C,class:"flex items-start gap-2"},[i.createElementVNode("div",Ag,i.toDisplayString(C+1),1),i.createElementVNode("div",Mg,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${C}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[C],"onUpdate:value":[S=>l.value.configuratorParams.linesWidths[C]=S,y[2]||(y[2]=S=>g())],parse:i.unref(Ut),"show-button":!1,class:"w-full",onKeydown:y[1]||(y[1]=S=>i.unref(ln)(S,".",!1)),onInput:S=>i.unref(Ke)(t.validation,`lines_widths[${C+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${C}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[C],"onUpdate:value":[S=>l.value.configuratorParams.linesAngles[C]=S,y[4]||(y[4]=S=>g())],parse:i.unref(Ut),"show-button":!1,class:"w-full",onKeydown:y[3]||(y[3]=S=>i.unref(ln)(S,".",!1)),onInput:S=>i.unref(Ke)(t.validation,`lines_angles[${C+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:S=>s("click:add-line",C)},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:S=>s("click:remove-line",C)},{default:i.withCtx(()=>[i.createVNode(R)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[y[5]||(y[5]=w=>l.value.configuratorParams.endTailType=w),g],options:t.settings.endTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:l.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Vg,[i.createElementVNode("div",Ig,"Суммарная ширина участков: "+i.toDisplayString(h.value)+" мм",1),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Og," Должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм ",1))]),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",zg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((k=t.settings.allTemplates)==null?void 0:k.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:a.value,onClick:y[6]||(y[6]=w=>s("click:save-template"))},{default:i.withCtx(()=>[...y[19]||(y[19]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Lg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[y[7]||(y[7]=w=>l.value.configuratorParams.colorSide=w),g],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[y[8]||(y[8]=w=>l.value.configuratorParams.length=w),y[11]||(y[11]=w=>g())],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:y[9]||(y[9]=w=>i.unref(ln)(w,".",!1)),onInput:y[10]||(y[10]=w=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[y[12]||(y[12]=w=>l.value.quantity=w),y[15]||(y[15]=w=>u("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:y[13]||(y[13]=w=>i.unref(ii)(w,!1)),onInput:y[14]||(y[14]=w=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:y[16]||(y[16]=w=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":y[17]||(y[17]=w=>{l.value.marker=w??null,u("marker",w??null)})},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createElementBlock("div",Dg,[y[21]||(y[21]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Hg,i.toDisplayString(d.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Wg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!m.value,type:"primary",class:"self-start",onClick:y[18]||(y[18]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}});var nl=Object.defineProperty,qg=Object.defineProperties,Xg=Object.getOwnPropertyDescriptors,il=Object.getOwnPropertySymbols,Yg=Object.prototype.hasOwnProperty,Ug=Object.prototype.propertyIsEnumerable,rl=t=>{throw TypeError(t)},Ds=(t,e,n)=>e in t?nl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hs=(t,e)=>{for(var n in e||(e={}))Yg.call(e,n)&&Ds(t,n,e[n]);if(il)for(var n of il(e))Ug.call(e,n)&&Ds(t,n,e[n]);return t},Ws=(t,e)=>qg(t,Xg(e)),sl=(t,e)=>{for(var n in e)nl(t,n,{get:e[n],enumerable:!0})},x=(t,e,n)=>Ds(t,typeof e!="symbol"?e+"":e,n),ol=(t,e,n)=>e.has(t)||rl("Cannot "+n),$t=(t,e,n)=>(ol(t,e,"read from private field"),n?n.call(t):e.get(t)),al=(t,e,n)=>e.has(t)?rl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Gg=(t,e,n,r)=>(ol(t,e,"write to private field"),e.set(t,n),n),xt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return xt.shim(t),typeof e<"u"&&(xt.Image=e),xt.isHeadless=!0,t}},ll={};sl(ll,{Curve:()=>Vi,getAnchorsFromArcData:()=>Qg,getComponentOnCubicBezier:()=>cr,getControlPoints:()=>_l,getCurveBoundingBox:()=>pl,getCurveFromPoints:()=>bl,getCurveLength:()=>ml,getReflection:()=>Ys,integrate:()=>yl,subdivide:()=>Xs});var cl={};sl(cl,{HALF_PI:()=>Je,NumArray:()=>cn,TWO_PI:()=>ht,decomposeMatrix:()=>si,getComputedMatrix:()=>js,getEffectiveStrokeWidth:()=>dn,getPoT:()=>ul,lerp:()=>At,mod:()=>Mt,setMatrix:()=>hl,toFixed:()=>Ae});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var dl,ht=Math.PI*2,Je=Math.PI*.5;function si(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function hl(t){dl=t}function js(t,e){e=e&&e.identity()||new dl;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function At(t,e,n){return n*(e-t)+t}var qs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function ul(t){let e=0;for(;qs[e]&&qs[e]<t;)e++;return qs[e]}function Mt(t,e){for(;t<0;)t+=e;return t%e}var cn=De.Float32Array||Array,Kg=Math.floor;function Ae(t){return Kg(t*1e6)/1e6}function dn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||js(t));const r=si(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var J={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){x(this,"_events",{}),x(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};x(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var fl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(X.Types.change))}}},Gt=class ir extends X{constructor(e=0,n=0){super(),x(this,"_x",0),x(this,"_y",0);for(let r in fl)Object.defineProperty(this,r,fl[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(ir.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ir(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ae(this.x),y:Ae(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};x(Gt,"zero",new Gt),x(Gt,"left",new Gt(-1,0)),x(Gt,"right",new Gt(1,0)),x(Gt,"up",new Gt(0,-1)),x(Gt,"down",new Gt(0,1));var K=Gt,ke=class Is extends K{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=J.move){super(e,n),x(this,"controls",{left:new K,right:new K}),x(this,"_command",J.move),x(this,"_relative",!0),x(this,"_rx",0),x(this,"_ry",0),x(this,"_xAxisRotation",0),x(this,"_largeArcFlag",0),x(this,"_sweepFlag",1);for(let d in gl)Object.defineProperty(this,d,gl[d]);this.command=l,this.relative=!0;const c=Is.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(X.Types.change)}}static fromObject(e){return new Is().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Is().copy(this)}toObject(){return{x:Ae(this.x),y:Ae(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ae(this.rx),ry:Ae(this.ry),xAxisRotation:Ae(this.xAxisRotation),largeArcFlag:Ae(this.largeArcFlag),sweepFlag:Ae(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},gl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}}},Zg=0,vt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Zg++}},Vi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function cr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Xs(t,e,n,r,s,o,a,l,c){c=c||Vi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ke(a,l)];const h=[];for(let f=0;f<d;f++){const m=f/d,g=cr(m,t,n,s,a),u=cr(m,e,r,o,l);h.push(new ke(g,u))}return h}function ml(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(m*b+g)*b+u;return Math.sqrt(y*y+_*_)}return yl(p,0,1,c||Vi.RecursionLimit)}function pl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,m,g,u,p,b,y;for(let w=0;w<2;++w){if(w===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;g=-m/f,0<g&&g<1&&c.push(g);continue}b=f*f-4*m*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,R=_,k;for(;_--;)g=c[_],k=1-g,d[0][_]=k*k*k*t+3*k*k*g*n+3*k*g*g*s+g*g*g*a,d[1][_]=k*k*k*e+3*k*k*g*r+3*k*g*g*o+g*g*g*l;return d[0][R]=t,d[1][R]=e,d[0][R+1]=a,d[1][R+1]=l,d[0].length=d[1].length=R+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function yl(t,e,n,r){let s=Vi.abscissas[r-2],o=Vi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function bl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Mt(s-1,n):Math.max(s-1,0),l=e?Mt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];_l(c,d,h),d.command=s===0?J.move:J.curve}}function _l(t,e,n){const r=K.angleBetween(t,e),s=K.angleBetween(n,e);let o=K.distanceBetween(t,e),a=K.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ys(t,e,n){return new K(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Qg(t,e,n,r,s,o,a){const l=vt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),m=r*Math.sin(h),g=new ke(f,m);g.command=J.line}}var wl=Array.prototype.slice;function Jg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var G={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!Jg(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:De.performance&&De.performance.now?De.performance:Date},Vt={hasEventListeners:typeof De.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Vt},unbind:function(t,e,n,r){return Vt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Vt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=De[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=De.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ii=De.document?De.document.createElement("div"):{};Ii.id="help-two-load",Object.defineProperty(Vt,"temp",{enumerable:!0,get:function(){return G.isElement(Ii)&&!De.document.head.contains(Ii)&&(Ii.style.display="none",De.document.head.appendChild(Ii)),Ii}});var Pt=class extends Error{constructor(e){super(),x(this,"name","Two.js"),x(this,"message"),this.message=e}},em=De.devicePixelRatio||1;function tm(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Us(t){return em/tm(t)}var zr=class{constructor(){x(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},ut,Dn=class extends Array{constructor(){super(),al(this,ut,new X),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return $t(this,ut)}set _events(e){Gg(this,ut,e)}get _bound(){return $t(this,ut)._bound}set _bound(e){$t(this,ut)._bound=e}addEventListener(){return $t(this,ut).addEventListener.apply(this,arguments)}on(){return $t(this,ut).on.apply(this,arguments)}bind(){return $t(this,ut).bind.apply(this,arguments)}removeEventListener(){return $t(this,ut).removeEventListener.apply(this,arguments)}off(){return $t(this,ut).off.apply(this,arguments)}unbind(){return $t(this,ut).unbind.apply(this,arguments)}dispatchEvent(){return $t(this,ut).dispatchEvent.apply(this,arguments)}trigger(){return $t(this,ut).trigger.apply(this,arguments)}listen(){return $t(this,ut).listen.apply(this,arguments)}ignore(){return $t(this,ut).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};ut=new WeakMap;var xl=class Du extends X{constructor(){super(),x(this,"_flagId",!1),x(this,"_flagClassName",!1),x(this,"_renderer",{}),x(this,"_id",vt.Identifier+vt.uniqueId()),x(this,"_className",""),x(this,"classList",[]);for(let e in vl)Object.defineProperty(this,e,vl[e])}static fromObject(e){const n=new Du().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};x(xl,"Properties",["renderer","id","className"]);var Oi=xl,vl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},Lr,kl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(Lr=document.createElement("a"));var Kt=class zt extends Oi{constructor(e,n){super(),x(this,"_flagSrc",!1),x(this,"_flagImage",!1),x(this,"_flagVideo",!1),x(this,"_flagLoaded",!1),x(this,"_flagRepeat",!1),x(this,"_flagOffset",!1),x(this,"_flagScale",!1),x(this,"_src",""),x(this,"_image",null),x(this,"_loaded",!1),x(this,"_repeat","no-repeat"),x(this,"_scale",1),x(this,"_offset",null);for(let r in Cl)Object.defineProperty(this,r,Cl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=nm.bind(this),this._renderer.flagScale=im.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new K,typeof n=="function"){const r=(function(){this.unbind(X.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(X.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new zt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Lr?(Lr.href=e,Lr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=zt.getAbsoluteURL(e);if(zt.ImageRegistry.contains(n))return zt.ImageRegistry.get(n);let r;return xt.Image?(r=new xt.Image,xt.shim(r,"img")):De.document?kl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=zt.getTag(r);e._flagImage&&(/canvas/i.test(s)?zt.Register.canvas(e,n):(e._src=!xt.isHeadless&&r.getAttribute("two-src")||r.src,zt.Register[s](e,n))),e._flagSrc&&(r||(r=zt.getImage(e.src),e.image=r),s=zt.getTag(r),zt.Register[s](e,n))}clone(){const e=new zt(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 K?e.offset:new K().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof K?e.scale:new K().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,zt.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(Kt,"Properties",["src","loaded","repeat","scale","offset","image"]),x(Kt,"RegularExpressions",kl),x(Kt,"ImageRegistry",new zr),x(Kt,"Register",{canvas:function(t,e){t._src="#"+t.id,Kt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!xt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!xt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Pt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!xt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Kt.getAbsoluteURL(t._src),!(!xt.isHeadless&&n&&n.getAttribute("two-src"))&&(xt.isHeadless||n.setAttribute("two-src",t.src),Kt.ImageRegistry.add(t.src,n),xt.isHeadless?Kt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(xt.isHeadless)throw new Pt("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new Pt("unable to load "+t.src)};t._src=Kt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Kt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Me=Kt,Cl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Me.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Me.ImageRegistry.contains(n)?this._image=Me.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(X.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof K&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof K&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function nm(){this._flagOffset=!0}function im(){this._flagScale=!0}var Gs=class an extends Oi{constructor(e,n,r){super(),x(this,"_flagOffset",!0),x(this,"_flagOpacity",!0),x(this,"_flagColor",!0),x(this,"_offset",0),x(this,"_opacity",1),x(this,"_color","#fff");for(let s in Sl)Object.defineProperty(this,s,Sl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:an.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:an.Index<=0?"#fff":"#000",an.Index=(an.Index+1)%2}static fromObject(e){const n=new an().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<an.Properties.length;n++){const r=an.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new an;return G.each(an.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",G.each(an.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Gs,"Index",0),x(Gs,"Properties",["offset","opacity","color"]);var Hn=Gs,Sl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Ks=class Ri extends Oi{constructor(e){super(),x(this,"_flagStops",!1),x(this,"_flagSpread",!1),x(this,"_flagUnits",!1),x(this,"_spread",""),x(this,"_units","");for(let n in Bl)Object.defineProperty(this,n,Bl[n]);this._renderer.type="gradient",this._renderer.flagStops=rm.bind(this),this._renderer.bindStops=sm.bind(this),this._renderer.unbindStops=om.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Hn?s:new Hn().copy(s)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Ri(n);return G.each(Ri.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return G.each(Ri.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(Ks,"Stop",Hn),x(Ks,"Properties",["spread","stops","units"]);var et=Ks,Bl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(X.Types.insert,e).unbind(X.Types.remove,n),this._stops=new Dn((t||[]).slice(0)),this._stops.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._stops)}}};function rm(){this._flagStops=!0}function sm(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function om(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Zs=class Er extends et{constructor(e,n,r,s,o){super(o),x(this,"_flagEndPoints",!1),x(this,"_left",null),x(this,"_right",null);for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=am.bind(this),this.left=new K,this.right=new K,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new Er().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Er.Properties.length;n++){const r=Er.Properties[n];r in e&&(this[r]=e[r]instanceof K?e[r]:new K().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Er(this.left._x,this.left._y,this.right._x,this.right._y,n);return G.each(et.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(Zs,"Stop",Hn),x(Zs,"Properties",["left","right"]);var He=Zs,Tl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof K&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof K&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function am(){this._flagEndPoints=!0}var Qs=class $i extends et{constructor(e,n,r,s,o,a){super(s),x(this,"_flagRadius",!1),x(this,"_flagCenter",!1),x(this,"_flagFocal",!1),x(this,"_radius",0),x(this,"_center",null),x(this,"_focal",null);for(let l in Rl)Object.defineProperty(this,l,Rl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=lm.bind(this),this._renderer.flagFocal=cm.bind(this),this.center=new K,this.radius=typeof r=="number"?r:1,this.focal=new K,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof K?e[r]:new K().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new $i(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return G.each(et.Properties.concat($i.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return G.each($i.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(Qs,"Stop",Hn),x(Qs,"Properties",["center","radius","focal"]);var We=Qs,Rl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(X.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function lm(){this._flagCenter=!0}function cm(){this._flagFocal=!0}function $l(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Dr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Pl(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),ml(r,l,s,c,o,d,a,h,n)}function El(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Xs(r,l,s,c,o,d,a,h,n)}function oi(t){switch(t.renderer.type){case"texture":return Me.fromObject(t);case"gradient":return et.fromObject(t);case"linear-gradient":return He.fromObject(t);case"radial-gradient":return We.fromObject(t)}return t}var dm=Math.cos,hm=Math.sin,Nl=Math.tan,Js=[],Fl=class Lt extends X{constructor(e,n,r,s,o,a){super(),x(this,"elements",new cn(9)),x(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const C=e;let S,T,B;const $=n[0]||0,M=n[1]||0,E=n[2]||0;return S=C[0]*$+C[1]*M+C[2]*E,T=C[3]*$+C[4]*M+C[5]*E,B=C[6]*$+C[7]*M+C[8]*E,[S,T,B]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],f=e[7],m=e[8],g=n[0],u=n[1],p=n[2],b=n[3],y=n[4],_=n[5],R=n[6],k=n[7],w=n[8];return r=r||new cn(9),r[0]=s*g+o*b+a*R,r[1]=s*u+o*y+a*k,r[2]=s*p+o*_+a*w,r[3]=l*g+c*b+d*R,r[4]=l*u+c*y+d*k,r[5]=l*p+c*_+d*w,r[6]=h*g+f*b+m*R,r[7]=h*u+f*y+m*k,r[8]=h*p+f*_+m*w,r}static fromObject(e){return new Lt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(X.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(X.Types.change)}identity(){return this.elements[0]=Lt.Identity[0],this.elements[1]=Lt.Identity[1],this.elements[2]=Lt.Identity[2],this.elements[3]=Lt.Identity[3],this.elements[4]=Lt.Identity[4],this.elements[5]=Lt.Identity[5],this.elements[6]=Lt.Identity[6],this.elements[7]=Lt.Identity[7],this.elements[8]=Lt.Identity[8],this.trigger(X.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(X.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const L=o[0]*e+o[1]*n+o[2]*r,D=o[3]*e+o[4]*n+o[5]*r,te=o[6]*e+o[7]*n+o[8]*r;return[L,D,te]}const h=this.elements,f=[e,n,r,s,o,a,l,c,d],m=h[0],g=h[1],u=h[2],p=h[3],b=h[4],y=h[5],_=h[6],R=h[7],k=h[8],w=f[0],C=f[1],S=f[2],T=f[3],B=f[4],$=f[5],M=f[6],E=f[7],V=f[8];return this.elements[0]=m*w+g*T+u*M,this.elements[1]=m*C+g*B+u*E,this.elements[2]=m*S+g*$+u*V,this.elements[3]=p*w+b*T+y*M,this.elements[4]=p*C+b*B+y*E,this.elements[5]=p*S+b*$+y*V,this.elements[6]=_*w+R*T+k*M,this.elements[7]=_*C+R*B+k*E,this.elements[8]=_*S+R*$+k*V,this.trigger(X.Types.change)}inverse(e){const n=this.elements;e=e||new Lt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],f=n[8],m=f*l-c*h,g=-f*a+c*d,u=h*a-l*d;let p=r*m+s*g+o*u;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-f*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(f*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=u*p,e.elements[7]=(-h*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=dm(e),r=hm(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Nl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Nl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Js.length=0,this.toTransformArray(e,Js),Js.map(Ae).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=f,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=h,n[8]=g;return}return[o,c,f,a,d,m,l,h,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=f,n[7]=m,n[8]=g;return}return[o,a,l,c,d,h,f,m,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Lt().copy(this)}};x(Fl,"Identity",[1,0,0,0,1,0,0,0,1]);var zi=Fl;hl(zi);var Al=class Ha extends Oi{constructor(){super(),x(this,"_flagMatrix",!0),x(this,"_flagScale",!1),x(this,"_matrix",null),x(this,"_worldMatrix",null),x(this,"_position",null),x(this,"_rotation",0),x(this,"_scale",1),x(this,"_skewX",0),x(this,"_skewY",0);for(let e in Hr)Object.defineProperty(this,e,Hr[e]);this._renderer.flagMatrix=Ml.bind(this),this.isShape=!0,this.matrix=new zi,this.worldMatrix=new zi,this.position=new K,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Ha().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Hr.position.get.apply(this,arguments)}set translation(e){Hr.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 K?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 K?e.scale:new K(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new Ha;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof K?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 K?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};x(Al,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Wn=Al,Hr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(X.Types.change,this._renderer.flagMatrix),Ml.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof K&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof K&&this._scale.bind(X.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return js(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Ml(){this._flagMatrix=!0}var Li=Math.min,Di=Math.max,um=Math.ceil,fm=Math.floor,gm=new K,eo=class Jn extends Wn{constructor(e,n,r,s){super(),x(this,"_flagVertices",!0),x(this,"_flagLength",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagCap",!0),x(this,"_flagJoin",!0),x(this,"_flagMiter",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_flagMask",!1),x(this,"_flagClip",!1),x(this,"_length",0),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_cap","round"),x(this,"_join","round"),x(this,"_miter",4),x(this,"_closed",!0),x(this,"_curved",!1),x(this,"_automatic",!0),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_mask",null),x(this,"_clip",!1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0);for(let o in Vl)Object.defineProperty(this,o,Vl[o]);this._renderer.type="path",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:oi(e.fill),r=typeof e.stroke=="string"?e.stroke:oi(e.stroke),s=new Jn().copy(Ws(Hs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}}for(let n=0;n<Jn.Properties.length;n++){const r=Jn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Jn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Jn.Properties.length;r++){const s=Jn.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),G.each(Jn.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,h=1/0,f=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:g}=si(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof g=="number"&&(r=Math.max(m,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[m,g]=n.multiply(a.x,a.y),[u,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,R]=n.multiply(b,y),k=l.controls.left.x,w=l.controls.left.y;l.relative&&(k+=l.x,w+=l.y);let[C,S]=n.multiply(k,w);const T=pl(m,g,_,R,C,S,u,p);h=Li(T.min.y-r,h),c=Li(T.min.x-r,c),d=Di(T.max.x+r,d),f=Di(T.max.y+r,f)}else o<=1&&(h=Li(g-r,h),c=Li(m-r,c),d=Di(m+r,d),f=Di(g+r,f)),h=Li(p-r,h),c=Li(u-r,c),d=Di(u+r,d),f=Di(p+r,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,f,m,g,u,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const R=this.vertices.length,k=R-1;let w=null,C=null;for(let ne=0,A=this._lengths.length,I=0;ne<A;ne++){if(I+this._lengths[ne]>=_){this._closed?(r=Mt(ne,R),s=Mt(ne-1,R),ne===0&&(r=s,s=ne)):(r=ne,s=Math.min(Math.max(ne-1,0),k)),w=this.vertices[r],C=this.vertices[s],_-=I,this._lengths[ne]!==0?e=_/this._lengths[ne]:e=0;break}I+=this._lengths[ne]}if(w===null||C===null)return null;if(w){if(!C)return w}else return C;y=C.controls&&C.controls.right,b=w.controls&&w.controls.left,l=C.x,m=C.y,c=(y||C).x,g=(y||C).y,d=(b||w).x,u=(b||w).y,h=w.x,p=w.y,y&&C.relative&&(c+=C.x,g+=C.y),b&&w.relative&&(d+=w.x,u+=w.y),a=cr(e,l,c,d,h),f=cr(e,m,g,u,p);const S=At(l,c,e),T=At(m,g,e),B=At(c,d,e),$=At(g,u,e),M=At(d,h,e),E=At(u,p,e),V=At(S,B,e),L=At(T,$,e),D=At(B,M,e),te=At($,E,e);return G.isObject(n)?(n.x=a,n.y=f,n instanceof ke&&(n.controls.left.x=V,n.controls.left.y=L,n.controls.right.x=D,n.controls.right.y=te,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=f,n.controls.right.x-=a,n.controls.right.y-=f)),n.t=e,n):(o=new ke(a,f,V-a,L-f,D-a,te-f,this._curved?J.curve:J.line),o.t=e,o)}plot(){if(this.curved)return bl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?J.move:J.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===J.close;let s=this.vertices[n],o=[],a;return G.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===J.move){o.push(new ke(s.x,s.y)),c>0&&(o[o.length-1].command=J.line),s=l;return}a=El(l,s,e),o=o.concat(a),G.each(a,function(d,h){h<=0&&s.command===J.move?d.command=J.move:d.command=J.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=El(l,s,e),o=o.concat(a),G.each(a,function(d,h){h<=0&&s.command===J.move?d.command=J.move:d.command=J.line})),o.push(new ke(l.x,l.y)),o[o.length-1].command=r?J.close:J.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),G.each(this.vertices,function(l,c){if(c<=0||l.command===J.move){o=l,this._lengths[c]=0;return}this._lengths[c]=Pl(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Dr(this,r*this._length),a=Dr(this,s*this._length),l=um(o),c=fm(a);let d,h,f,m,g,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ke),u>c&&!h?(g=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(s,g),g.command=this._renderer.collection[u].command,this._renderer.vertices.push(g),h=g,f=this._collection[u-1],f&&f.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),f.relative?this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(K.zero,1-g.t):this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(f,1-g.t))):u>=l&&u<=c&&(g=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(g),u===c&&$l(this,s)?(h=g,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):u===l&&$l(this,r)&&(d=g,d.command=J.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(u=l-1,g=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,g),g.command=J.move,this._renderer.vertices.unshift(g),m=this._collection[u+1],m&&m.controls&&(g.controls.left.clear(),m.relative?this._renderer.collection[u+1].controls.left.copy(m.controls.left).lerp(K.zero,g.t):(gm.copy(m),this._renderer.collection[u+1].controls.left.copy(m.controls.left).lerp(m,g.t))))}return Wn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Wn.prototype.flagReset.call(this),this}};x(eo,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(eo,"Utils",{getCurveLength:Pl});var Te=eo,Vl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";G.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof Dn?this._collection=t:this._collection=new Dn(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,G.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Il(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Ol(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function zl(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Ll(){this._flagFill=!0}function Dl(){this._flagStroke=!0}var Hl=class Nr extends Te{constructor(e,n,r,s){const o=[new ke,new ke,new ke,new ke];super(o,!0,!1,!0),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_width",0),x(this,"_height",0),x(this,"_origin",null),this._renderer.type="rectangle";for(let a in Wl)Object.defineProperty(this,a,Wl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new K,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Nr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Nr.Properties.length;n++){const r=Nr.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof K&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ke),this.vertices[0].set(-e,-n).sub(this._origin).command=J.move,this.vertices[1].set(e,-n).sub(this._origin).command=J.line,this.vertices[2].set(e,n).sub(this._origin).command=J.line,this.vertices[3].set(-e,n).sub(this._origin).command=J.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=J.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Nr(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Te.Properties.length;r++){const s=Te.Properties[r];n[s]instanceof K?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};x(Hl,"Properties",["width","height","origin"]);var jn=Hl,Wl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(X.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},jl=class Fr extends jn{constructor(e,n,r,s,o,a){super(n,r,0,0),x(this,"_flagTexture",!1),x(this,"_flagColumns",!1),x(this,"_flagRows",!1),x(this,"_flagFrameRate",!1),x(this,"_flagIndex",!1),x(this,"_amount",1),x(this,"_duration",0),x(this,"_startTime",0),x(this,"_playing",!1),x(this,"_firstFrame",0),x(this,"_lastFrame",0),x(this,"_loop",!0),x(this,"_texture",null),x(this,"_columns",1),x(this,"_rows",1),x(this,"_frameRate",0),x(this,"_index",0),x(this,"_origin",null),this._renderer.type="sprite";for(let l in ql)Object.defineProperty(this,l,ql[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),this.origin=new K,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Fr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fr.Properties.length;n++){const r=Fr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Fr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,h,f,m;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){h=e.image.width,f=e.image.height,s=h/n,o=f/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(G.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=G.performance.now()-this._startTime,m=this._lastFrame+1,c=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=At(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,u=Math.floor(this._index/n),p=-s*g+(h-s)/2,b=-o*u+(f-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(jl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Wr=jl,ql={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},to,Xl=class extends Dn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),al(this,to,{}),this.attach(e),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return $t(this,to)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};to=new WeakMap;var Yl=class Pi extends Te{constructor(e,n,r,s,o,a,l){const c=l||vt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ke);super(d,!0,!1,!0),x(this,"_flagStartAngle",!1),x(this,"_flagEndAngle",!1),x(this,"_flagInnerRadius",!1),x(this,"_flagOuterRadius",!1),x(this,"_startAngle",0),x(this,"_endAngle",ht),x(this,"_innerRadius",0),x(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Ul)Object.defineProperty(this,h,Ul[h]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=Mt(e,ht)===Mt(n,ht),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,f,m,g,u,p,b,y,_,R;for(o?c--:a||(c-=2),f=0,m=c-1;f<c;f++){switch(g=f/m,u=l[h],p=g*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),f){case 0:d=J.move;break;default:d=J.curve}u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===J.curve&&(R=s*b/Math.PI,u.controls.left.x=R*Math.cos(p-Je),u.controls.left.y=R*Math.sin(p-Je),u.controls.right.x=R*Math.cos(p+Je),u.controls.right.y=R*Math.sin(p+Je),f===1&&u.controls.left.multiplyScalar(2),f===m&&u.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=J.close,h++):(c--,m=c-1),f=0;f<c;f++)g=f/m,u=l[h],p=(1-g)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=J.curve,f<=0&&(d=o?J.move:J.line),u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===J.curve&&(R=r*b/Math.PI,u.controls.left.x=R*Math.cos(p+Je),u.controls.left.y=R*Math.sin(p+Je),u.controls.right.x=R*Math.cos(p-Je),u.controls.right.y=R*Math.sin(p-Je),f===1&&u.controls.left.multiplyScalar(2),f===m&&u.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=J.line}else o||(l[h].command=J.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=J.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new Pi(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Te.Properties.length;c++){const d=Te.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];e[r]=this[r]}return e}};x(Yl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var no=Yl,Ul={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},io=Math.cos,ro=Math.sin,Gl=class Ei extends Te{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ke(0,0,0,0,0,0));super(a,!0,!0,!0),x(this,"_flagRadius",!1),x(this,"_radius",0),this._renderer.type="circle";for(let l in Kl)Object.defineProperty(this,l,Kl[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ht,c=r*io(l),d=r*ro(l),h=s*io(l-Je),f=s*ro(l-Je),m=s*io(l+Je),g=s*ro(l+Je),u=this.vertices[o];u.command=o===0?J.move:J.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Ei(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Te.Properties.length;r++){const s=Te.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};x(Gl,"Properties",["radius"]);var jr=Gl,Kl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},so=Math.cos,oo=Math.sin,Zl=class Ni extends Te{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ke);super(l,!0,!0,!0),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_width",0),x(this,"_height",0),this._renderer.type="ellipse";for(let c in Ql)Object.defineProperty(this,c,Ql[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ni().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ht,c=r*so(l),d=s*oo(l),h=r*n*so(l-Je),f=s*n*oo(l-Je),m=r*n*so(l+Je),g=s*n*oo(l+Je),u=this.vertices[o];u.command=o===0?J.move:J.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Ni(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Te.Properties.length;a++){const l=Te.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];e[r]=this[r]}return e}};x(Zl,"Properties",["width","height"]);var qr=Zl,Ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},mm=Math.ceil,pm=Math.floor,Jl=class ei extends Wn{constructor(e){super(),x(this,"_flagVertices",!0),x(this,"_flagLength",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagSize",!0),x(this,"_flagSizeAttenuation",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_length",0),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_size",1),x(this,"_sizeAttenuation",!1),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0),x(this,"noFill",Te.prototype.noFill),x(this,"noStroke",Te.prototype.noStroke),x(this,"corner",Te.prototype.corner),x(this,"center",Te.prototype.center),x(this,"getBoundingClientRect",Te.prototype.getBoundingClientRect),x(this,"_updateLength",Te.prototype._updateLength);for(let n in ec)Object.defineProperty(this,n,ec[n]);this._renderer.type="points",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:oi(e.fill),r=typeof e.stroke=="string"?e.stroke:oi(e.stroke),s=new ei().copy(Ws(Hs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}for(let n=0;n<ei.Properties.length;n++){const r=ei.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ei;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ei.Properties.length;r++){const s=ei.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),G.each(ei.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,h=Xs(a,l,a,l,c,d,c,d,e);n=n.concat(h)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Dr(this,e*this._length),s=Dr(this,n*this._length),o=mm(r),a=pm(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};x(Jl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var ao=Jl,ec={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof Dn?this._collection=t:this._collection=new Dn(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},ym=Math.cos,bm=Math.sin,tc=class Fi extends Te{constructor(e,n,r,s){s=Math.max(s||0,3),super(),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_flagSides",!1),x(this,"_radius",0),x(this,"_width",0),x(this,"_height",0),x(this,"_sides",0),this._renderer.type="polygon";for(let o in nc)Object.defineProperty(this,o,nc[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ht*o+Math.PI/2,l=this._width*ym(a)/2,c=this._height*bm(a)/2;s>=r?this.vertices.push(new ke(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?J.move:J.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Te.Properties.length;r++){const s=Te.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};x(tc,"Properties",["width","height","sides"]);var lo=tc,nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ic=class Ai extends Te{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ke(0,0,0,0,0,0,l===0?J.move:J.curve));super(a),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_flagRadius",!1),x(this,"_width",0),x(this,"_height",0),x(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in rc)Object.defineProperty(this,l,rc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=_m.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof K)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof K?s:new K().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof K?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=this.width,r=this.height,s=this.radius,o=new Ai(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Te.Properties.length;a++){const l=Te.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};x(ic,"Properties",["width","height","radius"]);var Xr=ic,rc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof K&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof K&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function _m(){this._flagRadius=!0}var wm=Math.cos,xm=Math.sin,sc=class Mi extends Te{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),x(this,"_flagInnerRadius",!1),x(this,"_flagOuterRadius",!1),x(this,"_flagSides",!1),x(this,"_innerRadius",0),x(this,"_outerRadius",0),x(this,"_sides",0),this._renderer.type="star";for(let a in oc)Object.defineProperty(this,a,oc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ht*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*wm(a),d=l*xm(a);s>=r?this.vertices.push(new ke(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?J.move:J.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Mi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Te.Properties.length;a++){const l=Te.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};x(sc,"Properties",["innerRadius","outerRadius","sides"]);var co=sc,oc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ho,ac=Math.min,lc=Math.max;De.document&&(ho=document.createElement("canvas"));var uo=class Dt extends Wn{constructor(e,n,r,s){super(),x(this,"_flagValue",!0),x(this,"_flagFamily",!0),x(this,"_flagSize",!0),x(this,"_flagLeading",!0),x(this,"_flagAlignment",!0),x(this,"_flagBaseline",!0),x(this,"_flagStyle",!0),x(this,"_flagWeight",!0),x(this,"_flagDecoration",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagMask",!1),x(this,"_flagClip",!1),x(this,"_flagDirection",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_value",""),x(this,"_family","sans-serif"),x(this,"_size",13),x(this,"_leading",17),x(this,"_alignment","center"),x(this,"_baseline","middle"),x(this,"_style","normal"),x(this,"_weight",500),x(this,"_decoration","none"),x(this,"_direction","ltr"),x(this,"_fill","#000"),x(this,"_stroke","none"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_mask",null),x(this,"_clip",!1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0);for(let o in cc)Object.defineProperty(this,o,cc[o]);if(this._renderer.type="text",this._renderer.flagFill=vm.bind(this),this._renderer.flagStroke=km.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!G.isObject(s))return this;for(let o=0;o<Dt.Properties.length;o++){const a=Dt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ho){const n=ho.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*Dt.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:oi(e.fill),r=typeof e.stroke=="string"?e.stroke:oi(e.stroke),s=new Dt().copy(Ws(Hs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<Dt.Properties.length;n++){const r=Dt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Dt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Dt.Properties.length;r++){const s=Dt.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<Dt.Properties.length;n++){const r=Dt.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=Dt.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[h,f]=n.multiply(r,o),[m,g]=n.multiply(r,a),[u,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=ac(f,g,p,y),r=ac(h,m,u,b),s=lc(h,m,u,b),a=lc(f,g,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};x(uo,"Ratio",.6),x(uo,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var hn=uo,cc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,G.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function vm(){this._flagFill=!0}function km(){this._flagStroke=!0}var fo=class rr extends jn{constructor(e,n,r,s){super(n,r,0,0),x(this,"_flagTextures",!1),x(this,"_flagFrameRate",!1),x(this,"_flagIndex",!1),x(this,"_amount",1),x(this,"_duration",0),x(this,"_index",0),x(this,"_startTime",0),x(this,"_playing",!1),x(this,"_firstFrame",0),x(this,"_lastFrame",0),x(this,"_loop",!0),x(this,"_textures",null),x(this,"_frameRate",0),x(this,"_origin",null),this._renderer.type="image-sequence";for(let o in dc)Object.defineProperty(this,o,dc[o]);this._renderer.flagTextures=Cm.bind(this),this._renderer.bindTextures=Sm.bind(this),this._renderer.unbindTextures=Bm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(hc.bind(this)):typeof e=="string"&&(this.textures=[hc(e)]),this.origin=new K,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new rr(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,G.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=G.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=At(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Me))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(fo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(fo,"DefaultFrameRate",30);var go=fo,dc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(X.Types.insert,e).unbind(X.Types.remove,n),this._textures=new Dn((t||[]).slice(0)),this._textures.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Cm(){this._flagTextures=!0}function Sm(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Bm(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function hc(t){if(t instanceof Me)return t;if(typeof t=="string")return new Me(t)}var Yr=Math.min,Ur=Math.max,mo=class ti extends Wn{constructor(e){super(),x(this,"_flagAdditions",!1),x(this,"_flagSubtractions",!1),x(this,"_flagOrder",!1),x(this,"_flagOpacity",!0),x(this,"_flagBeginning",!1),x(this,"_flagEnding",!1),x(this,"_flagLength",!1),x(this,"_flagMask",!1),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_cap","round"),x(this,"_join","round"),x(this,"_miter",4),x(this,"_closed",!0),x(this,"_curved",!1),x(this,"_automatic",!0),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_length",0),x(this,"_mask",null),x(this,"_strokeAttenuation",!0);for(let n in uc)Object.defineProperty(this,n,uc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new ti;for(let s=0;s<ti.Properties.length;s++){const o=ti.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:oi(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return no.fromObject(s);case"circle":return jr.fromObject(s);case"element":return Oi.fromObject(s);case"ellipse":return qr.fromObject(s);case"group":return ti.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return go.fromObject(s);case"path":return Te.fromObject(s);case"points":return ao.fromObject(s);case"polygon":return lo.fromObject(s);case"rectangle":return jn.fromObject(s);case"rounded-rectangle":return Xr.fromObject(s);case"shape":return Wn.fromObject(s);case"sprite":return Wr.fromObject(s);case"star":return co.fromObject(s);case"text":return hn.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<ti.Properties.length;n++){const r=ti.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ti,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,G.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,h=1/0,f=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const u=this.children[g];if(!(!u.visible||m.test(u._renderer.type))&&(n=u.getBoundingClientRect(e),s=typeof n.top!="number"||G.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||G.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||G.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||G.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[R,k]=r.multiply(n.left,n.bottom),[w,C]=r.multiply(n.right,n.bottom);h=Yr(b,_,k,C,h),c=Yr(p,y,R,w,c),d=Ur(p,y,R,w,d),f=Ur(b,_,k,C,f)}else h=Yr(n.top,h),c=Yr(n.left,c),d=Ur(n.right,d),f=Ur(n.bottom,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};x(mo,"Children",Xl),x(mo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var st=mo,uc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=st.InsertChildren.bind(this),n=st.RemoveChildren.bind(this),r=st.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Xl(t),this._children.bind(X.Types.insert,e),this._children.bind(X.Types.remove,n),this._children.bind(X.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,G.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function fc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Gr=class extends Te{constructor(e,n,r,s){const o=[new ke(e,n),new ke(r,s)];super(o);for(let a in gc)Object.defineProperty(this,a,gc[a]);this.vertices[0].command=J.move,this.vertices[1].command=J.line,this.automatic=!1}};x(Gr,"Properties",["left","right"]);var gc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(G.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=J.move;else{const e=new Pt("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(G.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=J.line;else{const e=new Pt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},un={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Tm={start:"left",middle:"center",end:"right"},mc=["id","class","transform","xmlns","viewBox"],Rm=["x","y","width","height","href","xlink:href"];function $m(t){return Tm[t]}function Pm(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function dr(t){return t.replace(/svg:/gi,"").toLowerCase()}function pc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function Em(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Nm(t){const e={},n=Fm(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Fm(t){const e=t.getAttributeNames();for(let n=0;n<mc.length;n++){const r=mc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Am(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<t.children.length;f++){const m=t.children[f];"translation"in m?m.translation.add(r,s):"x"in m?m.x=r:"y"in m&&(m.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new K(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new jn(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Ht(t,e,n){const r={},s={},o={};let a,l,c,d,h,f,m,g,u,p,b,y,_,R,k,w,C;if(t===null)return r;if(De.getComputedStyle){const S=De.getComputedStyle(t);for(a=S.length;a--;)c=S[a],d=S[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)f=t.attributes[a],/style/i.test(f.nodeName)?Em(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&G.defaults(r,n),G.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(m=si(l),e._renderer.type){case"linear-gradient":pc(m,e.left),pc(m,e.right);break;case"radial-gradient":e.center.x+=m.translateX,e.center.y+=m.translateY,e.focal.x+=m.translateX,e.focal.y+=m.translateY,e.radius*=Math.max(m.scaleX,m.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;m=si(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new K(m.scaleX,m.scaleY),g=parseFloat((r.x+"").replace("px")),u=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),u&&(e.translation.y=u);break;case"visible":if(e instanceof st){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof st){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof st){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof st){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof st){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof st){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(un.cssBackgroundImage.test(d)&&(p=d.replace(un.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(y=ze.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=dr(y.nodeName),e.mask=ze[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof st?"_":"")+c,un.cssBackgroundImage.test(d)?(p=d.replace(un.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(y=ze.defs.current.get(p),y.object||(_=dr(y.nodeName),y.object=ze[_].call(this,y,{})),y=y.object):(b=Vm(this),y=b.getById(p)),e[h]=y):e[h]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(R=e instanceof et,k=e instanceof He,w=e instanceof We,R||k||w)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(C=new Pt("only pixel values are supported with the "+c+" attribute."),console.warn(C.name,C.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof hn&&(e.family=d);break;case"font-size":e instanceof hn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(C=new Pt("only pixel values are supported with the "+c+" attribute."),console.warn(C.name,C.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof hn&&(e.weight=d);break;case"font-style":e instanceof hn&&(e.style=d);break;case"text-decoration":e instanceof hn&&(e.decoration=d);break;case"line-height":e instanceof hn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function Mm(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||dr(t.nodeName)==="#text"||e.add(s.id,s)}}function Vm(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new zr,n=t.getElementsByTagName("defs");for(let u=0;u<n.length;u++)Mm(n[u],e);const r=ze.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,h=o!==null,f=a!==null,m=l!==null,g=c!==null;return h&&(r.x=parseFloat(o.replace(un.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(un.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(un.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(un.unitSuffix,""))),d&&Am(r,s),delete ze.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Pt("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 Pt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],h=Rm.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=dr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new st;Ht.call(this,t,n,e),this.add(n);const r=Nm.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=dr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ke(parseFloat(a),parseFloat(l)))});const s=new Te(r,!0);return s.stroke="none",s.fill="black",Ht.call(this,t,s,e),s},polyline:function(t,e){const n=ze.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ke,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const f=h.length-1;G.each(h.slice(0),function(m,g){const u=m.slice(1).trim().match(un.path),p=m[0],b=p.toLowerCase();let y,_,R,k,w;const C=[];switch(g===0&&(h=[]),b){case"h":case"v":u.length>1&&(y=1);break;case"m":case"l":case"t":u.length>2&&(y=2);break;case"s":case"q":u.length>4&&(y=4);break;case"c":u.length>6&&(y=6);break;case"a":u.length>7&&(y=7);break}if(y){for(_=0,R=u.length,w=0;_<R;_+=y){if(k=p,w>0)switch(p){case"m":k="l";break;case"M":k="L";break}C.push(k+u.slice(_,_+y).join(" ")),w++}h=Array.prototype.concat.apply(h,C)}else h.push(m)}),G.each(h,function(m,g){let u,p,b;const y=m[0],_=y.toLowerCase();d=m.slice(1).trim().match(un.path),o=y===_;let R,k,w,C,S,T,B,$,M,E,V,L,D,te,ne,A,I;switch(_){case"z":if(g>=f)s=!0;else{p=l.x,b=l.y,u=new ke(p,b,void 0,void 0,void 0,void 0,J.close);for(let j=r.length-1;j>=0;j--){const q=r[j];if(/m/i.test(q.command)){l=q;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),u=new ke(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?J.move:J.line),o&&u.addSelf(l),l=u;break;case"h":case"v":E=/h/i.test(_)?"x":"y",V=/x/i.test(E)?"y":"x",u=new ke(void 0,void 0,void 0,void 0,void 0,void 0,J.line),u[E]=parseFloat(d[0]),u[V]=l[V],o&&(u[E]+=l[E]),l=u;break;case"c":case"s":R=l.x,k=l.y,c||(c=new K),/c/i.test(_)?(w=parseFloat(d[0]),C=parseFloat(d[1]),S=parseFloat(d[2]),T=parseFloat(d[3]),B=parseFloat(d[4]),$=parseFloat(d[5])):(M=Ys(l,c,o),w=M.x,C=M.y,S=parseFloat(d[0]),T=parseFloat(d[1]),B=parseFloat(d[2]),$=parseFloat(d[3])),o&&(w+=R,C+=k,S+=R,T+=k,B+=R,$+=k),l.controls.right.set(w-l.x,C-l.y),u=new ke(B,$,S-B,T-$,void 0,void 0,J.curve),l=u,c=u.controls.left;break;case"t":case"q":R=l.x,k=l.y,c||(c=new K),/q/i.test(_)?(w=parseFloat(d[0]),C=parseFloat(d[1]),S=parseFloat(d[0]),T=parseFloat(d[1]),B=parseFloat(d[2]),$=parseFloat(d[3])):(M=Ys(l,c,o),w=M.x,C=M.y,S=M.x,T=M.y,B=parseFloat(d[0]),$=parseFloat(d[1])),o&&(w+=R,C+=k,S+=R,T+=k,B+=R,$+=k),l.controls.right.set((w-l.x)*.33,(C-l.y)*.33),u=new ke(B,$,S-B,T-$,void 0,void 0,J.curve),l=u,c=u.controls.left;break;case"a":R=l.x,k=l.y,D=parseFloat(d[0]),te=parseFloat(d[1]),ne=parseFloat(d[2]),A=parseFloat(d[3]),I=parseFloat(d[4]),B=parseFloat(d[5]),$=parseFloat(d[6]),o&&(B+=R,$+=k),L=new ke(B,$),L.command=J.arc,L.rx=D,L.ry=te,L.xAxisRotation=ne,L.largeArcFlag=A,L.sweepFlag=I,u=L,l=L,c=void 0;break}u&&(Array.isArray(u)?r=r.concat(u):r.push(u))})}n=new Te(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},G.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ht.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new jr(0,0,s);return o.stroke="none",o.fill="black",Ht.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new qr(0,0,s,o);return a.stroke="none",a.fill="black",Ht.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!G.isNaN(n)||!G.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new jn(0,0,s,o);return c.stroke="none",c.fill="black",Ht.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new K(n,r),d=new Xr(0,0,s,o,c);return d.stroke="none",d.fill="black",Ht.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Gr(n,r,s,o).noFill();return Ht.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let m=0;m<t.children.length;m++){const g=t.children[m];let u=g.getAttribute("offset");/%/gi.test(u)&&(u=parseFloat(u.replace(/%/gi,""))/100),u=parseFloat(u);let p=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),y=g.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),h.push(new Hn(u,p,b))}const f=new He(s,o,a,l,h);return f.spread=r,f.units=n,Ht.call(this,t,f,e),f},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));G.isNaN(l)&&(l=s),G.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const f=[];for(let g=0;g<t.children.length;g++){const u=t.children[g];let p=u.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=u.getAttribute("stop-color"),y=u.getAttribute("stop-opacity"),_=u.getAttribute("style"),R;b===null&&(R=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=R&&R.length>1?R[1]:void 0),y===null?(R=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=R&&R.length>1?parseFloat(R[1]):1):y=parseFloat(y),f.push(new Hn(p,b,y))}const m=new We(s,o,a,f,l,c);return m.spread=r,m.units=n,Ht.call(this,t,m,e),m},text:function(t,e){const n=$m(t.getAttribute("text-anchor"))||"left",r=Pm(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new hn(s);return Ht.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Pt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Wr(r,s,o);return G.isNaN(a)||(c.width=a),G.isNaN(l)||(c.height=l),Ht.call(this,t,c,e),c}};function yc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var po=class Cn extends jn{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),x(this,"_flagTexture",!1),x(this,"_flagMode",!1),x(this,"_texture",null),x(this,"_mode","fill"),this._renderer.type="image";for(let l in _c)Object.defineProperty(this,l,_c[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Cn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Cn.Properties.length;n++){const r=Cn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Cn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case Cn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Cn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Cn.Modes.crop:break;case Cn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case Cn.Modes.stretch:default:e.scale=new K(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};x(po,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),x(po,"Properties",["texture","mode"]);var bc=po,_c={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},yo=[],bo=Math.max,Im=Math.min,wc=Math.abs,Kr=Math.sin,Zr=Math.cos,Om=Math.acos,Qr=Math.sqrt,$e={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in $e?t:"path"},group:{renderChild:function(t){const e=$e.getRendererType(t._renderer.type);$e[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Jr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=$e.getRendererType(r._renderer.type);$e[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=$e.getRendererType(l._renderer.type);$e[c].render.call(l,t)}return o&&t.restore(),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,m,g,u,p,b,y,_,R,k,w,C,S,T,B,$,M,E,V,L,D,te,ne,A,I,j;if(j=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,D=this._mask,te=this._clip,l=this._opacity*(j||1),c=this._visible,!e&&(!c||te||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,m=this._closed,g=this._renderer.vertices,u=g.length,p=u-1,ne=Jr(r),I=this.dashes,ne||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),D){const ie=$e.getRendererType(D._renderer.type);$e[ie].render.call(D,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const ie=$e.getRendererType(a._renderer.type);$e[ie].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const ie=$e.getRendererType(s._renderer.type);$e[ie].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=dn(this)),f&&(t.miterLimit=f),h&&(t.lineJoin=h),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),I&&I.length>0&&(t.lineDashOffset=I.offset||0,t.setLineDash(I)),t.beginPath();let q,N,O,Y,re,de,oe;for(let ie=0;ie<u;ie++)switch(_=g[ie],V=_.x,L=_.y,_.command){case J.close:t.closePath();break;case J.arc:q=_.rx,N=_.ry,O=_.xAxisRotation,Y=_.largeArcFlag,re=_.sweepFlag,b=m?Mt(ie-1,u):bo(ie-1,0),y=g[b],de=y.x,oe=y.y,$e.renderSvgArcCommand(t,de,oe,q,N,Y,re,O,V,L);break;case J.curve:b=m?Mt(ie-1,u):Math.max(ie-1,0),y=g[b],B=y.controls&&y.controls.right||K.zero,$=_.controls&&_.controls.left||K.zero,y._relative?(S=B.x+y.x,T=B.y+y.y):(S=B.x,T=B.y),_._relative?(w=$.x+_.x,C=$.y+_.y):(w=$.x,C=$.y),t.bezierCurveTo(S,T,w,C,V,L),ie>=p&&m&&(R=k,M=_.controls&&_.controls.right||K.zero,E=R.controls&&R.controls.left||K.zero,_._relative?(S=M.x+_.x,T=M.y+_.y):(S=M.x,T=M.y),R._relative?(w=E.x+R.x,C=E.y+R.y):(w=E.x,C=E.y),V=R.x,L=R.y,t.bezierCurveTo(S,T,w,C,V,L));break;case J.line:t.lineTo(V,L);break;case J.move:k=_,t.moveTo(V,L);break}return m&&t.closePath(),!te&&!n&&($e.isHidden.test(a)||(A=a._renderer&&a._renderer.offset,A&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),A&&t.restore()),$e.isHidden.test(s)||(A=s._renderer&&s._renderer.offset,A&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),A&&t.restore())),ne||t.restore(),te&&!n&&t.clip(),I&&I.length>0&&t.setLineDash(yo),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,m,g,u,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,p=Jr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const w=$e.getRendererType(a._renderer.type);$e[w].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const w=$e.getRendererType(s._renderer.type);$e[w].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=dn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let R=d*.5,k;this._sizeAttenuation||(k=this.worldMatrix.elements,k=si(k[0],k[3],k[1],k[4],k[2],k[5]),R/=Math.max(k.scaleX,k.scaleY));for(let w=0;w<f;w++)m=h[w],g=m.x,u=m.y,t.moveTo(g+R,u),t.arc(g,u,R,0,ht);return n||($e.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),$e.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(yo),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!e&&(!o||l||s===0))return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,m=this._decoration,g=this._direction,u=Jr(c),p=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=$e.alignments[this._alignment]||this._alignment,_=$e.baselines[this._baseline]||this._baseline;let R,k,w,C,S,T,B,$,M,E,V;if(u||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const L=$e.getRendererType(a._renderer.type);$e[L].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=g,f)if(typeof f=="string")t.fillStyle=f;else{const L=$e.getRendererType(f._renderer.type);$e[L].render.call(f,t,this),t.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const L=$e.getRendererType(d._renderer.type);$e[L].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=dn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&($e.isHidden.test(f)||(f._renderer&&f._renderer.offset?(T=f._renderer.scale.x,B=f._renderer.scale.y,t.save(),t.translate(-f._renderer.offset.x,-f._renderer.offset.y),t.scale(T,B),R=this._size/f._renderer.scale.y,k=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,R+"px/",k+"px",this._family].join(" "),w=f._renderer.offset.x/f._renderer.scale.x,C=f._renderer.offset.y/f._renderer.scale.y,t.fillText(this.value,w,C),t.restore()):t.fillText(this.value,0,0)),$e.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,B=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,B),R=this._size/d._renderer.scale.y,k=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,R+"px/",k+"px",this._family].join(" "),w=d._renderer.offset.x/d._renderer.scale.x,C=d._renderer.offset.y/d._renderer.scale.y,S=h/d._renderer.scale.x,t.lineWidth=S,t.strokeText(this.value,w,C),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const L=t.measureText(this.value);let D=1;switch(m){case"underline":M=L.actualBoundingBoxDescent,V=L.actualBoundingBoxDescent;break;case"strikethrough":M=0,V=0,D=.5;break}switch(_){case"top":M+=this._size*D,V+=this._size*D;break;case"baseline":case"bottom":M-=this._size*D,V-=this._size*D;break}switch(y){case"left":case"start":$=0,E=L.width;break;case"right":case"end":$=-L.width,E=0;break;default:$=-L.width/2,E=L.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,M),t.lineTo(E,V),t.stroke()}return u||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(yo),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof K||(this._renderer.offset=new K),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof K?(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 K||(this._renderer.scale=new K),this._scale instanceof K?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=wc(r),s=wc(s);const h=(e-c)/2,f=(n-d)/2,m=Zr(l)*h+Kr(l)*f,g=-Kr(l)*h+Zr(l)*f,u=m*m,p=g*g;let b=r*r,y=s*s;const _=u/b+p/y;if(_>1){const L=Qr(_);r=L*r,s=L*s,b=r*r,y=s*s}const R=b*p+y*u,k=(b*y-R)/R;let w=Qr(bo(0,k));o===a&&(w=-w);const C=w*r*g/s,S=-w*s*m/r,T=Zr(l)*C-Kr(l)*S+(e+c)/2,B=Kr(l)*C+Zr(l)*S+(n+d)/2,$=xc(1,0,(m-C)/r,(g-S)/s),M=xc((m-C)/r,(g-S)/s,(-m-C)/r,(-g-S)/s)%ht,E=$+M;zm(t,T,B,r,s,$,E,a===0,l)}},ft=class extends X{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new st,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Us(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&G.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(X.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),$e.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};x(ft,"Utils",$e);function zm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Vi.Tolerance.epsilon,f=Math.abs(d)<h;let m=Mt(d,ht);m<h&&(f?m=0:m=ht),l===!0&&!f&&(m===ht?m=-ht:m=m-ht);for(let g=0;g<vt.Resolution;g++){const u=g/(vt.Resolution-1),p=o+u*m;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),R=Math.sin(c),k=b-e,w=y-n;b=k*_-w*R+e,y=k*R+w*_+n}t.lineTo(b,y)}}function xc(t,e,n,r){const s=t*n+e*r,o=Qr(t*t+e*e)*Qr(n*n+r*r);let a=Om(bo(-1,Im(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Jr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ae={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(ae.ns,n);return n==="svg"&&(e=G.defaults(e||{},{version:ae.version})),e&&Object.keys(e).length>0&&ae.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(ae.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?Mt(a-1,n):Math.max(a-1,0),d=t[c];let h,f,m,g,u,p,b,y,_,R,k,w,C,S,T,B=Ae(l.x),$=Ae(l.y);switch(l.command){case J.close:h=J.close;break;case J.arc:k=l.rx,w=l.ry,C=l.xAxisRotation,S=l.largeArcFlag,T=l.sweepFlag,h=J.arc+" "+k+" "+w+" "+C+" "+S+" "+T+" "+B+" "+$;break;case J.curve:b=d.controls&&d.controls.right||K.zero,y=l.controls&&l.controls.left||K.zero,d.relative?(m=Ae(b.x+d.x),g=Ae(b.y+d.y)):(m=Ae(b.x),g=Ae(b.y)),l.relative?(u=Ae(y.x+l.x),p=Ae(y.y+l.y)):(u=Ae(y.x),p=Ae(y.y)),h=(a===0?J.move:J.curve)+" "+m+" "+g+" "+u+" "+p+" "+B+" "+$;break;case J.move:s=l,h=J.move+" "+B+" "+$;break;default:h=l.command+" "+B+" "+$}a>=r&&e&&(l.command===J.curve&&(f=s,_=l.controls&&l.controls.right||l,R=f.controls&&f.controls.left||f,l.relative?(m=Ae(_.x+l.x),g=Ae(_.y+l.y)):(m=Ae(_.x),g=Ae(_.y)),f.relative?(u=Ae(R.x+f.x),p=Ae(R.y+f.y)):(u=Ae(R.x),p=Ae(R.y)),B=Ae(f.x),$=Ae(f.y),h+=" C "+m+" "+g+" "+u+" "+p+" "+B+" "+$),l.command!==J.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=J.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=ae.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in ae?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=ae.getRendererType(t._renderer.type);ae[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ae.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=ae.getRendererType(s._renderer.type);ae[o].render.call(s,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(ae.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(ae.group.removeChild,n),this._flagOrder&&this.children.forEach(ae.group.orderChild,n),this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=ae.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=dn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=si(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=ae.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=dn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=ae.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ae.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=dn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof K?(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 K?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?ae.setAttributes(this._renderer.image,r):this._renderer.image=ae.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&ae.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=ae.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},vc=class extends X{constructor(t){super(),this.domElement=t.domElement||ae.createElement("svg"),this.scene=new st,this.scene.parent=this,this.defs=ae.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,ae.setAttributes(this.domElement,{width:t,height:e}),this.trigger(X.Types.resize,t,e)}render(){return ae.group.render.call(this.scene,this.domElement),ae.defs.update(this.domElement),this}};x(vc,"Utils",ae);var Wt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new Pt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var Or=function(){return Or=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Or.apply(this,arguments)},Xf={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"}},Sn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ls=500,Yf=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Or(Or({},Xf),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(Sn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(n),g,u,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),g=p/y,u=b/y}else{var y=(e-n)*n;g=p*y,u=b*y}r&&(f?this.isBeyondPossibleLeft(g,m.minX)?g=m.minX:this.isBeyondPossibleRight(g,m.maxX)&&(g=m.maxX):e>1&&(g<m.minX?g=m.minX:g>m.maxX&&(g=m.maxX)),h?this.isBeyondPossibleTop(u,m.minY)?u=m.minY:this.isBeyondPossibleBottom(u,m.maxY)&&(u=m.maxY):e>1&&(u<m.minY?u=m.minY:u>m.maxY&&(u=m.maxY))),this.setZoomStyles({x:g,y:u,scale:e}),this.left=g,this.top=u,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Ls),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ls+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ls+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(Sn.containerResize+".zoom "+Sn.rotateRight+".zoom "+Sn.rotateLeft+".zoom "+Sn.flipHorizontal+".zoom "+Sn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(Sn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(Sn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(Sn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var f=e.scale-o;e.zoomImage(e.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),f={};f.x=this.left+a,f.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,m.minY)?f.y=m.minY:this.isBeyondPossibleBottom(f.y,m.maxY)&&(f.y=m.maxY)),r&&(this.isBeyondPossibleLeft(f.x,m.minX)?f.x=m.minX:this.isBeyondPossibleRight(f.x,m.maxX)&&(f.x=m.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;e&&(o=o+e*o,a=a+e*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,f={minY:l,maxY:c,minX:d,maxX:h};return f},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(f=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,o=g.allowX,(o||a)&&(n=e.getSwipeCords(m)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(m){if(m.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var g=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(h,g))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target))){if(m.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||g.get().contains(m.target)){c=new Date,f=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var u=e.getDragAllowedAxises(0);l=u.allowY,a=u.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),h=e.getPossibleSwipeDragCords(),s=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(m){if(s){o=!0,r=e.getDragCords(m);var g=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(f,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(m){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(m);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Uf={ref:"gallery-container",class:"lightgallery-wrapper"},Gf={},Za=i.defineComponent({...Gf,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...e.settings}),F.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",Uf,[i.renderSlot(o.$slots,"default")],512))}}),at=class at{static init(){at.isInitialized||(at.isInitialized=!0,at.windowResizeHandler(),window.addEventListener("resize",at.windowResizeHandler))}static destroy(){window.removeEventListener("resize",at.windowResizeHandler),at.isInitialized=!1}static getDeviceTypeByResolution(){const e=K.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ue.phone:window.innerWidth<e.laptop?Ue.tablet:Ue.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return at.setRefValueDependingOnDeviceResolution(s,e,n,r),at.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return at.getDeviceTypeByResolution()===Ue.phone}static isTabletDevice(){return at.getDeviceTypeByResolution()===Ue.tablet}static isLaptopDevice(){return at.getDeviceTypeByResolution()===Ue.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(at.getDeviceTypeByResolution()){case Ue.phone:e.value=n;break;case Ue.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){F.forEach(at.refsDependingOnDeviceResolution,e=>{at.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};v(at,"isInitialized",!1),v(at,"refsDependingOnDeviceResolution",[]);let wt=at;const Kf=["href"],Zf=["src","alt"],Qf={},Qa=i.defineComponent({...Qf,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[qf,Yf],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===Ue.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=Ka,m=z.NPopover;return i.openBlock(),i.createBlock(m,{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]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(Za,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,u)=>(i.openBlock(),i.createElementBlock("a",{key:u,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${u+1}`},null,8,Zf)],8,Kf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Jf={class:"flex flex-col text-sm"},eg={},tg=i.defineComponent({...eg,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=zs,s=z.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Jf,[(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})}}}),ng={class:"flex flex-row justify-between"},ig={key:1},rg={class:"ml-2 align-sub"},sg={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},og={class:"@container"},ag={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},lg={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},cg={class:"text-sc-dark-grey"},dg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},hg={class:"text-gray-600"},ug={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},fg={key:3,class:"underline decoration-dashed"},gg={key:4,class:"sc-product-pack whitespace-nowrap"},mg={class:"text-gray-600"},pg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},yg={class:"text-gray-600"},bg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},_g={key:0},wg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},xg={},ar=i.defineComponent({...xg,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>F.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>F.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>F.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,f)=>{var R,k,w,C,S;const m=Ya,g=z.NTooltip,u=Ka,p=z.NText,b=Ga,y=zs,_=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",ng,[i.createVNode(p,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var T;return[((T=t.product)==null?void 0:T.isFavorite)??!1?(i.openBlock(),i.createBlock(g,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{class:"!text-black mr-2 pt-1.5 align-sub"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",ig," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",rg,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(Qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",sg,[i.createVNode(u)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||(((R=t.productContextButtonsConfig)==null?void 0:R.length)??0)>0?(i.openBlock(),i.createBlock(b,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",og,[i.createElementVNode("div",ag,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",lg,[f[1]||(f[1]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",cg,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",dg,[f[2]||(f[2]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",hg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(tg,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",ug,[f[3]||(f[3]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(y,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",fg," Нет в наличии ")),(w=(k=t.product)==null?void 0:k.properties)!=null&&w.pack?(i.openBlock(),i.createElementBlock("span",gg,[f[4]||(f[4]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",mg,i.toDisplayString((S=(C=t.product)==null?void 0:C.properties)==null?void 0:S.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",pg,[f[5]||(f[5]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",yg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",bg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,T=>(i.openBlock(),i.createBlock(Vr,{key:T.coefficient.slug,product:t.product,"cost-field-name":T.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(Vr,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",_g,[i.createElementVNode("ul",wg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(T,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(T),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(T,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(T),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),vg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Vr,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),kg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(F.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),wt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(F.forEach(t,s=>{F.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),F.forEach(F.sortBy(r,["slug"]),s=>{n.push(vg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Vr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!F.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ga,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},Cg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sg(t,e){return i.openBlock(),i.createElementBlock("svg",Cg,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Ja=i.markRaw({name:"ion-trash",render:Sg}),Bg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Tg(t,e){return i.openBlock(),i.createElementBlock("svg",Bg,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const el=i.markRaw({name:"ion-plus",render:Tg}),Rg={key:0,class:"flex w-fit items-center gap-2"},$g={key:1,class:"flex flex-wrap gap-1"},Pg={key:0},Eg={key:2},Ng={},lr=i.defineComponent({...Ng,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=z.NSpin,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Rg,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",$g,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Pg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Eg,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),ue={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},Qe={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Fg={class:"flex flex-col gap-4"},Ag={class:"flex flex-col gap-2"},Mg={class:"mt-8 font-bold"},Vg={class:"grid grow grid-cols-2 items-start gap-2"},Ig={class:"text-sm"},Og={class:"font-medium"},zg={key:0,class:"text-red-500"},Lg={key:2,class:"text-red-500 text-sm mb-2"},Dg={class:"flex flex-col gap-4"},Hg={key:0},Wg={class:"text-lg font-semibold"},jg={class:"flex gap-3"},qg={},tl=i.defineComponent({...qg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var p;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(F.cloneDeep(r.value)),c=i.computed(()=>{var y,_,R;const b={"configuratorParams.length":[ue.required,ue.min(r.settings.stripMinLength),ue.max(r.settings.stripMaxLength||Number.MAX_VALUE),ue.step(r.settings.lengthStep),Qe.serverValidation((y=r.validation.length)==null?void 0:y.feedback)],quantity:[ue.required,ue.min(1),ue.step(1),Qe.serverValidation((_=r.validation.quantity)==null?void 0:_.feedback)],marker:[Qe.serverValidation((R=r.validation.marker)==null?void 0:R.feedback)]};return F.forEach(l.value.configuratorParams.linesWidths,(k,w)=>{var T;const S=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;b[`configuratorParams.linesWidths.${w}`]=[ue.required,ue.min(S),ue.max(r.settings.maxLineWidth),ue.step(r.settings.lineWidthStep),Qe.serverValidation((T=r.validation[`lines_widths[${w+1}]`])==null?void 0:T.feedback)]}),F.forEach(l.value.configuratorParams.linesAngles,(k,w)=>{var C;b[`configuratorParams.linesAngles.${w}`]=[ue.required,ue.min(r.settings.minLineAngle),ue.max(r.settings.maxLineAngle),ue.step(r.settings.lineAngleStep),Qe.serverValidation((C=r.validation[`lines_angles[${w+1}]`])==null?void 0:C.feedback)]}),b}),d=i.computed(()=>{var k;const{length:b}=l.value.configuratorParams,{quantity:y}=l.value,_=((k=l.value.product)==null?void 0:k.costRub)||0;if(!b||!y||_===0)return null;const R=b/100;return(_*y*R).toLocaleString("ru-ru",{minimumFractionDigits:2})}),h=i.computed(()=>F.reduce(l.value.configuratorParams.linesWidths,(b,y)=>b+(y||0),0)),f=i.computed(()=>{const b=h.value;return b>=r.settings.stripMinWidth&&b<=r.settings.stripMaxWidth}),m=i.computed(()=>{const{configuratorParams:b}=l.value,y=F.every(b.linesWidths,w=>!!(w&&w>0)),_=F.every(b.linesAngles,w=>!F.isNil(w)),R=!!(l.value.quantity&&l.value.quantity>0),k=b.length>0&&b.length>0;return y&&_&&R&&k&&f.value}),g=()=>{i.nextTick(()=>{var b;(b=o.value)==null||b.validate(y=>{y||(s("update:params",l.value.configuratorParams),u("configuratorParams",l.value.configuratorParams))}).catch(F.noop)})},u=(b,y)=>{const _=new K.CartItemBase(l.value);_[b]=y,b==="configuratorParams"&&(_.product=new K.Product),s("update:value",_)};return i.watch(()=>r.previewParams,b=>{l.value.configuratorParams.linesWidths=b.linesWidths,l.value.configuratorParams.linesAngles=b.linesAngles},{deep:!0}),i.watch(()=>r.value,b=>{l.value=F.cloneDeep(b)},{deep:!0}),e({validate:(p=o.value)==null?void 0:p.validate,formReference:o}),(b,y)=>{const _=el,R=Ja;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var k;return[i.createElementVNode("div",Fg,[y[20]||(y[20]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[y[0]||(y[0]=w=>l.value.configuratorParams.startTailType=w),g],options:t.settings.startTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Ag,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,C)=>(i.openBlock(),i.createElementBlock("div",{key:C,class:"flex items-start gap-2"},[i.createElementVNode("div",Mg,i.toDisplayString(C+1),1),i.createElementVNode("div",Vg,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${C}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[C],"onUpdate:value":[S=>l.value.configuratorParams.linesWidths[C]=S,y[2]||(y[2]=S=>g())],parse:i.unref(Ut),"show-button":!1,class:"w-full",onKeydown:y[1]||(y[1]=S=>i.unref(ln)(S,".",!1)),onInput:S=>i.unref(Ke)(t.validation,`lines_widths[${C+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${C}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[C],"onUpdate:value":[S=>l.value.configuratorParams.linesAngles[C]=S,y[4]||(y[4]=S=>g())],parse:i.unref(Ut),"show-button":!1,class:"w-full",onKeydown:y[3]||(y[3]=S=>i.unref(ln)(S,".",!1)),onInput:S=>i.unref(Ke)(t.validation,`lines_angles[${C+1}]`)},null,8,["value","onUpdate:value","parse","onInput"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:S=>s("click:add-line",C)},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:S=>s("click:remove-line",C)},{default:i.withCtx(()=>[i.createVNode(R)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[y[5]||(y[5]=w=>l.value.configuratorParams.endTailType=w),g],options:t.settings.endTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Ig,[i.createElementVNode("div",Og,"Суммарная ширина участков: "+i.toDisplayString(h.value)+" мм",1),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",zg," Должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм ",1))]),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Lg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((k=t.settings.allTemplates)==null?void 0:k.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:a.value,onClick:y[6]||(y[6]=w=>s("click:save-template"))},{default:i.withCtx(()=>[...y[19]||(y[19]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Dg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[y[7]||(y[7]=w=>l.value.configuratorParams.colorSide=w),g],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[y[8]||(y[8]=w=>l.value.configuratorParams.length=w),y[11]||(y[11]=w=>g())],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:y[9]||(y[9]=w=>i.unref(ln)(w,".",!1)),onInput:y[10]||(y[10]=w=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[y[12]||(y[12]=w=>l.value.quantity=w),y[15]||(y[15]=w=>u("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:y[13]||(y[13]=w=>i.unref(ii)(w,!1)),onInput:y[14]||(y[14]=w=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:y[16]||(y[16]=w=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":y[17]||(y[17]=w=>{l.value.marker=w??null,u("marker",w??null)})},null,8,["value"])]),_:1}),d.value?(i.openBlock(),i.createElementBlock("div",Hg,[y[21]||(y[21]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Wg,i.toDisplayString(d.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",jg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:y[18]||(y[18]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}});var nl=Object.defineProperty,Xg=Object.defineProperties,Yg=Object.getOwnPropertyDescriptors,il=Object.getOwnPropertySymbols,Ug=Object.prototype.hasOwnProperty,Gg=Object.prototype.propertyIsEnumerable,rl=t=>{throw TypeError(t)},Ds=(t,e,n)=>e in t?nl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hs=(t,e)=>{for(var n in e||(e={}))Ug.call(e,n)&&Ds(t,n,e[n]);if(il)for(var n of il(e))Gg.call(e,n)&&Ds(t,n,e[n]);return t},Ws=(t,e)=>Xg(t,Yg(e)),sl=(t,e)=>{for(var n in e)nl(t,n,{get:e[n],enumerable:!0})},x=(t,e,n)=>Ds(t,typeof e!="symbol"?e+"":e,n),ol=(t,e,n)=>e.has(t)||rl("Cannot "+n),$t=(t,e,n)=>(ol(t,e,"read from private field"),n?n.call(t):e.get(t)),al=(t,e,n)=>e.has(t)?rl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Kg=(t,e,n,r)=>(ol(t,e,"write to private field"),e.set(t,n),n),xt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return xt.shim(t),typeof e<"u"&&(xt.Image=e),xt.isHeadless=!0,t}},ll={};sl(ll,{Curve:()=>Vi,getAnchorsFromArcData:()=>Jg,getComponentOnCubicBezier:()=>cr,getControlPoints:()=>_l,getCurveBoundingBox:()=>pl,getCurveFromPoints:()=>bl,getCurveLength:()=>ml,getReflection:()=>Ys,integrate:()=>yl,subdivide:()=>Xs});var cl={};sl(cl,{HALF_PI:()=>Je,NumArray:()=>cn,TWO_PI:()=>ht,decomposeMatrix:()=>si,getComputedMatrix:()=>js,getEffectiveStrokeWidth:()=>dn,getPoT:()=>ul,lerp:()=>At,mod:()=>Mt,setMatrix:()=>hl,toFixed:()=>Ae});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var dl,ht=Math.PI*2,Je=Math.PI*.5;function si(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function hl(t){dl=t}function js(t,e){e=e&&e.identity()||new dl;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function At(t,e,n){return n*(e-t)+t}var qs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function ul(t){let e=0;for(;qs[e]&&qs[e]<t;)e++;return qs[e]}function Mt(t,e){for(;t<0;)t+=e;return t%e}var cn=De.Float32Array||Array,Zg=Math.floor;function Ae(t){return Zg(t*1e6)/1e6}function dn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||js(t));const r=si(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var J={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){x(this,"_events",{}),x(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};x(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var fl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(X.Types.change))}}},Gt=class ir extends X{constructor(e=0,n=0){super(),x(this,"_x",0),x(this,"_y",0);for(let r in fl)Object.defineProperty(this,r,fl[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(ir.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ir(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ae(this.x),y:Ae(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};x(Gt,"zero",new Gt),x(Gt,"left",new Gt(-1,0)),x(Gt,"right",new Gt(1,0)),x(Gt,"up",new Gt(0,-1)),x(Gt,"down",new Gt(0,1));var Z=Gt,ke=class Is extends Z{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=J.move){super(e,n),x(this,"controls",{left:new Z,right:new Z}),x(this,"_command",J.move),x(this,"_relative",!0),x(this,"_rx",0),x(this,"_ry",0),x(this,"_xAxisRotation",0),x(this,"_largeArcFlag",0),x(this,"_sweepFlag",1);for(let d in gl)Object.defineProperty(this,d,gl[d]);this.command=l,this.relative=!0;const c=Is.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(X.Types.change)}}static fromObject(e){return new Is().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Is().copy(this)}toObject(){return{x:Ae(this.x),y:Ae(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ae(this.rx),ry:Ae(this.ry),xAxisRotation:Ae(this.xAxisRotation),largeArcFlag:Ae(this.largeArcFlag),sweepFlag:Ae(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},gl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}}},Qg=0,vt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Qg++}},Vi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function cr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Xs(t,e,n,r,s,o,a,l,c){c=c||Vi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ke(a,l)];const h=[];for(let f=0;f<d;f++){const m=f/d,g=cr(m,t,n,s,a),u=cr(m,e,r,o,l);h.push(new ke(g,u))}return h}function ml(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(m*b+g)*b+u;return Math.sqrt(y*y+_*_)}return yl(p,0,1,c||Vi.RecursionLimit)}function pl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,m,g,u,p,b,y;for(let w=0;w<2;++w){if(w===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;g=-m/f,0<g&&g<1&&c.push(g);continue}b=f*f-4*m*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,R=_,k;for(;_--;)g=c[_],k=1-g,d[0][_]=k*k*k*t+3*k*k*g*n+3*k*g*g*s+g*g*g*a,d[1][_]=k*k*k*e+3*k*k*g*r+3*k*g*g*o+g*g*g*l;return d[0][R]=t,d[1][R]=e,d[0][R+1]=a,d[1][R+1]=l,d[0].length=d[1].length=R+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function yl(t,e,n,r){let s=Vi.abscissas[r-2],o=Vi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function bl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Mt(s-1,n):Math.max(s-1,0),l=e?Mt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];_l(c,d,h),d.command=s===0?J.move:J.curve}}function _l(t,e,n){const r=Z.angleBetween(t,e),s=Z.angleBetween(n,e);let o=Z.distanceBetween(t,e),a=Z.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ys(t,e,n){return new Z(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Jg(t,e,n,r,s,o,a){const l=vt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),m=r*Math.sin(h),g=new ke(f,m);g.command=J.line}}var wl=Array.prototype.slice;function em(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var G={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=wl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!em(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:De.performance&&De.performance.now?De.performance:Date},Vt={hasEventListeners:typeof De.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Vt},unbind:function(t,e,n,r){return Vt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Vt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=De[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=De.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ii=De.document?De.document.createElement("div"):{};Ii.id="help-two-load",Object.defineProperty(Vt,"temp",{enumerable:!0,get:function(){return G.isElement(Ii)&&!De.document.head.contains(Ii)&&(Ii.style.display="none",De.document.head.appendChild(Ii)),Ii}});var Pt=class extends Error{constructor(e){super(),x(this,"name","Two.js"),x(this,"message"),this.message=e}},tm=De.devicePixelRatio||1;function nm(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Us(t){return tm/nm(t)}var zr=class{constructor(){x(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},ut,Dn=class extends Array{constructor(){super(),al(this,ut,new X),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return $t(this,ut)}set _events(e){Kg(this,ut,e)}get _bound(){return $t(this,ut)._bound}set _bound(e){$t(this,ut)._bound=e}addEventListener(){return $t(this,ut).addEventListener.apply(this,arguments)}on(){return $t(this,ut).on.apply(this,arguments)}bind(){return $t(this,ut).bind.apply(this,arguments)}removeEventListener(){return $t(this,ut).removeEventListener.apply(this,arguments)}off(){return $t(this,ut).off.apply(this,arguments)}unbind(){return $t(this,ut).unbind.apply(this,arguments)}dispatchEvent(){return $t(this,ut).dispatchEvent.apply(this,arguments)}trigger(){return $t(this,ut).trigger.apply(this,arguments)}listen(){return $t(this,ut).listen.apply(this,arguments)}ignore(){return $t(this,ut).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};ut=new WeakMap;var xl=class Du extends X{constructor(){super(),x(this,"_flagId",!1),x(this,"_flagClassName",!1),x(this,"_renderer",{}),x(this,"_id",vt.Identifier+vt.uniqueId()),x(this,"_className",""),x(this,"classList",[]);for(let e in vl)Object.defineProperty(this,e,vl[e])}static fromObject(e){const n=new Du().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};x(xl,"Properties",["renderer","id","className"]);var Oi=xl,vl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},Lr,kl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(Lr=document.createElement("a"));var Kt=class zt extends Oi{constructor(e,n){super(),x(this,"_flagSrc",!1),x(this,"_flagImage",!1),x(this,"_flagVideo",!1),x(this,"_flagLoaded",!1),x(this,"_flagRepeat",!1),x(this,"_flagOffset",!1),x(this,"_flagScale",!1),x(this,"_src",""),x(this,"_image",null),x(this,"_loaded",!1),x(this,"_repeat","no-repeat"),x(this,"_scale",1),x(this,"_offset",null);for(let r in Cl)Object.defineProperty(this,r,Cl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=im.bind(this),this._renderer.flagScale=rm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof n=="function"){const r=(function(){this.unbind(X.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(X.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new zt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Lr?(Lr.href=e,Lr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=zt.getAbsoluteURL(e);if(zt.ImageRegistry.contains(n))return zt.ImageRegistry.get(n);let r;return xt.Image?(r=new xt.Image,xt.shim(r,"img")):De.document?kl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=zt.getTag(r);e._flagImage&&(/canvas/i.test(s)?zt.Register.canvas(e,n):(e._src=!xt.isHeadless&&r.getAttribute("two-src")||r.src,zt.Register[s](e,n))),e._flagSrc&&(r||(r=zt.getImage(e.src),e.image=r),s=zt.getTag(r),zt.Register[s](e,n))}clone(){const e=new zt(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,zt.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(Kt,"Properties",["src","loaded","repeat","scale","offset","image"]),x(Kt,"RegularExpressions",kl),x(Kt,"ImageRegistry",new zr),x(Kt,"Register",{canvas:function(t,e){t._src="#"+t.id,Kt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!xt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!xt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Pt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!xt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Kt.getAbsoluteURL(t._src),!(!xt.isHeadless&&n&&n.getAttribute("two-src"))&&(xt.isHeadless||n.setAttribute("two-src",t.src),Kt.ImageRegistry.add(t.src,n),xt.isHeadless?Kt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(xt.isHeadless)throw new Pt("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new Pt("unable to load "+t.src)};t._src=Kt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Kt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Me=Kt,Cl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Me.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Me.ImageRegistry.contains(n)?this._image=Me.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(X.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Z&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof Z&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function im(){this._flagOffset=!0}function rm(){this._flagScale=!0}var Gs=class an extends Oi{constructor(e,n,r){super(),x(this,"_flagOffset",!0),x(this,"_flagOpacity",!0),x(this,"_flagColor",!0),x(this,"_offset",0),x(this,"_opacity",1),x(this,"_color","#fff");for(let s in Sl)Object.defineProperty(this,s,Sl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:an.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:an.Index<=0?"#fff":"#000",an.Index=(an.Index+1)%2}static fromObject(e){const n=new an().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<an.Properties.length;n++){const r=an.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new an;return G.each(an.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",G.each(an.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Gs,"Index",0),x(Gs,"Properties",["offset","opacity","color"]);var Hn=Gs,Sl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Ks=class Ri extends Oi{constructor(e){super(),x(this,"_flagStops",!1),x(this,"_flagSpread",!1),x(this,"_flagUnits",!1),x(this,"_spread",""),x(this,"_units","");for(let n in Bl)Object.defineProperty(this,n,Bl[n]);this._renderer.type="gradient",this._renderer.flagStops=sm.bind(this),this._renderer.bindStops=om.bind(this),this._renderer.unbindStops=am.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Hn?s:new Hn().copy(s)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Ri(n);return G.each(Ri.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return G.each(Ri.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(Ks,"Stop",Hn),x(Ks,"Properties",["spread","stops","units"]);var et=Ks,Bl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(X.Types.insert,e).unbind(X.Types.remove,n),this._stops=new Dn((t||[]).slice(0)),this._stops.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._stops)}}};function sm(){this._flagStops=!0}function om(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function am(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Zs=class Er extends et{constructor(e,n,r,s,o){super(o),x(this,"_flagEndPoints",!1),x(this,"_left",null),x(this,"_right",null);for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=lm.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new Er().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Er.Properties.length;n++){const r=Er.Properties[n];r in e&&(this[r]=e[r]instanceof Z?e[r]:new Z().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Er(this.left._x,this.left._y,this.right._x,this.right._y,n);return G.each(et.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(Zs,"Stop",Hn),x(Zs,"Properties",["left","right"]);var He=Zs,Tl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof Z&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof Z&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function lm(){this._flagEndPoints=!0}var Qs=class $i extends et{constructor(e,n,r,s,o,a){super(s),x(this,"_flagRadius",!1),x(this,"_flagCenter",!1),x(this,"_flagFocal",!1),x(this,"_radius",0),x(this,"_center",null),x(this,"_focal",null);for(let l in Rl)Object.defineProperty(this,l,Rl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=cm.bind(this),this._renderer.flagFocal=dm.bind(this),this.center=new Z,this.radius=typeof r=="number"?r:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof Z?e[r]:new Z().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new $i(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return G.each(et.Properties.concat($i.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return G.each($i.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(Qs,"Stop",Hn),x(Qs,"Properties",["center","radius","focal"]);var We=Qs,Rl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(X.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function cm(){this._flagCenter=!0}function dm(){this._flagFocal=!0}function $l(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Dr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Pl(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),ml(r,l,s,c,o,d,a,h,n)}function El(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Xs(r,l,s,c,o,d,a,h,n)}function oi(t){switch(t.renderer.type){case"texture":return Me.fromObject(t);case"gradient":return et.fromObject(t);case"linear-gradient":return He.fromObject(t);case"radial-gradient":return We.fromObject(t)}return t}var hm=Math.cos,um=Math.sin,Nl=Math.tan,Js=[],Fl=class Lt extends X{constructor(e,n,r,s,o,a){super(),x(this,"elements",new cn(9)),x(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const C=e;let S,T,B;const $=n[0]||0,M=n[1]||0,E=n[2]||0;return S=C[0]*$+C[1]*M+C[2]*E,T=C[3]*$+C[4]*M+C[5]*E,B=C[6]*$+C[7]*M+C[8]*E,[S,T,B]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],f=e[7],m=e[8],g=n[0],u=n[1],p=n[2],b=n[3],y=n[4],_=n[5],R=n[6],k=n[7],w=n[8];return r=r||new cn(9),r[0]=s*g+o*b+a*R,r[1]=s*u+o*y+a*k,r[2]=s*p+o*_+a*w,r[3]=l*g+c*b+d*R,r[4]=l*u+c*y+d*k,r[5]=l*p+c*_+d*w,r[6]=h*g+f*b+m*R,r[7]=h*u+f*y+m*k,r[8]=h*p+f*_+m*w,r}static fromObject(e){return new Lt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(X.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(X.Types.change)}identity(){return this.elements[0]=Lt.Identity[0],this.elements[1]=Lt.Identity[1],this.elements[2]=Lt.Identity[2],this.elements[3]=Lt.Identity[3],this.elements[4]=Lt.Identity[4],this.elements[5]=Lt.Identity[5],this.elements[6]=Lt.Identity[6],this.elements[7]=Lt.Identity[7],this.elements[8]=Lt.Identity[8],this.trigger(X.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(X.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const L=o[0]*e+o[1]*n+o[2]*r,D=o[3]*e+o[4]*n+o[5]*r,te=o[6]*e+o[7]*n+o[8]*r;return[L,D,te]}const h=this.elements,f=[e,n,r,s,o,a,l,c,d],m=h[0],g=h[1],u=h[2],p=h[3],b=h[4],y=h[5],_=h[6],R=h[7],k=h[8],w=f[0],C=f[1],S=f[2],T=f[3],B=f[4],$=f[5],M=f[6],E=f[7],V=f[8];return this.elements[0]=m*w+g*T+u*M,this.elements[1]=m*C+g*B+u*E,this.elements[2]=m*S+g*$+u*V,this.elements[3]=p*w+b*T+y*M,this.elements[4]=p*C+b*B+y*E,this.elements[5]=p*S+b*$+y*V,this.elements[6]=_*w+R*T+k*M,this.elements[7]=_*C+R*B+k*E,this.elements[8]=_*S+R*$+k*V,this.trigger(X.Types.change)}inverse(e){const n=this.elements;e=e||new Lt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],f=n[8],m=f*l-c*h,g=-f*a+c*d,u=h*a-l*d;let p=r*m+s*g+o*u;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-f*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(f*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=u*p,e.elements[7]=(-h*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=hm(e),r=um(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Nl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Nl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Js.length=0,this.toTransformArray(e,Js),Js.map(Ae).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=f,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=h,n[8]=g;return}return[o,c,f,a,d,m,l,h,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const f=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=f,n[7]=m,n[8]=g;return}return[o,a,l,c,d,h,f,m,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Lt().copy(this)}};x(Fl,"Identity",[1,0,0,0,1,0,0,0,1]);var zi=Fl;hl(zi);var Al=class Ha extends Oi{constructor(){super(),x(this,"_flagMatrix",!0),x(this,"_flagScale",!1),x(this,"_matrix",null),x(this,"_worldMatrix",null),x(this,"_position",null),x(this,"_rotation",0),x(this,"_scale",1),x(this,"_skewX",0),x(this,"_skewY",0);for(let e in Hr)Object.defineProperty(this,e,Hr[e]);this._renderer.flagMatrix=Ml.bind(this),this.isShape=!0,this.matrix=new zi,this.worldMatrix=new zi,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Ha().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Hr.position.get.apply(this,arguments)}set translation(e){Hr.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 n=new Ha;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof 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}};x(Al,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Wn=Al,Hr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(X.Types.change,this._renderer.flagMatrix),Ml.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Z&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof Z&&this._scale.bind(X.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return js(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Ml(){this._flagMatrix=!0}var Li=Math.min,Di=Math.max,fm=Math.ceil,gm=Math.floor,mm=new Z,eo=class Jn extends Wn{constructor(e,n,r,s){super(),x(this,"_flagVertices",!0),x(this,"_flagLength",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagCap",!0),x(this,"_flagJoin",!0),x(this,"_flagMiter",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_flagMask",!1),x(this,"_flagClip",!1),x(this,"_length",0),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_cap","round"),x(this,"_join","round"),x(this,"_miter",4),x(this,"_closed",!0),x(this,"_curved",!1),x(this,"_automatic",!0),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_mask",null),x(this,"_clip",!1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0);for(let o in Vl)Object.defineProperty(this,o,Vl[o]);this._renderer.type="path",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:oi(e.fill),r=typeof e.stroke=="string"?e.stroke:oi(e.stroke),s=new Jn().copy(Ws(Hs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}}for(let n=0;n<Jn.Properties.length;n++){const r=Jn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Jn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Jn.Properties.length;r++){const s=Jn.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),G.each(Jn.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,h=1/0,f=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:g}=si(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof g=="number"&&(r=Math.max(m,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[m,g]=n.multiply(a.x,a.y),[u,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,R]=n.multiply(b,y),k=l.controls.left.x,w=l.controls.left.y;l.relative&&(k+=l.x,w+=l.y);let[C,S]=n.multiply(k,w);const T=pl(m,g,_,R,C,S,u,p);h=Li(T.min.y-r,h),c=Li(T.min.x-r,c),d=Di(T.max.x+r,d),f=Di(T.max.y+r,f)}else o<=1&&(h=Li(g-r,h),c=Li(m-r,c),d=Di(m+r,d),f=Di(g+r,f)),h=Li(p-r,h),c=Li(u-r,c),d=Di(u+r,d),f=Di(p+r,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,f,m,g,u,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const R=this.vertices.length,k=R-1;let w=null,C=null;for(let ne=0,A=this._lengths.length,I=0;ne<A;ne++){if(I+this._lengths[ne]>=_){this._closed?(r=Mt(ne,R),s=Mt(ne-1,R),ne===0&&(r=s,s=ne)):(r=ne,s=Math.min(Math.max(ne-1,0),k)),w=this.vertices[r],C=this.vertices[s],_-=I,this._lengths[ne]!==0?e=_/this._lengths[ne]:e=0;break}I+=this._lengths[ne]}if(w===null||C===null)return null;if(w){if(!C)return w}else return C;y=C.controls&&C.controls.right,b=w.controls&&w.controls.left,l=C.x,m=C.y,c=(y||C).x,g=(y||C).y,d=(b||w).x,u=(b||w).y,h=w.x,p=w.y,y&&C.relative&&(c+=C.x,g+=C.y),b&&w.relative&&(d+=w.x,u+=w.y),a=cr(e,l,c,d,h),f=cr(e,m,g,u,p);const S=At(l,c,e),T=At(m,g,e),B=At(c,d,e),$=At(g,u,e),M=At(d,h,e),E=At(u,p,e),V=At(S,B,e),L=At(T,$,e),D=At(B,M,e),te=At($,E,e);return G.isObject(n)?(n.x=a,n.y=f,n instanceof ke&&(n.controls.left.x=V,n.controls.left.y=L,n.controls.right.x=D,n.controls.right.y=te,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=f,n.controls.right.x-=a,n.controls.right.y-=f)),n.t=e,n):(o=new ke(a,f,V-a,L-f,D-a,te-f,this._curved?J.curve:J.line),o.t=e,o)}plot(){if(this.curved)return bl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?J.move:J.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===J.close;let s=this.vertices[n],o=[],a;return G.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===J.move){o.push(new ke(s.x,s.y)),c>0&&(o[o.length-1].command=J.line),s=l;return}a=El(l,s,e),o=o.concat(a),G.each(a,function(d,h){h<=0&&s.command===J.move?d.command=J.move:d.command=J.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=El(l,s,e),o=o.concat(a),G.each(a,function(d,h){h<=0&&s.command===J.move?d.command=J.move:d.command=J.line})),o.push(new ke(l.x,l.y)),o[o.length-1].command=r?J.close:J.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),G.each(this.vertices,function(l,c){if(c<=0||l.command===J.move){o=l,this._lengths[c]=0;return}this._lengths[c]=Pl(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Dr(this,r*this._length),a=Dr(this,s*this._length),l=fm(o),c=gm(a);let d,h,f,m,g,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ke),u>c&&!h?(g=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(s,g),g.command=this._renderer.collection[u].command,this._renderer.vertices.push(g),h=g,f=this._collection[u-1],f&&f.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),f.relative?this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(Z.zero,1-g.t):this._renderer.collection[u-1].controls.right.copy(f.controls.right).lerp(f,1-g.t))):u>=l&&u<=c&&(g=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(g),u===c&&$l(this,s)?(h=g,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):u===l&&$l(this,r)&&(d=g,d.command=J.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(u=l-1,g=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,g),g.command=J.move,this._renderer.vertices.unshift(g),m=this._collection[u+1],m&&m.controls&&(g.controls.left.clear(),m.relative?this._renderer.collection[u+1].controls.left.copy(m.controls.left).lerp(Z.zero,g.t):(mm.copy(m),this._renderer.collection[u+1].controls.left.copy(m.controls.left).lerp(m,g.t))))}return Wn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Wn.prototype.flagReset.call(this),this}};x(eo,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(eo,"Utils",{getCurveLength:Pl});var Te=eo,Vl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";G.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof Dn?this._collection=t:this._collection=new Dn(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,G.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Il(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Ol(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function zl(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Ll(){this._flagFill=!0}function Dl(){this._flagStroke=!0}var Hl=class Nr extends Te{constructor(e,n,r,s){const o=[new ke,new ke,new ke,new ke];super(o,!0,!1,!0),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_width",0),x(this,"_height",0),x(this,"_origin",null),this._renderer.type="rectangle";for(let a in Wl)Object.defineProperty(this,a,Wl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Nr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Nr.Properties.length;n++){const r=Nr.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof Z&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ke),this.vertices[0].set(-e,-n).sub(this._origin).command=J.move,this.vertices[1].set(e,-n).sub(this._origin).command=J.line,this.vertices[2].set(e,n).sub(this._origin).command=J.line,this.vertices[3].set(-e,n).sub(this._origin).command=J.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=J.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Nr(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Te.Properties.length;r++){const s=Te.Properties[r];n[s]instanceof Z?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};x(Hl,"Properties",["width","height","origin"]);var jn=Hl,Wl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(X.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},jl=class Fr extends jn{constructor(e,n,r,s,o,a){super(n,r,0,0),x(this,"_flagTexture",!1),x(this,"_flagColumns",!1),x(this,"_flagRows",!1),x(this,"_flagFrameRate",!1),x(this,"_flagIndex",!1),x(this,"_amount",1),x(this,"_duration",0),x(this,"_startTime",0),x(this,"_playing",!1),x(this,"_firstFrame",0),x(this,"_lastFrame",0),x(this,"_loop",!0),x(this,"_texture",null),x(this,"_columns",1),x(this,"_rows",1),x(this,"_frameRate",0),x(this,"_index",0),x(this,"_origin",null),this._renderer.type="sprite";for(let l in ql)Object.defineProperty(this,l,ql[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),this.origin=new Z,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Fr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fr.Properties.length;n++){const r=Fr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Fr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,h,f,m;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){h=e.image.width,f=e.image.height,s=h/n,o=f/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(G.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=G.performance.now()-this._startTime,m=this._lastFrame+1,c=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=At(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,u=Math.floor(this._index/n),p=-s*g+(h-s)/2,b=-o*u+(f-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(jl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Wr=jl,ql={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},to,Xl=class extends Dn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),al(this,to,{}),this.attach(e),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return $t(this,to)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};to=new WeakMap;var Yl=class Pi extends Te{constructor(e,n,r,s,o,a,l){const c=l||vt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ke);super(d,!0,!1,!0),x(this,"_flagStartAngle",!1),x(this,"_flagEndAngle",!1),x(this,"_flagInnerRadius",!1),x(this,"_flagOuterRadius",!1),x(this,"_startAngle",0),x(this,"_endAngle",ht),x(this,"_innerRadius",0),x(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Ul)Object.defineProperty(this,h,Ul[h]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=Mt(e,ht)===Mt(n,ht),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,f,m,g,u,p,b,y,_,R;for(o?c--:a||(c-=2),f=0,m=c-1;f<c;f++){switch(g=f/m,u=l[h],p=g*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),f){case 0:d=J.move;break;default:d=J.curve}u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===J.curve&&(R=s*b/Math.PI,u.controls.left.x=R*Math.cos(p-Je),u.controls.left.y=R*Math.sin(p-Je),u.controls.right.x=R*Math.cos(p+Je),u.controls.right.y=R*Math.sin(p+Je),f===1&&u.controls.left.multiplyScalar(2),f===m&&u.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=J.close,h++):(c--,m=c-1),f=0;f<c;f++)g=f/m,u=l[h],p=(1-g)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=J.curve,f<=0&&(d=o?J.move:J.line),u.command=d,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===J.curve&&(R=r*b/Math.PI,u.controls.left.x=R*Math.cos(p+Je),u.controls.left.y=R*Math.sin(p+Je),u.controls.right.x=R*Math.cos(p-Je),u.controls.right.y=R*Math.sin(p-Je),f===1&&u.controls.left.multiplyScalar(2),f===m&&u.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=J.line}else o||(l[h].command=J.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=J.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new Pi(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Te.Properties.length;c++){const d=Te.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];e[r]=this[r]}return e}};x(Yl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var no=Yl,Ul={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},io=Math.cos,ro=Math.sin,Gl=class Ei extends Te{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ke(0,0,0,0,0,0));super(a,!0,!0,!0),x(this,"_flagRadius",!1),x(this,"_radius",0),this._renderer.type="circle";for(let l in Kl)Object.defineProperty(this,l,Kl[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ht,c=r*io(l),d=r*ro(l),h=s*io(l-Je),f=s*ro(l-Je),m=s*io(l+Je),g=s*ro(l+Je),u=this.vertices[o];u.command=o===0?J.move:J.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Ei(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Te.Properties.length;r++){const s=Te.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};x(Gl,"Properties",["radius"]);var jr=Gl,Kl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},so=Math.cos,oo=Math.sin,Zl=class Ni extends Te{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ke);super(l,!0,!0,!0),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_width",0),x(this,"_height",0),this._renderer.type="ellipse";for(let c in Ql)Object.defineProperty(this,c,Ql[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ni().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ht,c=r*so(l),d=s*oo(l),h=r*n*so(l-Je),f=s*n*oo(l-Je),m=r*n*so(l+Je),g=s*n*oo(l+Je),u=this.vertices[o];u.command=o===0?J.move:J.curve,u.set(c,d),u.controls.left.set(h,f),u.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Ni(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Te.Properties.length;a++){const l=Te.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];e[r]=this[r]}return e}};x(Zl,"Properties",["width","height"]);var qr=Zl,Ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},pm=Math.ceil,ym=Math.floor,Jl=class ei extends Wn{constructor(e){super(),x(this,"_flagVertices",!0),x(this,"_flagLength",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagSize",!0),x(this,"_flagSizeAttenuation",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_length",0),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_size",1),x(this,"_sizeAttenuation",!1),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0),x(this,"noFill",Te.prototype.noFill),x(this,"noStroke",Te.prototype.noStroke),x(this,"corner",Te.prototype.corner),x(this,"center",Te.prototype.center),x(this,"getBoundingClientRect",Te.prototype.getBoundingClientRect),x(this,"_updateLength",Te.prototype._updateLength);for(let n in ec)Object.defineProperty(this,n,ec[n]);this._renderer.type="points",this._renderer.flagVertices=Il.bind(this),this._renderer.bindVertices=Ol.bind(this),this._renderer.unbindVertices=zl.bind(this),this._renderer.flagFill=Ll.bind(this),this._renderer.flagStroke=Dl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:oi(e.fill),r=typeof e.stroke=="string"?e.stroke:oi(e.stroke),s=new ei().copy(Ws(Hs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ke?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ke().copy(r))}for(let n=0;n<ei.Properties.length;n++){const r=ei.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ei;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ei.Properties.length;r++){const s=ei.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),G.each(ei.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,h=Xs(a,l,a,l,c,d,c,d,e);n=n.concat(h)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Dr(this,e*this._length),s=Dr(this,n*this._length),o=pm(r),a=ym(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};x(Jl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var ao=Jl,ec={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof Dn?this._collection=t:this._collection=new Dn(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},bm=Math.cos,_m=Math.sin,tc=class Fi extends Te{constructor(e,n,r,s){s=Math.max(s||0,3),super(),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_flagSides",!1),x(this,"_radius",0),x(this,"_width",0),x(this,"_height",0),x(this,"_sides",0),this._renderer.type="polygon";for(let o in nc)Object.defineProperty(this,o,nc[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ht*o+Math.PI/2,l=this._width*bm(a)/2,c=this._height*_m(a)/2;s>=r?this.vertices.push(new ke(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?J.move:J.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Te.Properties.length;r++){const s=Te.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};x(tc,"Properties",["width","height","sides"]);var lo=tc,nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ic=class Ai extends Te{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ke(0,0,0,0,0,0,l===0?J.move:J.curve));super(a),x(this,"_flagWidth",!1),x(this,"_flagHeight",!1),x(this,"_flagRadius",!1),x(this,"_width",0),x(this,"_height",0),x(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in rc)Object.defineProperty(this,l,rc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=wm.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof Z)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof Z?s:new Z().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof Z?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=this.width,r=this.height,s=this.radius,o=new Ai(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Te.Properties.length;a++){const l=Te.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};x(ic,"Properties",["width","height","radius"]);var Xr=ic,rc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof Z&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof Z&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function wm(){this._flagRadius=!0}var xm=Math.cos,vm=Math.sin,sc=class Mi extends Te{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),x(this,"_flagInnerRadius",!1),x(this,"_flagOuterRadius",!1),x(this,"_flagSides",!1),x(this,"_innerRadius",0),x(this,"_outerRadius",0),x(this,"_sides",0),this._renderer.type="star";for(let a in oc)Object.defineProperty(this,a,oc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ht*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*xm(a),d=l*vm(a);s>=r?this.vertices.push(new ke(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?J.move:J.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Mi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Te.Properties.length;a++){const l=Te.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};x(sc,"Properties",["innerRadius","outerRadius","sides"]);var co=sc,oc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ho,ac=Math.min,lc=Math.max;De.document&&(ho=document.createElement("canvas"));var uo=class Dt extends Wn{constructor(e,n,r,s){super(),x(this,"_flagValue",!0),x(this,"_flagFamily",!0),x(this,"_flagSize",!0),x(this,"_flagLeading",!0),x(this,"_flagAlignment",!0),x(this,"_flagBaseline",!0),x(this,"_flagStyle",!0),x(this,"_flagWeight",!0),x(this,"_flagDecoration",!0),x(this,"_flagFill",!0),x(this,"_flagStroke",!0),x(this,"_flagLinewidth",!0),x(this,"_flagOpacity",!0),x(this,"_flagVisible",!0),x(this,"_flagMask",!1),x(this,"_flagClip",!1),x(this,"_flagDirection",!0),x(this,"_flagStrokeAttenuation",!0),x(this,"_value",""),x(this,"_family","sans-serif"),x(this,"_size",13),x(this,"_leading",17),x(this,"_alignment","center"),x(this,"_baseline","middle"),x(this,"_style","normal"),x(this,"_weight",500),x(this,"_decoration","none"),x(this,"_direction","ltr"),x(this,"_fill","#000"),x(this,"_stroke","none"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_mask",null),x(this,"_clip",!1),x(this,"_dashes",null),x(this,"_strokeAttenuation",!0);for(let o in cc)Object.defineProperty(this,o,cc[o]);if(this._renderer.type="text",this._renderer.flagFill=km.bind(this),this._renderer.flagStroke=Cm.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!G.isObject(s))return this;for(let o=0;o<Dt.Properties.length;o++){const a=Dt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ho){const n=ho.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*Dt.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:oi(e.fill),r=typeof e.stroke=="string"?e.stroke:oi(e.stroke),s=new Dt().copy(Ws(Hs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<Dt.Properties.length;n++){const r=Dt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Dt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Dt.Properties.length;r++){const s=Dt.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<Dt.Properties.length;n++){const r=Dt.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=Dt.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[h,f]=n.multiply(r,o),[m,g]=n.multiply(r,a),[u,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=ac(f,g,p,y),r=ac(h,m,u,b),s=lc(h,m,u,b),a=lc(f,g,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};x(uo,"Ratio",.6),x(uo,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var hn=uo,cc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof He||this._fill instanceof We||this._fill instanceof Me)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof He||this._stroke instanceof We||this._stroke instanceof Me)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,G.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function km(){this._flagFill=!0}function Cm(){this._flagStroke=!0}var fo=class rr extends jn{constructor(e,n,r,s){super(n,r,0,0),x(this,"_flagTextures",!1),x(this,"_flagFrameRate",!1),x(this,"_flagIndex",!1),x(this,"_amount",1),x(this,"_duration",0),x(this,"_index",0),x(this,"_startTime",0),x(this,"_playing",!1),x(this,"_firstFrame",0),x(this,"_lastFrame",0),x(this,"_loop",!0),x(this,"_textures",null),x(this,"_frameRate",0),x(this,"_origin",null),this._renderer.type="image-sequence";for(let o in dc)Object.defineProperty(this,o,dc[o]);this._renderer.flagTextures=Sm.bind(this),this._renderer.bindTextures=Bm.bind(this),this._renderer.unbindTextures=Tm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(hc.bind(this)):typeof e=="string"&&(this.textures=[hc(e)]),this.origin=new Z,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new rr(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,G.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=G.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=At(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Me))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(fo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(fo,"DefaultFrameRate",30);var go=fo,dc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(X.Types.insert,e).unbind(X.Types.remove,n),this._textures=new Dn((t||[]).slice(0)),this._textures.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Sm(){this._flagTextures=!0}function Bm(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Tm(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function hc(t){if(t instanceof Me)return t;if(typeof t=="string")return new Me(t)}var Yr=Math.min,Ur=Math.max,mo=class ti extends Wn{constructor(e){super(),x(this,"_flagAdditions",!1),x(this,"_flagSubtractions",!1),x(this,"_flagOrder",!1),x(this,"_flagOpacity",!0),x(this,"_flagBeginning",!1),x(this,"_flagEnding",!1),x(this,"_flagLength",!1),x(this,"_flagMask",!1),x(this,"_fill","#fff"),x(this,"_stroke","#000"),x(this,"_linewidth",1),x(this,"_opacity",1),x(this,"_visible",!0),x(this,"_cap","round"),x(this,"_join","round"),x(this,"_miter",4),x(this,"_closed",!0),x(this,"_curved",!1),x(this,"_automatic",!0),x(this,"_beginning",0),x(this,"_ending",1),x(this,"_length",0),x(this,"_mask",null),x(this,"_strokeAttenuation",!0);for(let n in uc)Object.defineProperty(this,n,uc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)fc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new ti;for(let s=0;s<ti.Properties.length;s++){const o=ti.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:oi(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return no.fromObject(s);case"circle":return jr.fromObject(s);case"element":return Oi.fromObject(s);case"ellipse":return qr.fromObject(s);case"group":return ti.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return go.fromObject(s);case"path":return Te.fromObject(s);case"points":return ao.fromObject(s);case"polygon":return lo.fromObject(s);case"rectangle":return jn.fromObject(s);case"rounded-rectangle":return Xr.fromObject(s);case"shape":return Wn.fromObject(s);case"sprite":return Wr.fromObject(s);case"star":return co.fromObject(s);case"text":return hn.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<ti.Properties.length;n++){const r=ti.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ti,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,G.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,h=1/0,f=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const u=this.children[g];if(!(!u.visible||m.test(u._renderer.type))&&(n=u.getBoundingClientRect(e),s=typeof n.top!="number"||G.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||G.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||G.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||G.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[R,k]=r.multiply(n.left,n.bottom),[w,C]=r.multiply(n.right,n.bottom);h=Yr(b,_,k,C,h),c=Yr(p,y,R,w,c),d=Ur(p,y,R,w,d),f=Ur(b,_,k,C,f)}else h=Yr(n.top,h),c=Yr(n.left,c),d=Ur(n.right,d),f=Ur(n.bottom,f)}return{top:h,left:c,right:d,bottom:f,width:d-c,height:f-h}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};x(mo,"Children",Xl),x(mo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var st=mo,uc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=st.InsertChildren.bind(this),n=st.RemoveChildren.bind(this),r=st.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Xl(t),this._children.bind(X.Types.insert,e),this._children.bind(X.Types.remove,n),this._children.bind(X.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,G.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function fc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Gr=class extends Te{constructor(e,n,r,s){const o=[new ke(e,n),new ke(r,s)];super(o);for(let a in gc)Object.defineProperty(this,a,gc[a]);this.vertices[0].command=J.move,this.vertices[1].command=J.line,this.automatic=!1}};x(Gr,"Properties",["left","right"]);var gc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(G.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=J.move;else{const e=new Pt("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(G.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=J.line;else{const e=new Pt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},un={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Rm={start:"left",middle:"center",end:"right"},mc=["id","class","transform","xmlns","viewBox"],$m=["x","y","width","height","href","xlink:href"];function Pm(t){return Rm[t]}function Em(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function dr(t){return t.replace(/svg:/gi,"").toLowerCase()}function pc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function Nm(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Fm(t){const e={},n=Am(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Am(t){const e=t.getAttributeNames();for(let n=0;n<mc.length;n++){const r=mc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Mm(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<t.children.length;f++){const m=t.children[f];"translation"in m?m.translation.add(r,s):"x"in m?m.x=r:"y"in m&&(m.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new Z(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new jn(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Ht(t,e,n){const r={},s={},o={};let a,l,c,d,h,f,m,g,u,p,b,y,_,R,k,w,C;if(t===null)return r;if(De.getComputedStyle){const S=De.getComputedStyle(t);for(a=S.length;a--;)c=S[a],d=S[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)f=t.attributes[a],/style/i.test(f.nodeName)?Nm(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&G.defaults(r,n),G.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(m=si(l),e._renderer.type){case"linear-gradient":pc(m,e.left),pc(m,e.right);break;case"radial-gradient":e.center.x+=m.translateX,e.center.y+=m.translateY,e.focal.x+=m.translateX,e.focal.y+=m.translateY,e.radius*=Math.max(m.scaleX,m.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;m=si(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new Z(m.scaleX,m.scaleY),g=parseFloat((r.x+"").replace("px")),u=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),u&&(e.translation.y=u);break;case"visible":if(e instanceof st){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof st){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof st){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof st){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof st){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof st){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(un.cssBackgroundImage.test(d)&&(p=d.replace(un.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(y=ze.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=dr(y.nodeName),e.mask=ze[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof st?"_":"")+c,un.cssBackgroundImage.test(d)?(p=d.replace(un.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(y=ze.defs.current.get(p),y.object||(_=dr(y.nodeName),y.object=ze[_].call(this,y,{})),y=y.object):(b=Im(this),y=b.getById(p)),e[h]=y):e[h]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(R=e instanceof et,k=e instanceof He,w=e instanceof We,R||k||w)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(C=new Pt("only pixel values are supported with the "+c+" attribute."),console.warn(C.name,C.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof hn&&(e.family=d);break;case"font-size":e instanceof hn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(C=new Pt("only pixel values are supported with the "+c+" attribute."),console.warn(C.name,C.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof hn&&(e.weight=d);break;case"font-style":e instanceof hn&&(e.style=d);break;case"text-decoration":e instanceof hn&&(e.decoration=d);break;case"line-height":e instanceof hn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function Vm(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||dr(t.nodeName)==="#text"||e.add(s.id,s)}}function Im(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new zr,n=t.getElementsByTagName("defs");for(let u=0;u<n.length;u++)Vm(n[u],e);const r=ze.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,h=o!==null,f=a!==null,m=l!==null,g=c!==null;return h&&(r.x=parseFloat(o.replace(un.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(un.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(un.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(un.unitSuffix,""))),d&&Mm(r,s),delete ze.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Pt("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 Pt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],h=$m.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=dr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new st;Ht.call(this,t,n,e),this.add(n);const r=Fm.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=dr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ke(parseFloat(a),parseFloat(l)))});const s=new Te(r,!0);return s.stroke="none",s.fill="black",Ht.call(this,t,s,e),s},polyline:function(t,e){const n=ze.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ke,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const f=h.length-1;G.each(h.slice(0),function(m,g){const u=m.slice(1).trim().match(un.path),p=m[0],b=p.toLowerCase();let y,_,R,k,w;const C=[];switch(g===0&&(h=[]),b){case"h":case"v":u.length>1&&(y=1);break;case"m":case"l":case"t":u.length>2&&(y=2);break;case"s":case"q":u.length>4&&(y=4);break;case"c":u.length>6&&(y=6);break;case"a":u.length>7&&(y=7);break}if(y){for(_=0,R=u.length,w=0;_<R;_+=y){if(k=p,w>0)switch(p){case"m":k="l";break;case"M":k="L";break}C.push(k+u.slice(_,_+y).join(" ")),w++}h=Array.prototype.concat.apply(h,C)}else h.push(m)}),G.each(h,function(m,g){let u,p,b;const y=m[0],_=y.toLowerCase();d=m.slice(1).trim().match(un.path),o=y===_;let R,k,w,C,S,T,B,$,M,E,V,L,D,te,ne,A,I;switch(_){case"z":if(g>=f)s=!0;else{p=l.x,b=l.y,u=new ke(p,b,void 0,void 0,void 0,void 0,J.close);for(let j=r.length-1;j>=0;j--){const q=r[j];if(/m/i.test(q.command)){l=q;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),u=new ke(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?J.move:J.line),o&&u.addSelf(l),l=u;break;case"h":case"v":E=/h/i.test(_)?"x":"y",V=/x/i.test(E)?"y":"x",u=new ke(void 0,void 0,void 0,void 0,void 0,void 0,J.line),u[E]=parseFloat(d[0]),u[V]=l[V],o&&(u[E]+=l[E]),l=u;break;case"c":case"s":R=l.x,k=l.y,c||(c=new Z),/c/i.test(_)?(w=parseFloat(d[0]),C=parseFloat(d[1]),S=parseFloat(d[2]),T=parseFloat(d[3]),B=parseFloat(d[4]),$=parseFloat(d[5])):(M=Ys(l,c,o),w=M.x,C=M.y,S=parseFloat(d[0]),T=parseFloat(d[1]),B=parseFloat(d[2]),$=parseFloat(d[3])),o&&(w+=R,C+=k,S+=R,T+=k,B+=R,$+=k),l.controls.right.set(w-l.x,C-l.y),u=new ke(B,$,S-B,T-$,void 0,void 0,J.curve),l=u,c=u.controls.left;break;case"t":case"q":R=l.x,k=l.y,c||(c=new Z),/q/i.test(_)?(w=parseFloat(d[0]),C=parseFloat(d[1]),S=parseFloat(d[0]),T=parseFloat(d[1]),B=parseFloat(d[2]),$=parseFloat(d[3])):(M=Ys(l,c,o),w=M.x,C=M.y,S=M.x,T=M.y,B=parseFloat(d[0]),$=parseFloat(d[1])),o&&(w+=R,C+=k,S+=R,T+=k,B+=R,$+=k),l.controls.right.set((w-l.x)*.33,(C-l.y)*.33),u=new ke(B,$,S-B,T-$,void 0,void 0,J.curve),l=u,c=u.controls.left;break;case"a":R=l.x,k=l.y,D=parseFloat(d[0]),te=parseFloat(d[1]),ne=parseFloat(d[2]),A=parseFloat(d[3]),I=parseFloat(d[4]),B=parseFloat(d[5]),$=parseFloat(d[6]),o&&(B+=R,$+=k),L=new ke(B,$),L.command=J.arc,L.rx=D,L.ry=te,L.xAxisRotation=ne,L.largeArcFlag=A,L.sweepFlag=I,u=L,l=L,c=void 0;break}u&&(Array.isArray(u)?r=r.concat(u):r.push(u))})}n=new Te(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},G.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ht.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new jr(0,0,s);return o.stroke="none",o.fill="black",Ht.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new qr(0,0,s,o);return a.stroke="none",a.fill="black",Ht.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!G.isNaN(n)||!G.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new jn(0,0,s,o);return c.stroke="none",c.fill="black",Ht.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new Xr(0,0,s,o,c);return d.stroke="none",d.fill="black",Ht.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Gr(n,r,s,o).noFill();return Ht.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let m=0;m<t.children.length;m++){const g=t.children[m];let u=g.getAttribute("offset");/%/gi.test(u)&&(u=parseFloat(u.replace(/%/gi,""))/100),u=parseFloat(u);let p=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),y=g.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),h.push(new Hn(u,p,b))}const f=new He(s,o,a,l,h);return f.spread=r,f.units=n,Ht.call(this,t,f,e),f},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));G.isNaN(l)&&(l=s),G.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const f=[];for(let g=0;g<t.children.length;g++){const u=t.children[g];let p=u.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=u.getAttribute("stop-color"),y=u.getAttribute("stop-opacity"),_=u.getAttribute("style"),R;b===null&&(R=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=R&&R.length>1?R[1]:void 0),y===null?(R=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=R&&R.length>1?parseFloat(R[1]):1):y=parseFloat(y),f.push(new Hn(p,b,y))}const m=new We(s,o,a,f,l,c);return m.spread=r,m.units=n,Ht.call(this,t,m,e),m},text:function(t,e){const n=Pm(t.getAttribute("text-anchor"))||"left",r=Em(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new hn(s);return Ht.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Pt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Wr(r,s,o);return G.isNaN(a)||(c.width=a),G.isNaN(l)||(c.height=l),Ht.call(this,t,c,e),c}};function yc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var po=class Cn extends jn{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),x(this,"_flagTexture",!1),x(this,"_flagMode",!1),x(this,"_texture",null),x(this,"_mode","fill"),this._renderer.type="image";for(let l in _c)Object.defineProperty(this,l,_c[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Cn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Cn.Properties.length;n++){const r=Cn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Cn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case Cn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Cn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Cn.Modes.crop:break;case Cn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case Cn.Modes.stretch:default:e.scale=new Z(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};x(po,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),x(po,"Properties",["texture","mode"]);var bc=po,_c={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},yo=[],bo=Math.max,Om=Math.min,wc=Math.abs,Kr=Math.sin,Zr=Math.cos,zm=Math.acos,Qr=Math.sqrt,$e={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in $e?t:"path"},group:{renderChild:function(t){const e=$e.getRendererType(t._renderer.type);$e[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Jr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=$e.getRendererType(r._renderer.type);$e[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=$e.getRendererType(l._renderer.type);$e[c].render.call(l,t)}return o&&t.restore(),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,m,g,u,p,b,y,_,R,k,w,C,S,T,B,$,M,E,V,L,D,te,ne,A,I,j;if(j=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,D=this._mask,te=this._clip,l=this._opacity*(j||1),c=this._visible,!e&&(!c||te||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,m=this._closed,g=this._renderer.vertices,u=g.length,p=u-1,ne=Jr(r),I=this.dashes,ne||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),D){const ie=$e.getRendererType(D._renderer.type);$e[ie].render.call(D,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const ie=$e.getRendererType(a._renderer.type);$e[ie].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const ie=$e.getRendererType(s._renderer.type);$e[ie].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=dn(this)),f&&(t.miterLimit=f),h&&(t.lineJoin=h),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),I&&I.length>0&&(t.lineDashOffset=I.offset||0,t.setLineDash(I)),t.beginPath();let q,N,O,Y,re,de,oe;for(let ie=0;ie<u;ie++)switch(_=g[ie],V=_.x,L=_.y,_.command){case J.close:t.closePath();break;case J.arc:q=_.rx,N=_.ry,O=_.xAxisRotation,Y=_.largeArcFlag,re=_.sweepFlag,b=m?Mt(ie-1,u):bo(ie-1,0),y=g[b],de=y.x,oe=y.y,$e.renderSvgArcCommand(t,de,oe,q,N,Y,re,O,V,L);break;case J.curve:b=m?Mt(ie-1,u):Math.max(ie-1,0),y=g[b],B=y.controls&&y.controls.right||Z.zero,$=_.controls&&_.controls.left||Z.zero,y._relative?(S=B.x+y.x,T=B.y+y.y):(S=B.x,T=B.y),_._relative?(w=$.x+_.x,C=$.y+_.y):(w=$.x,C=$.y),t.bezierCurveTo(S,T,w,C,V,L),ie>=p&&m&&(R=k,M=_.controls&&_.controls.right||Z.zero,E=R.controls&&R.controls.left||Z.zero,_._relative?(S=M.x+_.x,T=M.y+_.y):(S=M.x,T=M.y),R._relative?(w=E.x+R.x,C=E.y+R.y):(w=E.x,C=E.y),V=R.x,L=R.y,t.bezierCurveTo(S,T,w,C,V,L));break;case J.line:t.lineTo(V,L);break;case J.move:k=_,t.moveTo(V,L);break}return m&&t.closePath(),!te&&!n&&($e.isHidden.test(a)||(A=a._renderer&&a._renderer.offset,A&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),A&&t.restore()),$e.isHidden.test(s)||(A=s._renderer&&s._renderer.offset,A&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),A&&t.restore())),ne||t.restore(),te&&!n&&t.clip(),I&&I.length>0&&t.setLineDash(yo),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,f,m,g,u,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,p=Jr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const w=$e.getRendererType(a._renderer.type);$e[w].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const w=$e.getRendererType(s._renderer.type);$e[w].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=dn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let R=d*.5,k;this._sizeAttenuation||(k=this.worldMatrix.elements,k=si(k[0],k[3],k[1],k[4],k[2],k[5]),R/=Math.max(k.scaleX,k.scaleY));for(let w=0;w<f;w++)m=h[w],g=m.x,u=m.y,t.moveTo(g+R,u),t.arc(g,u,R,0,ht);return n||($e.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),$e.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(yo),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!e&&(!o||l||s===0))return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,m=this._decoration,g=this._direction,u=Jr(c),p=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=$e.alignments[this._alignment]||this._alignment,_=$e.baselines[this._baseline]||this._baseline;let R,k,w,C,S,T,B,$,M,E,V;if(u||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const L=$e.getRendererType(a._renderer.type);$e[L].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=g,f)if(typeof f=="string")t.fillStyle=f;else{const L=$e.getRendererType(f._renderer.type);$e[L].render.call(f,t,this),t.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const L=$e.getRendererType(d._renderer.type);$e[L].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=dn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&($e.isHidden.test(f)||(f._renderer&&f._renderer.offset?(T=f._renderer.scale.x,B=f._renderer.scale.y,t.save(),t.translate(-f._renderer.offset.x,-f._renderer.offset.y),t.scale(T,B),R=this._size/f._renderer.scale.y,k=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,R+"px/",k+"px",this._family].join(" "),w=f._renderer.offset.x/f._renderer.scale.x,C=f._renderer.offset.y/f._renderer.scale.y,t.fillText(this.value,w,C),t.restore()):t.fillText(this.value,0,0)),$e.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,B=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,B),R=this._size/d._renderer.scale.y,k=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,R+"px/",k+"px",this._family].join(" "),w=d._renderer.offset.x/d._renderer.scale.x,C=d._renderer.offset.y/d._renderer.scale.y,S=h/d._renderer.scale.x,t.lineWidth=S,t.strokeText(this.value,w,C),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const L=t.measureText(this.value);let D=1;switch(m){case"underline":M=L.actualBoundingBoxDescent,V=L.actualBoundingBoxDescent;break;case"strikethrough":M=0,V=0,D=.5;break}switch(_){case"top":M+=this._size*D,V+=this._size*D;break;case"baseline":case"bottom":M-=this._size*D,V-=this._size*D;break}switch(y){case"left":case"start":$=0,E=L.width;break;case"right":case"end":$=-L.width,E=0;break;default:$=-L.width/2,E=L.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,M),t.lineTo(E,V),t.stroke()}return u||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(yo),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof 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)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=wc(r),s=wc(s);const h=(e-c)/2,f=(n-d)/2,m=Zr(l)*h+Kr(l)*f,g=-Kr(l)*h+Zr(l)*f,u=m*m,p=g*g;let b=r*r,y=s*s;const _=u/b+p/y;if(_>1){const L=Qr(_);r=L*r,s=L*s,b=r*r,y=s*s}const R=b*p+y*u,k=(b*y-R)/R;let w=Qr(bo(0,k));o===a&&(w=-w);const C=w*r*g/s,S=-w*s*m/r,T=Zr(l)*C-Kr(l)*S+(e+c)/2,B=Kr(l)*C+Zr(l)*S+(n+d)/2,$=xc(1,0,(m-C)/r,(g-S)/s),M=xc((m-C)/r,(g-S)/s,(-m-C)/r,(-g-S)/s)%ht,E=$+M;Lm(t,T,B,r,s,$,E,a===0,l)}},ft=class extends X{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new st,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Us(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&G.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(X.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),$e.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};x(ft,"Utils",$e);function Lm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Vi.Tolerance.epsilon,f=Math.abs(d)<h;let m=Mt(d,ht);m<h&&(f?m=0:m=ht),l===!0&&!f&&(m===ht?m=-ht:m=m-ht);for(let g=0;g<vt.Resolution;g++){const u=g/(vt.Resolution-1),p=o+u*m;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),R=Math.sin(c),k=b-e,w=y-n;b=k*_-w*R+e,y=k*R+w*_+n}t.lineTo(b,y)}}function xc(t,e,n,r){const s=t*n+e*r,o=Qr(t*t+e*e)*Qr(n*n+r*r);let a=zm(bo(-1,Om(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Jr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ae={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(ae.ns,n);return n==="svg"&&(e=G.defaults(e||{},{version:ae.version})),e&&Object.keys(e).length>0&&ae.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(ae.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?Mt(a-1,n):Math.max(a-1,0),d=t[c];let h,f,m,g,u,p,b,y,_,R,k,w,C,S,T,B=Ae(l.x),$=Ae(l.y);switch(l.command){case J.close:h=J.close;break;case J.arc:k=l.rx,w=l.ry,C=l.xAxisRotation,S=l.largeArcFlag,T=l.sweepFlag,h=J.arc+" "+k+" "+w+" "+C+" "+S+" "+T+" "+B+" "+$;break;case J.curve:b=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(m=Ae(b.x+d.x),g=Ae(b.y+d.y)):(m=Ae(b.x),g=Ae(b.y)),l.relative?(u=Ae(y.x+l.x),p=Ae(y.y+l.y)):(u=Ae(y.x),p=Ae(y.y)),h=(a===0?J.move:J.curve)+" "+m+" "+g+" "+u+" "+p+" "+B+" "+$;break;case J.move:s=l,h=J.move+" "+B+" "+$;break;default:h=l.command+" "+B+" "+$}a>=r&&e&&(l.command===J.curve&&(f=s,_=l.controls&&l.controls.right||l,R=f.controls&&f.controls.left||f,l.relative?(m=Ae(_.x+l.x),g=Ae(_.y+l.y)):(m=Ae(_.x),g=Ae(_.y)),f.relative?(u=Ae(R.x+f.x),p=Ae(R.y+f.y)):(u=Ae(R.x),p=Ae(R.y)),B=Ae(f.x),$=Ae(f.y),h+=" C "+m+" "+g+" "+u+" "+p+" "+B+" "+$),l.command!==J.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=J.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=ae.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in ae?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=ae.getRendererType(t._renderer.type);ae[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ae.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=ae.getRendererType(s._renderer.type);ae[o].render.call(s,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(ae.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(ae.group.removeChild,n),this._flagOrder&&this.children.forEach(ae.group.orderChild,n),this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=ae.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=dn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=si(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=ae.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=dn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("path",e),t.appendChild(this._renderer.elem)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=ae.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ae.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ae.getRendererType(this._fill._renderer.type);ae[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ae.getRendererType(this._stroke._renderer.type);ae[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=dn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ae.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ae.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ae.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=ae.getRendererType(this._mask._renderer.type);ae[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?ae.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ae.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?ae.setAttributes(o._renderer.elem,a):o._renderer.elem=ae.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof 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),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?ae.setAttributes(this._renderer.image,r):this._renderer.image=ae.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&ae.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=ae.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},vc=class extends X{constructor(t){super(),this.domElement=t.domElement||ae.createElement("svg"),this.scene=new st,this.scene.parent=this,this.defs=ae.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,ae.setAttributes(this.domElement,{width:t,height:e}),this.trigger(X.Types.resize,t,e)}render(){return ae.group.render.call(this.scene,this.domElement),ae.defs.update(this.domElement),this}};x(vc,"Utils",ae);var Wt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new Pt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
41
41
|
precision mediump float;
|
|
42
42
|
attribute vec2 a_position;
|
|
43
43
|
|
|
@@ -100,30 +100,30 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},es=zi.Multiply,Lm=[1,0,0,0,1,0,0,0,1],qn=new cn(9),Dm=ft.Utils,kc=new K,_o=new cn([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:De.document?De.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new zi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)_e.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K),this._scale instanceof K?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ft.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)_e.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ft.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,f,m,g,u,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,R=t.renderer.ratio,k=kc.copy(e._renderer.scale).multiply(R),w=e._stroke,C=e._linewidth,S=e._fill,T=e._renderer.opacity||e._opacity,B=e._cap,$=e._join,M=e._miter,E=e._closed,V=e.dashes,L=b.length,D=L-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*k.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*k.y),1);const te=e._renderer.rect.centroid,ne=te.x,A=te.y;if(_.clearRect(0,0,y.width,y.height),S)if(typeof S=="string")_.fillStyle=S;else{const oe=ft.Utils.getRendererType(S._renderer.type);_e[oe].render.call(S,_,e),_.fillStyle=S._renderer.effect}if(w){if(typeof w=="string")_.strokeStyle=w;else{const oe=ft.Utils.getRendererType(w._renderer.type);_e[oe].render.call(w,_,e),_.strokeStyle=w._renderer.effect}C&&(_.lineWidth=dn(e)),M&&(_.miterLimit=M),$&&(_.lineJoin=$),!E&&B&&(_.lineCap=B)}typeof T=="number"&&(_.globalAlpha=T),V&&V.length>0&&(_.lineDashOffset=V.offset||0,_.setLineDash(V));let I,j,q,N,O,Y,re,de;_.save(),_.scale(k.x,k.y),_.translate(ne,A),_.beginPath();for(let oe=0;oe<b.length;oe++){const ie=b[oe];switch(g=ie.x,u=ie.y,ie.command){case J.close:_.closePath();break;case J.arc:j=ie.rx,q=ie.ry,N=ie.xAxisRotation,O=ie.largeArcFlag,Y=ie.sweepFlag,n=E?Mt(oe-1,L):Math.max(oe-1,0),r=b[n],re=r.x,de=r.y,Dm.renderSvgArcCommand(_,re,de,j,q,O,Y,N,g,u);break;case J.curve:n=E?Mt(oe-1,L):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||K.zero,h=ie.controls&&ie.controls.left||K.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ie._relative?(o=h.x+ie.x,a=h.y+ie.y):(o=h.x,a=h.y),_.bezierCurveTo(l,c,o,a,g,u),oe>=D&&E&&(s=I,f=ie.controls&&ie.controls.right||K.zero,m=s.controls&&s.controls.left||K.zero,ie._relative?(l=f.x+ie.x,c=f.y+ie.y):(l=f.x,c=f.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,u=s.y,_.bezierCurveTo(l,c,o,a,g,u));break;case J.line:_.lineTo(g,u);break;case J.move:I=ie,_.moveTo(g,u);break}}E&&_.closePath(),_e.isHidden.test(S)||(p=S._renderer&&S._renderer.offset,p&&(_.save(),_.translate(-S._renderer.offset.x,-S._renderer.offset.y),_.scale(S._renderer.scale.x,S._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y),_.lineWidth=C/w._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const h=d.x,f=d.y,m=d.controls;let g,u,p,b,y,_;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(g=d._relative?y.x+h:y.x,u=d._relative?y.y+f:y.y,p=d._relative?_.x+h:_.x,b=d._relative?_.y+f:_.y,!(!g||!u||!p||!b)&&(o=Math.min(u,b,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(u,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(t,e,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ft.Utils.getRendererType(this._renderer.type),o=e[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K);let f,m;this._scale instanceof K?(f=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=m<0?-m:m,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const f=ft.Utils.getRendererType(this._mask._renderer.type);_e[f].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,_o,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._size*o;let m=f;_e.isHidden.test(a)||(m+=l),r.width=ul(m),r.height=r.width;const g=m/r.width,u=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ft.Utils.getRendererType(c._renderer.type);_e[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ft.Utils.getRendererType(a._renderer.type);_e[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=dn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(u,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,f/g*.5,0,ht),s.restore(),closed&&s.closePath(),_e.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),_e.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,u=this._flagVertices,p=this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||f){this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K);let b,y;this._scale instanceof K?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=s)}if(u){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=kc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._decoration,m=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const g=e._renderer.rect.centroid,u=g.x,p=g.y;let b,y,_,R,k,w,C,S,T,B,$;const M=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),M||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=m,c)if(typeof c=="string")r.fillStyle=c;else{const E=ft.Utils.getRendererType(c._renderer.type);_e[E].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const E=ft.Utils.getRendererType(a._renderer.type);_e[E].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=dn(e))}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(u,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(w=c._renderer.scale.x,C=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(w,C),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,R=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,R),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(w=a._renderer.scale.x,C=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(w,C),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,R=a._renderer.offset.y/a._renderer.scale.y,k=l/a._renderer.scale.x,r.lineWidth=k,r.strokeText(e.value,_,R),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const E=r.measureText(e.value);switch(f){case"underline":T=E.actualBoundingBoxDescent,$=E.actualBoundingBoxDescent;break;case"strikethrough":T=0,$=0;break}S=-E.width/2,B=E.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(S,T),r.lineTo(B,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=_e.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ft.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[t._alignment]||t._alignment){case _e.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case _e.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K);let h,f;this._scale instanceof K?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ft.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,_o,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof K||(this._renderer.offset=new K),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof K?(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 K||(this._renderer.scale=new K);let r,s;this._scale instanceof K?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ft.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(_e,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),G.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new Pt("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];e[s]=_e.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new zr};_e.ctx=_e.canvas.getContext("2d");var Cc=class extends X{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(_e.canvas=t.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new st,this.scene.parent=this,this._renderer={type:"renderer",matrix:new cn(Lm),scale:1,opacity:1},this._flagMatrix=!0,t=G.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new Pt("unable to create a webgl context. Try using another renderer.");r=Wt.create(e,Wt.path.vertex,Wt.types.vertex),s=Wt.create(e,Wt.path.fragment,Wt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=_e.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,_o,e.STATIC_DRAW),r=Wt.create(e,Wt.points.vertex,Wt.types.vertex),s=Wt.create(e,Wt.points.fragment,Wt.types.fragment),n=this.programs.points=_e.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Us(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,G.isObject(this.domElement.style)&&G.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(X.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};x(Cc,"Utils",_e);var Hm=G.extend({Error:Pt,getRatio:Us,read:ze,xhr:yc},G,xt,ll,cl),xe=class Ar{constructor(e){x(this,"_events",new X),x(this,"type",""),x(this,"renderer",null),x(this,"scene",null),x(this,"width",0),x(this,"height",0),x(this,"frameCount",0),x(this,"timeDelta",0),x(this,"playing",!1);const n=G.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Ar.Types.svg,autostart:!1});if(G.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),G.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Ar.Types[r])}this.renderer=new Ar[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Wm.bind(this),this.fit.domElement=window,this.fit.attached=!0,G.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),G.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Vt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=jm.bind(this),G.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(X.Types.resize,qm.bind(this)),this.scene=this.renderer.scene,Ar.Instances.push(this),n.autostart&&hr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,hr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=G.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Vt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(X.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(X.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,n,r,s){const o=new Gr(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ke(e,n,void 0,void 0,void 0,void 0,J.move),new ke(r,s,void 0,void 0,void 0,void 0,J.line),new ke(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,J.line),new ke(r,s,void 0,void 0,void 0,void 0,J.move),new ke(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,J.line)],d=new Te(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new jn(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Xr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new jr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new qr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new co(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ke(l,c))}}const r=arguments[n-1],s=new Te(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new lo(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new no(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new K(a,l))}}const s=new ao(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ke(c,d))}}const s=arguments[n-1],o=new Te(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new hn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new He(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new We(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Wr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new bc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new go(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Me(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new st;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof st?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new st;let s,o,a;const l=(function(c){for(Vt.temp.innerHTML=c,o=0;o<Vt.temp.children.length;o++)s=Vt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Vt.temp.children.length<=1?Vt.temp.children[0]:Vt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(yc(e,l),r):(l(e),r)}};x(xe,"NextFrameId",vt.NextFrameId),x(xe,"Types",vt.Types),x(xe,"Version",vt.Version),x(xe,"PublishDate",vt.PublishDate),x(xe,"Identifier",vt.Identifier),x(xe,"Resolution",vt.Resolution),x(xe,"AutoCalculateImportedMatrices",vt.AutoCalculateImportedMatrices),x(xe,"Instances",vt.Instances),x(xe,"uniqueId",vt.uniqueId),x(xe,"Anchor",ke),x(xe,"Collection",Dn),x(xe,"Events",X),x(xe,"Group",st),x(xe,"Matrix",zi),x(xe,"Path",Te),x(xe,"Registry",zr),x(xe,"Element",Oi),x(xe,"Shape",Wn),x(xe,"Text",hn),x(xe,"Vector",K),x(xe,"Gradient",et),x(xe,"Image",bc),x(xe,"ImageSequence",go),x(xe,"LinearGradient",He),x(xe,"RadialGradient",We),x(xe,"Sprite",Wr),x(xe,"Stop",Hn),x(xe,"Texture",Me),x(xe,"ArcSegment",no),x(xe,"Circle",jr),x(xe,"Ellipse",qr),x(xe,"Line",Gr),x(xe,"Points",ao),x(xe,"Polygon",lo),x(xe,"Rectangle",jn),x(xe,"RoundedRectangle",Xr),x(xe,"Star",co),x(xe,"CanvasRenderer",ft),x(xe,"SVGRenderer",vc),x(xe,"WebGLRenderer",Cc),x(xe,"Commands",J),x(xe,"Utils",Hm);var fn=xe;function Wm(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function jm(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function qm(t,e){this.width=t,this.height=e,this.trigger(X.Types.resize,t,e)}var hr=Vt.getRequestAnimationFrame();function Sc(){for(let t=0;t<fn.Instances.length;t++){const e=fn.Instances[t];e.playing&&e.update()}fn.NextFrameId=hr(Sc)}hr.init=function(){Sc(),hr.init=function(){}};let gn;typeof window<"u"?gn=window:typeof global<"u"?gn=global:typeof self<"u"&&(gn=self);let Bc;const ai=Math.PI*2,ot=Math.PI*.5;function Xm(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Ym(t){Bc=t}function Um(t,e){e=e&&e.identity()||new Bc;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function jt(t,e,n){return n*(e-t)+t}function Hi(t,e){for(;t<0;)t+=e;return t%e}const Tc=gn.Float32Array||Array,Gm=Math.floor;function mn(t){return Gm(t*1e6)/1e6}const ge={move:"M",line:"L",curve:"C",close:"Z"};class U{constructor(){v(this,"_events",{});v(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}}v(U,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),v(U,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Rc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(U.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(U.Types.change))}}},lt=class lt extends U{constructor(n=0,r=0){super();v(this,"_x",0);v(this,"_y",0);for(let s in Rc)Object.defineProperty(this,s,Rc[s]);this.x=n,this.y=r}static add(n,r){return new lt(n.x+r.x,n.y+r.y)}static sub(n,r){return new lt(n.x-r.x,n.y-r.y)}static subtract(n,r){return lt.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(lt.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new lt(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:mn(this.x),y:mn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};v(lt,"zero",new lt),v(lt,"left",new lt(-1,0)),v(lt,"right",new lt(1,0)),v(lt,"up",new lt(0,-1)),v(lt,"down",new lt(0,1));let pe=lt;class Pe extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=ge.move){super(n,r);v(this,"controls",{left:new pe,right:new pe});v(this,"_command",ge.move);v(this,"_relative",!0);v(this,"_rx",0);v(this,"_ry",0);v(this,"_xAxisRotation",0);v(this,"_largeArcFlag",0);v(this,"_sweepFlag",1);for(let h in $c)Object.defineProperty(this,h,$c[h]);this.command=c,this.relative=!0;const d=Pe.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(U.Types.change,d),this.controls.right.set(a,l).addEventListener(U.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(U.Types.change)}}static fromObject(n){return new Pe().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Pe().copy(this)}toObject(){return{x:mn(this.x),y:mn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:mn(this.rx),ry:mn(this.ry),xAxisRotation:mn(this.xAxisRotation),largeArcFlag:mn(this.largeArcFlag),sweepFlag:mn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const $c={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(U.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(U.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(U.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(U.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(U.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}}};let Km=0;const wo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Km++}},ts={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ns(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Pc(t,e,n,r,s,o,a,l,c){c=c||ts.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Pe(a,l)];const h=[];for(let f=0;f<d;f++){const m=f/d,g=ns(m,t,n,s,a),u=ns(m,e,r,o,l);h.push(new Pe(g,u))}return h}function Zm(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(m*b+g)*b+u;return Math.sqrt(y*y+_*_)}return Jm(p,0,1,c||ts.RecursionLimit)}function Qm(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,m,g,u,p,b,y;for(let w=0;w<2;++w){if(w===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;g=-m/f,0<g&&g<1&&c.push(g);continue}b=f*f-4*m*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,R=_,k;for(;_--;)g=c[_],k=1-g,d[0][_]=k*k*k*t+3*k*k*g*n+3*k*g*g*s+g*g*g*a,d[1][_]=k*k*k*e+3*k*k*g*r+3*k*g*g*o+g*g*g*l;return d[0][R]=t,d[1][R]=e,d[0][R+1]=a,d[1][R+1]=l,d[0].length=d[1].length=R+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 Jm(t,e,n,r){let s=ts.abscissas[r-2],o=ts.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function ep(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Hi(s-1,n):Math.max(s-1,0),l=e?Hi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];tp(c,d,h),d.command=s===0?ge.move:ge.curve}}function tp(t,e,n){const r=pe.angleBetween(t,e),s=pe.angleBetween(n,e);let o=pe.distanceBetween(t,e),a=pe.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=ot:l-=ot,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let ur=(ki=class extends U{constructor(){super();v(this,"_flagId",!1);v(this,"_flagClassName",!1);v(this,"_renderer",{});v(this,"_id",wo.Identifier+wo.uniqueId());v(this,"_className","");v(this,"classList",[]);for(let n in Ec)Object.defineProperty(this,n,Ec[n])}static fromObject(n){const r=new ki().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},v(ki,"Properties",["renderer","id","className"]),ki);const Ec={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class is extends Error{constructor(n){super();v(this,"name","Two.js");v(this,"message");this.message=n}}class np{constructor(){v(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let rs;const Nc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};gn.document&&(rs=document.createElement("a"));const qe=class qe extends ur{constructor(n,r){super();v(this,"_flagSrc",!1);v(this,"_flagImage",!1);v(this,"_flagVideo",!1);v(this,"_flagLoaded",!1);v(this,"_flagRepeat",!1);v(this,"_flagOffset",!1);v(this,"_flagScale",!1);v(this,"_src","");v(this,"_image",null);v(this,"_loaded",!1);v(this,"_repeat","no-repeat");v(this,"_scale",1);v(this,"_offset",null);for(let s in Fc)Object.defineProperty(this,s,Fc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=ip.bind(this),this._renderer.flagScale=rp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const s=(function(){this.unbind(U.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(U.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new qe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return rs?(rs.href=n,rs.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=qe.getAbsoluteURL(n);if(qe.ImageRegistry.contains(r))return qe.ImageRegistry.get(r);let s;return gn.document?Nc.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=qe.getTag(s);n._flagImage&&(/canvas/i.test(o)?qe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,qe.Register[o](n,r))),n._flagSrc&&(s||(s=qe.getImage(n.src),n.image=s),o=qe.getTag(s),qe.Register[o](n,r))}clone(){const n=new qe(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof pe?n.offset:new pe().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(U.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,qe.load(this,(function(){this.loaded=!0,this.trigger(U.Types.change).trigger(U.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};v(qe,"Properties",["src","loaded","repeat","scale","offset","image"]),v(qe,"RegularExpressions",Nc),v(qe,"ImageRegistry",new np),v(qe,"Register",{canvas:function(n,r){n._src="#"+n.id,qe.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new is("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=qe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),qe.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new is("unable to load "+n.src)};n._src=qe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),qe.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let je=qe;const Fc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=je.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}je.ImageRegistry.contains(n)?this._image=je.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(U.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(U.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(U.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(U.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function ip(){this._flagOffset=!0}function rp(){this._flagScale=!0}class li extends Array{constructor(){super();Da(this,ct,new U);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Rt(this,ct)}set _events(n){Lu(this,ct,n)}get _bound(){return Rt(this,ct)._bound}set _bound(n){Rt(this,ct)._bound=n}addEventListener(){return Rt(this,ct).addEventListener.apply(this,arguments)}on(){return Rt(this,ct).on.apply(this,arguments)}bind(){return Rt(this,ct).bind.apply(this,arguments)}removeEventListener(){return Rt(this,ct).removeEventListener.apply(this,arguments)}off(){return Rt(this,ct).off.apply(this,arguments)}unbind(){return Rt(this,ct).unbind.apply(this,arguments)}dispatchEvent(){return Rt(this,ct).dispatchEvent.apply(this,arguments)}trigger(){return Rt(this,ct).trigger.apply(this,arguments)}listen(){return Rt(this,ct).listen.apply(this,arguments)}ignore(){return Rt(this,ct).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(U.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(U.Types.insert,r),this.trigger(U.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(U.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(U.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}ct=new WeakMap;const Ac=Array.prototype.slice;function sp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Ee={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!sp(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:gn.performance&&gn.performance.now?gn.performance:Date},Nt=class Nt extends ur{constructor(n,r,s){super();v(this,"_flagOffset",!0);v(this,"_flagOpacity",!0);v(this,"_flagColor",!0);v(this,"_offset",0);v(this,"_opacity",1);v(this,"_color","#fff");for(let o in Mc)Object.defineProperty(this,o,Mc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Nt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Nt.Index<=0?"#fff":"#000",Nt.Index=(Nt.Index+1)%2}static fromObject(n){const r=new Nt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nt.Properties.length;r++){const s=Nt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Nt;return Ee.each(Nt.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Ee.each(Nt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};v(Nt,"Index",0),v(Nt,"Properties",["offset","opacity","color"]);let ci=Nt;const Mc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},wn=class wn extends ur{constructor(n){super();v(this,"_flagStops",!1);v(this,"_flagSpread",!1);v(this,"_flagUnits",!1);v(this,"_spread","");v(this,"_units","");for(let r in Vc)Object.defineProperty(this,r,Vc[r]);this._renderer.type="gradient",this._renderer.flagStops=op.bind(this),this._renderer.bindStops=ap.bind(this),this._renderer.unbindStops=lp.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof ci?o:new ci().copy(o)));const s=new wn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new wn(r);return Ee.each(wn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ee.each(wn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};v(wn,"Stop",ci),v(wn,"Properties",["spread","stops","units"]);let tt=wn;const Vc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._stops=new li((t||[]).slice(0)),this._stops.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._stops)}}};function op(){this._flagStops=!0}function ap(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function lp(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const Zn=class Zn extends tt{constructor(n,r,s,o,a){super(a);v(this,"_flagEndPoints",!1);v(this,"_left",null);v(this,"_right",null);for(let l in Ic)Object.defineProperty(this,l,Ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=cp.bind(this),this.left=new pe,this.right=new pe,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new Zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Zn.Properties.length;r++){const s=Zn.Properties[r];s in n&&(this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Zn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ee.each(tt.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};v(Zn,"Stop",ci),v(Zn,"Properties",["left","right"]);let kt=Zn;const Ic={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(U.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof pe&&this._right.unbind(U.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function cp(){this._flagEndPoints=!0}const xn=class xn extends tt{constructor(n,r,s,o,a,l){super(o);v(this,"_flagRadius",!1);v(this,"_flagCenter",!1);v(this,"_flagFocal",!1);v(this,"_radius",0);v(this,"_center",null);v(this,"_focal",null);for(let c in Oc)Object.defineProperty(this,c,Oc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=dp.bind(this),this._renderer.flagFocal=hp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new xn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ee.each(tt.Properties.concat(xn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ee.each(xn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};v(xn,"Stop",ci),v(xn,"Properties",["center","radius","focal"]);let Ct=xn;const Oc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(U.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(U.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(U.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(U.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function dp(){this._flagCenter=!0}function hp(){this._flagFocal=!0}function zc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function ss(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Lc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Zm(r,l,s,c,o,d,a,h,n)}function Dc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Pc(r,l,s,c,o,d,a,h,n)}function di(t){switch(t.renderer.type){case"texture":return je.fromObject(t);case"gradient":return tt.fromObject(t);case"linear-gradient":return kt.fromObject(t);case"radial-gradient":return Ct.fromObject(t)}return t}const up=Math.cos,fp=Math.sin,Hc=Math.tan,xo=[],Bt=class Bt extends U{constructor(n,r,s,o,a,l){super();v(this,"elements",new Tc(9));v(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const S=n;let T,B,$;const M=r[0]||0,E=r[1]||0,V=r[2]||0;return T=S[0]*M+S[1]*E+S[2]*V,B=S[3]*M+S[4]*E+S[5]*V,$=S[6]*M+S[7]*E+S[8]*V,[T,B,$]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],m=n[7],g=n[8],u=r[0],p=r[1],b=r[2],y=r[3],_=r[4],R=r[5],k=r[6],w=r[7],C=r[8];return s=s||new Tc(9),s[0]=o*u+a*y+l*k,s[1]=o*p+a*_+l*w,s[2]=o*b+a*R+l*C,s[3]=c*u+d*y+h*k,s[4]=c*p+d*_+h*w,s[5]=c*b+d*R+h*C,s[6]=f*u+m*y+g*k,s[7]=f*p+m*_+g*w,s[8]=f*b+m*R+g*C,s}static fromObject(n){return new Bt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(U.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(U.Types.change)}identity(){return this.elements[0]=Bt.Identity[0],this.elements[1]=Bt.Identity[1],this.elements[2]=Bt.Identity[2],this.elements[3]=Bt.Identity[3],this.elements[4]=Bt.Identity[4],this.elements[5]=Bt.Identity[5],this.elements[6]=Bt.Identity[6],this.elements[7]=Bt.Identity[7],this.elements[8]=Bt.Identity[8],this.trigger(U.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(U.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const D=a[0]*n+a[1]*r+a[2]*s,te=a[3]*n+a[4]*r+a[5]*s,ne=a[6]*n+a[7]*r+a[8]*s;return[D,te,ne]}const f=this.elements,m=[n,r,s,o,a,l,c,d,h],g=f[0],u=f[1],p=f[2],b=f[3],y=f[4],_=f[5],R=f[6],k=f[7],w=f[8],C=m[0],S=m[1],T=m[2],B=m[3],$=m[4],M=m[5],E=m[6],V=m[7],L=m[8];return this.elements[0]=g*C+u*B+p*E,this.elements[1]=g*S+u*$+p*V,this.elements[2]=g*T+u*M+p*L,this.elements[3]=b*C+y*B+_*E,this.elements[4]=b*S+y*$+_*V,this.elements[5]=b*T+y*M+_*L,this.elements[6]=R*C+k*B+w*E,this.elements[7]=R*S+k*$+w*V,this.elements[8]=R*T+k*M+w*L,this.trigger(U.Types.change)}inverse(n){const r=this.elements;n=n||new Bt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],m=r[8],g=m*c-d*f,u=-m*l+d*h,p=f*l-c*h;let b=s*g+o*u+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-m*o+a*f)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=u*b,n.elements[4]=(m*s-a*h)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-f*s+o*h)*b,n.elements[8]=(c*s-o*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=up(n),s=fp(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=Hc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Hc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return xo.length=0,this.toTransformArray(n,xo),xo.map(mn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const m=s[6],g=s[7],u=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=h,r[5]=g,r[6]=c,r[7]=f,r[8]=u;return}return[a,d,m,l,h,g,c,f,u]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const m=s[6],g=s[7],u=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=m,r[7]=g,r[8]=u;return}return[a,l,c,d,h,f,m,g,u]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Bt().copy(this)}};v(Bt,"Identity",[1,0,0,0,1,0,0,0,1]);let fr=Bt;Ym(fr);const Pr=class Pr extends ur{constructor(){super();v(this,"_flagMatrix",!0);v(this,"_flagScale",!1);v(this,"_matrix",null);v(this,"_worldMatrix",null);v(this,"_position",null);v(this,"_rotation",0);v(this,"_scale",1);v(this,"_skewX",0);v(this,"_skewY",0);for(let n in os)Object.defineProperty(this,n,os[n]);this._renderer.flagMatrix=Wc.bind(this),this.isShape=!0,this.matrix=new fr,this.worldMatrix=new fr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Pr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return os.position.get.apply(this,arguments)}set translation(n){os.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof pe?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new Pr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof pe?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof pe?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};v(Pr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Bn=Pr;const os={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(U.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(U.Types.change,this._renderer.flagMatrix),Wc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(U.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(U.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Um(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Wc(){this._flagMatrix=!0}const Wi=Math.min,ji=Math.max,gp=Math.ceil,mp=Math.floor,pp=new pe,Jt=class Jt extends Bn{constructor(n,r,s,o){super();v(this,"_flagVertices",!0);v(this,"_flagLength",!0);v(this,"_flagFill",!0);v(this,"_flagStroke",!0);v(this,"_flagLinewidth",!0);v(this,"_flagOpacity",!0);v(this,"_flagVisible",!0);v(this,"_flagCap",!0);v(this,"_flagJoin",!0);v(this,"_flagMiter",!0);v(this,"_flagStrokeAttenuation",!0);v(this,"_flagMask",!1);v(this,"_flagClip",!1);v(this,"_length",0);v(this,"_fill","#fff");v(this,"_stroke","#000");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_cap","round");v(this,"_join","round");v(this,"_miter",4);v(this,"_closed",!0);v(this,"_curved",!1);v(this,"_automatic",!0);v(this,"_beginning",0);v(this,"_ending",1);v(this,"_mask",null);v(this,"_clip",!1);v(this,"_dashes",null);v(this,"_strokeAttenuation",!0);for(let a in jc)Object.defineProperty(this,a,jc[a]);this._renderer.type="path",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Gc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:di(n.fill),s=typeof n.stroke=="string"?n.stroke:di(n.stroke),o=new Jt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Pe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Pe().copy(s))}}for(let r=0;r<Jt.Properties.length;r++){const s=Jt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Jt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Jt.Properties.length;s++){const o=Jt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Ee.each(Jt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,f=1/0,m=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:u}=Xm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof u=="number"&&(s=Math.max(g,u)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[g,u]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[R,k]=r.multiply(y,_),w=c.controls.left.x,C=c.controls.left.y;c.relative&&(w+=c.x,C+=c.y);let[S,T]=r.multiply(w,C);const B=Qm(g,u,R,k,S,T,p,b);f=Wi(B.min.y-s,f),d=Wi(B.min.x-s,d),h=ji(B.max.x+s,h),m=ji(B.max.y+s,m)}else a<=1&&(f=Wi(u-s,f),d=Wi(g-s,d),h=ji(g+s,h),m=ji(u+s,m)),f=Wi(b-s,f),d=Wi(p-s,d),h=ji(p+s,h),m=ji(b+s,m)}return{top:f,left:d,right:h,bottom:m,width:h-d,height:m-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,m,g,u,p,b,y,_,R=this.length*Math.min(Math.max(n,0),1);const k=this.vertices.length,w=k-1;let C=null,S=null;for(let A=0,I=this._lengths.length,j=0;A<I;A++){if(j+this._lengths[A]>=R){this._closed?(s=Hi(A,k),o=Hi(A-1,k),A===0&&(s=o,o=A)):(s=A,o=Math.min(Math.max(A-1,0),w)),C=this.vertices[s],S=this.vertices[o],R-=j,this._lengths[A]!==0?n=R/this._lengths[A]:n=0;break}j+=this._lengths[A]}if(C===null||S===null)return null;if(C){if(!S)return C}else return S;_=S.controls&&S.controls.right,y=C.controls&&C.controls.left,c=S.x,g=S.y,d=(_||S).x,u=(_||S).y,h=(y||C).x,p=(y||C).y,f=C.x,b=C.y,_&&S.relative&&(d+=S.x,u+=S.y),y&&C.relative&&(h+=C.x,p+=C.y),l=ns(n,c,d,h,f),m=ns(n,g,u,p,b);const T=jt(c,d,n),B=jt(g,u,n),$=jt(d,h,n),M=jt(u,p,n),E=jt(h,f,n),V=jt(p,b,n),L=jt(T,$,n),D=jt(B,M,n),te=jt($,E,n),ne=jt(M,V,n);return Ee.isObject(r)?(r.x=l,r.y=m,r instanceof Pe&&(r.controls.left.x=L,r.controls.left.y=D,r.controls.right.x=te,r.controls.right.y=ne,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=m,r.controls.right.x-=l,r.controls.right.y-=m)),r.t=n,r):(a=new Pe(l,m,L-l,D-m,te-l,ne-m,this._curved?ge.curve:ge.line),a.t=n,a)}plot(){if(this.curved)return ep(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?ge.move:ge.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===ge.close;let o=this.vertices[r],a=[],l;return Ee.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===ge.move){a.push(new Pe(o.x,o.y)),d>0&&(a[a.length-1].command=ge.line),o=c;return}l=Dc(c,o,n),a=a.concat(l),Ee.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Dc(c,o,n),a=a.concat(l),Ee.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line})),a.push(new Pe(c.x,c.y)),a[a.length-1].command=s?ge.close:ge.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Ee.each(this.vertices,function(c,d){if(d<=0||c.command===ge.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Lc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=ss(this,s*this._length),l=ss(this,o*this._length),c=gp(a),d=mp(l);let h,f,m,g,u,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Pe),p>d&&!f?(u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,u),u.command=this._renderer.collection[p].command,this._renderer.vertices.push(u),f=u,m=this._collection[p-1],m&&m.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(pe.zero,1-u.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-u.t))):p>=c&&p<=d&&(u=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(u),p===d&&zc(this,o)?(f=u,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):p===c&&zc(this,s)&&(h=u,h.command=ge.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,u),u.command=ge.move,this._renderer.vertices.unshift(u),g=this._collection[p+1],g&&g.controls&&(u.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(pe.zero,u.t):(pp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,u.t))))}return Bn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Bn.prototype.flagReset.call(this),this}};v(Jt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),v(Jt,"Utils",{getCurveLength:Lc});let Ne=Jt;const jc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Ee.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof li?this._collection=t:this._collection=new li(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ee.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function qc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Xc(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Yc(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Uc(){this._flagFill=!0}function Gc(){this._flagStroke=!0}const yp=Math.ceil,bp=Math.floor,vn=class vn extends Bn{constructor(n){super();v(this,"_flagVertices",!0);v(this,"_flagLength",!0);v(this,"_flagFill",!0);v(this,"_flagStroke",!0);v(this,"_flagLinewidth",!0);v(this,"_flagOpacity",!0);v(this,"_flagVisible",!0);v(this,"_flagSize",!0);v(this,"_flagSizeAttenuation",!0);v(this,"_flagStrokeAttenuation",!0);v(this,"_length",0);v(this,"_fill","#fff");v(this,"_stroke","#000");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_size",1);v(this,"_sizeAttenuation",!1);v(this,"_beginning",0);v(this,"_ending",1);v(this,"_dashes",null);v(this,"_strokeAttenuation",!0);v(this,"noFill",Ne.prototype.noFill);v(this,"noStroke",Ne.prototype.noStroke);v(this,"corner",Ne.prototype.corner);v(this,"center",Ne.prototype.center);v(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);v(this,"_updateLength",Ne.prototype._updateLength);for(let r in Kc)Object.defineProperty(this,r,Kc[r]);this._renderer.type="points",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Gc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:di(n.fill),s=typeof n.stroke=="string"?n.stroke:di(n.stroke),o=new vn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Pe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Pe().copy(s))}for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new vn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<vn.Properties.length;s++){const o=vn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Ee.each(vn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,f=Pc(l,c,l,c,d,h,d,h,n);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=ss(this,n*this._length),o=ss(this,r*this._length),a=yp(s),l=bp(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};v(vn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let as=vn;const Kc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof li?this._collection=t:this._collection=new li(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class Zc extends li{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Da(this,As,{});this.attach(n),this.on(U.Types.insert,this.attach),this.on(U.Types.remove,this.detach)}get ids(){return Rt(this,As)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}As=new WeakMap;const En=class En extends Ne{constructor(n,r,s,o,a,l,c){const d=c||wo.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Pe);super(h,!0,!1,!0);v(this,"_flagStartAngle",!1);v(this,"_flagEndAngle",!1);v(this,"_flagInnerRadius",!1);v(this,"_flagOuterRadius",!1);v(this,"_startAngle",0);v(this,"_endAngle",ai);v(this,"_innerRadius",0);v(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in Qc)Object.defineProperty(this,f,Qc[f]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new En().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Hi(n,ai)===Hi(r,ai),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,m,g,u,p,b,y,_,R,k;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(u=m/g,p=c[f],b=u*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),R=o*Math.sin(b),m){case 0:h=ge.move;break;default:h=ge.curve}p.command=h,p.x=_,p.y=R,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(k=o*y/Math.PI,p.controls.left.x=k*Math.cos(b-ot),p.controls.left.y=k*Math.sin(b-ot),p.controls.right.x=k*Math.cos(b+ot),p.controls.right.y=k*Math.sin(b+ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=ge.close,f++):(d--,g=d-1),m=0;m<d;m++)u=m/g,p=c[f],b=(1-u)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),R=s*Math.sin(b),h=ge.curve,m<=0&&(h=a?ge.move:ge.line),p.command=h,p.x=_,p.y=R,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(k=s*y/Math.PI,p.controls.left.x=k*Math.cos(b+ot),p.controls.left.y=k*Math.sin(b+ot),p.controls.right.x=k*Math.cos(b-ot),p.controls.right.y=k*Math.sin(b-ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=ge.line}else a||(c[f].command=ge.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=ge.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new En(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const h=Ne.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];n[s]=this[s]}return n}};v(En,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let vo=En;const Qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},ko=Math.cos,Co=Math.sin,Nn=class Nn extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Pe(0,0,0,0,0,0));super(l,!0,!0,!0);v(this,"_flagRadius",!1);v(this,"_radius",0);this._renderer.type="circle";for(let c in Jc)Object.defineProperty(this,c,Jc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*ai,d=s*ko(c),h=s*Co(c),f=o*ko(c-ot),m=o*Co(c-ot),g=o*ko(c+ot),u=o*Co(c+ot),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,m),p.controls.right.set(g,u)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Nn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<Nn.Properties.length;r++){const s=Nn.Properties[r];n[s]=this[s]}return n}};v(Nn,"Properties",["radius"]);let So=Nn;const Jc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Bo=Math.cos,To=Math.sin,Fn=class Fn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Pe);super(c,!0,!0,!0);v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_width",0);v(this,"_height",0);this._renderer.type="ellipse";for(let d in ed)Object.defineProperty(this,d,ed[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Fn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*ai,d=s*Bo(c),h=o*To(c),f=s*r*Bo(c-ot),m=o*r*To(c-ot),g=s*r*Bo(c+ot),u=o*r*To(c+ot),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,m),p.controls.right.set(g,u)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Fn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];n[s]=this[s]}return n}};v(Fn,"Properties",["width","height"]);let Ro=Fn;const ed={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},_p=Math.cos,wp=Math.sin,An=class An extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_flagSides",!1);v(this,"_radius",0);v(this,"_width",0);v(this,"_height",0);v(this,"_sides",0);this._renderer.type="polygon";for(let a in td)Object.defineProperty(this,a,td[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ai*a+Math.PI/2,c=this._width*_p(l)/2,d=this._height*wp(l)/2;o>=s?this.vertices.push(new Pe(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ge.move:ge.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new An(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};v(An,"Properties",["width","height","sides"]);let $o=An;const td={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Ci=class Ci extends Ne{constructor(n,r,s,o){const a=[new Pe,new Pe,new Pe,new Pe];super(a,!0,!1,!0);v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_width",0);v(this,"_height",0);v(this,"_origin",null);this._renderer.type="rectangle";for(let l in nd)Object.defineProperty(this,l,nd[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new pe,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ci().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ci.Properties.length;r++){const s=Ci.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Pe),this.vertices[0].set(-n,-r).sub(this._origin).command=ge.move,this.vertices[1].set(n,-r).sub(this._origin).command=ge.line,this.vertices[2].set(n,r).sub(this._origin).command=ge.line,this.vertices[3].set(-n,r).sub(this._origin).command=ge.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=ge.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ci(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};v(Ci,"Properties",["width","height","origin"]);let gr=Ci;const nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(U.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(U.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Mn=class Mn extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Pe(0,0,0,0,0,0,c===0?ge.move:ge.curve));super(l);v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_flagRadius",!1);v(this,"_width",0);v(this,"_height",0);v(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in id)Object.defineProperty(this,c,id[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=xp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof pe)&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof pe?o:new pe().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof pe?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new Mn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};v(Mn,"Properties",["width","height","radius"]);let Po=Mn;const id={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof pe&&this._radius.unbind(U.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(U.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function xp(){this._flagRadius=!0}const vp=Math.cos,kp=Math.sin,Vn=class Vn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();v(this,"_flagInnerRadius",!1);v(this,"_flagOuterRadius",!1);v(this,"_flagSides",!1);v(this,"_innerRadius",0);v(this,"_outerRadius",0);v(this,"_sides",0);this._renderer.type="star";for(let l in rd)Object.defineProperty(this,l,rd[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ai*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*vp(l),h=c*kp(l);o>=s?this.vertices.push(new Pe(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?ge.move:ge.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new Vn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};v(Vn,"Properties",["innerRadius","outerRadius","sides"]);let Eo=Vn;const rd={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let No;const sd=Math.min,od=Math.max;gn.document&&(No=document.createElement("canvas"));const bt=class bt extends Bn{constructor(n,r,s,o){super();v(this,"_flagValue",!0);v(this,"_flagFamily",!0);v(this,"_flagSize",!0);v(this,"_flagLeading",!0);v(this,"_flagAlignment",!0);v(this,"_flagBaseline",!0);v(this,"_flagStyle",!0);v(this,"_flagWeight",!0);v(this,"_flagDecoration",!0);v(this,"_flagFill",!0);v(this,"_flagStroke",!0);v(this,"_flagLinewidth",!0);v(this,"_flagOpacity",!0);v(this,"_flagVisible",!0);v(this,"_flagMask",!1);v(this,"_flagClip",!1);v(this,"_flagDirection",!0);v(this,"_flagStrokeAttenuation",!0);v(this,"_value","");v(this,"_family","sans-serif");v(this,"_size",13);v(this,"_leading",17);v(this,"_alignment","center");v(this,"_baseline","middle");v(this,"_style","normal");v(this,"_weight",500);v(this,"_decoration","none");v(this,"_direction","ltr");v(this,"_fill","#000");v(this,"_stroke","none");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_mask",null);v(this,"_clip",!1);v(this,"_dashes",null);v(this,"_strokeAttenuation",!0);for(let a in ad)Object.defineProperty(this,a,ad[a]);if(this._renderer.type="text",this._renderer.flagFill=Cp.bind(this),this._renderer.flagStroke=Sp.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Ee.isObject(o))return this;for(let a=0;a<bt.Properties.length;a++){const l=bt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(No){const r=No.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*bt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:di(n.fill),s=typeof n.stroke=="string"?n.stroke:di(n.stroke),o=new bt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new bt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<bt.Properties.length;s++){const o=bt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=bt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[f,m]=r.multiply(s,a),[g,u]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=sd(m,u,b,_),s=sd(f,g,p,y),o=od(f,g,p,y),l=od(m,u,b,_),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};v(bt,"Ratio",.6),v(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let qi=bt;const ad={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ee.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Cp(){this._flagFill=!0}function Sp(){this._flagStroke=!0}const In=class In extends gr{constructor(n,r,s,o){super(r,s,0,0);v(this,"_flagTextures",!1);v(this,"_flagFrameRate",!1);v(this,"_flagIndex",!1);v(this,"_amount",1);v(this,"_duration",0);v(this,"_index",0);v(this,"_startTime",0);v(this,"_playing",!1);v(this,"_firstFrame",0);v(this,"_lastFrame",0);v(this,"_loop",!0);v(this,"_textures",null);v(this,"_frameRate",0);v(this,"_origin",null);this._renderer.type="image-sequence";for(let a in ld)Object.defineProperty(this,a,ld[a]);this._renderer.flagTextures=Bp.bind(this),this._renderer.bindTextures=Tp.bind(this),this._renderer.unbindTextures=Rp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(cd.bind(this)):typeof n=="string"&&(this.textures=[cd(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=In.DefaultFrameRate,this.index=0}static fromObject(n){const r=new In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Ee.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new In(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,h;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Ee.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Ee.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=jt(this._firstFrame,h,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof je))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};v(In,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),v(In,"DefaultFrameRate",30);let Fo=In;const ld={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._textures=new li((t||[]).slice(0)),this._textures.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Bp(){this._flagTextures=!0}function Tp(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Rp(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function cd(t){if(t instanceof je)return t;if(typeof t=="string")return new je(t)}const Si=class Si extends gr{constructor(n,r,s,o,a,l){super(r,s,0,0);v(this,"_flagTexture",!1);v(this,"_flagColumns",!1);v(this,"_flagRows",!1);v(this,"_flagFrameRate",!1);v(this,"_flagIndex",!1);v(this,"_amount",1);v(this,"_duration",0);v(this,"_startTime",0);v(this,"_playing",!1);v(this,"_firstFrame",0);v(this,"_lastFrame",0);v(this,"_loop",!0);v(this,"_texture",null);v(this,"_columns",1);v(this,"_rows",1);v(this,"_frameRate",0);v(this,"_index",0);v(this,"_origin",null);this._renderer.type="sprite";for(let c in dd)Object.defineProperty(this,c,dd[c]);this.noStroke(),this.noFill(),n instanceof je?this.texture=n:typeof n=="string"&&(this.texture=new je(n)),this.origin=new pe,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Si().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Ee.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new Si(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,h,f,m,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){f=n.image.width,m=n.image.height,o=f/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Ee.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Ee.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=jt(this._firstFrame,g,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const u=this._index%r,p=Math.floor(this._index/r),b=-o*u+(f-o)/2,y=-a*p+(m-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};v(Si,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Ao=Si;const dd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},ls=Math.min,cs=Math.max,en=class en extends Bn{constructor(n){super();v(this,"_flagAdditions",!1);v(this,"_flagSubtractions",!1);v(this,"_flagOrder",!1);v(this,"_flagOpacity",!0);v(this,"_flagBeginning",!1);v(this,"_flagEnding",!1);v(this,"_flagLength",!1);v(this,"_flagMask",!1);v(this,"_fill","#fff");v(this,"_stroke","#000");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_cap","round");v(this,"_join","round");v(this,"_miter",4);v(this,"_closed",!0);v(this,"_curved",!1);v(this,"_automatic",!0);v(this,"_beginning",0);v(this,"_ending",1);v(this,"_length",0);v(this,"_mask",null);v(this,"_strokeAttenuation",!0);for(let r in hd)Object.defineProperty(this,r,hd[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)ud.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)ud.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new en;for(let o=0;o<en.Properties.length;o++){const a=en.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:di(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return vo.fromObject(o);case"circle":return So.fromObject(o);case"element":return ur.fromObject(o);case"ellipse":return Ro.fromObject(o);case"group":return en.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Fo.fromObject(o);case"path":return Ne.fromObject(o);case"points":return as.fromObject(o);case"polygon":return $o.fromObject(o);case"rectangle":return gr.fromObject(o);case"rounded-rectangle":return Po.fromObject(o);case"shape":return Bn.fromObject(o);case"sprite":return Ao.fromObject(o);case"star":return Eo.fromObject(o);case"text":return qi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<en.Properties.length;r++){const s=en.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new en,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Ee.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,f=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let u=0;u<this.children.length;u++){const p=this.children[u];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Ee.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ee.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ee.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ee.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,R]=s.multiply(r.right,r.top),[k,w]=s.multiply(r.left,r.bottom),[C,S]=s.multiply(r.right,r.bottom);f=ls(y,R,w,S,f),d=ls(b,_,k,C,d),h=cs(b,_,k,C,h),m=cs(y,R,w,S,m)}else f=ls(r.top,f),d=ls(r.left,d),h=cs(r.right,h),m=cs(r.bottom,m)}return{top:f,left:d,right:h,bottom:m,width:h-d,height:m-f}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};v(en,"Children",Zc),v(en,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Tn=en;const hd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=Tn.InsertChildren.bind(this),n=Tn.RemoveChildren.bind(this),r=Tn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Zc(t),this._children.bind(U.Types.insert,e),this._children.bind(U.Types.remove,n),this._children.bind(U.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ee.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function ud(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class ds extends Ne{constructor(e,n,r,s){const o=[new Pe(e,n),new Pe(r,s)];super(o);for(let a in fd)Object.defineProperty(this,a,fd[a]);this.vertices[0].command=ge.move,this.vertices[1].command=ge.line,this.automatic=!1}}v(ds,"Properties",["left","right"]);const fd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Ee.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ge.move;else{const e=new is("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Ee.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ge.line;else{const e=new is("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Mo{constructor(e=0,n=0){this.x=e,this.y=n}}class pn{constructor(e=10,n=0,r="A"){v(this,"start",new Mo);v(this,"end",new Mo);this.width=e,this.angle=n,this.label=r}}const Oe={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},$p={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pp(t,e){return i.openBlock(),i.createElementBlock("svg",$p,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const hs=i.markRaw({name:"ion-close",render:Pp}),Ep={class:"mr-3 flex flex-col gap-2"},Np=["onClick"],Fp={class:"h-full p-2"},Ap={},Mp=i.defineComponent({...Ap,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((h,f)=>{var g;const m=(g=s.value)==null?void 0:g.at(f);m&&a("init-draw-template",m,h)}),(d=n.settings.customTemplates)==null||d.forEach((h,f)=>{var g;const m=(g=o.value)==null?void 0:g.at(f);m&&a("init-draw-template",m,h)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((h,f)=>{var m;if(!(d!=null&&d.includes(h))){const g=(m=o.value)==null?void 0:m.at(f);g&&a("init-draw-template",g,h)}}),d.length>c.length&&d.forEach((h,f)=>{var g;const m=(g=o.value)==null?void 0:g.at(f);m&&(m.innerHTML="",a("init-draw-template",m,h))})})},{deep:!0}),(c,d)=>{const h=hs;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Ep,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(f,m)=>(i.openBlock(),i.createElementBlock("div",{key:`${f.id}-${m}`,class:"group relative"},[i.createVNode(i.unref(z.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":m===t.selectTemplateIndex}]),onClick:g=>a("template:select",m)},[i.createElementVNode("div",Fp,[i.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Np)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(m)},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),gd=ri(Mp,[["__scopeId","data-v-69dd9f78"]]),Vp={class:"flex gap-3"},Ip={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Op={ref:"drawing-container",class:"size-full"},zp={},md=i.defineComponent({...zp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((A,I)=>new pn(n.value.configuratorParams.linesWidths[I],A,`A-${I+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var A,I;return n.value.configuratorParams.startTailType&&((A=n.settings.startTailConfigs)!=null&&A[n.value.configuratorParams.startTailType])?(I=n.settings.startTailConfigs)==null?void 0:I[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var I;const A=n.value.configuratorParams.endTailType!==void 0&&((I=n.settings.endTailConfigs)==null?void 0:I[n.value.configuratorParams.endTailType]);return!A||!A.points?[]:A.points.map((j,q)=>Array.isArray(j)?new pn(j[0],j[1],`A-${q+1}`):new pn(j.width,j.angle,`A-${q+1}`))}),u=(A,I=!1)=>{A[0].start.x=0,A[0].start.y=0;let j=0;for(let q=0;q<A.length;q++){const N=A[q],O=A[q-1]??new pn(0,j);j+=!I||q>1?O.angle:0;const Y=(!I||q>0?N.angle:0)+j;if(A[q].end.x=N.width*Math.cos(Y*Math.PI/180)+A[q].start.x,A[q].end.y=N.width*Math.sin(Y*Math.PI/180)+A[q].start.y,q<A.length-1){const re=q+1;A[re].start.x=A[q].end.x,A[re].start.y=A[q].end.y}}return A},p=(A,I,j,q,N=!1)=>{let O=u([...j,...q]);I.length>0&&(O=[...u(I),...O]);let Y=0,re=0,de=0,oe=0;O.forEach(Ce=>{Y=Math.min(Y,Ce.start.x,Ce.end.x),re=Math.min(re,Ce.start.y,Ce.end.y),de=Math.max(de,Ce.start.x,Ce.end.x),oe=Math.max(oe,Ce.start.y,Ce.end.y)});let ie,Fe;Y===0&&re===0&&de===0&&oe===0?(ie=1,Fe=1):(ie=A.width/Math.abs(de-Y),Fe=(N?A.height:A.height-Oe.colorSideLabel.size)/Math.abs(oe-re));const rt=Math.min(ie,Fe);return Y=Y<0?-Y*rt:0,re=re<0?-re*rt:0,[rt,Y,re]},b=A=>{const I=new as([A]);return I._size=Oe.anchorPoint.size,I.fill=Oe.anchorPoint.color,I.stroke="transparent",I._linewidth=Oe.anchorPoint.strokeSize,l.push(I),I},y=(A,I)=>{if(l=[],n.settings.allowChangeFirstPoint){const j=A[0],q=new pe(j.vertices[0].x,j.vertices[0].y);q.bind(U.Types.change,()=>{j.vertices[0].copy(q)});const N=b(q);I.add(N)}A.forEach((j,q)=>{const N=A[q+1],O=new pe(j.vertices[1].x,j.vertices[1].y);O.bind(U.Types.change,()=>{j.vertices[1].copy(O),N!==void 0&&N.vertices[0].copy(O)});const Y=b(O);I.add(Y)})},_=A=>A*(Math.PI/180),R=(A,I,j)=>{const q=I.vertices.length-1;A.position.x=I.vertices[q].x,A.position.y=I.vertices[q].y;const N=Math.atan2(I.vertices[q].y-I.vertices[0].y,I.vertices[q].x-I.vertices[0].x);A.rotation=_(j)+N},k=(A,I,j)=>{if(I.vertices[0]===void 0)return;A.position.x=I.vertices[0].x,A.position.y=I.vertices[0].y;const q=I.vertices.length-1,N=Math.atan2(I.vertices[q].y-I.vertices[0].y,I.vertices[q].x-I.vertices[0].x);A.rotation=_(j)+N},w=(A,I,j)=>{const q=new Tn;if(A.length===0)return q;const N=[];return[...A].reverse().forEach((O,Y)=>{Y!==0&&O.angle>0&&(O.angle*=-1),N.push(O)}),A=u(N,!0),k(q,I,A[0].angle),[I.vertices[0],I.vertices[1]].forEach(O=>{O.bind(U.Types.change,()=>{k(q,I,A[0].angle)})}),A.forEach(O=>{const Y=O.start.x*j,re=O.end.x*j,de=O.start.y*j,oe=O.end.y*j,ie=new ds(Y,de,re,oe);ie.linewidth=Oe.line.size,ie.stroke=Oe.line.color,q.add(ie)}),q},C=(A,I,j)=>{const q=new Tn;return A.length===0||(A=u(A,!0),R(q,I,A[0].angle),[I.vertices[0],I.vertices[1]].forEach(N=>{N.bind(U.Types.change,()=>{R(q,I,A[0].angle)})}),A.forEach(N=>{const O=N.start.x*j,Y=N.end.x*j,re=N.start.y*j,de=N.end.y*j,oe=new ds(O,re,Y,de);oe.linewidth=Oe.line.size,oe.stroke=Oe.line.color,q.add(oe)})),q},S=(A,I,j,q)=>{const N=I.vertices[0].x+(I.vertices[1].x-I.vertices[0].x)/2-8*Math.sin(A.angle*Math.PI/180),O=I.vertices[0].y+(I.vertices[1].y-I.vertices[0].y)/2-8*Math.cos(A.angle*Math.PI/180),Y=new qi(A.label,N+10,O-10);let re;Y.size=Oe.lineLabel.size,Y.weight=600,Y.fill=Oe.lineLabel.color,Y.id+=1,Y.rotation=Oe.lineLabel.rotation,q>0&&(re=new qi(`${A.angle}°`,I.vertices[0].x+25,I.vertices[0].y-25),re.size=Oe.angleLabel.size,re.weight=600,re.fill=Oe.angleLabel.color,re.rotation=Oe.angleLabel.rotation,re.id+=q,o.push(re),j.add(re)),j.add(Y),B(Y,I,0,re),B(Y,I,1)},T=()=>{const{size:A}=Oe.colorSideLabel,I=0,j=0,q=f.value?A/2:A/2-A,N=f.value?A/2-A:A/2,O=new Tn;if(!c)return O;const Y=5,re=Math.atan2(N-q,j-I),de=[new Pe(I,q,0,0,0,0,fn.Commands.move),new Pe(j,N,0,0,0,0,fn.Commands.line),new Pe(j-Y*Math.cos(re-Math.PI/4),N-Y*Math.sin(re-Math.PI/4),0,0,0,0,fn.Commands.line),new Pe(j,N,0,0,0,0,fn.Commands.move),new Pe(j-Y*Math.cos(re+Math.PI/4),N-Y*Math.sin(re+Math.PI/4),0,0,0,0,fn.Commands.line)],oe=new Ne(de,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=A/7,oe.stroke=Oe.colorSideLabel.color,O.add(oe);const ie=new qi(f.value?"Цвет снизу":"Цвет сверху",10,0);ie.size=A,ie.weight=600,ie.fill=Oe.colorSideLabel.color,ie.alignment="left",O.add(ie);const Fe=O.getBoundingClientRect();return O.position.x=(c.width-Fe.width)*d+10,O.position.y=f.value?c.height+Fe.height*2:Fe.height/2,O},B=(A,I,j,q)=>{I.vertices[j].bind(U.Types.change,()=>{const N=I.vertices.length-1,O=Math.atan2(I.vertices[0].y-I.vertices[N].y,I.vertices[0].x-I.vertices[N].x)*180/Math.PI,Y=I.vertices[0].x+(I.vertices[N].x-I.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),re=I.vertices[0].y+(I.vertices[N].y-I.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);A.position.x=Y+10,A.position.y=re-10,A.rotation=-.5,q&&(q.position.x=I.vertices[0].x+25,q.position.y=I.vertices[0].y-25)})},$=(A,I,j,q,N=!1)=>{var Yt;if(A.clear(),j.length===0){A.update();return}const O=u(j),[Y,re,de]=p(A,I,O,q,N),oe=new Tn,ie=new Array,Fe=new Array;N||(o=[],a=[]),O.forEach((Ie,tn)=>{const nn=Ie.start.x*Y+re,Tt=Ie.end.x*Y+re,Ot=Ie.start.y*Y+de,rn=Ie.end.y*Y+de,dt=new ds(nn,Ot,Tt,rn);dt.linewidth=N?Oe.previewLine.size:Oe.line.size,dt.stroke=N?Oe.previewLine.color:Oe.line.color,a.push(dt),ie.push(dt),oe.add(dt),!N&&Ie.label!==""&&S(Ie,dt,oe,tn)});const rt=ie.at(-1);let Ce=oe.getBoundingClientRect();if(!N){const Ie=T();Fe.push(Ie)}if(I.length>0){const Ie=w(I,ie[0],Y);oe.add(Ie)}if(q.length>0&&rt){const Ie=C(q,rt,Y);oe.add(Ie)}if(Fe.push(oe),A.makeGroup(Fe),Ce=oe.getBoundingClientRect(),oe.position.x=0-Ce.left+(A.width-Ce.width)/(2*(N?1:d)),oe.position.y=0-Ce.top+(A.height-Ce.height)/(2*(N?1:d)),A.update(),!N){const Ie=((Yt=n.value.configuratorParams)==null?void 0:Yt.colorSide)==="top";oe.position.y=oe.position.y+Oe.colorSideLabel.size*Number(Ie),y(ie,oe),A.update()}},M=(A,I)=>{if(A&&!I.isNewRec()){const j=new fn({width:A.scrollWidth,height:A.scrollHeight});j.appendTo(A),$(j,[],I.points,[],!0)}},E=()=>{c&&$(c,m.value,h.value,g.value,!1)},V=A=>A*(180/Math.PI),L=(A,I)=>{const j=A[1].x-A[0].x,q=A[1].y-A[0].y,N=I[1].x-I[0].x,O=I[1].y-I[0].y;let Y=Math.atan2(j*O-q*N,j*N+q*O);return Y=V(Y),Math.round(Y)*-1},D=A=>{const I=a.map((j,q,N)=>{const O=N[q-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let Y=Math.ceil(j._length/A/n.settings.lineWidthStep)*n.settings.lineWidthStep;const re=o[q-1];Y<(N.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(Y=N.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),Y>n.settings.maxLineWidth&&(Y=n.settings.maxLineWidth);const de=L(j.vertices,O.vertices);return re&&(re.value=`${de}°`),new pn(Y,de,`A-${q+1}`)});r("pointer:move",I)},te=A=>{let I=null,j;const q=re=>{I=l.find(de=>{const oe=de.renderer;return(oe==null?void 0:oe.elem)===re.target}),[j]=p(A,m.value,h.value.map(de=>de),g.value)},N=re=>{if(I){const de=I.renderer,oe=de==null?void 0:de.elem;if(!oe)return;const ie=oe.getBoundingClientRect();I.vertices[0].x-=ie.x-(re instanceof MouseEvent?re.clientX:re.targetTouches[0].clientX)+Oe.anchorPoint.size/2,I.vertices[0].y-=ie.y-(re instanceof MouseEvent?re.clientY:re.targetTouches[0].clientY)+Oe.anchorPoint.size/2,D(j),A.update()}},O=()=>{I&&r("pointer:up",h.value),I=null},Y=s.value;Y&&(Y.addEventListener("touchstart",q,{passive:!0}),Y.addEventListener("touchend",O,{passive:!0}),Y.addEventListener("mousedown",q),Y.addEventListener("mouseup",O),Y.addEventListener("mousemove",N),Y.addEventListener("touchmove",N,{passive:!0}))},ne=(A,I)=>{r("remove-custom-template",A,I)};return i.onMounted(()=>{s.value&&(c=new fn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{E()},{deep:!0,immediate:!0}),te(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(A,I)=>(i.openBlock(),i.createElementBlock("div",Vp,[i.createVNode(gd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":I[0]||(I[0]=j=>r("template:select",j)),onInitDrawTemplate:M,onRemoveCustomTemplate:ne},null,8,["select-template-index","settings"]),i.createElementVNode("div",Ip,[i.createElementVNode("div",Op,null,512)])]))}});class Xi extends Z.Identity{constructor(n,r){super();v(this,"label","");v(this,"points",[]);v(this,"isCustom",!1);v(this,"id",-1);v(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>F.isArray(s)?new pn(s[0],s[1],`A-${o+1}`):new pn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new pn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Vo extends Xi{constructor(n){super(n);v(this,"isDefault");this.isDefault=n.isDefault??!1}}class pd{constructor(e){v(this,"minLineWidth");v(this,"maxLineWidth");v(this,"lineWidthStep");v(this,"minLineAngle");v(this,"maxLineAngle");v(this,"lineAngleStep");v(this,"stripMinWidth");v(this,"stripMaxWidth");v(this,"stripMinLength");v(this,"stripMaxLength");v(this,"allowShowTable");v(this,"showOnlyTemplates");v(this,"templates");v(this,"customTemplates",[]);v(this,"startTailConfigs");v(this,"endTailConfigs");v(this,"bendCountForExtended");v(this,"extendedProductCatalog");v(this,"allowChangeFirstPoint");v(this,"allowSaveTemplates");v(this,"userTemplatesPrefix");v(this,"lengthStep");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Xi(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Vo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Vo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Xi(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Xi({label:"-- Новая конфигурация --",points:[new pn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Xi(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const Lp={class:"flex max-w-[50rem] flex-col gap-3"},Dp={},yd=i.defineComponent({...Dp,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new pd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),f=i.ref(0),m=i.useTemplateRef("kozyrek-configurator-params-form");i.computed(()=>{const B=F.every(l.value.configuratorParams.linesWidths,V=>!!(V&&V>0)),$=F.every(l.value.configuratorParams.linesAngles,V=>!F.isNil(V)),M=!!(l.value.quantity&&l.value.quantity>0),E=l.value.configuratorParams.length>0&&l.value.configuratorParams.length>0;return B&&$&&M&&E});const g=(B=0)=>{var M;const $=(M=c.value.allTemplates)==null?void 0:M.at(B);$!==void 0&&(f.value=B,l.value.configuratorParams.linesWidths=$.points.map(E=>F.isArray(E)?E[0]:E.width),l.value.configuratorParams.linesAngles=$.points.map(E=>F.isArray(E)?E[1]:E.angle),R()),y(l.value.configuratorParams)},u=async()=>{const B=prompt("Введите название шаблона:");if(!B)return;a.value=!0;const $={label:B,points:l.value.configuratorParams.linesWidths.map((E,V)=>[E,l.value.configuratorParams.linesAngles[V]])},M=E=>{E&&(c.value.addCustomTemplate($),f.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:$,callback:M})},p=async(B,$)=>{var V;const M=(V=c.value.allTemplates)==null?void 0:V.at(B);if(!M||!M.isCustom)return;const E=L=>{L&&(c.value.removeCustomTemplate(M.id),g()),$==null||$()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:M.id,callback:E})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async B=>{var $,M;l.value.product=new Z.Product,(M=($=m.value)==null?void 0:$.formReference)==null||M.validate(E=>{E||(R(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:B,validationFieldResultData:h.value,callback:V=>{V&&(l.value.product=V),s.value=!1}}))}).catch(F.noop)},_=async()=>{var B,$;($=(B=m.value)==null?void 0:B.formReference)==null||$.validate(M=>{M||(o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1,i.nextTick(()=>{var E,V;(V=(E=m.value)==null?void 0:E.formReference)==null||V.restoreValidation()})}))}).catch(F.noop)},R=()=>{const B={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach(($,M)=>{B[`lines_widths[${M+1}]`]={},B[`lines_angles[${M+1}]`]={}}),h.value=B},k=B=>{d.value.linesWidths=B.map($=>$.width),d.value.linesAngles=B.map($=>$.angle)},w=B=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,R(),b(),y(l.value.configuratorParams)},C=(B,$)=>{d.value.linesWidths=B,d.value.linesAngles=$},S=B=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,M=0;l.value.configuratorParams.linesWidths.splice(B+1,0,$),l.value.configuratorParams.linesAngles.splice(B+1,0,M),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],R(),b(),y(l.value.configuratorParams)},T=B=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(B,1),l.value.configuratorParams.linesAngles.splice(B,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],R(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,B=>{l.value=new Z.CartItemBase(B),g()}),(B,$)=>{const M=z.NButton;return i.openBlock(),i.createElementBlock("div",Lp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(M,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=E=>r("click:view-switch"))},{default:i.withCtx(()=>[...$[3]||($[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(md,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":w,"onPointer:move":k,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(tl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=E=>l.value=E),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":$[2]||($[2]=E=>y(E)),"onUpdate:preview":C,onSubmit:_,"onClick:saveTemplate":u,"onClick:addLine":S,"onClick:removeLine":T},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Hp={},Yi=i.defineComponent({...Hp,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=F.debounce(()=>s("update:value",o.value),a.value),c=g=>{o.value=g,l()};i.watch(()=>r.value,g=>{o.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:u[0]||(u[0]=p=>s("keydown",p)),onInput:u[1]||(u[1]=p=>s("input",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),Wp={key:0,class:"flex items-baseline gap-1"},jp={key:0,class:"flex items-baseline gap-1"},qp={key:0},Xp={class:"text-lg font-semibold"},Yp={key:1,class:"text-red-500 text-sm mb-2"},Up={class:"flex gap-3"},Gp={},bd=i.defineComponent({...Gp,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{expose:e,emit:n}){var C;const r=t,s=n,o=i.computed(()=>wt.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),h=i.ref(F.cloneDeep(r.value)),f=i.computed(()=>r.settings.widthOverlaps[h.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.heightOverlaps[h.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[h.value.configuratorParams.netType]),u=i.computed(()=>r.settings.maxHeights[h.value.configuratorParams.netType]),p=i.computed(()=>h.value.configuratorParams.width?h.value.configuratorParams.width+f.value:0),b=i.computed(()=>h.value.configuratorParams.height?h.value.configuratorParams.height+m.value:0),y=i.computed(()=>({"configuratorParams.width":[ue.required,ue.min(r.settings.minWidth-f.value),ue.max(g.value-f.value),ue.step(1),Qe.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ue.required,ue.min(r.settings.minHeight-m.value),ue.max(u.value-m.value),ue.step(1),Qe.serverValidation(r.validation.height.feedback)],quantity:[ue.required,ue.min(1),ue.step(1),Qe.serverValidation(r.validation.quantity.feedback)],marker:[Qe.serverValidation(r.validation.marker.feedback)]})),_=i.computed(()=>{var E;const S=p.value,T=b.value,{quantity:B}=r.value,$=((E=r.value.product)==null?void 0:E.costRub)||0;if(!S||!T||!B||$===0)return null;const M=S*T/1e6;return($*B*M).toLocaleString("ru-ru",{minimumFractionDigits:2})}),R=i.computed(()=>{const S=p.value,T=b.value,B=!!(S&&S>=r.settings.minWidth&&S<=r.settings.maxWidths[h.value.configuratorParams.netType]),$=!!(T&&T>=r.settings.minHeight&&T<=r.settings.maxHeights[h.value.configuratorParams.netType]),M=!!(r.value.quantity&&r.value.quantity>0);return B&&$&&M}),k=(S,T)=>{var M,E;const B=h.value.configuratorParams;S&&S in B&&(B[S]=T);const $={...B,width:p.value??0,height:b.value??0};S==="width"&&((M=l.value)==null||M.validate().catch(F.noop)),S==="height"&&((E=c.value)==null||E.validate().catch(F.noop)),i.nextTick(()=>{var L,D;!((L=l.value)!=null&&L.validationErrored)&&!((D=c.value)!=null&&D.validationErrored)&&$.height&&$.width&&s("update:params",$),w("configuratorParams",$)})},w=(S,T)=>{const B=new Z.CartItemBase(r.value);B[S]=T,s("update:value",B)};return i.watch(()=>r.value,S=>{const T=F.cloneDeep(i.toRaw(S)),B=T.configuratorParams.mountType,$=r.settings.widthOverlaps[B]??0,M=r.settings.heightOverlaps[B]??0;T.configuratorParams.width&&T.configuratorParams.width>0&&(T.configuratorParams.width-=$),T.configuratorParams.height&&T.configuratorParams.height>0&&(T.configuratorParams.height-=M),h.value=T},{deep:!0}),i.onMounted(()=>{var S;(S=d.value)==null||S.select()}),e({validate:(C=a.value)==null?void 0:C.validate,formReference:a}),(S,T)=>(i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:h.value,rules:y.value,class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.netType,"onUpdate:value":[T[0]||(T[0]=B=>h.value.configuratorParams.netType=B),T[1]||(T[1]=B=>k("netType",B))],options:t.settings.netType.map(B=>({label:t.settings.descriptions.net_type[B],value:B}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.color,"onUpdate:value":[T[2]||(T[2]=B=>h.value.configuratorParams.color=B),T[3]||(T[3]=B=>k("color",B))],options:t.settings.color.map(B=>({label:t.settings.descriptions.color[B],value:B}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.mountType,"onUpdate:value":[T[4]||(T[4]=B=>h.value.configuratorParams.mountType=B),T[5]||(T[5]=B=>k("mountType",B))],options:t.settings.mountType.map(B=>({label:t.settings.descriptions.mount_type[B],value:B}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-f.value} ${g.value?" до "+(g.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Wp,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:T[10]||(T[10]=B=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...T[24]||(T[24]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-reference",value:h.value.configuratorParams.width,"onUpdate:value":[T[6]||(T[6]=B=>h.value.configuratorParams.width=B),T[9]||(T[9]=B=>k("width",B))],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:T[7]||(T[7]=B=>i.unref(ln)(B,".",!1)),onInput:T[8]||(T[8]=B=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-m.value} ${u.value?" до "+(u.value-m.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",jp,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:T[15]||(T[15]=B=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...T[25]||(T[25]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{value:h.value.configuratorParams.height,"onUpdate:value":[T[11]||(T[11]=B=>h.value.configuratorParams.height=B),T[14]||(T[14]=B=>k("height",B))],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:T[12]||(T[12]=B=>i.unref(ln)(B,".",!1)),onInput:T[13]||(T[13]=B=>i.unref(Ke)(t.validation,"height"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:h.value.quantity,"onUpdate:value":[T[16]||(T[16]=B=>h.value.quantity=B),T[19]||(T[19]=B=>w("quantity",B??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:T[17]||(T[17]=B=>i.unref(ii)(B,!1)),onInput:T[18]||(T[18]=B=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:T[20]||(T[20]=B=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":T[21]||(T[21]=B=>{h.value.marker=B??null,w("marker",B??null)})},null,8,["value"])]),_:1}),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),_.value?(i.openBlock(),i.createElementBlock("div",qp,[T[26]||(T[26]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Xp,i.toDisplayString(_.value)+" ₽",1)])):i.createCommentVNode("",!0),R.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Yp," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Up,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!R.value,type:"primary",class:"self-start",onClick:T[22]||(T[22]=B=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:T[23]||(T[23]=B=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...T[27]||(T[27]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"]))}}),Kp="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Zp="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Qp="/img/configurators/mosquitto/measurement-instructions/mount.png",Jp="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ey="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",ty={class:"flex flex-col gap-6"},ny={class:"flex gap-4"},iy={class:"flex flex-col gap-2"},ry={class:"flex gap-4"},sy={class:"flex flex-col gap-2"},oy={class:"flex gap-4"},ay={class:"flex flex-col gap-2"},ly={},_d=i.defineComponent({...ly,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=wt.initRefDependingOnDeviceResolution("small","small","medium"),r=wt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",ty,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:Kp,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:Zp,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",ny,[l[9]||(l[9]=i.createElementVNode("img",{src:Qp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",iy,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",ry,[l[15]||(l[15]=i.createElementVNode("img",{src:Jp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",sy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",oy,[l[21]||(l[21]=i.createElementVNode("img",{src:ey,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",ay,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),cy={class:"flex flex-col items-center justify-between rounded-xl"},dy={class:"img-preview relative flex justify-center"},hy={},uy=i.defineComponent({...hy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=F.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",cy,[i.createElementVNode("div",dy,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Io=ri(uy,[["__scopeId","data-v-a67fd61e"]]),fy={class:"grid md:grid-cols-2"},gy={},wd=i.defineComponent({...gy,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>wt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),h=i.ref(!1),f=i.ref(!1),m=async u=>{var p,b;l.value.product=new Z.Product,(b=(p=c.value)==null?void 0:p.formReference)==null||b.validate(y=>{y||(h.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:u,validationFieldResultData:d.value,callback:_=>{_&&(l.value.product=_),h.value=!1}}))}).catch(F.noop)},g=()=>{f.value=!0,r("submit",l.value,d.value,()=>{f.value=!1})};return i.watch(()=>n.cartItem,u=>{l.value=u},{deep:!0}),(u,p)=>{const b=hs;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(_d,{show:a.value,"onUpdate:show":p[0]||(p[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",fy,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":p[4]||(p[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:p[2]||(p[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Io,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[3]||(p[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Io,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[1]||(p[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(bd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":p[5]||(p[5]=y=>l.value=y),validation:d.value,settings:t.settings,"is-product-searching":h.value,"is-submit-processing":f.value,"onUpdate:params":p[6]||(p[6]=y=>m(y)),onSubmit:p[7]||(p[7]=y=>g()),"onClick:instructionsToggle":p[8]||(p[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":p[9]||(p[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),my={},xd=i.defineComponent({...my,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),h=m=>{l.value=m,s("update:value",m,r.index,a)},f=()=>{var m;(m=o.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(m,g)=>{const u=el,p=Ja;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(lr,{key:0,"is-product-searching":a.value,product:t.product},null,8,["is-product-searching","product"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:h},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(Ut),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(ln)(b,".",!1)),onInput:g[1]||(g[1]=b=>i.unref(Ke)(t.validation,`linesWidths.${t.index}`)),"onUpdate:value":h},null,8,["value","parse"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=b=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=b=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),py={class:"my-2 flex w-full flex-col"},yy={key:0},by={class:"text-lg font-semibold"},_y={class:"flex gap-3"},wy={},vd=i.defineComponent({...wy,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var b;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(F.cloneDeep(r.value)),c=i.computed(()=>{const y={length:[ue.required,ue.min(r.settings.minLength),ue.max(r.settings.maxLength),ue.step(r.settings.lengthStep),Qe.serverValidation(r.validation.length.feedback)],quantity:[ue.required,ue.min(1),Qe.serverValidation(r.validation.quantity.feedback)],marker:[Qe.serverValidation(r.validation.marker.feedback)]};return F.forEach(l.value,(_,R)=>{var k;y[`configuratorParams.linesWidths.${R}`]=[ue.required,ue.min(r.settings.minLineWidth),ue.step(r.settings.lineWidthStep),Qe.serverValidation((k=r.validation[`linesWidths.${R}`])==null?void 0:k.feedback)]}),y}),d=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((y,_)=>(y??0)+(_??0),0)),h=i.computed(()=>r.settings.width-d.value),f=i.computed(()=>!r.value.some(({product:y})=>!y||y.isNewRec())),m=i.computed(()=>y=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+y}]),g=i.computed(()=>{const{length:y}=r.value[0];return!y||d.value!==r.settings.width?null:(F.reduce(r.value,(R,k)=>{var C;const w=((C=k.product)==null?void 0:C.costRub)||0;return R+w},0)*r.value[0].quantity*y).toLocaleString("ru-ru",{minimumFractionDigits:2})}),u=(y,_,R)=>{var w,C,S;l.value[_].product.id=-1;const{configuratorParams:k}=l.value[_];k.linesWidths[_]=y,p("configuratorParams",k),(S=(C=(w=a.value)==null?void 0:w.at(_))==null?void 0:C.formItemReference)==null||S.validate().catch(F.noop),i.nextTick(()=>{var T,B;(B=(T=a.value)==null?void 0:T.at(_))!=null&&B.isValid&&s("update:params",k,_,R)})},p=(y,_)=>{l.value.forEach(R=>{R[y]=_}),s("update:value",l.value)};return i.watch(()=>r.value,y=>{l.value=F.cloneDeep(y)},{deep:!0}),e({validate:(b=o.value)==null?void 0:b.validate,formReference:o}),(y,_)=>(i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var R;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(k,w)=>(i.openBlock(),i.createBlock(xd,{key:w,ref_for:!0,ref:"line-items-reference",value:k.configuratorParams.linesWidths.at(w)??null,"auto-focus":!0,index:w,path:`configuratorParams.linesWidths.${w}`,product:k.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(k.configuratorParams.linesWidths.at(w)??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(C=>C.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":u,"onClick:addLine":_[0]||(_[0]=C=>s("click:add-line",C)),"onClick:removeLine":_[1]||(_[1]=C=>s("click:remove-line",C))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",py,[h.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[..._[14]||(_[14]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[_[15]||(_[15]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{disabled:t.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=t.settings.maxLinesCount||t.value.some(k=>k.product.isNewRec()),type:"primary",class:"self-center",onClick:_[2]||(_[2]=k=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[..._[16]||(_[16]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[_[3]||(_[3]=k=>l.value[0].length=k),_[6]||(_[6]=k=>p("length",k))],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[4]||(_[4]=k=>i.unref(ii)(k,!1)),onInput:_[5]||(_[5]=k=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[_[7]||(_[7]=k=>l.value[0].quantity=k),_[10]||(_[10]=k=>p("quantity",k))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[8]||(_[8]=k=>i.unref(ii)(k,!1)),onInput:_[9]||(_[9]=k=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:_[11]||(_[11]=k=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":_[12]||(_[12]=k=>{l.value[0].marker=k??null,p("marker",k??null)})},null,8,["value"])]),_:1}),g.value?(i.openBlock(),i.createElementBlock("div",yy,[_[17]||(_[17]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",by,i.toDisplayString(g.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",_y,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((R=l.value[0])!=null&&R.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:_[13]||(_[13]=k=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"]))}}),xy={class:"flex grow flex-col"},vy=["src"],ky={class:"w-full"},Cy={},kd=i.defineComponent({...Cy,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",xy,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,vy),i.createElementVNode("div",ky,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),Sy={class:"flex flex-col gap-2"},By={class:"w-104 flex grow flex-col px-5"},Ty={},Cd=i.defineComponent({...Ty,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>o.value[0].configuratorParams.linesWidths.reduce((g,u)=>(g??0)+(u??0),0)),d=g=>{g===void 0&&(g=o.value.length-1);const u=o.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(g+1,0,null),o.value.forEach(b=>{b.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const p=new Z.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});o.value=o.value.toSpliced(g+1,0,p)},h=g=>{const u=o.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(g,1),o.value.forEach(p=>{p.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),o.value=o.value.toSpliced(g,1),delete a[`linesWidths.${g}`],delete a[`linesWidths.${g}`])},f=async(g,u,p)=>{const b={linesWidths:g.linesWidths.at(u)};p.value=!0,a.value[`linesWidths.${u}`]={},o.value[u].product=new Z.Product,n.eventEmitter.emit("configurator:search-product",{category:o.value[u].category,params:b,validationFieldResultData:a.value,callback:y=>{y?(o.value[u].product=y,u===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&c.value&&c.value<n.settings.width&&d()):(o.value[u].product=new Z.Product,a.value[`linesWidths.${u}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},p.value=!1),p.value=!1}})},m=async()=>{var g,u;(u=(g=s.value)==null?void 0:g.formReference)==null||u.validate(p=>{if(!p){l.value=!0;const b=o.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var y,_;(_=(y=s.value)==null?void 0:y.formReference)==null||_.restoreValidation()})})}}).catch(F.noop)};return i.watch(()=>n.cartItems,g=>{o.value=g.map(u=>new Z.CartItemBase(u))}),(g,u)=>{const p=z.NButton;return i.openBlock(),i.createElementBlock("div",Sy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[3]||(u[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",By,[i.createVNode(kd,{value:o.value,"onUpdate:value":u[1]||(u[1]=b=>o.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(vd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":u[2]||(u[2]=b=>o.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":f,onSubmit:m,"onClick:addLine":d,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing"])])])}}}),Ry={class:"flex flex-col gap-3"},$y={},Sd=i.defineComponent({...$y,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit"],setup(t,{expose:e,emit:n}){var m;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(F.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ue.required,ue.min(r.settings.minWidth),...r.settings.maxWidth?[ue.max(r.settings.maxWidth)]:[],ue.step(1),Qe.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ue.required,ue.min(r.settings.minLength),ue.max(r.settings.maxLength),ue.step(1),Qe.serverValidation(r.validation.length.feedback)],quantity:[ue.required,ue.min(1),ue.step(1),Qe.serverValidation(r.validation.quantity.feedback)],marker:[Qe.serverValidation(r.validation.marker.feedback)]})),d=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(g,u)=>{const p=new Z.CartItemBase(r.value);p[g]=u,s("update:value",p)},f=()=>{var g;(g=a.value)==null||g.select()};return i.watch(()=>r.value,g=>{l.value=F.cloneDeep(g)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(m=o.value)==null?void 0:m.validate,formReference:o}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[u[0]||(u[0]=p=>l.value.configuratorParams.width=p),d],class:"w-full",parse:i.unref(Ut),"show-button":!1,placeholder:"Введите ширину",onKeydown:u[1]||(u[1]=p=>i.unref(ln)(p,".",!1)),onInput:u[2]||(u[2]=p=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{value:l.value.configuratorParams.length,"onUpdate:value":[u[3]||(u[3]=p=>l.value.configuratorParams.length=p),d],placeholder:"Введите длину",parse:i.unref(Ut),"show-button":!1,class:"w-full",onKeydown:u[4]||(u[4]=p=>i.unref(ln)(p,".",!1)),onInput:u[5]||(u[5]=p=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:u[6]||(u[6]=p=>i.unref(ii)(p,!1)),onInput:u[7]||(u[7]=p=>i.unref(Ke)(t.validation,"quantity")),"onUpdate:value":u[8]||(u[8]=p=>h("quantity",p??0))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:u[9]||(u[9]=p=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":u[10]||(u[10]=p=>h("marker",p??null))},null,8,["value"])]),_:1}),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Ry,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:u[11]||(u[11]=p=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"]))}}),Py={class:"flex flex-col gap-2 w-72"},Ey={},Bd=i.defineComponent({...Ey,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=async f=>{var m,g;o.value.product=new Z.Product,(g=(m=s.value)==null?void 0:m.formReference)==null||g.validate(u=>{u||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:p=>{p&&(o.value.product=p),l.value=!1}}))}).catch(F.noop)},h=async()=>{var f,m;(m=(f=s.value)==null?void 0:f.formReference)==null||m.validate(g=>{g||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var u,p;(p=(u=s.value)==null?void 0:u.formReference)==null||p.restoreValidation()})}))}).catch(F.noop)};return i.watch(()=>n.cartItem,f=>{o.value=new Z.CartItemBase(f)},{deep:!0}),(f,m)=>{const g=z.NButton;return i.openBlock(),i.createElementBlock("div",Py,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=u=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[4]||(m[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Sd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":m[1]||(m[1]=u=>o.value=u),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":m[2]||(m[2]=u=>d(u)),onSubmit:m[3]||(m[3]=u=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Ny={key:0,class:"flex justify-center p-4"},Fy={key:1,class:"p-4 text-center text-red-500"},Ay={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},My={key:3,class:"p-4 text-center text-gray-500"},Td=i.defineComponent({__name:"dynamic-configurator",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function]},categoryContextButtonsConfig:{type:Function},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configuratorSettings}),o=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configurator}),a=i.ref(null),l=i.ref(null),c=()=>{var m,g;if(!s.value){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:e.categoryItem,configurator:o.value,quantity:1};switch(o.value){case"kozyrek":{const u=s.value;a.value=new Z.CartItemBase({...f,configuratorParams:{length:u.stripMinLength,linesAngles:[],linesWidths:[],startTailType:F.some(u.startTailConfigs,p=>p.isDefault)?(m=u.startTailConfigs)==null?void 0:m.findIndex(p=>p.isDefault):void 0,endTailType:F.some(u.endTailConfigs,p=>p.isDefault)?(g=u.endTailConfigs)==null?void 0:g.findIndex(p=>p.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const u=s.value;a.value=new Z.CartItemBase({...f,configuratorParams:{width:0,height:0,netType:u.netType[0]||"",color:u.color[0]||"",mountType:u.mountType[0]||""}});break}case"strip":{const u=s.value;l.value=[new Z.CartItemBase({...f,length:u.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const u=s.value;a.value=new Z.CartItemBase({...f,configuratorParams:{width:u.minWidth,length:u.minLength}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${o.value}.`}a.value&&(a.value.marker=void 0)},d=(f,m,g)=>{const u=p=>{g==null||g(),p&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:u,validation:m})},h=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})};return i.onMounted(()=>{c()}),(f,m)=>{const g=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",Ny,[i.createVNode(g,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",Fy,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),s.value!==null&&(a.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",Ay,[o.value==="kozyrek"?(i.openBlock(),i.createBlock(yd,{key:0,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="mosquitto"?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="strip"?(i.openBlock(),i.createBlock(Cd,{key:2,"event-emitter":t.eventEmitter,settings:s.value,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):o.value==="metal_for_doors"?(i.openBlock(),i.createBlock(Bd,{key:3,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",My,' Конфигуратор "'+i.toDisplayString(o.value)+'" не поддерживается. ',1))],64)}}}),Vy={key:0,class:"pt-0.5"},Iy={key:0},Oy={class:"line-through"},zy={key:0},Ly={key:1},Dy={class:"flex flex-row gap-1"},Hy={key:0},Wy={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},jy={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},qy={key:2,class:"flex flex-col"},Xy={},Yy=i.defineComponent({...Xy,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function,default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>{var N;return(N=e==null?void 0:e.filteredItems)==null?void 0:N[e.categoryItem.id]}),s=i.computed(()=>{var N,O;return F.isArray((N=e.categoryItem)==null?void 0:N.categories)&&((O=e.categoryItem.categories)==null?void 0:O.length)>0}),o=i.computed(()=>{var N;return F.isArray((N=e.categoryItem)==null?void 0:N.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([N,O])=>`${O} руб./${B(N)}`).join(", ")),l=i.computed(()=>F.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(N=>{var Y;const O=(Y=r.value)==null?void 0:Y.products;return F.isArray(O)&&O.includes(N.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>F.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>F.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),f=i.computed(()=>F.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>F.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var N,O;return((N=e.categoryItem.properties)==null?void 0:N.configurator)!==void 0&&((O=e.categoryItem.properties)==null?void 0:O.configuratorSettings)!==void 0&&(F.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),u=i.computed(()=>{var N,O;return((N=e.categoryItem.properties)==null?void 0:N.configurator)!==void 0&&((O=e.categoryItem.properties)==null?void 0:O.configuratorSettings)!==void 0&&(F.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),p=i.computed(()=>F.isNil(e.categoryContextButtonsConfig)?[]:F.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new Z.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),R=i.computed(()=>!F.isUndefined(e.isCategoryItemSelected)),k=i.computed(()=>F.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected),w=i.computed(()=>I.value&&wt.getDeviceTypeByResolution()===Ue.laptop?"auto":"fixed"),C=i.useTemplateRef("collapse-item-reference"),S=i.computed(()=>{var N,O;return(O=(N=e.categoryItem.properties)==null?void 0:N.templateCost)==null?void 0:O.priceCoefficient}),T=i.computed(()=>{var N,O;return(O=(N=e.categoryItem.properties)==null?void 0:N.templateCost)==null?void 0:O.increasePercent}),B=(N,O="ru-RU")=>0 .toLocaleString(O,{style:"currency",currency:N,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),$=N=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:N,target:C.value})},M=(N,O)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:O,isLoadingState:y,target:C.value})},E=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:C.value})},V=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:C.value})},L=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:C.value})},D=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:C.value})},te=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:C.value})},ne=N=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:N,target:C.value})},A=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},I=i.ref(0),j=i.computed(()=>I.value&&o.value.length>0?kg(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),q=F.debounce(()=>{I.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",q)}),window.addEventListener("resize",q),q(),(N,O)=>{const Y=z.NCheckbox,re=hf,de=z.NTooltip,oe=Ya,ie=z.NTag,Fe=of,rt=nf,Ce=z.NButton,Yt=Ju,Ie=Xa,tn=qa,nn=ja,Tt=Wa,Ot=z.NDropdown,rn=z.NDataTable,dt=z.NAlert,On=z.NSpin;return i.openBlock(),i.createBlock(Ua,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":M},{"pre-arrow":i.withCtx(()=>{var Le,Be;return[R.value?(i.openBlock(),i.createElementBlock("div",Vy,[i.createVNode(Y,{checked:k.value,disabled:k.value==="disabled","onUpdate:checked":$},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Le=b.value)!=null&&Le.isDisabled)?(i.openBlock(),i.createBlock(de,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(re,{class:"pt-1.5"})]),default:i.withCtx(()=>[O[1]||(O[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((Be=b.value)==null?void 0:Be.isFavorite)??!1?(i.openBlock(),i.createBlock(de,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[O[2]||(O[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Le,Be,Xe,Q,se;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Le=b.value)==null?void 0:Le.isDisabled})},[i.createVNode(de,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[O[3]||(O[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:O[0]||(O[0]=i.withModifiers((...Se)=>i.unref(F.noop)&&i.unref(F.noop)(...Se),["prevent","stop"]))},[(Be=t.categoryItem.properties)!=null&&Be.m2Price?(i.openBlock(),i.createBlock(ie,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Xe=t.categoryItem.properties)==null?void 0:Xe.templateCost)&&t.categoryItem.properties.m2PriceRetail&&T.value}),round:""},{default:i.withCtx(()=>{var Se;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Se=t.categoryItem.properties)!=null&&Se.templateCost&&t.categoryItem.properties.m2PriceRetail&&T.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[T.value?(i.openBlock(),i.createBlock(ie,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[T.value?(i.openBlock(),i.createElementBlock("span",Iy,i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ie,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",Oy,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Q=t.categoryItem.properties)!=null&&Q.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[S.value||T.value?(i.openBlock(),i.createBlock(ie,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Se;return[S.value?(i.openBlock(),i.createElementBlock("span",zy,i.toDisplayString((Se=S.value)==null?void 0:Se.name),1)):i.createCommentVNode("",!0),T.value?(i.openBlock(),i.createElementBlock("span",Ly,i.toDisplayString(T.value>0?"+":"")+i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ie,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((se=b.value)!=null&&se.manager)?(i.openBlock(),i.createBlock(ie,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:D},{default:i.withCtx(()=>[i.createVNode(de,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Se,sn;return[i.createElementVNode("span",Dy,[i.createVNode(Fe),i.createTextVNode(" "+i.toDisplayString((sn=(Se=b.value)==null?void 0:Se.manager)==null?void 0:sn.name),1)])]}),default:i.withCtx(()=>{var Se,sn;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((sn=(Se=b.value)==null?void 0:Se.manager)==null?void 0:sn.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Hy,[i.createElementVNode("ul",Wy,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Le,Be)=>(i.openBlock(),i.createElementBlock("li",{key:Be}," ("+i.toDisplayString(Be)+"): "+i.toDisplayString(Le),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Le,Be)=>(i.openBlock(),i.createElementBlock("li",{key:Be}," ("+i.toDisplayString(Be)+"): "+i.toDisplayString(Le),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Le;return[i.createElementVNode("div",jy,[d.value?(i.openBlock(),i.createBlock(de,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),onClick:E},{default:i.withCtx(()=>{var Be;return[(Be=b.value)!=null&&Be.isDisabled?(i.openBlock(),i.createBlock(re,{key:1})):(i.openBlock(),i.createBlock(rt,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Be;return[(Be=b.value)!=null&&Be.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Le=b.value)!=null&&Le.manager)?(i.openBlock(),i.createBlock(de,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),onClick:L},{default:i.withCtx(()=>[i.createVNode(Yt)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Be,Xe,Q;return[(Be=b.value)!=null&&Be.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Q=(Xe=b.value)==null?void 0:Xe.manager)==null?void 0:Q.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(de,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,disabled:f.value==="disabled",size:i.unref(n),onClick:V},{default:i.withCtx(()=>{var Be;return[(Be=b.value)!=null&&Be.isRequired?(i.openBlock(),i.createBlock(tn,{key:1})):(i.openBlock(),i.createBlock(Ie,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[O[4]||(O[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(de,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),type:"primary",onClick:te},{default:i.withCtx(()=>[i.createVNode(nn)]),_:1},8,["size"])]),default:i.withCtx(()=>[O[5]||(O[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Ot,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:ne},{default:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(Tt)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(N.$slots,"default",{},()=>{var Le;return[s.value?(i.openBlock(),i.createBlock($d,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Le=r.value)==null?void 0:Le.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(Td,{key:1,"event-emitter":t.eventEmitter,"category-item":t.categoryItem},null,8,["event-emitter","category-item"])):c.value?(i.openBlock(),i.createElementBlock("div",qy,[g.value?(i.openBlock(),i.createBlock(Ce,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:A},{default:i.withCtx(()=>[...O[6]||(O[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(rn,{columns:j.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Be=>Be.id,"table-layout":w.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(dt,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(dt,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(On,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...O[7]||(O[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Uy=ri(Yy,[["__scopeId","data-v-063e89d9"]]),Gy={class:"sc-collapse flex w-full flex-col"},Ky={},Rd=i.defineComponent({...Ky,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",Gy,[i.renderSlot(o.$slots,"default")]))}}),Zy={},$d=i.defineComponent({...Zy,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>F.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(F.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Rd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Uy,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Qy={},Pd=i.defineComponent({...Qy,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=new Z.Reference,l=i.computed(()=>{const g=o.value?[]:a,u=F.isUndefined(r.value)?g:r.value;return F.isArray(u)?u.map(p=>p.id):u==null?void 0:u.id}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var u;if(F.isArray(g)){const p=g.length>0?g.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=g===a.id||(u=c.value.find(b=>b.value===g))==null?void 0:u.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=h.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=h.value)==null?void 0:g.blur()}}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Jy={},e0=i.defineComponent({...Jy,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var R,k;const n=t,r=e,s=()=>{const w=Z.PriceCoefficient.getRetailPriceCoefficient();return F.unset(w,"isNewRec"),w},o=w=>!w||w.id===s().id,a=i.computed(()=>{var w;return((w=n.catalogItem)==null?void 0:w.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=w=>{var C,S,T,B;return w.id===s().id?(C=l.value)==null?void 0:C.getRetailCost():(B=(T=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:T.find($=>$.coefficient.id===w.id))==null?void 0:B.cost},d=i.computed(()=>{var C;const w=[...((C=Z.useReferencesStore().priceCoefficientsReference)==null?void 0:C.map(S=>structuredClone(i.toRaw(S))))??[],s()];return a.value&&w.forEach(S=>{var B;const T=c(S);T?S.name+=` (${T} ${(B=l.value)==null?void 0:B.currency})`:S.name=""}),w.filter(S=>S.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((k=(R=n.value)==null?void 0:R.value)==null?void 0:k.toString())??null),m=i.ref(null),g=i.computed(()=>{var w,C;return(C=(w=l.value)==null?void 0:w.priceCoefficients)==null?void 0:C.find(S=>S.coefficient.slug===Z.PriceCoefficientEnum.K0)}),u=i.ref(void 0),p=()=>{var C,S,T;u.value=void 0;let w=Number.parseFloat(((C=f.value)==null?void 0:C.replace(",","."))??"");if(w=Number.isNaN(w)?void 0:w,a.value)if(h.value||f.value){const B=s(),$=c(h.value??B)??0,M=$+$*((w??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(M),M>(((S=l.value)==null?void 0:S.getRetailCost())??M)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&M<(((T=g.value)==null?void 0:T.cost)??0)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},b=w=>{F.isArray(w)||(h.value=w,!h.value&&f.value&&(h.value=s()),p())},y=()=>{h.value||(h.value=s()),p()},_=w=>{var S,T,B,$,M,E;const C=Number.parseFloat((w==null?void 0:w.replace(",","."))??"");if(a.value){let V=0;if(C<=0)h.value=void 0,f.value=null;else if(g.value&&C<(((S=g.value)==null?void 0:S.cost)??0))h.value=(T=g.value)==null?void 0:T.coefficient,V=(C-g.value.cost)*100/g.value.cost,u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(C>(((B=l.value)==null?void 0:B.getRetailCost())??C)){h.value=s();const L=(($=l.value)==null?void 0:$.getRetailCost())??0;V=(C-L)*100/L,u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const L=(E=(M=l.value)==null?void 0:M.priceCoefficients)==null?void 0:E.filter(D=>D.cost<C);if(L&&L.length>0){const D=L.at(-1);h.value=D==null?void 0:D.coefficient,V=(C-((D==null?void 0:D.cost)??0))*100/((D==null?void 0:D.cost)??1)}u.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(V),r("update:value",{value:Number.isNaN(V)?void 0:V,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(C)?void 0:C,coefficient:void 0})};return i.onMounted(()=>{var w,C,S,T;n.calculationType===Z.CalculationTypeEnum.m2Cost?m.value=((C=(w=n.value)==null?void 0:w.value)==null?void 0:C.toString())??null:!((S=n.value)!=null&&S.coefficient)&&((T=n.value)!=null&&T.value)&&(h.value=s()),p()}),(w,C)=>{var B,$,M;const S=z.NInput,T=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(F.isNil)(t.label),label:t.label,"show-feedback":!i.unref(F.isNil)(((B=u.value)==null?void 0:B.feedback)??t.feedback),feedback:(($=u.value)==null?void 0:$.feedback)??t.feedback,"validation-status":((M=u.value)==null?void 0:M.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(Z.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(Z.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(T,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Pd,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(S,{value:f.value,"onUpdate:value":[C[0]||(C[0]=E=>f.value=E),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[C[3]||(C[3]=i.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[C[2]||(C[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(Z.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(S,{key:1,value:m.value,"onUpdate:value":[C[1]||(C[1]=E=>m.value=E),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var E;return[i.createTextVNode(i.toDisplayString((E=l.value)==null?void 0:E.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),t0={key:0,class:"flex flex-row gap-2.5"},n0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},i0={},Ed=i.defineComponent({...i0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=wt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=wt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},f=(g="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let u=!1;s("closing",g,()=>{u=!0}),u||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",u=>{a.value=u})};return i.watch(()=>r.show,g=>{g?h():f("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:h,close:f}),(g,u)=>{const p=z.NButton,b=z.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:u[1]||(u[1]=y=>f("header")),onEsc:u[2]||(u[2]=y=>f("esc")),onMaskClick:u[3]||(u[3]=y=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",t0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",n0,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:u[0]||(u[0]=y=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),r0={class:"text-sm"},s0={},o0=i.defineComponent({...s0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.ref(null),o=i.computed(()=>{var w,C;return((C=(w=s.value)==null?void 0:w.properties)==null?void 0:C.isLengthConfigurator)??!1}),a=i.ref(void 0),l=i.ref(void 0),c=i.ref(null),d=n,h=()=>({length:{},quantity:{},marker:{}}),f=i.ref(h()),m=i.ref(!1),g=i.computed(()=>{var B,$,M,E;if(!s.value)return{};const w=Z.UnitsHelper.getProductLengthMultiplicity(s.value),C=Z.UnitsHelper.getProductMultiplicity(s.value),S=(($=(B=s.value)==null?void 0:B.properties)==null?void 0:$.minLength)||w,T=(E=(M=s.value)==null?void 0:M.properties)==null?void 0:E.maxLength;return{length:[ue.required,ue.min(S??.1),ue.max(T),ue.step(w),Qe.serverValidation(f.value.length.feedback)],quantity:[ue.required,ue.min(C),ue.step(C),Qe.serverValidation(f.value.quantity.feedback)],marker:[Qe.serverValidation(f.value.marker.feedback)]}}),u=i.computed(()=>{var w,C,S;return s.value?((w=s.value.properties)==null?void 0:w.lengthStep)??((C=s.value.properties)!=null&&C.ignoreMinCountCheck?0:((S=s.value.properties)==null?void 0:S.minCount)??0):0}),p=i.computed(()=>{var S,T,B,$,M,E,V,L,D;if(!s.value)return"";const w=((T=(S=s.value)==null?void 0:S.properties)==null?void 0:T.minLength)??(($=(B=s.value)==null?void 0:B.properties)!=null&&$.ignoreMinCountCheck?0:(E=(M=s.value)==null?void 0:M.properties)==null?void 0:E.minCount),C=(L=(V=s.value)==null?void 0:V.properties)==null?void 0:L.maxLength;return w||C?`(${w?`от ${w}`:""}${w&&C?" ":""}${C?`до ${C}`:""} ${(D=s.value)==null?void 0:D.unit})`:""}),b=w=>{var $,M;if(!((M=($=s.value)==null?void 0:$.properties)!=null&&M.isLengthConfigurator)||!c.value||F.isNil(w)||u.value===0)return;const C=w/u.value,S=Math.round(C),T=Z.UnitsHelper.getProductMultiplicity(s.value),B=Math.max(S,T);c.value.quantity=B},y=w=>{var B,$,M,E;if(!(($=(B=s.value)==null?void 0:B.properties)!=null&&$.isLengthConfigurator)||!c.value||F.isNil(w)||u.value===0)return;const C=w*u.value,S=((M=s.value.properties)==null?void 0:M.minLength)||Z.UnitsHelper.getProductLengthMultiplicity(s.value),T=(E=s.value.properties)==null?void 0:E.maxLength;S!==void 0&&C<S?c.value.length=S:T!==void 0&&C>T?c.value.length=T:c.value.length=C},_=async w=>{var C;try{await((C=r.value)==null?void 0:C.validate(S=>{if(!S){if(!s.value||!c.value)return;Z.UnitsHelper.productIsMeasurable(s.value)||delete c.value.length,o.value&&u.value&&(c.value.length=u.value),m.value=!0,d("submit",c.value,f.value,()=>{m.value=!1,w(!1),i.nextTick(()=>{var T;(T=r.value)==null||T.validate(F.noop).catch(F.noop)})})}}))}catch{}},R=()=>{s.value=null,a.value=void 0,c.value=null,f.value=h()};return e({show:(w,C)=>{var S,T,B,$;if(s.value=w,a.value=C==null?void 0:C.cartItemData,l.value=C==null?void 0:C.orderId,c.value=new Z.CartItemBase((C==null?void 0:C.cartItemData)??new Z.CartItemBase({product:w,quantity:1,length:((S=w==null?void 0:w.properties)==null?void 0:S.minLength)||((T=w==null?void 0:w.properties)!=null&&T.ignoreMinCountCheck?0:(B=w==null?void 0:w.properties)==null?void 0:B.minCount)||0})),($=w==null?void 0:w.properties)!=null&&$.isLengthConfigurator&&c.value&&u.value>0){const M=u.value,E=c.value.quantity||1;c.value.length=E*M}},closeDialog:R}),(w,C)=>{const S=z.NInputNumber,T=z.NFormItem,B=z.NInputGroupLabel,$=z.NInputGroup,M=z.NInput;return i.openBlock(),i.createBlock(Ed,{show:!i.unref(F.isNil)(s.value)&&!i.unref(F.isNil)(c.value),title:`${a.value?"Изменение":"Добавление"} товара в ${l.value?` заказ №${l.value}`:"корзину"}`,"accept-button":{show:!0,text:a.value?"Изменить":"Добавить"},processing:m.value,onAccept:_,onClosing:R},{default:i.withCtx(()=>[s.value&&c.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:c.value,rules:g.value,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(Z.UnitsHelper).productIsMeasurable(s.value)?(i.openBlock(),i.createBlock(T,{key:0,path:"length",label:`Метраж, ${p.value+s.value.unit}`},{default:i.withCtx(()=>[i.createVNode(S,{value:c.value.length,"onUpdate:value":[C[0]||(C[0]=E=>c.value.length=E),b],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:C[1]||(C[1]=E=>i.unref(ln)(E,".",!1)),onInput:C[2]||(C[2]=E=>i.unref(Ke)(f.value,"length"))},null,8,["value","parse"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(T,{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode($,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(S,{value:c.value.quantity,"onUpdate:value":[C[3]||(C[3]=E=>c.value.quantity=E),y],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[4]||(C[4]=E=>i.unref(ii)(E,!1)),onInput:C[5]||(C[5]=E=>i.unref(Ke)(f.value,"quantity"))},null,8,["value"]),o.value?(i.openBlock(),i.createBlock(B,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(u.value)+" "+i.toDisplayString(s.value.unit),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!f.value.quantity.feedback&&i.unref(Z.UnitsHelper).getProductMultiplicity(s.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",r0,"Количество должно быть кратно "+i.toDisplayString(i.unref(Z.UnitsHelper).getProductMultiplicity(s.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.createVNode(T,{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(M,{value:c.value.marker??null,placeholder:"Введите маркировку",onInput:C[6]||(C[6]=E=>i.unref(Ke)(f.value,"marker")),"onUpdate:value":C[7]||(C[7]=E=>c.value.marker=E??null)},null,8,["value"])]),_:1})]),_:1},8,["model","rules"])):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),a0={class:"flex flex-row gap-1"},l0={class:"sc-client-name flex flex-col gap-1 text-base"},c0=["href"],d0={key:1,class:"text-sc-grey"},h0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},u0={key:0},f0={key:1,class:"text-sm"},g0={},us=i.defineComponent({...g0,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Ln.format(n.client.lastLoginAt,Z.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{F.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=zs,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",a0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(F.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",l0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",d0," [ Деактивирован ] "))],8,c0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",h0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",u0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",f0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),m0={class:"text-base"},p0={},Nd=i.defineComponent({...p0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",m0,i.toDisplayString(t.contragent.name),1))}}),y0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b0(t,e){return i.openBlock(),i.createElementBlock("svg",y0,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const _0=i.markRaw({name:"tabler-mail",render:b0}),w0=["href"],x0={},v0=i.defineComponent({...x0,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=_0;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,w0)],2)}}}),k0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function C0(t,e){return i.openBlock(),i.createElementBlock("svg",k0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Fd=i.markRaw({name:"fa6-brands-viber",render:C0}),S0={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},B0=["id"],T0=["id"],R0=["fill"],$0=["fill"];function P0(t,e){return i.openBlock(),i.createElementBlock("svg",S0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,B0),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,T0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,R0),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,$0),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ad=i.markRaw({name:"logos-whatsapp-icon",render:P0,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),E0={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},N0=["id"],F0=["fill"];function A0(t,e){return i.openBlock(),i.createElementBlock("svg",E0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,N0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,F0),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Md=i.markRaw({name:"logos-telegram",render:A0,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),M0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function V0(t,e){return i.openBlock(),i.createElementBlock("svg",M0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const Vd=i.markRaw({name:"ion-call",render:V0}),I0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O0(t,e){return i.openBlock(),i.createElementBlock("svg",I0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const z0=i.markRaw({name:"tabler-phone-call",render:O0}),L0={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},D0=["href"],H0=["href"],W0=["href"],j0=["href"],q0={},X0=i.defineComponent({...q0,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?sr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return F.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return F.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return F.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=z0,h=Vd,f=Md,m=Ad,g=Fd;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=u=>a.value=!a.value),onFocusout:c[1]||(c[1]=u=>a.value=!1),onMouseleave:c[2]||(c[2]=u=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",L0,[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,D0)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(f)],8,H0)):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(m)],8,W0)):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(g)],8,j0)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Y0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U0(t,e){return i.openBlock(),i.createElementBlock("svg",Y0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const G0=i.markRaw({name:"mdi-envelope",render:U0}),K0={class:"flex flex-col gap-1"},Z0={key:0,class:"mb-2 flex flex-col text-base"},Q0={key:0,class:"text-sc-dark-grey text-sm"},J0={key:1,class:"whitespace-nowrap text-sm"},eb={key:2,class:"whitespace-nowrap text-sm"},tb={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},nb=["href"],ib=["href"],rb=["href"],sb=["href"],ob=["href"],ab={key:0,class:"flex flex-col text-base"},lb={key:0,class:"text-sc-dark-grey text-sm"},cb={key:1,class:"mt-2 text-sm"},db={key:0,class:"-mt-1"},hb={},ub=i.defineComponent({...hb,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?sr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return F.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return F.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return F.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const h=Vd,f=Md,m=Ad,g=Fd,u=G0,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",K0,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,R,k,w;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=C=>l.value=!0),onFocusin:d[1]||(d[1]=C=>l.value=!0),onMouseleave:d[2]||(d[2]=C=>l.value=!1),onFocusout:d[3]||(d[3]=C=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(R=t.contact)!=null&&R.position)?(i.openBlock(),i.createElementBlock("div",Z0,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",Q0,i.toDisplayString((w=t.contact)==null?void 0:w.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",J0,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",eb,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",tb,[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,nb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,ib)):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(m)],8,rb)):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(g)],8,sb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(u)],8,ob)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,R,k,w;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",ab,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",lb,i.toDisplayString((R=t.contact)==null?void 0:R.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(k=t.contact)!=null&&k.comment?(i.openBlock(),i.createElementBlock("div",cb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((w=t.contact)==null?void 0:w.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",db,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class fb{constructor(e){v(this,"minHeight");v(this,"maxHeights");v(this,"minWidth");v(this,"maxWidths");v(this,"netType");v(this,"color");v(this,"mountType");v(this,"descriptions");v(this,"crossbarCount");v(this,"heightOverlaps");v(this,"widthOverlaps");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Os.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Os.objectToSnake(e.heightOverlaps),this.widthOverlaps=Os.objectToSnake(e.widthOverlaps)}}const gb={class:"flex flex-wrap gap-2"},mb={class:"flex flex-col"},pb={class:"flex flex-col"},yb={},bb=i.defineComponent({...yb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Z.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return F.forOwn(Z.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Ln.startOfDay(new Date(a)):void 0,to:l?Ln.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,m,g,u,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",gb,[i.createVNode(d,{value:((f=(h=t.dateRange)==null?void 0:h.from)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(m=t.disabled)==null?void 0:m.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",mb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var R,k;return o((R=b==null?void 0:b.from)==null?void 0:R.getTime(),(k=b==null?void 0:b.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((u=(g=t.dateRange)==null?void 0:g.to)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",pb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var R,k;return o((R=b==null?void 0:b.from)==null?void 0:R.getTime(),(k=b==null?void 0:b.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),_b={class:"sc-lbl-date text-nowrap"},wb={},Oo=i.defineComponent({...wb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Ln.format(e.date,Z.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Ln.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",_b,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),xb={class:"flex flex-row gap-2.5"},vb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},kb={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Cb={class:"mb-0.5 sm:mb-0 sm:ml-3"},Sb={},Bb=i.defineComponent({...Sb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=hs,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",xb,[i.createElementVNode("div",vb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",kb,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",Cb,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),Tb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Rb(t,e){return i.openBlock(),i.createElementBlock("svg",Tb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const $b=i.markRaw({name:"ion-download-outline",render:Rb}),Pb={},Eb=i.defineComponent({...Pb,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=$b;return i.openBlock(),i.createBlock(i.unref(z.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Nb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fb(t,e){return i.openBlock(),i.createElementBlock("svg",Nb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const Ab=i.markRaw({name:"ion-checkmark-done-sharp",render:Fb}),Mb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vb(t,e){return i.openBlock(),i.createElementBlock("svg",Mb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const Ib=i.markRaw({name:"ion-options-outline",render:Vb}),Ob={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},zb={class:"flex-auto"},Lb={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Db={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Hb={},zo=i.defineComponent({...Hb,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=Ib,f=z.NButton,m=z.NPopover,g=Ab,u=hs;return i.openBlock(),i.createElementBlock("div",Ob,[i.createElementVNode("div",zb,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Lb,[i.createElementVNode("div",Db,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(m,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(m,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),Wb={},Id=i.defineComponent({...Wb,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(zo,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(zo,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),jb={},qb=i.defineComponent({...jb,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=F.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Xb={},Yb=i.defineComponent({...Xb,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=F.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(F.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(F.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof sr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=sr.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof sr.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Hu.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),Ub=ri(Yb,[["__scopeId","data-v-751dbb0e"]]),Gb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Kb(t,e){return i.openBlock(),i.createElementBlock("svg",Gb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const Zb=i.markRaw({name:"tabler-external-link",render:Kb}),Qb={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Jb=["href"],e_={},t_=i.defineComponent({...e_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Zb,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(F.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Qb,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Jb),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(t,e){return i.openBlock(),i.createElementBlock("svg",n_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const r_=i.markRaw({name:"ion-remove-circle-outline",render:i_});let fs=[];const Od=new WeakMap;function s_(){fs.forEach(t=>t(...Od.get(t))),fs=[]}function zd(t,...e){Od.set(t,e),!fs.includes(t)&&fs.push(t)===1&&requestAnimationFrame(s_)}function mr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function pr(t){return t.composedPath()[0]||null}function yr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function br(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Zt(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Ld={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function o_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function a_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const yn="^\\s*",bn="\\s*$",Xn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",It="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",hi="([0-9A-Fa-f])",ui="([0-9A-Fa-f]{2})",Dd=new RegExp(`${yn}hsl\\s*\\(${It},${Xn},${Xn}\\)${bn}`),Hd=new RegExp(`${yn}hsv\\s*\\(${It},${Xn},${Xn}\\)${bn}`),Wd=new RegExp(`${yn}hsla\\s*\\(${It},${Xn},${Xn},${It}\\)${bn}`),jd=new RegExp(`${yn}hsva\\s*\\(${It},${Xn},${Xn},${It}\\)${bn}`),l_=new RegExp(`${yn}rgb\\s*\\(${It},${It},${It}\\)${bn}`),c_=new RegExp(`${yn}rgba\\s*\\(${It},${It},${It},${It}\\)${bn}`),d_=new RegExp(`${yn}#${hi}${hi}${hi}${bn}`),h_=new RegExp(`${yn}#${ui}${ui}${ui}${bn}`),u_=new RegExp(`${yn}#${hi}${hi}${hi}${hi}${bn}`),f_=new RegExp(`${yn}#${ui}${ui}${ui}${ui}${bn}`);function Et(t){return parseInt(t,16)}function g_(t){try{let e;if(e=Wd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),gi(e[13])];if(e=Dd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function m_(t){try{let e;if(e=jd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),gi(e[13])];if(e=Hd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function fi(t){try{let e;if(e=h_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),1];if(e=l_.exec(t))return[gt(e[1]),gt(e[5]),gt(e[9]),1];if(e=c_.exec(t))return[gt(e[1]),gt(e[5]),gt(e[9]),gi(e[13])];if(e=d_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),1];if(e=f_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),gi(Et(e[4])/255)];if(e=u_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),gi(Et(e[4]+e[4])/255)];if(t in Ld)return fi(Ld[t]);if(Dd.test(t)||Wd.test(t)){const[n,r,s,o]=g_(t);return[...a_(n,r,s),o]}else if(Hd.test(t)||jd.test(t)){const[n,r,s,o]=m_(t);return[...o_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function p_(t){return t>1?1:t<0?0:t}function Lo(t,e,n,r){return`rgba(${gt(t)}, ${gt(e)}, ${gt(n)}, ${p_(r)})`}function Do(t,e,n,r,s){return gt((t*e*(1-r)+n*r)/s)}function y_(t,e){Array.isArray(t)||(t=fi(t)),Array.isArray(e)||(e=fi(e));const n=t[3],r=e[3],s=gi(n+r-n*r);return Lo(Do(t[0],n,e[0],r,s),Do(t[1],n,e[1],r,s),Do(t[2],n,e[2],r,s),s)}function Ve(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:fi(t);return typeof e.alpha=="number"?Lo(n,r,s,e.alpha):Lo(n,r,s,o)}function gs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:fi(t),{lightness:a=1,alpha:l=1}=e;return b_([n*a,r*a,s*a,o*l])}function gi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function ms(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function gt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Yn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function b_(t){const[e,n,r]=t;return 3 in t?`rgba(${gt(e)}, ${gt(n)}, ${gt(r)}, ${gi(t[3])})`:`rgba(${gt(e)}, ${gt(n)}, ${gt(r)}, 1)`}function __(t=8){return Math.random().toString(16).slice(2,2+t)}function qd(t){return Array.isArray(t)?t:[t]}const Ho={STOP:"STOP"};function Xd(t,e){const n=e(t);t.children!==void 0&&n!==Ho.STOP&&t.children.forEach(r=>Xd(r,e))}function w_(t,e={}){const{preserveGroup:n=!1}=e,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(t),r}function x_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function v_(t){return t.children}function k_(t){return t.key}function C_(){return!1}function S_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function B_(t){return t.disabled===!0}function T_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function R_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Wo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function jo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function $_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function P_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function E_(t){return(t==null?void 0:t.type)==="group"}function N_(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class F_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function A_(t,e,n,r){return ps(e.concat(t),n,r,!1)}function M_(t,e){const n=new Set;return t.forEach(r=>{const s=e.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function V_(t,e,n,r){const s=ps(e,n,r,!1),o=ps(t,n,r,!0),a=M_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function qo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:$_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:P_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let f;s!==void 0?f=V_(s,n,e,d):r!==void 0?f=A_(r,n,e,d):f=ps(n,e,d,!1);const m=c==="parent",g=c==="child"||l,u=f,p=new Set,b=Math.max.apply(null,Array.from(h.keys()));for(let y=b;y>=0;y-=1){const _=y===0,R=h.get(y);for(const k of R){if(k.isLeaf)continue;const{key:w,shallowLoaded:C}=k;if(g&&C&&k.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&u.has($.key)&&u.delete($.key)}),k.disabled||!C)continue;let S=!0,T=!1,B=!0;for(const $ of k.children){const M=$.key;if(!$.disabled){if(B&&(B=!1),u.has(M))T=!0;else if(p.has(M)){T=!0,S=!1;break}else if(S=!1,T)break}}S&&!B?(m&&k.children.forEach($=>{!$.disabled&&u.has($.key)&&u.delete($.key)}),u.add(w)):T&&p.add(w),_&&g&&u.has(w)&&u.delete(w)}}return{checkedKeys:Array.from(u),indeterminateKeys:Array.from(p)}}function ps(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&Xd(d,h=>{if(h.disabled)return Ho.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),T_(h.rawNode,o))){if(r)return Ho.STOP;if(!n)throw new F_}})}),l}function I_(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function O_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function z_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Yd(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?L_:z_,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=Xo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=D_(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(t),l}function L_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function D_(t){return t.parent}function Xo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=Xo(d,e);if(h!==null)return h}else return d}}return null}const H_={getChild(){return this.ignored?null:Xo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Yd(this,"next",t)},getPrev(t={}){return Yd(this,"prev",t)}};function W_(t,e){const n=e?new Set(e):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(t),r}function j_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var q_={};function Ud(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;q_.NODE_ENV!=="production"&&R_(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===t.length,f.parent=o,!f.ignored){const m=s(c);Array.isArray(m)&&(f.children=Ud(m,e,n,r,s,f,a+1))}l.push(f),e.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function X_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=B_,getIgnored:a=C_,getIsGroup:l=E_,getKey:c=k_}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:v_,h=e.ignoreEmptyChildren?k=>{const w=d(k);return Array.isArray(w)?w.length?w:null:w}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return x_(this.rawNode,h)},get shallowLoaded(){return S_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(k){return j_(this,k)}},H_),m=Ud(t,r,s,f,h);function g(k){if(k==null)return null;const w=r.get(k);return w&&!w.isGroup&&!w.ignored?w:null}function u(k){if(k==null)return null;const w=r.get(k);return w&&!w.ignored?w:null}function p(k,w){const C=u(k);return C?C.getPrev(w):null}function b(k,w){const C=u(k);return C?C.getNext(w):null}function y(k){const w=u(k);return w?w.getParent():null}function _(k){const w=u(k);return w?w.getChild():null}const R={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(k){return W_(m,k)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return O_(m)},getPath(k,w={}){return I_(k,w,R)},getCheckedKeys(k,w={}){const{cascade:C=!0,leafOnly:S=!1,checkStrategy:T="all",allowNotLoaded:B=!1}=w;return qo({checkedKeys:Wo(k),indeterminateKeys:jo(k),cascade:C,leafOnly:S,checkStrategy:T,allowNotLoaded:B},R)},check(k,w,C={}){const{cascade:S=!0,leafOnly:T=!1,checkStrategy:B="all",allowNotLoaded:$=!1}=C;return qo({checkedKeys:Wo(w),indeterminateKeys:jo(w),keysToCheck:k==null?[]:qd(k),cascade:S,leafOnly:T,checkStrategy:B,allowNotLoaded:$},R)},uncheck(k,w,C={}){const{cascade:S=!0,leafOnly:T=!1,checkStrategy:B="all",allowNotLoaded:$=!1}=C;return qo({checkedKeys:Wo(w),indeterminateKeys:jo(w),keysToUncheck:k==null?[]:qd(k),cascade:S,leafOnly:T,checkStrategy:B,allowNotLoaded:$},R)},getNonLeafKeys(k={}){return w_(m,k)}};return R}function ys(t){return t.composedPath()[0]}const Y_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function U_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(ys(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(ys(a))},o=a=>{r&&(e.contains(ys(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Gd(t,e,n){const r=Y_[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=U_(t,e,n)),o}function G_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Gd(t,e,n);return Object.keys(s).forEach(o=>{St(o,document,s[o],r)}),!0}return!1}function K_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Gd(t,e,n);return Object.keys(s).forEach(o=>{nt(o,document,s[o],r)}),!0}return!1}function Z_(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(S,T,B){const $=S[T];return S[T]=function(){return B.apply(S,arguments),$.apply(S,arguments)},S}function o(S,T){S[T]=Event.prototype[T]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var S;return(S=a.get(this))!==null&&S!==void 0?S:null}function d(S,T){l!==void 0&&Object.defineProperty(S,"currentTarget",{configurable:!0,enumerable:!0,get:T??l.get})}const h={bubble:{},capture:{}},f={};function m(){const S=function(T){const{type:B,eventPhase:$,bubbles:M}=T,E=ys(T);if($===2)return;const V=$===1?"capture":"bubble";let L=E;const D=[];for(;L===null&&(L=window),D.push(L),L!==window;)L=L.parentNode||null;const te=h.capture[B],ne=h.bubble[B];if(s(T,"stopPropagation",n),s(T,"stopImmediatePropagation",r),d(T,c),V==="capture"){if(te===void 0)return;for(let A=D.length-1;A>=0&&!t.has(T);--A){const I=D[A],j=te.get(I);if(j!==void 0){a.set(T,I);for(const q of j){if(e.has(T))break;q(T)}}if(A===0&&!M&&ne!==void 0){const q=ne.get(I);if(q!==void 0)for(const N of q){if(e.has(T))break;N(T)}}}}else if(V==="bubble"){if(ne===void 0)return;for(let A=0;A<D.length&&!t.has(T);++A){const I=D[A],j=ne.get(I);if(j!==void 0){a.set(T,I);for(const q of j){if(e.has(T))break;q(T)}}}}o(T,"stopPropagation"),o(T,"stopImmediatePropagation"),d(T)};return S.displayName="evtdUnifiedHandler",S}function g(){const S=function(T){const{type:B,eventPhase:$}=T;if($!==2)return;const M=f[B];M!==void 0&&M.forEach(E=>E(T))};return S.displayName="evtdUnifiedWindowEventHandler",S}const u=m(),p=g();function b(S,T){const B=h[S];return B[T]===void 0&&(B[T]=new Map,window.addEventListener(T,u,S==="capture")),B[T]}function y(S){return f[S]===void 0&&(f[S]=new Set,window.addEventListener(S,p)),f[S]}function _(S,T){let B=S.get(T);return B===void 0&&S.set(T,B=new Set),B}function R(S,T,B,$){const M=h[T][B];if(M!==void 0){const E=M.get(S);if(E!==void 0&&E.has($))return!0}return!1}function k(S,T){const B=f[S];return!!(B!==void 0&&B.has(T))}function w(S,T,B,$){let M;if(typeof $=="object"&&$.once===!0?M=te=>{C(S,T,M,$),B(te)}:M=B,G_(S,T,M,$))return;const V=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",L=b(V,S),D=_(L,T);if(D.has(M)||D.add(M),T===window){const te=y(S);te.has(M)||te.add(M)}}function C(S,T,B,$){if(K_(S,T,B,$))return;const E=$===!0||typeof $=="object"&&$.capture===!0,V=E?"capture":"bubble",L=b(V,S),D=_(L,T);if(T===window&&!R(T,E?"bubble":"capture",S,B)&&k(S,B)){const ne=f[S];ne.delete(B),ne.size===0&&(window.removeEventListener(S,p),f[S]=void 0)}D.has(B)&&D.delete(B),D.size===0&&L.delete(T),L.size===0&&(window.removeEventListener(S,u,V==="capture"),h[V][S]=void 0)}return{on:w,off:C}}const{on:St,off:nt}=Z_(),Ui="@@mmoContext",Q_={mounted(t,{value:e}){t[Ui]={handler:void 0},typeof e=="function"&&(t[Ui].handler=e,St("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ui];typeof e=="function"?n.handler?n.handler!==e&&(nt("mousemoveoutside",t,n.handler),n.handler=e,St("mousemoveoutside",t,e)):(t[Ui].handler=e,St("mousemoveoutside",t,e)):n.handler&&(nt("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ui];e&&nt("mousemoveoutside",t,e),t[Ui].handler=void 0}},Gi="@@coContext",bs={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,St("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,St("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,St("clickoutside",t,e,{capture:n.capture})):r.handler&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&nt("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function J_(t,e){console.error(`[vdirs/${t}]: ${e}`)}class e1{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&J_("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Yo=new e1,Ki="@@ziContext",Kd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Ki]={enabled:!!s,initialized:!1},s&&(Yo.ensureZIndex(t,r),t[Ki].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Ki].enabled;s&&!o&&(Yo.ensureZIndex(t,r),t[Ki].initialized=!0),t[Ki].enabled=!!s},unmounted(t,e){if(!t[Ki].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Yo.unregister(t,r)}};function t1(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function qt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const n1=typeof window<"u";let Zi,_r;(()=>{var t,e;Zi=n1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,_r=!1,Zi!==void 0?Zi.then(()=>{_r=!0}):_r=!0})();function i1(t){if(_r)return;let e=!1;i.onMounted(()=>{_r||Zi==null||Zi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Uo(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function _s(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function Zd(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const r1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function s1(){return r1}function Go(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Ko(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Ko(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ko(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Un=null;function Jd(){if(Un===null&&(Un=document.getElementById("v-binder-view-measurer"),Un===null)){Un=document.createElement("div"),Un.id="v-binder-view-measurer";const{style:t}=Un;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Un)}return Un.getBoundingClientRect()}function o1(t,e){const n=Jd();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Zo(t){const e=t.getBoundingClientRect(),n=Jd();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function a1(t){return t.nodeType===9?null:t.parentNode}function eh(t){if(t===null)return null;const e=a1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return eh(e)}const th=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=eh(y),y!==null;)o.push(y);for(const _ of o)St("scroll",_,f,!0)},l=()=>{for(const y of o)nt("scroll",y,f,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},f=()=>{zd(m)},m=()=>{c.forEach(y=>y())},g=new Set,u=y=>{g.size===0&&St("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&nt("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{nt("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:u,removeResizeListener:p}},render(){return Go("binder",this.$slots)}}),nh=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(Qd("follower",this.$slots),[[e]]):Qd("follower",this.$slots)}}),l1="@css-render/vue3-ssr";function c1(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},es=zi.Multiply,Dm=[1,0,0,0,1,0,0,0,1],qn=new cn(9),Hm=ft.Utils,kc=new Z,_o=new cn([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:De.document?De.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new zi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)_e.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ft.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)_e.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ft.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,f,m,g,u,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,R=t.renderer.ratio,k=kc.copy(e._renderer.scale).multiply(R),w=e._stroke,C=e._linewidth,S=e._fill,T=e._renderer.opacity||e._opacity,B=e._cap,$=e._join,M=e._miter,E=e._closed,V=e.dashes,L=b.length,D=L-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*k.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*k.y),1);const te=e._renderer.rect.centroid,ne=te.x,A=te.y;if(_.clearRect(0,0,y.width,y.height),S)if(typeof S=="string")_.fillStyle=S;else{const oe=ft.Utils.getRendererType(S._renderer.type);_e[oe].render.call(S,_,e),_.fillStyle=S._renderer.effect}if(w){if(typeof w=="string")_.strokeStyle=w;else{const oe=ft.Utils.getRendererType(w._renderer.type);_e[oe].render.call(w,_,e),_.strokeStyle=w._renderer.effect}C&&(_.lineWidth=dn(e)),M&&(_.miterLimit=M),$&&(_.lineJoin=$),!E&&B&&(_.lineCap=B)}typeof T=="number"&&(_.globalAlpha=T),V&&V.length>0&&(_.lineDashOffset=V.offset||0,_.setLineDash(V));let I,j,q,N,O,Y,re,de;_.save(),_.scale(k.x,k.y),_.translate(ne,A),_.beginPath();for(let oe=0;oe<b.length;oe++){const ie=b[oe];switch(g=ie.x,u=ie.y,ie.command){case J.close:_.closePath();break;case J.arc:j=ie.rx,q=ie.ry,N=ie.xAxisRotation,O=ie.largeArcFlag,Y=ie.sweepFlag,n=E?Mt(oe-1,L):Math.max(oe-1,0),r=b[n],re=r.x,de=r.y,Hm.renderSvgArcCommand(_,re,de,j,q,O,Y,N,g,u);break;case J.curve:n=E?Mt(oe-1,L):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||Z.zero,h=ie.controls&&ie.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ie._relative?(o=h.x+ie.x,a=h.y+ie.y):(o=h.x,a=h.y),_.bezierCurveTo(l,c,o,a,g,u),oe>=D&&E&&(s=I,f=ie.controls&&ie.controls.right||Z.zero,m=s.controls&&s.controls.left||Z.zero,ie._relative?(l=f.x+ie.x,c=f.y+ie.y):(l=f.x,c=f.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,u=s.y,_.bezierCurveTo(l,c,o,a,g,u));break;case J.line:_.lineTo(g,u);break;case J.move:I=ie,_.moveTo(g,u);break}}E&&_.closePath(),_e.isHidden.test(S)||(p=S._renderer&&S._renderer.offset,p&&(_.save(),_.translate(-S._renderer.offset.x,-S._renderer.offset.y),_.scale(S._renderer.scale.x,S._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y),_.lineWidth=C/w._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const h=d.x,f=d.y,m=d.controls;let g,u,p,b,y,_;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(g=d._relative?y.x+h:y.x,u=d._relative?y.y+f:y.y,p=d._relative?_.x+h:_.x,b=d._relative?_.y+f:_.y,!(!g||!u||!p||!b)&&(o=Math.min(u,b,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(u,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(t,e,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ft.Utils.getRendererType(this._renderer.type),o=e[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let f,m;this._scale instanceof Z?(f=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=m<0?-m:m,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const f=ft.Utils.getRendererType(this._mask._renderer.type);_e[f].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,_o,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._size*o;let m=f;_e.isHidden.test(a)||(m+=l),r.width=ul(m),r.height=r.width;const g=m/r.width,u=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ft.Utils.getRendererType(c._renderer.type);_e[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ft.Utils.getRendererType(a._renderer.type);_e[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=dn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(u,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,f/g*.5,0,ht),s.restore(),closed&&s.closePath(),_e.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),_e.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,u=this._flagVertices,p=this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||f){this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let b,y;this._scale instanceof Z?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=s)}if(u){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=kc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,f=e._decoration,m=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const g=e._renderer.rect.centroid,u=g.x,p=g.y;let b,y,_,R,k,w,C,S,T,B,$;const M=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),M||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=m,c)if(typeof c=="string")r.fillStyle=c;else{const E=ft.Utils.getRendererType(c._renderer.type);_e[E].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const E=ft.Utils.getRendererType(a._renderer.type);_e[E].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=dn(e))}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(u,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(w=c._renderer.scale.x,C=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(w,C),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,R=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,R),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(w=a._renderer.scale.x,C=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(w,C),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,R=a._renderer.offset.y/a._renderer.scale.y,k=l/a._renderer.scale.x,r.lineWidth=k,r.strokeText(e.value,_,R),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const E=r.measureText(e.value);switch(f){case"underline":T=E.actualBoundingBoxDescent,$=E.actualBoundingBoxDescent;break;case"strikethrough":T=0,$=0;break}S=-E.width/2,B=E.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(S,T),r.lineTo(B,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=_e.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ft.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[t._alignment]||t._alignment){case _e.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case _e.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof He&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof He&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new cn(9)),this._matrix.toTransformArray(!0,qn),es(qn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,f;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ft.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,_o,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ft.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(_e,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),G.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new Pt("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];e[s]=_e.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new zr};_e.ctx=_e.canvas.getContext("2d");var Cc=class extends X{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(_e.canvas=t.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new st,this.scene.parent=this,this._renderer={type:"renderer",matrix:new cn(Dm),scale:1,opacity:1},this._flagMatrix=!0,t=G.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new Pt("unable to create a webgl context. Try using another renderer.");r=Wt.create(e,Wt.path.vertex,Wt.types.vertex),s=Wt.create(e,Wt.path.fragment,Wt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=_e.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,_o,e.STATIC_DRAW),r=Wt.create(e,Wt.points.vertex,Wt.types.vertex),s=Wt.create(e,Wt.points.fragment,Wt.types.fragment),n=this.programs.points=_e.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Us(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,G.isObject(this.domElement.style)&&G.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(X.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};x(Cc,"Utils",_e);var Wm=G.extend({Error:Pt,getRatio:Us,read:ze,xhr:yc},G,xt,ll,cl),xe=class Ar{constructor(e){x(this,"_events",new X),x(this,"type",""),x(this,"renderer",null),x(this,"scene",null),x(this,"width",0),x(this,"height",0),x(this,"frameCount",0),x(this,"timeDelta",0),x(this,"playing",!1);const n=G.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Ar.Types.svg,autostart:!1});if(G.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),G.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Ar.Types[r])}this.renderer=new Ar[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=jm.bind(this),this.fit.domElement=window,this.fit.attached=!0,G.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),G.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Vt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=qm.bind(this),G.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(X.Types.resize,Xm.bind(this)),this.scene=this.renderer.scene,Ar.Instances.push(this),n.autostart&&hr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,hr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=G.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Vt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(X.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(X.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,n,r,s){const o=new Gr(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ke(e,n,void 0,void 0,void 0,void 0,J.move),new ke(r,s,void 0,void 0,void 0,void 0,J.line),new ke(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,J.line),new ke(r,s,void 0,void 0,void 0,void 0,J.move),new ke(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,J.line)],d=new Te(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new jn(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Xr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new jr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new qr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new co(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ke(l,c))}}const r=arguments[n-1],s=new Te(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new lo(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new no(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new Z(a,l))}}const s=new ao(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ke(c,d))}}const s=arguments[n-1],o=new Te(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new hn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new He(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new We(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Wr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new bc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new go(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Me(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new st;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof st?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new st;let s,o,a;const l=(function(c){for(Vt.temp.innerHTML=c,o=0;o<Vt.temp.children.length;o++)s=Vt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Vt.temp.children.length<=1?Vt.temp.children[0]:Vt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(yc(e,l),r):(l(e),r)}};x(xe,"NextFrameId",vt.NextFrameId),x(xe,"Types",vt.Types),x(xe,"Version",vt.Version),x(xe,"PublishDate",vt.PublishDate),x(xe,"Identifier",vt.Identifier),x(xe,"Resolution",vt.Resolution),x(xe,"AutoCalculateImportedMatrices",vt.AutoCalculateImportedMatrices),x(xe,"Instances",vt.Instances),x(xe,"uniqueId",vt.uniqueId),x(xe,"Anchor",ke),x(xe,"Collection",Dn),x(xe,"Events",X),x(xe,"Group",st),x(xe,"Matrix",zi),x(xe,"Path",Te),x(xe,"Registry",zr),x(xe,"Element",Oi),x(xe,"Shape",Wn),x(xe,"Text",hn),x(xe,"Vector",Z),x(xe,"Gradient",et),x(xe,"Image",bc),x(xe,"ImageSequence",go),x(xe,"LinearGradient",He),x(xe,"RadialGradient",We),x(xe,"Sprite",Wr),x(xe,"Stop",Hn),x(xe,"Texture",Me),x(xe,"ArcSegment",no),x(xe,"Circle",jr),x(xe,"Ellipse",qr),x(xe,"Line",Gr),x(xe,"Points",ao),x(xe,"Polygon",lo),x(xe,"Rectangle",jn),x(xe,"RoundedRectangle",Xr),x(xe,"Star",co),x(xe,"CanvasRenderer",ft),x(xe,"SVGRenderer",vc),x(xe,"WebGLRenderer",Cc),x(xe,"Commands",J),x(xe,"Utils",Wm);var fn=xe;function jm(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function qm(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function Xm(t,e){this.width=t,this.height=e,this.trigger(X.Types.resize,t,e)}var hr=Vt.getRequestAnimationFrame();function Sc(){for(let t=0;t<fn.Instances.length;t++){const e=fn.Instances[t];e.playing&&e.update()}fn.NextFrameId=hr(Sc)}hr.init=function(){Sc(),hr.init=function(){}};let gn;typeof window<"u"?gn=window:typeof global<"u"?gn=global:typeof self<"u"&&(gn=self);let Bc;const ai=Math.PI*2,ot=Math.PI*.5;function Ym(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Um(t){Bc=t}function Gm(t,e){e=e&&e.identity()||new Bc;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function jt(t,e,n){return n*(e-t)+t}function Hi(t,e){for(;t<0;)t+=e;return t%e}const Tc=gn.Float32Array||Array,Km=Math.floor;function mn(t){return Km(t*1e6)/1e6}const ge={move:"M",line:"L",curve:"C",close:"Z"};class U{constructor(){v(this,"_events",{});v(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}}v(U,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),v(U,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Rc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(U.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(U.Types.change))}}},lt=class lt extends U{constructor(n=0,r=0){super();v(this,"_x",0);v(this,"_y",0);for(let s in Rc)Object.defineProperty(this,s,Rc[s]);this.x=n,this.y=r}static add(n,r){return new lt(n.x+r.x,n.y+r.y)}static sub(n,r){return new lt(n.x-r.x,n.y-r.y)}static subtract(n,r){return lt.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(lt.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new lt(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:mn(this.x),y:mn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};v(lt,"zero",new lt),v(lt,"left",new lt(-1,0)),v(lt,"right",new lt(1,0)),v(lt,"up",new lt(0,-1)),v(lt,"down",new lt(0,1));let pe=lt;class Pe extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=ge.move){super(n,r);v(this,"controls",{left:new pe,right:new pe});v(this,"_command",ge.move);v(this,"_relative",!0);v(this,"_rx",0);v(this,"_ry",0);v(this,"_xAxisRotation",0);v(this,"_largeArcFlag",0);v(this,"_sweepFlag",1);for(let h in $c)Object.defineProperty(this,h,$c[h]);this.command=c,this.relative=!0;const d=Pe.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(U.Types.change,d),this.controls.right.set(a,l).addEventListener(U.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(U.Types.change)}}static fromObject(n){return new Pe().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Pe().copy(this)}toObject(){return{x:mn(this.x),y:mn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:mn(this.rx),ry:mn(this.ry),xAxisRotation:mn(this.xAxisRotation),largeArcFlag:mn(this.largeArcFlag),sweepFlag:mn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const $c={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(U.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(U.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(U.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(U.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(U.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}}};let Zm=0;const wo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Zm++}},ts={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ns(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Pc(t,e,n,r,s,o,a,l,c){c=c||ts.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Pe(a,l)];const h=[];for(let f=0;f<d;f++){const m=f/d,g=ns(m,t,n,s,a),u=ns(m,e,r,o,l);h.push(new Pe(g,u))}return h}function Qm(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,f=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,u=3*(r-e);function p(b){const y=(d*b+h)*b+f,_=(m*b+g)*b+u;return Math.sqrt(y*y+_*_)}return ep(p,0,1,c||ts.RecursionLimit)}function Jm(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,m,g,u,p,b,y;for(let w=0;w<2;++w){if(w===0?(f=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(f=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(f)<.001)continue;g=-m/f,0<g&&g<1&&c.push(g);continue}b=f*f-4*m*h,y=Math.sqrt(b),!(b<0)&&(u=(-f+y)/(2*h),0<u&&u<1&&c.push(u),p=(-f-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,R=_,k;for(;_--;)g=c[_],k=1-g,d[0][_]=k*k*k*t+3*k*k*g*n+3*k*g*g*s+g*g*g*a,d[1][_]=k*k*k*e+3*k*k*g*r+3*k*g*g*o+g*g*g*l;return d[0][R]=t,d[1][R]=e,d[0][R+1]=a,d[1][R+1]=l,d[0].length=d[1].length=R+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 ep(t,e,n,r){let s=ts.abscissas[r-2],o=ts.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(t(l+f)+t(l-f))}return a*h}function tp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Hi(s-1,n):Math.max(s-1,0),l=e?Hi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];np(c,d,h),d.command=s===0?ge.move:ge.curve}}function np(t,e,n){const r=pe.angleBetween(t,e),s=pe.angleBetween(n,e);let o=pe.distanceBetween(t,e),a=pe.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=ot:l-=ot,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let ur=(ki=class extends U{constructor(){super();v(this,"_flagId",!1);v(this,"_flagClassName",!1);v(this,"_renderer",{});v(this,"_id",wo.Identifier+wo.uniqueId());v(this,"_className","");v(this,"classList",[]);for(let n in Ec)Object.defineProperty(this,n,Ec[n])}static fromObject(n){const r=new ki().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},v(ki,"Properties",["renderer","id","className"]),ki);const Ec={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class is extends Error{constructor(n){super();v(this,"name","Two.js");v(this,"message");this.message=n}}class ip{constructor(){v(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let rs;const Nc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};gn.document&&(rs=document.createElement("a"));const qe=class qe extends ur{constructor(n,r){super();v(this,"_flagSrc",!1);v(this,"_flagImage",!1);v(this,"_flagVideo",!1);v(this,"_flagLoaded",!1);v(this,"_flagRepeat",!1);v(this,"_flagOffset",!1);v(this,"_flagScale",!1);v(this,"_src","");v(this,"_image",null);v(this,"_loaded",!1);v(this,"_repeat","no-repeat");v(this,"_scale",1);v(this,"_offset",null);for(let s in Fc)Object.defineProperty(this,s,Fc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=rp.bind(this),this._renderer.flagScale=sp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const s=(function(){this.unbind(U.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(U.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new qe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return rs?(rs.href=n,rs.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=qe.getAbsoluteURL(n);if(qe.ImageRegistry.contains(r))return qe.ImageRegistry.get(r);let s;return gn.document?Nc.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=qe.getTag(s);n._flagImage&&(/canvas/i.test(o)?qe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,qe.Register[o](n,r))),n._flagSrc&&(s||(s=qe.getImage(n.src),n.image=s),o=qe.getTag(s),qe.Register[o](n,r))}clone(){const n=new qe(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof pe?n.offset:new pe().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(U.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,qe.load(this,(function(){this.loaded=!0,this.trigger(U.Types.change).trigger(U.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};v(qe,"Properties",["src","loaded","repeat","scale","offset","image"]),v(qe,"RegularExpressions",Nc),v(qe,"ImageRegistry",new ip),v(qe,"Register",{canvas:function(n,r){n._src="#"+n.id,qe.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new is("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=qe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),qe.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new is("unable to load "+n.src)};n._src=qe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),qe.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let je=qe;const Fc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=je.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}je.ImageRegistry.contains(n)?this._image=je.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(U.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(U.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(U.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(U.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function rp(){this._flagOffset=!0}function sp(){this._flagScale=!0}class li extends Array{constructor(){super();Da(this,ct,new U);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Rt(this,ct)}set _events(n){Lu(this,ct,n)}get _bound(){return Rt(this,ct)._bound}set _bound(n){Rt(this,ct)._bound=n}addEventListener(){return Rt(this,ct).addEventListener.apply(this,arguments)}on(){return Rt(this,ct).on.apply(this,arguments)}bind(){return Rt(this,ct).bind.apply(this,arguments)}removeEventListener(){return Rt(this,ct).removeEventListener.apply(this,arguments)}off(){return Rt(this,ct).off.apply(this,arguments)}unbind(){return Rt(this,ct).unbind.apply(this,arguments)}dispatchEvent(){return Rt(this,ct).dispatchEvent.apply(this,arguments)}trigger(){return Rt(this,ct).trigger.apply(this,arguments)}listen(){return Rt(this,ct).listen.apply(this,arguments)}ignore(){return Rt(this,ct).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(U.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(U.Types.insert,r),this.trigger(U.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(U.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(U.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}ct=new WeakMap;const Ac=Array.prototype.slice;function op(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Ee={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Ac.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!op(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:gn.performance&&gn.performance.now?gn.performance:Date},Nt=class Nt extends ur{constructor(n,r,s){super();v(this,"_flagOffset",!0);v(this,"_flagOpacity",!0);v(this,"_flagColor",!0);v(this,"_offset",0);v(this,"_opacity",1);v(this,"_color","#fff");for(let o in Mc)Object.defineProperty(this,o,Mc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Nt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Nt.Index<=0?"#fff":"#000",Nt.Index=(Nt.Index+1)%2}static fromObject(n){const r=new Nt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nt.Properties.length;r++){const s=Nt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Nt;return Ee.each(Nt.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Ee.each(Nt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};v(Nt,"Index",0),v(Nt,"Properties",["offset","opacity","color"]);let ci=Nt;const Mc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},wn=class wn extends ur{constructor(n){super();v(this,"_flagStops",!1);v(this,"_flagSpread",!1);v(this,"_flagUnits",!1);v(this,"_spread","");v(this,"_units","");for(let r in Vc)Object.defineProperty(this,r,Vc[r]);this._renderer.type="gradient",this._renderer.flagStops=ap.bind(this),this._renderer.bindStops=lp.bind(this),this._renderer.unbindStops=cp.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof ci?o:new ci().copy(o)));const s=new wn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new wn(r);return Ee.each(wn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ee.each(wn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};v(wn,"Stop",ci),v(wn,"Properties",["spread","stops","units"]);let tt=wn;const Vc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._stops=new li((t||[]).slice(0)),this._stops.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._stops)}}};function ap(){this._flagStops=!0}function lp(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function cp(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const Zn=class Zn extends tt{constructor(n,r,s,o,a){super(a);v(this,"_flagEndPoints",!1);v(this,"_left",null);v(this,"_right",null);for(let l in Ic)Object.defineProperty(this,l,Ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=dp.bind(this),this.left=new pe,this.right=new pe,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new Zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Zn.Properties.length;r++){const s=Zn.Properties[r];s in n&&(this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Zn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ee.each(tt.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};v(Zn,"Stop",ci),v(Zn,"Properties",["left","right"]);let kt=Zn;const Ic={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(U.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof pe&&this._right.unbind(U.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function dp(){this._flagEndPoints=!0}const xn=class xn extends tt{constructor(n,r,s,o,a,l){super(o);v(this,"_flagRadius",!1);v(this,"_flagCenter",!1);v(this,"_flagFocal",!1);v(this,"_radius",0);v(this,"_center",null);v(this,"_focal",null);for(let c in Oc)Object.defineProperty(this,c,Oc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=hp.bind(this),this._renderer.flagFocal=up.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new xn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ee.each(tt.Properties.concat(xn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ee.each(xn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};v(xn,"Stop",ci),v(xn,"Properties",["center","radius","focal"]);let Ct=xn;const Oc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(U.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(U.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(U.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(U.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function hp(){this._flagCenter=!0}function up(){this._flagFocal=!0}function zc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function ss(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Lc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Qm(r,l,s,c,o,d,a,h,n)}function Dc(t,e,n){let r,s,o,a,l,c,d,h;const f=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(f||e).x,c=(f||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,f&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Pc(r,l,s,c,o,d,a,h,n)}function di(t){switch(t.renderer.type){case"texture":return je.fromObject(t);case"gradient":return tt.fromObject(t);case"linear-gradient":return kt.fromObject(t);case"radial-gradient":return Ct.fromObject(t)}return t}const fp=Math.cos,gp=Math.sin,Hc=Math.tan,xo=[],Bt=class Bt extends U{constructor(n,r,s,o,a,l){super();v(this,"elements",new Tc(9));v(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const S=n;let T,B,$;const M=r[0]||0,E=r[1]||0,V=r[2]||0;return T=S[0]*M+S[1]*E+S[2]*V,B=S[3]*M+S[4]*E+S[5]*V,$=S[6]*M+S[7]*E+S[8]*V,[T,B,$]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],m=n[7],g=n[8],u=r[0],p=r[1],b=r[2],y=r[3],_=r[4],R=r[5],k=r[6],w=r[7],C=r[8];return s=s||new Tc(9),s[0]=o*u+a*y+l*k,s[1]=o*p+a*_+l*w,s[2]=o*b+a*R+l*C,s[3]=c*u+d*y+h*k,s[4]=c*p+d*_+h*w,s[5]=c*b+d*R+h*C,s[6]=f*u+m*y+g*k,s[7]=f*p+m*_+g*w,s[8]=f*b+m*R+g*C,s}static fromObject(n){return new Bt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(U.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(U.Types.change)}identity(){return this.elements[0]=Bt.Identity[0],this.elements[1]=Bt.Identity[1],this.elements[2]=Bt.Identity[2],this.elements[3]=Bt.Identity[3],this.elements[4]=Bt.Identity[4],this.elements[5]=Bt.Identity[5],this.elements[6]=Bt.Identity[6],this.elements[7]=Bt.Identity[7],this.elements[8]=Bt.Identity[8],this.trigger(U.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(U.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const D=a[0]*n+a[1]*r+a[2]*s,te=a[3]*n+a[4]*r+a[5]*s,ne=a[6]*n+a[7]*r+a[8]*s;return[D,te,ne]}const f=this.elements,m=[n,r,s,o,a,l,c,d,h],g=f[0],u=f[1],p=f[2],b=f[3],y=f[4],_=f[5],R=f[6],k=f[7],w=f[8],C=m[0],S=m[1],T=m[2],B=m[3],$=m[4],M=m[5],E=m[6],V=m[7],L=m[8];return this.elements[0]=g*C+u*B+p*E,this.elements[1]=g*S+u*$+p*V,this.elements[2]=g*T+u*M+p*L,this.elements[3]=b*C+y*B+_*E,this.elements[4]=b*S+y*$+_*V,this.elements[5]=b*T+y*M+_*L,this.elements[6]=R*C+k*B+w*E,this.elements[7]=R*S+k*$+w*V,this.elements[8]=R*T+k*M+w*L,this.trigger(U.Types.change)}inverse(n){const r=this.elements;n=n||new Bt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],m=r[8],g=m*c-d*f,u=-m*l+d*h,p=f*l-c*h;let b=s*g+o*u+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-m*o+a*f)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=u*b,n.elements[4]=(m*s-a*h)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-f*s+o*h)*b,n.elements[8]=(c*s-o*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=fp(n),s=gp(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=Hc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Hc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return xo.length=0,this.toTransformArray(n,xo),xo.map(mn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const m=s[6],g=s[7],u=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=h,r[5]=g,r[6]=c,r[7]=f,r[8]=u;return}return[a,d,m,l,h,g,c,f,u]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const m=s[6],g=s[7],u=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=m,r[7]=g,r[8]=u;return}return[a,l,c,d,h,f,m,g,u]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Bt().copy(this)}};v(Bt,"Identity",[1,0,0,0,1,0,0,0,1]);let fr=Bt;Um(fr);const Pr=class Pr extends ur{constructor(){super();v(this,"_flagMatrix",!0);v(this,"_flagScale",!1);v(this,"_matrix",null);v(this,"_worldMatrix",null);v(this,"_position",null);v(this,"_rotation",0);v(this,"_scale",1);v(this,"_skewX",0);v(this,"_skewY",0);for(let n in os)Object.defineProperty(this,n,os[n]);this._renderer.flagMatrix=Wc.bind(this),this.isShape=!0,this.matrix=new fr,this.worldMatrix=new fr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Pr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return os.position.get.apply(this,arguments)}set translation(n){os.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof pe?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new Pr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof pe?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof pe?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};v(Pr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Bn=Pr;const os={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(U.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(U.Types.change,this._renderer.flagMatrix),Wc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(U.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(U.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Gm(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Wc(){this._flagMatrix=!0}const Wi=Math.min,ji=Math.max,mp=Math.ceil,pp=Math.floor,yp=new pe,Jt=class Jt extends Bn{constructor(n,r,s,o){super();v(this,"_flagVertices",!0);v(this,"_flagLength",!0);v(this,"_flagFill",!0);v(this,"_flagStroke",!0);v(this,"_flagLinewidth",!0);v(this,"_flagOpacity",!0);v(this,"_flagVisible",!0);v(this,"_flagCap",!0);v(this,"_flagJoin",!0);v(this,"_flagMiter",!0);v(this,"_flagStrokeAttenuation",!0);v(this,"_flagMask",!1);v(this,"_flagClip",!1);v(this,"_length",0);v(this,"_fill","#fff");v(this,"_stroke","#000");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_cap","round");v(this,"_join","round");v(this,"_miter",4);v(this,"_closed",!0);v(this,"_curved",!1);v(this,"_automatic",!0);v(this,"_beginning",0);v(this,"_ending",1);v(this,"_mask",null);v(this,"_clip",!1);v(this,"_dashes",null);v(this,"_strokeAttenuation",!0);for(let a in jc)Object.defineProperty(this,a,jc[a]);this._renderer.type="path",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Gc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:di(n.fill),s=typeof n.stroke=="string"?n.stroke:di(n.stroke),o=new Jt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Pe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Pe().copy(s))}}for(let r=0;r<Jt.Properties.length;r++){const s=Jt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Jt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Jt.Properties.length;s++){const o=Jt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Ee.each(Jt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,f=1/0,m=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:u}=Ym(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof u=="number"&&(s=Math.max(g,u)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[g,u]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[R,k]=r.multiply(y,_),w=c.controls.left.x,C=c.controls.left.y;c.relative&&(w+=c.x,C+=c.y);let[S,T]=r.multiply(w,C);const B=Jm(g,u,R,k,S,T,p,b);f=Wi(B.min.y-s,f),d=Wi(B.min.x-s,d),h=ji(B.max.x+s,h),m=ji(B.max.y+s,m)}else a<=1&&(f=Wi(u-s,f),d=Wi(g-s,d),h=ji(g+s,h),m=ji(u+s,m)),f=Wi(b-s,f),d=Wi(p-s,d),h=ji(p+s,h),m=ji(b+s,m)}return{top:f,left:d,right:h,bottom:m,width:h-d,height:m-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,m,g,u,p,b,y,_,R=this.length*Math.min(Math.max(n,0),1);const k=this.vertices.length,w=k-1;let C=null,S=null;for(let A=0,I=this._lengths.length,j=0;A<I;A++){if(j+this._lengths[A]>=R){this._closed?(s=Hi(A,k),o=Hi(A-1,k),A===0&&(s=o,o=A)):(s=A,o=Math.min(Math.max(A-1,0),w)),C=this.vertices[s],S=this.vertices[o],R-=j,this._lengths[A]!==0?n=R/this._lengths[A]:n=0;break}j+=this._lengths[A]}if(C===null||S===null)return null;if(C){if(!S)return C}else return S;_=S.controls&&S.controls.right,y=C.controls&&C.controls.left,c=S.x,g=S.y,d=(_||S).x,u=(_||S).y,h=(y||C).x,p=(y||C).y,f=C.x,b=C.y,_&&S.relative&&(d+=S.x,u+=S.y),y&&C.relative&&(h+=C.x,p+=C.y),l=ns(n,c,d,h,f),m=ns(n,g,u,p,b);const T=jt(c,d,n),B=jt(g,u,n),$=jt(d,h,n),M=jt(u,p,n),E=jt(h,f,n),V=jt(p,b,n),L=jt(T,$,n),D=jt(B,M,n),te=jt($,E,n),ne=jt(M,V,n);return Ee.isObject(r)?(r.x=l,r.y=m,r instanceof Pe&&(r.controls.left.x=L,r.controls.left.y=D,r.controls.right.x=te,r.controls.right.y=ne,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=m,r.controls.right.x-=l,r.controls.right.y-=m)),r.t=n,r):(a=new Pe(l,m,L-l,D-m,te-l,ne-m,this._curved?ge.curve:ge.line),a.t=n,a)}plot(){if(this.curved)return tp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?ge.move:ge.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===ge.close;let o=this.vertices[r],a=[],l;return Ee.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===ge.move){a.push(new Pe(o.x,o.y)),d>0&&(a[a.length-1].command=ge.line),o=c;return}l=Dc(c,o,n),a=a.concat(l),Ee.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Dc(c,o,n),a=a.concat(l),Ee.each(l,function(h,f){f<=0&&o.command===ge.move?h.command=ge.move:h.command=ge.line})),a.push(new Pe(c.x,c.y)),a[a.length-1].command=s?ge.close:ge.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Ee.each(this.vertices,function(c,d){if(d<=0||c.command===ge.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Lc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=ss(this,s*this._length),l=ss(this,o*this._length),c=mp(a),d=pp(l);let h,f,m,g,u,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Pe),p>d&&!f?(u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,u),u.command=this._renderer.collection[p].command,this._renderer.vertices.push(u),f=u,m=this._collection[p-1],m&&m.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(pe.zero,1-u.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-u.t))):p>=c&&p<=d&&(u=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(u),p===d&&zc(this,o)?(f=u,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):p===c&&zc(this,s)&&(h=u,h.command=ge.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,u=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,u),u.command=ge.move,this._renderer.vertices.unshift(u),g=this._collection[p+1],g&&g.controls&&(u.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(pe.zero,u.t):(yp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,u.t))))}return Bn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Bn.prototype.flagReset.call(this),this}};v(Jt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),v(Jt,"Utils",{getCurveLength:Lc});let Ne=Jt;const jc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Ee.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof li?this._collection=t:this._collection=new li(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ee.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function qc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Xc(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Yc(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Uc(){this._flagFill=!0}function Gc(){this._flagStroke=!0}const bp=Math.ceil,_p=Math.floor,vn=class vn extends Bn{constructor(n){super();v(this,"_flagVertices",!0);v(this,"_flagLength",!0);v(this,"_flagFill",!0);v(this,"_flagStroke",!0);v(this,"_flagLinewidth",!0);v(this,"_flagOpacity",!0);v(this,"_flagVisible",!0);v(this,"_flagSize",!0);v(this,"_flagSizeAttenuation",!0);v(this,"_flagStrokeAttenuation",!0);v(this,"_length",0);v(this,"_fill","#fff");v(this,"_stroke","#000");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_size",1);v(this,"_sizeAttenuation",!1);v(this,"_beginning",0);v(this,"_ending",1);v(this,"_dashes",null);v(this,"_strokeAttenuation",!0);v(this,"noFill",Ne.prototype.noFill);v(this,"noStroke",Ne.prototype.noStroke);v(this,"corner",Ne.prototype.corner);v(this,"center",Ne.prototype.center);v(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);v(this,"_updateLength",Ne.prototype._updateLength);for(let r in Kc)Object.defineProperty(this,r,Kc[r]);this._renderer.type="points",this._renderer.flagVertices=qc.bind(this),this._renderer.bindVertices=Xc.bind(this),this._renderer.unbindVertices=Yc.bind(this),this._renderer.flagFill=Uc.bind(this),this._renderer.flagStroke=Gc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:di(n.fill),s=typeof n.stroke=="string"?n.stroke:di(n.stroke),o=new vn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Pe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Pe().copy(s))}for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new vn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<vn.Properties.length;s++){const o=vn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Ee.each(vn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,f=Pc(l,c,l,c,d,h,d,h,n);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=ss(this,n*this._length),o=ss(this,r*this._length),a=bp(s),l=_p(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};v(vn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let as=vn;const Kc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof li?this._collection=t:this._collection=new li(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class Zc extends li{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Da(this,As,{});this.attach(n),this.on(U.Types.insert,this.attach),this.on(U.Types.remove,this.detach)}get ids(){return Rt(this,As)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}As=new WeakMap;const En=class En extends Ne{constructor(n,r,s,o,a,l,c){const d=c||wo.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Pe);super(h,!0,!1,!0);v(this,"_flagStartAngle",!1);v(this,"_flagEndAngle",!1);v(this,"_flagInnerRadius",!1);v(this,"_flagOuterRadius",!1);v(this,"_startAngle",0);v(this,"_endAngle",ai);v(this,"_innerRadius",0);v(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in Qc)Object.defineProperty(this,f,Qc[f]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new En().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Hi(n,ai)===Hi(r,ai),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,m,g,u,p,b,y,_,R,k;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(u=m/g,p=c[f],b=u*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),R=o*Math.sin(b),m){case 0:h=ge.move;break;default:h=ge.curve}p.command=h,p.x=_,p.y=R,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(k=o*y/Math.PI,p.controls.left.x=k*Math.cos(b-ot),p.controls.left.y=k*Math.sin(b-ot),p.controls.right.x=k*Math.cos(b+ot),p.controls.right.y=k*Math.sin(b+ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=ge.close,f++):(d--,g=d-1),m=0;m<d;m++)u=m/g,p=c[f],b=(1-u)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),R=s*Math.sin(b),h=ge.curve,m<=0&&(h=a?ge.move:ge.line),p.command=h,p.x=_,p.y=R,p.controls.left.clear(),p.controls.right.clear(),p.command===ge.curve&&(k=s*y/Math.PI,p.controls.left.x=k*Math.cos(b+ot),p.controls.left.y=k*Math.sin(b+ot),p.controls.right.x=k*Math.cos(b-ot),p.controls.right.y=k*Math.sin(b-ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=ge.line}else a||(c[f].command=ge.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=ge.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new En(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const h=Ne.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];n[s]=this[s]}return n}};v(En,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let vo=En;const Qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},ko=Math.cos,Co=Math.sin,Nn=class Nn extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Pe(0,0,0,0,0,0));super(l,!0,!0,!0);v(this,"_flagRadius",!1);v(this,"_radius",0);this._renderer.type="circle";for(let c in Jc)Object.defineProperty(this,c,Jc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*ai,d=s*ko(c),h=s*Co(c),f=o*ko(c-ot),m=o*Co(c-ot),g=o*ko(c+ot),u=o*Co(c+ot),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,m),p.controls.right.set(g,u)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Nn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<Nn.Properties.length;r++){const s=Nn.Properties[r];n[s]=this[s]}return n}};v(Nn,"Properties",["radius"]);let So=Nn;const Jc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Bo=Math.cos,To=Math.sin,Fn=class Fn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Pe);super(c,!0,!0,!0);v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_width",0);v(this,"_height",0);this._renderer.type="ellipse";for(let d in ed)Object.defineProperty(this,d,ed[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Fn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*ai,d=s*Bo(c),h=o*To(c),f=s*r*Bo(c-ot),m=o*r*To(c-ot),g=s*r*Bo(c+ot),u=o*r*To(c+ot),p=this.vertices[a];p.command=a===0?ge.move:ge.curve,p.set(d,h),p.controls.left.set(f,m),p.controls.right.set(g,u)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Fn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];n[s]=this[s]}return n}};v(Fn,"Properties",["width","height"]);let Ro=Fn;const ed={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},wp=Math.cos,xp=Math.sin,An=class An extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_flagSides",!1);v(this,"_radius",0);v(this,"_width",0);v(this,"_height",0);v(this,"_sides",0);this._renderer.type="polygon";for(let a in td)Object.defineProperty(this,a,td[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ai*a+Math.PI/2,c=this._width*wp(l)/2,d=this._height*xp(l)/2;o>=s?this.vertices.push(new Pe(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ge.move:ge.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new An(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};v(An,"Properties",["width","height","sides"]);let $o=An;const td={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Ci=class Ci extends Ne{constructor(n,r,s,o){const a=[new Pe,new Pe,new Pe,new Pe];super(a,!0,!1,!0);v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_width",0);v(this,"_height",0);v(this,"_origin",null);this._renderer.type="rectangle";for(let l in nd)Object.defineProperty(this,l,nd[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new pe,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ci().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ci.Properties.length;r++){const s=Ci.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Pe),this.vertices[0].set(-n,-r).sub(this._origin).command=ge.move,this.vertices[1].set(n,-r).sub(this._origin).command=ge.line,this.vertices[2].set(n,r).sub(this._origin).command=ge.line,this.vertices[3].set(-n,r).sub(this._origin).command=ge.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=ge.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ci(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};v(Ci,"Properties",["width","height","origin"]);let gr=Ci;const nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(U.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(U.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Mn=class Mn extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Pe(0,0,0,0,0,0,c===0?ge.move:ge.curve));super(l);v(this,"_flagWidth",!1);v(this,"_flagHeight",!1);v(this,"_flagRadius",!1);v(this,"_width",0);v(this,"_height",0);v(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in id)Object.defineProperty(this,c,id[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=vp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof pe)&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof pe?o:new pe().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof pe?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new Mn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};v(Mn,"Properties",["width","height","radius"]);let Po=Mn;const id={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof pe&&this._radius.unbind(U.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(U.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function vp(){this._flagRadius=!0}const kp=Math.cos,Cp=Math.sin,Vn=class Vn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();v(this,"_flagInnerRadius",!1);v(this,"_flagOuterRadius",!1);v(this,"_flagSides",!1);v(this,"_innerRadius",0);v(this,"_outerRadius",0);v(this,"_sides",0);this._renderer.type="star";for(let l in rd)Object.defineProperty(this,l,rd[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ai*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*kp(l),h=c*Cp(l);o>=s?this.vertices.push(new Pe(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?ge.move:ge.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new Vn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};v(Vn,"Properties",["innerRadius","outerRadius","sides"]);let Eo=Vn;const rd={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let No;const sd=Math.min,od=Math.max;gn.document&&(No=document.createElement("canvas"));const bt=class bt extends Bn{constructor(n,r,s,o){super();v(this,"_flagValue",!0);v(this,"_flagFamily",!0);v(this,"_flagSize",!0);v(this,"_flagLeading",!0);v(this,"_flagAlignment",!0);v(this,"_flagBaseline",!0);v(this,"_flagStyle",!0);v(this,"_flagWeight",!0);v(this,"_flagDecoration",!0);v(this,"_flagFill",!0);v(this,"_flagStroke",!0);v(this,"_flagLinewidth",!0);v(this,"_flagOpacity",!0);v(this,"_flagVisible",!0);v(this,"_flagMask",!1);v(this,"_flagClip",!1);v(this,"_flagDirection",!0);v(this,"_flagStrokeAttenuation",!0);v(this,"_value","");v(this,"_family","sans-serif");v(this,"_size",13);v(this,"_leading",17);v(this,"_alignment","center");v(this,"_baseline","middle");v(this,"_style","normal");v(this,"_weight",500);v(this,"_decoration","none");v(this,"_direction","ltr");v(this,"_fill","#000");v(this,"_stroke","none");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_mask",null);v(this,"_clip",!1);v(this,"_dashes",null);v(this,"_strokeAttenuation",!0);for(let a in ad)Object.defineProperty(this,a,ad[a]);if(this._renderer.type="text",this._renderer.flagFill=Sp.bind(this),this._renderer.flagStroke=Bp.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Ee.isObject(o))return this;for(let a=0;a<bt.Properties.length;a++){const l=bt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(No){const r=No.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*bt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:di(n.fill),s=typeof n.stroke=="string"?n.stroke:di(n.stroke),o=new bt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new bt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<bt.Properties.length;s++){const o=bt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=bt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[f,m]=r.multiply(s,a),[g,u]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=sd(m,u,b,_),s=sd(f,g,p,y),o=od(f,g,p,y),l=od(m,u,b,_),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};v(bt,"Ratio",.6),v(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let qi=bt;const ad={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof kt||this._fill instanceof Ct||this._fill instanceof je)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof kt||this._stroke instanceof Ct||this._stroke instanceof je)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ee.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Sp(){this._flagFill=!0}function Bp(){this._flagStroke=!0}const In=class In extends gr{constructor(n,r,s,o){super(r,s,0,0);v(this,"_flagTextures",!1);v(this,"_flagFrameRate",!1);v(this,"_flagIndex",!1);v(this,"_amount",1);v(this,"_duration",0);v(this,"_index",0);v(this,"_startTime",0);v(this,"_playing",!1);v(this,"_firstFrame",0);v(this,"_lastFrame",0);v(this,"_loop",!0);v(this,"_textures",null);v(this,"_frameRate",0);v(this,"_origin",null);this._renderer.type="image-sequence";for(let a in ld)Object.defineProperty(this,a,ld[a]);this._renderer.flagTextures=Tp.bind(this),this._renderer.bindTextures=Rp.bind(this),this._renderer.unbindTextures=$p.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(cd.bind(this)):typeof n=="string"&&(this.textures=[cd(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=In.DefaultFrameRate,this.index=0}static fromObject(n){const r=new In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Ee.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new In(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,h;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Ee.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Ee.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=jt(this._firstFrame,h,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof je))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};v(In,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),v(In,"DefaultFrameRate",30);let Fo=In;const ld={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._textures=new li((t||[]).slice(0)),this._textures.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Tp(){this._flagTextures=!0}function Rp(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function $p(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function cd(t){if(t instanceof je)return t;if(typeof t=="string")return new je(t)}const Si=class Si extends gr{constructor(n,r,s,o,a,l){super(r,s,0,0);v(this,"_flagTexture",!1);v(this,"_flagColumns",!1);v(this,"_flagRows",!1);v(this,"_flagFrameRate",!1);v(this,"_flagIndex",!1);v(this,"_amount",1);v(this,"_duration",0);v(this,"_startTime",0);v(this,"_playing",!1);v(this,"_firstFrame",0);v(this,"_lastFrame",0);v(this,"_loop",!0);v(this,"_texture",null);v(this,"_columns",1);v(this,"_rows",1);v(this,"_frameRate",0);v(this,"_index",0);v(this,"_origin",null);this._renderer.type="sprite";for(let c in dd)Object.defineProperty(this,c,dd[c]);this.noStroke(),this.noFill(),n instanceof je?this.texture=n:typeof n=="string"&&(this.texture=new je(n)),this.origin=new pe,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Si().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Ee.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new Si(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,h,f,m,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){f=n.image.width,m=n.image.height,o=f/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Ee.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Ee.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=jt(this._firstFrame,g,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const u=this._index%r,p=Math.floor(this._index/r),b=-o*u+(f-o)/2,y=-a*p+(m-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};v(Si,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Ao=Si;const dd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},ls=Math.min,cs=Math.max,en=class en extends Bn{constructor(n){super();v(this,"_flagAdditions",!1);v(this,"_flagSubtractions",!1);v(this,"_flagOrder",!1);v(this,"_flagOpacity",!0);v(this,"_flagBeginning",!1);v(this,"_flagEnding",!1);v(this,"_flagLength",!1);v(this,"_flagMask",!1);v(this,"_fill","#fff");v(this,"_stroke","#000");v(this,"_linewidth",1);v(this,"_opacity",1);v(this,"_visible",!0);v(this,"_cap","round");v(this,"_join","round");v(this,"_miter",4);v(this,"_closed",!0);v(this,"_curved",!1);v(this,"_automatic",!0);v(this,"_beginning",0);v(this,"_ending",1);v(this,"_length",0);v(this,"_mask",null);v(this,"_strokeAttenuation",!0);for(let r in hd)Object.defineProperty(this,r,hd[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)ud.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)ud.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new en;for(let o=0;o<en.Properties.length;o++){const a=en.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:di(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return vo.fromObject(o);case"circle":return So.fromObject(o);case"element":return ur.fromObject(o);case"ellipse":return Ro.fromObject(o);case"group":return en.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Fo.fromObject(o);case"path":return Ne.fromObject(o);case"points":return as.fromObject(o);case"polygon":return $o.fromObject(o);case"rectangle":return gr.fromObject(o);case"rounded-rectangle":return Po.fromObject(o);case"shape":return Bn.fromObject(o);case"sprite":return Ao.fromObject(o);case"star":return Eo.fromObject(o);case"text":return qi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<en.Properties.length;r++){const s=en.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new en,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Ee.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,f=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let u=0;u<this.children.length;u++){const p=this.children[u];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Ee.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ee.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ee.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ee.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,R]=s.multiply(r.right,r.top),[k,w]=s.multiply(r.left,r.bottom),[C,S]=s.multiply(r.right,r.bottom);f=ls(y,R,w,S,f),d=ls(b,_,k,C,d),h=cs(b,_,k,C,h),m=cs(y,R,w,S,m)}else f=ls(r.top,f),d=ls(r.left,d),h=cs(r.right,h),m=cs(r.bottom,m)}return{top:f,left:d,right:h,bottom:m,width:h-d,height:m-f}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};v(en,"Children",Zc),v(en,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Tn=en;const hd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=Tn.InsertChildren.bind(this),n=Tn.RemoveChildren.bind(this),r=Tn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Zc(t),this._children.bind(U.Types.insert,e),this._children.bind(U.Types.remove,n),this._children.bind(U.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ee.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function ud(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class ds extends Ne{constructor(e,n,r,s){const o=[new Pe(e,n),new Pe(r,s)];super(o);for(let a in fd)Object.defineProperty(this,a,fd[a]);this.vertices[0].command=ge.move,this.vertices[1].command=ge.line,this.automatic=!1}}v(ds,"Properties",["left","right"]);const fd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Ee.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ge.move;else{const e=new is("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Ee.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ge.line;else{const e=new is("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Mo{constructor(e=0,n=0){this.x=e,this.y=n}}class pn{constructor(e=10,n=0,r="A"){v(this,"start",new Mo);v(this,"end",new Mo);this.width=e,this.angle=n,this.label=r}}const Oe={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},Pp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ep(t,e){return i.openBlock(),i.createElementBlock("svg",Pp,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const hs=i.markRaw({name:"ion-close",render:Ep}),Np={class:"mr-3 flex flex-col gap-2"},Fp=["onClick"],Ap={class:"h-full p-2"},Mp={},Vp=i.defineComponent({...Mp,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((h,f)=>{var g;const m=(g=s.value)==null?void 0:g.at(f);m&&a("init-draw-template",m,h)}),(d=n.settings.customTemplates)==null||d.forEach((h,f)=>{var g;const m=(g=o.value)==null?void 0:g.at(f);m&&a("init-draw-template",m,h)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((h,f)=>{var m;if(!(d!=null&&d.includes(h))){const g=(m=o.value)==null?void 0:m.at(f);g&&a("init-draw-template",g,h)}}),d.length>c.length&&d.forEach((h,f)=>{var g;const m=(g=o.value)==null?void 0:g.at(f);m&&(m.innerHTML="",a("init-draw-template",m,h))})})},{deep:!0}),(c,d)=>{const h=hs;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Np,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(f,m)=>(i.openBlock(),i.createElementBlock("div",{key:`${f.id}-${m}`,class:"group relative"},[i.createVNode(i.unref(z.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":m===t.selectTemplateIndex}]),onClick:g=>a("template:select",m)},[i.createElementVNode("div",Ap,[i.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Fp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(m)},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),gd=ri(Vp,[["__scopeId","data-v-69dd9f78"]]),Ip={class:"flex gap-3"},Op={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},zp={ref:"drawing-container",class:"size-full"},Lp={},md=i.defineComponent({...Lp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((A,I)=>new pn(n.value.configuratorParams.linesWidths[I],A,`A-${I+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var A,I;return n.value.configuratorParams.startTailType&&((A=n.settings.startTailConfigs)!=null&&A[n.value.configuratorParams.startTailType])?(I=n.settings.startTailConfigs)==null?void 0:I[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var I;const A=n.value.configuratorParams.endTailType!==void 0&&((I=n.settings.endTailConfigs)==null?void 0:I[n.value.configuratorParams.endTailType]);return!A||!A.points?[]:A.points.map((j,q)=>Array.isArray(j)?new pn(j[0],j[1],`A-${q+1}`):new pn(j.width,j.angle,`A-${q+1}`))}),u=(A,I=!1)=>{A[0].start.x=0,A[0].start.y=0;let j=0;for(let q=0;q<A.length;q++){const N=A[q],O=A[q-1]??new pn(0,j);j+=!I||q>1?O.angle:0;const Y=(!I||q>0?N.angle:0)+j;if(A[q].end.x=N.width*Math.cos(Y*Math.PI/180)+A[q].start.x,A[q].end.y=N.width*Math.sin(Y*Math.PI/180)+A[q].start.y,q<A.length-1){const re=q+1;A[re].start.x=A[q].end.x,A[re].start.y=A[q].end.y}}return A},p=(A,I,j,q,N=!1)=>{let O=u([...j,...q]);I.length>0&&(O=[...u(I),...O]);let Y=0,re=0,de=0,oe=0;O.forEach(Ce=>{Y=Math.min(Y,Ce.start.x,Ce.end.x),re=Math.min(re,Ce.start.y,Ce.end.y),de=Math.max(de,Ce.start.x,Ce.end.x),oe=Math.max(oe,Ce.start.y,Ce.end.y)});let ie,Fe;Y===0&&re===0&&de===0&&oe===0?(ie=1,Fe=1):(ie=A.width/Math.abs(de-Y),Fe=(N?A.height:A.height-Oe.colorSideLabel.size)/Math.abs(oe-re));const rt=Math.min(ie,Fe);return Y=Y<0?-Y*rt:0,re=re<0?-re*rt:0,[rt,Y,re]},b=A=>{const I=new as([A]);return I._size=Oe.anchorPoint.size,I.fill=Oe.anchorPoint.color,I.stroke="transparent",I._linewidth=Oe.anchorPoint.strokeSize,l.push(I),I},y=(A,I)=>{if(l=[],n.settings.allowChangeFirstPoint){const j=A[0],q=new pe(j.vertices[0].x,j.vertices[0].y);q.bind(U.Types.change,()=>{j.vertices[0].copy(q)});const N=b(q);I.add(N)}A.forEach((j,q)=>{const N=A[q+1],O=new pe(j.vertices[1].x,j.vertices[1].y);O.bind(U.Types.change,()=>{j.vertices[1].copy(O),N!==void 0&&N.vertices[0].copy(O)});const Y=b(O);I.add(Y)})},_=A=>A*(Math.PI/180),R=(A,I,j)=>{const q=I.vertices.length-1;A.position.x=I.vertices[q].x,A.position.y=I.vertices[q].y;const N=Math.atan2(I.vertices[q].y-I.vertices[0].y,I.vertices[q].x-I.vertices[0].x);A.rotation=_(j)+N},k=(A,I,j)=>{if(I.vertices[0]===void 0)return;A.position.x=I.vertices[0].x,A.position.y=I.vertices[0].y;const q=I.vertices.length-1,N=Math.atan2(I.vertices[q].y-I.vertices[0].y,I.vertices[q].x-I.vertices[0].x);A.rotation=_(j)+N},w=(A,I,j)=>{const q=new Tn;if(A.length===0)return q;const N=[];return[...A].reverse().forEach((O,Y)=>{Y!==0&&O.angle>0&&(O.angle*=-1),N.push(O)}),A=u(N,!0),k(q,I,A[0].angle),[I.vertices[0],I.vertices[1]].forEach(O=>{O.bind(U.Types.change,()=>{k(q,I,A[0].angle)})}),A.forEach(O=>{const Y=O.start.x*j,re=O.end.x*j,de=O.start.y*j,oe=O.end.y*j,ie=new ds(Y,de,re,oe);ie.linewidth=Oe.line.size,ie.stroke=Oe.line.color,q.add(ie)}),q},C=(A,I,j)=>{const q=new Tn;return A.length===0||(A=u(A,!0),R(q,I,A[0].angle),[I.vertices[0],I.vertices[1]].forEach(N=>{N.bind(U.Types.change,()=>{R(q,I,A[0].angle)})}),A.forEach(N=>{const O=N.start.x*j,Y=N.end.x*j,re=N.start.y*j,de=N.end.y*j,oe=new ds(O,re,Y,de);oe.linewidth=Oe.line.size,oe.stroke=Oe.line.color,q.add(oe)})),q},S=(A,I,j,q)=>{const N=I.vertices[0].x+(I.vertices[1].x-I.vertices[0].x)/2-8*Math.sin(A.angle*Math.PI/180),O=I.vertices[0].y+(I.vertices[1].y-I.vertices[0].y)/2-8*Math.cos(A.angle*Math.PI/180),Y=new qi(A.label,N+10,O-10);let re;Y.size=Oe.lineLabel.size,Y.weight=600,Y.fill=Oe.lineLabel.color,Y.id+=1,Y.rotation=Oe.lineLabel.rotation,q>0&&(re=new qi(`${A.angle}°`,I.vertices[0].x+25,I.vertices[0].y-25),re.size=Oe.angleLabel.size,re.weight=600,re.fill=Oe.angleLabel.color,re.rotation=Oe.angleLabel.rotation,re.id+=q,o.push(re),j.add(re)),j.add(Y),B(Y,I,0,re),B(Y,I,1)},T=()=>{const{size:A}=Oe.colorSideLabel,I=0,j=0,q=f.value?A/2:A/2-A,N=f.value?A/2-A:A/2,O=new Tn;if(!c)return O;const Y=5,re=Math.atan2(N-q,j-I),de=[new Pe(I,q,0,0,0,0,fn.Commands.move),new Pe(j,N,0,0,0,0,fn.Commands.line),new Pe(j-Y*Math.cos(re-Math.PI/4),N-Y*Math.sin(re-Math.PI/4),0,0,0,0,fn.Commands.line),new Pe(j,N,0,0,0,0,fn.Commands.move),new Pe(j-Y*Math.cos(re+Math.PI/4),N-Y*Math.sin(re+Math.PI/4),0,0,0,0,fn.Commands.line)],oe=new Ne(de,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=A/7,oe.stroke=Oe.colorSideLabel.color,O.add(oe);const ie=new qi(f.value?"Цвет снизу":"Цвет сверху",10,0);ie.size=A,ie.weight=600,ie.fill=Oe.colorSideLabel.color,ie.alignment="left",O.add(ie);const Fe=O.getBoundingClientRect();return O.position.x=(c.width-Fe.width)*d+10,O.position.y=f.value?c.height+Fe.height*2:Fe.height/2,O},B=(A,I,j,q)=>{I.vertices[j].bind(U.Types.change,()=>{const N=I.vertices.length-1,O=Math.atan2(I.vertices[0].y-I.vertices[N].y,I.vertices[0].x-I.vertices[N].x)*180/Math.PI,Y=I.vertices[0].x+(I.vertices[N].x-I.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),re=I.vertices[0].y+(I.vertices[N].y-I.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);A.position.x=Y+10,A.position.y=re-10,A.rotation=-.5,q&&(q.position.x=I.vertices[0].x+25,q.position.y=I.vertices[0].y-25)})},$=(A,I,j,q,N=!1)=>{var Yt;if(A.clear(),j.length===0){A.update();return}const O=u(j),[Y,re,de]=p(A,I,O,q,N),oe=new Tn,ie=new Array,Fe=new Array;N||(o=[],a=[]),O.forEach((Ie,tn)=>{const nn=Ie.start.x*Y+re,Tt=Ie.end.x*Y+re,Ot=Ie.start.y*Y+de,rn=Ie.end.y*Y+de,dt=new ds(nn,Ot,Tt,rn);dt.linewidth=N?Oe.previewLine.size:Oe.line.size,dt.stroke=N?Oe.previewLine.color:Oe.line.color,a.push(dt),ie.push(dt),oe.add(dt),!N&&Ie.label!==""&&S(Ie,dt,oe,tn)});const rt=ie.at(-1);let Ce=oe.getBoundingClientRect();if(!N){const Ie=T();Fe.push(Ie)}if(I.length>0){const Ie=w(I,ie[0],Y);oe.add(Ie)}if(q.length>0&&rt){const Ie=C(q,rt,Y);oe.add(Ie)}if(Fe.push(oe),A.makeGroup(Fe),Ce=oe.getBoundingClientRect(),oe.position.x=0-Ce.left+(A.width-Ce.width)/(2*(N?1:d)),oe.position.y=0-Ce.top+(A.height-Ce.height)/(2*(N?1:d)),A.update(),!N){const Ie=((Yt=n.value.configuratorParams)==null?void 0:Yt.colorSide)==="top";oe.position.y=oe.position.y+Oe.colorSideLabel.size*Number(Ie),y(ie,oe),A.update()}},M=(A,I)=>{if(A&&!I.isNewRec()){const j=new fn({width:A.scrollWidth,height:A.scrollHeight});j.appendTo(A),$(j,[],I.points,[],!0)}},E=()=>{c&&$(c,m.value,h.value,g.value,!1)},V=A=>A*(180/Math.PI),L=(A,I)=>{const j=A[1].x-A[0].x,q=A[1].y-A[0].y,N=I[1].x-I[0].x,O=I[1].y-I[0].y;let Y=Math.atan2(j*O-q*N,j*N+q*O);return Y=V(Y),Math.round(Y)*-1},D=A=>{const I=a.map((j,q,N)=>{const O=N[q-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let Y=Math.ceil(j._length/A/n.settings.lineWidthStep)*n.settings.lineWidthStep;const re=o[q-1];Y<(N.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(Y=N.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),Y>n.settings.maxLineWidth&&(Y=n.settings.maxLineWidth);const de=L(j.vertices,O.vertices);return re&&(re.value=`${de}°`),new pn(Y,de,`A-${q+1}`)});r("pointer:move",I)},te=A=>{let I=null,j;const q=re=>{I=l.find(de=>{const oe=de.renderer;return(oe==null?void 0:oe.elem)===re.target}),[j]=p(A,m.value,h.value.map(de=>de),g.value)},N=re=>{if(I){const de=I.renderer,oe=de==null?void 0:de.elem;if(!oe)return;const ie=oe.getBoundingClientRect();I.vertices[0].x-=ie.x-(re instanceof MouseEvent?re.clientX:re.targetTouches[0].clientX)+Oe.anchorPoint.size/2,I.vertices[0].y-=ie.y-(re instanceof MouseEvent?re.clientY:re.targetTouches[0].clientY)+Oe.anchorPoint.size/2,D(j),A.update()}},O=()=>{I&&r("pointer:up",h.value),I=null},Y=s.value;Y&&(Y.addEventListener("touchstart",q,{passive:!0}),Y.addEventListener("touchend",O,{passive:!0}),Y.addEventListener("mousedown",q),Y.addEventListener("mouseup",O),Y.addEventListener("mousemove",N),Y.addEventListener("touchmove",N,{passive:!0}))},ne=(A,I)=>{r("remove-custom-template",A,I)};return i.onMounted(()=>{s.value&&(c=new fn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{E()},{deep:!0,immediate:!0}),te(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(A,I)=>(i.openBlock(),i.createElementBlock("div",Ip,[i.createVNode(gd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":I[0]||(I[0]=j=>r("template:select",j)),onInitDrawTemplate:M,onRemoveCustomTemplate:ne},null,8,["select-template-index","settings"]),i.createElementVNode("div",Op,[i.createElementVNode("div",zp,null,512)])]))}});class Xi extends K.Identity{constructor(n,r){super();v(this,"label","");v(this,"points",[]);v(this,"isCustom",!1);v(this,"id",-1);v(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>F.isArray(s)?new pn(s[0],s[1],`A-${o+1}`):new pn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new pn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Vo extends Xi{constructor(n){super(n);v(this,"isDefault");this.isDefault=n.isDefault??!1}}class pd{constructor(e){v(this,"minLineWidth");v(this,"maxLineWidth");v(this,"lineWidthStep");v(this,"minLineAngle");v(this,"maxLineAngle");v(this,"lineAngleStep");v(this,"stripMinWidth");v(this,"stripMaxWidth");v(this,"stripMinLength");v(this,"stripMaxLength");v(this,"allowShowTable");v(this,"showOnlyTemplates");v(this,"templates");v(this,"customTemplates",[]);v(this,"startTailConfigs");v(this,"endTailConfigs");v(this,"bendCountForExtended");v(this,"extendedProductCatalog");v(this,"allowChangeFirstPoint");v(this,"allowSaveTemplates");v(this,"userTemplatesPrefix");v(this,"lengthStep");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Xi(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Vo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Vo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Xi(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Xi({label:"-- Новая конфигурация --",points:[new pn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Xi(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const Dp={class:"flex max-w-[50rem] flex-col gap-3"},Hp={},yd=i.defineComponent({...Hp,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new pd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),f=i.ref(0),m=i.useTemplateRef("kozyrek-configurator-params-form");i.computed(()=>{const B=F.every(l.value.configuratorParams.linesWidths,V=>!!(V&&V>0)),$=F.every(l.value.configuratorParams.linesAngles,V=>!F.isNil(V)),M=!!(l.value.quantity&&l.value.quantity>0),E=l.value.configuratorParams.length>0&&l.value.configuratorParams.length>0;return B&&$&&M&&E});const g=(B=0)=>{var M;const $=(M=c.value.allTemplates)==null?void 0:M.at(B);$!==void 0&&(f.value=B,l.value.configuratorParams.linesWidths=$.points.map(E=>F.isArray(E)?E[0]:E.width),l.value.configuratorParams.linesAngles=$.points.map(E=>F.isArray(E)?E[1]:E.angle),R()),y(l.value.configuratorParams)},u=async()=>{const B=prompt("Введите название шаблона:");if(!B)return;a.value=!0;const $={label:B,points:l.value.configuratorParams.linesWidths.map((E,V)=>[E,l.value.configuratorParams.linesAngles[V]])},M=E=>{E&&(c.value.addCustomTemplate($),f.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:$,callback:M})},p=async(B,$)=>{var V;const M=(V=c.value.allTemplates)==null?void 0:V.at(B);if(!M||!M.isCustom)return;const E=L=>{L&&(c.value.removeCustomTemplate(M.id),g()),$==null||$()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:M.id,callback:E})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async B=>{var $,M;l.value.product=new K.Product,(M=($=m.value)==null?void 0:$.formReference)==null||M.validate(E=>{E||(R(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:B,validationFieldResultData:h.value,callback:V=>{V?l.value.product=V:h.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(F.noop)},_=async()=>{var B,$;($=(B=m.value)==null?void 0:B.formReference)==null||$.validate(M=>{M||(o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1,i.nextTick(()=>{var E,V;(V=(E=m.value)==null?void 0:E.formReference)==null||V.restoreValidation()})}))}).catch(F.noop)},R=()=>{const B={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach(($,M)=>{B[`lines_widths[${M+1}]`]={},B[`lines_angles[${M+1}]`]={}}),h.value=B},k=B=>{d.value.linesWidths=B.map($=>$.width),d.value.linesAngles=B.map($=>$.angle)},w=B=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,R(),b(),y(l.value.configuratorParams)},C=(B,$)=>{d.value.linesWidths=B,d.value.linesAngles=$},S=B=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,M=0;l.value.configuratorParams.linesWidths.splice(B+1,0,$),l.value.configuratorParams.linesAngles.splice(B+1,0,M),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],R(),b(),y(l.value.configuratorParams)},T=B=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(B,1),l.value.configuratorParams.linesAngles.splice(B,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],R(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,B=>{l.value=new K.CartItemBase(B),g()}),(B,$)=>{const M=z.NButton;return i.openBlock(),i.createElementBlock("div",Dp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(M,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=E=>r("click:view-switch"))},{default:i.withCtx(()=>[...$[3]||($[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(md,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":w,"onPointer:move":k,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(tl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=E=>l.value=E),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":$[2]||($[2]=E=>y(E)),"onUpdate:preview":C,onSubmit:_,"onClick:saveTemplate":u,"onClick:addLine":S,"onClick:removeLine":T},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Wp={},Yi=i.defineComponent({...Wp,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=F.debounce(()=>s("update:value",o.value),a.value),c=g=>{o.value=g,l()};i.watch(()=>r.value,g=>{o.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:u[0]||(u[0]=p=>s("keydown",p)),onInput:u[1]||(u[1]=p=>s("input",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),jp={key:0,class:"flex items-baseline gap-1"},qp={key:0,class:"flex items-baseline gap-1"},Xp={key:0},Yp={class:"text-lg font-semibold"},Up={key:1,class:"text-red-500 text-sm mb-2"},Gp={class:"flex gap-3"},Kp={},bd=i.defineComponent({...Kp,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{expose:e,emit:n}){var C;const r=t,s=n,o=i.computed(()=>wt.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),h=i.ref(F.cloneDeep(r.value)),f=i.computed(()=>r.settings.widthOverlaps[h.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.heightOverlaps[h.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[h.value.configuratorParams.netType]),u=i.computed(()=>r.settings.maxHeights[h.value.configuratorParams.netType]),p=i.computed(()=>h.value.configuratorParams.width?h.value.configuratorParams.width+f.value:0),b=i.computed(()=>h.value.configuratorParams.height?h.value.configuratorParams.height+m.value:0),y=i.computed(()=>({"configuratorParams.width":[ue.required,ue.min(r.settings.minWidth-f.value),ue.max(g.value-f.value),ue.step(1),Qe.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ue.required,ue.min(r.settings.minHeight-m.value),ue.max(u.value-m.value),ue.step(1),Qe.serverValidation(r.validation.height.feedback)],quantity:[ue.required,ue.min(1),ue.step(1),Qe.serverValidation(r.validation.quantity.feedback)],marker:[Qe.serverValidation(r.validation.marker.feedback)]})),_=i.computed(()=>{var E;const S=p.value,T=b.value,{quantity:B}=r.value,$=((E=r.value.product)==null?void 0:E.costRub)||0;if(!S||!T||!B||$===0)return null;const M=S*T/1e6;return($*B*M).toLocaleString("ru-ru",{minimumFractionDigits:2})}),R=i.computed(()=>{const S=p.value,T=b.value,B=!!(S&&S>=r.settings.minWidth&&S<=r.settings.maxWidths[h.value.configuratorParams.netType]),$=!!(T&&T>=r.settings.minHeight&&T<=r.settings.maxHeights[h.value.configuratorParams.netType]),M=!!(r.value.quantity&&r.value.quantity>0);return B&&$&&M}),k=(S,T)=>{var M,E;const B=h.value.configuratorParams;S&&S in B&&(B[S]=T);const $={...B,width:p.value??0,height:b.value??0};S==="width"&&((M=l.value)==null||M.validate().catch(F.noop)),S==="height"&&((E=c.value)==null||E.validate().catch(F.noop)),i.nextTick(()=>{var L,D;!((L=l.value)!=null&&L.validationErrored)&&!((D=c.value)!=null&&D.validationErrored)&&$.height&&$.width&&s("update:params",$),w("configuratorParams",$)})},w=(S,T)=>{const B=new K.CartItemBase(r.value);B[S]=T,S==="configuratorParams"&&(B.product=new K.Product),s("update:value",B)};return i.watch(()=>r.value,S=>{const T=F.cloneDeep(i.toRaw(S)),B=T.configuratorParams.mountType,$=r.settings.widthOverlaps[B]??0,M=r.settings.heightOverlaps[B]??0;T.configuratorParams.width&&T.configuratorParams.width>0&&(T.configuratorParams.width-=$),T.configuratorParams.height&&T.configuratorParams.height>0&&(T.configuratorParams.height-=M),h.value=T},{deep:!0}),i.onMounted(()=>{var S;(S=d.value)==null||S.select()}),e({validate:(C=a.value)==null?void 0:C.validate,formReference:a}),(S,T)=>(i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:h.value,rules:y.value,class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.netType,"onUpdate:value":[T[0]||(T[0]=B=>h.value.configuratorParams.netType=B),T[1]||(T[1]=B=>k("netType",B))],options:t.settings.netType.map(B=>({label:t.settings.descriptions.net_type[B],value:B}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.color,"onUpdate:value":[T[2]||(T[2]=B=>h.value.configuratorParams.color=B),T[3]||(T[3]=B=>k("color",B))],options:t.settings.color.map(B=>({label:t.settings.descriptions.color[B],value:B}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value.configuratorParams.mountType,"onUpdate:value":[T[4]||(T[4]=B=>h.value.configuratorParams.mountType=B),T[5]||(T[5]=B=>k("mountType",B))],options:t.settings.mountType.map(B=>({label:t.settings.descriptions.mount_type[B],value:B}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-f.value} ${g.value?" до "+(g.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",jp,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:T[10]||(T[10]=B=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...T[24]||(T[24]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-reference",value:h.value.configuratorParams.width,"onUpdate:value":[T[6]||(T[6]=B=>h.value.configuratorParams.width=B),T[9]||(T[9]=B=>k("width",B))],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:T[7]||(T[7]=B=>i.unref(ln)(B,".",!1)),onInput:T[8]||(T[8]=B=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-m.value} ${u.value?" до "+(u.value-m.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[h.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",qp,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:T[15]||(T[15]=B=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...T[25]||(T[25]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Yi,{value:h.value.configuratorParams.height,"onUpdate:value":[T[11]||(T[11]=B=>h.value.configuratorParams.height=B),T[14]||(T[14]=B=>k("height",B))],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:T[12]||(T[12]=B=>i.unref(ln)(B,".",!1)),onInput:T[13]||(T[13]=B=>i.unref(Ke)(t.validation,"height"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:h.value.quantity,"onUpdate:value":[T[16]||(T[16]=B=>h.value.quantity=B),T[19]||(T[19]=B=>w("quantity",B??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:T[17]||(T[17]=B=>i.unref(ii)(B,!1)),onInput:T[18]||(T[18]=B=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:T[20]||(T[20]=B=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":T[21]||(T[21]=B=>{h.value.marker=B??null,w("marker",B??null)})},null,8,["value"])]),_:1}),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:h.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),_.value?(i.openBlock(),i.createElementBlock("div",Xp,[T[26]||(T[26]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Yp,i.toDisplayString(_.value)+" ₽",1)])):i.createCommentVNode("",!0),R.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Up," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Gp,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!R.value||h.value.product.isNewRec(),type:"primary",class:"self-start",onClick:T[22]||(T[22]=B=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:T[23]||(T[23]=B=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...T[27]||(T[27]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"]))}}),Zp="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Qp="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Jp="/img/configurators/mosquitto/measurement-instructions/mount.png",ey="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ty="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",ny={class:"flex flex-col gap-6"},iy={class:"flex gap-4"},ry={class:"flex flex-col gap-2"},sy={class:"flex gap-4"},oy={class:"flex flex-col gap-2"},ay={class:"flex gap-4"},ly={class:"flex flex-col gap-2"},cy={},_d=i.defineComponent({...cy,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=wt.initRefDependingOnDeviceResolution("small","small","medium"),r=wt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",ny,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:Zp,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:Qp,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",iy,[l[9]||(l[9]=i.createElementVNode("img",{src:Jp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",ry,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",sy,[l[15]||(l[15]=i.createElementVNode("img",{src:ey,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",oy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",ay,[l[21]||(l[21]=i.createElementVNode("img",{src:ty,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",ly,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),dy={class:"flex flex-col items-center justify-between rounded-xl"},hy={class:"img-preview relative flex justify-center"},uy={},fy=i.defineComponent({...uy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=F.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",dy,[i.createElementVNode("div",hy,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Io=ri(fy,[["__scopeId","data-v-a67fd61e"]]),gy={class:"grid md:grid-cols-2"},my={},wd=i.defineComponent({...my,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>wt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),h=i.ref(!1),f=i.ref(!1),m=async u=>{var p,b;l.value.product=new K.Product,(b=(p=c.value)==null?void 0:p.formReference)==null||b.validate(y=>{y||(h.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:u,validationFieldResultData:d.value,callback:_=>{_?l.value.product=_:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},h.value=!1}}))}).catch(F.noop)},g=()=>{f.value=!0,r("submit",l.value,d.value,()=>{f.value=!1})};return i.watch(()=>n.cartItem,u=>{l.value=u},{deep:!0}),(u,p)=>{const b=hs;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(_d,{show:a.value,"onUpdate:show":p[0]||(p[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",gy,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":p[4]||(p[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:p[2]||(p[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Io,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[3]||(p[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Io,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:p[1]||(p[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(bd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":p[5]||(p[5]=y=>l.value=y),validation:d.value,settings:t.settings,"is-product-searching":h.value,"is-submit-processing":f.value,"onUpdate:params":p[6]||(p[6]=y=>m(y)),onSubmit:p[7]||(p[7]=y=>g()),"onClick:instructionsToggle":p[8]||(p[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":p[9]||(p[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),py={},xd=i.defineComponent({...py,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),h=m=>{l.value=m,s("update:value",m,r.index,a)},f=()=>{var m;(m=o.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(m,g)=>{const u=el,p=Ja;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(lr,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:h},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(Ut),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(ln)(b,".",!1)),onInput:g[1]||(g[1]=b=>i.unref(Ke)(t.validation,`linesWidths.${t.index}`)),"onUpdate:value":h},null,8,["value","parse"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=b=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=b=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),yy={class:"my-2 flex w-full flex-col"},by={key:0},_y={class:"text-lg font-semibold"},wy={class:"flex gap-3"},xy={},vd=i.defineComponent({...xy,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var b;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(F.cloneDeep(r.value)),c=i.computed(()=>{const y={length:[ue.required,ue.min(r.settings.minLength),ue.max(r.settings.maxLength),ue.step(r.settings.lengthStep),Qe.serverValidation(r.validation.length.feedback)],quantity:[ue.required,ue.min(1),Qe.serverValidation(r.validation.quantity.feedback)],marker:[Qe.serverValidation(r.validation.marker.feedback)]};return F.forEach(l.value,(_,R)=>{var k;y[`configuratorParams.linesWidths.${R}`]=[ue.required,ue.min(r.settings.minLineWidth),ue.step(r.settings.lineWidthStep),Qe.serverValidation((k=r.validation[`linesWidths.${R}`])==null?void 0:k.feedback)]}),y}),d=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((y,_)=>(y??0)+(_??0),0)),h=i.computed(()=>r.settings.width-d.value),f=i.computed(()=>!r.value.some(({product:y})=>!y||y.isNewRec())),m=i.computed(()=>y=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+y}]),g=i.computed(()=>{const{length:y}=r.value[0];return!y||d.value!==r.settings.width?null:(F.reduce(r.value,(R,k)=>{var C;const w=((C=k.product)==null?void 0:C.costRub)||0;return R+w},0)*r.value[0].quantity*y).toLocaleString("ru-ru",{minimumFractionDigits:2})}),u=(y,_,R)=>{var w,C,S;l.value[_].product.id=-1;const{configuratorParams:k}=l.value[_];k.linesWidths[_]=y,p("configuratorParams",k),(S=(C=(w=a.value)==null?void 0:w.at(_))==null?void 0:C.formItemReference)==null||S.validate().catch(F.noop),i.nextTick(()=>{var T,B;(B=(T=a.value)==null?void 0:T.at(_))!=null&&B.isValid&&s("update:params",k,_,R)})},p=(y,_)=>{l.value.forEach(R=>{R[y]=_}),s("update:value",l.value)};return i.watch(()=>r.value,y=>{l.value=F.cloneDeep(y)},{deep:!0}),e({validate:(b=o.value)==null?void 0:b.validate,formReference:o}),(y,_)=>(i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var R;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(k,w)=>(i.openBlock(),i.createBlock(xd,{key:w,ref_for:!0,ref:"line-items-reference",value:k.configuratorParams.linesWidths.at(w)??null,"auto-focus":!0,index:w,path:`configuratorParams.linesWidths.${w}`,product:k.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(k.configuratorParams.linesWidths.at(w)??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(C=>C.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":u,"onClick:addLine":_[0]||(_[0]=C=>s("click:add-line",C)),"onClick:removeLine":_[1]||(_[1]=C=>s("click:remove-line",C))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",yy,[h.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[..._[14]||(_[14]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[_[15]||(_[15]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{disabled:t.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=t.settings.maxLinesCount||t.value.some(k=>k.product.isNewRec()),type:"primary",class:"self-center",onClick:_[2]||(_[2]=k=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[..._[16]||(_[16]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[_[3]||(_[3]=k=>l.value[0].length=k),_[6]||(_[6]=k=>p("length",k))],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[4]||(_[4]=k=>i.unref(ii)(k,!1)),onInput:_[5]||(_[5]=k=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[_[7]||(_[7]=k=>l.value[0].quantity=k),_[10]||(_[10]=k=>p("quantity",k))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[8]||(_[8]=k=>i.unref(ii)(k,!1)),onInput:_[9]||(_[9]=k=>i.unref(Ke)(t.validation,"quantity"))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:_[11]||(_[11]=k=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":_[12]||(_[12]=k=>{l.value[0].marker=k??null,p("marker",k??null)})},null,8,["value"])]),_:1}),g.value?(i.openBlock(),i.createElementBlock("div",by,[_[17]||(_[17]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",_y,i.toDisplayString(g.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",wy,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((R=l.value[0])!=null&&R.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:_[13]||(_[13]=k=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"]))}}),vy={class:"flex grow flex-col"},ky=["src"],Cy={class:"w-full"},Sy={},kd=i.defineComponent({...Sy,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",vy,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,ky),i.createElementVNode("div",Cy,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),By={class:"flex flex-col gap-2"},Ty={class:"w-104 flex grow flex-col px-5"},Ry={},Cd=i.defineComponent({...Ry,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>o.value[0].configuratorParams.linesWidths.reduce((g,u)=>(g??0)+(u??0),0)),d=g=>{g===void 0&&(g=o.value.length-1);const u=o.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(g+1,0,null),o.value.forEach(b=>{b.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const p=new K.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});o.value=o.value.toSpliced(g+1,0,p)},h=g=>{const u=o.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(g,1),o.value.forEach(p=>{p.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),o.value=o.value.toSpliced(g,1),delete a[`linesWidths.${g}`],delete a[`linesWidths.${g}`])},f=async(g,u,p)=>{const b={linesWidths:g.linesWidths.at(u)};p.value=!0,a.value[`linesWidths.${u}`]={},o.value[u].product=new K.Product,n.eventEmitter.emit("configurator:search-product",{category:o.value[u].category,params:b,validationFieldResultData:a.value,callback:y=>{y?(o.value[u].product=y,u===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&c.value&&c.value<n.settings.width&&d()):(o.value[u].product=new K.Product,a.value[`linesWidths.${u}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},p.value=!1),p.value=!1}})},m=async()=>{var g,u;(u=(g=s.value)==null?void 0:g.formReference)==null||u.validate(p=>{if(!p){l.value=!0;const b=o.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var y,_;(_=(y=s.value)==null?void 0:y.formReference)==null||_.restoreValidation()})})}}).catch(F.noop)};return i.watch(()=>n.cartItems,g=>{o.value=g.map(u=>new K.CartItemBase(u))}),(g,u)=>{const p=z.NButton;return i.openBlock(),i.createElementBlock("div",By,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[3]||(u[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Ty,[i.createVNode(kd,{value:o.value,"onUpdate:value":u[1]||(u[1]=b=>o.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(vd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":u[2]||(u[2]=b=>o.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":f,onSubmit:m,"onClick:addLine":d,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing"])])])}}}),$y={class:"flex flex-col gap-3"},Py={},Sd=i.defineComponent({...Py,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit"],setup(t,{expose:e,emit:n}){var m;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(F.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ue.required,ue.min(r.settings.minWidth),...r.settings.maxWidth?[ue.max(r.settings.maxWidth)]:[],ue.step(1),Qe.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ue.required,ue.min(r.settings.minLength),ue.max(r.settings.maxLength),ue.step(1),Qe.serverValidation(r.validation.length.feedback)],quantity:[ue.required,ue.min(1),ue.step(1),Qe.serverValidation(r.validation.quantity.feedback)],marker:[Qe.serverValidation(r.validation.marker.feedback)]})),d=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(g,u)=>{const p=new K.CartItemBase(r.value);p[g]=u,g==="configuratorParams"&&(p.product=new K.Product),s("update:value",p)},f=()=>{var g;(g=a.value)==null||g.select()};return i.watch(()=>r.value,g=>{l.value=F.cloneDeep(g)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(m=o.value)==null?void 0:m.validate,formReference:o}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[u[0]||(u[0]=p=>l.value.configuratorParams.width=p),d],class:"w-full",parse:i.unref(Ut),"show-button":!1,placeholder:"Введите ширину",onKeydown:u[1]||(u[1]=p=>i.unref(ln)(p,".",!1)),onInput:u[2]||(u[2]=p=>i.unref(Ke)(t.validation,"width"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Yi,{value:l.value.configuratorParams.length,"onUpdate:value":[u[3]||(u[3]=p=>l.value.configuratorParams.length=p),d],placeholder:"Введите длину",parse:i.unref(Ut),"show-button":!1,class:"w-full",onKeydown:u[4]||(u[4]=p=>i.unref(ln)(p,".",!1)),onInput:u[5]||(u[5]=p=>i.unref(Ke)(t.validation,"length"))},null,8,["value","parse"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:u[6]||(u[6]=p=>i.unref(ii)(p,!1)),onInput:u[7]||(u[7]=p=>i.unref(Ke)(t.validation,"quantity")),"onUpdate:value":u[8]||(u[8]=p=>h("quantity",p??0))},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:u[9]||(u[9]=p=>i.unref(Ke)(t.validation,"marker")),"onUpdate:value":u[10]||(u[10]=p=>h("marker",p??null))},null,8,["value"])]),_:1}),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",$y,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:u[11]||(u[11]=p=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"]))}}),Ey={class:"flex flex-col gap-2 w-72"},Ny={},Bd=i.defineComponent({...Ny,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=async f=>{var m,g;o.value.product=new K.Product,(g=(m=s.value)==null?void 0:m.formReference)==null||g.validate(u=>{u||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:p=>{p?o.value.product=p:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(F.noop)},h=async()=>{var f,m;(m=(f=s.value)==null?void 0:f.formReference)==null||m.validate(g=>{g||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var u,p;(p=(u=s.value)==null?void 0:u.formReference)==null||p.restoreValidation()})}))}).catch(F.noop)};return i.watch(()=>n.cartItem,f=>{o.value=new K.CartItemBase(f)},{deep:!0}),(f,m)=>{const g=z.NButton;return i.openBlock(),i.createElementBlock("div",Ey,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=u=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[4]||(m[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Sd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":m[1]||(m[1]=u=>o.value=u),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":m[2]||(m[2]=u=>d(u)),onSubmit:m[3]||(m[3]=u=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Fy={key:0,class:"flex justify-center p-4"},Ay={key:1,class:"p-4 text-center text-red-500"},My={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},Vy={key:3,class:"p-4 text-center text-gray-500"},Td=i.defineComponent({__name:"dynamic-configurator",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function]},categoryContextButtonsConfig:{type:Function},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configuratorSettings}),o=i.computed(()=>{var f;return(f=e.categoryItem.properties)==null?void 0:f.configurator}),a=i.ref(null),l=i.ref(null),c=()=>{var m,g;if(!s.value){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:e.categoryItem,configurator:o.value,quantity:1};switch(o.value){case"kozyrek":{const u=s.value;a.value=new K.CartItemBase({...f,configuratorParams:{length:u.stripMinLength,linesAngles:[],linesWidths:[],startTailType:F.some(u.startTailConfigs,p=>p.isDefault)?(m=u.startTailConfigs)==null?void 0:m.findIndex(p=>p.isDefault):void 0,endTailType:F.some(u.endTailConfigs,p=>p.isDefault)?(g=u.endTailConfigs)==null?void 0:g.findIndex(p=>p.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const u=s.value;a.value=new K.CartItemBase({...f,configuratorParams:{width:0,height:0,netType:u.netType[0]||"",color:u.color[0]||"",mountType:u.mountType[0]||""}});break}case"strip":{const u=s.value;l.value=[new K.CartItemBase({...f,length:u.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const u=s.value;a.value=new K.CartItemBase({...f,configuratorParams:{width:u.minWidth,length:u.minLength}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${o.value}.`}a.value&&(a.value.marker=void 0)},d=(f,m,g)=>{const u=p=>{g==null||g(),p&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:u,validation:m})},h=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})};return i.onMounted(()=>{c()}),(f,m)=>{const g=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",Fy,[i.createVNode(g,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",Ay,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),s.value!==null&&(a.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",My,[o.value==="kozyrek"?(i.openBlock(),i.createBlock(yd,{key:0,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="mosquitto"?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):o.value==="strip"?(i.openBlock(),i.createBlock(Cd,{key:2,"event-emitter":t.eventEmitter,settings:s.value,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):o.value==="metal_for_doors"?(i.openBlock(),i.createBlock(Bd,{key:3,"event-emitter":t.eventEmitter,settings:s.value,"cart-item":a.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",Vy,' Конфигуратор "'+i.toDisplayString(o.value)+'" не поддерживается. ',1))],64)}}}),Iy={key:0,class:"pt-0.5"},Oy={key:0},zy={class:"line-through"},Ly={key:0},Dy={key:1},Hy={class:"flex flex-row gap-1"},Wy={key:0},jy={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},qy={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Xy={key:2,class:"flex flex-col"},Yy={},Uy=i.defineComponent({...Yy,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function,default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>{var N;return(N=e==null?void 0:e.filteredItems)==null?void 0:N[e.categoryItem.id]}),s=i.computed(()=>{var N,O;return F.isArray((N=e.categoryItem)==null?void 0:N.categories)&&((O=e.categoryItem.categories)==null?void 0:O.length)>0}),o=i.computed(()=>{var N;return F.isArray((N=e.categoryItem)==null?void 0:N.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([N,O])=>`${O} руб./${B(N)}`).join(", ")),l=i.computed(()=>F.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(N=>{var Y;const O=(Y=r.value)==null?void 0:Y.products;return F.isArray(O)&&O.includes(N.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>F.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>F.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),f=i.computed(()=>F.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>F.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var N,O;return((N=e.categoryItem.properties)==null?void 0:N.configurator)!==void 0&&((O=e.categoryItem.properties)==null?void 0:O.configuratorSettings)!==void 0&&(F.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),u=i.computed(()=>{var N,O;return((N=e.categoryItem.properties)==null?void 0:N.configurator)!==void 0&&((O=e.categoryItem.properties)==null?void 0:O.configuratorSettings)!==void 0&&(F.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),p=i.computed(()=>F.isNil(e.categoryContextButtonsConfig)?[]:F.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new K.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),R=i.computed(()=>!F.isUndefined(e.isCategoryItemSelected)),k=i.computed(()=>F.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected),w=i.computed(()=>I.value&&wt.getDeviceTypeByResolution()===Ue.laptop?"auto":"fixed"),C=i.useTemplateRef("collapse-item-reference"),S=i.computed(()=>{var N,O;return(O=(N=e.categoryItem.properties)==null?void 0:N.templateCost)==null?void 0:O.priceCoefficient}),T=i.computed(()=>{var N,O;return(O=(N=e.categoryItem.properties)==null?void 0:N.templateCost)==null?void 0:O.increasePercent}),B=(N,O="ru-RU")=>0 .toLocaleString(O,{style:"currency",currency:N,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),$=N=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:N,target:C.value})},M=(N,O)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:O,isLoadingState:y,target:C.value})},E=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:C.value})},V=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:C.value})},L=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:C.value})},D=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:C.value})},te=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:C.value})},ne=N=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:N,target:C.value})},A=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},I=i.ref(0),j=i.computed(()=>I.value&&o.value.length>0?kg(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),q=F.debounce(()=>{I.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",q)}),window.addEventListener("resize",q),q(),(N,O)=>{const Y=z.NCheckbox,re=hf,de=z.NTooltip,oe=Ya,ie=z.NTag,Fe=of,rt=nf,Ce=z.NButton,Yt=Ju,Ie=Xa,tn=qa,nn=ja,Tt=Wa,Ot=z.NDropdown,rn=z.NDataTable,dt=z.NAlert,On=z.NSpin;return i.openBlock(),i.createBlock(Ua,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":M},{"pre-arrow":i.withCtx(()=>{var Le,Be;return[R.value?(i.openBlock(),i.createElementBlock("div",Iy,[i.createVNode(Y,{checked:k.value,disabled:k.value==="disabled","onUpdate:checked":$},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Le=b.value)!=null&&Le.isDisabled)?(i.openBlock(),i.createBlock(de,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(re,{class:"pt-1.5"})]),default:i.withCtx(()=>[O[1]||(O[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((Be=b.value)==null?void 0:Be.isFavorite)??!1?(i.openBlock(),i.createBlock(de,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[O[2]||(O[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Le,Be,Xe,Q,se;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Le=b.value)==null?void 0:Le.isDisabled})},[i.createVNode(de,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[O[3]||(O[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:O[0]||(O[0]=i.withModifiers((...Se)=>i.unref(F.noop)&&i.unref(F.noop)(...Se),["prevent","stop"]))},[(Be=t.categoryItem.properties)!=null&&Be.m2Price?(i.openBlock(),i.createBlock(ie,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Xe=t.categoryItem.properties)==null?void 0:Xe.templateCost)&&t.categoryItem.properties.m2PriceRetail&&T.value}),round:""},{default:i.withCtx(()=>{var Se;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Se=t.categoryItem.properties)!=null&&Se.templateCost&&t.categoryItem.properties.m2PriceRetail&&T.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[T.value?(i.openBlock(),i.createBlock(ie,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[T.value?(i.openBlock(),i.createElementBlock("span",Oy,i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ie,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",zy,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Q=t.categoryItem.properties)!=null&&Q.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[S.value||T.value?(i.openBlock(),i.createBlock(ie,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Se;return[S.value?(i.openBlock(),i.createElementBlock("span",Ly,i.toDisplayString((Se=S.value)==null?void 0:Se.name),1)):i.createCommentVNode("",!0),T.value?(i.openBlock(),i.createElementBlock("span",Dy,i.toDisplayString(T.value>0?"+":"")+i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ie,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((se=b.value)!=null&&se.manager)?(i.openBlock(),i.createBlock(ie,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:D},{default:i.withCtx(()=>[i.createVNode(de,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Se,sn;return[i.createElementVNode("span",Hy,[i.createVNode(Fe),i.createTextVNode(" "+i.toDisplayString((sn=(Se=b.value)==null?void 0:Se.manager)==null?void 0:sn.name),1)])]}),default:i.withCtx(()=>{var Se,sn;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((sn=(Se=b.value)==null?void 0:Se.manager)==null?void 0:sn.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Wy,[i.createElementVNode("ul",jy,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Le,Be)=>(i.openBlock(),i.createElementBlock("li",{key:Be}," ("+i.toDisplayString(Be)+"): "+i.toDisplayString(Le),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Le,Be)=>(i.openBlock(),i.createElementBlock("li",{key:Be}," ("+i.toDisplayString(Be)+"): "+i.toDisplayString(Le),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Le;return[i.createElementVNode("div",qy,[d.value?(i.openBlock(),i.createBlock(de,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),onClick:E},{default:i.withCtx(()=>{var Be;return[(Be=b.value)!=null&&Be.isDisabled?(i.openBlock(),i.createBlock(re,{key:1})):(i.openBlock(),i.createBlock(rt,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Be;return[(Be=b.value)!=null&&Be.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Le=b.value)!=null&&Le.manager)?(i.openBlock(),i.createBlock(de,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),onClick:L},{default:i.withCtx(()=>[i.createVNode(Yt)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Be,Xe,Q;return[(Be=b.value)!=null&&Be.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Q=(Xe=b.value)==null?void 0:Xe.manager)==null?void 0:Q.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(de,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,disabled:f.value==="disabled",size:i.unref(n),onClick:V},{default:i.withCtx(()=>{var Be;return[(Be=b.value)!=null&&Be.isRequired?(i.openBlock(),i.createBlock(tn,{key:1})):(i.openBlock(),i.createBlock(Ie,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[O[4]||(O[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(de,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),type:"primary",onClick:te},{default:i.withCtx(()=>[i.createVNode(nn)]),_:1},8,["size"])]),default:i.withCtx(()=>[O[5]||(O[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Ot,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:ne},{default:i.withCtx(()=>[i.createVNode(Ce,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(Tt)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(N.$slots,"default",{},()=>{var Le;return[s.value?(i.openBlock(),i.createBlock($d,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Le=r.value)==null?void 0:Le.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(Td,{key:1,"event-emitter":t.eventEmitter,"category-item":t.categoryItem},null,8,["event-emitter","category-item"])):c.value?(i.openBlock(),i.createElementBlock("div",Xy,[g.value?(i.openBlock(),i.createBlock(Ce,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:A},{default:i.withCtx(()=>[...O[6]||(O[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(rn,{columns:j.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Be=>Be.id,"table-layout":w.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(dt,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(dt,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(On,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...O[7]||(O[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Gy=ri(Uy,[["__scopeId","data-v-063e89d9"]]),Ky={class:"sc-collapse flex w-full flex-col"},Zy={},Rd=i.defineComponent({...Zy,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",Ky,[i.renderSlot(o.$slots,"default")]))}}),Qy={},$d=i.defineComponent({...Qy,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>F.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(F.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Rd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Gy,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Jy={},Pd=i.defineComponent({...Jy,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=new K.Reference,l=i.computed(()=>{const g=o.value?[]:a,u=F.isUndefined(r.value)?g:r.value;return F.isArray(u)?u.map(p=>p.id):u==null?void 0:u.id}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var u;if(F.isArray(g)){const p=g.length>0?g.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=g===a.id||(u=c.value.find(b=>b.value===g))==null?void 0:u.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=h.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=h.value)==null?void 0:g.blur()}}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),e0={},t0=i.defineComponent({...e0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var R,k;const n=t,r=e,s=()=>{const w=K.PriceCoefficient.getRetailPriceCoefficient();return F.unset(w,"isNewRec"),w},o=w=>!w||w.id===s().id,a=i.computed(()=>{var w;return((w=n.catalogItem)==null?void 0:w.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=w=>{var C,S,T,B;return w.id===s().id?(C=l.value)==null?void 0:C.getRetailCost():(B=(T=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:T.find($=>$.coefficient.id===w.id))==null?void 0:B.cost},d=i.computed(()=>{var C;const w=[...((C=K.useReferencesStore().priceCoefficientsReference)==null?void 0:C.map(S=>structuredClone(i.toRaw(S))))??[],s()];return a.value&&w.forEach(S=>{var B;const T=c(S);T?S.name+=` (${T} ${(B=l.value)==null?void 0:B.currency})`:S.name=""}),w.filter(S=>S.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((k=(R=n.value)==null?void 0:R.value)==null?void 0:k.toString())??null),m=i.ref(null),g=i.computed(()=>{var w,C;return(C=(w=l.value)==null?void 0:w.priceCoefficients)==null?void 0:C.find(S=>S.coefficient.slug===K.PriceCoefficientEnum.K0)}),u=i.ref(void 0),p=()=>{var C,S,T;u.value=void 0;let w=Number.parseFloat(((C=f.value)==null?void 0:C.replace(",","."))??"");if(w=Number.isNaN(w)?void 0:w,a.value)if(h.value||f.value){const B=s(),$=c(h.value??B)??0,M=$+$*((w??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(M),M>(((S=l.value)==null?void 0:S.getRetailCost())??M)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&M<(((T=g.value)==null?void 0:T.cost)??0)&&(u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},b=w=>{F.isArray(w)||(h.value=w,!h.value&&f.value&&(h.value=s()),p())},y=()=>{h.value||(h.value=s()),p()},_=w=>{var S,T,B,$,M,E;const C=Number.parseFloat((w==null?void 0:w.replace(",","."))??"");if(a.value){let V=0;if(C<=0)h.value=void 0,f.value=null;else if(g.value&&C<(((S=g.value)==null?void 0:S.cost)??0))h.value=(T=g.value)==null?void 0:T.coefficient,V=(C-g.value.cost)*100/g.value.cost,u.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(C>(((B=l.value)==null?void 0:B.getRetailCost())??C)){h.value=s();const L=(($=l.value)==null?void 0:$.getRetailCost())??0;V=(C-L)*100/L,u.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const L=(E=(M=l.value)==null?void 0:M.priceCoefficients)==null?void 0:E.filter(D=>D.cost<C);if(L&&L.length>0){const D=L.at(-1);h.value=D==null?void 0:D.coefficient,V=(C-((D==null?void 0:D.cost)??0))*100/((D==null?void 0:D.cost)??1)}u.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(V),r("update:value",{value:Number.isNaN(V)?void 0:V,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(C)?void 0:C,coefficient:void 0})};return i.onMounted(()=>{var w,C,S,T;n.calculationType===K.CalculationTypeEnum.m2Cost?m.value=((C=(w=n.value)==null?void 0:w.value)==null?void 0:C.toString())??null:!((S=n.value)!=null&&S.coefficient)&&((T=n.value)!=null&&T.value)&&(h.value=s()),p()}),(w,C)=>{var B,$,M;const S=z.NInput,T=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(F.isNil)(t.label),label:t.label,"show-feedback":!i.unref(F.isNil)(((B=u.value)==null?void 0:B.feedback)??t.feedback),feedback:(($=u.value)==null?void 0:$.feedback)??t.feedback,"validation-status":((M=u.value)==null?void 0:M.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(K.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(K.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(T,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Pd,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(S,{value:f.value,"onUpdate:value":[C[0]||(C[0]=E=>f.value=E),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[C[3]||(C[3]=i.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[C[2]||(C[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(K.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(S,{key:1,value:m.value,"onUpdate:value":[C[1]||(C[1]=E=>m.value=E),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var E;return[i.createTextVNode(i.toDisplayString((E=l.value)==null?void 0:E.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),n0={key:0,class:"flex flex-row gap-2.5"},i0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},r0={},Ed=i.defineComponent({...r0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=wt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=wt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},f=(g="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let u=!1;s("closing",g,()=>{u=!0}),u||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",u=>{a.value=u})};return i.watch(()=>r.show,g=>{g?h():f("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:h,close:f}),(g,u)=>{const p=z.NButton,b=z.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:u[1]||(u[1]=y=>f("header")),onEsc:u[2]||(u[2]=y=>f("esc")),onMaskClick:u[3]||(u[3]=y=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",n0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",i0,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:u[0]||(u[0]=y=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),s0={class:"text-sm"},o0={},a0=i.defineComponent({...o0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.ref(null),o=i.computed(()=>{var w,C;return((C=(w=s.value)==null?void 0:w.properties)==null?void 0:C.isLengthConfigurator)??!1}),a=i.ref(void 0),l=i.ref(void 0),c=i.ref(null),d=n,h=()=>({length:{},quantity:{},marker:{}}),f=i.ref(h()),m=i.ref(!1),g=i.computed(()=>{var B,$,M,E;if(!s.value)return{};const w=K.UnitsHelper.getProductLengthMultiplicity(s.value),C=K.UnitsHelper.getProductMultiplicity(s.value),S=(($=(B=s.value)==null?void 0:B.properties)==null?void 0:$.minLength)||w,T=(E=(M=s.value)==null?void 0:M.properties)==null?void 0:E.maxLength;return{length:[ue.required,ue.min(S??.1),ue.max(T),ue.step(w),Qe.serverValidation(f.value.length.feedback)],quantity:[ue.required,ue.min(C),ue.step(C),Qe.serverValidation(f.value.quantity.feedback)],marker:[Qe.serverValidation(f.value.marker.feedback)]}}),u=i.computed(()=>{var w,C,S;return s.value?((w=s.value.properties)==null?void 0:w.lengthStep)??((C=s.value.properties)!=null&&C.ignoreMinCountCheck?0:((S=s.value.properties)==null?void 0:S.minCount)??0):0}),p=i.computed(()=>{var S,T,B,$,M,E,V,L,D;if(!s.value)return"";const w=((T=(S=s.value)==null?void 0:S.properties)==null?void 0:T.minLength)??(($=(B=s.value)==null?void 0:B.properties)!=null&&$.ignoreMinCountCheck?0:(E=(M=s.value)==null?void 0:M.properties)==null?void 0:E.minCount),C=(L=(V=s.value)==null?void 0:V.properties)==null?void 0:L.maxLength;return w||C?`(${w?`от ${w}`:""}${w&&C?" ":""}${C?`до ${C}`:""} ${(D=s.value)==null?void 0:D.unit})`:""}),b=w=>{var $,M;if(!((M=($=s.value)==null?void 0:$.properties)!=null&&M.isLengthConfigurator)||!c.value||F.isNil(w)||u.value===0)return;const C=w/u.value,S=Math.round(C),T=K.UnitsHelper.getProductMultiplicity(s.value),B=Math.max(S,T);c.value.quantity=B},y=w=>{var B,$,M,E;if(!(($=(B=s.value)==null?void 0:B.properties)!=null&&$.isLengthConfigurator)||!c.value||F.isNil(w)||u.value===0)return;const C=w*u.value,S=((M=s.value.properties)==null?void 0:M.minLength)||K.UnitsHelper.getProductLengthMultiplicity(s.value),T=(E=s.value.properties)==null?void 0:E.maxLength;S!==void 0&&C<S?c.value.length=S:T!==void 0&&C>T?c.value.length=T:c.value.length=C},_=async w=>{var C;try{await((C=r.value)==null?void 0:C.validate(S=>{if(!S){if(!s.value||!c.value)return;K.UnitsHelper.productIsMeasurable(s.value)||delete c.value.length,o.value&&u.value&&(c.value.length=u.value),m.value=!0,d("submit",c.value,f.value,()=>{m.value=!1,w(!1),i.nextTick(()=>{var T;(T=r.value)==null||T.validate(F.noop).catch(F.noop)})})}}))}catch{}},R=()=>{s.value=null,a.value=void 0,c.value=null,f.value=h()};return e({show:(w,C)=>{var S,T,B,$;if(s.value=w,a.value=C==null?void 0:C.cartItemData,l.value=C==null?void 0:C.orderId,c.value=new K.CartItemBase((C==null?void 0:C.cartItemData)??new K.CartItemBase({product:w,quantity:1,length:((S=w==null?void 0:w.properties)==null?void 0:S.minLength)||((T=w==null?void 0:w.properties)!=null&&T.ignoreMinCountCheck?0:(B=w==null?void 0:w.properties)==null?void 0:B.minCount)||0})),($=w==null?void 0:w.properties)!=null&&$.isLengthConfigurator&&c.value&&u.value>0){const M=u.value,E=c.value.quantity||1;c.value.length=E*M}},closeDialog:R}),(w,C)=>{const S=z.NInputNumber,T=z.NFormItem,B=z.NInputGroupLabel,$=z.NInputGroup,M=z.NInput;return i.openBlock(),i.createBlock(Ed,{show:!i.unref(F.isNil)(s.value)&&!i.unref(F.isNil)(c.value),title:`${a.value?"Изменение":"Добавление"} товара в ${l.value?` заказ №${l.value}`:"корзину"}`,"accept-button":{show:!0,text:a.value?"Изменить":"Добавить"},processing:m.value,onAccept:_,onClosing:R},{default:i.withCtx(()=>[s.value&&c.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:c.value,rules:g.value,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(K.UnitsHelper).productIsMeasurable(s.value)?(i.openBlock(),i.createBlock(T,{key:0,path:"length",label:`Метраж, ${p.value+s.value.unit}`},{default:i.withCtx(()=>[i.createVNode(S,{value:c.value.length,"onUpdate:value":[C[0]||(C[0]=E=>c.value.length=E),b],parse:i.unref(Ut),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:C[1]||(C[1]=E=>i.unref(ln)(E,".",!1)),onInput:C[2]||(C[2]=E=>i.unref(Ke)(f.value,"length"))},null,8,["value","parse"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(T,{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode($,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(S,{value:c.value.quantity,"onUpdate:value":[C[3]||(C[3]=E=>c.value.quantity=E),y],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[4]||(C[4]=E=>i.unref(ii)(E,!1)),onInput:C[5]||(C[5]=E=>i.unref(Ke)(f.value,"quantity"))},null,8,["value"]),o.value?(i.openBlock(),i.createBlock(B,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(u.value)+" "+i.toDisplayString(s.value.unit),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!f.value.quantity.feedback&&i.unref(K.UnitsHelper).getProductMultiplicity(s.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",s0,"Количество должно быть кратно "+i.toDisplayString(i.unref(K.UnitsHelper).getProductMultiplicity(s.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.createVNode(T,{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(M,{value:c.value.marker??null,placeholder:"Введите маркировку",onInput:C[6]||(C[6]=E=>i.unref(Ke)(f.value,"marker")),"onUpdate:value":C[7]||(C[7]=E=>c.value.marker=E??null)},null,8,["value"])]),_:1})]),_:1},8,["model","rules"])):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),l0={class:"flex flex-row gap-1"},c0={class:"sc-client-name flex flex-col gap-1 text-base"},d0=["href"],h0={key:1,class:"text-sc-grey"},u0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},f0={key:0},g0={key:1,class:"text-sm"},m0={},us=i.defineComponent({...m0,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Ln.format(n.client.lastLoginAt,K.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{F.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=zs,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",l0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(F.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",c0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",h0," [ Деактивирован ] "))],8,d0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",u0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",f0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",g0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),p0={class:"text-base"},y0={},Nd=i.defineComponent({...y0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",p0,i.toDisplayString(t.contragent.name),1))}}),b0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _0(t,e){return i.openBlock(),i.createElementBlock("svg",b0,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const w0=i.markRaw({name:"tabler-mail",render:_0}),x0=["href"],v0={},k0=i.defineComponent({...v0,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=w0;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,x0)],2)}}}),C0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function S0(t,e){return i.openBlock(),i.createElementBlock("svg",C0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Fd=i.markRaw({name:"fa6-brands-viber",render:S0}),B0={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},T0=["id"],R0=["id"],$0=["fill"],P0=["fill"];function E0(t,e){return i.openBlock(),i.createElementBlock("svg",B0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,T0),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,R0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,$0),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,P0),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ad=i.markRaw({name:"logos-whatsapp-icon",render:E0,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),N0={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},F0=["id"],A0=["fill"];function M0(t,e){return i.openBlock(),i.createElementBlock("svg",N0,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,F0)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,A0),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Md=i.markRaw({name:"logos-telegram",render:M0,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),V0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function I0(t,e){return i.openBlock(),i.createElementBlock("svg",V0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const Vd=i.markRaw({name:"ion-call",render:I0}),O0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z0(t,e){return i.openBlock(),i.createElementBlock("svg",O0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const L0=i.markRaw({name:"tabler-phone-call",render:z0}),D0={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},H0=["href"],W0=["href"],j0=["href"],q0=["href"],X0={},Y0=i.defineComponent({...X0,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?sr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return F.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return F.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return F.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=L0,h=Vd,f=Md,m=Ad,g=Fd;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=u=>a.value=!a.value),onFocusout:c[1]||(c[1]=u=>a.value=!1),onMouseleave:c[2]||(c[2]=u=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",D0,[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,H0)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(f)],8,W0)):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(m)],8,j0)):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(g)],8,q0)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),U0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G0(t,e){return i.openBlock(),i.createElementBlock("svg",U0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const K0=i.markRaw({name:"mdi-envelope",render:G0}),Z0={class:"flex flex-col gap-1"},Q0={key:0,class:"mb-2 flex flex-col text-base"},J0={key:0,class:"text-sc-dark-grey text-sm"},eb={key:1,class:"whitespace-nowrap text-sm"},tb={key:2,class:"whitespace-nowrap text-sm"},nb={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},ib=["href"],rb=["href"],sb=["href"],ob=["href"],ab=["href"],lb={key:0,class:"flex flex-col text-base"},cb={key:0,class:"text-sc-dark-grey text-sm"},db={key:1,class:"mt-2 text-sm"},hb={key:0,class:"-mt-1"},ub={},fb=i.defineComponent({...ub,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?sr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return F.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return F.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return F.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const h=Vd,f=Md,m=Ad,g=Fd,u=K0,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",Z0,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,R,k,w;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=C=>l.value=!0),onFocusin:d[1]||(d[1]=C=>l.value=!0),onMouseleave:d[2]||(d[2]=C=>l.value=!1),onFocusout:d[3]||(d[3]=C=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(R=t.contact)!=null&&R.position)?(i.openBlock(),i.createElementBlock("div",Q0,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",J0,i.toDisplayString((w=t.contact)==null?void 0:w.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",eb,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",tb,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",nb,[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,ib)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,rb)):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(m)],8,sb)):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(g)],8,ob)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(u)],8,ab)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,R,k,w;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",lb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",cb,i.toDisplayString((R=t.contact)==null?void 0:R.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(k=t.contact)!=null&&k.comment?(i.openBlock(),i.createElementBlock("div",db,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((w=t.contact)==null?void 0:w.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",hb,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class gb{constructor(e){v(this,"minHeight");v(this,"maxHeights");v(this,"minWidth");v(this,"maxWidths");v(this,"netType");v(this,"color");v(this,"mountType");v(this,"descriptions");v(this,"crossbarCount");v(this,"heightOverlaps");v(this,"widthOverlaps");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Os.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Os.objectToSnake(e.heightOverlaps),this.widthOverlaps=Os.objectToSnake(e.widthOverlaps)}}const mb={class:"flex flex-wrap gap-2"},pb={class:"flex flex-col"},yb={class:"flex flex-col"},bb={},_b=i.defineComponent({...bb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>K.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return F.forOwn(K.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Ln.startOfDay(new Date(a)):void 0,to:l?Ln.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,m,g,u,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",mb,[i.createVNode(d,{value:((f=(h=t.dateRange)==null?void 0:h.from)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(m=t.disabled)==null?void 0:m.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",pb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var R,k;return o((R=b==null?void 0:b.from)==null?void 0:R.getTime(),(k=b==null?void 0:b.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((u=(g=t.dateRange)==null?void 0:g.to)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",yb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var R,k;return o((R=b==null?void 0:b.from)==null?void 0:R.getTime(),(k=b==null?void 0:b.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),wb={class:"sc-lbl-date text-nowrap"},xb={},Oo=i.defineComponent({...xb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Ln.format(e.date,K.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Ln.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",wb,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),vb={class:"flex flex-row gap-2.5"},kb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},Cb={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Sb={class:"mb-0.5 sm:mb-0 sm:ml-3"},Bb={},Tb=i.defineComponent({...Bb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=hs,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",vb,[i.createElementVNode("div",kb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",Cb,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",Sb,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),Rb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $b(t,e){return i.openBlock(),i.createElementBlock("svg",Rb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const Pb=i.markRaw({name:"ion-download-outline",render:$b}),Eb={},Nb=i.defineComponent({...Eb,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=Pb;return i.openBlock(),i.createBlock(i.unref(z.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Fb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ab(t,e){return i.openBlock(),i.createElementBlock("svg",Fb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const Mb=i.markRaw({name:"ion-checkmark-done-sharp",render:Ab}),Vb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ib(t,e){return i.openBlock(),i.createElementBlock("svg",Vb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const Ob=i.markRaw({name:"ion-options-outline",render:Ib}),zb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Lb={class:"flex-auto"},Db={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Hb={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Wb={},zo=i.defineComponent({...Wb,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=Ob,f=z.NButton,m=z.NPopover,g=Mb,u=hs;return i.openBlock(),i.createElementBlock("div",zb,[i.createElementVNode("div",Lb,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Db,[i.createElementVNode("div",Hb,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(m,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(m,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),jb={},Id=i.defineComponent({...jb,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(zo,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(zo,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),qb={},Xb=i.defineComponent({...qb,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=F.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Yb={},Ub=i.defineComponent({...Yb,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=F.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(F.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(F.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof sr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=sr.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof sr.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Hu.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),Gb=ri(Ub,[["__scopeId","data-v-751dbb0e"]]),Kb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zb(t,e){return i.openBlock(),i.createElementBlock("svg",Kb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const Qb=i.markRaw({name:"tabler-external-link",render:Zb}),Jb={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},e_=["href"],t_={},n_=i.defineComponent({...t_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Qb,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(F.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Jb,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,e_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),i_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function r_(t,e){return i.openBlock(),i.createElementBlock("svg",i_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const s_=i.markRaw({name:"ion-remove-circle-outline",render:r_});let fs=[];const Od=new WeakMap;function o_(){fs.forEach(t=>t(...Od.get(t))),fs=[]}function zd(t,...e){Od.set(t,e),!fs.includes(t)&&fs.push(t)===1&&requestAnimationFrame(o_)}function mr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function pr(t){return t.composedPath()[0]||null}function yr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function br(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Zt(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Ld={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function a_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function l_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const yn="^\\s*",bn="\\s*$",Xn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",It="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",hi="([0-9A-Fa-f])",ui="([0-9A-Fa-f]{2})",Dd=new RegExp(`${yn}hsl\\s*\\(${It},${Xn},${Xn}\\)${bn}`),Hd=new RegExp(`${yn}hsv\\s*\\(${It},${Xn},${Xn}\\)${bn}`),Wd=new RegExp(`${yn}hsla\\s*\\(${It},${Xn},${Xn},${It}\\)${bn}`),jd=new RegExp(`${yn}hsva\\s*\\(${It},${Xn},${Xn},${It}\\)${bn}`),c_=new RegExp(`${yn}rgb\\s*\\(${It},${It},${It}\\)${bn}`),d_=new RegExp(`${yn}rgba\\s*\\(${It},${It},${It},${It}\\)${bn}`),h_=new RegExp(`${yn}#${hi}${hi}${hi}${bn}`),u_=new RegExp(`${yn}#${ui}${ui}${ui}${bn}`),f_=new RegExp(`${yn}#${hi}${hi}${hi}${hi}${bn}`),g_=new RegExp(`${yn}#${ui}${ui}${ui}${ui}${bn}`);function Et(t){return parseInt(t,16)}function m_(t){try{let e;if(e=Wd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),gi(e[13])];if(e=Dd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function p_(t){try{let e;if(e=jd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),gi(e[13])];if(e=Hd.exec(t))return[ms(e[1]),Yn(e[5]),Yn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function fi(t){try{let e;if(e=u_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),1];if(e=c_.exec(t))return[gt(e[1]),gt(e[5]),gt(e[9]),1];if(e=d_.exec(t))return[gt(e[1]),gt(e[5]),gt(e[9]),gi(e[13])];if(e=h_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),1];if(e=g_.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),gi(Et(e[4])/255)];if(e=f_.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),gi(Et(e[4]+e[4])/255)];if(t in Ld)return fi(Ld[t]);if(Dd.test(t)||Wd.test(t)){const[n,r,s,o]=m_(t);return[...l_(n,r,s),o]}else if(Hd.test(t)||jd.test(t)){const[n,r,s,o]=p_(t);return[...a_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function y_(t){return t>1?1:t<0?0:t}function Lo(t,e,n,r){return`rgba(${gt(t)}, ${gt(e)}, ${gt(n)}, ${y_(r)})`}function Do(t,e,n,r,s){return gt((t*e*(1-r)+n*r)/s)}function b_(t,e){Array.isArray(t)||(t=fi(t)),Array.isArray(e)||(e=fi(e));const n=t[3],r=e[3],s=gi(n+r-n*r);return Lo(Do(t[0],n,e[0],r,s),Do(t[1],n,e[1],r,s),Do(t[2],n,e[2],r,s),s)}function Ve(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:fi(t);return typeof e.alpha=="number"?Lo(n,r,s,e.alpha):Lo(n,r,s,o)}function gs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:fi(t),{lightness:a=1,alpha:l=1}=e;return __([n*a,r*a,s*a,o*l])}function gi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function ms(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function gt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Yn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function __(t){const[e,n,r]=t;return 3 in t?`rgba(${gt(e)}, ${gt(n)}, ${gt(r)}, ${gi(t[3])})`:`rgba(${gt(e)}, ${gt(n)}, ${gt(r)}, 1)`}function w_(t=8){return Math.random().toString(16).slice(2,2+t)}function qd(t){return Array.isArray(t)?t:[t]}const Ho={STOP:"STOP"};function Xd(t,e){const n=e(t);t.children!==void 0&&n!==Ho.STOP&&t.children.forEach(r=>Xd(r,e))}function x_(t,e={}){const{preserveGroup:n=!1}=e,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(t),r}function v_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function k_(t){return t.children}function C_(t){return t.key}function S_(){return!1}function B_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function T_(t){return t.disabled===!0}function R_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function $_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Wo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function jo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function P_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function E_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function N_(t){return(t==null?void 0:t.type)==="group"}function F_(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class A_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function M_(t,e,n,r){return ps(e.concat(t),n,r,!1)}function V_(t,e){const n=new Set;return t.forEach(r=>{const s=e.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function I_(t,e,n,r){const s=ps(e,n,r,!1),o=ps(t,n,r,!0),a=V_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function qo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:P_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:E_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let f;s!==void 0?f=I_(s,n,e,d):r!==void 0?f=M_(r,n,e,d):f=ps(n,e,d,!1);const m=c==="parent",g=c==="child"||l,u=f,p=new Set,b=Math.max.apply(null,Array.from(h.keys()));for(let y=b;y>=0;y-=1){const _=y===0,R=h.get(y);for(const k of R){if(k.isLeaf)continue;const{key:w,shallowLoaded:C}=k;if(g&&C&&k.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&u.has($.key)&&u.delete($.key)}),k.disabled||!C)continue;let S=!0,T=!1,B=!0;for(const $ of k.children){const M=$.key;if(!$.disabled){if(B&&(B=!1),u.has(M))T=!0;else if(p.has(M)){T=!0,S=!1;break}else if(S=!1,T)break}}S&&!B?(m&&k.children.forEach($=>{!$.disabled&&u.has($.key)&&u.delete($.key)}),u.add(w)):T&&p.add(w),_&&g&&u.has(w)&&u.delete(w)}}return{checkedKeys:Array.from(u),indeterminateKeys:Array.from(p)}}function ps(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&Xd(d,h=>{if(h.disabled)return Ho.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),R_(h.rawNode,o))){if(r)return Ho.STOP;if(!n)throw new A_}})}),l}function O_(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function z_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function L_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Yd(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?D_:L_,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=Xo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=H_(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(t),l}function D_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function H_(t){return t.parent}function Xo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=Xo(d,e);if(h!==null)return h}else return d}}return null}const W_={getChild(){return this.ignored?null:Xo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Yd(this,"next",t)},getPrev(t={}){return Yd(this,"prev",t)}};function j_(t,e){const n=e?new Set(e):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(t),r}function q_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var X_={};function Ud(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;X_.NODE_ENV!=="production"&&$_(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===t.length,f.parent=o,!f.ignored){const m=s(c);Array.isArray(m)&&(f.children=Ud(m,e,n,r,s,f,a+1))}l.push(f),e.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function Y_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=T_,getIgnored:a=S_,getIsGroup:l=N_,getKey:c=C_}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:k_,h=e.ignoreEmptyChildren?k=>{const w=d(k);return Array.isArray(w)?w.length?w:null:w}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return v_(this.rawNode,h)},get shallowLoaded(){return B_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(k){return q_(this,k)}},W_),m=Ud(t,r,s,f,h);function g(k){if(k==null)return null;const w=r.get(k);return w&&!w.isGroup&&!w.ignored?w:null}function u(k){if(k==null)return null;const w=r.get(k);return w&&!w.ignored?w:null}function p(k,w){const C=u(k);return C?C.getPrev(w):null}function b(k,w){const C=u(k);return C?C.getNext(w):null}function y(k){const w=u(k);return w?w.getParent():null}function _(k){const w=u(k);return w?w.getChild():null}const R={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(k){return j_(m,k)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return z_(m)},getPath(k,w={}){return O_(k,w,R)},getCheckedKeys(k,w={}){const{cascade:C=!0,leafOnly:S=!1,checkStrategy:T="all",allowNotLoaded:B=!1}=w;return qo({checkedKeys:Wo(k),indeterminateKeys:jo(k),cascade:C,leafOnly:S,checkStrategy:T,allowNotLoaded:B},R)},check(k,w,C={}){const{cascade:S=!0,leafOnly:T=!1,checkStrategy:B="all",allowNotLoaded:$=!1}=C;return qo({checkedKeys:Wo(w),indeterminateKeys:jo(w),keysToCheck:k==null?[]:qd(k),cascade:S,leafOnly:T,checkStrategy:B,allowNotLoaded:$},R)},uncheck(k,w,C={}){const{cascade:S=!0,leafOnly:T=!1,checkStrategy:B="all",allowNotLoaded:$=!1}=C;return qo({checkedKeys:Wo(w),indeterminateKeys:jo(w),keysToUncheck:k==null?[]:qd(k),cascade:S,leafOnly:T,checkStrategy:B,allowNotLoaded:$},R)},getNonLeafKeys(k={}){return x_(m,k)}};return R}function ys(t){return t.composedPath()[0]}const U_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function G_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(ys(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(ys(a))},o=a=>{r&&(e.contains(ys(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Gd(t,e,n){const r=U_[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=G_(t,e,n)),o}function K_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Gd(t,e,n);return Object.keys(s).forEach(o=>{St(o,document,s[o],r)}),!0}return!1}function Z_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Gd(t,e,n);return Object.keys(s).forEach(o=>{nt(o,document,s[o],r)}),!0}return!1}function Q_(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(S,T,B){const $=S[T];return S[T]=function(){return B.apply(S,arguments),$.apply(S,arguments)},S}function o(S,T){S[T]=Event.prototype[T]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var S;return(S=a.get(this))!==null&&S!==void 0?S:null}function d(S,T){l!==void 0&&Object.defineProperty(S,"currentTarget",{configurable:!0,enumerable:!0,get:T??l.get})}const h={bubble:{},capture:{}},f={};function m(){const S=function(T){const{type:B,eventPhase:$,bubbles:M}=T,E=ys(T);if($===2)return;const V=$===1?"capture":"bubble";let L=E;const D=[];for(;L===null&&(L=window),D.push(L),L!==window;)L=L.parentNode||null;const te=h.capture[B],ne=h.bubble[B];if(s(T,"stopPropagation",n),s(T,"stopImmediatePropagation",r),d(T,c),V==="capture"){if(te===void 0)return;for(let A=D.length-1;A>=0&&!t.has(T);--A){const I=D[A],j=te.get(I);if(j!==void 0){a.set(T,I);for(const q of j){if(e.has(T))break;q(T)}}if(A===0&&!M&&ne!==void 0){const q=ne.get(I);if(q!==void 0)for(const N of q){if(e.has(T))break;N(T)}}}}else if(V==="bubble"){if(ne===void 0)return;for(let A=0;A<D.length&&!t.has(T);++A){const I=D[A],j=ne.get(I);if(j!==void 0){a.set(T,I);for(const q of j){if(e.has(T))break;q(T)}}}}o(T,"stopPropagation"),o(T,"stopImmediatePropagation"),d(T)};return S.displayName="evtdUnifiedHandler",S}function g(){const S=function(T){const{type:B,eventPhase:$}=T;if($!==2)return;const M=f[B];M!==void 0&&M.forEach(E=>E(T))};return S.displayName="evtdUnifiedWindowEventHandler",S}const u=m(),p=g();function b(S,T){const B=h[S];return B[T]===void 0&&(B[T]=new Map,window.addEventListener(T,u,S==="capture")),B[T]}function y(S){return f[S]===void 0&&(f[S]=new Set,window.addEventListener(S,p)),f[S]}function _(S,T){let B=S.get(T);return B===void 0&&S.set(T,B=new Set),B}function R(S,T,B,$){const M=h[T][B];if(M!==void 0){const E=M.get(S);if(E!==void 0&&E.has($))return!0}return!1}function k(S,T){const B=f[S];return!!(B!==void 0&&B.has(T))}function w(S,T,B,$){let M;if(typeof $=="object"&&$.once===!0?M=te=>{C(S,T,M,$),B(te)}:M=B,K_(S,T,M,$))return;const V=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",L=b(V,S),D=_(L,T);if(D.has(M)||D.add(M),T===window){const te=y(S);te.has(M)||te.add(M)}}function C(S,T,B,$){if(Z_(S,T,B,$))return;const E=$===!0||typeof $=="object"&&$.capture===!0,V=E?"capture":"bubble",L=b(V,S),D=_(L,T);if(T===window&&!R(T,E?"bubble":"capture",S,B)&&k(S,B)){const ne=f[S];ne.delete(B),ne.size===0&&(window.removeEventListener(S,p),f[S]=void 0)}D.has(B)&&D.delete(B),D.size===0&&L.delete(T),L.size===0&&(window.removeEventListener(S,u,V==="capture"),h[V][S]=void 0)}return{on:w,off:C}}const{on:St,off:nt}=Q_(),Ui="@@mmoContext",J_={mounted(t,{value:e}){t[Ui]={handler:void 0},typeof e=="function"&&(t[Ui].handler=e,St("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ui];typeof e=="function"?n.handler?n.handler!==e&&(nt("mousemoveoutside",t,n.handler),n.handler=e,St("mousemoveoutside",t,e)):(t[Ui].handler=e,St("mousemoveoutside",t,e)):n.handler&&(nt("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ui];e&&nt("mousemoveoutside",t,e),t[Ui].handler=void 0}},Gi="@@coContext",bs={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,St("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,St("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,St("clickoutside",t,e,{capture:n.capture})):r.handler&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&nt("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function e1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class t1{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&e1("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Yo=new t1,Ki="@@ziContext",Kd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Ki]={enabled:!!s,initialized:!1},s&&(Yo.ensureZIndex(t,r),t[Ki].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Ki].enabled;s&&!o&&(Yo.ensureZIndex(t,r),t[Ki].initialized=!0),t[Ki].enabled=!!s},unmounted(t,e){if(!t[Ki].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Yo.unregister(t,r)}};function n1(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function qt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const i1=typeof window<"u";let Zi,_r;(()=>{var t,e;Zi=i1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,_r=!1,Zi!==void 0?Zi.then(()=>{_r=!0}):_r=!0})();function r1(t){if(_r)return;let e=!1;i.onMounted(()=>{_r||Zi==null||Zi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Uo(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function _s(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function Zd(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const s1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function o1(){return s1}function Go(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Ko(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Ko(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ko(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Un=null;function Jd(){if(Un===null&&(Un=document.getElementById("v-binder-view-measurer"),Un===null)){Un=document.createElement("div"),Un.id="v-binder-view-measurer";const{style:t}=Un;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Un)}return Un.getBoundingClientRect()}function a1(t,e){const n=Jd();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Zo(t){const e=t.getBoundingClientRect(),n=Jd();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function l1(t){return t.nodeType===9?null:t.parentNode}function eh(t){if(t===null)return null;const e=l1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return eh(e)}const th=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=eh(y),y!==null;)o.push(y);for(const _ of o)St("scroll",_,f,!0)},l=()=>{for(const y of o)nt("scroll",y,f,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},f=()=>{zd(m)},m=()=>{c.forEach(y=>y())},g=new Set,u=y=>{g.size===0&&St("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&nt("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{nt("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:u,removeResizeListener:p}},render(){return Go("binder",this.$slots)}}),nh=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(Qd("follower",this.$slots),[[e]]):Qd("follower",this.$slots)}}),c1="@css-render/vue3-ssr";function d1(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
|
-
</style>`}function
|
|
105
|
+
</style>`}function h1(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(d1(t,e)))}const u1=typeof document<"u";function mi(){if(u1)return;const t=i.inject(c1,null);if(t!==null)return{adapter:(e,n)=>h1(e,n,t),context:t}}function ih(t,e){console.error(`[vueuc/${t}]: ${e}`)}function f1(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const rh=/\s*,(?![^(]*\))\s*/g,g1=/\s+/g;function m1(t,e){const n=[];return e.split(rh).forEach(r=>{let s=f1(r);if(s){if(s===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function p1(t,e){const n=[];return e.split(rh).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function y1(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=m1(e,n):e=p1(e,n))}),e.join(", ").replace(g1," ")}function sh(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function ws(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function b1(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function xs(t){return t?/^\s*@(s|m)/.test(t):!1}const _1=/[A-Z]/g;function oh(t){return t.replace(_1,e=>"-"+e.toLowerCase())}function w1(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(n=>e+` ${oh(n[0])}: ${n[1]};`).join(`
|
|
107
107
|
`)+`
|
|
108
|
-
`+e+"}":`: ${t};`}function
|
|
108
|
+
`+e+"}":`: ${t};`}function x1(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function ah(t,e,n,r){if(!e)return"";const s=x1(e,n,r);if(!s)return"";if(typeof s=="string")return`${t} {
|
|
109
109
|
${s}
|
|
110
110
|
}`;const o=Object.keys(s);if(o.length===0)return n.config.keepEmptyBlock?t+` {
|
|
111
111
|
}`:"";const a=t?[t+" {"]:[];return o.forEach(l=>{const c=s[l];if(l==="raw"){a.push(`
|
|
112
112
|
`+c+`
|
|
113
|
-
`);return}l=oh(l),c!=null&&a.push(` ${l}${
|
|
114
|
-
`)}function Qo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Qo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Qo(s,e,n):s&&n(s)}else r&&n(r)})}function lh(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")xs(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});xs(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")xs(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});xs(d)?a=d:e.push(d)}const l=
|
|
113
|
+
`);return}l=oh(l),c!=null&&a.push(` ${l}${w1(c)}`)}),t&&a.push("}"),a.join(`
|
|
114
|
+
`)}function Qo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Qo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Qo(s,e,n):s&&n(s)}else r&&n(r)})}function lh(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")xs(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});xs(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")xs(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});xs(d)?a=d:e.push(d)}const l=y1(e),c=ah(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&Qo(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=ah(l,{raw:d},r,s);n.push(h)}else lh(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function v1(t,e,n){const r=[];return lh(t,[],r,e,n),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function Jo(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function v1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(sh),e.els=[];else{const o=ws(n,r);o&&s.includes(o)&&(sh(o),e.els=s.filter(a=>a!==o))}}function ch(t,e){t.push(e)}function k1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Jo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=ws(n,l);if(h!==null&&!o)return h;const f=h??y1(n);if(d===void 0&&(d=e.render(r)),f.textContent=d,h!==null)return h;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(f,m),ch(e.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),ch(e.els,f),f}function C1(t){return x1(this,this.instance,t)}function S1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return k1(this.instance,this,e,r,s,o,a,l,n)}function B1(t={}){const{id:e,parent:n}=t;v1(this.instance,this,e,n)}const vs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:C1,mount:S1,unmount:B1}},T1=function(t,e,n,r){return Array.isArray(e)?vs(t,{$:null},null,e):Array.isArray(n)?vs(t,e,null,n):Array.isArray(r)?vs(t,e,n,r):vs(t,e,n,null)};function dh(t={}){const e={c:((...n)=>T1(e,...n)),use:(n,...r)=>n.install(e,...r),find:ws,context:{},config:t};return e}function R1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return ws(t)!==null}const{c:Gn}=dh(),ea="vueuc-style";function hh(t){return t&-t}class uh{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=hh(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=hh(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function fh(t){return typeof t=="string"?document.querySelector(t):t()||null}const $1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:t1(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Go("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Go("lazy-teleport",this.$slots)):null}}),ks={top:"bottom",bottom:"top",left:"right",right:"left"},gh={start:"end",center:"center",end:"start"},ta={top:"height",bottom:"height",left:"width",right:"width"},P1={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},E1={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},N1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},mh={top:!0,bottom:!1,left:!0,right:!1},ph={top:"end",bottom:"start",left:"end",right:"start"};function F1(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const h=(g,u,p)=>{let b=0,y=0;const _=n[g]-e[u]-e[g];return _>0&&r&&(p?y=mh[u]?_:-_:b=mh[u]?_:-_),{left:b,top:y}},f=a==="left"||a==="right";if(c!=="center"){const g=N1[t],u=ks[g],p=ta[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[g]<b||e[u]<b?e[g]<e[u]?(c=gh[l],d=h(p,u,f)):d=h(p,g,f):c="center"}}else n[p]<e[p]&&e[u]<0&&e[g]>e[u]&&(c=gh[l])}else{const g=a==="bottom"||a==="top"?"left":"top",u=ks[g],p=ta[g],b=(n[p]-e[p])/2;(e[g]<b||e[u]<b)&&(e[g]>e[u]?(c=ph[g],d=h(p,g,f)):(c=ph[u],d=h(p,u,f)))}let m=a;return e[a]<n[ta[a]]&&e[a]<e[ks[a]]&&(m=ks[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function A1(t,e){return e?E1[t]:P1[t]}function M1(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const V1=Gn([Gn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Gn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Gn("> *",{pointerEvents:"all"})])]),yh=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=qt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=mi();V1.mount({id:"vueuc/binder",head:!0,anchorMetaName:ea,ssr:l}),i.onBeforeUnmount(()=>{a()}),i1(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:u,y:p,overlap:b}=t,y=u!==void 0&&p!==void 0?o1(u,p):Zo(g);m.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:R,placement:k,internalShift:w,flip:C}=t;m.setAttribute("v-placement",k),b?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:S}=m;_==="target"?S.width=`${y.width}px`:_!==void 0?S.width=_:S.width="",R==="target"?S.minWidth=`${y.width}px`:R!==void 0?S.minWidth=R:S.minWidth="";const T=Zo(m),B=Zo(s.value),{left:$,top:M,placement:E}=F1(k,y,T,w,C,b),V=A1(E,b),{left:L,top:D,transform:te}=M1(E,B,y,M,$,b);m.setAttribute("v-placement",E),m.style.setProperty("--v-offset-left",`${Math.round($)}px`),m.style.setProperty("--v-offset-top",`${Math.round(M)}px`),m.style.transform=`translateX(${L}) translateY(${D}) ${te}`,m.style.setProperty("--v-transform-origin",V),m.style.transformOrigin=V};i.watch(n,m=>{m?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const h=_s(),f=qt(()=>{const{to:m}=t;if(m!==void 0)return m;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h($1,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[Kd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var pi=[],I1=function(){return pi.some(function(t){return t.activeTargets.length>0})},O1=function(){return pi.some(function(t){return t.skippedTargets.length>0})},bh="ResizeObserver loop completed with undelivered notifications.",z1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:bh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=bh),window.dispatchEvent(t)},wr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wr||(wr={}));var yi=function(t){return Object.freeze(t)},L1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,yi(this)}return t})(),_h=(function(){function t(e,n,r,s){return this.x=e,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,yi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),na=function(t){return t instanceof SVGElement&&"getBBox"in t},wh=function(t){if(na(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},xh=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},D1=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},xr=typeof window<"u"?window:{},Cs=new WeakMap,vh=/auto|scroll/,H1=/^tb|vertical/,W1=/msie|trident/i.test(xr.navigator&&xr.navigator.userAgent),_n=function(t){return parseFloat(t||"0")},Qi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new L1((n?e:t)||0,(n?t:e)||0)},kh=yi({devicePixelContentBoxSize:Qi(),borderBoxSize:Qi(),contentBoxSize:Qi(),contentRect:new _h(0,0,0,0)}),Ch=function(t,e){if(e===void 0&&(e=!1),Cs.has(t)&&!e)return Cs.get(t);if(wh(t))return Cs.set(t,kh),kh;var n=getComputedStyle(t),r=na(t)&&t.ownerSVGElement&&t.getBBox(),s=!W1&&n.boxSizing==="border-box",o=H1.test(n.writingMode||""),a=!r&&vh.test(n.overflowY||""),l=!r&&vh.test(n.overflowX||""),c=r?0:_n(n.paddingTop),d=r?0:_n(n.paddingRight),h=r?0:_n(n.paddingBottom),f=r?0:_n(n.paddingLeft),m=r?0:_n(n.borderTopWidth),g=r?0:_n(n.borderRightWidth),u=r?0:_n(n.borderBottomWidth),p=r?0:_n(n.borderLeftWidth),b=f+d,y=c+h,_=p+g,R=m+u,k=l?t.offsetHeight-R-t.clientHeight:0,w=a?t.offsetWidth-_-t.clientWidth:0,C=s?b+_:0,S=s?y+R:0,T=r?r.width:_n(n.width)-C-w,B=r?r.height:_n(n.height)-S-k,$=T+b+w+_,M=B+y+k+R,E=yi({devicePixelContentBoxSize:Qi(Math.round(T*devicePixelRatio),Math.round(B*devicePixelRatio),o),borderBoxSize:Qi($,M,o),contentBoxSize:Qi(T,B,o),contentRect:new _h(f,c,T,B)});return Cs.set(t,E),E},Sh=function(t,e,n){var r=Ch(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case wr.DEVICE_PIXEL_CONTENT_BOX:return a;case wr.BORDER_BOX:return s;default:return o}},j1=(function(){function t(e){var n=Ch(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=yi([n.borderBoxSize]),this.contentBoxSize=yi([n.contentBoxSize]),this.devicePixelContentBoxSize=yi([n.devicePixelContentBoxSize])}return t})(),Bh=function(t){if(wh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},q1=function(){var t=1/0,e=[];pi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new j1(d.target),f=Bh(d.target);l.push(h),d.lastReportedSize=Sh(d.target,d.observedBox),f<t&&(t=f)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},Th=function(t){pi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Bh(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},X1=function(){var t=0;for(Th(t);I1();)t=q1(),Th(t);return O1()&&z1(),t>0},ia,Rh=[],Y1=function(){return Rh.splice(0).forEach(function(t){return t()})},U1=function(t){if(!ia){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Y1()}).observe(n,r),ia=function(){n.textContent="".concat(e?e--:e++)}}Rh.push(t),ia()},G1=function(t){U1(function(){requestAnimationFrame(t)})},Ss=0,K1=function(){return!!Ss},Z1=250,Q1={attributes:!0,characterData:!0,childList:!0,subtree:!0},$h=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ph=function(t){return t===void 0&&(t=0),Date.now()+t},ra=!1,J1=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Z1),!ra){ra=!0;var r=Ph(e);G1(function(){var s=!1;try{s=X1()}finally{if(ra=!1,e=r-Ph(),!K1())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Q1)};document.body?n():xr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),$h.forEach(function(n){return xr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),$h.forEach(function(n){return xr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),sa=new J1,Eh=function(t){!Ss&&t>0&&sa.start(),Ss+=t,!Ss&&sa.stop()},ew=function(t){return!na(t)&&!D1(t)&&getComputedStyle(t).display==="inline"},tw=(function(){function t(e,n){this.target=e,this.observedBox=n||wr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Sh(this.target,this.observedBox,!0);return ew(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),nw=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Bs=new WeakMap,Nh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ts=(function(){function t(){}return t.connect=function(e,n){var r=new nw(e,n);Bs.set(e,r)},t.observe=function(e,n,r){var s=Bs.get(e),o=s.observationTargets.length===0;Nh(s.observationTargets,n)<0&&(o&&pi.push(s),s.observationTargets.push(new tw(n,r&&r.box)),Eh(1),sa.schedule())},t.unobserve=function(e,n){var r=Bs.get(e),s=Nh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&pi.splice(pi.indexOf(r),1),r.observationTargets.splice(s,1),Eh(-1))},t.disconnect=function(e){var n=this,r=Bs.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),iw=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ts.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.unobserve(this,e)},t.prototype.disconnect=function(){Ts.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class rw{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||iw)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const vr=new rw,Rs=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){ih("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){ih("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(vr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&vr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let $s;function sw(){return typeof document>"u"?!1:($s===void 0&&("matchMedia"in window?$s=window.matchMedia("(pointer:coarse)").matches:$s=!1),$s)}let oa;function Fh(){return typeof document>"u"?1:(oa===void 0&&(oa="chrome"in window?window.devicePixelRatio:1),oa)}const Ah="VVirtualListXScroll";function ow({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const h=new uh(d.length,0);return d.forEach((f,m)=>{h.add(m,f.width)}),h}),a=qt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=qt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Ah,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Mh=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ah);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),aw=Gn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Gn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Gn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),lw=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=mi();aw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ea,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:L}=t;V!=null?b({index:V}):L!=null&&b({key:L})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=qt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(L=>{V+=L.width}),V}),o=i.computed(()=>{const V=new Map,{keyField:L}=t;return t.items.forEach((D,te)=>{V.set(D[L],te)}),V}),{scrollLeftRef:a,listWidthRef:l}=ow({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:V,itemSize:L,keyField:D}=t,te=new uh(V.length,L);return V.forEach((ne,A)=>{const I=ne[D],j=h.get(I);j!==void 0&&te.add(A,j)}),te}),m=i.ref(0),g=i.ref(0),u=qt(()=>Math.max(f.value.getBound(g.value-yr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:L,itemSize:D}=t,te=u.value,ne=Math.min(te+Math.ceil(V/D+1),L.length-1),A=[];for(let I=te;I<=ne;++I)A.push(L[I]);return A}),b=(V,L)=>{if(typeof V=="number"){k(V,L,"auto");return}const{left:D,top:te,index:ne,key:A,position:I,behavior:j,debounce:q=!0}=V;if(D!==void 0||te!==void 0)k(D,te,j);else if(ne!==void 0)R(ne,j,q);else if(A!==void 0){const N=o.value.get(A);N!==void 0&&R(N,j,q)}else I==="bottom"?k(0,Number.MAX_SAFE_INTEGER,j):I==="top"&&k(0,0,j)};let y,_=null;function R(V,L,D){const{value:te}=f,ne=te.sum(V)+yr(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:ne,behavior:L});else{y=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:A,offsetHeight:I}=c.value;if(ne>A){const j=te.get(V);ne+j<=A+I||c.value.scrollTo({left:0,top:ne+j-I,behavior:L})}else c.value.scrollTo({left:0,top:ne,behavior:L})}}function k(V,L,D){c.value.scrollTo({left:V,top:L,behavior:D})}function w(V,L){var D,te,ne;if(n||t.ignoreItemResize||E(L.target))return;const{value:A}=f,I=o.value.get(V),j=A.get(I),q=(ne=(te=(D=L.borderBoxSize)===null||D===void 0?void 0:D[0])===null||te===void 0?void 0:te.blockSize)!==null&&ne!==void 0?ne:L.contentRect.height;if(q===j)return;q-t.itemSize===0?h.delete(V):h.set(V,q-t.itemSize);const O=q-j;if(O===0)return;A.add(I,O);const Y=c.value;if(Y!=null){if(y===void 0){const re=A.sum(I);Y.scrollTop>re&&Y.scrollBy(0,O)}else if(I<y)Y.scrollBy(0,O);else if(I===y){const re=A.sum(I);q+re>Y.scrollTop+Y.offsetHeight&&Y.scrollBy(0,O)}M()}m.value++}const C=!sw();let S=!1;function T(V){var L;(L=t.onScroll)===null||L===void 0||L.call(t,V),(!C||!S)&&M()}function B(V){var L;if((L=t.onWheel)===null||L===void 0||L.call(t,V),C){const D=c.value;if(D!=null){if(V.deltaX===0&&(D.scrollTop===0&&V.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),D.scrollTop+=V.deltaY/Fh(),D.scrollLeft+=V.deltaX/Fh(),M(),S=!0,zd(()=>{S=!1})}}}function $(V){if(n||E(V.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(V.contentRect.height===d.value)return}else if(V.contentRect.height===d.value&&V.contentRect.width===l.value)return;d.value=V.contentRect.height,l.value=V.contentRect.width;const{onResize:L}=t;L!==void 0&&L(V)}function M(){const{value:V}=c;V!=null&&(g.value=V.scrollTop,a.value=V.scrollLeft)}function E(V){let L=V;for(;L!==null;){if(L.style.display==="none")return!0;L=L.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,L=br(f.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:br(s.value),height:V?"":L,minHeight:V?L:"",paddingTop:br(t.paddingTop),paddingBottom:br(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${br(f.value.sum(u.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:$,handleListScroll:T,handleListWheel:B,handleItemResize:w}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Rs,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],h=n.get(d),f=a!=null?i.h(Mh,{index:h,item:c}):void 0,m=l!=null?i.h(Mh,{index:h,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:m,index:h})[0];return t?i.h(Rs,{key:d,onResize:u=>this.handleItemResize(d,u)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Rn="v-hidden",cw=Gn("[v-hidden]",{display:"none!important"}),Vh=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(Rn)&&h.removeAttribute(Rn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const R of f)R.hasAttribute(Rn)&&R.removeAttribute(Rn);const m=l.offsetWidth,g=[],u=e.tail?d==null?void 0:d():null;let p=u?u.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let R=0;R<y-1;++R){if(R<0)continue;const k=f[R];if(b){k.hasAttribute(Rn)||k.setAttribute(Rn,"");continue}else k.hasAttribute(Rn)&&k.removeAttribute(Rn);const w=k.offsetWidth;if(p+=w,g[R]=w,p>m){const{updateCounter:C}=t;for(let S=R;S>=0;--S){const T=y-1-S;C!==void 0?C(T):h.textContent=`${T}`;const B=h.offsetWidth;if(p-=g[S],p+B<=m||S===0){b=!0,R=S-1,u&&(R===-1?(u.style.maxWidth=`${m-B}px`,u.style.boxSizing="border-box"):u.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(T);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(Rn,""))}const o=mi();return cw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ea,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Ih(t){return t instanceof HTMLElement}function Oh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||Oh(n)))return!0}return!1}function zh(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||zh(n)))return!0}return!1}function Lh(t){if(!dw(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function dw(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let kr=[];const hw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=__(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return kr[kr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(f(),St("keydown",document,c)):(nt("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{nt("keydown",document,c),s&&m()});function d(b){if(!o&&l()){const y=h();if(y===null||y.contains(pr(b)))return;g("first")}}function h(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!t.disabled){if(kr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?g("first"):(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),kr=kr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function g(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const R=h();if(R==null||R===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const k=b==="first"?Oh(R):zh(R);o=!1,k||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function u(b){if(o)return;const y=h();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?g("last"):g("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:u,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function aC(t){return t}const aa="n-internal-select-menu",Dh="n-internal-select-menu-body",Hh="n-drawer-body",Wh="n-modal-body",jh="n-popover-body",qh="__disabled__";function $n(t){const e=i.inject(Wh,null),n=i.inject(Hh,null),r=i.inject(jh,null),s=i.inject(Dh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{St("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{nt("fullscreenchange",document,a)})}return qt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?qh:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}$n.tdkey=qh,$n.propTo={type:[String,Object,Boolean],default:void 0};function uw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Xh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&vr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&vr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&vr.unregisterHandler(n)}))}function Yh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const fw=/^(\d|\.)+$/,Uh=/(\d|\.)+/;function la(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(fw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Uh.exec(t);return s?t.replace(Uh,String((Number(s[0])+n)*e)):t}return t}function Gh(t){const{left:e,right:n,top:r,bottom:s}=Zt(t);return`${r} ${e} ${s} ${n}`}var Kh={};function gw(t){let e=".",n="__",r="--",s;if(t){let u=t.blockPrefix;u&&(e=u),u=t.elementPrefix,u&&(n=u),u=t.modifierPrefix,u&&(r=u)}const o={install(u){s=u.c;const p=u.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(u){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return u=typeof u=="string"?u:u({context:y,props:_}),y.bem.b=u,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(u){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return u=typeof u=="string"?u:u({context:b,props:y}),b.bem.els=u.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=u.split(",").map(k=>k.trim());function _(k){return y.map(w=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${w}`).join(", ")}const R=p.bem.els;if(R!==null){if(Kh.NODE_ENV!=="production"&&R.length>=2)throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`);return _(R[0])}else return _()}}}function d(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=p.bem.els;if(Kh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${u})`}}}return Object.assign(o,{cB:((...u)=>s(a(u[0]),u[1],u[2])),cE:((...u)=>s(l(u[0]),u[1],u[2])),cM:((...u)=>s(c(u[0]),u[1],u[2])),cNotM:((...u)=>s(d(u[0]),u[1],u[2]))}),o}const mw=".n-",pw="__",yw="--",Zh=dh(),Qh=gw({blockPrefix:mw,elementPrefix:pw,modifierPrefix:yw});Zh.use(Qh);const{c:le,find:cC}=Zh,{cB:me,cE:be,cM:Re,cNotM:Qt}=Qh,bw=(...t)=>le(">",[me(...t)]);function Ge(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ca;function _w(){return ca===void 0&&(ca=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ca}const ww=new WeakSet;function xw(t){ww.add(t)}function Jh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const eu=new Set;function Kn(t,e){const n=`[naive/${t}]: ${e}`;eu.has(n)||(eu.add(n),console.error(n))}function tu(t,e){console.error(`[naive/${t}]: ${e}`)}function nu(t,e){throw new Error(`[naive/${t}]: ${e}`)}function mt(t,...e){if(Array.isArray(t))t.forEach(n=>mt(n,...e));else return t(...e)}function da(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){da(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&da(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function vw(t,e="default",n=void 0){const r=t[e];if(!r)return tu("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=da(r(n));return s.length===1?s[0]:(tu("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function kw(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function ha(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function Ji(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ua(t,e){return t&&Ps(t())||e()}function bi(t,e){const n=t&&Ps(t());return e(n||null)}function iu(t){return!(t&&Ps(t()))}const fa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),_i="n-config-provider",Cw="n";function wi(t={},e={defaultBordered:!0}){const n=i.inject(_i,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Cw),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function xi(t,e,n,r){n||nu("useThemeClass","cssVarsRef is not passed");const s=i.inject(_i,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=mi();let d;const h=`__${t}`,f=()=>{let m=h;const g=e?e.value:void 0,u=o==null?void 0:o.value;u&&(m+=`-${u}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(m+=`-${Jo(JSON.stringify(p))}`),b&&(m+=`-${Jo(JSON.stringify(b))}`),l.value=m,d=()=>{const y=n.value;let _="";for(const R in y)_+=`${R}: ${y[R]};`;le(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const ru="n-form-item";function Sw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(ru,null);i.provide(ru,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const Bw={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ga(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Cr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function Sr(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Rw(l,f=>f.test(a)):Tw(l,f=>f.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function Tw(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Rw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function $w(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Pw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ew=(t,e,n)=>{let r;const s=Pw[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Nw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Fw=(t,e,n,r)=>Nw[t],Aw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Mw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Iw={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ow={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},zw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Lw={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Cr({values:Aw,defaultWidth:"wide"}),quarter:Cr({values:Mw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Cr({values:Vw,defaultWidth:"wide"}),day:Cr({values:Iw,defaultWidth:"wide"}),dayPeriod:Cr({values:Ow,defaultWidth:"wide",formattingValues:zw,defaultFormattingWidth:"wide"})},Dw=/^(\d+)(th|st|nd|rd)?/i,Hw=/\d+/i,Ww={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jw={any:[/^b/i,/^(a|c)/i]},qw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xw={any:[/1/i,/2/i,/3/i,/4/i]},Yw={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Uw={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Zw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Qw={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Jw={ordinalNumber:$w({matchPattern:Dw,parsePattern:Hw,valueCallback:t=>parseInt(t,10)}),era:Sr({matchPatterns:Ww,defaultMatchWidth:"wide",parsePatterns:jw,defaultParseWidth:"any"}),quarter:Sr({matchPatterns:qw,defaultMatchWidth:"wide",parsePatterns:Xw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Sr({matchPatterns:Yw,defaultMatchWidth:"wide",parsePatterns:Uw,defaultParseWidth:"any"}),day:Sr({matchPatterns:Gw,defaultMatchWidth:"wide",parsePatterns:Kw,defaultParseWidth:"any"}),dayPeriod:Sr({matchPatterns:Zw,defaultMatchWidth:"any",parsePatterns:Qw,defaultParseWidth:"any"})},ex={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ix={date:ga({formats:ex,defaultWidth:"full"}),time:ga({formats:tx,defaultWidth:"full"}),dateTime:ga({formats:nx,defaultWidth:"full"})},rx={name:"en-US",locale:{code:"en-US",formatDistance:Ew,formatLong:ix,formatRelative:Fw,localize:Lw,match:Jw,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function su(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(_i,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:Bw[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:rx}),localeRef:r}}const Br="naive-ui-style";function Tr(t,e,n){if(!e)return;const r=mi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(_i,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(R1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:Br,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const Rr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:sx,fontFamily:ox,lineHeight:ax}=Rr,ou=le("body",`
|
|
116
|
+
`)}function Jo(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function k1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(sh),e.els=[];else{const o=ws(n,r);o&&s.includes(o)&&(sh(o),e.els=s.filter(a=>a!==o))}}function ch(t,e){t.push(e)}function C1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Jo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=ws(n,l);if(h!==null&&!o)return h;const f=h??b1(n);if(d===void 0&&(d=e.render(r)),f.textContent=d,h!==null)return h;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(f,m),ch(e.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),ch(e.els,f),f}function S1(t){return v1(this,this.instance,t)}function B1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return C1(this.instance,this,e,r,s,o,a,l,n)}function T1(t={}){const{id:e,parent:n}=t;k1(this.instance,this,e,n)}const vs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:S1,mount:B1,unmount:T1}},R1=function(t,e,n,r){return Array.isArray(e)?vs(t,{$:null},null,e):Array.isArray(n)?vs(t,e,null,n):Array.isArray(r)?vs(t,e,n,r):vs(t,e,n,null)};function dh(t={}){const e={c:((...n)=>R1(e,...n)),use:(n,...r)=>n.install(e,...r),find:ws,context:{},config:t};return e}function $1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return ws(t)!==null}const{c:Gn}=dh(),ea="vueuc-style";function hh(t){return t&-t}class uh{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=hh(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=hh(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function fh(t){return typeof t=="string"?document.querySelector(t):t()||null}const P1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:n1(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Go("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Go("lazy-teleport",this.$slots)):null}}),ks={top:"bottom",bottom:"top",left:"right",right:"left"},gh={start:"end",center:"center",end:"start"},ta={top:"height",bottom:"height",left:"width",right:"width"},E1={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},N1={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},F1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},mh={top:!0,bottom:!1,left:!0,right:!1},ph={top:"end",bottom:"start",left:"end",right:"start"};function A1(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const h=(g,u,p)=>{let b=0,y=0;const _=n[g]-e[u]-e[g];return _>0&&r&&(p?y=mh[u]?_:-_:b=mh[u]?_:-_),{left:b,top:y}},f=a==="left"||a==="right";if(c!=="center"){const g=F1[t],u=ks[g],p=ta[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[g]<b||e[u]<b?e[g]<e[u]?(c=gh[l],d=h(p,u,f)):d=h(p,g,f):c="center"}}else n[p]<e[p]&&e[u]<0&&e[g]>e[u]&&(c=gh[l])}else{const g=a==="bottom"||a==="top"?"left":"top",u=ks[g],p=ta[g],b=(n[p]-e[p])/2;(e[g]<b||e[u]<b)&&(e[g]>e[u]?(c=ph[g],d=h(p,g,f)):(c=ph[u],d=h(p,u,f)))}let m=a;return e[a]<n[ta[a]]&&e[a]<e[ks[a]]&&(m=ks[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function M1(t,e){return e?N1[t]:E1[t]}function V1(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const I1=Gn([Gn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Gn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Gn("> *",{pointerEvents:"all"})])]),yh=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=qt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=mi();I1.mount({id:"vueuc/binder",head:!0,anchorMetaName:ea,ssr:l}),i.onBeforeUnmount(()=>{a()}),r1(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:u,y:p,overlap:b}=t,y=u!==void 0&&p!==void 0?a1(u,p):Zo(g);m.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:R,placement:k,internalShift:w,flip:C}=t;m.setAttribute("v-placement",k),b?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:S}=m;_==="target"?S.width=`${y.width}px`:_!==void 0?S.width=_:S.width="",R==="target"?S.minWidth=`${y.width}px`:R!==void 0?S.minWidth=R:S.minWidth="";const T=Zo(m),B=Zo(s.value),{left:$,top:M,placement:E}=A1(k,y,T,w,C,b),V=M1(E,b),{left:L,top:D,transform:te}=V1(E,B,y,M,$,b);m.setAttribute("v-placement",E),m.style.setProperty("--v-offset-left",`${Math.round($)}px`),m.style.setProperty("--v-offset-top",`${Math.round(M)}px`),m.style.transform=`translateX(${L}) translateY(${D}) ${te}`,m.style.setProperty("--v-transform-origin",V),m.style.transformOrigin=V};i.watch(n,m=>{m?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const h=_s(),f=qt(()=>{const{to:m}=t;if(m!==void 0)return m;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h(P1,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[Kd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var pi=[],O1=function(){return pi.some(function(t){return t.activeTargets.length>0})},z1=function(){return pi.some(function(t){return t.skippedTargets.length>0})},bh="ResizeObserver loop completed with undelivered notifications.",L1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:bh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=bh),window.dispatchEvent(t)},wr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wr||(wr={}));var yi=function(t){return Object.freeze(t)},D1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,yi(this)}return t})(),_h=(function(){function t(e,n,r,s){return this.x=e,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,yi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),na=function(t){return t instanceof SVGElement&&"getBBox"in t},wh=function(t){if(na(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},xh=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},H1=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},xr=typeof window<"u"?window:{},Cs=new WeakMap,vh=/auto|scroll/,W1=/^tb|vertical/,j1=/msie|trident/i.test(xr.navigator&&xr.navigator.userAgent),_n=function(t){return parseFloat(t||"0")},Qi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new D1((n?e:t)||0,(n?t:e)||0)},kh=yi({devicePixelContentBoxSize:Qi(),borderBoxSize:Qi(),contentBoxSize:Qi(),contentRect:new _h(0,0,0,0)}),Ch=function(t,e){if(e===void 0&&(e=!1),Cs.has(t)&&!e)return Cs.get(t);if(wh(t))return Cs.set(t,kh),kh;var n=getComputedStyle(t),r=na(t)&&t.ownerSVGElement&&t.getBBox(),s=!j1&&n.boxSizing==="border-box",o=W1.test(n.writingMode||""),a=!r&&vh.test(n.overflowY||""),l=!r&&vh.test(n.overflowX||""),c=r?0:_n(n.paddingTop),d=r?0:_n(n.paddingRight),h=r?0:_n(n.paddingBottom),f=r?0:_n(n.paddingLeft),m=r?0:_n(n.borderTopWidth),g=r?0:_n(n.borderRightWidth),u=r?0:_n(n.borderBottomWidth),p=r?0:_n(n.borderLeftWidth),b=f+d,y=c+h,_=p+g,R=m+u,k=l?t.offsetHeight-R-t.clientHeight:0,w=a?t.offsetWidth-_-t.clientWidth:0,C=s?b+_:0,S=s?y+R:0,T=r?r.width:_n(n.width)-C-w,B=r?r.height:_n(n.height)-S-k,$=T+b+w+_,M=B+y+k+R,E=yi({devicePixelContentBoxSize:Qi(Math.round(T*devicePixelRatio),Math.round(B*devicePixelRatio),o),borderBoxSize:Qi($,M,o),contentBoxSize:Qi(T,B,o),contentRect:new _h(f,c,T,B)});return Cs.set(t,E),E},Sh=function(t,e,n){var r=Ch(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case wr.DEVICE_PIXEL_CONTENT_BOX:return a;case wr.BORDER_BOX:return s;default:return o}},q1=(function(){function t(e){var n=Ch(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=yi([n.borderBoxSize]),this.contentBoxSize=yi([n.contentBoxSize]),this.devicePixelContentBoxSize=yi([n.devicePixelContentBoxSize])}return t})(),Bh=function(t){if(wh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},X1=function(){var t=1/0,e=[];pi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new q1(d.target),f=Bh(d.target);l.push(h),d.lastReportedSize=Sh(d.target,d.observedBox),f<t&&(t=f)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},Th=function(t){pi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Bh(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},Y1=function(){var t=0;for(Th(t);O1();)t=X1(),Th(t);return z1()&&L1(),t>0},ia,Rh=[],U1=function(){return Rh.splice(0).forEach(function(t){return t()})},G1=function(t){if(!ia){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return U1()}).observe(n,r),ia=function(){n.textContent="".concat(e?e--:e++)}}Rh.push(t),ia()},K1=function(t){G1(function(){requestAnimationFrame(t)})},Ss=0,Z1=function(){return!!Ss},Q1=250,J1={attributes:!0,characterData:!0,childList:!0,subtree:!0},$h=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ph=function(t){return t===void 0&&(t=0),Date.now()+t},ra=!1,ew=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Q1),!ra){ra=!0;var r=Ph(e);K1(function(){var s=!1;try{s=Y1()}finally{if(ra=!1,e=r-Ph(),!Z1())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,J1)};document.body?n():xr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),$h.forEach(function(n){return xr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),$h.forEach(function(n){return xr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),sa=new ew,Eh=function(t){!Ss&&t>0&&sa.start(),Ss+=t,!Ss&&sa.stop()},tw=function(t){return!na(t)&&!H1(t)&&getComputedStyle(t).display==="inline"},nw=(function(){function t(e,n){this.target=e,this.observedBox=n||wr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Sh(this.target,this.observedBox,!0);return tw(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),iw=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Bs=new WeakMap,Nh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ts=(function(){function t(){}return t.connect=function(e,n){var r=new iw(e,n);Bs.set(e,r)},t.observe=function(e,n,r){var s=Bs.get(e),o=s.observationTargets.length===0;Nh(s.observationTargets,n)<0&&(o&&pi.push(s),s.observationTargets.push(new nw(n,r&&r.box)),Eh(1),sa.schedule())},t.unobserve=function(e,n){var r=Bs.get(e),s=Nh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&pi.splice(pi.indexOf(r),1),r.observationTargets.splice(s,1),Eh(-1))},t.disconnect=function(e){var n=this,r=Bs.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),rw=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ts.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!xh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.unobserve(this,e)},t.prototype.disconnect=function(){Ts.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class sw{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||rw)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const vr=new sw,Rs=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){ih("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){ih("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(vr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&vr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let $s;function ow(){return typeof document>"u"?!1:($s===void 0&&("matchMedia"in window?$s=window.matchMedia("(pointer:coarse)").matches:$s=!1),$s)}let oa;function Fh(){return typeof document>"u"?1:(oa===void 0&&(oa="chrome"in window?window.devicePixelRatio:1),oa)}const Ah="VVirtualListXScroll";function aw({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const h=new uh(d.length,0);return d.forEach((f,m)=>{h.add(m,f.width)}),h}),a=qt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=qt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Ah,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Mh=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ah);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),lw=Gn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Gn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Gn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),cw=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=mi();lw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ea,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:L}=t;V!=null?b({index:V}):L!=null&&b({key:L})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=qt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(L=>{V+=L.width}),V}),o=i.computed(()=>{const V=new Map,{keyField:L}=t;return t.items.forEach((D,te)=>{V.set(D[L],te)}),V}),{scrollLeftRef:a,listWidthRef:l}=aw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:V,itemSize:L,keyField:D}=t,te=new uh(V.length,L);return V.forEach((ne,A)=>{const I=ne[D],j=h.get(I);j!==void 0&&te.add(A,j)}),te}),m=i.ref(0),g=i.ref(0),u=qt(()=>Math.max(f.value.getBound(g.value-yr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:L,itemSize:D}=t,te=u.value,ne=Math.min(te+Math.ceil(V/D+1),L.length-1),A=[];for(let I=te;I<=ne;++I)A.push(L[I]);return A}),b=(V,L)=>{if(typeof V=="number"){k(V,L,"auto");return}const{left:D,top:te,index:ne,key:A,position:I,behavior:j,debounce:q=!0}=V;if(D!==void 0||te!==void 0)k(D,te,j);else if(ne!==void 0)R(ne,j,q);else if(A!==void 0){const N=o.value.get(A);N!==void 0&&R(N,j,q)}else I==="bottom"?k(0,Number.MAX_SAFE_INTEGER,j):I==="top"&&k(0,0,j)};let y,_=null;function R(V,L,D){const{value:te}=f,ne=te.sum(V)+yr(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:ne,behavior:L});else{y=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:A,offsetHeight:I}=c.value;if(ne>A){const j=te.get(V);ne+j<=A+I||c.value.scrollTo({left:0,top:ne+j-I,behavior:L})}else c.value.scrollTo({left:0,top:ne,behavior:L})}}function k(V,L,D){c.value.scrollTo({left:V,top:L,behavior:D})}function w(V,L){var D,te,ne;if(n||t.ignoreItemResize||E(L.target))return;const{value:A}=f,I=o.value.get(V),j=A.get(I),q=(ne=(te=(D=L.borderBoxSize)===null||D===void 0?void 0:D[0])===null||te===void 0?void 0:te.blockSize)!==null&&ne!==void 0?ne:L.contentRect.height;if(q===j)return;q-t.itemSize===0?h.delete(V):h.set(V,q-t.itemSize);const O=q-j;if(O===0)return;A.add(I,O);const Y=c.value;if(Y!=null){if(y===void 0){const re=A.sum(I);Y.scrollTop>re&&Y.scrollBy(0,O)}else if(I<y)Y.scrollBy(0,O);else if(I===y){const re=A.sum(I);q+re>Y.scrollTop+Y.offsetHeight&&Y.scrollBy(0,O)}M()}m.value++}const C=!ow();let S=!1;function T(V){var L;(L=t.onScroll)===null||L===void 0||L.call(t,V),(!C||!S)&&M()}function B(V){var L;if((L=t.onWheel)===null||L===void 0||L.call(t,V),C){const D=c.value;if(D!=null){if(V.deltaX===0&&(D.scrollTop===0&&V.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),D.scrollTop+=V.deltaY/Fh(),D.scrollLeft+=V.deltaX/Fh(),M(),S=!0,zd(()=>{S=!1})}}}function $(V){if(n||E(V.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(V.contentRect.height===d.value)return}else if(V.contentRect.height===d.value&&V.contentRect.width===l.value)return;d.value=V.contentRect.height,l.value=V.contentRect.width;const{onResize:L}=t;L!==void 0&&L(V)}function M(){const{value:V}=c;V!=null&&(g.value=V.scrollTop,a.value=V.scrollLeft)}function E(V){let L=V;for(;L!==null;){if(L.style.display==="none")return!0;L=L.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,L=br(f.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:br(s.value),height:V?"":L,minHeight:V?L:"",paddingTop:br(t.paddingTop),paddingBottom:br(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${br(f.value.sum(u.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:$,handleListScroll:T,handleListWheel:B,handleItemResize:w}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Rs,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],h=n.get(d),f=a!=null?i.h(Mh,{index:h,item:c}):void 0,m=l!=null?i.h(Mh,{index:h,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:m,index:h})[0];return t?i.h(Rs,{key:d,onResize:u=>this.handleItemResize(d,u)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Rn="v-hidden",dw=Gn("[v-hidden]",{display:"none!important"}),Vh=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(Rn)&&h.removeAttribute(Rn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const R of f)R.hasAttribute(Rn)&&R.removeAttribute(Rn);const m=l.offsetWidth,g=[],u=e.tail?d==null?void 0:d():null;let p=u?u.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let R=0;R<y-1;++R){if(R<0)continue;const k=f[R];if(b){k.hasAttribute(Rn)||k.setAttribute(Rn,"");continue}else k.hasAttribute(Rn)&&k.removeAttribute(Rn);const w=k.offsetWidth;if(p+=w,g[R]=w,p>m){const{updateCounter:C}=t;for(let S=R;S>=0;--S){const T=y-1-S;C!==void 0?C(T):h.textContent=`${T}`;const B=h.offsetWidth;if(p-=g[S],p+B<=m||S===0){b=!0,R=S-1,u&&(R===-1?(u.style.maxWidth=`${m-B}px`,u.style.boxSizing="border-box"):u.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(T);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(Rn,""))}const o=mi();return dw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ea,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Ih(t){return t instanceof HTMLElement}function Oh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||Oh(n)))return!0}return!1}function zh(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Ih(n)&&(Lh(n)||zh(n)))return!0}return!1}function Lh(t){if(!hw(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function hw(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let kr=[];const uw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=w_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return kr[kr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(f(),St("keydown",document,c)):(nt("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{nt("keydown",document,c),s&&m()});function d(b){if(!o&&l()){const y=h();if(y===null||y.contains(pr(b)))return;g("first")}}function h(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!t.disabled){if(kr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?g("first"):(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),kr=kr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=fh(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function g(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const R=h();if(R==null||R===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const k=b==="first"?Oh(R):zh(R);o=!1,k||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function u(b){if(o)return;const y=h();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?g("last"):g("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:u,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function lC(t){return t}const aa="n-internal-select-menu",Dh="n-internal-select-menu-body",Hh="n-drawer-body",Wh="n-modal-body",jh="n-popover-body",qh="__disabled__";function $n(t){const e=i.inject(Wh,null),n=i.inject(Hh,null),r=i.inject(jh,null),s=i.inject(Dh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{St("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{nt("fullscreenchange",document,a)})}return qt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?qh:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}$n.tdkey=qh,$n.propTo={type:[String,Object,Boolean],default:void 0};function fw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Xh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&vr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&vr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&vr.unregisterHandler(n)}))}function Yh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const gw=/^(\d|\.)+$/,Uh=/(\d|\.)+/;function la(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(gw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Uh.exec(t);return s?t.replace(Uh,String((Number(s[0])+n)*e)):t}return t}function Gh(t){const{left:e,right:n,top:r,bottom:s}=Zt(t);return`${r} ${e} ${s} ${n}`}var Kh={};function mw(t){let e=".",n="__",r="--",s;if(t){let u=t.blockPrefix;u&&(e=u),u=t.elementPrefix,u&&(n=u),u=t.modifierPrefix,u&&(r=u)}const o={install(u){s=u.c;const p=u.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(u){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return u=typeof u=="string"?u:u({context:y,props:_}),y.bem.b=u,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(u){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return u=typeof u=="string"?u:u({context:b,props:y}),b.bem.els=u.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=u.split(",").map(k=>k.trim());function _(k){return y.map(w=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${w}`).join(", ")}const R=p.bem.els;if(R!==null){if(Kh.NODE_ENV!=="production"&&R.length>=2)throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`);return _(R[0])}else return _()}}}function d(u){return{$({context:p,props:b}){u=typeof u=="string"?u:u({context:p,props:b});const y=p.bem.els;if(Kh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${u})`}}}return Object.assign(o,{cB:((...u)=>s(a(u[0]),u[1],u[2])),cE:((...u)=>s(l(u[0]),u[1],u[2])),cM:((...u)=>s(c(u[0]),u[1],u[2])),cNotM:((...u)=>s(d(u[0]),u[1],u[2]))}),o}const pw=".n-",yw="__",bw="--",Zh=dh(),Qh=mw({blockPrefix:pw,elementPrefix:yw,modifierPrefix:bw});Zh.use(Qh);const{c:le,find:dC}=Zh,{cB:me,cE:be,cM:Re,cNotM:Qt}=Qh,_w=(...t)=>le(">",[me(...t)]);function Ge(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ca;function ww(){return ca===void 0&&(ca=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ca}const xw=new WeakSet;function vw(t){xw.add(t)}function Jh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const eu=new Set;function Kn(t,e){const n=`[naive/${t}]: ${e}`;eu.has(n)||(eu.add(n),console.error(n))}function tu(t,e){console.error(`[naive/${t}]: ${e}`)}function nu(t,e){throw new Error(`[naive/${t}]: ${e}`)}function mt(t,...e){if(Array.isArray(t))t.forEach(n=>mt(n,...e));else return t(...e)}function da(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){da(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&da(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function kw(t,e="default",n=void 0){const r=t[e];if(!r)return tu("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=da(r(n));return s.length===1?s[0]:(tu("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Cw(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function ha(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function Ji(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ua(t,e){return t&&Ps(t())||e()}function bi(t,e){const n=t&&Ps(t());return e(n||null)}function iu(t){return!(t&&Ps(t()))}const fa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),_i="n-config-provider",Sw="n";function wi(t={},e={defaultBordered:!0}){const n=i.inject(_i,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Sw),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function xi(t,e,n,r){n||nu("useThemeClass","cssVarsRef is not passed");const s=i.inject(_i,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=mi();let d;const h=`__${t}`,f=()=>{let m=h;const g=e?e.value:void 0,u=o==null?void 0:o.value;u&&(m+=`-${u}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(m+=`-${Jo(JSON.stringify(p))}`),b&&(m+=`-${Jo(JSON.stringify(b))}`),l.value=m,d=()=>{const y=n.value;let _="";for(const R in y)_+=`${R}: ${y[R]};`;le(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const ru="n-form-item";function Bw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(ru,null);i.provide(ru,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const Tw={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ga(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Cr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function Sr(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?$w(l,f=>f.test(a)):Rw(l,f=>f.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function Rw(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function $w(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Pw(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Ew={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Nw=(t,e,n)=>{let r;const s=Ew[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Fw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Aw=(t,e,n,r)=>Fw[t],Mw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Iw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ow={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},zw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Lw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Dw={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Cr({values:Mw,defaultWidth:"wide"}),quarter:Cr({values:Vw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Cr({values:Iw,defaultWidth:"wide"}),day:Cr({values:Ow,defaultWidth:"wide"}),dayPeriod:Cr({values:zw,defaultWidth:"wide",formattingValues:Lw,defaultFormattingWidth:"wide"})},Hw=/^(\d+)(th|st|nd|rd)?/i,Ww=/\d+/i,jw={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},qw={any:[/^b/i,/^(a|c)/i]},Xw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yw={any:[/1/i,/2/i,/3/i,/4/i]},Uw={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gw={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Kw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jw={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ex={ordinalNumber:Pw({matchPattern:Hw,parsePattern:Ww,valueCallback:t=>parseInt(t,10)}),era:Sr({matchPatterns:jw,defaultMatchWidth:"wide",parsePatterns:qw,defaultParseWidth:"any"}),quarter:Sr({matchPatterns:Xw,defaultMatchWidth:"wide",parsePatterns:Yw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Sr({matchPatterns:Uw,defaultMatchWidth:"wide",parsePatterns:Gw,defaultParseWidth:"any"}),day:Sr({matchPatterns:Kw,defaultMatchWidth:"wide",parsePatterns:Zw,defaultParseWidth:"any"}),dayPeriod:Sr({matchPatterns:Qw,defaultMatchWidth:"any",parsePatterns:Jw,defaultParseWidth:"any"})},tx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},nx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ix={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},rx={date:ga({formats:tx,defaultWidth:"full"}),time:ga({formats:nx,defaultWidth:"full"}),dateTime:ga({formats:ix,defaultWidth:"full"})},sx={name:"en-US",locale:{code:"en-US",formatDistance:Nw,formatLong:rx,formatRelative:Aw,localize:Dw,match:ex,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function su(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(_i,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:Tw[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:sx}),localeRef:r}}const Br="naive-ui-style";function Tr(t,e,n){if(!e)return;const r=mi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(_i,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if($1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:Br,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const Rr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:ox,fontFamily:ax,lineHeight:lx}=Rr,ou=le("body",`
|
|
117
117
|
margin: 0;
|
|
118
|
-
font-size: ${
|
|
119
|
-
font-family: ${
|
|
120
|
-
line-height: ${
|
|
118
|
+
font-size: ${ox};
|
|
119
|
+
font-family: ${ax};
|
|
120
|
+
line-height: ${lx};
|
|
121
121
|
-webkit-text-size-adjust: 100%;
|
|
122
122
|
-webkit-tap-highlight-color: transparent;
|
|
123
123
|
`,[le("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var
|
|
126
|
+
`)]);var cx={};function Es(t,e,n){if(!e){cx.NODE_ENV!=="production"&&nu("use-style","No style is specified.");return}const r=mi(),s=i.inject(_i,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Br,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ou.mount({id:"n-global",head:!0,anchorMetaName:Br,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function fC(t){return t}function pt(t,e,n,r,s,o){const a=mi(),l=i.inject(_i,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:Br,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ou.mount({id:"n-global",head:!0,anchorMetaName:Br,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:f,peers:m={}}={},themeOverrides:g={},builtinThemeOverrides:u={}}=s,{common:p,peers:b}=g,{common:y=void 0,[t]:{common:_=void 0,self:R=void 0,peers:k={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:w=void 0,[t]:C={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:S,peers:T={}}=C,B=F.merge({},h||_||y||r.common,w,S,p),$=F.merge((d=f||R||r.self)===null||d===void 0?void 0:d(B),u,C,g);return{common:B,self:$,peers:F.merge({},r.peers,k,m),peerOverrides:F.merge({},u.peers,T,b)}})}pt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const dx=me("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -134,7 +134,7 @@ ${s}
|
|
|
134
134
|
`,[le("svg",`
|
|
135
135
|
height: 1em;
|
|
136
136
|
width: 1em;
|
|
137
|
-
`)]),$r=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Es("-base-icon",
|
|
137
|
+
`)]),$r=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Es("-base-icon",dx,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),au=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=_s();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function lu(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:F.upperFirst(t),setup(){var r;const s=(r=i.inject(_i,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[t];return a?a():i.h(n,null)}}})}const hx=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),ux=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),fx=lu("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),gx=lu("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),mx=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:px}=Rr;function ma({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${px} !important`}={}){return[le("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),le("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),le("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const yx=me("base-clear",`
|
|
138
138
|
flex-shrink: 0;
|
|
139
139
|
height: 1em;
|
|
140
140
|
width: 1em;
|
|
@@ -158,7 +158,7 @@ ${s}
|
|
|
158
158
|
left: 50%;
|
|
159
159
|
top: 50%;
|
|
160
160
|
transform: translateX(-50%) translateY(-50%);
|
|
161
|
-
`,[ma({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),
|
|
161
|
+
`,[ma({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),bx=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Es("-base-clear",yx,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(au,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},ua(this.$slots.icon,()=>[i.h($r,{clsPrefix:t},{default:()=>i.h(fx,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),_x=me("base-close",`
|
|
162
162
|
display: flex;
|
|
163
163
|
align-items: center;
|
|
164
164
|
justify-content: center;
|
|
@@ -202,7 +202,7 @@ ${s}
|
|
|
202
202
|
background-color: transparent;
|
|
203
203
|
`),Re("round",[le("&::before",`
|
|
204
204
|
border-radius: 50%;
|
|
205
|
-
`)])]),
|
|
205
|
+
`)])]),wx=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(t){return Es("-base-close",_x,i.toRef(t,"clsPrefix")),()=>{const{clsPrefix:e,disabled:n,absolute:r,round:s,isButtonTag:o}=t,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!t.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${e}-base-close`,r&&`${e}-base-close--absolute`,n&&`${e}-base-close--disabled`,s&&`${e}-base-close--round`],onMousedown:l=>{t.focusable||l.preventDefault()},onClick:t.onClick},i.h($r,{clsPrefix:e},{default:()=>i.h(gx,null)}))}}}),xx=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(t){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:t.onFocus,onBlur:t.onBlur})}}),vx=le([le("@keyframes rotator",`
|
|
206
206
|
0% {
|
|
207
207
|
-webkit-transform: rotate(0deg);
|
|
208
208
|
transform: rotate(0deg);
|
|
@@ -229,7 +229,7 @@ ${s}
|
|
|
229
229
|
`,[be("icon",`
|
|
230
230
|
height: 1em;
|
|
231
231
|
width: 1em;
|
|
232
|
-
`)])])]),pa="1.6s",
|
|
232
|
+
`)])])]),pa="1.6s",kx={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},cu=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},kx),setup(t){Es("-base-loading",vx,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:s}=this,o=e/s;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(au,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:pa,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:pa,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:pa,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:du}=Rr;function Cx({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=du,leaveCubicBezier:s=du}={}){return[le(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),le(`&.${t}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),le(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),le(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const fe={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Sx=fi(fe.neutralBase),hu=fi(fe.neutralInvertBase),Bx=`rgba(${hu.slice(0,3).join(", ")}, `;function uu(t){return`${Bx+String(t)})`}function yt(t){const e=Array.from(hu);return e[3]=Number(t),b_(Sx,e)}const vi=Object.assign(Object.assign({name:"common"},Rr),{baseColor:fe.neutralBase,primaryColor:fe.primaryDefault,primaryColorHover:fe.primaryHover,primaryColorPressed:fe.primaryActive,primaryColorSuppl:fe.primarySuppl,infoColor:fe.infoDefault,infoColorHover:fe.infoHover,infoColorPressed:fe.infoActive,infoColorSuppl:fe.infoSuppl,successColor:fe.successDefault,successColorHover:fe.successHover,successColorPressed:fe.successActive,successColorSuppl:fe.successSuppl,warningColor:fe.warningDefault,warningColorHover:fe.warningHover,warningColorPressed:fe.warningActive,warningColorSuppl:fe.warningSuppl,errorColor:fe.errorDefault,errorColorHover:fe.errorHover,errorColorPressed:fe.errorActive,errorColorSuppl:fe.errorSuppl,textColorBase:fe.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:yt(fe.alpha4),placeholderColor:yt(fe.alpha4),placeholderColorDisabled:yt(fe.alpha5),iconColor:yt(fe.alpha4),iconColorHover:gs(yt(fe.alpha4),{lightness:.75}),iconColorPressed:gs(yt(fe.alpha4),{lightness:.9}),iconColorDisabled:yt(fe.alpha5),opacity1:fe.alpha1,opacity2:fe.alpha2,opacity3:fe.alpha3,opacity4:fe.alpha4,opacity5:fe.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:yt(Number(fe.alphaClose)),closeIconColorHover:yt(Number(fe.alphaClose)),closeIconColorPressed:yt(Number(fe.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:yt(fe.alpha4),clearColorHover:gs(yt(fe.alpha4),{lightness:.75}),clearColorPressed:gs(yt(fe.alpha4),{lightness:.9}),scrollbarColor:uu(fe.alphaScrollbar),scrollbarColorHover:uu(fe.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:yt(fe.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:fe.neutralPopover,tableColor:fe.neutralCard,cardColor:fe.neutralCard,modalColor:fe.neutralModal,bodyColor:fe.neutralBody,tagColor:"#eee",avatarColor:yt(fe.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:yt(fe.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:fe.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Tx={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Rx(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=t;return Object.assign(Object.assign({},Tx),{height:r,width:s,borderRadius:o,color:e,colorHover:n})}const ya={name:"Scrollbar",common:vi,self:Rx},$x=me("scrollbar",`
|
|
233
233
|
overflow: hidden;
|
|
234
234
|
position: relative;
|
|
235
235
|
z-index: auto;
|
|
@@ -294,7 +294,7 @@ ${s}
|
|
|
294
294
|
pointer-events: all;
|
|
295
295
|
background-color: var(--n-scrollbar-color);
|
|
296
296
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
|
297
|
-
`,[kx(),le("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),$x=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),fu=i.defineComponent({name:"Scrollbar",props:$x,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=wi(t),s=Tr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),m=i.ref(null),g=i.ref(null),u=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),R=i.ref(!1);let k=!1,w=!1,C,S,T=0,B=0,$=0,M=0;const E=s1(),V=pt("Scrollbar","-scrollbar",Rx,ya,t,e),L=i.computed(()=>{const{value:P}=m,{value:W}=h,{value:ee}=u;return P===null||W===null||ee===null?0:Math.min(P,ee*P/W+yr(V.value.self.width)*1.5)}),D=i.computed(()=>`${L.value}px`),te=i.computed(()=>{const{value:P}=g,{value:W}=f,{value:ee}=p;return P===null||W===null||ee===null?0:ee*P/W+yr(V.value.self.height)*1.5}),ne=i.computed(()=>`${te.value}px`),A=i.computed(()=>{const{value:P}=m,{value:W}=b,{value:ee}=h,{value:ce}=u;if(P===null||ee===null||ce===null)return 0;{const he=ee-P;return he?W/he*(ce-L.value):0}}),I=i.computed(()=>`${A.value}px`),j=i.computed(()=>{const{value:P}=g,{value:W}=y,{value:ee}=f,{value:ce}=p;if(P===null||ee===null||ce===null)return 0;{const he=ee-P;return he?W/he*(ce-te.value):0}}),q=i.computed(()=>`${j.value}px`),N=i.computed(()=>{const{value:P}=m,{value:W}=h;return P!==null&&W!==null&&W>P}),O=i.computed(()=>{const{value:P}=g,{value:W}=f;return P!==null&&W!==null&&W>P}),Y=i.computed(()=>{const{trigger:P}=t;return P==="none"||_.value}),re=i.computed(()=>{const{trigger:P}=t;return P==="none"||R.value}),de=i.computed(()=>{const{container:P}=t;return P?P():a.value}),oe=i.computed(()=>{const{content:P}=t;return P?P():l.value}),ie=(P,W)=>{if(!t.scrollable)return;if(typeof P=="number"){Ie(P,W??0,0,!1,"auto");return}const{left:ee,top:ce,index:he,elSize:ye,position:we,behavior:ve,el:Ye,debounce:kn=!0}=P;(ee!==void 0||ce!==void 0)&&Ie(ee??0,ce??0,0,!1,ve),Ye!==void 0?Ie(0,Ye.offsetTop,Ye.offsetHeight,kn,ve):he!==void 0&&ye!==void 0?Ie(0,he*ye,ye,kn,ve):we==="bottom"?Ie(0,Number.MAX_SAFE_INTEGER,0,!1,ve):we==="top"&&Ie(0,0,0,!1,ve)},Fe=uw(()=>{t.container||ie({top:b.value,left:y.value})}),rt=()=>{Fe.isDeactivated||se()},Ce=P=>{if(Fe.isDeactivated)return;const{onResize:W}=t;W&&W(P),se()},Yt=(P,W)=>{if(!t.scrollable)return;const{value:ee}=de;ee&&(typeof P=="object"?ee.scrollBy(P):ee.scrollBy(P,W||0))};function Ie(P,W,ee,ce,he){const{value:ye}=de;if(ye){if(ce){const{scrollTop:we,offsetHeight:ve}=ye;if(W>we){W+ee<=we+ve||ye.scrollTo({left:P,top:W+ee-ve,behavior:he});return}}ye.scrollTo({left:P,top:W,behavior:he})}}function tn(){dt(),On(),se()}function nn(){Tt()}function Tt(){Ot(),rn()}function Ot(){S!==void 0&&window.clearTimeout(S),S=window.setTimeout(()=>{R.value=!1},t.duration)}function rn(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{_.value=!1},t.duration)}function dt(){C!==void 0&&window.clearTimeout(C),_.value=!0}function On(){S!==void 0&&window.clearTimeout(S),R.value=!0}function Le(P){const{onScroll:W}=t;W&&W(P),Be()}function Be(){const{value:P}=de;P&&(b.value=P.scrollTop,y.value=P.scrollLeft*(s!=null&&s.value?-1:1))}function Xe(){const{value:P}=oe;P&&(h.value=P.offsetHeight,f.value=P.offsetWidth);const{value:W}=de;W&&(m.value=W.offsetHeight,g.value=W.offsetWidth);const{value:ee}=d,{value:ce}=c;ee&&(p.value=ee.offsetWidth),ce&&(u.value=ce.offsetHeight)}function Q(){const{value:P}=de;P&&(b.value=P.scrollTop,y.value=P.scrollLeft*(s!=null&&s.value?-1:1),m.value=P.offsetHeight,g.value=P.offsetWidth,h.value=P.scrollHeight,f.value=P.scrollWidth);const{value:W}=d,{value:ee}=c;W&&(p.value=W.offsetWidth),ee&&(u.value=ee.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?Q():(Xe(),Be()))}function Se(P){var W;return!(!((W=o.value)===null||W===void 0)&&W.contains(pr(P)))}function sn(P){P.preventDefault(),P.stopPropagation(),w=!0,St("mousemove",window,er,!0),St("mouseup",window,Bi,!0),B=y.value,$=s!=null&&s.value?window.innerWidth-P.clientX:P.clientX}function er(P){if(!w)return;C!==void 0&&window.clearTimeout(C),S!==void 0&&window.clearTimeout(S);const{value:W}=g,{value:ee}=f,{value:ce}=te;if(W===null||ee===null)return;const ye=(s!=null&&s.value?window.innerWidth-P.clientX-$:P.clientX-$)*(ee-W)/(W-ce),we=ee-W;let ve=B+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Ye}=de;if(Ye){Ye.scrollLeft=ve*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:kn}=t;kn&&kn(ve)}}function Bi(P){P.preventDefault(),P.stopPropagation(),nt("mousemove",window,er,!0),nt("mouseup",window,Bi,!0),w=!1,se(),Se(P)&&Tt()}function tr(P){P.preventDefault(),P.stopPropagation(),k=!0,St("mousemove",window,Qn,!0),St("mouseup",window,Ti,!0),T=b.value,M=P.clientY}function Qn(P){if(!k)return;C!==void 0&&window.clearTimeout(C),S!==void 0&&window.clearTimeout(S);const{value:W}=m,{value:ee}=h,{value:ce}=L;if(W===null||ee===null)return;const ye=(P.clientY-M)*(ee-W)/(W-ce),we=ee-W;let ve=T+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Ye}=de;Ye&&(Ye.scrollTop=ve)}function Ti(P){P.preventDefault(),P.stopPropagation(),nt("mousemove",window,Qn,!0),nt("mouseup",window,Ti,!0),k=!1,se(),Se(P)&&Tt()}i.watchEffect(()=>{const{value:P}=O,{value:W}=N,{value:ee}=e,{value:ce}=d,{value:he}=c;ce&&(P?ce.classList.remove(`${ee}-scrollbar-rail--disabled`):ce.classList.add(`${ee}-scrollbar-rail--disabled`)),he&&(W?he.classList.remove(`${ee}-scrollbar-rail--disabled`):he.classList.add(`${ee}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{C!==void 0&&window.clearTimeout(C),S!==void 0&&window.clearTimeout(S),nt("mousemove",window,Qn,!0),nt("mouseup",window,Ti,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:P},self:{color:W,colorHover:ee,height:ce,width:he,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ve,railInsetVerticalRight:Ye,railInsetVerticalLeft:kn,railColor:Ca}}=V.value,{top:Sa,right:Ba,bottom:Ta,left:Ra}=Zt(we),{top:$a,right:Pa,bottom:Ea,left:Na}=Zt(ve),{top:Fa,right:Aa,bottom:Ma,left:Va}=Zt(s!=null&&s.value?Gh(Ye):Ye),{top:Ia,right:Oa,bottom:za,left:La}=Zt(s!=null&&s.value?Gh(kn):kn);return{"--n-scrollbar-bezier":P,"--n-scrollbar-color":W,"--n-scrollbar-color-hover":ee,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":he,"--n-scrollbar-height":ce,"--n-scrollbar-rail-top-horizontal-top":Sa,"--n-scrollbar-rail-right-horizontal-top":Ba,"--n-scrollbar-rail-bottom-horizontal-top":Ta,"--n-scrollbar-rail-left-horizontal-top":Ra,"--n-scrollbar-rail-top-horizontal-bottom":$a,"--n-scrollbar-rail-right-horizontal-bottom":Pa,"--n-scrollbar-rail-bottom-horizontal-bottom":Ea,"--n-scrollbar-rail-left-horizontal-bottom":Na,"--n-scrollbar-rail-top-vertical-right":Fa,"--n-scrollbar-rail-right-vertical-right":Aa,"--n-scrollbar-rail-bottom-vertical-right":Ma,"--n-scrollbar-rail-left-vertical-right":Va,"--n-scrollbar-rail-top-vertical-left":Ia,"--n-scrollbar-rail-right-vertical-left":Oa,"--n-scrollbar-rail-bottom-vertical-left":za,"--n-scrollbar-rail-left-vertical-left":La,"--n-scrollbar-rail-color":Ca}}),on=n?xi("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:ie,scrollBy:Yt,sync:se,syncUnifiedContainer:Q,handleMouseEnterWrapper:tn,handleMouseLeaveWrapper:nn}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:N,needXBar:O,yBarSizePx:D,xBarSizePx:ne,yBarTopPx:I,xBarLeftPx:q,isShowXBar:Y,isShowYBar:re,isIos:E,handleScroll:Le,handleContentResize:rt,handleContainerResize:Ce,handleYScrollMouseDown:tr,handleXScrollMouseDown:sn,cssVars:n?void 0:nr,themeClass:on==null?void 0:on.themeClass,onRender:on==null?void 0:on.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",h=(g,u)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[u||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?fa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var g,u;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(u=e.default)===null||u===void 0?void 0:u.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Rs,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?fa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},m=this.container?f():i.h(Rs,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,m,h(this.themeClass,this.cssVars)):m}}),Px=fu,Ex={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Nx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Ex),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const gu={name:"Empty",common:vi,self:Nx},Fx=me("empty",`
|
|
297
|
+
`,[Cx(),le("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Px=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),fu=i.defineComponent({name:"Scrollbar",props:Px,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=wi(t),s=Tr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),m=i.ref(null),g=i.ref(null),u=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),R=i.ref(!1);let k=!1,w=!1,C,S,T=0,B=0,$=0,M=0;const E=o1(),V=pt("Scrollbar","-scrollbar",$x,ya,t,e),L=i.computed(()=>{const{value:P}=m,{value:W}=h,{value:ee}=u;return P===null||W===null||ee===null?0:Math.min(P,ee*P/W+yr(V.value.self.width)*1.5)}),D=i.computed(()=>`${L.value}px`),te=i.computed(()=>{const{value:P}=g,{value:W}=f,{value:ee}=p;return P===null||W===null||ee===null?0:ee*P/W+yr(V.value.self.height)*1.5}),ne=i.computed(()=>`${te.value}px`),A=i.computed(()=>{const{value:P}=m,{value:W}=b,{value:ee}=h,{value:ce}=u;if(P===null||ee===null||ce===null)return 0;{const he=ee-P;return he?W/he*(ce-L.value):0}}),I=i.computed(()=>`${A.value}px`),j=i.computed(()=>{const{value:P}=g,{value:W}=y,{value:ee}=f,{value:ce}=p;if(P===null||ee===null||ce===null)return 0;{const he=ee-P;return he?W/he*(ce-te.value):0}}),q=i.computed(()=>`${j.value}px`),N=i.computed(()=>{const{value:P}=m,{value:W}=h;return P!==null&&W!==null&&W>P}),O=i.computed(()=>{const{value:P}=g,{value:W}=f;return P!==null&&W!==null&&W>P}),Y=i.computed(()=>{const{trigger:P}=t;return P==="none"||_.value}),re=i.computed(()=>{const{trigger:P}=t;return P==="none"||R.value}),de=i.computed(()=>{const{container:P}=t;return P?P():a.value}),oe=i.computed(()=>{const{content:P}=t;return P?P():l.value}),ie=(P,W)=>{if(!t.scrollable)return;if(typeof P=="number"){Ie(P,W??0,0,!1,"auto");return}const{left:ee,top:ce,index:he,elSize:ye,position:we,behavior:ve,el:Ye,debounce:kn=!0}=P;(ee!==void 0||ce!==void 0)&&Ie(ee??0,ce??0,0,!1,ve),Ye!==void 0?Ie(0,Ye.offsetTop,Ye.offsetHeight,kn,ve):he!==void 0&&ye!==void 0?Ie(0,he*ye,ye,kn,ve):we==="bottom"?Ie(0,Number.MAX_SAFE_INTEGER,0,!1,ve):we==="top"&&Ie(0,0,0,!1,ve)},Fe=fw(()=>{t.container||ie({top:b.value,left:y.value})}),rt=()=>{Fe.isDeactivated||se()},Ce=P=>{if(Fe.isDeactivated)return;const{onResize:W}=t;W&&W(P),se()},Yt=(P,W)=>{if(!t.scrollable)return;const{value:ee}=de;ee&&(typeof P=="object"?ee.scrollBy(P):ee.scrollBy(P,W||0))};function Ie(P,W,ee,ce,he){const{value:ye}=de;if(ye){if(ce){const{scrollTop:we,offsetHeight:ve}=ye;if(W>we){W+ee<=we+ve||ye.scrollTo({left:P,top:W+ee-ve,behavior:he});return}}ye.scrollTo({left:P,top:W,behavior:he})}}function tn(){dt(),On(),se()}function nn(){Tt()}function Tt(){Ot(),rn()}function Ot(){S!==void 0&&window.clearTimeout(S),S=window.setTimeout(()=>{R.value=!1},t.duration)}function rn(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{_.value=!1},t.duration)}function dt(){C!==void 0&&window.clearTimeout(C),_.value=!0}function On(){S!==void 0&&window.clearTimeout(S),R.value=!0}function Le(P){const{onScroll:W}=t;W&&W(P),Be()}function Be(){const{value:P}=de;P&&(b.value=P.scrollTop,y.value=P.scrollLeft*(s!=null&&s.value?-1:1))}function Xe(){const{value:P}=oe;P&&(h.value=P.offsetHeight,f.value=P.offsetWidth);const{value:W}=de;W&&(m.value=W.offsetHeight,g.value=W.offsetWidth);const{value:ee}=d,{value:ce}=c;ee&&(p.value=ee.offsetWidth),ce&&(u.value=ce.offsetHeight)}function Q(){const{value:P}=de;P&&(b.value=P.scrollTop,y.value=P.scrollLeft*(s!=null&&s.value?-1:1),m.value=P.offsetHeight,g.value=P.offsetWidth,h.value=P.scrollHeight,f.value=P.scrollWidth);const{value:W}=d,{value:ee}=c;W&&(p.value=W.offsetWidth),ee&&(u.value=ee.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?Q():(Xe(),Be()))}function Se(P){var W;return!(!((W=o.value)===null||W===void 0)&&W.contains(pr(P)))}function sn(P){P.preventDefault(),P.stopPropagation(),w=!0,St("mousemove",window,er,!0),St("mouseup",window,Bi,!0),B=y.value,$=s!=null&&s.value?window.innerWidth-P.clientX:P.clientX}function er(P){if(!w)return;C!==void 0&&window.clearTimeout(C),S!==void 0&&window.clearTimeout(S);const{value:W}=g,{value:ee}=f,{value:ce}=te;if(W===null||ee===null)return;const ye=(s!=null&&s.value?window.innerWidth-P.clientX-$:P.clientX-$)*(ee-W)/(W-ce),we=ee-W;let ve=B+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Ye}=de;if(Ye){Ye.scrollLeft=ve*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:kn}=t;kn&&kn(ve)}}function Bi(P){P.preventDefault(),P.stopPropagation(),nt("mousemove",window,er,!0),nt("mouseup",window,Bi,!0),w=!1,se(),Se(P)&&Tt()}function tr(P){P.preventDefault(),P.stopPropagation(),k=!0,St("mousemove",window,Qn,!0),St("mouseup",window,Ti,!0),T=b.value,M=P.clientY}function Qn(P){if(!k)return;C!==void 0&&window.clearTimeout(C),S!==void 0&&window.clearTimeout(S);const{value:W}=m,{value:ee}=h,{value:ce}=L;if(W===null||ee===null)return;const ye=(P.clientY-M)*(ee-W)/(W-ce),we=ee-W;let ve=T+ye;ve=Math.min(we,ve),ve=Math.max(ve,0);const{value:Ye}=de;Ye&&(Ye.scrollTop=ve)}function Ti(P){P.preventDefault(),P.stopPropagation(),nt("mousemove",window,Qn,!0),nt("mouseup",window,Ti,!0),k=!1,se(),Se(P)&&Tt()}i.watchEffect(()=>{const{value:P}=O,{value:W}=N,{value:ee}=e,{value:ce}=d,{value:he}=c;ce&&(P?ce.classList.remove(`${ee}-scrollbar-rail--disabled`):ce.classList.add(`${ee}-scrollbar-rail--disabled`)),he&&(W?he.classList.remove(`${ee}-scrollbar-rail--disabled`):he.classList.add(`${ee}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{C!==void 0&&window.clearTimeout(C),S!==void 0&&window.clearTimeout(S),nt("mousemove",window,Qn,!0),nt("mouseup",window,Ti,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:P},self:{color:W,colorHover:ee,height:ce,width:he,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ve,railInsetVerticalRight:Ye,railInsetVerticalLeft:kn,railColor:Ca}}=V.value,{top:Sa,right:Ba,bottom:Ta,left:Ra}=Zt(we),{top:$a,right:Pa,bottom:Ea,left:Na}=Zt(ve),{top:Fa,right:Aa,bottom:Ma,left:Va}=Zt(s!=null&&s.value?Gh(Ye):Ye),{top:Ia,right:Oa,bottom:za,left:La}=Zt(s!=null&&s.value?Gh(kn):kn);return{"--n-scrollbar-bezier":P,"--n-scrollbar-color":W,"--n-scrollbar-color-hover":ee,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":he,"--n-scrollbar-height":ce,"--n-scrollbar-rail-top-horizontal-top":Sa,"--n-scrollbar-rail-right-horizontal-top":Ba,"--n-scrollbar-rail-bottom-horizontal-top":Ta,"--n-scrollbar-rail-left-horizontal-top":Ra,"--n-scrollbar-rail-top-horizontal-bottom":$a,"--n-scrollbar-rail-right-horizontal-bottom":Pa,"--n-scrollbar-rail-bottom-horizontal-bottom":Ea,"--n-scrollbar-rail-left-horizontal-bottom":Na,"--n-scrollbar-rail-top-vertical-right":Fa,"--n-scrollbar-rail-right-vertical-right":Aa,"--n-scrollbar-rail-bottom-vertical-right":Ma,"--n-scrollbar-rail-left-vertical-right":Va,"--n-scrollbar-rail-top-vertical-left":Ia,"--n-scrollbar-rail-right-vertical-left":Oa,"--n-scrollbar-rail-bottom-vertical-left":za,"--n-scrollbar-rail-left-vertical-left":La,"--n-scrollbar-rail-color":Ca}}),on=n?xi("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:ie,scrollBy:Yt,sync:se,syncUnifiedContainer:Q,handleMouseEnterWrapper:tn,handleMouseLeaveWrapper:nn}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:N,needXBar:O,yBarSizePx:D,xBarSizePx:ne,yBarTopPx:I,xBarLeftPx:q,isShowXBar:Y,isShowYBar:re,isIos:E,handleScroll:Le,handleContentResize:rt,handleContainerResize:Ce,handleYScrollMouseDown:tr,handleXScrollMouseDown:sn,cssVars:n?void 0:nr,themeClass:on==null?void 0:on.themeClass,onRender:on==null?void 0:on.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",h=(g,u)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[u||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?fa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var g,u;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(u=e.default)===null||u===void 0?void 0:u.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Rs,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?fa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},m=this.container?f():i.h(Rs,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,m,h(this.themeClass,this.cssVars)):m}}),Ex=fu,Nx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Fx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Nx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const gu={name:"Empty",common:vi,self:Fx},Ax=me("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
@@ -317,7 +317,7 @@ ${s}
|
|
|
317
317
|
transition: color .3s var(--n-bezier);
|
|
318
318
|
margin-top: 12px;
|
|
319
319
|
color: var(--n-extra-text-color);
|
|
320
|
-
`)]),
|
|
320
|
+
`)]),Mx=Object.assign(Object.assign({},pt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Vx=i.defineComponent({name:"Empty",props:Mx,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=wi(t),s=pt("Empty","-empty",Ax,gu,t,e),{localeRef:o}=su("Empty"),a=i.computed(()=>{var h,f,m;return(h=t.description)!==null&&h!==void 0?h:(m=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||m===void 0?void 0:m.description}),l=i.computed(()=>{var h,f;return((f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i.h(mx,null))}),c=i.computed(()=>{const{size:h}=t,{common:{cubicBezierEaseInOut:f},self:{[Ge("iconSize",h)]:m,[Ge("fontSize",h)]:g,textColor:u,iconColor:p,extraTextColor:b}}=s.value;return{"--n-icon-size":m,"--n-font-size":g,"--n-bezier":f,"--n-text-color":u,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?xi("empty",i.computed(()=>{let h="";const{size:f}=t;return h+=f[0],h}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h($r,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),Ix={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Ox(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:f,fontSizeSmall:m,fontSizeMedium:g,fontSizeLarge:u,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:R,heightHuge:k}=t;return Object.assign(Object.assign({},Ix),{optionFontSizeTiny:f,optionFontSizeSmall:m,optionFontSizeMedium:g,optionFontSizeLarge:u,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:R,optionHeightHuge:k,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const mu={name:"InternalSelectMenu",common:vi,peers:{Scrollbar:ya,Empty:gu},self:Ox},pu=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(aa);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=e?e(s,!1):Ji(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${t}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function zx(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h($r,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(hx)}):null})}const yu=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:f,handleOptionMouseEnter:m}=i.inject(aa),g=qt(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function u(y){const{tmNode:_}=t;_.disabled||f(y,_)}function p(y){const{tmNode:_}=t;_.disabled||m(y,_)}function b(y){const{tmNode:_}=t,{value:R}=g;_.disabled||R||m(y,_)}return{multiple:r,isGrouped:qt(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:g,isSelected:qt(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const R=t.tmNode.rawNode[c.value];if(_){const{value:k}=s;return k.has(R)}else return y===R}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:u}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:f}=this,m=zx(n,t),g=c?[c(e,n),o&&m]:[Ji(e[this.labelField],e,n),o&&m],u=a==null?void 0:a(e),p=i.h("div",Object.assign({},u,{class:[`${t}-base-select-option`,e.class,u==null?void 0:u.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:s,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:o}],style:[(u==null?void 0:u.style)||"",e.style||""],onClick:ha([d,u==null?void 0:u.onClick]),onMouseenter:ha([h,u==null?void 0:u.onMouseenter]),onMousemove:ha([f,u==null?void 0:u.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},g));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:bu,cubicBezierEaseOut:_u}=Rr;function wu({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[le("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${bu}, transform ${e} ${bu} ${s&&`,${s}`}`}),le("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${_u}, transform ${e} ${_u} ${s&&`,${s}`}`}),le("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),le("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Lx=me("base-select-menu",`
|
|
321
321
|
line-height: 1.5;
|
|
322
322
|
outline: none;
|
|
323
323
|
z-index: 0;
|
|
@@ -424,7 +424,7 @@ ${s}
|
|
|
424
424
|
top: calc(50% - 7px);
|
|
425
425
|
color: var(--n-option-check-color);
|
|
426
426
|
transition: color .3s var(--n-bezier);
|
|
427
|
-
`,[wu({enterScale:"0.5"})])])]),
|
|
427
|
+
`,[wu({enterScale:"0.5"})])])]),Dx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=wi(t),r=Tr("InternalSelectMenu",n,e),s=pt("InternalSelectMenu","-internal-select-menu",Lx,mu,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>F_(c.value)),h=i.ref(null);function f(){const{treeMate:N}=t;let O=null;const{value:Y}=t;Y===null?O=N.getFirstAvailableNode():(t.multiple?O=N.getNode((Y||[])[(Y||[]).length-1]):O=N.getNode(Y),(!O||O.disabled)&&(O=N.getFirstAvailableNode())),L(O||null)}function m(){const{value:N}=h;N&&!t.treeMate.getNode(N.key)&&(h.value=null)}let g;i.watch(()=>t.show,N=>{N?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?f():m(),i.nextTick(D)):m()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const u=i.computed(()=>yr(s.value.self[Ge("optionHeight",t.size)])),p=i.computed(()=>Zt(s.value.self[Ge("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const N=c.value;return N&&N.length===0});function _(N){const{onToggle:O}=t;O&&O(N)}function R(N){const{onScroll:O}=t;O&&O(N)}function k(N){var O;(O=l.value)===null||O===void 0||O.sync(),R(N)}function w(){var N;(N=l.value)===null||N===void 0||N.sync()}function C(){const{value:N}=h;return N||null}function S(N,O){O.disabled||L(O,!1)}function T(N,O){O.disabled||_(O)}function B(N){var O;mr(N,"action")||(O=t.onKeyup)===null||O===void 0||O.call(t,N)}function $(N){var O;mr(N,"action")||(O=t.onKeydown)===null||O===void 0||O.call(t,N)}function M(N){var O;(O=t.onMousedown)===null||O===void 0||O.call(t,N),!t.focusable&&N.preventDefault()}function E(){const{value:N}=h;N&&L(N.getNext({loop:!0}),!0)}function V(){const{value:N}=h;N&&L(N.getPrev({loop:!0}),!0)}function L(N,O=!1){h.value=N,O&&D()}function D(){var N,O;const Y=h.value;if(!Y)return;const re=d.value(Y.key);re!==null&&(t.virtualScroll?(N=a.value)===null||N===void 0||N.scrollTo({index:re}):(O=l.value)===null||O===void 0||O.scrollTo({index:re,elSize:u.value}))}function te(N){var O,Y;!((O=o.value)===null||O===void 0)&&O.contains(N.target)&&((Y=t.onFocus)===null||Y===void 0||Y.call(t,N))}function ne(N){var O,Y;!((O=o.value)===null||O===void 0)&&O.contains(N.relatedTarget)||(Y=t.onBlur)===null||Y===void 0||Y.call(t,N)}i.provide(aa,{handleOptionMouseEnter:S,handleOptionClick:T,valueSetRef:b,pendingTmNodeRef:h,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(Dh,o),i.onMounted(()=>{const{value:N}=l;N&&N.sync()});const A=i.computed(()=>{const{size:N}=t,{common:{cubicBezierEaseInOut:O},self:{height:Y,borderRadius:re,color:de,groupHeaderTextColor:oe,actionDividerColor:ie,optionTextColorPressed:Fe,optionTextColor:rt,optionTextColorDisabled:Ce,optionTextColorActive:Yt,optionOpacityDisabled:Ie,optionCheckColor:tn,actionTextColor:nn,optionColorPending:Tt,optionColorActive:Ot,loadingColor:rn,loadingSize:dt,optionColorActivePending:On,[Ge("optionFontSize",N)]:Le,[Ge("optionHeight",N)]:Be,[Ge("optionPadding",N)]:Xe}}=s.value;return{"--n-height":Y,"--n-action-divider-color":ie,"--n-action-text-color":nn,"--n-bezier":O,"--n-border-radius":re,"--n-color":de,"--n-option-font-size":Le,"--n-group-header-text-color":oe,"--n-option-check-color":tn,"--n-option-color-pending":Tt,"--n-option-color-active":Ot,"--n-option-color-active-pending":On,"--n-option-height":Be,"--n-option-opacity-disabled":Ie,"--n-option-text-color":rt,"--n-option-text-color-active":Yt,"--n-option-text-color-disabled":Ce,"--n-option-text-color-pressed":Fe,"--n-option-padding":Xe,"--n-option-padding-left":Zt(Xe,"left"),"--n-option-padding-right":Zt(Xe,"right"),"--n-loading-color":rn,"--n-loading-size":dt}}),{inlineThemeDisabled:I}=t,j=I?xi("internal-select-menu",i.computed(()=>t.size[0]),A,t):void 0,q={selfRef:o,next:E,prev:V,getPendingTmNode:C};return Xh(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:u,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:N}=a;return N==null?void 0:N.listElRef},virtualListContent(){const{value:N}=a;return N==null?void 0:N.itemsElRef},doScroll:R,handleFocusin:te,handleFocusout:ne,handleKeyUp:B,handleKeyDown:$,handleMouseDown:M,handleVirtualListResize:w,handleVirtualListScroll:k,cssVars:I?void 0:A,themeClass:j==null?void 0:j.themeClass,onRender:j==null?void 0:j.onRender},q)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},bi(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(cu,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},ua(t.empty,()=>[i.h(Vx,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(fu,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(cw,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(pu,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(yu,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(pu,{key:a.key,clsPrefix:n,tmNode:a}):i.h(yu,{clsPrefix:n,key:a.key,tmNode:a})))}),bi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(xx,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Hx={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Wx(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},Hx),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const xu={name:"Popover",common:vi,peers:{Scrollbar:ya},self:Wx},ba={top:"bottom",bottom:"top",left:"right",right:"left"},it="var(--n-arrow-height) * 1.414",jx=le([me("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -532,7 +532,7 @@ ${s}
|
|
|
532
532
|
margin-${ba[n]}: var(--n-space-arrow);
|
|
533
533
|
`),Re("overlap",`
|
|
534
534
|
margin: 0;
|
|
535
|
-
`),
|
|
535
|
+
`),_w("popover-arrow-wrapper",`
|
|
536
536
|
right: 0;
|
|
537
537
|
left: 0;
|
|
538
538
|
top: 0;
|
|
@@ -540,7 +540,7 @@ ${s}
|
|
|
540
540
|
${n}: 100%;
|
|
541
541
|
${ba[n]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[me("popover-arrow",e)])])])}const vu=Object.assign(Object.assign({},pt.props),{to:$n.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function jx({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,t],style:e}))}const qx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:vu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=wi(t),l=pt("Popover","-popover",Wx,xu,t,s),c=Tr("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),f=i.ref(null),m=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:B}=t;B&&!_w()&&!t.internalDeactivateImmediately&&(g.value=!0)});const u=i.computed(()=>{const{trigger:B,onClickoutside:$}=t,M=[],{positionManuallyRef:{value:E}}=h;return E||(B==="click"&&!$&&M.push([bs,C,void 0,{capture:!0}]),B==="hover"&&M.push([Q_,w])),$&&M.push([bs,C,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&M.push([i.vShow,t.show]),M}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:B,cubicBezierEaseIn:$,cubicBezierEaseOut:M},self:{space:E,spaceArrow:V,padding:L,fontSize:D,textColor:te,dividerColor:ne,color:A,boxShadow:I,borderRadius:j,arrowHeight:q,arrowOffset:N,arrowOffsetVertical:O}}=l.value;return{"--n-box-shadow":I,"--n-bezier":B,"--n-bezier-ease-in":$,"--n-bezier-ease-out":M,"--n-font-size":D,"--n-text-color":te,"--n-color":A,"--n-divider-color":ne,"--n-border-radius":j,"--n-arrow-height":q,"--n-arrow-offset":N,"--n-arrow-offset-vertical":O,"--n-padding":L,"--n-space":E,"--n-space-arrow":V}}),b=i.computed(()=>{const B=t.width==="trigger"?void 0:la(t.width),$=[];B&&$.push({width:B});const{maxWidth:M,minWidth:E}=t;return M&&$.push({maxWidth:la(M)}),E&&$.push({maxWidth:la(E)}),o||$.push(p.value),$}),y=o?xi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),B=>{t.animated||(B?m.value=!0:m.value=!1)});function _(){var B;(B=d.value)===null||B===void 0||B.syncPosition()}function R(B){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter(B)}function k(B){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave(B)}function w(B){t.trigger==="hover"&&!S().contains(pr(B))&&h.handleMouseMoveOutside(B)}function C(B){(t.trigger==="click"&&!S().contains(pr(B))||t.onClickoutside)&&h.handleClickOutside(B)}function S(){return h.getTriggerElement()}i.provide(jh,f),i.provide(Hh,null),i.provide(Wh,null);function T(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let $;const M=h.internalRenderBodyRef.value,{value:E}=s;if(M)$=M([`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${E}-popover-shared--overlap`,t.showArrow&&`${E}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${E}-popover-shared--center-arrow`],f,b.value,R,k);else{const{value:V}=h.extraClassRef,{internalTrapFocus:L}=t,D=!iu(e.header)||!iu(e.footer),te=()=>{var ne,A;const I=D?i.h(i.Fragment,null,bi(e.header,N=>N?i.h("div",{class:[`${E}-popover__header`,t.headerClass],style:t.headerStyle},N):null),bi(e.default,N=>N?i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e):null),bi(e.footer,N=>N?i.h("div",{class:[`${E}-popover__footer`,t.footerClass],style:t.footerStyle},N):null)):t.scrollable?(ne=e.default)===null||ne===void 0?void 0:ne.call(e):i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e),j=t.scrollable?i.h(Px,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:D?void 0:`${E}-popover__content ${(A=t.contentClass)!==null&&A!==void 0?A:""}`,contentStyle:D?void 0:t.contentStyle},{default:()=>I}):I,q=t.showArrow?jx({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:E}):null;return[j,q]};$=i.h("div",i.mergeProps({class:[`${E}-popover`,`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,V.map(ne=>`${E}-${ne}`),{[`${E}-popover--scrollable`]:t.scrollable,[`${E}-popover--show-header-or-footer`]:D,[`${E}-popover--raw`]:t.raw,[`${E}-popover-shared--overlap`]:t.overlap,[`${E}-popover-shared--show-arrow`]:t.showArrow,[`${E}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:f,style:b.value,onKeydown:h.handleKeydown,onMouseenter:R,onMouseleave:k},n),L?i.h(hw,{active:t.show,autoFocus:!0},{default:te}):te())}return i.withDirectives($,u.value)}return{displayed:g,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:$n(t),followerEnabled:m,renderContentNode:T}},render(){return i.h(yh,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===$n.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Xx={};const Yx=Object.keys(vu),Ux={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Gx(t,e,n){Ux[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const Kx={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:$n.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Zx=Object.assign(Object.assign(Object.assign({},pt.props),Kx),{internalOnAfterLeave:Function,internalRenderBody:Function}),Qx=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Zx,slots:Object,__popover__:!0,setup(t){Xx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&Kn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&Kn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&Kn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&Kn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&Kn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=_s(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Uo(r,s),a=qt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:D}=t;return!!(D!=null&&D())},c=()=>l()?!1:o.value,d=Zd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let f=null;const m=i.ref(null),g=i.ref(null),u=qt(()=>t.x!==void 0&&t.y!==void 0);function p(D){const{"onUpdate:show":te,onUpdateShow:ne,onShow:A,onHide:I}=t;s.value=D,te&&mt(te,D),ne&&mt(ne,D),D&&A&&mt(A,!0),D&&I&&mt(I,!1)}function b(){f&&f.syncPosition()}function y(){const{value:D}=m;D&&(window.clearTimeout(D),m.value=null)}function _(){const{value:D}=g;D&&(window.clearTimeout(D),g.value=null)}function R(){const D=l();if(t.trigger==="focus"&&!D){if(c())return;p(!0)}}function k(){const D=l();if(t.trigger==="focus"&&!D){if(!c())return;p(!1)}}function w(){const D=l();if(t.trigger==="hover"&&!D){if(_(),m.value!==null||c())return;const te=()=>{p(!0),m.value=null},{delay:ne}=t;ne===0?te():m.value=window.setTimeout(te,ne)}}function C(){const D=l();if(t.trigger==="hover"&&!D){if(y(),g.value!==null||!c())return;const te=()=>{p(!1),g.value=null},{duration:ne}=t;ne===0?te():g.value=window.setTimeout(te,ne)}}function S(){C()}function T(D){var te;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(te=t.onClickoutside)===null||te===void 0||te.call(t,D))}function B(){if(t.trigger==="click"&&!l()){y(),_();const D=!c();p(D)}}function $(D){t.internalTrapFocus&&D.key==="Escape"&&(y(),_(),p(!1))}function M(D){s.value=D}function E(){var D;return(D=n.value)===null||D===void 0?void 0:D.targetRef}function V(D){f=D}return i.provide("NPopover",{getTriggerElement:E,handleKeydown:$,handleMouseEnter:w,handleMouseLeave:C,handleClickOutside:T,handleMouseMoveOutside:S,setBodyInstance:V,positionManuallyRef:u,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:u,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:M,handleClick:B,handleMouseEnter:w,handleMouseLeave:C,handleFocus:R,handleBlur:k,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=vw(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};Gx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(th,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Kd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(nh,null,{default:()=>r}),i.h(qx,kw(this.$props,Yx,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Jx={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function ev(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:m,closeIconColor:g,closeIconColorHover:u,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:R,fontSizeMedium:k,heightMini:w,heightTiny:C,heightSmall:S,heightMedium:T,closeColorHover:B,closeColorPressed:$,buttonColor2Hover:M,buttonColor2Pressed:E,fontWeightStrong:V}=t;return Object.assign(Object.assign({},Jx),{closeBorderRadius:b,heightTiny:w,heightSmall:C,heightMedium:S,heightLarge:T,borderRadius:b,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:R,fontSizeLarge:k,fontWeightStrong:V,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:M,colorPressedCheckable:E,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:B,closeColorPressed:$,borderPrimary:`1px solid ${Ve(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ve(s,{alpha:.12}),colorBorderedPrimary:Ve(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ve(s,{alpha:.12}),closeColorPressedPrimary:Ve(s,{alpha:.18}),borderInfo:`1px solid ${Ve(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ve(o,{alpha:.12}),colorBorderedInfo:Ve(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ve(o,{alpha:.12}),closeColorPressedInfo:Ve(o,{alpha:.18}),borderSuccess:`1px solid ${Ve(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ve(a,{alpha:.12}),colorBorderedSuccess:Ve(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ve(a,{alpha:.12}),closeColorPressedSuccess:Ve(a,{alpha:.18}),borderWarning:`1px solid ${Ve(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ve(l,{alpha:.15}),colorBorderedWarning:Ve(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ve(l,{alpha:.12}),closeColorPressedWarning:Ve(l,{alpha:.18}),borderError:`1px solid ${Ve(c,{alpha:.23})}`,textColorError:c,colorError:Ve(c,{alpha:.1}),colorBorderedError:Ve(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ve(c,{alpha:.12}),closeColorPressedError:Ve(c,{alpha:.18})})}const tv={common:vi,self:ev},nv={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},iv=me("tag",`
|
|
543
|
+
`,[me("popover-arrow",e)])])])}const vu=Object.assign(Object.assign({},pt.props),{to:$n.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function qx({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,t],style:e}))}const Xx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:vu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=wi(t),l=pt("Popover","-popover",jx,xu,t,s),c=Tr("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),f=i.ref(null),m=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:B}=t;B&&!ww()&&!t.internalDeactivateImmediately&&(g.value=!0)});const u=i.computed(()=>{const{trigger:B,onClickoutside:$}=t,M=[],{positionManuallyRef:{value:E}}=h;return E||(B==="click"&&!$&&M.push([bs,C,void 0,{capture:!0}]),B==="hover"&&M.push([J_,w])),$&&M.push([bs,C,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&M.push([i.vShow,t.show]),M}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:B,cubicBezierEaseIn:$,cubicBezierEaseOut:M},self:{space:E,spaceArrow:V,padding:L,fontSize:D,textColor:te,dividerColor:ne,color:A,boxShadow:I,borderRadius:j,arrowHeight:q,arrowOffset:N,arrowOffsetVertical:O}}=l.value;return{"--n-box-shadow":I,"--n-bezier":B,"--n-bezier-ease-in":$,"--n-bezier-ease-out":M,"--n-font-size":D,"--n-text-color":te,"--n-color":A,"--n-divider-color":ne,"--n-border-radius":j,"--n-arrow-height":q,"--n-arrow-offset":N,"--n-arrow-offset-vertical":O,"--n-padding":L,"--n-space":E,"--n-space-arrow":V}}),b=i.computed(()=>{const B=t.width==="trigger"?void 0:la(t.width),$=[];B&&$.push({width:B});const{maxWidth:M,minWidth:E}=t;return M&&$.push({maxWidth:la(M)}),E&&$.push({maxWidth:la(E)}),o||$.push(p.value),$}),y=o?xi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),B=>{t.animated||(B?m.value=!0:m.value=!1)});function _(){var B;(B=d.value)===null||B===void 0||B.syncPosition()}function R(B){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter(B)}function k(B){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave(B)}function w(B){t.trigger==="hover"&&!S().contains(pr(B))&&h.handleMouseMoveOutside(B)}function C(B){(t.trigger==="click"&&!S().contains(pr(B))||t.onClickoutside)&&h.handleClickOutside(B)}function S(){return h.getTriggerElement()}i.provide(jh,f),i.provide(Hh,null),i.provide(Wh,null);function T(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let $;const M=h.internalRenderBodyRef.value,{value:E}=s;if(M)$=M([`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${E}-popover-shared--overlap`,t.showArrow&&`${E}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${E}-popover-shared--center-arrow`],f,b.value,R,k);else{const{value:V}=h.extraClassRef,{internalTrapFocus:L}=t,D=!iu(e.header)||!iu(e.footer),te=()=>{var ne,A;const I=D?i.h(i.Fragment,null,bi(e.header,N=>N?i.h("div",{class:[`${E}-popover__header`,t.headerClass],style:t.headerStyle},N):null),bi(e.default,N=>N?i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e):null),bi(e.footer,N=>N?i.h("div",{class:[`${E}-popover__footer`,t.footerClass],style:t.footerStyle},N):null)):t.scrollable?(ne=e.default)===null||ne===void 0?void 0:ne.call(e):i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e),j=t.scrollable?i.h(Ex,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:D?void 0:`${E}-popover__content ${(A=t.contentClass)!==null&&A!==void 0?A:""}`,contentStyle:D?void 0:t.contentStyle},{default:()=>I}):I,q=t.showArrow?qx({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:E}):null;return[j,q]};$=i.h("div",i.mergeProps({class:[`${E}-popover`,`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,V.map(ne=>`${E}-${ne}`),{[`${E}-popover--scrollable`]:t.scrollable,[`${E}-popover--show-header-or-footer`]:D,[`${E}-popover--raw`]:t.raw,[`${E}-popover-shared--overlap`]:t.overlap,[`${E}-popover-shared--show-arrow`]:t.showArrow,[`${E}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:f,style:b.value,onKeydown:h.handleKeydown,onMouseenter:R,onMouseleave:k},n),L?i.h(uw,{active:t.show,autoFocus:!0},{default:te}):te())}return i.withDirectives($,u.value)}return{displayed:g,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:$n(t),followerEnabled:m,renderContentNode:T}},render(){return i.h(yh,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===$n.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Yx={};const Ux=Object.keys(vu),Gx={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Kx(t,e,n){Gx[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const Zx={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:$n.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Qx=Object.assign(Object.assign(Object.assign({},pt.props),Zx),{internalOnAfterLeave:Function,internalRenderBody:Function}),Jx=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Qx,slots:Object,__popover__:!0,setup(t){Yx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&Kn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&Kn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&Kn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&Kn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&Kn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=_s(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Uo(r,s),a=qt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:D}=t;return!!(D!=null&&D())},c=()=>l()?!1:o.value,d=Zd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let f=null;const m=i.ref(null),g=i.ref(null),u=qt(()=>t.x!==void 0&&t.y!==void 0);function p(D){const{"onUpdate:show":te,onUpdateShow:ne,onShow:A,onHide:I}=t;s.value=D,te&&mt(te,D),ne&&mt(ne,D),D&&A&&mt(A,!0),D&&I&&mt(I,!1)}function b(){f&&f.syncPosition()}function y(){const{value:D}=m;D&&(window.clearTimeout(D),m.value=null)}function _(){const{value:D}=g;D&&(window.clearTimeout(D),g.value=null)}function R(){const D=l();if(t.trigger==="focus"&&!D){if(c())return;p(!0)}}function k(){const D=l();if(t.trigger==="focus"&&!D){if(!c())return;p(!1)}}function w(){const D=l();if(t.trigger==="hover"&&!D){if(_(),m.value!==null||c())return;const te=()=>{p(!0),m.value=null},{delay:ne}=t;ne===0?te():m.value=window.setTimeout(te,ne)}}function C(){const D=l();if(t.trigger==="hover"&&!D){if(y(),g.value!==null||!c())return;const te=()=>{p(!1),g.value=null},{duration:ne}=t;ne===0?te():g.value=window.setTimeout(te,ne)}}function S(){C()}function T(D){var te;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(te=t.onClickoutside)===null||te===void 0||te.call(t,D))}function B(){if(t.trigger==="click"&&!l()){y(),_();const D=!c();p(D)}}function $(D){t.internalTrapFocus&&D.key==="Escape"&&(y(),_(),p(!1))}function M(D){s.value=D}function E(){var D;return(D=n.value)===null||D===void 0?void 0:D.targetRef}function V(D){f=D}return i.provide("NPopover",{getTriggerElement:E,handleKeydown:$,handleMouseEnter:w,handleMouseLeave:C,handleClickOutside:T,handleMouseMoveOutside:S,setBodyInstance:V,positionManuallyRef:u,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:u,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:M,handleClick:B,handleMouseEnter:w,handleMouseLeave:C,handleFocus:R,handleBlur:k,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=kw(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};Kx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(th,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Kd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(nh,null,{default:()=>r}),i.h(Xx,Cw(this.$props,Ux,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),ev={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function tv(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:m,closeIconColor:g,closeIconColorHover:u,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:R,fontSizeMedium:k,heightMini:w,heightTiny:C,heightSmall:S,heightMedium:T,closeColorHover:B,closeColorPressed:$,buttonColor2Hover:M,buttonColor2Pressed:E,fontWeightStrong:V}=t;return Object.assign(Object.assign({},ev),{closeBorderRadius:b,heightTiny:w,heightSmall:C,heightMedium:S,heightLarge:T,borderRadius:b,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:R,fontSizeLarge:k,fontWeightStrong:V,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:M,colorPressedCheckable:E,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:B,closeColorPressed:$,borderPrimary:`1px solid ${Ve(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ve(s,{alpha:.12}),colorBorderedPrimary:Ve(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ve(s,{alpha:.12}),closeColorPressedPrimary:Ve(s,{alpha:.18}),borderInfo:`1px solid ${Ve(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ve(o,{alpha:.12}),colorBorderedInfo:Ve(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ve(o,{alpha:.12}),closeColorPressedInfo:Ve(o,{alpha:.18}),borderSuccess:`1px solid ${Ve(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ve(a,{alpha:.12}),colorBorderedSuccess:Ve(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ve(a,{alpha:.12}),closeColorPressedSuccess:Ve(a,{alpha:.18}),borderWarning:`1px solid ${Ve(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ve(l,{alpha:.15}),colorBorderedWarning:Ve(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ve(l,{alpha:.12}),closeColorPressedWarning:Ve(l,{alpha:.18}),borderError:`1px solid ${Ve(c,{alpha:.23})}`,textColorError:c,colorError:Ve(c,{alpha:.1}),colorBorderedError:Ve(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ve(c,{alpha:.12}),closeColorPressedError:Ve(c,{alpha:.18})})}const nv={common:vi,self:tv},iv={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},rv=me("tag",`
|
|
544
544
|
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
|
|
545
545
|
white-space: nowrap;
|
|
546
546
|
position: relative;
|
|
@@ -610,7 +610,7 @@ ${s}
|
|
|
610
610
|
`,[Qt("disabled",[le("&:hover","background-color: var(--n-color-hover-checkable);",[Qt("checked","color: var(--n-text-color-hover-checkable);")]),le("&:active","background-color: var(--n-color-pressed-checkable);",[Qt("checked","color: var(--n-text-color-pressed-checkable);")])]),Re("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[Qt("disabled",[le("&:hover","background-color: var(--n-color-checked-hover);"),le("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var
|
|
613
|
+
`,[Qt("disabled",[le("&:hover","background-color: var(--n-color-checked-hover);"),le("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var sv={};const ov=Object.assign(Object.assign(Object.assign({},pt.props),iv),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),av="n-tag",_a=i.defineComponent({name:"Tag",props:ov,slots:Object,setup(t){sv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&Kn("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=wi(t),a=pt("Tag","-tag",rv,nv,t,r);i.provide(av,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:u,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!g),b&&b(!g),u&&u(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:u}=t;u&&mt(u,g)}}const d={setTextContent(g){const{value:u}=e;u&&(u.textContent=g)}},h=Tr("Tag",o,r),f=i.computed(()=>{const{type:g,size:u,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:R,borderRadius:k,opacityDisabled:w,textColorCheckable:C,textColorHoverCheckable:S,textColorPressedCheckable:T,textColorChecked:B,colorCheckable:$,colorHoverCheckable:M,colorPressedCheckable:E,colorChecked:V,colorCheckedHover:L,colorCheckedPressed:D,closeBorderRadius:te,fontWeightStrong:ne,[Ge("colorBordered",g)]:A,[Ge("closeSize",u)]:I,[Ge("closeIconSize",u)]:j,[Ge("fontSize",u)]:q,[Ge("height",u)]:N,[Ge("color",g)]:O,[Ge("textColor",g)]:Y,[Ge("border",g)]:re,[Ge("closeIconColor",g)]:de,[Ge("closeIconColorHover",g)]:oe,[Ge("closeIconColorPressed",g)]:ie,[Ge("closeColorHover",g)]:Fe,[Ge("closeColorPressed",g)]:rt}}=a.value,Ce=Zt(R);return{"--n-font-weight-strong":ne,"--n-avatar-size-override":`calc(${N} - 8px)`,"--n-bezier":y,"--n-border-radius":k,"--n-border":re,"--n-close-icon-size":j,"--n-close-color-pressed":rt,"--n-close-color-hover":Fe,"--n-close-border-radius":te,"--n-close-icon-color":de,"--n-close-icon-color-hover":oe,"--n-close-icon-color-pressed":ie,"--n-close-icon-color-disabled":de,"--n-close-margin-top":Ce.top,"--n-close-margin-right":Ce.right,"--n-close-margin-bottom":Ce.bottom,"--n-close-margin-left":Ce.left,"--n-close-size":I,"--n-color":p||(n.value?A:O),"--n-color-checkable":$,"--n-color-checked":V,"--n-color-checked-hover":L,"--n-color-checked-pressed":D,"--n-color-hover-checkable":M,"--n-color-pressed-checkable":E,"--n-font-size":q,"--n-height":N,"--n-opacity-disabled":w,"--n-padding":_,"--n-text-color":b||Y,"--n-text-color-checkable":C,"--n-text-color-checked":B,"--n-text-color-hover-checkable":S,"--n-text-color-pressed-checkable":T}}),m=s?xi("tag",i.computed(()=>{let g="";const{type:u,size:p,color:{color:b,textColor:y}={}}=t;return g+=u[0],g+=p[0],b&&(g+=`a${Yh(b)}`),y&&(g+=`b${Yh(y)}`),n.value&&(g+="c"),g}),f,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:f,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=bi(c.avatar,f=>f&&i.h("div",{class:`${n}-tag__avatar`},f)),h=bi(c.icon,f=>f&&i.h("div",{class:`${n}-tag__icon`},f));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&s?i.h(wx,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),lv=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(cu,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(bx,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h($r,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>ua(e.default,()=>[i.h(ux,null)])})}):null})}}}),cv={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function dv(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:f,borderColor:m,iconColor:g,iconColorDisabled:u,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:R,fontSizeTiny:k,fontSizeSmall:w,fontSizeMedium:C,fontSizeLarge:S,heightTiny:T,heightSmall:B,heightMedium:$,heightLarge:M,fontWeight:E}=t;return Object.assign(Object.assign({},cv),{fontSizeTiny:k,fontSizeSmall:w,fontSizeMedium:C,fontSizeLarge:S,heightTiny:T,heightSmall:B,heightMedium:$,heightLarge:M,borderRadius:e,fontWeight:E,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:R,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${m}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Ve(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Ve(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:u,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Ve(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Ve(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:p,clearColorHover:b,clearColorPressed:y})}const ku={name:"InternalSelection",common:vi,peers:{Popover:xu},self:dv},hv=le([me("base-selection",`
|
|
614
614
|
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
|
|
615
615
|
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
|
|
616
616
|
position: relative;
|
|
@@ -810,7 +810,7 @@ ${s}
|
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),hv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=wi(t),r=Tr("InternalSelection",n,e),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),m=i.ref(null),g=i.ref(null),u=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=pt("InternalSelection","-internal-selection",dv,ku,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),R=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Ji(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const Q=t.selectedOption;if(Q)return Q[t.labelField]}),w=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function C(){var Q;const{value:se}=s;if(se){const{value:Se}=o;Se&&(Se.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((Q=m.value)===null||Q===void 0||Q.sync({showAllItemsBeforeCalculate:!1})))}}function S(){const{value:Q}=g;Q&&(Q.style.display="none")}function T(){const{value:Q}=g;Q&&(Q.style.display="inline-block")}i.watch(i.toRef(t,"active"),Q=>{Q||S()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(C)});function B(Q){const{onFocus:se}=t;se&&se(Q)}function $(Q){const{onBlur:se}=t;se&&se(Q)}function M(Q){const{onDeleteOption:se}=t;se&&se(Q)}function E(Q){const{onClear:se}=t;se&&se(Q)}function V(Q){const{onPatternInput:se}=t;se&&se(Q)}function L(Q){var se;(!Q.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(Q.relatedTarget)))&&B(Q)}function D(Q){var se;!((se=a.value)===null||se===void 0)&&se.contains(Q.relatedTarget)||$(Q)}function te(Q){E(Q)}function ne(){b.value=!0}function A(){b.value=!1}function I(Q){!t.active||!t.filterable||Q.target!==o.value&&Q.preventDefault()}function j(Q){M(Q)}const q=i.ref(!1);function N(Q){if(Q.key==="Backspace"&&!q.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&j(se[se.length-1])}}let O=null;function Y(Q){const{value:se}=s;if(se){const Se=Q.target.value;se.textContent=Se,C()}t.ignoreComposition&&q.value?O=Q:V(Q)}function re(){q.value=!0}function de(){q.value=!1,t.ignoreComposition&&V(O),O=null}function oe(Q){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,Q)}function ie(Q){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,Q)}function Fe(){var Q,se;if(t.filterable)p.value=!1,(Q=d.value)===null||Q===void 0||Q.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Se}=l;Se==null||Se.blur()}else{const{value:Se}=c;Se==null||Se.blur()}}function rt(){var Q,se,Se;t.filterable?(p.value=!1,(Q=d.value)===null||Q===void 0||Q.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Se=c.value)===null||Se===void 0||Se.focus()}function Ce(){const{value:Q}=o;Q&&(T(),Q.focus())}function Yt(){const{value:Q}=o;Q&&Q.blur()}function Ie(Q){const{value:se}=h;se&&se.setTextContent(`+${Q}`)}function tn(){const{value:Q}=f;return Q}function nn(){return o.value}let Tt=null;function Ot(){Tt!==null&&window.clearTimeout(Tt)}function rn(){t.active||(Ot(),Tt=window.setTimeout(()=>{w.value&&(u.value=!0)},100))}function dt(){Ot()}function On(Q){Q||(Ot(),u.value=!1)}i.watch(w,Q=>{Q||(u.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const Q=d.value;Q&&(t.disabled?Q.removeAttribute("tabindex"):Q.tabIndex=p.value?-1:0)})}),Xh(a,t.onResize);const{inlineThemeDisabled:Le}=t,Be=i.computed(()=>{const{size:Q}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Se,borderRadius:sn,color:er,placeholderColor:Bi,textColor:tr,paddingSingle:Qn,paddingMultiple:Ti,caretColor:nr,colorDisabled:on,textColorDisabled:zn,placeholderColorDisabled:P,colorActive:W,boxShadowFocus:ee,boxShadowActive:ce,boxShadowHover:he,border:ye,borderFocus:we,borderHover:ve,borderActive:Ye,arrowColor:kn,arrowColorDisabled:Ca,loadingColor:Sa,colorActiveWarning:Ba,boxShadowFocusWarning:Ta,boxShadowActiveWarning:Ra,boxShadowHoverWarning:$a,borderWarning:Pa,borderFocusWarning:Ea,borderHoverWarning:Na,borderActiveWarning:Fa,colorActiveError:Aa,boxShadowFocusError:Ma,boxShadowActiveError:Va,boxShadowHoverError:Ia,borderError:Oa,borderFocusError:za,borderHoverError:La,borderActiveError:K2,clearColor:Z2,clearColorHover:Q2,clearColorPressed:J2,clearSize:eC,arrowSize:tC,[Ge("height",Q)]:nC,[Ge("fontSize",Q)]:iC}}=y.value,Ms=Zt(Qn),Vs=Zt(Ti);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Ye,"--n-border-focus":we,"--n-border-hover":ve,"--n-border-radius":sn,"--n-box-shadow-active":ce,"--n-box-shadow-focus":ee,"--n-box-shadow-hover":he,"--n-caret-color":nr,"--n-color":er,"--n-color-active":W,"--n-color-disabled":on,"--n-font-size":iC,"--n-height":nC,"--n-padding-single-top":Ms.top,"--n-padding-multiple-top":Vs.top,"--n-padding-single-right":Ms.right,"--n-padding-multiple-right":Vs.right,"--n-padding-single-left":Ms.left,"--n-padding-multiple-left":Vs.left,"--n-padding-single-bottom":Ms.bottom,"--n-padding-multiple-bottom":Vs.bottom,"--n-placeholder-color":Bi,"--n-placeholder-color-disabled":P,"--n-text-color":tr,"--n-text-color-disabled":zn,"--n-arrow-color":kn,"--n-arrow-color-disabled":Ca,"--n-loading-color":Sa,"--n-color-active-warning":Ba,"--n-box-shadow-focus-warning":Ta,"--n-box-shadow-active-warning":Ra,"--n-box-shadow-hover-warning":$a,"--n-border-warning":Pa,"--n-border-focus-warning":Ea,"--n-border-hover-warning":Na,"--n-border-active-warning":Fa,"--n-color-active-error":Aa,"--n-box-shadow-focus-error":Ma,"--n-box-shadow-active-error":Va,"--n-box-shadow-hover-error":Ia,"--n-border-error":Oa,"--n-border-focus-error":za,"--n-border-hover-error":La,"--n-border-active-error":K2,"--n-clear-size":eC,"--n-clear-color":Z2,"--n-clear-color-hover":Q2,"--n-clear-color-pressed":J2,"--n-arrow-size":tC,"--n-font-weight":Se}}),Xe=Le?xi("internal-selection",i.computed(()=>t.size[0]),Be,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:R,label:k,selected:w,showTagsPanel:u,isComposing:q,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:I,handleFocusin:L,handleClear:te,handleMouseEnter:ne,handleMouseLeave:A,handleDeleteOption:j,handlePatternKeyDown:N,handlePatternInputInput:Y,handlePatternInputBlur:ie,handlePatternInputFocus:oe,handleMouseEnterCounter:rn,handleMouseLeaveCounter:dt,handleFocusout:D,handleCompositionEnd:de,handleCompositionStart:re,onPopoverUpdateShow:On,focus:rt,focusInput:Ce,blur:Fe,blurInput:Yt,updateCounter:Ie,getCounter:tn,getTail:nn,renderLabel:t.renderLabel,cssVars:Le?void 0:Be,themeClass:Xe==null?void 0:Xe.themeClass,onRender:Xe==null?void 0:Xe.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",u=m||g,p=i.h(fa,null,{default:()=>i.h(av,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},h?h({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(_a,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(V,!0):Ji(V[y],V,!0)})),R=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),k=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,w=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(_a,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let C;if(g){const V=this.selectedOptions.length-o;V>0&&(C=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(_a,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const S=m?s?i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:R,counter:w,tail:()=>k}):i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:R,counter:w}):g&&C?R().concat(C):R(),T=u?()=>i.h("div",{class:`${l}-base-selection-popover`},m?R():this.selectedOptions.map(_)):void 0,B=u?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,M=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,E=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},S,m?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},S,p);b=i.h(i.Fragment,null,u?i.h(Qx,Object.assign({},B,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>E,default:T}):E,M)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,R=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Jh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),R?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Ji(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Jh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Ji(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function uv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const fv={name:"Select",common:vi,peers:{InternalSelection:ku,InternalSelectMenu:mu},self:uv},gv=le([me("select",`
|
|
813
|
+
`)])])]),uv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=wi(t),r=Tr("InternalSelection",n,e),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),m=i.ref(null),g=i.ref(null),u=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=pt("InternalSelection","-internal-selection",hv,ku,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),R=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Ji(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const Q=t.selectedOption;if(Q)return Q[t.labelField]}),w=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function C(){var Q;const{value:se}=s;if(se){const{value:Se}=o;Se&&(Se.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((Q=m.value)===null||Q===void 0||Q.sync({showAllItemsBeforeCalculate:!1})))}}function S(){const{value:Q}=g;Q&&(Q.style.display="none")}function T(){const{value:Q}=g;Q&&(Q.style.display="inline-block")}i.watch(i.toRef(t,"active"),Q=>{Q||S()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(C)});function B(Q){const{onFocus:se}=t;se&&se(Q)}function $(Q){const{onBlur:se}=t;se&&se(Q)}function M(Q){const{onDeleteOption:se}=t;se&&se(Q)}function E(Q){const{onClear:se}=t;se&&se(Q)}function V(Q){const{onPatternInput:se}=t;se&&se(Q)}function L(Q){var se;(!Q.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(Q.relatedTarget)))&&B(Q)}function D(Q){var se;!((se=a.value)===null||se===void 0)&&se.contains(Q.relatedTarget)||$(Q)}function te(Q){E(Q)}function ne(){b.value=!0}function A(){b.value=!1}function I(Q){!t.active||!t.filterable||Q.target!==o.value&&Q.preventDefault()}function j(Q){M(Q)}const q=i.ref(!1);function N(Q){if(Q.key==="Backspace"&&!q.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&j(se[se.length-1])}}let O=null;function Y(Q){const{value:se}=s;if(se){const Se=Q.target.value;se.textContent=Se,C()}t.ignoreComposition&&q.value?O=Q:V(Q)}function re(){q.value=!0}function de(){q.value=!1,t.ignoreComposition&&V(O),O=null}function oe(Q){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,Q)}function ie(Q){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,Q)}function Fe(){var Q,se;if(t.filterable)p.value=!1,(Q=d.value)===null||Q===void 0||Q.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Se}=l;Se==null||Se.blur()}else{const{value:Se}=c;Se==null||Se.blur()}}function rt(){var Q,se,Se;t.filterable?(p.value=!1,(Q=d.value)===null||Q===void 0||Q.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Se=c.value)===null||Se===void 0||Se.focus()}function Ce(){const{value:Q}=o;Q&&(T(),Q.focus())}function Yt(){const{value:Q}=o;Q&&Q.blur()}function Ie(Q){const{value:se}=h;se&&se.setTextContent(`+${Q}`)}function tn(){const{value:Q}=f;return Q}function nn(){return o.value}let Tt=null;function Ot(){Tt!==null&&window.clearTimeout(Tt)}function rn(){t.active||(Ot(),Tt=window.setTimeout(()=>{w.value&&(u.value=!0)},100))}function dt(){Ot()}function On(Q){Q||(Ot(),u.value=!1)}i.watch(w,Q=>{Q||(u.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const Q=d.value;Q&&(t.disabled?Q.removeAttribute("tabindex"):Q.tabIndex=p.value?-1:0)})}),Xh(a,t.onResize);const{inlineThemeDisabled:Le}=t,Be=i.computed(()=>{const{size:Q}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Se,borderRadius:sn,color:er,placeholderColor:Bi,textColor:tr,paddingSingle:Qn,paddingMultiple:Ti,caretColor:nr,colorDisabled:on,textColorDisabled:zn,placeholderColorDisabled:P,colorActive:W,boxShadowFocus:ee,boxShadowActive:ce,boxShadowHover:he,border:ye,borderFocus:we,borderHover:ve,borderActive:Ye,arrowColor:kn,arrowColorDisabled:Ca,loadingColor:Sa,colorActiveWarning:Ba,boxShadowFocusWarning:Ta,boxShadowActiveWarning:Ra,boxShadowHoverWarning:$a,borderWarning:Pa,borderFocusWarning:Ea,borderHoverWarning:Na,borderActiveWarning:Fa,colorActiveError:Aa,boxShadowFocusError:Ma,boxShadowActiveError:Va,boxShadowHoverError:Ia,borderError:Oa,borderFocusError:za,borderHoverError:La,borderActiveError:Z2,clearColor:Q2,clearColorHover:J2,clearColorPressed:eC,clearSize:tC,arrowSize:nC,[Ge("height",Q)]:iC,[Ge("fontSize",Q)]:rC}}=y.value,Ms=Zt(Qn),Vs=Zt(Ti);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Ye,"--n-border-focus":we,"--n-border-hover":ve,"--n-border-radius":sn,"--n-box-shadow-active":ce,"--n-box-shadow-focus":ee,"--n-box-shadow-hover":he,"--n-caret-color":nr,"--n-color":er,"--n-color-active":W,"--n-color-disabled":on,"--n-font-size":rC,"--n-height":iC,"--n-padding-single-top":Ms.top,"--n-padding-multiple-top":Vs.top,"--n-padding-single-right":Ms.right,"--n-padding-multiple-right":Vs.right,"--n-padding-single-left":Ms.left,"--n-padding-multiple-left":Vs.left,"--n-padding-single-bottom":Ms.bottom,"--n-padding-multiple-bottom":Vs.bottom,"--n-placeholder-color":Bi,"--n-placeholder-color-disabled":P,"--n-text-color":tr,"--n-text-color-disabled":zn,"--n-arrow-color":kn,"--n-arrow-color-disabled":Ca,"--n-loading-color":Sa,"--n-color-active-warning":Ba,"--n-box-shadow-focus-warning":Ta,"--n-box-shadow-active-warning":Ra,"--n-box-shadow-hover-warning":$a,"--n-border-warning":Pa,"--n-border-focus-warning":Ea,"--n-border-hover-warning":Na,"--n-border-active-warning":Fa,"--n-color-active-error":Aa,"--n-box-shadow-focus-error":Ma,"--n-box-shadow-active-error":Va,"--n-box-shadow-hover-error":Ia,"--n-border-error":Oa,"--n-border-focus-error":za,"--n-border-hover-error":La,"--n-border-active-error":Z2,"--n-clear-size":tC,"--n-clear-color":Q2,"--n-clear-color-hover":J2,"--n-clear-color-pressed":eC,"--n-arrow-size":nC,"--n-font-weight":Se}}),Xe=Le?xi("internal-selection",i.computed(()=>t.size[0]),Be,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:R,label:k,selected:w,showTagsPanel:u,isComposing:q,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:I,handleFocusin:L,handleClear:te,handleMouseEnter:ne,handleMouseLeave:A,handleDeleteOption:j,handlePatternKeyDown:N,handlePatternInputInput:Y,handlePatternInputBlur:ie,handlePatternInputFocus:oe,handleMouseEnterCounter:rn,handleMouseLeaveCounter:dt,handleFocusout:D,handleCompositionEnd:de,handleCompositionStart:re,onPopoverUpdateShow:On,focus:rt,focusInput:Ce,blur:Fe,blurInput:Yt,updateCounter:Ie,getCounter:tn,getTail:nn,renderLabel:t.renderLabel,cssVars:Le?void 0:Be,themeClass:Xe==null?void 0:Xe.themeClass,onRender:Xe==null?void 0:Xe.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",u=m||g,p=i.h(fa,null,{default:()=>i.h(lv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},h?h({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(_a,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(V,!0):Ji(V[y],V,!0)})),R=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),k=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,w=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(_a,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let C;if(g){const V=this.selectedOptions.length-o;V>0&&(C=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(_a,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const S=m?s?i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:R,counter:w,tail:()=>k}):i.h(Vh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:R,counter:w}):g&&C?R().concat(C):R(),T=u?()=>i.h("div",{class:`${l}-base-selection-popover`},m?R():this.selectedOptions.map(_)):void 0,B=u?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,M=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,E=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},S,m?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},S,p);b=i.h(i.Fragment,null,u?i.h(Jx,Object.assign({},B,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>E,default:T}):E,M)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,R=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Jh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),R?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Ji(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Jh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Ji(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function fv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const gv={name:"Select",common:vi,peers:{InternalSelection:ku,InternalSelectMenu:mu},self:fv},mv=le([me("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,5 +819,5 @@ ${s}
|
|
|
819
819
|
`),me("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[wu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Ns(t){return t.type==="group"}function Cu(t){return t.type==="ignored"}function wa(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function mv(t,e){return{getIsGroup:Ns,getIgnored:Cu,getKey(r){return Ns(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function pv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Ns(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Cu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function yv(t,e,n){const r=new Map;return t.forEach(s=>{Ns(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var bv={};const _v=Object.assign(Object.assign({},pt.props),{to:$n.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),wv=i.defineComponent({name:"Select",props:_v,slots:Object,setup(t){bv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&Kn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&Kn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=wi(t),o=pt("Select","-select",gv,fv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Uo(l,a),d=i.ref(!1),h=i.ref(""),f=Zd(t,["items","options"]),m=i.ref([]),g=i.ref([]),u=i.computed(()=>g.value.concat(m.value).concat(f.value)),p=i.computed(()=>{const{filter:P}=t;if(P)return P;const{labelField:W,valueField:ee}=t;return(ce,he)=>{if(!he)return!1;const ye=he[W];if(typeof ye=="string")return wa(ce,ye);const we=he[ee];return typeof we=="string"?wa(ce,we):typeof we=="number"?wa(ce,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return f.value;{const{value:P}=u,{value:W}=h;return!W.length||!t.filterable?P:pv(P,p.value,W,t.childrenField)}}),y=i.computed(()=>{const{valueField:P,childrenField:W}=t,ee=mv(P,W);return X_(b.value,ee)}),_=i.computed(()=>yv(u.value,t.valueField,t.childrenField)),R=i.ref(!1),k=Uo(i.toRef(t,"show"),R),w=i.ref(null),C=i.ref(null),S=i.ref(null),{localeRef:T}=su("Select"),B=i.computed(()=>{var P;return(P=t.placeholder)!==null&&P!==void 0?P:T.value.placeholder}),$=[],M=i.ref(new Map),E=i.computed(()=>{const{fallbackOption:P}=t;if(P===void 0){const{labelField:W,valueField:ee}=t;return ce=>({[W]:String(ce),[ee]:ce})}return P===!1?!1:W=>Object.assign(P(W),{value:W})});function V(P){const W=t.remote,{value:ee}=M,{value:ce}=_,{value:he}=E,ye=[];return P.forEach(we=>{if(ce.has(we))ye.push(ce.get(we));else if(W&&ee.has(we))ye.push(ee.get(we));else if(he){const ve=he(we);ve&&ye.push(ve)}}),ye}const L=i.computed(()=>{if(t.multiple){const{value:P}=c;return Array.isArray(P)?V(P):[]}return null}),D=i.computed(()=>{const{value:P}=c;return!t.multiple&&!Array.isArray(P)?P===null?null:V([P])[0]||null:null}),te=Sw(t),{mergedSizeRef:ne,mergedDisabledRef:A,mergedStatusRef:I}=te;function j(P,W){const{onChange:ee,"onUpdate:value":ce,onUpdateValue:he}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=te;ee&&mt(ee,P,W),he&&mt(he,P,W),ce&&mt(ce,P,W),a.value=P,ye(),we()}function q(P){const{onBlur:W}=t,{nTriggerFormBlur:ee}=te;W&&mt(W,P),ee()}function N(){const{onClear:P}=t;P&&mt(P)}function O(P){const{onFocus:W,showOnFocus:ee}=t,{nTriggerFormFocus:ce}=te;W&&mt(W,P),ce(),ee&&ie()}function Y(P){const{onSearch:W}=t;W&&mt(W,P)}function re(P){const{onScroll:W}=t;W&&mt(W,P)}function de(){var P;const{remote:W,multiple:ee}=t;if(W){const{value:ce}=M;if(ee){const{valueField:he}=t;(P=L.value)===null||P===void 0||P.forEach(ye=>{ce.set(ye[he],ye)})}else{const he=D.value;he&&ce.set(he[t.valueField],he)}}}function oe(P){const{onUpdateShow:W,"onUpdate:show":ee}=t;W&&mt(W,P),ee&&mt(ee,P),R.value=P}function ie(){A.value||(oe(!0),R.value=!0,t.filterable&&Qn())}function Fe(){oe(!1)}function rt(){h.value="",g.value=$}const Ce=i.ref(!1);function Yt(){t.filterable&&(Ce.value=!0)}function Ie(){t.filterable&&(Ce.value=!1,k.value||rt())}function tn(){A.value||(k.value?t.filterable?Qn():Fe():ie())}function nn(P){var W,ee;!((ee=(W=S.value)===null||W===void 0?void 0:W.selfRef)===null||ee===void 0)&&ee.contains(P.relatedTarget)||(d.value=!1,q(P),Fe())}function Tt(P){O(P),d.value=!0}function Ot(){d.value=!0}function rn(P){var W;!((W=w.value)===null||W===void 0)&&W.$el.contains(P.relatedTarget)||(d.value=!1,q(P),Fe())}function dt(){var P;(P=w.value)===null||P===void 0||P.focus(),Fe()}function On(P){var W;k.value&&(!((W=w.value)===null||W===void 0)&&W.$el.contains(pr(P))||Fe())}function Le(P){if(!Array.isArray(P))return[];if(E.value)return Array.from(P);{const{remote:W}=t,{value:ee}=_;if(W){const{value:ce}=M;return P.filter(he=>ee.has(he)||ce.has(he))}else return P.filter(ce=>ee.has(ce))}}function Be(P){Xe(P.rawNode)}function Xe(P){if(A.value)return;const{tag:W,remote:ee,clearFilterAfterSelect:ce,valueField:he}=t;if(W&&!ee){const{value:ye}=g,we=ye[0]||null;if(we){const ve=m.value;ve.length?ve.push(we):m.value=[we],g.value=$}}if(ee&&M.value.set(P[he],P),t.multiple){const ye=Le(c.value),we=ye.findIndex(ve=>ve===P[he]);if(~we){if(ye.splice(we,1),W&&!ee){const ve=Q(P[he]);~ve&&(m.value.splice(ve,1),ce&&(h.value=""))}}else ye.push(P[he]),ce&&(h.value="");j(ye,V(ye))}else{if(W&&!ee){const ye=Q(P[he]);~ye?m.value=[m.value[ye]]:m.value=$}tr(),Fe(),j(P[he],P)}}function Q(P){return m.value.findIndex(ee=>ee[t.valueField]===P)}function se(P){k.value||ie();const{value:W}=P.target;h.value=W;const{tag:ee,remote:ce}=t;if(Y(W),ee&&!ce){if(!W){g.value=$;return}const{onCreate:he}=t,ye=he?he(W):{[t.labelField]:W,[t.valueField]:W},{valueField:we,labelField:ve}=t;f.value.some(Ye=>Ye[we]===ye[we]||Ye[ve]===ye[ve])||m.value.some(Ye=>Ye[we]===ye[we]||Ye[ve]===ye[ve])?g.value=$:g.value=[ye]}}function Se(P){P.stopPropagation();const{multiple:W}=t;!W&&t.filterable&&Fe(),N(),W?j([],[]):j(null,null)}function sn(P){!mr(P,"action")&&!mr(P,"empty")&&!mr(P,"header")&&P.preventDefault()}function er(P){re(P)}function Bi(P){var W,ee,ce,he,ye;if(!t.keyboard){P.preventDefault();return}switch(P.key){case" ":if(t.filterable)break;P.preventDefault();case"Enter":if(!(!((W=w.value)===null||W===void 0)&&W.isComposing)){if(k.value){const we=(ee=S.value)===null||ee===void 0?void 0:ee.getPendingTmNode();we?Be(we):t.filterable||(Fe(),tr())}else if(ie(),t.tag&&Ce.value){const we=g.value[0];if(we){const ve=we[t.valueField],{value:Ye}=c;t.multiple&&Array.isArray(Ye)&&Ye.includes(ve)||Xe(we)}}}P.preventDefault();break;case"ArrowUp":if(P.preventDefault(),t.loading)return;k.value&&((ce=S.value)===null||ce===void 0||ce.prev());break;case"ArrowDown":if(P.preventDefault(),t.loading)return;k.value?(he=S.value)===null||he===void 0||he.next():ie();break;case"Escape":k.value&&(xw(P),Fe()),(ye=w.value)===null||ye===void 0||ye.focus();break}}function tr(){var P;(P=w.value)===null||P===void 0||P.focus()}function Qn(){var P;(P=w.value)===null||P===void 0||P.focusInput()}function Ti(){var P;k.value&&((P=C.value)===null||P===void 0||P.syncPosition())}de(),i.watch(i.toRef(t,"options"),de);const nr={focus:()=>{var P;(P=w.value)===null||P===void 0||P.focus()},focusInput:()=>{var P;(P=w.value)===null||P===void 0||P.focusInput()},blur:()=>{var P;(P=w.value)===null||P===void 0||P.blur()},blurInput:()=>{var P;(P=w.value)===null||P===void 0||P.blurInput()}},on=i.computed(()=>{const{self:{menuBoxShadow:P}}=o.value;return{"--n-menu-box-shadow":P}}),zn=s?xi("select",void 0,on,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:I,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:_s(),triggerRef:w,menuRef:S,pattern:h,uncontrolledShow:R,mergedShow:k,adjustedTo:$n(t),uncontrolledValue:a,mergedValue:c,followerRef:C,localizedPlaceholder:B,selectedOption:D,selectedOptions:L,mergedSize:ne,mergedDisabled:A,focused:d,activeWithoutMenuOpen:Ce,inlineThemeDisabled:s,onTriggerInputFocus:Yt,onTriggerInputBlur:Ie,handleTriggerOrMenuResize:Ti,handleMenuFocus:Ot,handleMenuBlur:rn,handleMenuTabOut:dt,handleTriggerClick:tn,handleToggle:Be,handleDeleteOption:Xe,handlePatternInput:se,handleClear:Se,handleTriggerBlur:nn,handleTriggerFocus:Tt,handleKeydown:Bi,handleMenuAfterLeave:rt,handleMenuClickOutside:On,handleMenuScroll:er,handleMenuKeydown:Bi,handleMenuMousedown:sn,mergedTheme:o,cssVars:s?void 0:on,themeClass:zn==null?void 0:zn.themeClass,onRender:zn==null?void 0:zn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(th,null,{default:()=>[i.h(nh,null,{default:()=>i.h(hv,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(yh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===$n.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Lx,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[bs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[bs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),xv={},Su=i.defineComponent({...xv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Z.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(R=>{if(F.isEmpty(R))return;const k=o.value?r.value:r.value?[r.value]:[],w=R.filter(C=>!k.some(S=>S.id===C.id));l.value=r.optionsListConverter([...k,...w])}).finally(()=>{d.value=!1}))};let m="";const g=F.debounce(()=>f(m),800),u=_=>{m=_,g()},p=_=>{var R;if(F.isArray(_)){const k=_.length>0?_.map(w=>{var C;return i.toRaw((C=l.value.find(S=>S.value===w))==null?void 0:C.item)}):[];s("update:value",k)}else if(_>0){const k=i.toRaw((R=l.value.find(w=>w.value===_))==null?void 0:R.item);s("update:value",k)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,R)=>(i.openBlock(),i.createBlock(i.unref(wv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:u,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),vv={},Bu=i.defineComponent({...vv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Z.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?Z.HttpRequester.getInstance(Z.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?Z.HttpRequester.getInstance(Z.ProductDataProvider).publicSimpleSearch(f):new Promise(m=>{m([])}),l=f=>r.searchType==="categories"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(f,m)=>{if(r.renderLabel)return r.renderLabel(f,m);if(r.searchType==="products"){const g=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=f.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,m)=>(i.openBlock(),i.createBlock(Su,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),kv={class:"col-span-2 flex flex-row gap-2.5"},Cv={class:"flex-1"},Sv={class:"text-sc-grey"},Bv={class:"ml-2.5"},Tv={key:0,class:"flex-none"},Rv={},$v=i.defineComponent({...Rv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Z.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(F.isArray(f)?f:[f]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(m=>m.id===f.id?f:i.toRaw(m)),l())},h=f=>{a.value=a.value.filter(m=>m.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,m)=>{const g=z.NListItem,u=r_,p=z.NButton,b=z.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Bu,{value:s.value,"onUpdate:value":[m[0]||(m[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(g,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(y)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",kv,[i.createElementVNode("span",Cv,[i.createElementVNode("span",Sv,i.toDisplayString(y.code),1),i.createElementVNode("span",Bv,i.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Tv,[i.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Pv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ev(t,e){return i.openBlock(),i.createElementBlock("svg",Pv,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const Nv=i.markRaw({name:"tabler-truck-filled",render:Ev}),Fv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Av(t,e){return i.openBlock(),i.createElementBlock("svg",Fv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const Mv=i.markRaw({name:"tabler-truck-delivery",render:Av}),Vv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iv(t,e){return i.openBlock(),i.createElementBlock("svg",Vv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const Ov=i.markRaw({name:"tabler-truck-loading",render:Iv}),zv={class:"flex flex-col gap-1"},Lv={key:0,class:"flex flex-row gap-1 text-base"},Dv={key:1,class:"text-sc-dark-grey text-sm"},Hv={class:"text-sc-grey mr-1.5"},Wv={key:0},jv={key:1},qv={key:2},Xv={},Fs=i.defineComponent({...Xv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=Z.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Ln.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,f,m,g,u,p,b;const a=Ov,l=Mv,c=Nv;return i.openBlock(),i.createElementBlock("div",zv,[t.showType?(i.openBlock(),i.createElementBlock("span",Lv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Dv,[i.createElementVNode("span",Hv,i.toDisplayString(n.value),1),(u=(g=t.delivery)==null?void 0:g.address)!=null&&u.address?(i.openBlock(),i.createElementBlock("span",Wv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",jv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",qv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Yv={class:"flex flex-col gap-2.5"},Uv={class:"text-base"},Gv=["href"],Kv={class:"text-sc-grey"},Zv={},Tu=i.defineComponent({...Zv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ze.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ze.Status)?(c=(l=Z.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Ze.CreatedAt)),o=i.computed(()=>e.fields.includes(Ze.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ze.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Yv,[i.createElementVNode("span",Uv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Gv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Oo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Kv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(us,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Fs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Qv={},Ru=i.defineComponent({...Qv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Z.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Jv={class:"flex flex-row gap-1.5"},ek={class:"flex-none text-nowrap"},tk={class:"flex flex-1 flex-col"},nk={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},ik={key:0},rk={key:1},sk={},$u=i.defineComponent({...sk,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Jv,[i.createElementVNode("span",ek,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",tk,[i.createVNode(ar,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",nk,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",ik,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",rk,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),ok={},ak=i.defineComponent({...ok,__name:"order-items-list",props:{order:{}},setup(t){const e=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(ar,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(wt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h($u,{product:o,index:a})}];case Ue.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Pu=ri(ak,[["__scopeId","data-v-b15b9b70"]]),lk={class:"text-base"},ck={},xa=i.defineComponent({...ck,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",lk,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),dk={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},hk={class:"col-span-2"},uk={class:"col-span-2"},fk={class:"btn btn-primary",href:"{{ invoice }}"},gk={},Eu=i.defineComponent({...gk,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",dk,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(xa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(us,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Nd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",hk,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ru,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Fs,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",uk,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(xa,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",fk," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),mk={key:0},pk={class:"text-sc-dark-grey my-2 text-center"},yk={key:1,class:"text-sc-dark-grey my-2 text-center"},bk={key:2},_k={class:"text-sc-dark-grey mt-4 text-right font-bold"},wk={class:"text-sc-primary"},xk={},Nu=i.defineComponent({...xk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new Z.Order(e.order)),s=()=>{n.value=!0,Z.HttpRequester.getInstance(Z.OrdersDataProvider).getOrder(e.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",mk,[i.createElementVNode("div",pk,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",yk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",bk,[i.createVNode(Pu,{order:r.value},null,8,["order"]),i.createElementVNode("div",_k,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",wk,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Eu,{order:r.value},null,8,["order"])]))}}}),vk={},kk=i.defineComponent({...vk,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Z.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ze.CreatedAt,Ze.Id,Ze.DeliveryInfo,Ze.Status,Ze.SalesDirections,Ze.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:F.constant(!0),renderExpand:R=>i.h(Nu,{order:R,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ze.CreatedAt,resizable:!0,minWidth:100,render:R=>i.h(Oo,{date:R.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ze.Id,resizable:!0,minWidth:70,render:R=>i.h("a",{href:e.orderUrl.replace(":id",R.id.toString()),target:"_blank",class:"text-base"},R.id)},{title:"Клиент",key:Ze.ClientInfo,resizable:!0,render:R=>i.h(us,{client:R.client})},{title:"Тип доставки",key:Ze.DeliveryInfo,resizable:!0,render:R=>i.h(Fs,{delivery:R.delivery})},{title:"Статус",key:Ze.Status,resizable:!0,minWidth:90,render:R=>{var k,w;return i.h("span",{class:"text-base"},[((w=(k=a.value)==null?void 0:k.find(C=>C.id===(R.status??-1)))==null?void 0:w.name)??""])}},{title:"Напр. продаж",key:Ze.SalesDirections,resizable:!0,minWidth:70,render:R=>i.h("span",{class:"text-base"},[R.salesDirection.name])},{title:"Закреплено за",key:Ze.AttachedUser,resizable:!0,render:R=>{var k;return i.h("span",{class:"text-base"},[(k=R==null?void 0:R.attachedUser)==null?void 0:k.name])}}];switch(wt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:R=>i.h(Tu,{order:R,fields:p,orderUrl:e.orderUrl})}];case Ue.laptop:return[y,...p.map(R=>_.find(k=>k.key===R)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new Z.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,Z.HttpRequester.getInstance(Z.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},f=p=>{d.value.page=p,h()},m=p=>{d.value.pageSize=p,h()},g=p=>{F.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},u=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{u(),window.addEventListener("resize",u),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",u)}),(p,b)=>{const y=z.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":f,"onUpdate:pageSize":m,"onUpdate:sorter":g},null,8,["columns","data","row-key","pagination","loading"])}}}),Ck=ri(kk,[["__scopeId","data-v-7c4554f4"]]),Sk=["href"],Bk={class:"text-sc-dark-grey"},Tk={},Rk=i.defineComponent({...Tk,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Ln.format(n.order.createdAt,Z.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{F.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,Sk),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",Bk,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),$k={class:"sc-page flex flex-col"},Pk={class:"my-2 flex flex-row items-end"},Ek={class:"sc-title grow"},Nk={key:0,class:"sc-title-buttons flex-1 grow-0"},Fk={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Ak={key:0,class:"sc-title-extra mt-2 sm:mt-4"},Mk={},Fu=i.defineComponent({...Mk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",$k,[i.createElementVNode("div",Pk,[i.createElementVNode("div",Ek,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",Nk,[i.createElementVNode("div",Fk,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Ak,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Vk={class:"overflow-hidden transition-all duration-300"},Ik={class:"text-lg font-medium leading-none"},Ok={},Au=i.defineComponent({...Ok,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(wt.getDeviceTypeByResolution()){case Ue.phone:return window.innerWidth*.66;case Ue.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?F.isUndefined(n.drawerWidth)?s.value=a():s.value=F.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=z.NDrawerContent,f=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Vk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=m=>o.value=m),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",Ik,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),zk={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},Lk={key:0},Dk={class:"sc-page-preview-panel grow"},Hk={key:1,class:"sc-page-preview-panel-extra flex-none"},Wk={},jk=i.defineComponent({...Wk,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Fu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",zk,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Lk,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",Dk,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Hk,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Au,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),qk={},Xk=i.defineComponent({...qk,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=i.computed(()=>{var u;return F.isArray(r.value)?r.value.map(p=>p.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{const u=new Z.Curator({id:-1,name:"",contacts:{},curatedDirection:new Z.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[u]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new Z.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,u=>{const p=F.some(o.value?r.value:[r.value],["id",u.id])?` (${u.curatedDirection.name}) `:"";return u.curatedDirection.isNewRec()?u.name:`${u.name}${p}`})),d=i.computed(()=>c.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),h=i.useTemplateRef("select-component"),f=u=>{if(F.isArray(u)){const p=u.length>0?u.map(b=>l.value.find(y=>y.id===b)).filter(b=>!F.isNil(b)):[];s("update:value",p)}else{const p=u>0?l.value.find(b=>b.id===u):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var u,p;(p=(u=h.value)==null?void 0:u.$forceUpdate)==null||p.call(u)},{deep:!0}),e({focus:()=>{var u;return(u=h.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blurInput()}}),(u,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Yk={},Uk=i.defineComponent({...Yk,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=i.computed(()=>{var g;return F.isArray(r.value)?r.value.map(u=>u.id):((g=r.value)==null?void 0:g.id)??null}),l=i.computed(()=>{var p;let g=r.showEmptyValue?[Z.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,u=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=F.isArray(r.value)?r.value.map(y=>y.id):[(p=r.value)==null?void 0:p.id];u=F.union(u,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),g=r.managerReferenceList.filter(y=>y.isActive||b.includes(y.id))}return Ft.convertReferencesToSelectOptionsList(g,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const y=!r.groupBySalesDirection||r.groupBySalesDirection&&F.some(o.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${y}${b.isActive?"":" [Не активен]"}`},b=>u.includes(b.id)&&b.isActive)}),c=i.computed(()=>l.value.map(g=>({...g,class:r.wrapContent?`${g.class} consistent-menu-width`:g.class}))),d=i.useTemplateRef("select-component"),h=g=>{if(F.isArray(g)){const u=g.length>0?g.filter(p=>!F.some(r.disabledManagerReferenceList,["id",p])).map(p=>r.managerReferenceList.find(b=>b.id===p)).filter(p=>!F.isNil(p)):[];s("update:value",u)}else{const u=g>0&&!F.some(r.disabledManagerReferenceList,["id",g])?r.managerReferenceList.find(p=>p.id===g):new Z.Manager;s("update:value",u??new Z.Manager)}};return i.watch(()=>r.value,()=>{var g,u;(u=(g=d.value)==null?void 0:g.$forceUpdate)==null||u.call(g)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,g=>{if(g.length>0&&r.value)if(o.value){const u=r.value;F.some(u,p=>F.some(g,["id",p.id]))&&s("update:value",u.filter(p=>!F.some(g,["id",p.id])))}else{const u=r.value;F.some(g,["id",u.id])&&s("update:value",new Z.Manager)}}),e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focusInput()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blurInput()}}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:l.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Gk={class:"m-0.5 flex flex-col p-0.5"},Kk={class:"flex flex-row gap-1"},Zk={key:0},Qk={key:1},Jk={key:2},e2={key:3},t2={class:"flex flex-row gap-1"},n2={key:0},i2={key:1},r2={key:2},s2={key:3},o2={},Mu=i.defineComponent({...o2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Gk,[i.createElementVNode("span",Kk,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",Zk,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",Qk,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",Jk,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",e2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",t2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",n2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",i2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",r2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",s2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),va={clearable:!1,value:"",field:void 0,disabled:!1},a2={},l2=i.defineComponent({...a2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...va,minTermLength:()=>{var t,e;return((e=(t=Z.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=F.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Mu,{addr:y,selected:b},{default:F.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function u(){g.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),c2={class:"m-0.5 flex flex-col p-0.5"},d2={class:"font-medium"},h2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},u2={key:0},f2={key:1},g2={},Vu=i.defineComponent({...g2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",c2,[i.createElementVNode("span",d2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",h2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",u2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",f2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),m2={},p2=i.defineComponent({...m2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...va,minTermLength:()=>{var t,e;return((e=(t=Z.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=F.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Vu,{bank:y,selected:b},{default:F.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function u(){g.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),y2={class:"font-medium"},b2={key:0,class:"flex flex-row gap-2"},_2={key:0,class:"text-xs font-light text-blue-800"},w2={key:1,class:"text-sc-dark-grey text-xs font-light"},x2={},Iu=i.defineComponent({...x2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",y2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",b2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",_2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",w2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),v2={},k2=i.defineComponent({...v2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...va,minTermLength:()=>{var t,e;return((e=(t=Z.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const h=F.debounce(()=>f(),800),f=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(R=>R.id===b.value)||{};return i.h(Iu,{org:_,selected:y},{default:F.constant("-")})},g=b=>{h.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},u=i.ref(null);function p(){u.value.focus()}return e({focus:p}),(b,y)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[y[0]||(y[0]=R=>o.value=R),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),C2={},S2=i.defineComponent({...C2,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=z.NButton,h=z.NPopover,f=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=m=>s.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),B2={key:0,class:"whitespace-pre-line"},T2={key:1,class:"text-sc-dark-grey"},R2={},$2=i.defineComponent({...R2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=z.NInput;return i.openBlock(),i.createBlock(Id,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",T2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),P2={},E2=i.defineComponent({...P2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),N2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function F2(t,e){return i.openBlock(),i.createElementBlock("svg",N2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const A2=i.markRaw({name:"ion-warning",render:F2}),M2={},V2=i.defineComponent({...M2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=A2,s=z.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),_t=class _t{static init(e,n){_t.messagesService&&_t.notificationsService||(_t.messagesService=e,_t.notificationsService=n)}static getMessagesService(){if(!_t.messagesService)throw new Error("UI provider is not initialized.");return _t.messagesService}static getNotificationsService(){if(!_t.notificationsService)throw new Error("UI provider is not initialized.");return _t.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(F.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";_t.notificationsService?_t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Z.FieldValidationResultData(e.errors[o].toString(),"error"):_t.messagesService?_t.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};v(_t,"messagesService"),v(_t,"notificationsService");let ka=_t;const I2=i.computed(()=>Z.useReferencesStore().deliveryTypeReference??[]),O2=i.computed(()=>Z.useReferencesStore().managersList??[]),z2=i.computed(()=>Z.useReferencesStore().opfReference??[]),L2=i.computed(()=>Z.useReferencesStore().partnerGroupsReference??[]),D2=i.computed(()=>Z.useReferencesStore().priceCoefficientsReference??[]),H2=i.computed(()=>Z.useReferencesStore().productFilesTypesReference??[]),W2=i.computed(()=>Z.useReferencesStore().resourceTypesReference),j2=i.computed(()=>Z.useReferencesStore().salesDirectionsReference??[]),q2=i.computed(()=>Z.useReferencesStore().warehousesReference??[]),X2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(Z.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),Y2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(Z.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),U2=t=>Z.HttpRequester.getInstance(Z.ReferenceDataProvider).searchCity(t),G2=t=>Ft.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());H.AddProductToCartDialog=o0,H.ConfiguratorSettingsKozyrek=pd,H.ConfiguratorSettingsMosquito=fb,H.ContentHelper=ni,H.KozyrekLine=pn,H.KozyrekTailTemplate=Vo,H.KozyrekTemplate=Xi,H.OrdersTableFields=Ze,H.Point=Mo,H.ScAddressSuggestion=l2,H.ScAddressSuggestionLabel=Mu,H.ScBankSuggestion=p2,H.ScBankSuggestionLabel=Vu,H.ScBaseDialog=Ed,H.ScButtonWithConfirmAction=S2,H.ScCategoryCollapse=$d,H.ScClientNameWithShortInfo=us,H.ScCollapse=Rd,H.ScCollapseItem=Ua,H.ScCommentEditor=$2,H.ScConfiguratorsProductInfo=lr,H.ScContragentWithShortInfo=Nd,H.ScCuratorSelect=Xk,H.ScDateRange=bb,H.ScDateTimeLabel=Oo,H.ScDebouncedInput=qb,H.ScDebouncedInputNumber=Yi,H.ScDebt=E2,H.ScDialogHeader=Bb,H.ScDynamicConfigurator=Td,H.ScEmail=v0,H.ScExternalLink=t_,H.ScImageGallery=Qa,H.ScInlineEditableItem=Id,H.ScInlineView=zo,H.ScKozyrekConfigurator=yd,H.ScKozyrekConfiguratorParamsForm=tl,H.ScKozyrekConfiguratorPreview=md,H.ScKozyrekConfiguratorTemplates=gd,H.ScLightGallery=Za,H.ScManagerSelect=Uk,H.ScMetalForDoorsConfigurator=Bd,H.ScMetalForDoorsConfiguratorForm=Sd,H.ScMosquitoConfigurator=wd,H.ScMosquitoConfiguratorForm=bd,H.ScMosquitoConfiguratorMeasurementInstructions=_d,H.ScMosquitoConfiguratorPreview=Io,H.ScOrderCommonInfo=Tu,H.ScOrderDeliveryLabel=Fs,H.ScOrderDetails=Eu,H.ScOrderInfo=Nu,H.ScOrderItemsList=Pu,H.ScOrderPayment=Ru,H.ScOrderProductInfo=$u,H.ScOrdersList=Ck,H.ScOrgSuggestion=k2,H.ScOrgSuggestionLabel=Iu,H.ScPage=Fu,H.ScPageWithSlidingPanel=jk,H.ScPersonContactsBlock=ub,H.ScPhone=X0,H.ScPhoneInput=Ub,H.ScProductName=ar,H.ScProductsList=$v,H.ScReferenceSelect=Pd,H.ScSearchableProductSelect=Bu,H.ScSearchableReferenceSelect=Su,H.ScSetClientPriceFormItem=e0,H.ScShortTextOrderInfo=Rk,H.ScSingleFileUploadSelector=Eb,H.ScSlidingContentWithDrawer=Au,H.ScStripConfigurator=Cd,H.ScStripConfiguratorForm=vd,H.ScStripConfiguratorLineItem=xd,H.ScStripConfiguratorPreview=kd,H.ScUserShortInfo=xa,H.ScWarningIcon=V2,H.SelectOptionHelper=Ft,H.UiNotificationProvider=ka,H.WindowResolutionEnum=Ue,H.WindowResolutionProvider=wt,H.channelPrimaryInterestOptionsList=X2,H.componentSizeInjectionKey=Mr,H.deliveryTypeReferenceList=I2,H.handleFloatInput=ln,H.handleIntegerInput=ii,H.managersReferenceList=O2,H.naiveUiTheme=$f,H.opfReferenceList=z2,H.parse=Ut,H.partnerGroupReferenceList=L2,H.priceCoefficientsReferenceList=D2,H.productFilesTypesReferenceList=H2,H.renderConfig=Oe,H.resetInputValidation=Ke,H.resourceReferencesList=W2,H.salesDirectionsReferenceList=j2,H.searchCityReferenceDataHandler=U2,H.searchCityReferenceLabelRenderer=G2,H.sourcePrimaryInterestOptionsList=Y2,H.warehousesReferenceList=q2,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[wu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Ns(t){return t.type==="group"}function Cu(t){return t.type==="ignored"}function wa(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function pv(t,e){return{getIsGroup:Ns,getIgnored:Cu,getKey(r){return Ns(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function yv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Ns(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Cu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function bv(t,e,n){const r=new Map;return t.forEach(s=>{Ns(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var _v={};const wv=Object.assign(Object.assign({},pt.props),{to:$n.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),xv=i.defineComponent({name:"Select",props:wv,slots:Object,setup(t){_v.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&Kn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&Kn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=wi(t),o=pt("Select","-select",mv,gv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Uo(l,a),d=i.ref(!1),h=i.ref(""),f=Zd(t,["items","options"]),m=i.ref([]),g=i.ref([]),u=i.computed(()=>g.value.concat(m.value).concat(f.value)),p=i.computed(()=>{const{filter:P}=t;if(P)return P;const{labelField:W,valueField:ee}=t;return(ce,he)=>{if(!he)return!1;const ye=he[W];if(typeof ye=="string")return wa(ce,ye);const we=he[ee];return typeof we=="string"?wa(ce,we):typeof we=="number"?wa(ce,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return f.value;{const{value:P}=u,{value:W}=h;return!W.length||!t.filterable?P:yv(P,p.value,W,t.childrenField)}}),y=i.computed(()=>{const{valueField:P,childrenField:W}=t,ee=pv(P,W);return Y_(b.value,ee)}),_=i.computed(()=>bv(u.value,t.valueField,t.childrenField)),R=i.ref(!1),k=Uo(i.toRef(t,"show"),R),w=i.ref(null),C=i.ref(null),S=i.ref(null),{localeRef:T}=su("Select"),B=i.computed(()=>{var P;return(P=t.placeholder)!==null&&P!==void 0?P:T.value.placeholder}),$=[],M=i.ref(new Map),E=i.computed(()=>{const{fallbackOption:P}=t;if(P===void 0){const{labelField:W,valueField:ee}=t;return ce=>({[W]:String(ce),[ee]:ce})}return P===!1?!1:W=>Object.assign(P(W),{value:W})});function V(P){const W=t.remote,{value:ee}=M,{value:ce}=_,{value:he}=E,ye=[];return P.forEach(we=>{if(ce.has(we))ye.push(ce.get(we));else if(W&&ee.has(we))ye.push(ee.get(we));else if(he){const ve=he(we);ve&&ye.push(ve)}}),ye}const L=i.computed(()=>{if(t.multiple){const{value:P}=c;return Array.isArray(P)?V(P):[]}return null}),D=i.computed(()=>{const{value:P}=c;return!t.multiple&&!Array.isArray(P)?P===null?null:V([P])[0]||null:null}),te=Bw(t),{mergedSizeRef:ne,mergedDisabledRef:A,mergedStatusRef:I}=te;function j(P,W){const{onChange:ee,"onUpdate:value":ce,onUpdateValue:he}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=te;ee&&mt(ee,P,W),he&&mt(he,P,W),ce&&mt(ce,P,W),a.value=P,ye(),we()}function q(P){const{onBlur:W}=t,{nTriggerFormBlur:ee}=te;W&&mt(W,P),ee()}function N(){const{onClear:P}=t;P&&mt(P)}function O(P){const{onFocus:W,showOnFocus:ee}=t,{nTriggerFormFocus:ce}=te;W&&mt(W,P),ce(),ee&&ie()}function Y(P){const{onSearch:W}=t;W&&mt(W,P)}function re(P){const{onScroll:W}=t;W&&mt(W,P)}function de(){var P;const{remote:W,multiple:ee}=t;if(W){const{value:ce}=M;if(ee){const{valueField:he}=t;(P=L.value)===null||P===void 0||P.forEach(ye=>{ce.set(ye[he],ye)})}else{const he=D.value;he&&ce.set(he[t.valueField],he)}}}function oe(P){const{onUpdateShow:W,"onUpdate:show":ee}=t;W&&mt(W,P),ee&&mt(ee,P),R.value=P}function ie(){A.value||(oe(!0),R.value=!0,t.filterable&&Qn())}function Fe(){oe(!1)}function rt(){h.value="",g.value=$}const Ce=i.ref(!1);function Yt(){t.filterable&&(Ce.value=!0)}function Ie(){t.filterable&&(Ce.value=!1,k.value||rt())}function tn(){A.value||(k.value?t.filterable?Qn():Fe():ie())}function nn(P){var W,ee;!((ee=(W=S.value)===null||W===void 0?void 0:W.selfRef)===null||ee===void 0)&&ee.contains(P.relatedTarget)||(d.value=!1,q(P),Fe())}function Tt(P){O(P),d.value=!0}function Ot(){d.value=!0}function rn(P){var W;!((W=w.value)===null||W===void 0)&&W.$el.contains(P.relatedTarget)||(d.value=!1,q(P),Fe())}function dt(){var P;(P=w.value)===null||P===void 0||P.focus(),Fe()}function On(P){var W;k.value&&(!((W=w.value)===null||W===void 0)&&W.$el.contains(pr(P))||Fe())}function Le(P){if(!Array.isArray(P))return[];if(E.value)return Array.from(P);{const{remote:W}=t,{value:ee}=_;if(W){const{value:ce}=M;return P.filter(he=>ee.has(he)||ce.has(he))}else return P.filter(ce=>ee.has(ce))}}function Be(P){Xe(P.rawNode)}function Xe(P){if(A.value)return;const{tag:W,remote:ee,clearFilterAfterSelect:ce,valueField:he}=t;if(W&&!ee){const{value:ye}=g,we=ye[0]||null;if(we){const ve=m.value;ve.length?ve.push(we):m.value=[we],g.value=$}}if(ee&&M.value.set(P[he],P),t.multiple){const ye=Le(c.value),we=ye.findIndex(ve=>ve===P[he]);if(~we){if(ye.splice(we,1),W&&!ee){const ve=Q(P[he]);~ve&&(m.value.splice(ve,1),ce&&(h.value=""))}}else ye.push(P[he]),ce&&(h.value="");j(ye,V(ye))}else{if(W&&!ee){const ye=Q(P[he]);~ye?m.value=[m.value[ye]]:m.value=$}tr(),Fe(),j(P[he],P)}}function Q(P){return m.value.findIndex(ee=>ee[t.valueField]===P)}function se(P){k.value||ie();const{value:W}=P.target;h.value=W;const{tag:ee,remote:ce}=t;if(Y(W),ee&&!ce){if(!W){g.value=$;return}const{onCreate:he}=t,ye=he?he(W):{[t.labelField]:W,[t.valueField]:W},{valueField:we,labelField:ve}=t;f.value.some(Ye=>Ye[we]===ye[we]||Ye[ve]===ye[ve])||m.value.some(Ye=>Ye[we]===ye[we]||Ye[ve]===ye[ve])?g.value=$:g.value=[ye]}}function Se(P){P.stopPropagation();const{multiple:W}=t;!W&&t.filterable&&Fe(),N(),W?j([],[]):j(null,null)}function sn(P){!mr(P,"action")&&!mr(P,"empty")&&!mr(P,"header")&&P.preventDefault()}function er(P){re(P)}function Bi(P){var W,ee,ce,he,ye;if(!t.keyboard){P.preventDefault();return}switch(P.key){case" ":if(t.filterable)break;P.preventDefault();case"Enter":if(!(!((W=w.value)===null||W===void 0)&&W.isComposing)){if(k.value){const we=(ee=S.value)===null||ee===void 0?void 0:ee.getPendingTmNode();we?Be(we):t.filterable||(Fe(),tr())}else if(ie(),t.tag&&Ce.value){const we=g.value[0];if(we){const ve=we[t.valueField],{value:Ye}=c;t.multiple&&Array.isArray(Ye)&&Ye.includes(ve)||Xe(we)}}}P.preventDefault();break;case"ArrowUp":if(P.preventDefault(),t.loading)return;k.value&&((ce=S.value)===null||ce===void 0||ce.prev());break;case"ArrowDown":if(P.preventDefault(),t.loading)return;k.value?(he=S.value)===null||he===void 0||he.next():ie();break;case"Escape":k.value&&(vw(P),Fe()),(ye=w.value)===null||ye===void 0||ye.focus();break}}function tr(){var P;(P=w.value)===null||P===void 0||P.focus()}function Qn(){var P;(P=w.value)===null||P===void 0||P.focusInput()}function Ti(){var P;k.value&&((P=C.value)===null||P===void 0||P.syncPosition())}de(),i.watch(i.toRef(t,"options"),de);const nr={focus:()=>{var P;(P=w.value)===null||P===void 0||P.focus()},focusInput:()=>{var P;(P=w.value)===null||P===void 0||P.focusInput()},blur:()=>{var P;(P=w.value)===null||P===void 0||P.blur()},blurInput:()=>{var P;(P=w.value)===null||P===void 0||P.blurInput()}},on=i.computed(()=>{const{self:{menuBoxShadow:P}}=o.value;return{"--n-menu-box-shadow":P}}),zn=s?xi("select",void 0,on,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:I,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:_s(),triggerRef:w,menuRef:S,pattern:h,uncontrolledShow:R,mergedShow:k,adjustedTo:$n(t),uncontrolledValue:a,mergedValue:c,followerRef:C,localizedPlaceholder:B,selectedOption:D,selectedOptions:L,mergedSize:ne,mergedDisabled:A,focused:d,activeWithoutMenuOpen:Ce,inlineThemeDisabled:s,onTriggerInputFocus:Yt,onTriggerInputBlur:Ie,handleTriggerOrMenuResize:Ti,handleMenuFocus:Ot,handleMenuBlur:rn,handleMenuTabOut:dt,handleTriggerClick:tn,handleToggle:Be,handleDeleteOption:Xe,handlePatternInput:se,handleClear:Se,handleTriggerBlur:nn,handleTriggerFocus:Tt,handleKeydown:Bi,handleMenuAfterLeave:rt,handleMenuClickOutside:On,handleMenuScroll:er,handleMenuKeydown:Bi,handleMenuMousedown:sn,mergedTheme:o,cssVars:s?void 0:on,themeClass:zn==null?void 0:zn.themeClass,onRender:zn==null?void 0:zn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(th,null,{default:()=>[i.h(nh,null,{default:()=>i.h(uv,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(yh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===$n.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Dx,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[bs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[bs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),vv={},Su=i.defineComponent({...vv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=K.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(R=>{if(F.isEmpty(R))return;const k=o.value?r.value:r.value?[r.value]:[],w=R.filter(C=>!k.some(S=>S.id===C.id));l.value=r.optionsListConverter([...k,...w])}).finally(()=>{d.value=!1}))};let m="";const g=F.debounce(()=>f(m),800),u=_=>{m=_,g()},p=_=>{var R;if(F.isArray(_)){const k=_.length>0?_.map(w=>{var C;return i.toRaw((C=l.value.find(S=>S.value===w))==null?void 0:C.item)}):[];s("update:value",k)}else if(_>0){const k=i.toRaw((R=l.value.find(w=>w.value===_))==null?void 0:R.item);s("update:value",k)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,R)=>(i.openBlock(),i.createBlock(i.unref(xv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:u,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),kv={},Bu=i.defineComponent({...kv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=K.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?K.HttpRequester.getInstance(K.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?K.HttpRequester.getInstance(K.ProductDataProvider).publicSimpleSearch(f):new Promise(m=>{m([])}),l=f=>r.searchType==="categories"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Ft.convertReferencesToSelectOptionsList(f,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(f,m)=>{if(r.renderLabel)return r.renderLabel(f,m);if(r.searchType==="products"){const g=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=f.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,m)=>(i.openBlock(),i.createBlock(Su,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Cv={class:"col-span-2 flex flex-row gap-2.5"},Sv={class:"flex-1"},Bv={class:"text-sc-grey"},Tv={class:"ml-2.5"},Rv={key:0,class:"flex-none"},$v={},Pv=i.defineComponent({...$v,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=K.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(F.isArray(f)?f:[f]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(m=>m.id===f.id?f:i.toRaw(m)),l())},h=f=>{a.value=a.value.filter(m=>m.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,m)=>{const g=z.NListItem,u=s_,p=z.NButton,b=z.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Bu,{value:s.value,"onUpdate:value":[m[0]||(m[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(g,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(y)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Cv,[i.createElementVNode("span",Sv,[i.createElementVNode("span",Bv,i.toDisplayString(y.code),1),i.createElementVNode("span",Tv,i.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Rv,[i.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Ev={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Nv(t,e){return i.openBlock(),i.createElementBlock("svg",Ev,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const Fv=i.markRaw({name:"tabler-truck-filled",render:Nv}),Av={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mv(t,e){return i.openBlock(),i.createElementBlock("svg",Av,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const Vv=i.markRaw({name:"tabler-truck-delivery",render:Mv}),Iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ov(t,e){return i.openBlock(),i.createElementBlock("svg",Iv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const zv=i.markRaw({name:"tabler-truck-loading",render:Ov}),Lv={class:"flex flex-col gap-1"},Dv={key:0,class:"flex flex-row gap-1 text-base"},Hv={key:1,class:"text-sc-dark-grey text-sm"},Wv={class:"text-sc-grey mr-1.5"},jv={key:0},qv={key:1},Xv={key:2},Yv={},Fs=i.defineComponent({...Yv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=K.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Ln.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,f,m,g,u,p,b;const a=zv,l=Vv,c=Fv;return i.openBlock(),i.createElementBlock("div",Lv,[t.showType?(i.openBlock(),i.createElementBlock("span",Dv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Hv,[i.createElementVNode("span",Wv,i.toDisplayString(n.value),1),(u=(g=t.delivery)==null?void 0:g.address)!=null&&u.address?(i.openBlock(),i.createElementBlock("span",jv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",qv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Xv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Uv={class:"flex flex-col gap-2.5"},Gv={class:"text-base"},Kv=["href"],Zv={class:"text-sc-grey"},Qv={},Tu=i.defineComponent({...Qv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ze.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ze.Status)?(c=(l=K.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Ze.CreatedAt)),o=i.computed(()=>e.fields.includes(Ze.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ze.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Uv,[i.createElementVNode("span",Gv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Kv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Oo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Zv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(us,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Fs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Jv={},Ru=i.defineComponent({...Jv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=K.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),ek={class:"flex flex-row gap-1.5"},tk={class:"flex-none text-nowrap"},nk={class:"flex flex-1 flex-col"},ik={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},rk={key:0},sk={key:1},ok={},$u=i.defineComponent({...ok,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",ek,[i.createElementVNode("span",tk,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",nk,[i.createVNode(ar,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",ik,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",rk,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",sk,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),ak={},lk=i.defineComponent({...ak,__name:"order-items-list",props:{order:{}},setup(t){const e=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(ar,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(wt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h($u,{product:o,index:a})}];case Ue.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Pu=ri(lk,[["__scopeId","data-v-b15b9b70"]]),ck={class:"text-base"},dk={},xa=i.defineComponent({...dk,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",ck,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),hk={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},uk={class:"col-span-2"},fk={class:"col-span-2"},gk={class:"btn btn-primary",href:"{{ invoice }}"},mk={},Eu=i.defineComponent({...mk,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",hk,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(xa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(us,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Nd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",uk,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ru,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Fs,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",fk,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(xa,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",gk," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),pk={key:0},yk={class:"text-sc-dark-grey my-2 text-center"},bk={key:1,class:"text-sc-dark-grey my-2 text-center"},_k={key:2},wk={class:"text-sc-dark-grey mt-4 text-right font-bold"},xk={class:"text-sc-primary"},vk={},Nu=i.defineComponent({...vk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new K.Order(e.order)),s=()=>{n.value=!0,K.HttpRequester.getInstance(K.OrdersDataProvider).getOrder(e.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",pk,[i.createElementVNode("div",yk,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",bk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",_k,[i.createVNode(Pu,{order:r.value},null,8,["order"]),i.createElementVNode("div",wk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",xk,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Eu,{order:r.value},null,8,["order"])]))}}}),kk={},Ck=i.defineComponent({...kk,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>K.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ze.CreatedAt,Ze.Id,Ze.DeliveryInfo,Ze.Status,Ze.SalesDirections,Ze.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:F.constant(!0),renderExpand:R=>i.h(Nu,{order:R,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ze.CreatedAt,resizable:!0,minWidth:100,render:R=>i.h(Oo,{date:R.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ze.Id,resizable:!0,minWidth:70,render:R=>i.h("a",{href:e.orderUrl.replace(":id",R.id.toString()),target:"_blank",class:"text-base"},R.id)},{title:"Клиент",key:Ze.ClientInfo,resizable:!0,render:R=>i.h(us,{client:R.client})},{title:"Тип доставки",key:Ze.DeliveryInfo,resizable:!0,render:R=>i.h(Fs,{delivery:R.delivery})},{title:"Статус",key:Ze.Status,resizable:!0,minWidth:90,render:R=>{var k,w;return i.h("span",{class:"text-base"},[((w=(k=a.value)==null?void 0:k.find(C=>C.id===(R.status??-1)))==null?void 0:w.name)??""])}},{title:"Напр. продаж",key:Ze.SalesDirections,resizable:!0,minWidth:70,render:R=>i.h("span",{class:"text-base"},[R.salesDirection.name])},{title:"Закреплено за",key:Ze.AttachedUser,resizable:!0,render:R=>{var k;return i.h("span",{class:"text-base"},[(k=R==null?void 0:R.attachedUser)==null?void 0:k.name])}}];switch(wt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:R=>i.h(Tu,{order:R,fields:p,orderUrl:e.orderUrl})}];case Ue.laptop:return[y,...p.map(R=>_.find(k=>k.key===R)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new K.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,K.HttpRequester.getInstance(K.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},f=p=>{d.value.page=p,h()},m=p=>{d.value.pageSize=p,h()},g=p=>{F.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},u=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{u(),window.addEventListener("resize",u),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",u)}),(p,b)=>{const y=z.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":f,"onUpdate:pageSize":m,"onUpdate:sorter":g},null,8,["columns","data","row-key","pagination","loading"])}}}),Sk=ri(Ck,[["__scopeId","data-v-7c4554f4"]]),Bk=["href"],Tk={class:"text-sc-dark-grey"},Rk={},$k=i.defineComponent({...Rk,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Ln.format(n.order.createdAt,K.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{F.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,Bk),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",Tk,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),Pk={class:"sc-page flex flex-col"},Ek={class:"my-2 flex flex-row items-end"},Nk={class:"sc-title grow"},Fk={key:0,class:"sc-title-buttons flex-1 grow-0"},Ak={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Mk={key:0,class:"sc-title-extra mt-2 sm:mt-4"},Vk={},Fu=i.defineComponent({...Vk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",Pk,[i.createElementVNode("div",Ek,[i.createElementVNode("div",Nk,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",Fk,[i.createElementVNode("div",Ak,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Mk,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Ik={class:"overflow-hidden transition-all duration-300"},Ok={class:"text-lg font-medium leading-none"},zk={},Au=i.defineComponent({...zk,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(wt.getDeviceTypeByResolution()){case Ue.phone:return window.innerWidth*.66;case Ue.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?F.isUndefined(n.drawerWidth)?s.value=a():s.value=F.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=z.NDrawerContent,f=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Ik,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=m=>o.value=m),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",Ok,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),Lk={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},Dk={key:0},Hk={class:"sc-page-preview-panel grow"},Wk={key:1,class:"sc-page-preview-panel-extra flex-none"},jk={},qk=i.defineComponent({...jk,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Fu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Lk,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Dk,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",Hk,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Wk,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Au,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),Xk={},Yk=i.defineComponent({...Xk,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=i.computed(()=>{var u;return F.isArray(r.value)?r.value.map(p=>p.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{const u=new K.Curator({id:-1,name:"",contacts:{},curatedDirection:new K.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[u]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new K.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,u=>{const p=F.some(o.value?r.value:[r.value],["id",u.id])?` (${u.curatedDirection.name}) `:"";return u.curatedDirection.isNewRec()?u.name:`${u.name}${p}`})),d=i.computed(()=>c.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),h=i.useTemplateRef("select-component"),f=u=>{if(F.isArray(u)){const p=u.length>0?u.map(b=>l.value.find(y=>y.id===b)).filter(b=>!F.isNil(b)):[];s("update:value",p)}else{const p=u>0?l.value.find(b=>b.id===u):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var u,p;(p=(u=h.value)==null?void 0:u.$forceUpdate)==null||p.call(u)},{deep:!0}),e({focus:()=>{var u;return(u=h.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blurInput()}}),(u,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Uk={},Gk=i.defineComponent({...Uk,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>F.isArray(r.value)),a=i.computed(()=>{var g;return F.isArray(r.value)?r.value.map(u=>u.id):((g=r.value)==null?void 0:g.id)??null}),l=i.computed(()=>{var p;let g=r.showEmptyValue?[K.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,u=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=F.isArray(r.value)?r.value.map(y=>y.id):[(p=r.value)==null?void 0:p.id];u=F.union(u,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),g=r.managerReferenceList.filter(y=>y.isActive||b.includes(y.id))}return Ft.convertReferencesToSelectOptionsList(g,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const y=!r.groupBySalesDirection||r.groupBySalesDirection&&F.some(o.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${y}${b.isActive?"":" [Не активен]"}`},b=>u.includes(b.id)&&b.isActive)}),c=i.computed(()=>l.value.map(g=>({...g,class:r.wrapContent?`${g.class} consistent-menu-width`:g.class}))),d=i.useTemplateRef("select-component"),h=g=>{if(F.isArray(g)){const u=g.length>0?g.filter(p=>!F.some(r.disabledManagerReferenceList,["id",p])).map(p=>r.managerReferenceList.find(b=>b.id===p)).filter(p=>!F.isNil(p)):[];s("update:value",u)}else{const u=g>0&&!F.some(r.disabledManagerReferenceList,["id",g])?r.managerReferenceList.find(p=>p.id===g):new K.Manager;s("update:value",u??new K.Manager)}};return i.watch(()=>r.value,()=>{var g,u;(u=(g=d.value)==null?void 0:g.$forceUpdate)==null||u.call(g)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,g=>{if(g.length>0&&r.value)if(o.value){const u=r.value;F.some(u,p=>F.some(g,["id",p.id]))&&s("update:value",u.filter(p=>!F.some(g,["id",p.id])))}else{const u=r.value;F.some(g,["id",u.id])&&s("update:value",new K.Manager)}}),e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focusInput()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blurInput()}}),(g,u)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:l.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Kk={class:"m-0.5 flex flex-col p-0.5"},Zk={class:"flex flex-row gap-1"},Qk={key:0},Jk={key:1},e2={key:2},t2={key:3},n2={class:"flex flex-row gap-1"},i2={key:0},r2={key:1},s2={key:2},o2={key:3},a2={},Mu=i.defineComponent({...a2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Kk,[i.createElementVNode("span",Zk,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",Qk,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",Jk,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",e2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",t2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",n2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",i2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",r2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",s2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",o2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),va={clearable:!1,value:"",field:void 0,disabled:!1},l2={},c2=i.defineComponent({...l2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...va,minTermLength:()=>{var t,e;return((e=(t=K.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=F.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):K.HttpRequester.getInstance(K.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Mu,{addr:y,selected:b},{default:F.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function u(){g.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),d2={class:"m-0.5 flex flex-col p-0.5"},h2={class:"font-medium"},u2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},f2={key:0},g2={key:1},m2={},Vu=i.defineComponent({...m2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",d2,[i.createElementVNode("span",h2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",u2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",f2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",g2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),p2={},y2=i.defineComponent({...p2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...va,minTermLength:()=>{var t,e;return((e=(t=K.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=F.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await K.HttpRequester.getInstance(K.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},f=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Vu,{bank:y,selected:b},{default:F.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function u(){g.value.focus()}return e({focus:u}),(p,b)=>{const y=z.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),b2={class:"font-medium"},_2={key:0,class:"flex flex-row gap-2"},w2={key:0,class:"text-xs font-light text-blue-800"},x2={key:1,class:"text-sc-dark-grey text-xs font-light"},v2={},Iu=i.defineComponent({...v2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",b2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",_2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",w2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",x2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),k2={},C2=i.defineComponent({...k2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...va,minTermLength:()=>{var t,e;return((e=(t=K.AppConfigProvider.getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Ft.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const h=F.debounce(()=>f(),800),f=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await K.HttpRequester.getInstance(K.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(R=>R.id===b.value)||{};return i.h(Iu,{org:_,selected:y},{default:F.constant("-")})},g=b=>{h.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},u=i.ref(null);function p(){u.value.focus()}return e({focus:p}),(b,y)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[y[0]||(y[0]=R=>o.value=R),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),S2={},B2=i.defineComponent({...S2,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=z.NButton,h=z.NPopover,f=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=m=>s.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),T2={key:0,class:"whitespace-pre-line"},R2={key:1,class:"text-sc-dark-grey"},$2={},P2=i.defineComponent({...$2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=z.NInput;return i.openBlock(),i.createBlock(Id,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",R2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),E2={},N2=i.defineComponent({...E2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),F2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function A2(t,e){return i.openBlock(),i.createElementBlock("svg",F2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const M2=i.markRaw({name:"ion-warning",render:A2}),V2={},I2=i.defineComponent({...V2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=M2,s=z.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),_t=class _t{static init(e,n){_t.messagesService&&_t.notificationsService||(_t.messagesService=e,_t.notificationsService=n)}static getMessagesService(){if(!_t.messagesService)throw new Error("UI provider is not initialized.");return _t.messagesService}static getNotificationsService(){if(!_t.notificationsService)throw new Error("UI provider is not initialized.");return _t.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(F.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";_t.notificationsService?_t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new K.FieldValidationResultData(e.errors[o].toString(),"error"):_t.messagesService?_t.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};v(_t,"messagesService"),v(_t,"notificationsService");let ka=_t;const O2=i.computed(()=>K.useReferencesStore().deliveryTypeReference??[]),z2=i.computed(()=>K.useReferencesStore().managersList??[]),L2=i.computed(()=>K.useReferencesStore().opfReference??[]),D2=i.computed(()=>K.useReferencesStore().partnerGroupsReference??[]),H2=i.computed(()=>K.useReferencesStore().priceCoefficientsReference??[]),W2=i.computed(()=>K.useReferencesStore().productFilesTypesReference??[]),j2=i.computed(()=>K.useReferencesStore().resourceTypesReference),q2=i.computed(()=>K.useReferencesStore().salesDirectionsReference??[]),X2=i.computed(()=>K.useReferencesStore().warehousesReference??[]),Y2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(K.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),U2=i.computed(()=>Ft.convertReferencesToSelectOptionsList(K.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),G2=t=>K.HttpRequester.getInstance(K.ReferenceDataProvider).searchCity(t),K2=t=>Ft.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());H.AddProductToCartDialog=a0,H.ConfiguratorSettingsKozyrek=pd,H.ConfiguratorSettingsMosquito=gb,H.ContentHelper=ni,H.KozyrekLine=pn,H.KozyrekTailTemplate=Vo,H.KozyrekTemplate=Xi,H.OrdersTableFields=Ze,H.Point=Mo,H.ScAddressSuggestion=c2,H.ScAddressSuggestionLabel=Mu,H.ScBankSuggestion=y2,H.ScBankSuggestionLabel=Vu,H.ScBaseDialog=Ed,H.ScButtonWithConfirmAction=B2,H.ScCategoryCollapse=$d,H.ScClientNameWithShortInfo=us,H.ScCollapse=Rd,H.ScCollapseItem=Ua,H.ScCommentEditor=P2,H.ScConfiguratorsProductInfo=lr,H.ScContragentWithShortInfo=Nd,H.ScCuratorSelect=Yk,H.ScDateRange=_b,H.ScDateTimeLabel=Oo,H.ScDebouncedInput=Xb,H.ScDebouncedInputNumber=Yi,H.ScDebt=N2,H.ScDialogHeader=Tb,H.ScDynamicConfigurator=Td,H.ScEmail=k0,H.ScExternalLink=n_,H.ScImageGallery=Qa,H.ScInlineEditableItem=Id,H.ScInlineView=zo,H.ScKozyrekConfigurator=yd,H.ScKozyrekConfiguratorParamsForm=tl,H.ScKozyrekConfiguratorPreview=md,H.ScKozyrekConfiguratorTemplates=gd,H.ScLightGallery=Za,H.ScManagerSelect=Gk,H.ScMetalForDoorsConfigurator=Bd,H.ScMetalForDoorsConfiguratorForm=Sd,H.ScMosquitoConfigurator=wd,H.ScMosquitoConfiguratorForm=bd,H.ScMosquitoConfiguratorMeasurementInstructions=_d,H.ScMosquitoConfiguratorPreview=Io,H.ScOrderCommonInfo=Tu,H.ScOrderDeliveryLabel=Fs,H.ScOrderDetails=Eu,H.ScOrderInfo=Nu,H.ScOrderItemsList=Pu,H.ScOrderPayment=Ru,H.ScOrderProductInfo=$u,H.ScOrdersList=Sk,H.ScOrgSuggestion=C2,H.ScOrgSuggestionLabel=Iu,H.ScPage=Fu,H.ScPageWithSlidingPanel=qk,H.ScPersonContactsBlock=fb,H.ScPhone=Y0,H.ScPhoneInput=Gb,H.ScProductName=ar,H.ScProductsList=Pv,H.ScReferenceSelect=Pd,H.ScSearchableProductSelect=Bu,H.ScSearchableReferenceSelect=Su,H.ScSetClientPriceFormItem=t0,H.ScShortTextOrderInfo=$k,H.ScSingleFileUploadSelector=Nb,H.ScSlidingContentWithDrawer=Au,H.ScStripConfigurator=Cd,H.ScStripConfiguratorForm=vd,H.ScStripConfiguratorLineItem=xd,H.ScStripConfiguratorPreview=kd,H.ScUserShortInfo=xa,H.ScWarningIcon=I2,H.SelectOptionHelper=Ft,H.UiNotificationProvider=ka,H.WindowResolutionEnum=Ue,H.WindowResolutionProvider=wt,H.channelPrimaryInterestOptionsList=Y2,H.componentSizeInjectionKey=Mr,H.deliveryTypeReferenceList=O2,H.handleFloatInput=ln,H.handleIntegerInput=ii,H.managersReferenceList=z2,H.naiveUiTheme=$f,H.opfReferenceList=L2,H.parse=Ut,H.partnerGroupReferenceList=D2,H.priceCoefficientsReferenceList=H2,H.productFilesTypesReferenceList=W2,H.renderConfig=Oe,H.resetInputValidation=Ke,H.resourceReferencesList=j2,H.salesDirectionsReferenceList=q2,H.searchCityReferenceDataHandler=G2,H.searchCityReferenceLabelRenderer=K2,H.sourcePrimaryInterestOptionsList=U2,H.warehousesReferenceList=X2,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
|
|
823
823
|
//# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map
|