@snabcentr/vue-ui-lib 3.59.6 → 3.59.7
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 +139 -137
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +6 -6
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(H,V){typeof exports=="object"&&typeof module<"u"?V(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"],V):(H=typeof globalThis<"u"?globalThis:H||self,V(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,V,i,O,U,Tn,sr,zs,Uh){"use strict";var J2=Object.defineProperty;var jh=H=>{throw TypeError(H)};var eS=(H,V,i)=>V in H?J2(H,V,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[V]=i;var S=(H,V,i)=>eS(H,typeof V!="symbol"?V+"":V,i),qh=(H,V,i)=>V.has(H)||jh("Cannot "+i);var Nt=(H,V,i)=>(qh(H,V,"read from private field"),i?i.call(H):V.get(H)),Xa=(H,V,i)=>V.has(H)?jh("Cannot add the same private member more than once"):V instanceof WeakSet?V.add(H):V.set(H,i),Xh=(H,V,i,O)=>(qh(H,V,"write to private field"),O?O.call(H,i):V.set(H,i),i);var Bi,dt,Ms;var Ne=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Ne||{}),Ze=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ze||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&V.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const lt=(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()}},Ls=(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()},xt=t=>t?Number.parseFloat(t.replace(",",".")):null,ze=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Pt{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(V.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=V.isString(r.key)?V.get(d,r.key):r.key(c),h=V.isString(r.label)?V.get(d,r.label):r.label(c);return{type:"group",label:V.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Pt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Pt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Kh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gh(t,e){return i.openBlock(),i.createElementBlock("svg",Kh,[...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 Ds=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Gh}),Zh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qh(t,e){return i.openBlock(),i.createElementBlock("svg",Zh,[...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 Ua=i.markRaw({name:"tabler-edit",render:Qh}),Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Jh,[...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 Ka=i.markRaw({name:"ion-checkmark-done-circle",render:ef}),tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function nf(t,e){return i.openBlock(),i.createElementBlock("svg",tf,[...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 Ga=i.markRaw({name:"ion-checkmark-done-circle-outline",render:nf}),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:"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 of=i.markRaw({name:"fluent-pin32-regular",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:"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 cf=i.markRaw({name:"ion-eye-outline",render:lf}),df={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function uf(t,e){return i.openBlock(),i.createElementBlock("svg",df,[...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 hf=i.markRaw({name:"fluent-pin32-filled",render:uf}),ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const gf=i.markRaw({name:"ion-bookmark-outline",render:mf}),pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...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 bf=i.markRaw({name:"ion-eye-off-sharp",render:yf}),_f={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...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 xf=i.markRaw({name:"ion-chevron-forward-outline",render:wf}),kf=["data-name"],vf={class:"sc-collapse-item-header flex flex-row gap-2.5"},Cf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Sf={key:0},Bf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Tf={class:"flex flex-1 flex-col"},Rf={key:0,class:"sc-collapse-item-sub-title flex-1"},$f={key:1,class:"sc-collapse-item-title-extra flex-none"},Nf={key:0,class:"sc-collapse-item-content"},Pf={},Ef=i.defineComponent({...Pf,__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",V.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=V.some(a,p=>p===r.name),d=i.computed(()=>V.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,s("header:click",r.name,u.value),o(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,s("header:click",r.name,u.value),o(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,s("header:click",r.name,u.value),o(r.name,u.value))},expanded:i.readonly(u)}),(p,b)=>{const y=xf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",vf,[i.createElementVNode("div",Cf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Sf,[i.createElementVNode("div",Bf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Tf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Rf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",$f,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Nf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,kf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Za=Wn(Ef,[["__scopeId","data-v-f1311d1c"]]),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...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 Qa=i.markRaw({name:"ion-cart-outline",render:Af}),or=Symbol(),Mf={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"}},Vf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},If={},Ja=i.defineComponent({...If,__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(or,"medium"),r=i.computed(()=>V.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>V.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>V.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>V.isNil(e.productContextButtonsConfig)?[]:V.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})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var T;const g=Ga,f=Ka,p=O.NButton,b=O.NTooltip,y=Ua,_=Qa,B=Ds,C=O.NDropdown;return i.openBlock(),i.createElementBlock("div",Vf,[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(f,{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),((T=a.value)==null?void 0:T.length)>0?(i.openBlock(),i.createBlock(C,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Of={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(t,e){return i.openBlock(),i.createElementBlock("svg",Of,[...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 Lf=i.markRaw({name:"tabler-history",render:zf}),Df={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(t,e){return i.openBlock(),i.createElementBlock("svg",Df,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const Wf=i.markRaw({name:"mdi-percent-outline",render:Hf}),jf={class:"flex flex-row gap-1"},qf={key:0,class:"flex gap-1"},Xf={key:0,class:"flex text-nowrap text-sm line-through"},Yf={key:1,class:"flex flex-row text-nowrap text-sm"},Uf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Kf={},jn=i.defineComponent({...Kf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var b;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>V.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),o=i.computed(()=>{const y=V.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return s.value||!y||V.isNil(l.value)||V.isNil(y.cost)?!1:l.value<y.cost}),a=((b=U.useBaseConfigStateStore().getConfig())==null?void 0:b.defaultCurrency)??"RUB",l=i.computed(()=>s.value?s.value.cost:V.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?V.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?Tn.format(r.value.costDate,U.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(V.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!V.isNil(l.value)),m=i.computed(()=>V.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const y=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*y)}),f=i.computed(()=>V.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const y=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(y)});return(y,_)=>{var x;const B=O.NTag,C=O.NTooltip,T=Wf,$=Lf;return i.openBlock(),i.createElementBlock("div",jf,[t.showTag?(i.openBlock(),i.createBlock(C,{key:0},{trigger:i.withCtx(()=>[i.createVNode(B,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!s.value}])},{default:i.withCtx(()=>{var v;return[i.createTextVNode(i.toDisplayString(((v=s.value)==null?void 0:v.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var v;return[i.createTextVNode(" "+i.toDisplayString(((v=s.value)==null?void 0:v.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":o.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",qf,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",Xf,i.toDisplayString(f.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":o.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(x=s.value)==null?void 0:x.readOnly,"font-bold":!s.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var v;h.value&&((v=t.eventEmitter)==null||v.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(m.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!s.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(C,{key:0},{trigger:i.withCtx(()=>[i.createVNode(T,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",Yf," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(V.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",Uf,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(C,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode($,{class:"cursor-pointer",onClick:_[1]||(_[1]=v=>{var w;return(w=t.eventEmitter)==null?void 0:w.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),Gf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...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 Hs=i.markRaw({name:"ion-information-circle-outline",render:Zf}),Qf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jf(t,e){return i.openBlock(),i.createElementBlock("svg",Qf,[...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 el=i.markRaw({name:"ion-images",render:Jf}),em={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const nm=i.markRaw({name:"ion-bookmark",render:tm});/*!
|
|
1
|
+
(function(H,V){typeof exports=="object"&&typeof module<"u"?V(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"],V):(H=typeof globalThis<"u"?globalThis:H||self,V(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,V,i,O,U,Tn,sr,zs,Uh){"use strict";var J2=Object.defineProperty;var jh=H=>{throw TypeError(H)};var eS=(H,V,i)=>V in H?J2(H,V,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[V]=i;var S=(H,V,i)=>eS(H,typeof V!="symbol"?V+"":V,i),qh=(H,V,i)=>V.has(H)||jh("Cannot "+i);var Nt=(H,V,i)=>(qh(H,V,"read from private field"),i?i.call(H):V.get(H)),Xa=(H,V,i)=>V.has(H)?jh("Cannot add the same private member more than once"):V instanceof WeakSet?V.add(H):V.set(H,i),Xh=(H,V,i,O)=>(qh(H,V,"write to private field"),O?O.call(H,i):V.set(H,i),i);var Bi,dt,Ms;var Re=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Re||{}),Ze=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ze||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&V.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const lt=(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()}},Ls=(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()},xt=t=>t?Number.parseFloat(t.replace(",",".")):null,ze=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Pt{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(V.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=V.isString(r.key)?V.get(d,r.key):r.key(c),h=V.isString(r.label)?V.get(d,r.label):r.label(c);return{type:"group",label:V.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Pt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Pt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Kh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gh(t,e){return i.openBlock(),i.createElementBlock("svg",Kh,[...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 Ds=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Gh}),Zh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qh(t,e){return i.openBlock(),i.createElementBlock("svg",Zh,[...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 Ua=i.markRaw({name:"tabler-edit",render:Qh}),Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Jh,[...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 Ka=i.markRaw({name:"ion-checkmark-done-circle",render:ef}),tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function nf(t,e){return i.openBlock(),i.createElementBlock("svg",tf,[...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 Ga=i.markRaw({name:"ion-checkmark-done-circle-outline",render:nf}),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:"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 of=i.markRaw({name:"fluent-pin32-regular",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:"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 cf=i.markRaw({name:"ion-eye-outline",render:lf}),df={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function uf(t,e){return i.openBlock(),i.createElementBlock("svg",df,[...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 hf=i.markRaw({name:"fluent-pin32-filled",render:uf}),ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const gf=i.markRaw({name:"ion-bookmark-outline",render:mf}),pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...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 bf=i.markRaw({name:"ion-eye-off-sharp",render:yf}),_f={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...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 xf=i.markRaw({name:"ion-chevron-forward-outline",render:wf}),kf=["data-name"],vf={class:"sc-collapse-item-header flex flex-row gap-2.5"},Cf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Sf={key:0},Bf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Tf={class:"flex flex-1 flex-col"},Rf={key:0,class:"sc-collapse-item-sub-title flex-1"},$f={key:1,class:"sc-collapse-item-title-extra flex-none"},Nf={key:0,class:"sc-collapse-item-content"},Pf={},Ef=i.defineComponent({...Pf,__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",V.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=V.some(a,p=>p===r.name),d=i.computed(()=>V.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,s("header:click",r.name,u.value),o(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,s("header:click",r.name,u.value),o(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,s("header:click",r.name,u.value),o(r.name,u.value))},expanded:i.readonly(u)}),(p,b)=>{const y=xf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",vf,[i.createElementVNode("div",Cf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Sf,[i.createElementVNode("div",Bf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Tf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Rf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",$f,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Nf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,kf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Za=Wn(Ef,[["__scopeId","data-v-f1311d1c"]]),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...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 Qa=i.markRaw({name:"ion-cart-outline",render:Af}),or=Symbol(),Mf={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"}},Vf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},If={},Ja=i.defineComponent({...If,__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(or,"medium"),r=i.computed(()=>V.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>V.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>V.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>V.isNil(e.productContextButtonsConfig)?[]:V.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})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var T;const g=Ga,f=Ka,p=O.NButton,b=O.NTooltip,y=Ua,_=Qa,B=Ds,C=O.NDropdown;return i.openBlock(),i.createElementBlock("div",Vf,[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(f,{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),((T=a.value)==null?void 0:T.length)>0?(i.openBlock(),i.createBlock(C,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Of={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(t,e){return i.openBlock(),i.createElementBlock("svg",Of,[...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 Lf=i.markRaw({name:"tabler-history",render:zf}),Df={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(t,e){return i.openBlock(),i.createElementBlock("svg",Df,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const Wf=i.markRaw({name:"mdi-percent-outline",render:Hf}),jf={class:"flex flex-row gap-1"},qf={key:0,class:"flex gap-1"},Xf={key:0,class:"flex text-nowrap text-sm line-through"},Yf={key:1,class:"flex flex-row text-nowrap text-sm"},Uf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Kf={},jn=i.defineComponent({...Kf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var b;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>V.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),o=i.computed(()=>{const y=V.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return s.value||!y||V.isNil(l.value)||V.isNil(y.cost)?!1:l.value<y.cost}),a=((b=U.useBaseConfigStateStore().getConfig())==null?void 0:b.defaultCurrency)??"RUB",l=i.computed(()=>s.value?s.value.cost:V.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?V.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?Tn.format(r.value.costDate,U.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(V.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!V.isNil(l.value)),m=i.computed(()=>V.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const y=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*y)}),f=i.computed(()=>V.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const y=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(y)});return(y,_)=>{var x;const B=O.NTag,C=O.NTooltip,T=Wf,$=Lf;return i.openBlock(),i.createElementBlock("div",jf,[t.showTag?(i.openBlock(),i.createBlock(C,{key:0},{trigger:i.withCtx(()=>[i.createVNode(B,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!s.value}])},{default:i.withCtx(()=>{var v;return[i.createTextVNode(i.toDisplayString(((v=s.value)==null?void 0:v.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var v;return[i.createTextVNode(" "+i.toDisplayString(((v=s.value)==null?void 0:v.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":o.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",qf,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",Xf,i.toDisplayString(f.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":o.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(x=s.value)==null?void 0:x.readOnly,"font-bold":!s.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var v;h.value&&((v=t.eventEmitter)==null||v.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(m.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!s.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(C,{key:0},{trigger:i.withCtx(()=>[i.createVNode(T,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",Yf," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(V.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",Uf,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(C,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode($,{class:"cursor-pointer",onClick:_[1]||(_[1]=v=>{var w;return(w=t.eventEmitter)==null?void 0:w.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),Gf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...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 Hs=i.markRaw({name:"ion-information-circle-outline",render:Zf}),Qf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jf(t,e){return i.openBlock(),i.createElementBlock("svg",Qf,[...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 el=i.markRaw({name:"ion-images",render:Jf}),em={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const nm=i.markRaw({name:"ion-bookmark",render:tm});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},es=Di.Multiply,np=[1,0,0,0,1,0,0,0,1],Kn=new un(9),ip=ft.Utils,Bc=new te,vo=new un([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:qe.document?qe.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Di,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;J.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 un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te),this._scale instanceof te?(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),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,u,h,m,g,f,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,B=t.renderer.ratio,C=Bc.copy(e._renderer.scale).multiply(B),T=e._stroke,$=e._linewidth,x=e._fill,v=e._renderer.opacity||e._opacity,w=e._cap,R=e._join,N=e._miter,M=e._closed,E=e.dashes,A=b.length,P=A-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*C.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*C.y),1);const Y=e._renderer.rect.centroid,ee=Y.x,I=Y.y;if(_.clearRect(0,0,y.width,y.height),x)if(typeof x=="string")_.fillStyle=x;else{const oe=ft.Utils.getRendererType(x._renderer.type);_e[oe].render.call(x,_,e),_.fillStyle=x._renderer.effect}if(T){if(typeof T=="string")_.strokeStyle=T;else{const oe=ft.Utils.getRendererType(T._renderer.type);_e[oe].render.call(T,_,e),_.strokeStyle=T._renderer.effect}$&&(_.lineWidth=hn(e)),N&&(_.miterLimit=N),R&&(_.lineJoin=R),!M&&w&&(_.lineCap=w)}typeof v=="number"&&(_.globalAlpha=v),E&&E.length>0&&(_.lineDashOffset=E.offset||0,_.setLineDash(E));let L,q,W,z,D,j,Z,ue;_.save(),_.scale(C.x,C.y),_.translate(ee,I),_.beginPath();for(let oe=0;oe<b.length;oe++){const re=b[oe];switch(g=re.x,f=re.y,re.command){case ne.close:_.closePath();break;case ne.arc:q=re.rx,W=re.ry,z=re.xAxisRotation,D=re.largeArcFlag,j=re.sweepFlag,n=M?It(oe-1,A):Math.max(oe-1,0),r=b[n],Z=r.x,ue=r.y,ip.renderSvgArcCommand(_,Z,ue,q,W,D,j,z,g,f);break;case ne.curve:n=M?It(oe-1,A):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||te.zero,u=re.controls&&re.controls.left||te.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=u.x+re.x,a=u.y+re.y):(o=u.x,a=u.y),_.bezierCurveTo(l,c,o,a,g,f),oe>=P&&M&&(s=L,h=re.controls&&re.controls.right||te.zero,m=s.controls&&s.controls.left||te.zero,re._relative?(l=h.x+re.x,c=h.y+re.y):(l=h.x,c=h.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,f=s.y,_.bezierCurveTo(l,c,o,a,g,f));break;case ne.line:_.lineTo(g,f);break;case ne.move:L=re,_.moveTo(g,f);break}}M&&_.closePath(),_e.isHidden.test(x)||(p=x._renderer&&x._renderer.offset,p&&(_.save(),_.translate(-x._renderer.offset.x,-x._renderer.offset.y),_.scale(x._renderer.scale.x,x._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(T)||(p=T._renderer&&T._renderer.offset,p&&(_.save(),_.translate(-T._renderer.offset.x,-T._renderer.offset.y),_.scale(T._renderer.scale.x,T._renderer.scale.y),_.lineWidth=$/T._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 u=d.x,h=d.y,m=d.controls;let g,f,p,b,y,_;o=Math.min(h,o),r=Math.min(u,r),s=Math.max(u,s),a=Math.max(h,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(g=d._relative?y.x+u:y.x,f=d._relative?y.y+h:y.y,p=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!g||!f||!p||!b)&&(o=Math.min(f,b,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(f,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;J.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 Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ve&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ve&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let h,m;this._scale instanceof te?(h=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,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 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(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,vo,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 u=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),J.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,u=e.dashes,h=e._size*o;let m=h;_e.isHidden.test(a)||(m+=l),r.width=gl(m),r.height=r.width;const g=m/r.width,f=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=hn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),u&&u.length>0&&(s.lineDashOffset=u.offset||0,s.setLineDash(u)),s.save(),s.translate(f,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,h/g*.5,0,ut),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;J.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,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,f=this._flagVertices,p=this._flagFill||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ve&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ve&&(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||u||h){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let b,y;this._scale instanceof te?(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,h&&(this._renderer.parent=s)}if(f){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),J.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=Bc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=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,f=g.x,p=g.y;let b,y,_,B,C,T,$,x,v,w,R;const N=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),N||(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 M=ft.Utils.getRendererType(c._renderer.type);_e[M].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const M=ft.Utils.getRendererType(a._renderer.type);_e[M].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(o.x,o.y),r.translate(f,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(T=c._renderer.scale.x,$=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(T,$),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,B=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,B),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(T=a._renderer.scale.x,$=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(T,$),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,B=a._renderer.offset.y/a._renderer.scale.y,C=l/a._renderer.scale.x,r.lineWidth=C,r.strokeText(e.value,_,B),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const M=r.measureText(e.value);switch(h){case"underline":v=M.actualBoundingBoxDescent,R=M.actualBoundingBoxDescent;break;case"strikethrough":v=0,R=0;break}x=-M.width/2,w=M.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(x,v),r.lineTo(w,R),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;J.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 Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ve&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ve&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let u,h;this._scale instanceof te?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,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 u=ft.Utils.getRendererType(this._mask._renderer.type);_e[u].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,vo,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),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.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 J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.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 J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;J.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 te||(this._renderer.offset=new te),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 te?(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 te||(this._renderer.scale=new te);let r,s;this._scale instanceof te?(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 J.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(),J.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 Ft("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 Tc=class extends K{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 un(np),scale:1,opacity:1},this._flagMatrix=!0,t=J.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 Ft("unable to create a webgl context. Try using another renderer.");r=Xt.create(e,Xt.path.vertex,Xt.types.vertex),s=Xt.create(e,Xt.path.fragment,Xt.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,vo,e.STATIC_DRAW),r=Xt.create(e,Xt.points.vertex,Xt.types.vertex),s=Xt.create(e,Xt.points.fragment,Xt.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"?Qs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,J.isObject(this.domElement.style)&&J.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(K.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}};k(Tc,"Utils",_e);var rp=J.extend({Error:Ft,getRatio:Qs,read:We,xhr:wc},J,vt,ul,hl),xe=class Vr{constructor(e){k(this,"_events",new K),k(this,"type",""),k(this,"renderer",null),k(this,"scene",null),k(this,"width",0),k(this,"height",0),k(this,"frameCount",0),k(this,"timeDelta",0),k(this,"playing",!1);const n=J.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Vr.Types.svg,autostart:!1});if(J.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),J.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Vr.Types[r])}this.renderer=new Vr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=sp.bind(this),this.fit.domElement=window,this.fit.attached=!0,J.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),J.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ot.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=op.bind(this),J.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(K.Types.resize,ap.bind(this)),this.scene=this.renderer.scene,Vr.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(K.Types.play)}pause(){return this.playing=!1,this.trigger(K.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=J.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ot.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(K.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(K.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 Kr(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 ve(e,n,void 0,void 0,void 0,void 0,ne.move),new ve(r,s,void 0,void 0,void 0,void 0,ne.line),new ve(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ne.line),new ve(r,s,void 0,void 0,void 0,void 0,ne.move),new ve(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ne.line)],d=new Ce(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new Un(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 mo(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 ve(l,c))}}const r=arguments[n-1],s=new Ce(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new fo(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new oo(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 te(a,l))}}const s=new ho(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 ve(c,d))}}const s=arguments[n-1],o=new Ce(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new fn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new Xe(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new Ye(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 xc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new bo(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Ve(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 We))return null;const o=We[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(Ot.temp.innerHTML=c,o=0;o<Ot.temp.children.length;o++)s=Ot.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ot.temp.children.length<=1?Ot.temp.children[0]:Ot.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(wc(e,l),r):(l(e),r)}};k(xe,"NextFrameId",Ct.NextFrameId),k(xe,"Types",Ct.Types),k(xe,"Version",Ct.Version),k(xe,"PublishDate",Ct.PublishDate),k(xe,"Identifier",Ct.Identifier),k(xe,"Resolution",Ct.Resolution),k(xe,"AutoCalculateImportedMatrices",Ct.AutoCalculateImportedMatrices),k(xe,"Instances",Ct.Instances),k(xe,"uniqueId",Ct.uniqueId),k(xe,"Anchor",ve),k(xe,"Collection",qn),k(xe,"Events",K),k(xe,"Group",st),k(xe,"Matrix",Di),k(xe,"Path",Ce),k(xe,"Registry",zr),k(xe,"Element",Li),k(xe,"Shape",Yn),k(xe,"Text",fn),k(xe,"Vector",te),k(xe,"Gradient",tt),k(xe,"Image",xc),k(xe,"ImageSequence",bo),k(xe,"LinearGradient",Xe),k(xe,"RadialGradient",Ye),k(xe,"Sprite",Wr),k(xe,"Stop",Xn),k(xe,"Texture",Ve),k(xe,"ArcSegment",oo),k(xe,"Circle",jr),k(xe,"Ellipse",qr),k(xe,"Line",Kr),k(xe,"Points",ho),k(xe,"Polygon",fo),k(xe,"Rectangle",Un),k(xe,"RoundedRectangle",Xr),k(xe,"Star",mo),k(xe,"CanvasRenderer",ft),k(xe,"SVGRenderer",Sc),k(xe,"WebGLRenderer",Tc),k(xe,"Commands",ne),k(xe,"Utils",rp);var gn=xe;function sp(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function op(){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 ap(t,e){this.width=t,this.height=e,this.trigger(K.Types.resize,t,e)}var hr=Ot.getRequestAnimationFrame();function Rc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=hr(Rc)}hr.init=function(){Rc(),hr.init=function(){}};let pn;typeof window<"u"?pn=window:typeof global<"u"?pn=global:typeof self<"u"&&(pn=self);let $c;const di=Math.PI*2,ot=Math.PI*.5;function lp(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 cp(t){$c=t}function dp(t,e){e=e&&e.identity()||new $c;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 Yt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const Nc=pn.Float32Array||Array,up=Math.floor;function yn(t){return up(t*1e6)/1e6}const me={move:"M",line:"L",curve:"C",close:"Z"};class Q{constructor(){S(this,"_events",{});S(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 u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}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}}S(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Pc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},ct=class ct extends Q{constructor(n=0,r=0){super();S(this,"_x",0);S(this,"_y",0);for(let s in Pc)Object.defineProperty(this,s,Pc[s]);this.x=n,this.y=r}static add(n,r){return new ct(n.x+r.x,n.y+r.y)}static sub(n,r){return new ct(n.x-r.x,n.y-r.y)}static subtract(n,r){return ct.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(ct.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 ct(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:yn(this.x),y:yn(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}};S(ct,"zero",new ct),S(ct,"left",new ct(-1,0)),S(ct,"right",new ct(1,0)),S(ct,"up",new ct(0,-1)),S(ct,"down",new ct(0,1));let pe=ct;class Re extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=me.move){super(n,r);S(this,"controls",{left:new pe,right:new pe});S(this,"_command",me.move);S(this,"_relative",!0);S(this,"_rx",0);S(this,"_ry",0);S(this,"_xAxisRotation",0);S(this,"_largeArcFlag",0);S(this,"_sweepFlag",1);for(let u in Ec)Object.defineProperty(this,u,Ec[u]);this.command=c,this.relative=!0;const d=Re.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(Q.Types.change,d),this.controls.right.set(a,l).addEventListener(Q.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(Q.Types.change)}}static fromObject(n){return new Re().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Re().copy(this)}toObject(){return{x:yn(this.x),y:yn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:yn(this.rx),ry:yn(this.ry),xAxisRotation:yn(this.xAxisRotation),largeArcFlag:yn(this.largeArcFlag),sweepFlag:yn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Ec={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}};let hp=0;const Co={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return hp++}},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 Fc(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 Re(a,l)];const u=[];for(let h=0;h<d;h++){const m=h/d,g=ns(m,t,n,s,a),f=ns(m,e,r,o,l);u.push(new Re(g,f))}return u}function fp(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),u=6*(t+s)-12*n,h=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(m*b+g)*b+f;return Math.sqrt(y*y+_*_)}return gp(p,0,1,c||ts.RecursionLimit)}function mp(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,m,g,f,p,b,y;for(let T=0;T<2;++T){if(T===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,m=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-m/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*m*u,y=Math.sqrt(b),!(b<0)&&(f=(-h+y)/(2*u),0<f&&f<1&&c.push(f),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,B=_,C;for(;_--;)g=c[_],C=1-g,d[0][_]=C*C*C*t+3*C*C*g*n+3*C*g*g*s+g*g*g*a,d[1][_]=C*C*C*e+3*C*C*g*r+3*C*g*g*o+g*g*g*l;return d[0][B]=t,d[1][B]=e,d[0][B+1]=a,d[1][B+1]=l,d[0].length=d[1].length=B+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 gp(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,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function pp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?ji(s-1,n):Math.max(s-1,0),l=e?ji(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];yp(c,d,u),d.command=s===0?me.move:me.curve}}function yp(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 fr=(Bi=class extends Q{constructor(){super();S(this,"_flagId",!1);S(this,"_flagClassName",!1);S(this,"_renderer",{});S(this,"_id",Co.Identifier+Co.uniqueId());S(this,"_className","");S(this,"classList",[]);for(let n in Ac)Object.defineProperty(this,n,Ac[n])}static fromObject(n){const r=new Bi().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}},S(Bi,"Properties",["renderer","id","className"]),Bi);const Ac={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();S(this,"name","Two.js");S(this,"message");this.message=n}}class bp{constructor(){S(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 Mc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};pn.document&&(rs=document.createElement("a"));const Ke=class Ke extends fr{constructor(n,r){super();S(this,"_flagSrc",!1);S(this,"_flagImage",!1);S(this,"_flagVideo",!1);S(this,"_flagLoaded",!1);S(this,"_flagRepeat",!1);S(this,"_flagOffset",!1);S(this,"_flagScale",!1);S(this,"_src","");S(this,"_image",null);S(this,"_loaded",!1);S(this,"_repeat","no-repeat");S(this,"_scale",1);S(this,"_offset",null);for(let s in Vc)Object.defineProperty(this,s,Vc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=_p.bind(this),this._renderer.flagScale=wp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const s=(function(){this.unbind(Q.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(Q.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 Ke().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=Ke.getAbsoluteURL(n);if(Ke.ImageRegistry.contains(r))return Ke.ImageRegistry.get(r);let s;return pn.document?Mc.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=Ke.getTag(s);n._flagImage&&(/canvas/i.test(o)?Ke.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Ke.Register[o](n,r))),n._flagSrc&&(s||(s=Ke.getImage(n.src),n.image=s),o=Ke.getTag(s),Ke.Register[o](n,r))}clone(){const n=new Ke(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(Q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ke.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(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}};S(Ke,"Properties",["src","loaded","repeat","scale","offset","image"]),S(Ke,"RegularExpressions",Mc),S(Ke,"ImageRegistry",new bp),S(Ke,"Register",{canvas:function(n,r){n._src="#"+n.id,Ke.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=Ke.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Ke.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=Ke.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ke.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 Ue=Ke;const Vc={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=Ue.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ue.ImageRegistry.contains(n)?this._image=Ue.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(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.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(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function _p(){this._flagOffset=!0}function wp(){this._flagScale=!0}class ui extends Array{constructor(){super();Xa(this,dt,new Q);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Nt(this,dt)}set _events(n){Xh(this,dt,n)}get _bound(){return Nt(this,dt)._bound}set _bound(n){Nt(this,dt)._bound=n}addEventListener(){return Nt(this,dt).addEventListener.apply(this,arguments)}on(){return Nt(this,dt).on.apply(this,arguments)}bind(){return Nt(this,dt).bind.apply(this,arguments)}removeEventListener(){return Nt(this,dt).removeEventListener.apply(this,arguments)}off(){return Nt(this,dt).off.apply(this,arguments)}unbind(){return Nt(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return Nt(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return Nt(this,dt).trigger.apply(this,arguments)}listen(){return Nt(this,dt).listen.apply(this,arguments)}ignore(){return Nt(this,dt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Q.Types.insert,r),this.trigger(Q.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(Q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Q.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(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}}dt=new WeakMap;const Ic=Array.prototype.slice;function xp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Pe={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=Ic.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=Ic.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=!xp(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:pn.performance&&pn.performance.now?pn.performance:Date},Mt=class Mt extends fr{constructor(n,r,s){super();S(this,"_flagOffset",!0);S(this,"_flagOpacity",!0);S(this,"_flagColor",!0);S(this,"_offset",0);S(this,"_opacity",1);S(this,"_color","#fff");for(let o in Oc)Object.defineProperty(this,o,Oc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Mt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Mt.Index<=0?"#fff":"#000",Mt.Index=(Mt.Index+1)%2}static fromObject(n){const r=new Mt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mt.Properties.length;r++){const s=Mt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Mt;return Pe.each(Mt.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",Pe.each(Mt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(Mt,"Index",0),S(Mt,"Properties",["offset","opacity","color"]);let hi=Mt;const Oc={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)}}},kn=class kn extends fr{constructor(n){super();S(this,"_flagStops",!1);S(this,"_flagSpread",!1);S(this,"_flagUnits",!1);S(this,"_spread","");S(this,"_units","");for(let r in zc)Object.defineProperty(this,r,zc[r]);this._renderer.type="gradient",this._renderer.flagStops=kp.bind(this),this._renderer.bindStops=vp.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 hi?o:new hi().copy(o)));const s=new kn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new kn(r);return Pe.each(kn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Pe.each(kn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(kn,"Stop",hi),S(kn,"Properties",["spread","stops","units"]);let nt=kn;const zc={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function kp(){this._flagStops=!0}function vp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Cp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends nt{constructor(n,r,s,o,a){super(a);S(this,"_flagEndPoints",!1);S(this,"_left",null);S(this,"_right",null);for(let l in Lc)Object.defineProperty(this,l,Lc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Sp.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 ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const s=ti.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 ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Pe.each(nt.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(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(ti,"Stop",hi),S(ti,"Properties",["left","right"]);let St=ti;const Lc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.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(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Sp(){this._flagEndPoints=!0}const vn=class vn extends nt{constructor(n,r,s,o,a,l){super(o);S(this,"_flagRadius",!1);S(this,"_flagCenter",!1);S(this,"_flagFocal",!1);S(this,"_radius",0);S(this,"_center",null);S(this,"_focal",null);for(let c in Dc)Object.defineProperty(this,c,Dc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Bp.bind(this),this._renderer.flagFocal=Tp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Pe.each(nt.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Pe.each(vn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(vn,"Stop",hi),S(vn,"Properties",["center","radius","focal"]);let Bt=vn;const Dc={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(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Bp(){this._flagCenter=!0}function Tp(){this._flagFocal=!0}function Hc(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 Wc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),fp(r,l,s,c,o,d,a,u,n)}function jc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Fc(r,l,s,c,o,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ue.fromObject(t);case"gradient":return nt.fromObject(t);case"linear-gradient":return St.fromObject(t);case"radial-gradient":return Bt.fromObject(t)}return t}const Rp=Math.cos,$p=Math.sin,qc=Math.tan,So=[],Rt=class Rt extends Q{constructor(n,r,s,o,a,l){super();S(this,"elements",new Nc(9));S(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 x=n;let v,w,R;const N=r[0]||0,M=r[1]||0,E=r[2]||0;return v=x[0]*N+x[1]*M+x[2]*E,w=x[3]*N+x[4]*M+x[5]*E,R=x[6]*N+x[7]*M+x[8]*E,[v,w,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],m=n[7],g=n[8],f=r[0],p=r[1],b=r[2],y=r[3],_=r[4],B=r[5],C=r[6],T=r[7],$=r[8];return s=s||new Nc(9),s[0]=o*f+a*y+l*C,s[1]=o*p+a*_+l*T,s[2]=o*b+a*B+l*$,s[3]=c*f+d*y+u*C,s[4]=c*p+d*_+u*T,s[5]=c*b+d*B+u*$,s[6]=h*f+m*y+g*C,s[7]=h*p+m*_+g*T,s[8]=h*b+m*B+g*$,s}static fromObject(n){return new Rt().copy(n)}set(n,r,s,o,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],s=h[2],o=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[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]=u,this.trigger(Q.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(Q.Types.change)}identity(){return this.elements[0]=Rt.Identity[0],this.elements[1]=Rt.Identity[1],this.elements[2]=Rt.Identity[2],this.elements[3]=Rt.Identity[3],this.elements[4]=Rt.Identity[4],this.elements[5]=Rt.Identity[5],this.elements[6]=Rt.Identity[6],this.elements[7]=Rt.Identity[7],this.elements[8]=Rt.Identity[8],this.trigger(Q.Types.change)}multiply(n,r,s,o,a,l,c,d,u){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(Q.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const P=a[0]*n+a[1]*r+a[2]*s,Y=a[3]*n+a[4]*r+a[5]*s,ee=a[6]*n+a[7]*r+a[8]*s;return[P,Y,ee]}const h=this.elements,m=[n,r,s,o,a,l,c,d,u],g=h[0],f=h[1],p=h[2],b=h[3],y=h[4],_=h[5],B=h[6],C=h[7],T=h[8],$=m[0],x=m[1],v=m[2],w=m[3],R=m[4],N=m[5],M=m[6],E=m[7],A=m[8];return this.elements[0]=g*$+f*w+p*M,this.elements[1]=g*x+f*R+p*E,this.elements[2]=g*v+f*N+p*A,this.elements[3]=b*$+y*w+_*M,this.elements[4]=b*x+y*R+_*E,this.elements[5]=b*v+y*N+_*A,this.elements[6]=B*$+C*w+T*M,this.elements[7]=B*x+C*R+T*E,this.elements[8]=B*v+C*N+T*A,this.trigger(Q.Types.change)}inverse(n){const r=this.elements;n=n||new Rt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],m=r[8],g=m*c-d*h,f=-m*l+d*u,p=h*l-c*u;let b=s*g+o*f+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-m*o+a*h)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=f*b,n.elements[4]=(m*s-a*u)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-h*s+o*u)*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=Rp(n),s=$p(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=qc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=qc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return So.length=0,this.toTransformArray(n,So),So.map(yn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=f;return}return[a,d,m,l,u,g,c,h,f]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=m,r[7]=g,r[8]=f;return}return[a,l,c,d,u,h,m,g,f]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Rt().copy(this)}};S(Rt,"Identity",[1,0,0,0,1,0,0,0,1]);let mr=Rt;cp(mr);const Er=class Er extends fr{constructor(){super();S(this,"_flagMatrix",!0);S(this,"_flagScale",!1);S(this,"_matrix",null);S(this,"_worldMatrix",null);S(this,"_position",null);S(this,"_rotation",0);S(this,"_scale",1);S(this,"_skewX",0);S(this,"_skewY",0);for(let n in os)Object.defineProperty(this,n,os[n]);this._renderer.flagMatrix=Xc.bind(this),this.isShape=!0,this.matrix=new mr,this.worldMatrix=new mr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Er().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 Er;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}};S(Er,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let $n=Er;const os={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),Xc.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(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(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 dp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Xc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Np=Math.ceil,Pp=Math.floor,Ep=new pe,nn=class nn extends $n{constructor(n,r,s,o){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagCap",!0);S(this,"_flagJoin",!0);S(this,"_flagMiter",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in Yc)Object.defineProperty(this,a,Yc[a]);this._renderer.type="path",this._renderer.flagVertices=Uc.bind(this),this._renderer.bindVertices=Kc.bind(this),this._renderer.unbindVertices=Gc.bind(this),this._renderer.flagFill=Zc.bind(this),this._renderer.flagStroke=Qc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new nn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}}for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new nn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<nn.Properties.length;s++){const o=nn.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()),Pe.each(nn.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,u=-1/0,h=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:f}=lp(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof f=="number"&&(s=Math.max(g,f)*(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,f]=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[B,C]=r.multiply(y,_),T=c.controls.left.x,$=c.controls.left.y;c.relative&&(T+=c.x,$+=c.y);let[x,v]=r.multiply(T,$);const w=mp(g,f,B,C,x,v,p,b);h=qi(w.min.y-s,h),d=qi(w.min.x-s,d),u=Xi(w.max.x+s,u),m=Xi(w.max.y+s,m)}else a<=1&&(h=qi(f-s,h),d=qi(g-s,d),u=Xi(g+s,u),m=Xi(f+s,m)),h=qi(b-s,h),d=qi(p-s,d),u=Xi(p+s,u),m=Xi(b+s,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}getPointAt(n,r){let s,o,a,l,c,d,u,h,m,g,f,p,b,y,_,B=this.length*Math.min(Math.max(n,0),1);const C=this.vertices.length,T=C-1;let $=null,x=null;for(let I=0,L=this._lengths.length,q=0;I<L;I++){if(q+this._lengths[I]>=B){this._closed?(s=ji(I,C),o=ji(I-1,C),I===0&&(s=o,o=I)):(s=I,o=Math.min(Math.max(I-1,0),T)),$=this.vertices[s],x=this.vertices[o],B-=q,this._lengths[I]!==0?n=B/this._lengths[I]:n=0;break}q+=this._lengths[I]}if($===null||x===null)return null;if($){if(!x)return $}else return x;_=x.controls&&x.controls.right,y=$.controls&&$.controls.left,c=x.x,g=x.y,d=(_||x).x,f=(_||x).y,u=(y||$).x,p=(y||$).y,h=$.x,b=$.y,_&&x.relative&&(d+=x.x,f+=x.y),y&&$.relative&&(u+=$.x,p+=$.y),l=ns(n,c,d,u,h),m=ns(n,g,f,p,b);const v=Yt(c,d,n),w=Yt(g,f,n),R=Yt(d,u,n),N=Yt(f,p,n),M=Yt(u,h,n),E=Yt(p,b,n),A=Yt(v,R,n),P=Yt(w,N,n),Y=Yt(R,M,n),ee=Yt(N,E,n);return Pe.isObject(r)?(r.x=l,r.y=m,r instanceof Re&&(r.controls.left.x=A,r.controls.left.y=P,r.controls.right.x=Y,r.controls.right.y=ee,(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 Re(l,m,A-l,P-m,Y-l,ee-m,this._curved?me.curve:me.line),a.t=n,a)}plot(){if(this.curved)return pp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?me.move:me.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===me.close;let o=this.vertices[r],a=[],l;return Pe.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===me.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=me.line),o=c;return}l=jc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=jc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?me.close:me.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=[]),Pe.each(this.vertices,function(c,d){if(d<=0||c.command===me.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Wc(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=Np(a),d=Pp(l);let u,h,m,g,f,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Re),p>d&&!h?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),h=f,m=this._collection[p-1],m&&m.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(pe.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-f.t))):p>=c&&p<=d&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===d&&Hc(this,o)?(h=f,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&Hc(this,s)&&(u=f,u.command=me.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,f),f.command=me.move,this._renderer.vertices.unshift(f),g=this._collection[p+1],g&&g.controls&&(f.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(pe.zero,f.t):(Ep.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,f.t))))}return $n.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,$n.prototype.flagReset.call(this),this}};S(nn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(nn,"Utils",{getCurveLength:Wc});let Ee=nn;const Yc={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 nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(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";Pe.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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.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 Uc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Kc(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Gc(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Zc(){this._flagFill=!0}function Qc(){this._flagStroke=!0}const Fp=Math.ceil,Ap=Math.floor,Cn=class Cn extends $n{constructor(n){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagSize",!0);S(this,"_flagSizeAttenuation",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_size",1);S(this,"_sizeAttenuation",!1);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);S(this,"noFill",Ee.prototype.noFill);S(this,"noStroke",Ee.prototype.noStroke);S(this,"corner",Ee.prototype.corner);S(this,"center",Ee.prototype.center);S(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);S(this,"_updateLength",Ee.prototype._updateLength);for(let r in Jc)Object.defineProperty(this,r,Jc[r]);this._renderer.type="points",this._renderer.flagVertices=Uc.bind(this),this._renderer.bindVertices=Kc.bind(this),this._renderer.unbindVertices=Gc.bind(this),this._renderer.flagFill=Zc.bind(this),this._renderer.flagStroke=Qc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new Cn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Cn.Properties.length;s++){const o=Cn.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()),Pe.each(Cn.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,u=a.y,h=Fc(l,c,l,c,d,u,d,u,n);r=r.concat(h)}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=Fp(s),l=Ap(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],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}};S(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let as=Cn;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}},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 nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.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 ed extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Xa(this,Ms,{});this.attach(n),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return Nt(this,Ms)}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}}Ms=new WeakMap;const An=class An extends Ee{constructor(n,r,s,o,a,l,c){const d=c||Co.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Re);super(u,!0,!1,!0);S(this,"_flagStartAngle",!1);S(this,"_flagEndAngle",!1);S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_startAngle",0);S(this,"_endAngle",di);S(this,"_innerRadius",0);S(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in td)Object.defineProperty(this,h,td[h]);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 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._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=ji(n,di)===ji(r,di),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,m,g,f,p,b,y,_,B,C;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(f=m/g,p=c[h],b=f*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),B=o*Math.sin(b),m){case 0:u=me.move;break;default:u=me.curve}p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(C=o*y/Math.PI,p.controls.left.x=C*Math.cos(b-ot),p.controls.left.y=C*Math.sin(b-ot),p.controls.right.x=C*Math.cos(b+ot),p.controls.right.y=C*Math.sin(b+ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=me.close,h++):(d--,g=d-1),m=0;m<d;m++)f=m/g,p=c[h],b=(1-f)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),B=s*Math.sin(b),u=me.curve,m<=0&&(u=a?me.move:me.line),p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(C=s*y/Math.PI,p.controls.left.x=C*Math.cos(b+ot),p.controls.left.y=C*Math.sin(b+ot),p.controls.right.x=C*Math.cos(b-ot),p.controls.right.y=C*Math.sin(b-ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=me.line}else a||(c[h].command=me.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=me.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 An(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ee.Properties.length;d++){const u=Ee.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};S(An,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Bo=An;const td={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}}},To=Math.cos,Ro=Math.sin,Mn=class Mn extends Ee{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Re(0,0,0,0,0,0));super(l,!0,!0,!0);S(this,"_flagRadius",!1);S(this,"_radius",0);this._renderer.type="circle";for(let c in nd)Object.defineProperty(this,c,nd[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 Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._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*di,d=s*To(c),u=s*Ro(c),h=o*To(c-ot),m=o*Ro(c-ot),g=o*To(c+ot),f=o*Ro(c+ot),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Mn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};S(Mn,"Properties",["radius"]);let $o=Mn;const nd={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},No=Math.cos,Po=Math.sin,Vn=class Vn extends Ee{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Re);super(c,!0,!0,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);this._renderer.type="ellipse";for(let d in id)Object.defineProperty(this,d,id[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 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._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*di,d=s*No(c),u=o*Po(c),h=s*r*No(c-ot),m=o*r*Po(c-ot),g=s*r*No(c+ot),f=o*r*Po(c+ot),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}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 Vn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};S(Vn,"Properties",["width","height"]);let Eo=Vn;const id={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Mp=Math.cos,Vp=Math.sin,In=class In extends Ee{constructor(n,r,s,o){o=Math.max(o||0,3);super();S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagSides",!1);S(this,"_radius",0);S(this,"_width",0);S(this,"_height",0);S(this,"_sides",0);this._renderer.type="polygon";for(let a in rd)Object.defineProperty(this,a,rd[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 In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._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=di*a+Math.PI/2,c=this._width*Mp(l)/2,d=this._height*Vp(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?me.move:me.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 In(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n}};S(In,"Properties",["width","height","sides"]);let Fo=In;const rd={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}}},Ti=class Ti extends Ee{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_origin",null);this._renderer.type="rectangle";for(let l in sd)Object.defineProperty(this,l,sd[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 Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Re),this.vertices[0].set(-n,-r).sub(this._origin).command=me.move,this.vertices[1].set(n,-r).sub(this._origin).command=me.line,this.vertices[2].set(n,r).sub(this._origin).command=me.line,this.vertices[3].set(-n,r).sub(this._origin).command=me.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=me.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ti(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};S(Ti,"Properties",["width","height","origin"]);let gr=Ti;const sd={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(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},On=class On extends Ee{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Re(0,0,0,0,0,0,c===0?me.move:me.curve));super(l);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagRadius",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in od)Object.defineProperty(this,c,od[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Ip.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 On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];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 On(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};S(On,"Properties",["width","height","radius"]);let Ao=On;const od={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(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Ip(){this._flagRadius=!0}const Op=Math.cos,zp=Math.sin,zn=class zn extends Ee{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_flagSides",!1);S(this,"_innerRadius",0);S(this,"_outerRadius",0);S(this,"_sides",0);this._renderer.type="star";for(let l in ad)Object.defineProperty(this,l,ad[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 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&&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=di*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Op(l),u=c*zp(l);o>=s?this.vertices.push(new Re(d,u)):this.vertices[o].set(d,u),this.vertices[o].command=o===0?me.move:me.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 zn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<zn.Properties.length;r++){const s=zn.Properties[r];n[s]=this[s]}return n}};S(zn,"Properties",["innerRadius","outerRadius","sides"]);let Mo=zn;const ad={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 Vo;const ld=Math.min,cd=Math.max;pn.document&&(Vo=document.createElement("canvas"));const bt=class bt extends $n{constructor(n,r,s,o){super();S(this,"_flagValue",!0);S(this,"_flagFamily",!0);S(this,"_flagSize",!0);S(this,"_flagLeading",!0);S(this,"_flagAlignment",!0);S(this,"_flagBaseline",!0);S(this,"_flagStyle",!0);S(this,"_flagWeight",!0);S(this,"_flagDecoration",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_flagDirection",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_value","");S(this,"_family","sans-serif");S(this,"_size",13);S(this,"_leading",17);S(this,"_alignment","center");S(this,"_baseline","middle");S(this,"_style","normal");S(this,"_weight",500);S(this,"_decoration","none");S(this,"_direction","ltr");S(this,"_fill","#000");S(this,"_stroke","none");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in dd)Object.defineProperty(this,a,dd[a]);if(this._renderer.type="text",this._renderer.flagFill=Lp.bind(this),this._renderer.flagStroke=Dp.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,!Pe.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(Vo){const r=Vo.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(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),u=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-u,o=c+u;break;case"right":s=-(c+u),o=u;break;default:s=-(c/2+u),o=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,m]=r.multiply(s,a),[g,f]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=ld(m,f,b,_),s=ld(h,g,p,y),o=cd(h,g,p,y),l=cd(m,f,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}};S(bt,"Ratio",.6),S(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=bt;const dd={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 nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.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 Lp(){this._flagFill=!0}function Dp(){this._flagStroke=!0}const Ln=class Ln extends gr{constructor(n,r,s,o){super(r,s,0,0);S(this,"_flagTextures",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_index",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_textures",null);S(this,"_frameRate",0);S(this,"_origin",null);this._renderer.type="image-sequence";for(let a in ud)Object.defineProperty(this,a,ud[a]);this._renderer.flagTextures=Hp.bind(this),this._renderer.bindTextures=Wp.bind(this),this._renderer.unbindTextures=jp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(hd.bind(this)):typeof n=="string"&&(this.textures=[hd(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Ln.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Ln().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ln.Properties.length;r++){const s=Ln.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=Pe.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 Ln(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,u;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,Pe.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Pe.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Yt(this._firstFrame,u,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 Ue))&&(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}};S(Ln,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(Ln,"DefaultFrameRate",30);let Io=Ln;const ud={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.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 Hp(){this._flagTextures=!0}function Wp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function jp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function hd(t){if(t instanceof Ue)return t;if(typeof t=="string")return new Ue(t)}const Ri=class Ri extends gr{constructor(n,r,s,o,a,l){super(r,s,0,0);S(this,"_flagTexture",!1);S(this,"_flagColumns",!1);S(this,"_flagRows",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_texture",null);S(this,"_columns",1);S(this,"_rows",1);S(this,"_frameRate",0);S(this,"_index",0);S(this,"_origin",null);this._renderer.type="sprite";for(let c in fd)Object.defineProperty(this,c,fd[c]);this.noStroke(),this.noFill(),n instanceof Ue?this.texture=n:typeof n=="string"&&(this.texture=new Ue(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 Ri().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ri.Properties.length;r++){const s=Ri.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=Pe.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 Ri(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,u,h,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)){h=n.image.width,m=n.image.height,o=h/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Pe.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Pe.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),u=Yt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%r,p=Math.floor(this._index/r),b=-o*f+(h-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}};S(Ri,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Oo=Ri;const fd={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,rn=class rn extends $n{constructor(n){super();S(this,"_flagAdditions",!1);S(this,"_flagSubtractions",!1);S(this,"_flagOrder",!1);S(this,"_flagOpacity",!0);S(this,"_flagBeginning",!1);S(this,"_flagEnding",!1);S(this,"_flagLength",!1);S(this,"_flagMask",!1);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_length",0);S(this,"_mask",null);S(this,"_strokeAttenuation",!0);for(let r in md)Object.defineProperty(this,r,md[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++)gd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)gd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new rn;for(let o=0;o<rn.Properties.length;o++){const a=rn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(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 Bo.fromObject(o);case"circle":return $o.fromObject(o);case"element":return fr.fromObject(o);case"ellipse":return Eo.fromObject(o);case"group":return rn.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Io.fromObject(o);case"path":return Ee.fromObject(o);case"points":return as.fromObject(o);case"polygon":return Fo.fromObject(o);case"rectangle":return gr.fromObject(o);case"rounded-rectangle":return Ao.fromObject(o);case"shape":return $n.fromObject(o);case"sprite":return Oo.fromObject(o);case"star":return Mo.fromObject(o);case"text":return Yi.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<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new rn,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,Pe.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,u=-1/0,h=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Pe.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Pe.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Pe.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Pe.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,B]=s.multiply(r.right,r.top),[C,T]=s.multiply(r.left,r.bottom),[$,x]=s.multiply(r.right,r.bottom);h=ls(y,B,T,x,h),d=ls(b,_,C,$,d),u=cs(b,_,C,$,u),m=cs(y,B,T,x,m)}else h=ls(r.top,h),d=ls(r.left,d),u=cs(r.right,u),m=cs(r.bottom,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}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,u=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):u<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):u>c&&u<c+r?(s.beginning=0,s.ending=(u-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}};S(rn,"Children",ed),S(rn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Nn=rn;const md={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=Nn.InsertChildren.bind(this),n=Nn.RemoveChildren.bind(this),r=Nn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new ed(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.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,Pe.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 gd(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 Ee{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in pd)Object.defineProperty(this,a,pd[a]);this.vertices[0].command=me.move,this.vertices[1].command=me.line,this.automatic=!1}}S(ds,"Properties",["left","right"]);const pd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Pe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=me.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(Pe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=me.line;else{const e=new is("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class zo{constructor(e=0,n=0){this.x=e,this.y=n}}class bn{constructor(e=10,n=0,r="A"){S(this,"start",new zo);S(this,"end",new zo);this.width=e,this.angle=n,this.label=r}}const De={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"}},qp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xp(t,e){return i.openBlock(),i.createElementBlock("svg",qp,[...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 us=i.markRaw({name:"ion-close",render:Xp}),Yp={class:"mr-3 flex flex-col gap-2"},Up=["onClick"],Kp={class:"h-full p-2"},Gp={},Zp=i.defineComponent({...Gp,__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((u,h)=>{var g;const m=(g=s.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var m;if(!(d!=null&&d.includes(u))){const g=(m=o.value)==null?void 0:m.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&(m.innerHTML="",a("init-draw-template",m,u))})})},{deep:!0}),(c,d)=>{const u=us;return i.openBlock(),i.createBlock(i.unref(O.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",Yp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,m)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${m}`,class:"group relative"},[i.createVNode(i.unref(O.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":m===t.selectTemplateIndex}]),onClick:g=>a("template:select",m)},[i.createElementVNode("div",Kp,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Up)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(O.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(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),yd=Wn(Zp,[["__scopeId","data-v-afccb364"]]),Qp={class:"flex gap-3 min-w-[20rem] relative"},Jp={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},ey={ref:"drawing-container",class:"size-full"},ty={},bd=i.defineComponent({...ty,__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,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((I,L)=>new bn(n.value.configuratorParams.linesWidths[L],I,`A-${L+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var I,L;return n.value.configuratorParams.startTailType&&((I=n.settings.startTailConfigs)!=null&&I[n.value.configuratorParams.startTailType])?(L=n.settings.startTailConfigs)==null?void 0:L[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var L;const I=n.value.configuratorParams.endTailType!==void 0&&((L=n.settings.endTailConfigs)==null?void 0:L[n.value.configuratorParams.endTailType]);return!I||!I.points?[]:I.points.map((q,W)=>Array.isArray(q)?new bn(q[0],q[1],`A-${W+1}`):new bn(q.width,q.angle,`A-${W+1}`))}),f=(I,L=!1)=>{I[0].start.x=0,I[0].start.y=0;let q=0;for(let W=0;W<I.length;W++){const z=I[W],D=I[W-1]??new bn(0,q);q+=!L||W>1?D.angle:0;const j=(!L||W>0?z.angle:0)+q;if(I[W].end.x=z.width*Math.cos(j*Math.PI/180)+I[W].start.x,I[W].end.y=z.width*Math.sin(j*Math.PI/180)+I[W].start.y,W<I.length-1){const Z=W+1;I[Z].start.x=I[W].end.x,I[Z].start.y=I[W].end.y}}return I},p=(I,L,q,W,z=!1)=>{let D=f([...q,...W]);L.length>0&&(D=[...f(L),...D]);let j=0,Z=0,ue=0,oe=0;D.forEach(Ae=>{j=Math.min(j,Ae.start.x,Ae.end.x),Z=Math.min(Z,Ae.start.y,Ae.end.y),ue=Math.max(ue,Ae.start.x,Ae.end.x),oe=Math.max(oe,Ae.start.y,Ae.end.y)});let re,Fe;j===0&&Z===0&&ue===0&&oe===0?(re=1,Fe=1):(re=I.width/Math.abs(ue-j),Fe=(z?I.height:I.height-De.colorSideLabel.size)/Math.abs(oe-Z));const je=Math.min(re,Fe);return j=j<0?-j*je:0,Z=Z<0?-Z*je:0,[je,j,Z]},b=I=>{const L=new as([I]);return L._size=De.anchorPoint.size,L.fill=De.anchorPoint.color,L.stroke="transparent",L._linewidth=De.anchorPoint.strokeSize,l.push(L),L},y=(I,L)=>{if(l=[],n.settings.allowChangeFirstPoint){const q=I[0],W=new pe(q.vertices[0].x,q.vertices[0].y);W.bind(Q.Types.change,()=>{q.vertices[0].copy(W)});const z=b(W);L.add(z)}I.forEach((q,W)=>{const z=I[W+1],D=new pe(q.vertices[1].x,q.vertices[1].y);D.bind(Q.Types.change,()=>{q.vertices[1].copy(D),z!==void 0&&z.vertices[0].copy(D)});const j=b(D);L.add(j)})},_=I=>I*(Math.PI/180),B=(I,L,q)=>{const W=L.vertices.length-1;I.position.x=L.vertices[W].x,I.position.y=L.vertices[W].y;const z=Math.atan2(L.vertices[W].y-L.vertices[0].y,L.vertices[W].x-L.vertices[0].x);I.rotation=_(q)+z},C=(I,L,q)=>{if(L.vertices[0]===void 0)return;I.position.x=L.vertices[0].x,I.position.y=L.vertices[0].y;const W=L.vertices.length-1,z=Math.atan2(L.vertices[W].y-L.vertices[0].y,L.vertices[W].x-L.vertices[0].x);I.rotation=_(q)+z},T=(I,L,q)=>{const W=new Nn;if(I.length===0)return W;const z=[];return[...I].reverse().forEach((D,j)=>{j!==0&&D.angle>0&&(D.angle*=-1),z.push(D)}),I=f(z,!0),C(W,L,I[0].angle),[L.vertices[0],L.vertices[1]].forEach(D=>{D.bind(Q.Types.change,()=>{C(W,L,I[0].angle)})}),I.forEach(D=>{const j=D.start.x*q,Z=D.end.x*q,ue=D.start.y*q,oe=D.end.y*q,re=new ds(j,ue,Z,oe);re.linewidth=De.line.size,re.stroke=De.line.color,W.add(re)}),W},$=(I,L,q)=>{const W=new Nn;return I.length===0||(I=f(I,!0),B(W,L,I[0].angle),[L.vertices[0],L.vertices[1]].forEach(z=>{z.bind(Q.Types.change,()=>{B(W,L,I[0].angle)})}),I.forEach(z=>{const D=z.start.x*q,j=z.end.x*q,Z=z.start.y*q,ue=z.end.y*q,oe=new ds(D,Z,j,ue);oe.linewidth=De.line.size,oe.stroke=De.line.color,W.add(oe)})),W},x=(I,L,q,W)=>{const z=L.vertices[0].x+(L.vertices[1].x-L.vertices[0].x)/2-8*Math.sin(I.angle*Math.PI/180),D=L.vertices[0].y+(L.vertices[1].y-L.vertices[0].y)/2-8*Math.cos(I.angle*Math.PI/180),j=new Yi(I.label,z+10,D-10);let Z;j.size=De.lineLabel.size,j.weight=600,j.fill=De.lineLabel.color,j.id+=1,j.rotation=De.lineLabel.rotation,W>0&&(Z=new Yi(`${I.angle}°`,L.vertices[0].x+25,L.vertices[0].y-25),Z.size=De.angleLabel.size,Z.weight=600,Z.fill=De.angleLabel.color,Z.rotation=De.angleLabel.rotation,Z.id+=W,o.push(Z),q.add(Z)),q.add(j),w(j,L,0,Z),w(j,L,1)},v=()=>{const{size:I}=De.colorSideLabel,L=0,q=0,W=h.value?I/2:I/2-I,z=h.value?I/2-I:I/2,D=new Nn;if(!c)return D;const j=5,Z=Math.atan2(z-W,q-L),ue=[new Re(L,W,0,0,0,0,gn.Commands.move),new Re(q,z,0,0,0,0,gn.Commands.line),new Re(q-j*Math.cos(Z-Math.PI/4),z-j*Math.sin(Z-Math.PI/4),0,0,0,0,gn.Commands.line),new Re(q,z,0,0,0,0,gn.Commands.move),new Re(q-j*Math.cos(Z+Math.PI/4),z-j*Math.sin(Z+Math.PI/4),0,0,0,0,gn.Commands.line)],oe=new Ee(ue,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=I/7,oe.stroke=De.colorSideLabel.color,D.add(oe);const re=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);re.size=I,re.weight=600,re.fill=De.colorSideLabel.color,re.alignment="left",D.add(re);const Fe=D.getBoundingClientRect();return D.position.x=(c.width-Fe.width)*d+10,D.position.y=h.value?c.height+Fe.height*2:Fe.height/2,D},w=(I,L,q,W)=>{L.vertices[q].bind(Q.Types.change,()=>{const z=L.vertices.length-1,D=Math.atan2(L.vertices[0].y-L.vertices[z].y,L.vertices[0].x-L.vertices[z].x)*180/Math.PI,j=L.vertices[0].x+(L.vertices[z].x-L.vertices[0].x)/2-8*Math.sin(D*Math.PI/180),Z=L.vertices[0].y+(L.vertices[z].y-L.vertices[0].y)/2-8*Math.cos(D*Math.PI/180);I.position.x=j+10,I.position.y=Z-10,I.rotation=-.5,W&&(W.position.x=L.vertices[0].x+25,W.position.y=L.vertices[0].y-25)})},R=(I,L,q,W,z=!1)=>{var Gt;if(I.clear(),q.length===0){I.update();return}const D=f(q),[j,Z,ue]=p(I,L,D,W,z),oe=new Nn,re=new Array,Fe=new Array;z||(o=[],a=[]),D.forEach((Te,sn)=>{const on=Te.start.x*j+Z,$t=Te.end.x*j+Z,Lt=Te.start.y*j+ue,an=Te.end.y*j+ue,wt=new ds(on,Lt,$t,an);wt.linewidth=z?De.previewLine.size:De.line.size,wt.stroke=z?De.previewLine.color:De.line.color,a.push(wt),re.push(wt),oe.add(wt),!z&&Te.label!==""&&x(Te,wt,oe,sn)});const je=re.at(-1);let Ae=oe.getBoundingClientRect();if(!z){const Te=v();Fe.push(Te)}if(L.length>0){const Te=T(L,re[0],j);oe.add(Te)}if(W.length>0&&je){const Te=$(W,je,j);oe.add(Te)}if(Fe.push(oe),I.makeGroup(Fe),Ae=oe.getBoundingClientRect(),oe.position.x=0-Ae.left+(I.width-Ae.width)/(2*(z?1:d)),oe.position.y=0-Ae.top+(I.height-Ae.height)/(2*(z?1:d)),I.update(),!z){const Te=((Gt=n.value.configuratorParams)==null?void 0:Gt.colorSide)==="top";oe.position.y=oe.position.y+De.colorSideLabel.size*Number(Te),y(re,oe),I.update()}},N=(I,L)=>{if(I&&!L.isNewRec()){const q=new gn({width:I.scrollWidth,height:I.scrollHeight});q.appendTo(I),R(q,[],L.points,[],!0)}},M=()=>{c&&R(c,m.value,u.value,g.value,!1)},E=I=>I*(180/Math.PI),A=(I,L)=>{const q=I[1].x-I[0].x,W=I[1].y-I[0].y,z=L[1].x-L[0].x,D=L[1].y-L[0].y;let j=Math.atan2(q*D-W*z,q*z+W*D);return j=E(j),Math.round(j)*-1},P=I=>{const L=a.map((q,W,z)=>{const D=z[W-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let j=Math.ceil(q._length/I/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[W-1];j<(z.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(j=z.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),j>n.settings.maxLineWidth&&(j=n.settings.maxLineWidth);const ue=A(q.vertices,D.vertices);return Z&&(Z.value=`${ue}°`),new bn(j,ue,`A-${W+1}`)});r("pointer:move",L)},Y=I=>{let L=null,q;const W=Z=>{L=l.find(ue=>{const oe=ue.renderer;return(oe==null?void 0:oe.elem)===Z.target}),[q]=p(I,m.value,u.value.map(ue=>ue),g.value)},z=Z=>{if(L){const ue=L.renderer,oe=ue==null?void 0:ue.elem;if(!oe)return;const re=oe.getBoundingClientRect();L.vertices[0].x-=re.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+De.anchorPoint.size/2,L.vertices[0].y-=re.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+De.anchorPoint.size/2,P(q),I.update()}},D=()=>{L&&r("pointer:up",u.value),L=null},j=s.value;j&&(j.addEventListener("touchstart",W,{passive:!0}),j.addEventListener("touchend",D,{passive:!0}),j.addEventListener("mousedown",W),j.addEventListener("mouseup",D),j.addEventListener("mousemove",z),j.addEventListener("touchmove",z,{passive:!0}))},ee=(I,L)=>{r("remove-custom-template",I,L)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{M()},{deep:!0,immediate:!0}),Y(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(I,L)=>(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(yd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":L[0]||(L[0]=q=>r("template:select",q)),onInitDrawTemplate:N,onRemoveCustomTemplate:ee},null,8,["select-template-index","settings"]),i.createElementVNode("div",Jp,[i.createElementVNode("div",ey,null,512)])]))}});class Ui extends U.Identity{constructor(n,r){super();S(this,"label","");S(this,"points",[]);S(this,"isCustom",!1);S(this,"id",-1);S(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>V.isArray(s)?new bn(s[0],s[1],`A-${o+1}`):new bn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new bn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Lo extends Ui{constructor(n){super(n);S(this,"isDefault");this.isDefault=n.isDefault??!1}}class _d{constructor(e){S(this,"minLineWidth");S(this,"maxLineWidth");S(this,"lineWidthStep");S(this,"minLineAngle");S(this,"maxLineAngle");S(this,"lineAngleStep");S(this,"stripMinWidth");S(this,"stripMaxWidth");S(this,"stripMinLength");S(this,"stripMaxLength");S(this,"allowShowTable");S(this,"showOnlyTemplates");S(this,"templates");S(this,"customTemplates",[]);S(this,"startTailConfigs");S(this,"endTailConfigs");S(this,"bendCountForExtended");S(this,"extendedProductCatalog");S(this,"allowChangeFirstPoint");S(this,"allowSaveTemplates");S(this,"userTemplatesPrefix");S(this,"lengthStep");S(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Ui(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Lo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Lo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Ui(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new bn(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 Ui(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 ny={class:"flex flex-col gap-3"},iy={class:"grid gap-5 md:grid-cols-5"},ry={},wd=i.defineComponent({...ry,__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 _d(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),m=i.useTemplateRef("kozyrek-configurator-params-form"),g=(w=0)=>{var N;const R=(N=c.value.allTemplates)==null?void 0:N.at(w);R!==void 0&&(h.value=w,l.value.configuratorParams.linesWidths=R.points.map(M=>V.isArray(M)?M[0]:M.width),l.value.configuratorParams.linesAngles=R.points.map(M=>V.isArray(M)?M[1]:M.angle),B()),y(l.value.configuratorParams)},f=async()=>{const w=prompt("Введите название шаблона:");if(!w)return;a.value=!0;const R={label:w,points:l.value.configuratorParams.linesWidths.map((M,E)=>[M,l.value.configuratorParams.linesAngles[E]])},N=M=>{M&&(c.value.addCustomTemplate(R),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:R,callback:N})},p=async(w,R)=>{var E;const N=(E=c.value.allTemplates)==null?void 0:E.at(w);if(!N||!N.isCustom)return;const M=A=>{A&&(c.value.removeCustomTemplate(N.id),g()),R==null||R()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:N.id,callback:M})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async w=>{var R,N;l.value.product=new U.ClientProduct,(N=(R=m.value)==null?void 0:R.formReference)==null||N.validate(M=>{M||(B(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:w,validationFieldResultData:u.value,callback:E=>{E?l.value.product=E:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(V.noop)},_=async()=>{var w,R;(R=(w=m.value)==null?void 0:w.formReference)==null||R.validate(N=>{N||(o.value=!0,r("submit",l.value,u.value,()=>{o.value=!1,i.nextTick(()=>{var M,E;(E=(M=m.value)==null?void 0:M.formReference)==null||E.restoreValidation()})}))}).catch(V.noop)},B=()=>{const w={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((R,N)=>{w[`lines_widths[${N+1}]`]={},w[`lines_angles[${N+1}]`]={}}),u.value=w},C=w=>{d.value.linesWidths=w.map(R=>R.width),d.value.linesAngles=w.map(R=>R.angle)},T=w=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,B(),b(),y(l.value.configuratorParams)},$=(w,R)=>{d.value.linesWidths=w,d.value.linesAngles=R},x=w=>{const R=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,N=0;l.value.configuratorParams.linesWidths.splice(w+1,0,R),l.value.configuratorParams.linesAngles.splice(w+1,0,N),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),b(),y(l.value.configuratorParams)},v=w=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(w,1),l.value.configuratorParams.linesAngles.splice(w,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,w=>{l.value=new U.OrderItemBase(w),g()}),(w,R)=>{const N=O.NButton;return i.openBlock(),i.createElementBlock("div",ny,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(N,{key:0,type:"tertiary",class:"self-end",onClick:R[0]||(R[0]=M=>r("click:view-switch"))},{default:i.withCtx(()=>[...R[3]||(R[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",iy,[i.createVNode(bd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":T,"onPointer:move":C,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(rl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":R[1]||(R[1]=M=>l.value=M),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":R[2]||(R[2]=M=>y(M)),"onUpdate:preview":$,onSubmit:_,"onClick:saveTemplate":f,"onClick:addLine":x,"onClick:removeLine":v},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),sy={class:"flex flex-col items-center justify-between rounded-xl"},oy={class:"img-preview relative flex justify-center"},ay={},ly=i.defineComponent({...ay,__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=V.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=O.NButton;return i.openBlock(),i.createElementBlock("div",sy,[i.createElementVNode("div",oy,[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})])}}}),Do=Wn(ly,[["__scopeId","data-v-a67fd61e"]]),cy={key:0,class:"flex items-baseline gap-1"},dy={key:0,class:"flex items-baseline gap-1"},uy={key:1},hy={class:"text-lg font-semibold"},fy={key:2,class:"text-red-500 text-sm mb-2"},my={class:"flex gap-3"},gy={},xd=i.defineComponent({...gy,__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 x;const r=t,s=n,o=i.computed(()=>kt.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"),u=i.ref(V.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),f=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),b=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+m.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-m.value),ae.max(f.value-m.value),ae.step(1),He.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),B=i.computed(()=>{var E;const v=p.value,w=b.value,{quantity:R}=r.value,N=((E=r.value.product)==null?void 0:E.costRub)||0;if(!v||!w||!R||N===0)return null;const M=v*w/1e6;return(N*R*M).toLocaleString("ru-ru",{minimumFractionDigits:2})}),C=i.computed(()=>{const v=p.value,w=b.value,R=!!(v&&v>=r.settings.minWidth&&v<=r.settings.maxWidths[u.value.configuratorParams.netType]),N=!!(w&&w>=r.settings.minHeight&&w<=r.settings.maxHeights[u.value.configuratorParams.netType]),M=!!(r.value.quantity&&r.value.quantity>0);return R&&N&&M}),T=(v,w)=>{var M,E;const R=u.value.configuratorParams;v&&v in R&&(R[v]=w);const N={...R,width:p.value??0,height:b.value??0};v==="width"&&((M=l.value)==null||M.validate().catch(V.noop)),v==="height"&&((E=c.value)==null||E.validate().catch(V.noop)),i.nextTick(()=>{var P,Y;!((P=l.value)!=null&&P.validationErrored)&&!((Y=c.value)!=null&&Y.validationErrored)&&N.height&&N.width&&s("update:params",N),$("configuratorParams",N)})},$=(v,w)=>{const R=new U.OrderItemBase(r.value);R[v]=w,v==="configuratorParams"&&(R.product=new U.ClientProduct),s("update:value",R)};return i.watch(()=>r.value,v=>{const w=V.cloneDeep(i.toRaw(v)),R=w.configuratorParams.mountType,N=r.settings.widthOverlaps[R]??0,M=r.settings.heightOverlaps[R]??0;w.configuratorParams.width&&w.configuratorParams.width>0&&(w.configuratorParams.width-=N),w.configuratorParams.height&&w.configuratorParams.height>0&&(w.configuratorParams.height-=M),u.value=w},{deep:!0}),i.onMounted(()=>{var v;(v=d.value)==null||v.select()}),e({validate:(x=a.value)==null?void 0:x.validate,formReference:a}),(v,w)=>{const R=O.NCheckbox;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:w[25]||(w[25]=i.withKeys(i.withModifiers(N=>s("submit",u.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[w[0]||(w[0]=N=>u.value.configuratorParams.netType=N),w[1]||(w[1]=N=>T("netType",N))],options:t.settings.netType.map(N=>({label:t.settings.descriptions.net_type[N],value:N}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[w[2]||(w[2]=N=>u.value.configuratorParams.color=N),w[3]||(w[3]=N=>T("color",N))],options:t.settings.color.map(N=>({label:t.settings.descriptions.color[N],value:N}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[w[4]||(w[4]=N=>u.value.configuratorParams.mountType=N),w[5]||(w[5]=N=>T("mountType",N))],options:t.settings.mountType.map(N=>({label:t.settings.descriptions.mount_type[N],value:N}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",cy,[i.createVNode(i.unref(O.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(O.NButton),{quaternary:"",type:"info",size:"tiny",onClick:w[10]||(w[10]=N=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...w[26]||(w[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[w[6]||(w[6]=N=>u.value.configuratorParams.width=N),w[9]||(w[9]=N=>T("width",N))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:w[7]||(w[7]=N=>i.unref(lt)(N)),onInput:w[8]||(w[8]=N=>i.unref(ze)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-m.value} ${f.value?" до "+(f.value-m.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",dy,[i.createVNode(i.unref(O.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(O.NButton),{quaternary:"",type:"info",size:"tiny",onClick:w[15]||(w[15]=N=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...w[27]||(w[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[w[11]||(w[11]=N=>u.value.configuratorParams.height=N),w[14]||(w[14]=N=>T("height",N))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:w[12]||(w[12]=N=>i.unref(lt)(N)),onInput:w[13]||(w[13]=N=>i.unref(ze)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.quantity,"onUpdate:value":[w[16]||(w[16]=N=>u.value.quantity=N),w[19]||(w[19]=N=>$("quantity",N??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:w[17]||(w[17]=N=>i.unref(lt)(N,!1)),onInput:w[18]||(w[18]=N=>i.unref(ze)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:w[20]||(w[20]=N=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":w[21]||(w[21]=N=>{u.value.marker=N??null,$("marker",N??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock(R,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":w[22]||(w[22]=N=>{u.value.isAdditionalSale=N??!1,$("isAdditionalSale",N??!1)})},{default:i.withCtx(()=>[...w[28]||(w[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),B.value?(i.openBlock(),i.createElementBlock("div",uy,[w[29]||(w[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",hy,i.toDisplayString(B.value)+" ₽",1)])):i.createCommentVNode("",!0),C.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",fy," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",my,[i.createVNode(i.unref(O.NButton),{loading:t.isSubmitProcessing,disabled:!C.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:w[23]||(w[23]=N=>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(O.NButton),{key:0,type:"default",onClick:w[24]||(w[24]=N=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...w[30]||(w[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),py="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",yy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",by="/img/configurators/mosquitto/measurement-instructions/mount.png",_y="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",wy="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",xy={class:"flex flex-col gap-6"},ky={class:"flex gap-4"},vy={class:"flex flex-col gap-2"},Cy={class:"flex gap-4"},Sy={class:"flex flex-col gap-2"},By={class:"flex gap-4"},Ty={class:"flex flex-col gap-2"},Ry={},kd=i.defineComponent({...Ry,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=kt.initRefDependingOnDeviceResolution("small","small","medium"),r=kt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=O.NText;return i.openBlock(),i.createBlock(i.unref(O.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",xy,[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:py,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:yy,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",ky,[l[9]||(l[9]=i.createElementVNode("img",{src:by,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",vy,[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",Cy,[l[15]||(l[15]=i.createElementVNode("img",{src:_y,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",By,[l[21]||(l[21]=i.createElementVNode("img",{src:wy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Ty,[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"])}}}),$y={class:"grid md:grid-cols-2"},Ny={},vd=i.defineComponent({...Ny,__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(()=>kt.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:{}}),u=i.ref(!1),h=i.ref(!1),m=i.computed(()=>i.inject("debounce-input-time",300)),g=V.debounce(async p=>{var b,y;l.value.product=new U.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:B=>{B?l.value.product=B:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(V.noop)},m.value),f=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,b)=>{const y=us;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(kd,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",$y,[s.value?(i.openBlock(),i.createBlock(i.unref(O.NDrawer),{key:1,show:o.value,"onUpdate:show":b[4]||(b[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(O.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(y)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Do,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Do,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(xd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>i.unref(g)(_)),onSubmit:b[7]||(b[7]=_=>f()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Py={},Cd=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)}),u=m=>{l.value=m,s("update:value",m,r.index,a)},h=()=>{var m;(m=o.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(m,g)=>{const f=il,p=js;return i.openBlock(),i.createBlock(i.unref(O.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(cr,{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(O.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(xt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(lt)(b)),onInput:g[1]||(g[1]=b=>i.unref(ze)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(O.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(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(O.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"])}}}),Ey={class:"my-2 flex w-full flex-col"},Fy={key:1},Ay={class:"text-lg font-semibold"},My={class:"flex gap-3"},Vy={},Sd=i.defineComponent({...Vy,__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 _;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(V.cloneDeep(r.value)),c=i.computed(()=>{const B={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]};return V.forEach(l.value,(C,T)=>{var $;B[`configuratorParams.linesWidths.${T}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),He.serverValidation(($=r.validation[`linesWidths.${T}`])==null?void 0:$.feedback)]}),B}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((B,C)=>(B??0)+(C??0),0)),h=i.computed(()=>r.settings.width-u.value),m=i.computed(()=>!r.value.some(({product:B})=>!B||B.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!m.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(B=>B.product.isNewRec())),f=i.computed(()=>B=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+B}]),p=i.computed(()=>{const{length:B}=r.value[0];return!B||u.value!==r.settings.width?null:(V.reduce(r.value,(T,$)=>{var v;const x=((v=$.product)==null?void 0:v.costRub)||0;return T+x},0)*r.value[0].quantity*B).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(B,C,T)=>{var x,v,w;l.value[C].product.id=-1;const{configuratorParams:$}=l.value[C];$.linesWidths[C]=B,y("configuratorParams",$),(w=(v=(x=a.value)==null?void 0:x.at(C))==null?void 0:v.formItemReference)==null||w.validate().catch(V.noop),i.nextTick(()=>{var R,N;(N=(R=a.value)==null?void 0:R.at(C))!=null&&N.isValid&&s("update:params",$,C,T)})},y=(B,C)=>{l.value.forEach(T=>{T[B]=C}),s("update:value",l.value)};return i.watch(()=>r.value,B=>{l.value=V.cloneDeep(B)},{deep:!0}),e({validate:(_=o.value)==null?void 0:_.validate,formReference:o}),(B,C)=>{const T=O.NCheckbox;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:C[15]||(C[15]=i.withKeys(i.withModifiers($=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var $;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(x,v)=>{var w,R;return i.openBlock(),i.createBlock(Cd,{key:v,ref_for:!0,ref:"line-items-reference",value:((w=x.configuratorParams)==null?void 0:w.linesWidths.at(v))??null,"auto-focus":!0,index:v,path:`configuratorParams.linesWidths.${v}`,product:x.product,settings:t.settings,validation:t.validation,"suggestion-option":f.value(((R=x.configuratorParams)==null?void 0:R.linesWidths.at(v))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(N=>N.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":b,"onClick:addLine":C[0]||(C[0]=N=>s("click:add-line",N)),"onClick:removeLine":C[1]||(C[1]=N=>s("click:remove-line",N))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Ey,[h.value<0?(i.openBlock(),i.createBlock(i.unref(O.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),m.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(O.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...C[16]||(C[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[C[17]||(C[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(O.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(O.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:C[2]||(C[2]=x=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...C[18]||(C[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(O.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:l.value[0].length,"onUpdate:value":[C[3]||(C[3]=x=>l.value[0].length=x),C[6]||(C[6]=x=>y("length",x))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:C[4]||(C[4]=x=>i.unref(lt)(x,!1)),onInput:C[5]||(C[5]=x=>i.unref(ze)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[C[7]||(C[7]=x=>l.value[0].quantity=x),C[10]||(C[10]=x=>y("quantity",x))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[8]||(C[8]=x=>i.unref(lt)(x,!1)),onInput:C[9]||(C[9]=x=>i.unref(ze)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:C[11]||(C[11]=x=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":C[12]||(C[12]=x=>{l.value[0].marker=x??null,y("marker",x??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(T,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":C[13]||(C[13]=x=>{l.value[0].isAdditionalSale=x??!1,y("isAdditionalSale",x??!1)})},{default:i.withCtx(()=>[...C[19]||(C[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",Fy,[C[20]||(C[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Ay,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",My,[i.createVNode(i.unref(O.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||h.value!=0||!(($=l.value[0])!=null&&$.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:C[14]||(C[14]=x=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),Iy={class:"flex grow flex-col"},Oy=["src"],zy={class:"w-full"},Ly={},Bd=i.defineComponent({...Ly,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Iy,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Oy),i.createElementVNode("div",zy,[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)])]))}}),Dy={class:"flex flex-col gap-2"},Hy={class:"w-104 flex grow flex-col px-5"},Wy={},Td=i.defineComponent({...Wy,__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(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var f;return(f=o.value[0].configuratorParams)==null?void 0:f.linesWidths.reduce((p,b)=>(p??0)+(b??0),0)}),u=f=>{f===void 0&&(f=o.value.length-1);const p=o.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,null),o.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const b=new U.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});o.value=o.value.toSpliced(f+1,0,b)},h=f=>{const p=o.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),o.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),o.value=o.value.toSpliced(f,1),delete a[`linesWidths.${f}`],delete a[`linesWidths.${f}`])},m=V.debounce(async(f,p,b)=>{const y={linesWidths:f.linesWidths.at(p)};b.value=!0,a.value[`linesWidths.${p}`]={},o.value[p].product=new U.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:o.value[p].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(o.value[p].product=_,p===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(o.value[p].product=new U.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),g=async()=>{var f,p;(p=(f=s.value)==null?void 0:f.formReference)==null||p.validate(b=>{if(!b){l.value=!0;const y=o.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,B;(B=(_=s.value)==null?void 0:_.formReference)==null||B.restoreValidation()})})}}).catch(V.noop)};return i.watch(()=>n.cartItems,f=>{o.value=f.map(p=>new U.OrderItemBase(p))}),(f,p)=>{const b=O.NButton;return i.openBlock(),i.createElementBlock("div",Dy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=y=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Hy,[i.createVNode(Bd,{value:o.value,"onUpdate:value":p[1]||(p[1]=y=>o.value=y),settings:t.settings},null,8,["value","settings"]),i.createVNode(Sd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":p[2]||(p[2]=y=>o.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(m),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),jy={class:"flex flex-col gap-3"},qy={},Rd=i.defineComponent({...qy,__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 g;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(V.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(f,p)=>{const b=new U.OrderItemBase(r.value);b[f]=p,f==="configuratorParams"&&(b.product=new U.ClientProduct),s("update:value",b)},m=()=>{var f;(f=a.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=V.cloneDeep(f)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{m()})}),e({validate:(g=o.value)==null?void 0:g.validate,formReference:o}),(f,p)=>{const b=O.NCheckbox;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:i.unref(xt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(lt)(y)),onInput:p[2]||(p[2]=y=>i.unref(ze)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:i.unref(xt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(lt)(y)),onInput:p[5]||(p[5]=y=>i.unref(ze)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(lt)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(ze)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>h("quantity",y??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>h("marker",y??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",jy,[i.createVNode(i.unref(O.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),Xy={class:"flex flex-col gap-2 w-72"},Yy={},$d=i.defineComponent({...Yy,__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=i.computed(()=>i.inject("debounce-input-time",300)),u=V.debounce(async m=>{var g,f;o.value.product=new U.ClientProduct,(f=(g=s.value)==null?void 0:g.formReference)==null||f.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:m,validationFieldResultData:a.value,callback:b=>{b?o.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(V.noop)},d.value),h=async()=>{var m,g;(g=(m=s.value)==null?void 0:m.formReference)==null||g.validate(f=>{f||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})}))}).catch(V.noop)};return i.watch(()=>n.cartItem,m=>{o.value=new U.OrderItemBase(m)},{deep:!0}),(m,g)=>{const f=O.NButton;return i.openBlock(),i.createElementBlock("div",Xy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(f,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Rd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=p=>o.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Uy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ky(t,e){return i.openBlock(),i.createElementBlock("svg",Uy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Gy=i.markRaw({name:"ion-add",render:Ky}),Zy={key:0,class:"ml-2 text-gray-500 text-sm"},Qy={class:"font-bold"},Jy={key:1,class:"flex flex-col gap-3"},e0={class:"w-full text-sm"},t0={"form-array-name":"items",class:"flex flex-col gap-3"},n0={class:"grid grow grid-cols-3 gap-2 items-start"},i0={key:0,class:"flex flex-wrap items-end gap-2"},r0={class:"whitespace-nowrap text-xl font-bold"},s0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},o0={class:"font-bold"},a0={class:"font-bold"},l0={class:"flex gap-3"},c0={},Nd=i.defineComponent({...c0,__name:"sandwich-configurator-form",props:{value:{},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:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var E;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(V.cloneDeep(r.value)),l=i.computed(()=>r.value.category),c=i.ref(null),d=i.ref(null),u=i.computed(()=>l.value.products??[]),h=i.computed(()=>u.value.map(A=>({label:A.name,value:A.id}))),m=i.ref(null),g=i.ref(!1),f=i.computed(()=>{var A,P;return(P=(A=c.value)==null?void 0:A.properties)!=null&&P.width?ae.max(c.value.properties.width):null}),p=i.computed(()=>{var A,P;return(P=(A=c.value)==null?void 0:A.properties)!=null&&P.length?ae.max(c.value.properties.length):null}),b=i.computed(()=>{const A={marker:[He.serverValidation(r.validation.marker.feedback)]};return a.value.configuratorParams.items.forEach((P,Y)=>{var ee,I,L,q,W,z,D;A[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(I=(ee=c.value)==null?void 0:ee.properties)!=null&&I.width?[ae.max(c.value.properties.width)]:[],ae.step(1),He.serverValidation((L=r.validation[`items.${Y}.width`])==null?void 0:L.feedback)],A[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(W=(q=c.value)==null?void 0:q.properties)!=null&&W.length?[ae.max(c.value.properties.length)]:[],ae.step(1),He.serverValidation((z=r.validation[`items.${Y}.length`])==null?void 0:z.feedback)],A[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),He.serverValidation((D=r.validation[`items.${Y}.count`])==null?void 0:D.feedback)]}),A}),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>a.value.configuratorParams.items.some(A=>{var P,Y;return!c.value||!A.width||A.width<r.settings.minWidth||A.width>(((P=c.value.properties)==null?void 0:P.width)??0)||A.length===0||A.length<r.settings.minLength||A.length>(((Y=c.value.properties)==null?void 0:Y.length)??0)||!A.count||A.count<1})),B=i.computed(()=>!c.value||_.value||a.value.configuratorParams.items.length===0),C=i.ref(null),T=A=>{if(!A){c.value=null,d.value=null,a.value.product=new U.ClientProduct,m.value=null;return}const P=u.value.find(Y=>Y.id===A);P&&(c.value=P,d.value=A,a.value.product=P,M("product",a.value.product),a.value.configuratorParams.items.forEach(Y=>{var ee,I;(ee=P.properties)!=null&&ee.width&&Y.width>P.properties.width&&(Y.width=P.properties.width),(I=P.properties)!=null&&I.length&&Y.length>P.properties.length&&(Y.length=P.properties.length)}),$())},$=()=>{m.value=null,C.value=null},x=async()=>{var A;if(!c.value||a.value.configuratorParams.items.length===0||_.value){$();return}(A=o.value)==null||A.validate(P=>{if(P){$();return}if(g.value=!0,!c.value||!l.value){$(),g.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:l.value,params:{productId:c.value.id,items:a.value.configuratorParams.items},callback:Y=>{Y?(m.value=Y,a.value.configuratorParams.calculationId=Y.id,a.value.quantity=Y.quantity,i.nextTick(()=>{M("quantity",Y.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,$()),M("configuratorParams",a.value.configuratorParams),v(),g.value=!1}})}).catch(()=>{$(),g.value=!1})},v=()=>{var P;if(!((P=c.value)!=null&&P.costRub)||!m.value){C.value=null;return}const A=m.value.quantity*c.value.costRub;C.value=Math.round(A*100)/100},w=A=>{var Y,ee;const P=a.value.configuratorParams.items[A];c.value&&((Y=c.value.properties)!=null&&Y.width&&P.width>c.value.properties.width&&(P.width=c.value.properties.width),(ee=c.value.properties)!=null&&ee.length&&P.length>c.value.properties.length&&(P.length=c.value.properties.length)),M("configuratorParams",a.value.configuratorParams),$()},R=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),M("configuratorParams",a.value.configuratorParams),$(),s("add-item",a.value.configuratorParams.items.length)},N=A=>{a.value.configuratorParams.items.splice(A,1),M("configuratorParams",a.value.configuratorParams),$(),s("remove-item",A)},M=(A,P)=>{const Y=new U.OrderItemBase(r.value);Y[A]=P,s("update:value",Y)};return i.watch(()=>r.value,A=>{const P=V.cloneDeep(i.toRaw(A));(!P.configuratorParams.items||P.configuratorParams.items.length===0)&&(P.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=P,r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id),r.value.product.isNewRec()&&(c.value=null,d.value=null)},{deep:!0}),i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id)}),e({validate:(E=o.value)==null?void 0:E.validate,formReference:o}),(A,P)=>{const Y=js,ee=Gy;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:a.value,rules:b.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:P[8]||(P[8]=i.withKeys(i.withModifiers(I=>s("submit",a.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var I,L,q;return[i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:d.value,"onUpdate:value":[P[0]||(P[0]=W=>d.value=W),T],options:h.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",Zy,[P[9]||(P[9]=i.createTextVNode(" Стоимость: ",-1)),i.createElementVNode("span",Qy,i.toDisplayString((I=c.value.costRub)==null?void 0:I.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.",1)])):i.createCommentVNode("",!0),c.value&&f.value&&p.value?(i.openBlock(),i.createElementBlock("div",Jy,[P[15]||(P[15]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",e0,[i.createTextVNode(" Минимальная ширина: "+i.toDisplayString(t.settings.minWidth)+" мм. ",1),P[10]||(P[10]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная ширина: "+i.toDisplayString((L=c.value.properties)==null?void 0:L.width)+" мм. ",1),P[11]||(P[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная длина: "+i.toDisplayString(t.settings.minLength)+" мм. ",1),P[12]||(P[12]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная длина: "+i.toDisplayString((q=c.value.properties)==null?void 0:q.length)+" мм. ",1)]),i.createElementVNode("div",t0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(W,z)=>(i.openBlock(),i.createElementBlock("div",{key:z,class:"flex grow gap-2"},[i.createElementVNode("div",n0,[i.createVNode(i.unref(O.NFormItem),{path:`configuratorParams.items.${z}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:a.value.configuratorParams.items[z].width,"onUpdate:value":[D=>a.value.configuratorParams.items[z].width=D,D=>w(z)],parse:i.unref(xt),"show-button":!1,placeholder:"Ширина",class:"w-full",onKeydown:P[1]||(P[1]=D=>i.unref(lt)(D)),onInput:D=>i.unref(ze)(t.validation,`items.${z}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(O.NFormItem),{path:`configuratorParams.items.${z}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:a.value.configuratorParams.items[z].length,"onUpdate:value":[D=>a.value.configuratorParams.items[z].length=D,D=>w(z)],parse:i.unref(xt),"show-button":!1,placeholder:"Длина",class:"w-full",onKeydown:P[2]||(P[2]=D=>i.unref(lt)(D)),onInput:D=>i.unref(ze)(t.validation,`items.${z}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(O.NFormItem),{path:`configuratorParams.items.${z}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:a.value.configuratorParams.items[z].count,"onUpdate:value":[D=>a.value.configuratorParams.items[z].count=D,D=>w(z)],parse:i.unref(xt),"show-button":!1,placeholder:"Количество",class:"w-full",onKeydown:P[3]||(P[3]=D=>i.unref(lt)(D,!1)),onInput:D=>i.unref(ze)(t.validation,`items.${z}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(O.NButton),{disabled:a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:D=>N(z)},{default:i.withCtx(()=>[i.createVNode(Y)]),_:1},8,["disabled","onClick"])]))),128))]),i.createVNode(i.unref(O.NButton),{disabled:_.value,type:"default",class:"self-center",onClick:R},{default:i.withCtx(()=>[i.createVNode(ee),P[13]||(P[13]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"]),i.createVNode(i.unref(O.NButton),{disabled:B.value,loading:g.value,type:"info",class:"self-start",onClick:x},{default:i.withCtx(()=>[...P[14]||(P[14]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["disabled","loading"])])):c.value?(i.openBlock(),i.createBlock(i.unref(O.NText),{key:2,type:"error"},{default:i.withCtx(()=>[...P[16]||(P[16]=[i.createTextVNode(" Расчет по продукту невозможен. Обратитесь к менеджеру. ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:a.value.marker??null,placeholder:"Введите маркировку распила",onInput:P[4]||(P[4]=W=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":P[5]||(P[5]=W=>M("marker",W??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock(i.unref(O.NCheckbox),{key:3,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":P[6]||(P[6]=W=>{a.value.isAdditionalSale=W??!1,M("isAdditionalSale",W??!1)})},{default:i.withCtx(()=>[...P[17]||(P[17]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(O.NSpin),{show:g.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var W;return[m.value&&c.value&&C.value?(i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("div",null,[P[18]||(P[18]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",r0,i.toDisplayString(C.value.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol),1)]),m.value.quantity&&c.value?(i.openBlock(),i.createElementBlock("div",s0,[i.createElementVNode("span",o0,"("+i.toDisplayString(m.value.quantity)+" шт.",1),P[19]||(P[19]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",a0,i.toDisplayString((W=c.value.costRub)==null?void 0:W.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",l0,[i.createVNode(i.unref(O.NButton),{loading:t.isSubmitProcessing,disabled:B.value||!m.value||g.value,type:"primary",class:"self-start",onClick:P[7]||(P[7]=W=>s("submit",a.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),d0={class:"flex flex-col gap-2"},u0={class:"w-104 flex grow flex-col px-5"},h0={},Pd=i.defineComponent({...h0,__name:"sandwich-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("sandwich-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,m;(m=(h=s.value)==null?void 0:h.formReference)==null||m.validate(g=>{if(!g){l.value=!0;const f=V.cloneDeep(o.value);"items"in f.configuratorParams&&delete f.configuratorParams.items,r("submit",f,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})})}}).catch(V.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,m)=>{a.value[`items.${m}.width`]={},a.value[`items.${m}.length`]={},a.value[`items.${m}.count`]={}})}),i.watch(()=>n.cartItem,h=>{o.value=new U.OrderItemBase(h)},{deep:!0}),(h,m)=>{const g=O.NButton;return i.openBlock(),i.createElementBlock("div",d0,[t.settings.allowShowTable&&o.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[2]||(m[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",u0,[i.createVNode(Nd,{ref:"sandwich-configurator-form",value:o.value,"onUpdate:value":m[1]||(m[1]=f=>o.value=f),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),f0={key:0,class:"flex justify-center p-4"},m0={key:1,class:"p-4 text-center text-red-500"},g0={key:2,class:"flex justify-center"},p0={class:"!bg-white p-4 m-2 rounded-md w-max"},y0={key:3,class:"p-4 text-center text-gray-500"},b0={},Ed=i.defineComponent({...b0,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.ref(e.cartItem??null),o=i.ref(null),a=()=>{var u,h,m;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const d={category:((u=e.cartItem)==null?void 0:u.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const g=e.settings;s.value=new U.OrderItemBase({...d,configuratorParams:{length:g.stripMinLength,linesAngles:[],linesWidths:[],startTailType:V.some(g.startTailConfigs,f=>f.isDefault)?(h=g.startTailConfigs)==null?void 0:h.findIndex(f=>f.isDefault):void 0,endTailType:V.some(g.endTailConfigs,f=>f.isDefault)?(m=g.endTailConfigs)==null?void 0:m.findIndex(f=>f.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const g=e.settings;s.value=new U.OrderItemBase({...d,configuratorParams:{width:0,height:0,netType:g.netType[0]||"",color:g.color[0]||"",mountType:g.mountType[0]||""}});break}case"strip":{const g=e.settings;o.value=[new U.OrderItemBase({...d,length:g.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const g=e.settings;s.value=new U.OrderItemBase({...d,configuratorParams:{width:g.minWidth,length:g.minLength}});break}case"sandwich":{s.value=new U.OrderItemBase({...d,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}s.value&&(s.value.marker=void 0)},l=(d,u,h)=>{const m=g=>{h==null||h(),g&&a()};e.eventEmitter.emit("configurator:submit",{cartItem:d,callback:m,validation:u})},c=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||a()}),(d,u)=>{const h=O.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",f0,[i.createVNode(h,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",m0,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(s.value!==null||o.value!==null)?(i.openBlock(),i.createElementBlock("div",g0,[i.createElementVNode("div",p0,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(wd,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(vd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock(Td,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":o.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock($d,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Pd,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",y0,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});var hs=(t=>(t.Kozyrek="kozyrek",t.Mosquitto="mosquitto",t.Strip="strip",t.MetalForDoors="metal_for_doors",t.Sandwich="sandwich",t))(hs||{});function Fd(t){return Object.values(hs).includes(t)}function Ad(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==hs.Sandwich?!0:t.properties.configuratorSettings!==void 0&&V.isArray(t.products)&&t.products.length>0}const _0={key:0,class:"pt-0.5"},w0={key:0},x0={class:"line-through"},k0={key:0},v0={key:1},C0={class:"flex flex-row gap-1"},S0={key:0},B0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},T0={class:"flex flex-col gap-2.5 sm:flex-row"},R0={class:"mt-2"},$0={key:1,class:"flex flex-col"},N0={},P0=i.defineComponent({...N0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(or,"medium"),r=i.computed(()=>{var j;return(j=e==null?void 0:e.filteredItems)==null?void 0:j[e.categoryItem.id]}),s=i.computed(()=>{var j,Z;return V.isArray((j=e.categoryItem)==null?void 0:j.categories)&&((Z=e.categoryItem.categories)==null?void 0:Z.length)>0}),o=i.computed(()=>{var j;return V.isArray((j=e.categoryItem)==null?void 0:j.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([j,Z])=>`${Z} руб./${N(j)}`).join(", ")),l=i.computed(()=>V.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(j=>{var ue;const Z=(ue=r.value)==null?void 0:ue.products;return V.isArray(Z)&&Z.includes(j.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>V.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>V.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>V.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>V.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var j,Z,ue;return((j=e.categoryItem.properties)==null?void 0:j.configurator)!==void 0&&Fd((Z=e.categoryItem.properties)==null?void 0:Z.configurator)&&Ad(e.categoryItem)&&((ue=e.categoryItem.properties)==null?void 0:ue.configuratorSettings)!==void 0&&(V.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),f=i.computed(()=>g.value&&(V.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>V.isNil(e.categoryContextButtonsConfig)?[]:V.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new U.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),B=i.computed(()=>!V.isUndefined(e.isCategoryItemSelected)),C=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),T=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),$=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),x=i.computed(()=>W.value&&kt.getDeviceTypeByResolution()===Ze.laptop?"auto":"fixed"),v=i.useTemplateRef("collapse-item-reference"),w=i.computed(()=>{var j,Z;return(Z=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:Z.priceCoefficient}),R=i.computed(()=>{var j,Z;return(Z=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:Z.increasePercent}),N=(j,Z="ru-RU")=>0 .toLocaleString(Z,{style:"currency",currency:j,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),M=j=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:j,target:v.value})},E=(j,Z)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:Z,isLoadingState:y,target:v.value})},A=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:v.value})},P=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:v.value})},Y=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:v.value})},ee=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:v.value})},I=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:v.value})},L=j=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:j,target:v.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},W=i.ref(0),z=i.computed(()=>W.value&&o.value.length>0?zm(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}):[]),D=V.debounce(()=>{W.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",D)}),window.addEventListener("resize",D),D(),(j,Z)=>{const ue=O.NCheckbox,oe=bf,re=O.NTooltip,Fe=gf,je=O.NTag,Ae=hf,Gt=cf,Te=O.NButton,sn=of,on=Ga,$t=Ka,Lt=Ua,an=Ds,wt=O.NDropdown,Dn=O.NDataTable,ln=O.NAlert,Zt=O.NSpin;return i.openBlock(),i.createBlock(Za,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":E},{"pre-arrow":i.withCtx(()=>{var $e,G;return[B.value?(i.openBlock(),i.createElementBlock("div",_0,[i.createVNode(ue,{checked:C.value,indeterminate:$.value,disabled:T.value,"onUpdate:checked":M},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&(($e=b.value)!=null&&$e.isDisabled)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[Z[1]||(Z[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((G=b.value)==null?void 0:G.isFavorite)??!1?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Fe,{class:"pt-1.5"})]),default:i.withCtx(()=>[Z[2]||(Z[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var $e,G,se,Oe,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":($e=b.value)==null?void 0:$e.isDisabled})},[i.createVNode(re,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[Z[3]||(Z[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:Z[0]||(Z[0]=i.withModifiers((...Je)=>i.unref(V.noop)&&i.unref(V.noop)(...Je),["prevent","stop"]))},[(G=t.categoryItem.properties)!=null&&G.m2Price?(i.openBlock(),i.createBlock(je,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((se=t.categoryItem.properties)==null?void 0:se.templateCost)&&t.categoryItem.properties.m2PriceRetail&&R.value}),round:""},{default:i.withCtx(()=>{var Je;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Je=t.categoryItem.properties)!=null&&Je.templateCost&&t.categoryItem.properties.m2PriceRetail&&R.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[R.value?(i.openBlock(),i.createBlock(je,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[R.value?(i.openBlock(),i.createElementBlock("span",w0,i.toDisplayString(R.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(je,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",x0,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"])):(Oe=t.categoryItem.properties)!=null&&Oe.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[w.value||R.value?(i.openBlock(),i.createBlock(je,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Je;return[w.value?(i.openBlock(),i.createElementBlock("span",k0,i.toDisplayString((Je=w.value)==null?void 0:Je.name),1)):i.createCommentVNode("",!0),R.value?(i.openBlock(),i.createElementBlock("span",v0,i.toDisplayString(R.value>0?"+":"")+i.toDisplayString(R.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(je,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=b.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(je,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ee},{default:i.withCtx(()=>[i.createVNode(re,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Je,Dt;return[i.createElementVNode("span",C0,[i.createVNode(Ae),i.createTextVNode(" "+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name),1)])]}),default:i.withCtx(()=>{var Je,Dt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",S0,[i.createElementVNode("ul",B0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},($e,G)=>(i.openBlock(),i.createElementBlock("li",{key:G}," ("+i.toDisplayString(G)+"): "+i.toDisplayString($e),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,($e,G)=>(i.openBlock(),i.createElementBlock("li",{key:G}," ("+i.toDisplayString(G)+"): "+i.toDisplayString($e),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var $e;return[i.createElementVNode("div",T0,[d.value?(i.openBlock(),i.createBlock(re,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:A},{default:i.withCtx(()=>{var G;return[(G=b.value)!=null&&G.isDisabled?(i.openBlock(),i.createBlock(oe,{key:1})):(i.openBlock(),i.createBlock(Gt,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var G;return[(G=b.value)!=null&&G.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),u.value&&!(($e=b.value)!=null&&$e.manager)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:Y},{default:i.withCtx(()=>[i.createVNode(sn)]),_:1},8,["size"])]),default:i.withCtx(()=>{var G,se,Oe;return[(G=b.value)!=null&&G.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Oe=(se=b.value)==null?void 0:se.manager)==null?void 0:Oe.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:P},{default:i.withCtx(()=>{var G;return[(G=b.value)!=null&&G.isRequired?(i.openBlock(),i.createBlock($t,{key:1})):(i.openBlock(),i.createBlock(on,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[Z[4]||(Z[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(re,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary",onClick:I},{default:i.withCtx(()=>[i.createVNode(Lt)]),_:1},8,["size"])]),default:i.withCtx(()=>[Z[5]||(Z[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(wt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:L},{default:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(an)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(j.$slots,"default",{},()=>{var $e,G,se;return[i.createElementVNode("div",R0,[s.value?(i.openBlock(),i.createBlock(Vd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?(($e=r.value)==null?void 0:$e.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)]),g.value&&f.value?(i.openBlock(),i.createBlock(Ed,{key:0,"event-emitter":t.eventEmitter,settings:(G=t.categoryItem.properties)==null?void 0:G.configuratorSettings,editor:(se=t.categoryItem.properties)==null?void 0:se.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",$0,[g.value?(i.openBlock(),i.createBlock(Te,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:i.withCtx(()=>[...Z[6]||(Z[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Dn,{columns:z.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Oe=>Oe.id,"table-layout":x.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(ln,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(ln,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Zt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...Z[7]||(Z[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),E0=Wn(P0,[["__scopeId","data-v-3560e7d3"]]),F0={class:"sc-collapse flex w-full flex-col"},A0={},Md=i.defineComponent({...A0,__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",F0,[i.renderSlot(o.$slots,"default")]))}}),M0={},Vd=i.defineComponent({...M0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(or,"medium"),r=i.computed(()=>V.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(V.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=O.NSpin,c=O.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Md,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(E0,{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)}}}),V0={},Id=i.defineComponent({...V0,__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(()=>V.isArray(r.value)),a=new U.Reference,l=i.computed(()=>V.isNil(r.value)?o.value?[]:null:V.isArray(r.value)?r.value.map(g=>g.id):r.value.id),c=i.computed(()=>Pt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var f;if(V.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||V.isNil(g)||(f=c.value.find(b=>b.value===g))==null?void 0:f.item;s("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),I0={},O0=i.defineComponent({...I0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var B,C;const n=t,r=e,s=()=>{const T=U.PriceCoefficient.getRetailPriceCoefficient();return V.unset(T,"isNewRec"),T},o=T=>!T||T.id===s().id,a=i.computed(()=>{var T;return((T=n.catalogItem)==null?void 0:T.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=T=>{var $,x,v,w;return T.id===s().id?($=l.value)==null?void 0:$.getRetailCost():(w=(v=(x=l.value)==null?void 0:x.priceCoefficients)==null?void 0:v.find(R=>R.coefficient.id===T.id))==null?void 0:w.cost},d=i.computed(()=>{var $;const T=[...(($=U.useReferencesStore().priceCoefficientsReference)==null?void 0:$.map(x=>structuredClone(i.toRaw(x))))??[],s()];return a.value&&T.forEach(x=>{var w;const v=c(x);v?x.name+=` (${v} ${(w=l.value)==null?void 0:w.currency.symbol})`:x.name=""}),T.filter(x=>x.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((C=(B=n.value)==null?void 0:B.value)==null?void 0:C.toString())??null),m=i.ref(null),g=i.computed(()=>{var T,$;return($=(T=l.value)==null?void 0:T.priceCoefficients)==null?void 0:$.find(x=>x.coefficient.slug===U.PriceCoefficientEnum.K0)}),f=i.ref(void 0),p=()=>{var $,x,v;f.value=void 0;let T=Number.parseFloat((($=h.value)==null?void 0:$.replace(",","."))??"");if(T=Number.isNaN(T)?void 0:T,a.value)if(u.value||h.value){const w=s(),R=c(u.value??w)??0,N=R+R*((T??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(N),N>(((x=l.value)==null?void 0:x.getRetailCost())??N)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&N<(((v=g.value)==null?void 0:v.cost)??0)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(T)?void 0:T,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=T=>{V.isArray(T)||V.isNull(T)||(u.value=T,h.value=null,!u.value&&h.value&&(u.value=s()),p())},y=()=>{u.value||(u.value=s()),p()},_=T=>{var x,v,w,R,N,M;const $=Number.parseFloat((T==null?void 0:T.replace(",","."))??"");if(a.value){let E=0;if($<=0)u.value=void 0,h.value=null;else if(g.value&&$<(((x=g.value)==null?void 0:x.cost)??0))u.value=(v=g.value)==null?void 0:v.coefficient,E=($-g.value.cost)*100/g.value.cost,f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if($>(((w=l.value)==null?void 0:w.getRetailCost())??$)){u.value=s();const A=((R=l.value)==null?void 0:R.getRetailCost())??0;E=($-A)*100/A,f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const A=(M=(N=l.value)==null?void 0:N.priceCoefficients)==null?void 0:M.filter(P=>P.cost<$);if(A&&A.length>0){const P=A.at(-1);u.value=P==null?void 0:P.coefficient,E=($-((P==null?void 0:P.cost)??0))*100/((P==null?void 0:P.cost)??1)}f.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(E),r("update:value",{value:Number.isNaN(E)?void 0:E,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN($)?void 0:$,coefficient:void 0})};return i.onMounted(()=>{var T,$,x,v;n.calculationType===U.CalculationTypeEnum.m2Cost?m.value=(($=(T=n.value)==null?void 0:T.value)==null?void 0:$.toString())??null:!((x=n.value)!=null&&x.coefficient)&&((v=n.value)!=null&&v.value)&&(u.value=s()),p()}),(T,$)=>{var w,R,N;const x=O.NInput,v=O.NInputGroup;return i.openBlock(),i.createBlock(i.unref(O.NFormItem),{"show-label":!i.unref(V.isNil)(t.label),label:t.label,"show-feedback":!i.unref(V.isNil)(((w=f.value)==null?void 0:w.feedback)??t.feedback),feedback:((R=f.value)==null?void 0:R.feedback)??t.feedback,"validation-status":((N=f.value)==null?void 0:N.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(v,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Id,{class:"w-full min-w-0 flex-1",value:u.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(x,{value:h.value,"onUpdate:value":[$[0]||($[0]=M=>h.value=M),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[$[3]||($[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[$[2]||($[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(x,{key:1,value:m.value,"onUpdate:value":[$[1]||($[1]=M=>m.value=M),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var M;return[i.createTextVNode(i.toDisplayString((M=l.value)==null?void 0:M.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),z0={key:0,class:"flex flex-row gap-2.5"},L0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},D0={},Od=i.defineComponent({...D0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=kt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=kt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{s("opening"),o.value=!0,s("update:show",o.value)},h=(g="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let f=!1;s("closing",g,()=>{f=!0}),f||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",f=>{a.value=f})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:m}),(g,f)=>{const p=O.NButton,b=O.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:f[1]||(f[1]=y=>h("header")),onEsc:f[2]||(f[2]=y=>h("esc")),onMaskClick:f[3]||(f[3]=y=>h("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",z0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",L0,[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:f[0]||(f[0]=y=>h("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"])}}}),H0={class:"text-sm"},W0={},j0=i.defineComponent({...W0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var x,v,w;return((x=o.value)==null?void 0:x.unit.isLinear)&&((w=(v=o.value)==null?void 0:v.properties)==null?void 0:w.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,m=()=>({length:{},quantity:{},marker:{}}),g=i.ref(m()),f=i.ref(!1),p=i.computed(()=>{var N,M,E,A;if(!o.value)return{};const x=U.UnitsHelper.getProductLengthMultiplicity(o.value),v=U.UnitsHelper.getProductMultiplicity(o.value),w=((M=(N=o.value)==null?void 0:N.properties)==null?void 0:M.minLength)||x,R=(A=(E=o.value)==null?void 0:E.properties)==null?void 0:A.maxLength;return{length:[ae.required,ae.min(w??.1),ae.max(R),ae.step(x),He.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(v),ae.step(v),He.serverValidation(g.value.quantity.feedback)],marker:[He.serverValidation(g.value.marker.feedback)]}}),b=i.computed(()=>{var x,v,w;return o.value?((x=o.value.properties)==null?void 0:x.lengthStep)??((v=o.value.properties)!=null&&v.ignoreMinCountCheck?0:((w=o.value.properties)==null?void 0:w.minCount)??0):0}),y=i.computed(()=>{var w,R,N,M,E,A,P,Y,ee;if(!o.value)return"";const x=((R=(w=o.value)==null?void 0:w.properties)==null?void 0:R.minLength)??((M=(N=o.value)==null?void 0:N.properties)!=null&&M.ignoreMinCountCheck?0:(A=(E=o.value)==null?void 0:E.properties)==null?void 0:A.minCount),v=(Y=(P=o.value)==null?void 0:P.properties)==null?void 0:Y.maxLength;return x||v?`(${x?`от ${x}`:""}${x&&v?" ":""}${v?`до ${v}`:""} ${(ee=o.value)==null?void 0:ee.unit.name})`:""}),_=x=>{var M,E;if(!((E=(M=o.value)==null?void 0:M.properties)!=null&&E.isLengthConfigurator)||!u.value||V.isNil(x)||b.value===0)return;const v=x/b.value,w=Math.round(v),R=U.UnitsHelper.getProductMultiplicity(o.value),N=Math.max(w,R);u.value.quantity=N},B=x=>{var N,M,E,A;if(!((M=(N=o.value)==null?void 0:N.properties)!=null&&M.isLengthConfigurator)||!u.value||V.isNil(x)||b.value===0)return;const v=x*b.value,w=((E=o.value.properties)==null?void 0:E.minLength)||U.UnitsHelper.getProductLengthMultiplicity(o.value),R=(A=o.value.properties)==null?void 0:A.maxLength;w!==void 0&&v<w?u.value.length=w:R!==void 0&&v>R?u.value.length=R:u.value.length=v},C=async x=>{var w;const v=V.cloneDeep(u.value);try{await((w=r.value)==null?void 0:w.validate(R=>{if(!R){if(!o.value||!v)return;U.UnitsHelper.productIsMeasurable(o.value)||delete v.length,a.value&&b.value&&(v.length=b.value),f.value=!0,h("submit",v,g.value,()=>{f.value=!1,x(!1),i.nextTick(()=>{var N;(N=r.value)==null||N.validate(V.noop).catch(V.noop)})})}}))}catch{}},T=()=>{o.value=null,l.value=void 0,u.value=null,g.value=m()};return e({show:(x,v)=>{var w,R,N,M,E;if(o.value=x,l.value=v==null?void 0:v.cartItemData,c.value=v==null?void 0:v.orderId,d.value=(v==null?void 0:v.canSetDopProdaga)??!1,u.value=new U.OrderItemBase((v==null?void 0:v.cartItemData)??new U.OrderItemBase({product:x,quantity:U.UnitsHelper.productIsMeasurable(o.value)?1:((w=x==null?void 0:x.properties)==null?void 0:w.minCount)??1,length:((R=x==null?void 0:x.properties)==null?void 0:R.minLength)||((N=x==null?void 0:x.properties)!=null&&N.ignoreMinCountCheck?0:(M=x==null?void 0:x.properties)==null?void 0:M.minCount)||0})),(E=x==null?void 0:x.properties)!=null&&E.isLengthConfigurator&&u.value&&b.value>0){const A=b.value,P=u.value.quantity||1;u.value.length=P*A}},closeDialog:T}),(x,v)=>{var E;const w=O.NFormItem,R=O.NInputGroupLabel,N=O.NInputGroup,M=O.NCheckbox;return i.openBlock(),i.createBlock(Od,{ref:"base-dialog-reference",show:!i.unref(V.isNil)(o.value)&&!i.unref(V.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(E=o.value)==null?void 0:E.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:f.value,"modal-width":500,onAccept:C,onClosing:T},{default:i.withCtx(()=>{var A;return[o.value&&u.value?(i.openBlock(),i.createBlock(i.unref(O.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((A=s.value)==null?void 0:A.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(w,{key:0,path:"length",label:`Метраж, ${y.value+o.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.length,"onUpdate:value":[v[0]||(v[0]=P=>u.value.length=P),_],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[1]||(v[1]=P=>i.unref(Ls)(P,".",!1)),onInput:v[2]||(v[2]=P=>i.unref(ze)(g.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(w,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode(N,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[3]||(v[3]=P=>u.value.quantity=P),B],parse:i.unref(xt),step:i.unref(U.UnitsHelper).getProductMultiplicity(o.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[4]||(v[4]=P=>i.unref(Ls)(P,".",!1)),onInput:v[5]||(v[5]=P=>i.unref(ze)(g.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock(R,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(o.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",H0,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(U.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(w,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[6]||(v[6]=P=>i.unref(ze)(g.value,"marker")),"onUpdate:value":v[7]||(v[7]=P=>u.value.marker=P??null),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(M,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":v[8]||(v[8]=P=>u.value.isAdditionalSale=P),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...v[9]||(v[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),q0={class:"flex flex-row gap-1"},X0={class:"sc-client-name flex flex-col gap-1 text-base"},Y0=["href"],U0={key:1,class:"text-sc-grey"},K0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},G0={key:0},Z0={key:1,class:"text-sm"},Q0={},pr=i.defineComponent({...Q0,__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?Tn.format(n.client.lastLoginAt,U.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),o=a=>{V.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Hs,d=O.NButton,u=O.NPopover;return i.openBlock(),i.createElementBlock("div",q0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(V.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",X0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>o(h))},[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",U0," [ Деактивирован ] "))],8,Y0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",K0," г. "+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",G0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Z0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),J0={class:"text-base"},eb={},zd=i.defineComponent({...eb,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",J0,i.toDisplayString(t.contragent.name),1))}}),tb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nb(t,e){return i.openBlock(),i.createElementBlock("svg",tb,[...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 ib=i.markRaw({name:"tabler-mail",render:nb}),rb=["href"],sb={},ob=i.defineComponent({...sb,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=ib;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,rb)],2)}}}),ab={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lb(t,e){return i.openBlock(),i.createElementBlock("svg",ab,[...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 Ld=i.markRaw({name:"fa6-brands-viber",render:lb}),cb={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},db=["id"],ub=["id"],hb=["fill"],fb=["fill"];function mb(t,e){return i.openBlock(),i.createElementBlock("svg",cb,[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,db),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,ub)]),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,hb),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,fb),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 Dd=i.markRaw({name:"logos-whatsapp-icon",render:mb,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),gb={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},pb=["id"],yb=["fill"];function bb(t,e){return i.openBlock(),i.createElementBlock("svg",gb,[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,pb)]),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,yb),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 Hd=i.markRaw({name:"logos-telegram",render:bb,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),_b={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wb(t,e){return i.openBlock(),i.createElementBlock("svg",_b,[...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 Wd=i.markRaw({name:"ion-call",render:wb}),xb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kb(t,e){return i.openBlock(),i.createElementBlock("svg",xb,[...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 vb=i.markRaw({name:"tabler-phone-call",render:kb}),Cb={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Sb=["href"],Bb=["href"],Tb=["href"],Rb=["href"],$b={},Nb=i.defineComponent({...$b,__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 V.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return V.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return V.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=vb,u=Wd,h=Hd,m=Dd,g=Ld;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]=f=>a.value=!a.value),onFocusout:c[1]||(c[1]=f=>a.value=!1),onMouseleave:c[2]||(c[2]=f=>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",Cb,[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(u)],8,Sb)):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(h)],8,Bb)):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,Tb)):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,Rb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Pb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Eb(t,e){return i.openBlock(),i.createElementBlock("svg",Pb,[...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 Fb=i.markRaw({name:"mdi-envelope",render:Eb}),Ab={class:"flex flex-col gap-1"},Mb={key:0,class:"mb-2 flex flex-col text-base"},Vb={key:0,class:"text-sc-dark-grey text-sm"},Ib={key:1,class:"whitespace-nowrap text-sm"},Ob={key:2,class:"whitespace-nowrap text-sm"},zb={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Lb=["href"],Db=["href"],Hb=["href"],Wb=["href"],jb=["href"],qb={key:0,class:"flex flex-col text-base"},Xb={key:0,class:"text-sc-dark-grey text-sm"},Yb={key:1,class:"mt-2 text-sm"},Ub={key:0,class:"-mt-1"},Kb={},Gb=i.defineComponent({...Kb,__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 V.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return V.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return V.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 u=Wd,h=Hd,m=Dd,g=Ld,f=Fb,p=O.NPopover;return i.openBlock(),i.createElementBlock("div",Ab,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,B,C,T;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]=$=>l.value=!0),onFocusin:d[1]||(d[1]=$=>l.value=!0),onMouseleave:d[2]||(d[2]=$=>l.value=!1),onFocusout:d[3]||(d[3]=$=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(B=t.contact)!=null&&B.position)?(i.openBlock(),i.createElementBlock("div",Mb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(C=t.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",Vb,i.toDisplayString((T=t.contact)==null?void 0:T.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Ib,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Ob,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",zb,[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(u)],8,Lb)):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(h)],8,Db)):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,Hb)):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,Wb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(f)],8,jb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,B,C,T;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",qb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",Xb,i.toDisplayString((B=t.contact)==null?void 0:B.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",Yb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((T=t.contact)==null?void 0:T.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",Ub,[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 Zb{constructor(e){S(this,"minHeight");S(this,"maxHeights");S(this,"minWidth");S(this,"maxWidths");S(this,"netType");S(this,"color");S(this,"mountType");S(this,"descriptions");S(this,"crossbarCount");S(this,"heightOverlaps");S(this,"widthOverlaps");S(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=zs.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=zs.objectToSnake(e.heightOverlaps),this.widthOverlaps=zs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}const Qb={class:"flex flex-wrap gap-2"},Jb={class:"flex flex-col"},e_={class:"flex flex-col"},t_={},n_=i.defineComponent({...t_,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>U.useBaseConfigStateStore().config.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 V.forOwn(U.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?Tn.startOfDay(new Date(a)):void 0,to:l?Tn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var u,h,m,g,f,p;const c=O.NButton,d=O.NDatePicker;return i.openBlock(),i.createElementBlock("div",Qb,[i.createVNode(d,{value:((h=(u=t.dateRange)==null?void 0:u.from)==null?void 0:h.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",Jb,[(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 B,C;return o((B=b==null?void 0:b.from)==null?void 0:B.getTime(),(C=b==null?void 0:b.to)==null?void 0:C.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:((f=(g=t.dateRange)==null?void 0:g.to)==null?void 0:f.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",e_,[(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 B,C;return o((B=b==null?void 0:b.from)==null?void 0:B.getTime(),(C=b==null?void 0:b.to)==null?void 0:C.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_={class:"sc-lbl-date text-nowrap"},r_={},fs=i.defineComponent({...r_,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>Tn.format(e.date,U.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>Tn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",i_,i.toDisplayString(n.value),1),t.isShowTime?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)):i.createCommentVNode("",!0)],2))}}),s_={class:"flex flex-row gap-2.5"},o_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},a_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},l_={class:"mb-0.5 sm:mb-0 sm:ml-3"},c_={},d_=i.defineComponent({...c_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=us,s=O.NButton,o=O.NPopover;return i.openBlock(),i.createElementBlock("div",s_,[i.createElementVNode("div",o_,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",a_,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",l_,[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)])])])])}}}),u_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function h_(t,e){return i.openBlock(),i.createElementBlock("svg",u_,[...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 f_=i.markRaw({name:"ion-download-outline",render:h_}),m_={},g_=i.defineComponent({...m_,__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 u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=f_;return i.openBlock(),i.createBlock(i.unref(O.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(O.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"])}}}),p_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function y_(t,e){return i.openBlock(),i.createElementBlock("svg",p_,[...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 b_=i.markRaw({name:"ion-checkmark-done-sharp",render:y_}),__={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function w_(t,e){return i.openBlock(),i.createElementBlock("svg",__,[...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 x_=i.markRaw({name:"ion-options-outline",render:w_}),k_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},v_={class:"flex-auto"},C_={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"},S_={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"},B_={},Ho=i.defineComponent({...B_,__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 u=x_,h=O.NButton,m=O.NPopover,g=b_,f=us;return i.openBlock(),i.createElementBlock("div",k_,[i.createElementVNode("div",v_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",C_,[i.createElementVNode("div",S_,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(u)]),_: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(h,{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(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),T_={},jd=i.defineComponent({...T_,__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(Ho,{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(Ho,{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"]))]))}}),R_={},$_=i.defineComponent({...R_,__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=V.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(O.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=u=>s.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),N_={},P_=i.defineComponent({...N_,__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","focus"],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=V.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,f)=>(i.openBlock(),i.createBlock(i.unref(O.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:f[0]||(f[0]=p=>s("keydown",p)),onInput:f[1]||(f[1]=p=>s("input",p)),onFocus:f[2]||(f[2]=p=>s("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),E_={},F_=i.defineComponent({...E_,__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=V.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(V.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(V.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 u=sr.parsePhoneNumberWithError(`+${d}`);u.isValid()?s.value=u.format("E.164"):u.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(u){if(u instanceof sr.ParseError)s.value=d;else throw u}};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(Uh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>s.value=u),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"]))}}),A_=Wn(F_,[["__scopeId","data-v-751dbb0e"]]),M_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V_(t,e){return i.openBlock(),i.createElementBlock("svg",M_,[...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 I_=i.markRaw({name:"tabler-external-link",render:V_}),O_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},z_=["href"],L_={},D_=i.defineComponent({...L_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=I_,s=O.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(V.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",O_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,z_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),H_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function W_(t,e){return i.openBlock(),i.createElementBlock("svg",H_,[...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 j_=i.markRaw({name:"ion-remove-circle-outline",render:W_});let ms=[];const qd=new WeakMap;function q_(){ms.forEach(t=>t(...qd.get(t))),ms=[]}function Xd(t,...e){qd.set(t,e),!ms.includes(t)&&ms.push(t)===1&&requestAnimationFrame(q_)}function yr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function br(t){return t.composedPath()[0]||null}function _r(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function wr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function en(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 Yd={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 X_(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 Y_(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 _n="^\\s*",wn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",zt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",Ud=new RegExp(`${_n}hsl\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Kd=new RegExp(`${_n}hsv\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Gd=new RegExp(`${_n}hsla\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),Zd=new RegExp(`${_n}hsva\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),U_=new RegExp(`${_n}rgb\\s*\\(${zt},${zt},${zt}\\)${wn}`),K_=new RegExp(`${_n}rgba\\s*\\(${zt},${zt},${zt},${zt}\\)${wn}`),G_=new RegExp(`${_n}#${mi}${mi}${mi}${wn}`),Z_=new RegExp(`${_n}#${gi}${gi}${gi}${wn}`),Q_=new RegExp(`${_n}#${mi}${mi}${mi}${mi}${wn}`),J_=new RegExp(`${_n}#${gi}${gi}${gi}${gi}${wn}`);function At(t){return parseInt(t,16)}function e1(t){try{let e;if(e=Gd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Ud.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function t1(t){try{let e;if(e=Zd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Kd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=Z_.exec(t))return[At(e[1]),At(e[2]),At(e[3]),1];if(e=U_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),1];if(e=K_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),yi(e[13])];if(e=G_.exec(t))return[At(e[1]+e[1]),At(e[2]+e[2]),At(e[3]+e[3]),1];if(e=J_.exec(t))return[At(e[1]),At(e[2]),At(e[3]),yi(At(e[4])/255)];if(e=Q_.exec(t))return[At(e[1]+e[1]),At(e[2]+e[2]),At(e[3]+e[3]),yi(At(e[4]+e[4])/255)];if(t in Yd)return pi(Yd[t]);if(Ud.test(t)||Gd.test(t)){const[n,r,s,o]=e1(t);return[...Y_(n,r,s),o]}else if(Kd.test(t)||Zd.test(t)){const[n,r,s,o]=t1(t);return[...X_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function n1(t){return t>1?1:t<0?0:t}function Wo(t,e,n,r){return`rgba(${mt(t)}, ${mt(e)}, ${mt(n)}, ${n1(r)})`}function jo(t,e,n,r,s){return mt((t*e*(1-r)+n*r)/s)}function i1(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],s=yi(n+r-n*r);return Wo(jo(t[0],n,e[0],r,s),jo(t[1],n,e[1],r,s),jo(t[2],n,e[2],r,s),s)}function Ie(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?Wo(n,r,s,e.alpha):Wo(n,r,s,o)}function gs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return r1([n*a,r*a,s*a,o*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function ps(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function mt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function r1(t){const[e,n,r]=t;return 3 in t?`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, ${yi(t[3])})`:`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, 1)`}function s1(t=8){return Math.random().toString(16).slice(2,2+t)}function Qd(t){return Array.isArray(t)?t:[t]}const qo={STOP:"STOP"};function Jd(t,e){const n=e(t);t.children!==void 0&&n!==qo.STOP&&t.children.forEach(r=>Jd(r,e))}function o1(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 a1(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function l1(t){return t.children}function c1(t){return t.key}function d1(){return!1}function u1(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function h1(t){return t.disabled===!0}function f1(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function m1(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Xo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Yo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function g1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function p1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function y1(t){return(t==null?void 0:t.type)==="group"}function b1(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 _1 extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function w1(t,e,n,r){return ys(e.concat(t),n,r,!1)}function x1(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 k1(t,e,n,r){const s=ys(e,n,r,!1),o=ys(t,n,r,!0),a=x1(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function Uo(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:g1(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:p1(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:u}=e;let h;s!==void 0?h=k1(s,n,e,d):r!==void 0?h=w1(r,n,e,d):h=ys(n,e,d,!1);const m=c==="parent",g=c==="child"||l,f=h,p=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,B=u.get(y);for(const C of B){if(C.isLeaf)continue;const{key:T,shallowLoaded:$}=C;if(g&&$&&C.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&f.has(R.key)&&f.delete(R.key)}),C.disabled||!$)continue;let x=!0,v=!1,w=!0;for(const R of C.children){const N=R.key;if(!R.disabled){if(w&&(w=!1),f.has(N))v=!0;else if(p.has(N)){v=!0,x=!1;break}else if(x=!1,v)break}}x&&!w?(m&&C.children.forEach(R=>{!R.disabled&&f.has(R.key)&&f.delete(R.key)}),f.add(T)):v&&p.add(T),_&&g&&f.has(T)&&f.delete(T)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(p)}}function ys(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&&Jd(d,u=>{if(u.disabled)return qo.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),f1(u.rawNode,o))){if(r)return qo.STOP;if(!n)throw new _1}})}),l}function v1(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 C1(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function S1(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 eu(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?B1:S1,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 u=Ko(d,o);u!==null?l=u:c(s(d,n))}else{const u=s(d,!1);if(u!==null)c(u);else{const h=T1(d);h!=null&&h.isGroup?c(s(h,n)):n&&c(s(d,!0))}}}}return c(t),l}function B1(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 T1(t){return t.parent}function Ko(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 u=Ko(d,e);if(u!==null)return u}else return d}}return null}const R1={getChild(){return this.ignored?null:Ko(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return eu(this,"next",t)},getPrev(t={}){return eu(this,"prev",t)}};function $1(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 N1(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var P1={};function tu(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var u;P1.NODE_ENV!=="production"&&m1(c,s)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=o,!h.ignored){const m=s(c);Array.isArray(m)&&(h.children=tu(m,e,n,r,s,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function E1(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=h1,getIgnored:a=d1,getIsGroup:l=y1,getKey:c=c1}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:l1,u=e.ignoreEmptyChildren?C=>{const T=d(C);return Array.isArray(T)?T.length?T:null:T}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return a1(this.rawNode,u)},get shallowLoaded(){return u1(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(C){return N1(this,C)}},R1),m=tu(t,r,s,h,u);function g(C){if(C==null)return null;const T=r.get(C);return T&&!T.isGroup&&!T.ignored?T:null}function f(C){if(C==null)return null;const T=r.get(C);return T&&!T.ignored?T:null}function p(C,T){const $=f(C);return $?$.getPrev(T):null}function b(C,T){const $=f(C);return $?$.getNext(T):null}function y(C){const T=f(C);return T?T.getParent():null}function _(C){const T=f(C);return T?T.getChild():null}const B={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:u,getFlattenedNodes(C){return $1(m,C)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return C1(m)},getPath(C,T={}){return v1(C,T,B)},getCheckedKeys(C,T={}){const{cascade:$=!0,leafOnly:x=!1,checkStrategy:v="all",allowNotLoaded:w=!1}=T;return Uo({checkedKeys:Xo(C),indeterminateKeys:Yo(C),cascade:$,leafOnly:x,checkStrategy:v,allowNotLoaded:w},B)},check(C,T,$={}){const{cascade:x=!0,leafOnly:v=!1,checkStrategy:w="all",allowNotLoaded:R=!1}=$;return Uo({checkedKeys:Xo(T),indeterminateKeys:Yo(T),keysToCheck:C==null?[]:Qd(C),cascade:x,leafOnly:v,checkStrategy:w,allowNotLoaded:R},B)},uncheck(C,T,$={}){const{cascade:x=!0,leafOnly:v=!1,checkStrategy:w="all",allowNotLoaded:R=!1}=$;return Uo({checkedKeys:Xo(T),indeterminateKeys:Yo(T),keysToUncheck:C==null?[]:Qd(C),cascade:x,leafOnly:v,checkStrategy:w,allowNotLoaded:R},B)},getNonLeafKeys(C={}){return o1(m,C)}};return B}function bs(t){return t.composedPath()[0]}const F1={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function A1(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(bs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(bs(a))},o=a=>{r&&(e.contains(bs(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 nu(t,e,n){const r=F1[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=A1(t,e,n)),o}function M1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=nu(t,e,n);return Object.keys(s).forEach(o=>{Tt(o,document,s[o],r)}),!0}return!1}function V1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=nu(t,e,n);return Object.keys(s).forEach(o=>{it(o,document,s[o],r)}),!0}return!1}function I1(){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(x,v,w){const R=x[v];return x[v]=function(){return w.apply(x,arguments),R.apply(x,arguments)},x}function o(x,v){x[v]=Event.prototype[v]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var x;return(x=a.get(this))!==null&&x!==void 0?x:null}function d(x,v){l!==void 0&&Object.defineProperty(x,"currentTarget",{configurable:!0,enumerable:!0,get:v??l.get})}const u={bubble:{},capture:{}},h={};function m(){const x=function(v){const{type:w,eventPhase:R,bubbles:N}=v,M=bs(v);if(R===2)return;const E=R===1?"capture":"bubble";let A=M;const P=[];for(;A===null&&(A=window),P.push(A),A!==window;)A=A.parentNode||null;const Y=u.capture[w],ee=u.bubble[w];if(s(v,"stopPropagation",n),s(v,"stopImmediatePropagation",r),d(v,c),E==="capture"){if(Y===void 0)return;for(let I=P.length-1;I>=0&&!t.has(v);--I){const L=P[I],q=Y.get(L);if(q!==void 0){a.set(v,L);for(const W of q){if(e.has(v))break;W(v)}}if(I===0&&!N&&ee!==void 0){const W=ee.get(L);if(W!==void 0)for(const z of W){if(e.has(v))break;z(v)}}}}else if(E==="bubble"){if(ee===void 0)return;for(let I=0;I<P.length&&!t.has(v);++I){const L=P[I],q=ee.get(L);if(q!==void 0){a.set(v,L);for(const W of q){if(e.has(v))break;W(v)}}}}o(v,"stopPropagation"),o(v,"stopImmediatePropagation"),d(v)};return x.displayName="evtdUnifiedHandler",x}function g(){const x=function(v){const{type:w,eventPhase:R}=v;if(R!==2)return;const N=h[w];N!==void 0&&N.forEach(M=>M(v))};return x.displayName="evtdUnifiedWindowEventHandler",x}const f=m(),p=g();function b(x,v){const w=u[x];return w[v]===void 0&&(w[v]=new Map,window.addEventListener(v,f,x==="capture")),w[v]}function y(x){return h[x]===void 0&&(h[x]=new Set,window.addEventListener(x,p)),h[x]}function _(x,v){let w=x.get(v);return w===void 0&&x.set(v,w=new Set),w}function B(x,v,w,R){const N=u[v][w];if(N!==void 0){const M=N.get(x);if(M!==void 0&&M.has(R))return!0}return!1}function C(x,v){const w=h[x];return!!(w!==void 0&&w.has(v))}function T(x,v,w,R){let N;if(typeof R=="object"&&R.once===!0?N=Y=>{$(x,v,N,R),w(Y)}:N=w,M1(x,v,N,R))return;const E=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=b(E,x),P=_(A,v);if(P.has(N)||P.add(N),v===window){const Y=y(x);Y.has(N)||Y.add(N)}}function $(x,v,w,R){if(V1(x,v,w,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0,E=M?"capture":"bubble",A=b(E,x),P=_(A,v);if(v===window&&!B(v,M?"bubble":"capture",x,w)&&C(x,w)){const ee=h[x];ee.delete(w),ee.size===0&&(window.removeEventListener(x,p),h[x]=void 0)}P.has(w)&&P.delete(w),P.size===0&&A.delete(v),A.size===0&&(window.removeEventListener(x,f,E==="capture"),u[E][x]=void 0)}return{on:T,off:$}}const{on:Tt,off:it}=I1(),Ki="@@mmoContext",O1={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Tt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(it("mousemoveoutside",t,n.handler),n.handler=e,Tt("mousemoveoutside",t,e)):(t[Ki].handler=e,Tt("mousemoveoutside",t,e)):n.handler&&(it("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&it("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",_s={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Tt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Tt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Tt("clickoutside",t,e,{capture:n.capture})):r.handler&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&it("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function z1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class L1{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&&z1("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 Go=new L1,Zi="@@ziContext",iu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Zi]={enabled:!!s,initialized:!1},s&&(Go.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Zi].enabled;s&&!o&&(Go.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!s},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Go.unregister(t,r)}};function D1(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 Ut(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 H1=typeof window<"u";let Qi,xr;(()=>{var t,e;Qi=H1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,xr=!1,Qi!==void 0?Qi.then(()=>{xr=!0}):xr=!0})();function W1(t){if(xr)return;let e=!1;i.onMounted(()=>{xr||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Zo(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function ws(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function ru(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 j1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function q1(){return j1}function Qo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Jo(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)){Jo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Jo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function su(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Jo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function ou(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function X1(t,e){const n=ou();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function ea(t){const e=t.getBoundingClientRect(),n=ou();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 Y1(t){return t.nodeType===9?null:t.parentNode}function au(t){if(t===null)return null;const e=Y1(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 au(e)}const lu=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=au(y),y!==null;)o.push(y);for(const _ of o)Tt("scroll",_,h,!0)},l=()=>{for(const y of o)it("scroll",y,h,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{Xd(m)},m=()=>{c.forEach(y=>y())},g=new Set,f=y=>{g.size===0&&Tt("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&it("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{it("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:u,addResizeListener:f,removeResizeListener:p}},render(){return Qo("binder",this.$slots)}}),cu=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(su("follower",this.$slots),[[e]]):su("follower",this.$slots)}}),U1="@css-render/vue3-ssr";function K1(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},es=Di.Multiply,np=[1,0,0,0,1,0,0,0,1],Kn=new un(9),ip=ft.Utils,Bc=new te,vo=new un([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:qe.document?qe.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Di,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;J.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 un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te),this._scale instanceof te?(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),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,u,h,m,g,f,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,B=t.renderer.ratio,C=Bc.copy(e._renderer.scale).multiply(B),T=e._stroke,$=e._linewidth,x=e._fill,v=e._renderer.opacity||e._opacity,w=e._cap,R=e._join,N=e._miter,M=e._closed,E=e.dashes,A=b.length,P=A-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*C.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*C.y),1);const Y=e._renderer.rect.centroid,ee=Y.x,I=Y.y;if(_.clearRect(0,0,y.width,y.height),x)if(typeof x=="string")_.fillStyle=x;else{const oe=ft.Utils.getRendererType(x._renderer.type);_e[oe].render.call(x,_,e),_.fillStyle=x._renderer.effect}if(T){if(typeof T=="string")_.strokeStyle=T;else{const oe=ft.Utils.getRendererType(T._renderer.type);_e[oe].render.call(T,_,e),_.strokeStyle=T._renderer.effect}$&&(_.lineWidth=hn(e)),N&&(_.miterLimit=N),R&&(_.lineJoin=R),!M&&w&&(_.lineCap=w)}typeof v=="number"&&(_.globalAlpha=v),E&&E.length>0&&(_.lineDashOffset=E.offset||0,_.setLineDash(E));let L,q,W,z,D,j,Z,ue;_.save(),_.scale(C.x,C.y),_.translate(ee,I),_.beginPath();for(let oe=0;oe<b.length;oe++){const re=b[oe];switch(g=re.x,f=re.y,re.command){case ne.close:_.closePath();break;case ne.arc:q=re.rx,W=re.ry,z=re.xAxisRotation,D=re.largeArcFlag,j=re.sweepFlag,n=M?It(oe-1,A):Math.max(oe-1,0),r=b[n],Z=r.x,ue=r.y,ip.renderSvgArcCommand(_,Z,ue,q,W,D,j,z,g,f);break;case ne.curve:n=M?It(oe-1,A):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||te.zero,u=re.controls&&re.controls.left||te.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=u.x+re.x,a=u.y+re.y):(o=u.x,a=u.y),_.bezierCurveTo(l,c,o,a,g,f),oe>=P&&M&&(s=L,h=re.controls&&re.controls.right||te.zero,m=s.controls&&s.controls.left||te.zero,re._relative?(l=h.x+re.x,c=h.y+re.y):(l=h.x,c=h.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,f=s.y,_.bezierCurveTo(l,c,o,a,g,f));break;case ne.line:_.lineTo(g,f);break;case ne.move:L=re,_.moveTo(g,f);break}}M&&_.closePath(),_e.isHidden.test(x)||(p=x._renderer&&x._renderer.offset,p&&(_.save(),_.translate(-x._renderer.offset.x,-x._renderer.offset.y),_.scale(x._renderer.scale.x,x._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(T)||(p=T._renderer&&T._renderer.offset,p&&(_.save(),_.translate(-T._renderer.offset.x,-T._renderer.offset.y),_.scale(T._renderer.scale.x,T._renderer.scale.y),_.lineWidth=$/T._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 u=d.x,h=d.y,m=d.controls;let g,f,p,b,y,_;o=Math.min(h,o),r=Math.min(u,r),s=Math.max(u,s),a=Math.max(h,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(g=d._relative?y.x+u:y.x,f=d._relative?y.y+h:y.y,p=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!g||!f||!p||!b)&&(o=Math.min(f,b,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(f,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;J.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 Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ve&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ve&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let h,m;this._scale instanceof te?(h=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,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 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(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,vo,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 u=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),J.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,u=e.dashes,h=e._size*o;let m=h;_e.isHidden.test(a)||(m+=l),r.width=gl(m),r.height=r.width;const g=m/r.width,f=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=hn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),u&&u.length>0&&(s.lineDashOffset=u.offset||0,s.setLineDash(u)),s.save(),s.translate(f,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,h/g*.5,0,ut),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;J.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,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,f=this._flagVertices,p=this._flagFill||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ve&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ve&&(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||u||h){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let b,y;this._scale instanceof te?(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,h&&(this._renderer.parent=s)}if(f){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),J.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=Bc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=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,f=g.x,p=g.y;let b,y,_,B,C,T,$,x,v,w,R;const N=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),N||(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 M=ft.Utils.getRendererType(c._renderer.type);_e[M].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const M=ft.Utils.getRendererType(a._renderer.type);_e[M].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(o.x,o.y),r.translate(f,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(T=c._renderer.scale.x,$=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(T,$),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,B=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,B),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(T=a._renderer.scale.x,$=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(T,$),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,B=a._renderer.offset.y/a._renderer.scale.y,C=l/a._renderer.scale.x,r.lineWidth=C,r.strokeText(e.value,_,B),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const M=r.measureText(e.value);switch(h){case"underline":v=M.actualBoundingBoxDescent,R=M.actualBoundingBoxDescent;break;case"strikethrough":v=0,R=0;break}x=-M.width/2,w=M.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(x,v),r.lineTo(w,R),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;J.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 Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ve&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ve&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),es(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let u,h;this._scale instanceof te?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,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 u=ft.Utils.getRendererType(this._mask._renderer.type);_e[u].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,vo,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),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.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 J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.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 J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;J.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 te||(this._renderer.offset=new te),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 te?(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 te||(this._renderer.scale=new te);let r,s;this._scale instanceof te?(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 J.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(),J.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 Ft("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 Tc=class extends K{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 un(np),scale:1,opacity:1},this._flagMatrix=!0,t=J.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 Ft("unable to create a webgl context. Try using another renderer.");r=Xt.create(e,Xt.path.vertex,Xt.types.vertex),s=Xt.create(e,Xt.path.fragment,Xt.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,vo,e.STATIC_DRAW),r=Xt.create(e,Xt.points.vertex,Xt.types.vertex),s=Xt.create(e,Xt.points.fragment,Xt.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"?Qs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,J.isObject(this.domElement.style)&&J.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(K.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}};k(Tc,"Utils",_e);var rp=J.extend({Error:Ft,getRatio:Qs,read:We,xhr:wc},J,vt,ul,hl),xe=class Vr{constructor(e){k(this,"_events",new K),k(this,"type",""),k(this,"renderer",null),k(this,"scene",null),k(this,"width",0),k(this,"height",0),k(this,"frameCount",0),k(this,"timeDelta",0),k(this,"playing",!1);const n=J.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Vr.Types.svg,autostart:!1});if(J.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),J.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Vr.Types[r])}this.renderer=new Vr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=sp.bind(this),this.fit.domElement=window,this.fit.attached=!0,J.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),J.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ot.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=op.bind(this),J.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(K.Types.resize,ap.bind(this)),this.scene=this.renderer.scene,Vr.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(K.Types.play)}pause(){return this.playing=!1,this.trigger(K.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=J.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ot.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(K.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(K.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 Kr(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 ve(e,n,void 0,void 0,void 0,void 0,ne.move),new ve(r,s,void 0,void 0,void 0,void 0,ne.line),new ve(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ne.line),new ve(r,s,void 0,void 0,void 0,void 0,ne.move),new ve(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ne.line)],d=new Ce(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new Un(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 mo(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 ve(l,c))}}const r=arguments[n-1],s=new Ce(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new fo(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new oo(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 te(a,l))}}const s=new ho(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 ve(c,d))}}const s=arguments[n-1],o=new Ce(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new fn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new Xe(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new Ye(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 xc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new bo(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Ve(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 We))return null;const o=We[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(Ot.temp.innerHTML=c,o=0;o<Ot.temp.children.length;o++)s=Ot.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ot.temp.children.length<=1?Ot.temp.children[0]:Ot.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(wc(e,l),r):(l(e),r)}};k(xe,"NextFrameId",Ct.NextFrameId),k(xe,"Types",Ct.Types),k(xe,"Version",Ct.Version),k(xe,"PublishDate",Ct.PublishDate),k(xe,"Identifier",Ct.Identifier),k(xe,"Resolution",Ct.Resolution),k(xe,"AutoCalculateImportedMatrices",Ct.AutoCalculateImportedMatrices),k(xe,"Instances",Ct.Instances),k(xe,"uniqueId",Ct.uniqueId),k(xe,"Anchor",ve),k(xe,"Collection",qn),k(xe,"Events",K),k(xe,"Group",st),k(xe,"Matrix",Di),k(xe,"Path",Ce),k(xe,"Registry",zr),k(xe,"Element",Li),k(xe,"Shape",Yn),k(xe,"Text",fn),k(xe,"Vector",te),k(xe,"Gradient",tt),k(xe,"Image",xc),k(xe,"ImageSequence",bo),k(xe,"LinearGradient",Xe),k(xe,"RadialGradient",Ye),k(xe,"Sprite",Wr),k(xe,"Stop",Xn),k(xe,"Texture",Ve),k(xe,"ArcSegment",oo),k(xe,"Circle",jr),k(xe,"Ellipse",qr),k(xe,"Line",Kr),k(xe,"Points",ho),k(xe,"Polygon",fo),k(xe,"Rectangle",Un),k(xe,"RoundedRectangle",Xr),k(xe,"Star",mo),k(xe,"CanvasRenderer",ft),k(xe,"SVGRenderer",Sc),k(xe,"WebGLRenderer",Tc),k(xe,"Commands",ne),k(xe,"Utils",rp);var gn=xe;function sp(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function op(){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 ap(t,e){this.width=t,this.height=e,this.trigger(K.Types.resize,t,e)}var hr=Ot.getRequestAnimationFrame();function Rc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=hr(Rc)}hr.init=function(){Rc(),hr.init=function(){}};let pn;typeof window<"u"?pn=window:typeof global<"u"?pn=global:typeof self<"u"&&(pn=self);let $c;const di=Math.PI*2,ot=Math.PI*.5;function lp(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 cp(t){$c=t}function dp(t,e){e=e&&e.identity()||new $c;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 Yt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const Nc=pn.Float32Array||Array,up=Math.floor;function yn(t){return up(t*1e6)/1e6}const me={move:"M",line:"L",curve:"C",close:"Z"};class Q{constructor(){S(this,"_events",{});S(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 u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}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}}S(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Pc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},ct=class ct extends Q{constructor(n=0,r=0){super();S(this,"_x",0);S(this,"_y",0);for(let s in Pc)Object.defineProperty(this,s,Pc[s]);this.x=n,this.y=r}static add(n,r){return new ct(n.x+r.x,n.y+r.y)}static sub(n,r){return new ct(n.x-r.x,n.y-r.y)}static subtract(n,r){return ct.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(ct.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 ct(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:yn(this.x),y:yn(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}};S(ct,"zero",new ct),S(ct,"left",new ct(-1,0)),S(ct,"right",new ct(1,0)),S(ct,"up",new ct(0,-1)),S(ct,"down",new ct(0,1));let pe=ct;class $e extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=me.move){super(n,r);S(this,"controls",{left:new pe,right:new pe});S(this,"_command",me.move);S(this,"_relative",!0);S(this,"_rx",0);S(this,"_ry",0);S(this,"_xAxisRotation",0);S(this,"_largeArcFlag",0);S(this,"_sweepFlag",1);for(let u in Ec)Object.defineProperty(this,u,Ec[u]);this.command=c,this.relative=!0;const d=$e.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(Q.Types.change,d),this.controls.right.set(a,l).addEventListener(Q.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(Q.Types.change)}}static fromObject(n){return new $e().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new $e().copy(this)}toObject(){return{x:yn(this.x),y:yn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:yn(this.rx),ry:yn(this.ry),xAxisRotation:yn(this.xAxisRotation),largeArcFlag:yn(this.largeArcFlag),sweepFlag:yn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Ec={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}};let hp=0;const Co={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return hp++}},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 Fc(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 $e(a,l)];const u=[];for(let h=0;h<d;h++){const m=h/d,g=ns(m,t,n,s,a),f=ns(m,e,r,o,l);u.push(new $e(g,f))}return u}function fp(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),u=6*(t+s)-12*n,h=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(m*b+g)*b+f;return Math.sqrt(y*y+_*_)}return gp(p,0,1,c||ts.RecursionLimit)}function mp(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,m,g,f,p,b,y;for(let T=0;T<2;++T){if(T===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,m=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-m/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*m*u,y=Math.sqrt(b),!(b<0)&&(f=(-h+y)/(2*u),0<f&&f<1&&c.push(f),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,B=_,C;for(;_--;)g=c[_],C=1-g,d[0][_]=C*C*C*t+3*C*C*g*n+3*C*g*g*s+g*g*g*a,d[1][_]=C*C*C*e+3*C*C*g*r+3*C*g*g*o+g*g*g*l;return d[0][B]=t,d[1][B]=e,d[0][B+1]=a,d[1][B+1]=l,d[0].length=d[1].length=B+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 gp(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,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function pp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?ji(s-1,n):Math.max(s-1,0),l=e?ji(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];yp(c,d,u),d.command=s===0?me.move:me.curve}}function yp(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 fr=(Bi=class extends Q{constructor(){super();S(this,"_flagId",!1);S(this,"_flagClassName",!1);S(this,"_renderer",{});S(this,"_id",Co.Identifier+Co.uniqueId());S(this,"_className","");S(this,"classList",[]);for(let n in Ac)Object.defineProperty(this,n,Ac[n])}static fromObject(n){const r=new Bi().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}},S(Bi,"Properties",["renderer","id","className"]),Bi);const Ac={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();S(this,"name","Two.js");S(this,"message");this.message=n}}class bp{constructor(){S(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 Mc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};pn.document&&(rs=document.createElement("a"));const Ke=class Ke extends fr{constructor(n,r){super();S(this,"_flagSrc",!1);S(this,"_flagImage",!1);S(this,"_flagVideo",!1);S(this,"_flagLoaded",!1);S(this,"_flagRepeat",!1);S(this,"_flagOffset",!1);S(this,"_flagScale",!1);S(this,"_src","");S(this,"_image",null);S(this,"_loaded",!1);S(this,"_repeat","no-repeat");S(this,"_scale",1);S(this,"_offset",null);for(let s in Vc)Object.defineProperty(this,s,Vc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=_p.bind(this),this._renderer.flagScale=wp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const s=(function(){this.unbind(Q.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(Q.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 Ke().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=Ke.getAbsoluteURL(n);if(Ke.ImageRegistry.contains(r))return Ke.ImageRegistry.get(r);let s;return pn.document?Mc.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=Ke.getTag(s);n._flagImage&&(/canvas/i.test(o)?Ke.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Ke.Register[o](n,r))),n._flagSrc&&(s||(s=Ke.getImage(n.src),n.image=s),o=Ke.getTag(s),Ke.Register[o](n,r))}clone(){const n=new Ke(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(Q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ke.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(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}};S(Ke,"Properties",["src","loaded","repeat","scale","offset","image"]),S(Ke,"RegularExpressions",Mc),S(Ke,"ImageRegistry",new bp),S(Ke,"Register",{canvas:function(n,r){n._src="#"+n.id,Ke.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=Ke.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Ke.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=Ke.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ke.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 Ue=Ke;const Vc={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=Ue.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ue.ImageRegistry.contains(n)?this._image=Ue.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(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.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(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function _p(){this._flagOffset=!0}function wp(){this._flagScale=!0}class ui extends Array{constructor(){super();Xa(this,dt,new Q);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Nt(this,dt)}set _events(n){Xh(this,dt,n)}get _bound(){return Nt(this,dt)._bound}set _bound(n){Nt(this,dt)._bound=n}addEventListener(){return Nt(this,dt).addEventListener.apply(this,arguments)}on(){return Nt(this,dt).on.apply(this,arguments)}bind(){return Nt(this,dt).bind.apply(this,arguments)}removeEventListener(){return Nt(this,dt).removeEventListener.apply(this,arguments)}off(){return Nt(this,dt).off.apply(this,arguments)}unbind(){return Nt(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return Nt(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return Nt(this,dt).trigger.apply(this,arguments)}listen(){return Nt(this,dt).listen.apply(this,arguments)}ignore(){return Nt(this,dt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Q.Types.insert,r),this.trigger(Q.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(Q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Q.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(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}}dt=new WeakMap;const Ic=Array.prototype.slice;function xp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Pe={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=Ic.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=Ic.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=!xp(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:pn.performance&&pn.performance.now?pn.performance:Date},Mt=class Mt extends fr{constructor(n,r,s){super();S(this,"_flagOffset",!0);S(this,"_flagOpacity",!0);S(this,"_flagColor",!0);S(this,"_offset",0);S(this,"_opacity",1);S(this,"_color","#fff");for(let o in Oc)Object.defineProperty(this,o,Oc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Mt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Mt.Index<=0?"#fff":"#000",Mt.Index=(Mt.Index+1)%2}static fromObject(n){const r=new Mt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mt.Properties.length;r++){const s=Mt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Mt;return Pe.each(Mt.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",Pe.each(Mt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(Mt,"Index",0),S(Mt,"Properties",["offset","opacity","color"]);let hi=Mt;const Oc={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)}}},kn=class kn extends fr{constructor(n){super();S(this,"_flagStops",!1);S(this,"_flagSpread",!1);S(this,"_flagUnits",!1);S(this,"_spread","");S(this,"_units","");for(let r in zc)Object.defineProperty(this,r,zc[r]);this._renderer.type="gradient",this._renderer.flagStops=kp.bind(this),this._renderer.bindStops=vp.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 hi?o:new hi().copy(o)));const s=new kn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new kn(r);return Pe.each(kn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Pe.each(kn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(kn,"Stop",hi),S(kn,"Properties",["spread","stops","units"]);let nt=kn;const zc={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function kp(){this._flagStops=!0}function vp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Cp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends nt{constructor(n,r,s,o,a){super(a);S(this,"_flagEndPoints",!1);S(this,"_left",null);S(this,"_right",null);for(let l in Lc)Object.defineProperty(this,l,Lc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Sp.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 ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const s=ti.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 ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Pe.each(nt.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(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(ti,"Stop",hi),S(ti,"Properties",["left","right"]);let St=ti;const Lc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.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(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Sp(){this._flagEndPoints=!0}const vn=class vn extends nt{constructor(n,r,s,o,a,l){super(o);S(this,"_flagRadius",!1);S(this,"_flagCenter",!1);S(this,"_flagFocal",!1);S(this,"_radius",0);S(this,"_center",null);S(this,"_focal",null);for(let c in Dc)Object.defineProperty(this,c,Dc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Bp.bind(this),this._renderer.flagFocal=Tp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Pe.each(nt.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Pe.each(vn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(vn,"Stop",hi),S(vn,"Properties",["center","radius","focal"]);let Bt=vn;const Dc={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(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Bp(){this._flagCenter=!0}function Tp(){this._flagFocal=!0}function Hc(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 Wc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),fp(r,l,s,c,o,d,a,u,n)}function jc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Fc(r,l,s,c,o,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ue.fromObject(t);case"gradient":return nt.fromObject(t);case"linear-gradient":return St.fromObject(t);case"radial-gradient":return Bt.fromObject(t)}return t}const Rp=Math.cos,$p=Math.sin,qc=Math.tan,So=[],Rt=class Rt extends Q{constructor(n,r,s,o,a,l){super();S(this,"elements",new Nc(9));S(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 x=n;let v,w,R;const N=r[0]||0,M=r[1]||0,E=r[2]||0;return v=x[0]*N+x[1]*M+x[2]*E,w=x[3]*N+x[4]*M+x[5]*E,R=x[6]*N+x[7]*M+x[8]*E,[v,w,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],m=n[7],g=n[8],f=r[0],p=r[1],b=r[2],y=r[3],_=r[4],B=r[5],C=r[6],T=r[7],$=r[8];return s=s||new Nc(9),s[0]=o*f+a*y+l*C,s[1]=o*p+a*_+l*T,s[2]=o*b+a*B+l*$,s[3]=c*f+d*y+u*C,s[4]=c*p+d*_+u*T,s[5]=c*b+d*B+u*$,s[6]=h*f+m*y+g*C,s[7]=h*p+m*_+g*T,s[8]=h*b+m*B+g*$,s}static fromObject(n){return new Rt().copy(n)}set(n,r,s,o,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],s=h[2],o=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[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]=u,this.trigger(Q.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(Q.Types.change)}identity(){return this.elements[0]=Rt.Identity[0],this.elements[1]=Rt.Identity[1],this.elements[2]=Rt.Identity[2],this.elements[3]=Rt.Identity[3],this.elements[4]=Rt.Identity[4],this.elements[5]=Rt.Identity[5],this.elements[6]=Rt.Identity[6],this.elements[7]=Rt.Identity[7],this.elements[8]=Rt.Identity[8],this.trigger(Q.Types.change)}multiply(n,r,s,o,a,l,c,d,u){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(Q.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const P=a[0]*n+a[1]*r+a[2]*s,Y=a[3]*n+a[4]*r+a[5]*s,ee=a[6]*n+a[7]*r+a[8]*s;return[P,Y,ee]}const h=this.elements,m=[n,r,s,o,a,l,c,d,u],g=h[0],f=h[1],p=h[2],b=h[3],y=h[4],_=h[5],B=h[6],C=h[7],T=h[8],$=m[0],x=m[1],v=m[2],w=m[3],R=m[4],N=m[5],M=m[6],E=m[7],A=m[8];return this.elements[0]=g*$+f*w+p*M,this.elements[1]=g*x+f*R+p*E,this.elements[2]=g*v+f*N+p*A,this.elements[3]=b*$+y*w+_*M,this.elements[4]=b*x+y*R+_*E,this.elements[5]=b*v+y*N+_*A,this.elements[6]=B*$+C*w+T*M,this.elements[7]=B*x+C*R+T*E,this.elements[8]=B*v+C*N+T*A,this.trigger(Q.Types.change)}inverse(n){const r=this.elements;n=n||new Rt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],m=r[8],g=m*c-d*h,f=-m*l+d*u,p=h*l-c*u;let b=s*g+o*f+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-m*o+a*h)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=f*b,n.elements[4]=(m*s-a*u)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-h*s+o*u)*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=Rp(n),s=$p(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=qc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=qc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return So.length=0,this.toTransformArray(n,So),So.map(yn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=f;return}return[a,d,m,l,u,g,c,h,f]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=m,r[7]=g,r[8]=f;return}return[a,l,c,d,u,h,m,g,f]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Rt().copy(this)}};S(Rt,"Identity",[1,0,0,0,1,0,0,0,1]);let mr=Rt;cp(mr);const Er=class Er extends fr{constructor(){super();S(this,"_flagMatrix",!0);S(this,"_flagScale",!1);S(this,"_matrix",null);S(this,"_worldMatrix",null);S(this,"_position",null);S(this,"_rotation",0);S(this,"_scale",1);S(this,"_skewX",0);S(this,"_skewY",0);for(let n in os)Object.defineProperty(this,n,os[n]);this._renderer.flagMatrix=Xc.bind(this),this.isShape=!0,this.matrix=new mr,this.worldMatrix=new mr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Er().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 Er;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}};S(Er,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let $n=Er;const os={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),Xc.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(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(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 dp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Xc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Np=Math.ceil,Pp=Math.floor,Ep=new pe,nn=class nn extends $n{constructor(n,r,s,o){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagCap",!0);S(this,"_flagJoin",!0);S(this,"_flagMiter",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in Yc)Object.defineProperty(this,a,Yc[a]);this._renderer.type="path",this._renderer.flagVertices=Uc.bind(this),this._renderer.bindVertices=Kc.bind(this),this._renderer.unbindVertices=Gc.bind(this),this._renderer.flagFill=Zc.bind(this),this._renderer.flagStroke=Qc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new nn().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}}for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new nn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<nn.Properties.length;s++){const o=nn.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()),Pe.each(nn.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,u=-1/0,h=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:f}=lp(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof f=="number"&&(s=Math.max(g,f)*(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,f]=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[B,C]=r.multiply(y,_),T=c.controls.left.x,$=c.controls.left.y;c.relative&&(T+=c.x,$+=c.y);let[x,v]=r.multiply(T,$);const w=mp(g,f,B,C,x,v,p,b);h=qi(w.min.y-s,h),d=qi(w.min.x-s,d),u=Xi(w.max.x+s,u),m=Xi(w.max.y+s,m)}else a<=1&&(h=qi(f-s,h),d=qi(g-s,d),u=Xi(g+s,u),m=Xi(f+s,m)),h=qi(b-s,h),d=qi(p-s,d),u=Xi(p+s,u),m=Xi(b+s,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}getPointAt(n,r){let s,o,a,l,c,d,u,h,m,g,f,p,b,y,_,B=this.length*Math.min(Math.max(n,0),1);const C=this.vertices.length,T=C-1;let $=null,x=null;for(let I=0,L=this._lengths.length,q=0;I<L;I++){if(q+this._lengths[I]>=B){this._closed?(s=ji(I,C),o=ji(I-1,C),I===0&&(s=o,o=I)):(s=I,o=Math.min(Math.max(I-1,0),T)),$=this.vertices[s],x=this.vertices[o],B-=q,this._lengths[I]!==0?n=B/this._lengths[I]:n=0;break}q+=this._lengths[I]}if($===null||x===null)return null;if($){if(!x)return $}else return x;_=x.controls&&x.controls.right,y=$.controls&&$.controls.left,c=x.x,g=x.y,d=(_||x).x,f=(_||x).y,u=(y||$).x,p=(y||$).y,h=$.x,b=$.y,_&&x.relative&&(d+=x.x,f+=x.y),y&&$.relative&&(u+=$.x,p+=$.y),l=ns(n,c,d,u,h),m=ns(n,g,f,p,b);const v=Yt(c,d,n),w=Yt(g,f,n),R=Yt(d,u,n),N=Yt(f,p,n),M=Yt(u,h,n),E=Yt(p,b,n),A=Yt(v,R,n),P=Yt(w,N,n),Y=Yt(R,M,n),ee=Yt(N,E,n);return Pe.isObject(r)?(r.x=l,r.y=m,r instanceof $e&&(r.controls.left.x=A,r.controls.left.y=P,r.controls.right.x=Y,r.controls.right.y=ee,(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 $e(l,m,A-l,P-m,Y-l,ee-m,this._curved?me.curve:me.line),a.t=n,a)}plot(){if(this.curved)return pp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?me.move:me.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===me.close;let o=this.vertices[r],a=[],l;return Pe.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===me.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=me.line),o=c;return}l=jc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=jc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?me.close:me.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=[]),Pe.each(this.vertices,function(c,d){if(d<=0||c.command===me.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Wc(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=Np(a),d=Pp(l);let u,h,m,g,f,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new $e),p>d&&!h?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),h=f,m=this._collection[p-1],m&&m.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(pe.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-f.t))):p>=c&&p<=d&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===d&&Hc(this,o)?(h=f,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&Hc(this,s)&&(u=f,u.command=me.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,f),f.command=me.move,this._renderer.vertices.unshift(f),g=this._collection[p+1],g&&g.controls&&(f.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(pe.zero,f.t):(Ep.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,f.t))))}return $n.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,$n.prototype.flagReset.call(this),this}};S(nn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(nn,"Utils",{getCurveLength:Wc});let Ee=nn;const Yc={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 nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(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";Pe.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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.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 Uc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Kc(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Gc(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Zc(){this._flagFill=!0}function Qc(){this._flagStroke=!0}const Fp=Math.ceil,Ap=Math.floor,Cn=class Cn extends $n{constructor(n){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagSize",!0);S(this,"_flagSizeAttenuation",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_size",1);S(this,"_sizeAttenuation",!1);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);S(this,"noFill",Ee.prototype.noFill);S(this,"noStroke",Ee.prototype.noStroke);S(this,"corner",Ee.prototype.corner);S(this,"center",Ee.prototype.center);S(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);S(this,"_updateLength",Ee.prototype._updateLength);for(let r in Jc)Object.defineProperty(this,r,Jc[r]);this._renderer.type="points",this._renderer.flagVertices=Uc.bind(this),this._renderer.bindVertices=Kc.bind(this),this._renderer.unbindVertices=Gc.bind(this),this._renderer.flagFill=Zc.bind(this),this._renderer.flagStroke=Qc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new Cn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Cn.Properties.length;s++){const o=Cn.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()),Pe.each(Cn.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,u=a.y,h=Fc(l,c,l,c,d,u,d,u,n);r=r.concat(h)}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=Fp(s),l=Ap(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],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}};S(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let as=Cn;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}},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 nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.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 ed extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Xa(this,Ms,{});this.attach(n),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return Nt(this,Ms)}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}}Ms=new WeakMap;const An=class An extends Ee{constructor(n,r,s,o,a,l,c){const d=c||Co.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new $e);super(u,!0,!1,!0);S(this,"_flagStartAngle",!1);S(this,"_flagEndAngle",!1);S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_startAngle",0);S(this,"_endAngle",di);S(this,"_innerRadius",0);S(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in td)Object.defineProperty(this,h,td[h]);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 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._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=ji(n,di)===ji(r,di),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,m,g,f,p,b,y,_,B,C;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(f=m/g,p=c[h],b=f*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),B=o*Math.sin(b),m){case 0:u=me.move;break;default:u=me.curve}p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(C=o*y/Math.PI,p.controls.left.x=C*Math.cos(b-ot),p.controls.left.y=C*Math.sin(b-ot),p.controls.right.x=C*Math.cos(b+ot),p.controls.right.y=C*Math.sin(b+ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=me.close,h++):(d--,g=d-1),m=0;m<d;m++)f=m/g,p=c[h],b=(1-f)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),B=s*Math.sin(b),u=me.curve,m<=0&&(u=a?me.move:me.line),p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(C=s*y/Math.PI,p.controls.left.x=C*Math.cos(b+ot),p.controls.left.y=C*Math.sin(b+ot),p.controls.right.x=C*Math.cos(b-ot),p.controls.right.y=C*Math.sin(b-ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=me.line}else a||(c[h].command=me.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=me.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 An(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ee.Properties.length;d++){const u=Ee.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};S(An,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Bo=An;const td={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}}},To=Math.cos,Ro=Math.sin,Mn=class Mn extends Ee{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);S(this,"_flagRadius",!1);S(this,"_radius",0);this._renderer.type="circle";for(let c in nd)Object.defineProperty(this,c,nd[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 Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._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*di,d=s*To(c),u=s*Ro(c),h=o*To(c-ot),m=o*Ro(c-ot),g=o*To(c+ot),f=o*Ro(c+ot),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Mn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};S(Mn,"Properties",["radius"]);let $o=Mn;const nd={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},No=Math.cos,Po=Math.sin,Vn=class Vn extends Ee{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new $e);super(c,!0,!0,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);this._renderer.type="ellipse";for(let d in id)Object.defineProperty(this,d,id[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 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._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*di,d=s*No(c),u=o*Po(c),h=s*r*No(c-ot),m=o*r*Po(c-ot),g=s*r*No(c+ot),f=o*r*Po(c+ot),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}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 Vn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};S(Vn,"Properties",["width","height"]);let Eo=Vn;const id={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Mp=Math.cos,Vp=Math.sin,In=class In extends Ee{constructor(n,r,s,o){o=Math.max(o||0,3);super();S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagSides",!1);S(this,"_radius",0);S(this,"_width",0);S(this,"_height",0);S(this,"_sides",0);this._renderer.type="polygon";for(let a in rd)Object.defineProperty(this,a,rd[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 In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._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=di*a+Math.PI/2,c=this._width*Mp(l)/2,d=this._height*Vp(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?me.move:me.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 In(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n}};S(In,"Properties",["width","height","sides"]);let Fo=In;const rd={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}}},Ti=class Ti extends Ee{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_origin",null);this._renderer.type="rectangle";for(let l in sd)Object.defineProperty(this,l,sd[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 Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const s=Ti.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 $e),this.vertices[0].set(-n,-r).sub(this._origin).command=me.move,this.vertices[1].set(n,-r).sub(this._origin).command=me.line,this.vertices[2].set(n,r).sub(this._origin).command=me.line,this.vertices[3].set(-n,r).sub(this._origin).command=me.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=me.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ti(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};S(Ti,"Properties",["width","height","origin"]);let gr=Ti;const sd={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(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},On=class On extends Ee{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new $e(0,0,0,0,0,0,c===0?me.move:me.curve));super(l);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagRadius",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in od)Object.defineProperty(this,c,od[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Ip.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 On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];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 On(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};S(On,"Properties",["width","height","radius"]);let Ao=On;const od={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(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Ip(){this._flagRadius=!0}const Op=Math.cos,zp=Math.sin,zn=class zn extends Ee{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_flagSides",!1);S(this,"_innerRadius",0);S(this,"_outerRadius",0);S(this,"_sides",0);this._renderer.type="star";for(let l in ad)Object.defineProperty(this,l,ad[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 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&&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=di*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Op(l),u=c*zp(l);o>=s?this.vertices.push(new $e(d,u)):this.vertices[o].set(d,u),this.vertices[o].command=o===0?me.move:me.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 zn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<zn.Properties.length;r++){const s=zn.Properties[r];n[s]=this[s]}return n}};S(zn,"Properties",["innerRadius","outerRadius","sides"]);let Mo=zn;const ad={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 Vo;const ld=Math.min,cd=Math.max;pn.document&&(Vo=document.createElement("canvas"));const bt=class bt extends $n{constructor(n,r,s,o){super();S(this,"_flagValue",!0);S(this,"_flagFamily",!0);S(this,"_flagSize",!0);S(this,"_flagLeading",!0);S(this,"_flagAlignment",!0);S(this,"_flagBaseline",!0);S(this,"_flagStyle",!0);S(this,"_flagWeight",!0);S(this,"_flagDecoration",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_flagDirection",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_value","");S(this,"_family","sans-serif");S(this,"_size",13);S(this,"_leading",17);S(this,"_alignment","center");S(this,"_baseline","middle");S(this,"_style","normal");S(this,"_weight",500);S(this,"_decoration","none");S(this,"_direction","ltr");S(this,"_fill","#000");S(this,"_stroke","none");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in dd)Object.defineProperty(this,a,dd[a]);if(this._renderer.type="text",this._renderer.flagFill=Lp.bind(this),this._renderer.flagStroke=Dp.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,!Pe.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(Vo){const r=Vo.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(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),u=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-u,o=c+u;break;case"right":s=-(c+u),o=u;break;default:s=-(c/2+u),o=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,m]=r.multiply(s,a),[g,f]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=ld(m,f,b,_),s=ld(h,g,p,y),o=cd(h,g,p,y),l=cd(m,f,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}};S(bt,"Ratio",.6),S(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=bt;const dd={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 nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ue)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ue)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.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 Lp(){this._flagFill=!0}function Dp(){this._flagStroke=!0}const Ln=class Ln extends gr{constructor(n,r,s,o){super(r,s,0,0);S(this,"_flagTextures",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_index",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_textures",null);S(this,"_frameRate",0);S(this,"_origin",null);this._renderer.type="image-sequence";for(let a in ud)Object.defineProperty(this,a,ud[a]);this._renderer.flagTextures=Hp.bind(this),this._renderer.bindTextures=Wp.bind(this),this._renderer.unbindTextures=jp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(hd.bind(this)):typeof n=="string"&&(this.textures=[hd(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Ln.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Ln().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ln.Properties.length;r++){const s=Ln.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=Pe.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 Ln(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,u;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,Pe.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Pe.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Yt(this._firstFrame,u,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 Ue))&&(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}};S(Ln,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(Ln,"DefaultFrameRate",30);let Io=Ln;const ud={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.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 Hp(){this._flagTextures=!0}function Wp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function jp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function hd(t){if(t instanceof Ue)return t;if(typeof t=="string")return new Ue(t)}const Ri=class Ri extends gr{constructor(n,r,s,o,a,l){super(r,s,0,0);S(this,"_flagTexture",!1);S(this,"_flagColumns",!1);S(this,"_flagRows",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_texture",null);S(this,"_columns",1);S(this,"_rows",1);S(this,"_frameRate",0);S(this,"_index",0);S(this,"_origin",null);this._renderer.type="sprite";for(let c in fd)Object.defineProperty(this,c,fd[c]);this.noStroke(),this.noFill(),n instanceof Ue?this.texture=n:typeof n=="string"&&(this.texture=new Ue(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 Ri().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ri.Properties.length;r++){const s=Ri.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=Pe.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 Ri(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,u,h,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)){h=n.image.width,m=n.image.height,o=h/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Pe.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Pe.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),u=Yt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%r,p=Math.floor(this._index/r),b=-o*f+(h-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}};S(Ri,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Oo=Ri;const fd={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,rn=class rn extends $n{constructor(n){super();S(this,"_flagAdditions",!1);S(this,"_flagSubtractions",!1);S(this,"_flagOrder",!1);S(this,"_flagOpacity",!0);S(this,"_flagBeginning",!1);S(this,"_flagEnding",!1);S(this,"_flagLength",!1);S(this,"_flagMask",!1);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_length",0);S(this,"_mask",null);S(this,"_strokeAttenuation",!0);for(let r in md)Object.defineProperty(this,r,md[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++)gd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)gd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new rn;for(let o=0;o<rn.Properties.length;o++){const a=rn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(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 Bo.fromObject(o);case"circle":return $o.fromObject(o);case"element":return fr.fromObject(o);case"ellipse":return Eo.fromObject(o);case"group":return rn.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Io.fromObject(o);case"path":return Ee.fromObject(o);case"points":return as.fromObject(o);case"polygon":return Fo.fromObject(o);case"rectangle":return gr.fromObject(o);case"rounded-rectangle":return Ao.fromObject(o);case"shape":return $n.fromObject(o);case"sprite":return Oo.fromObject(o);case"star":return Mo.fromObject(o);case"text":return Yi.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<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new rn,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,Pe.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,u=-1/0,h=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Pe.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Pe.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Pe.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Pe.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,B]=s.multiply(r.right,r.top),[C,T]=s.multiply(r.left,r.bottom),[$,x]=s.multiply(r.right,r.bottom);h=ls(y,B,T,x,h),d=ls(b,_,C,$,d),u=cs(b,_,C,$,u),m=cs(y,B,T,x,m)}else h=ls(r.top,h),d=ls(r.left,d),u=cs(r.right,u),m=cs(r.bottom,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}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,u=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):u<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):u>c&&u<c+r?(s.beginning=0,s.ending=(u-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}};S(rn,"Children",ed),S(rn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Nn=rn;const md={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=Nn.InsertChildren.bind(this),n=Nn.RemoveChildren.bind(this),r=Nn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new ed(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.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,Pe.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 gd(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 Ee{constructor(e,n,r,s){const o=[new $e(e,n),new $e(r,s)];super(o);for(let a in pd)Object.defineProperty(this,a,pd[a]);this.vertices[0].command=me.move,this.vertices[1].command=me.line,this.automatic=!1}}S(ds,"Properties",["left","right"]);const pd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Pe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=me.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(Pe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=me.line;else{const e=new is("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class zo{constructor(e=0,n=0){this.x=e,this.y=n}}class bn{constructor(e=10,n=0,r="A"){S(this,"start",new zo);S(this,"end",new zo);this.width=e,this.angle=n,this.label=r}}const De={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"}},qp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xp(t,e){return i.openBlock(),i.createElementBlock("svg",qp,[...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 us=i.markRaw({name:"ion-close",render:Xp}),Yp={class:"mr-3 flex flex-col gap-2"},Up=["onClick"],Kp={class:"h-full p-2"},Gp={},Zp=i.defineComponent({...Gp,__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((u,h)=>{var g;const m=(g=s.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var m;if(!(d!=null&&d.includes(u))){const g=(m=o.value)==null?void 0:m.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&(m.innerHTML="",a("init-draw-template",m,u))})})},{deep:!0}),(c,d)=>{const u=us;return i.openBlock(),i.createBlock(i.unref(O.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",Yp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,m)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${m}`,class:"group relative"},[i.createVNode(i.unref(O.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":m===t.selectTemplateIndex}]),onClick:g=>a("template:select",m)},[i.createElementVNode("div",Kp,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Up)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(O.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(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),yd=Wn(Zp,[["__scopeId","data-v-afccb364"]]),Qp={class:"flex gap-3 min-w-[20rem] relative"},Jp={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},ey={ref:"drawing-container",class:"size-full"},ty={},bd=i.defineComponent({...ty,__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,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((I,L)=>new bn(n.value.configuratorParams.linesWidths[L],I,`A-${L+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var I,L;return n.value.configuratorParams.startTailType&&((I=n.settings.startTailConfigs)!=null&&I[n.value.configuratorParams.startTailType])?(L=n.settings.startTailConfigs)==null?void 0:L[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var L;const I=n.value.configuratorParams.endTailType!==void 0&&((L=n.settings.endTailConfigs)==null?void 0:L[n.value.configuratorParams.endTailType]);return!I||!I.points?[]:I.points.map((q,W)=>Array.isArray(q)?new bn(q[0],q[1],`A-${W+1}`):new bn(q.width,q.angle,`A-${W+1}`))}),f=(I,L=!1)=>{I[0].start.x=0,I[0].start.y=0;let q=0;for(let W=0;W<I.length;W++){const z=I[W],D=I[W-1]??new bn(0,q);q+=!L||W>1?D.angle:0;const j=(!L||W>0?z.angle:0)+q;if(I[W].end.x=z.width*Math.cos(j*Math.PI/180)+I[W].start.x,I[W].end.y=z.width*Math.sin(j*Math.PI/180)+I[W].start.y,W<I.length-1){const Z=W+1;I[Z].start.x=I[W].end.x,I[Z].start.y=I[W].end.y}}return I},p=(I,L,q,W,z=!1)=>{let D=f([...q,...W]);L.length>0&&(D=[...f(L),...D]);let j=0,Z=0,ue=0,oe=0;D.forEach(Ae=>{j=Math.min(j,Ae.start.x,Ae.end.x),Z=Math.min(Z,Ae.start.y,Ae.end.y),ue=Math.max(ue,Ae.start.x,Ae.end.x),oe=Math.max(oe,Ae.start.y,Ae.end.y)});let re,Fe;j===0&&Z===0&&ue===0&&oe===0?(re=1,Fe=1):(re=I.width/Math.abs(ue-j),Fe=(z?I.height:I.height-De.colorSideLabel.size)/Math.abs(oe-Z));const je=Math.min(re,Fe);return j=j<0?-j*je:0,Z=Z<0?-Z*je:0,[je,j,Z]},b=I=>{const L=new as([I]);return L._size=De.anchorPoint.size,L.fill=De.anchorPoint.color,L.stroke="transparent",L._linewidth=De.anchorPoint.strokeSize,l.push(L),L},y=(I,L)=>{if(l=[],n.settings.allowChangeFirstPoint){const q=I[0],W=new pe(q.vertices[0].x,q.vertices[0].y);W.bind(Q.Types.change,()=>{q.vertices[0].copy(W)});const z=b(W);L.add(z)}I.forEach((q,W)=>{const z=I[W+1],D=new pe(q.vertices[1].x,q.vertices[1].y);D.bind(Q.Types.change,()=>{q.vertices[1].copy(D),z!==void 0&&z.vertices[0].copy(D)});const j=b(D);L.add(j)})},_=I=>I*(Math.PI/180),B=(I,L,q)=>{const W=L.vertices.length-1;I.position.x=L.vertices[W].x,I.position.y=L.vertices[W].y;const z=Math.atan2(L.vertices[W].y-L.vertices[0].y,L.vertices[W].x-L.vertices[0].x);I.rotation=_(q)+z},C=(I,L,q)=>{if(L.vertices[0]===void 0)return;I.position.x=L.vertices[0].x,I.position.y=L.vertices[0].y;const W=L.vertices.length-1,z=Math.atan2(L.vertices[W].y-L.vertices[0].y,L.vertices[W].x-L.vertices[0].x);I.rotation=_(q)+z},T=(I,L,q)=>{const W=new Nn;if(I.length===0)return W;const z=[];return[...I].reverse().forEach((D,j)=>{j!==0&&D.angle>0&&(D.angle*=-1),z.push(D)}),I=f(z,!0),C(W,L,I[0].angle),[L.vertices[0],L.vertices[1]].forEach(D=>{D.bind(Q.Types.change,()=>{C(W,L,I[0].angle)})}),I.forEach(D=>{const j=D.start.x*q,Z=D.end.x*q,ue=D.start.y*q,oe=D.end.y*q,re=new ds(j,ue,Z,oe);re.linewidth=De.line.size,re.stroke=De.line.color,W.add(re)}),W},$=(I,L,q)=>{const W=new Nn;return I.length===0||(I=f(I,!0),B(W,L,I[0].angle),[L.vertices[0],L.vertices[1]].forEach(z=>{z.bind(Q.Types.change,()=>{B(W,L,I[0].angle)})}),I.forEach(z=>{const D=z.start.x*q,j=z.end.x*q,Z=z.start.y*q,ue=z.end.y*q,oe=new ds(D,Z,j,ue);oe.linewidth=De.line.size,oe.stroke=De.line.color,W.add(oe)})),W},x=(I,L,q,W)=>{const z=L.vertices[0].x+(L.vertices[1].x-L.vertices[0].x)/2-8*Math.sin(I.angle*Math.PI/180),D=L.vertices[0].y+(L.vertices[1].y-L.vertices[0].y)/2-8*Math.cos(I.angle*Math.PI/180),j=new Yi(I.label,z+10,D-10);let Z;j.size=De.lineLabel.size,j.weight=600,j.fill=De.lineLabel.color,j.id+=1,j.rotation=De.lineLabel.rotation,W>0&&(Z=new Yi(`${I.angle}°`,L.vertices[0].x+25,L.vertices[0].y-25),Z.size=De.angleLabel.size,Z.weight=600,Z.fill=De.angleLabel.color,Z.rotation=De.angleLabel.rotation,Z.id+=W,o.push(Z),q.add(Z)),q.add(j),w(j,L,0,Z),w(j,L,1)},v=()=>{const{size:I}=De.colorSideLabel,L=0,q=0,W=h.value?I/2:I/2-I,z=h.value?I/2-I:I/2,D=new Nn;if(!c)return D;const j=5,Z=Math.atan2(z-W,q-L),ue=[new $e(L,W,0,0,0,0,gn.Commands.move),new $e(q,z,0,0,0,0,gn.Commands.line),new $e(q-j*Math.cos(Z-Math.PI/4),z-j*Math.sin(Z-Math.PI/4),0,0,0,0,gn.Commands.line),new $e(q,z,0,0,0,0,gn.Commands.move),new $e(q-j*Math.cos(Z+Math.PI/4),z-j*Math.sin(Z+Math.PI/4),0,0,0,0,gn.Commands.line)],oe=new Ee(ue,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=I/7,oe.stroke=De.colorSideLabel.color,D.add(oe);const re=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);re.size=I,re.weight=600,re.fill=De.colorSideLabel.color,re.alignment="left",D.add(re);const Fe=D.getBoundingClientRect();return D.position.x=(c.width-Fe.width)*d+10,D.position.y=h.value?c.height+Fe.height*2:Fe.height/2,D},w=(I,L,q,W)=>{L.vertices[q].bind(Q.Types.change,()=>{const z=L.vertices.length-1,D=Math.atan2(L.vertices[0].y-L.vertices[z].y,L.vertices[0].x-L.vertices[z].x)*180/Math.PI,j=L.vertices[0].x+(L.vertices[z].x-L.vertices[0].x)/2-8*Math.sin(D*Math.PI/180),Z=L.vertices[0].y+(L.vertices[z].y-L.vertices[0].y)/2-8*Math.cos(D*Math.PI/180);I.position.x=j+10,I.position.y=Z-10,I.rotation=-.5,W&&(W.position.x=L.vertices[0].x+25,W.position.y=L.vertices[0].y-25)})},R=(I,L,q,W,z=!1)=>{var Gt;if(I.clear(),q.length===0){I.update();return}const D=f(q),[j,Z,ue]=p(I,L,D,W,z),oe=new Nn,re=new Array,Fe=new Array;z||(o=[],a=[]),D.forEach((Te,sn)=>{const on=Te.start.x*j+Z,$t=Te.end.x*j+Z,Lt=Te.start.y*j+ue,an=Te.end.y*j+ue,wt=new ds(on,Lt,$t,an);wt.linewidth=z?De.previewLine.size:De.line.size,wt.stroke=z?De.previewLine.color:De.line.color,a.push(wt),re.push(wt),oe.add(wt),!z&&Te.label!==""&&x(Te,wt,oe,sn)});const je=re.at(-1);let Ae=oe.getBoundingClientRect();if(!z){const Te=v();Fe.push(Te)}if(L.length>0){const Te=T(L,re[0],j);oe.add(Te)}if(W.length>0&&je){const Te=$(W,je,j);oe.add(Te)}if(Fe.push(oe),I.makeGroup(Fe),Ae=oe.getBoundingClientRect(),oe.position.x=0-Ae.left+(I.width-Ae.width)/(2*(z?1:d)),oe.position.y=0-Ae.top+(I.height-Ae.height)/(2*(z?1:d)),I.update(),!z){const Te=((Gt=n.value.configuratorParams)==null?void 0:Gt.colorSide)==="top";oe.position.y=oe.position.y+De.colorSideLabel.size*Number(Te),y(re,oe),I.update()}},N=(I,L)=>{if(I&&!L.isNewRec()){const q=new gn({width:I.scrollWidth,height:I.scrollHeight});q.appendTo(I),R(q,[],L.points,[],!0)}},M=()=>{c&&R(c,m.value,u.value,g.value,!1)},E=I=>I*(180/Math.PI),A=(I,L)=>{const q=I[1].x-I[0].x,W=I[1].y-I[0].y,z=L[1].x-L[0].x,D=L[1].y-L[0].y;let j=Math.atan2(q*D-W*z,q*z+W*D);return j=E(j),Math.round(j)*-1},P=I=>{const L=a.map((q,W,z)=>{const D=z[W-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let j=Math.ceil(q._length/I/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[W-1];j<(z.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(j=z.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),j>n.settings.maxLineWidth&&(j=n.settings.maxLineWidth);const ue=A(q.vertices,D.vertices);return Z&&(Z.value=`${ue}°`),new bn(j,ue,`A-${W+1}`)});r("pointer:move",L)},Y=I=>{let L=null,q;const W=Z=>{L=l.find(ue=>{const oe=ue.renderer;return(oe==null?void 0:oe.elem)===Z.target}),[q]=p(I,m.value,u.value.map(ue=>ue),g.value)},z=Z=>{if(L){const ue=L.renderer,oe=ue==null?void 0:ue.elem;if(!oe)return;const re=oe.getBoundingClientRect();L.vertices[0].x-=re.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+De.anchorPoint.size/2,L.vertices[0].y-=re.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+De.anchorPoint.size/2,P(q),I.update()}},D=()=>{L&&r("pointer:up",u.value),L=null},j=s.value;j&&(j.addEventListener("touchstart",W,{passive:!0}),j.addEventListener("touchend",D,{passive:!0}),j.addEventListener("mousedown",W),j.addEventListener("mouseup",D),j.addEventListener("mousemove",z),j.addEventListener("touchmove",z,{passive:!0}))},ee=(I,L)=>{r("remove-custom-template",I,L)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{M()},{deep:!0,immediate:!0}),Y(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(I,L)=>(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(yd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":L[0]||(L[0]=q=>r("template:select",q)),onInitDrawTemplate:N,onRemoveCustomTemplate:ee},null,8,["select-template-index","settings"]),i.createElementVNode("div",Jp,[i.createElementVNode("div",ey,null,512)])]))}});class Ui extends U.Identity{constructor(n,r){super();S(this,"label","");S(this,"points",[]);S(this,"isCustom",!1);S(this,"id",-1);S(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>V.isArray(s)?new bn(s[0],s[1],`A-${o+1}`):new bn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new bn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Lo extends Ui{constructor(n){super(n);S(this,"isDefault");this.isDefault=n.isDefault??!1}}class _d{constructor(e){S(this,"minLineWidth");S(this,"maxLineWidth");S(this,"lineWidthStep");S(this,"minLineAngle");S(this,"maxLineAngle");S(this,"lineAngleStep");S(this,"stripMinWidth");S(this,"stripMaxWidth");S(this,"stripMinLength");S(this,"stripMaxLength");S(this,"allowShowTable");S(this,"showOnlyTemplates");S(this,"templates");S(this,"customTemplates",[]);S(this,"startTailConfigs");S(this,"endTailConfigs");S(this,"bendCountForExtended");S(this,"extendedProductCatalog");S(this,"allowChangeFirstPoint");S(this,"allowSaveTemplates");S(this,"userTemplatesPrefix");S(this,"lengthStep");S(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Ui(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Lo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Lo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Ui(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new bn(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 Ui(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 ny={class:"flex flex-col gap-3"},iy={class:"grid gap-5 md:grid-cols-5"},ry={},wd=i.defineComponent({...ry,__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 _d(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),m=i.useTemplateRef("kozyrek-configurator-params-form"),g=(w=0)=>{var N;const R=(N=c.value.allTemplates)==null?void 0:N.at(w);R!==void 0&&(h.value=w,l.value.configuratorParams.linesWidths=R.points.map(M=>V.isArray(M)?M[0]:M.width),l.value.configuratorParams.linesAngles=R.points.map(M=>V.isArray(M)?M[1]:M.angle),B()),y(l.value.configuratorParams)},f=async()=>{const w=prompt("Введите название шаблона:");if(!w)return;a.value=!0;const R={label:w,points:l.value.configuratorParams.linesWidths.map((M,E)=>[M,l.value.configuratorParams.linesAngles[E]])},N=M=>{M&&(c.value.addCustomTemplate(R),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:R,callback:N})},p=async(w,R)=>{var E;const N=(E=c.value.allTemplates)==null?void 0:E.at(w);if(!N||!N.isCustom)return;const M=A=>{A&&(c.value.removeCustomTemplate(N.id),g()),R==null||R()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:N.id,callback:M})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async w=>{var R,N;l.value.product=new U.ClientProduct,(N=(R=m.value)==null?void 0:R.formReference)==null||N.validate(M=>{M||(B(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:w,validationFieldResultData:u.value,callback:E=>{E?l.value.product=E:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(V.noop)},_=async()=>{var w,R;(R=(w=m.value)==null?void 0:w.formReference)==null||R.validate(N=>{N||(o.value=!0,r("submit",l.value,u.value,()=>{o.value=!1,i.nextTick(()=>{var M,E;(E=(M=m.value)==null?void 0:M.formReference)==null||E.restoreValidation()})}))}).catch(V.noop)},B=()=>{const w={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((R,N)=>{w[`lines_widths[${N+1}]`]={},w[`lines_angles[${N+1}]`]={}}),u.value=w},C=w=>{d.value.linesWidths=w.map(R=>R.width),d.value.linesAngles=w.map(R=>R.angle)},T=w=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,B(),b(),y(l.value.configuratorParams)},$=(w,R)=>{d.value.linesWidths=w,d.value.linesAngles=R},x=w=>{const R=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,N=0;l.value.configuratorParams.linesWidths.splice(w+1,0,R),l.value.configuratorParams.linesAngles.splice(w+1,0,N),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),b(),y(l.value.configuratorParams)},v=w=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(w,1),l.value.configuratorParams.linesAngles.splice(w,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,w=>{l.value=new U.OrderItemBase(w),g()}),(w,R)=>{const N=O.NButton;return i.openBlock(),i.createElementBlock("div",ny,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(N,{key:0,type:"tertiary",class:"self-end",onClick:R[0]||(R[0]=M=>r("click:view-switch"))},{default:i.withCtx(()=>[...R[3]||(R[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",iy,[i.createVNode(bd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":T,"onPointer:move":C,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(rl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":R[1]||(R[1]=M=>l.value=M),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":R[2]||(R[2]=M=>y(M)),"onUpdate:preview":$,onSubmit:_,"onClick:saveTemplate":f,"onClick:addLine":x,"onClick:removeLine":v},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),sy={class:"flex flex-col items-center justify-between rounded-xl"},oy={class:"img-preview relative flex justify-center"},ay={},ly=i.defineComponent({...ay,__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=V.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=O.NButton;return i.openBlock(),i.createElementBlock("div",sy,[i.createElementVNode("div",oy,[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})])}}}),Do=Wn(ly,[["__scopeId","data-v-a67fd61e"]]),cy={key:0,class:"flex items-baseline gap-1"},dy={key:0,class:"flex items-baseline gap-1"},uy={key:1},hy={class:"text-lg font-semibold"},fy={key:2,class:"text-red-500 text-sm mb-2"},my={class:"flex gap-3"},gy={},xd=i.defineComponent({...gy,__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 x;const r=t,s=n,o=i.computed(()=>kt.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"),u=i.ref(V.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),f=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),b=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+m.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-m.value),ae.max(f.value-m.value),ae.step(1),He.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),B=i.computed(()=>{var E;const v=p.value,w=b.value,{quantity:R}=r.value,N=((E=r.value.product)==null?void 0:E.costRub)||0;if(!v||!w||!R||N===0)return null;const M=v*w/1e6;return(N*R*M).toLocaleString("ru-ru",{minimumFractionDigits:2})}),C=i.computed(()=>{const v=p.value,w=b.value,R=!!(v&&v>=r.settings.minWidth&&v<=r.settings.maxWidths[u.value.configuratorParams.netType]),N=!!(w&&w>=r.settings.minHeight&&w<=r.settings.maxHeights[u.value.configuratorParams.netType]),M=!!(r.value.quantity&&r.value.quantity>0);return R&&N&&M}),T=(v,w)=>{var M,E;const R=u.value.configuratorParams;v&&v in R&&(R[v]=w);const N={...R,width:p.value??0,height:b.value??0};v==="width"&&((M=l.value)==null||M.validate().catch(V.noop)),v==="height"&&((E=c.value)==null||E.validate().catch(V.noop)),i.nextTick(()=>{var P,Y;!((P=l.value)!=null&&P.validationErrored)&&!((Y=c.value)!=null&&Y.validationErrored)&&N.height&&N.width&&s("update:params",N),$("configuratorParams",N)})},$=(v,w)=>{const R=new U.OrderItemBase(r.value);R[v]=w,v==="configuratorParams"&&(R.product=new U.ClientProduct),s("update:value",R)};return i.watch(()=>r.value,v=>{const w=V.cloneDeep(i.toRaw(v)),R=w.configuratorParams.mountType,N=r.settings.widthOverlaps[R]??0,M=r.settings.heightOverlaps[R]??0;w.configuratorParams.width&&w.configuratorParams.width>0&&(w.configuratorParams.width-=N),w.configuratorParams.height&&w.configuratorParams.height>0&&(w.configuratorParams.height-=M),u.value=w},{deep:!0}),i.onMounted(()=>{var v;(v=d.value)==null||v.select()}),e({validate:(x=a.value)==null?void 0:x.validate,formReference:a}),(v,w)=>{const R=O.NCheckbox;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:w[25]||(w[25]=i.withKeys(i.withModifiers(N=>s("submit",u.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[w[0]||(w[0]=N=>u.value.configuratorParams.netType=N),w[1]||(w[1]=N=>T("netType",N))],options:t.settings.netType.map(N=>({label:t.settings.descriptions.net_type[N],value:N}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[w[2]||(w[2]=N=>u.value.configuratorParams.color=N),w[3]||(w[3]=N=>T("color",N))],options:t.settings.color.map(N=>({label:t.settings.descriptions.color[N],value:N}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[w[4]||(w[4]=N=>u.value.configuratorParams.mountType=N),w[5]||(w[5]=N=>T("mountType",N))],options:t.settings.mountType.map(N=>({label:t.settings.descriptions.mount_type[N],value:N}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",cy,[i.createVNode(i.unref(O.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(O.NButton),{quaternary:"",type:"info",size:"tiny",onClick:w[10]||(w[10]=N=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...w[26]||(w[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[w[6]||(w[6]=N=>u.value.configuratorParams.width=N),w[9]||(w[9]=N=>T("width",N))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:w[7]||(w[7]=N=>i.unref(lt)(N)),onInput:w[8]||(w[8]=N=>i.unref(ze)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-m.value} ${f.value?" до "+(f.value-m.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",dy,[i.createVNode(i.unref(O.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(O.NButton),{quaternary:"",type:"info",size:"tiny",onClick:w[15]||(w[15]=N=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...w[27]||(w[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[w[11]||(w[11]=N=>u.value.configuratorParams.height=N),w[14]||(w[14]=N=>T("height",N))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:w[12]||(w[12]=N=>i.unref(lt)(N)),onInput:w[13]||(w[13]=N=>i.unref(ze)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.quantity,"onUpdate:value":[w[16]||(w[16]=N=>u.value.quantity=N),w[19]||(w[19]=N=>$("quantity",N??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:w[17]||(w[17]=N=>i.unref(lt)(N,!1)),onInput:w[18]||(w[18]=N=>i.unref(ze)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:w[20]||(w[20]=N=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":w[21]||(w[21]=N=>{u.value.marker=N??null,$("marker",N??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock(R,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":w[22]||(w[22]=N=>{u.value.isAdditionalSale=N??!1,$("isAdditionalSale",N??!1)})},{default:i.withCtx(()=>[...w[28]||(w[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),B.value?(i.openBlock(),i.createElementBlock("div",uy,[w[29]||(w[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",hy,i.toDisplayString(B.value)+" ₽",1)])):i.createCommentVNode("",!0),C.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",fy," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",my,[i.createVNode(i.unref(O.NButton),{loading:t.isSubmitProcessing,disabled:!C.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:w[23]||(w[23]=N=>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(O.NButton),{key:0,type:"default",onClick:w[24]||(w[24]=N=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...w[30]||(w[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),py="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",yy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",by="/img/configurators/mosquitto/measurement-instructions/mount.png",_y="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",wy="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",xy={class:"flex flex-col gap-6"},ky={class:"flex gap-4"},vy={class:"flex flex-col gap-2"},Cy={class:"flex gap-4"},Sy={class:"flex flex-col gap-2"},By={class:"flex gap-4"},Ty={class:"flex flex-col gap-2"},Ry={},kd=i.defineComponent({...Ry,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=kt.initRefDependingOnDeviceResolution("small","small","medium"),r=kt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=O.NText;return i.openBlock(),i.createBlock(i.unref(O.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",xy,[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:py,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:yy,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",ky,[l[9]||(l[9]=i.createElementVNode("img",{src:by,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",vy,[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",Cy,[l[15]||(l[15]=i.createElementVNode("img",{src:_y,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",By,[l[21]||(l[21]=i.createElementVNode("img",{src:wy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Ty,[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"])}}}),$y={class:"grid md:grid-cols-2"},Ny={},vd=i.defineComponent({...Ny,__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(()=>kt.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:{}}),u=i.ref(!1),h=i.ref(!1),m=i.computed(()=>i.inject("debounce-input-time",300)),g=V.debounce(async p=>{var b,y;l.value.product=new U.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:B=>{B?l.value.product=B:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(V.noop)},m.value),f=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,b)=>{const y=us;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(kd,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",$y,[s.value?(i.openBlock(),i.createBlock(i.unref(O.NDrawer),{key:1,show:o.value,"onUpdate:show":b[4]||(b[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(O.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(y)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Do,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Do,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(xd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>i.unref(g)(_)),onSubmit:b[7]||(b[7]=_=>f()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Py={},Cd=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)}),u=m=>{l.value=m,s("update:value",m,r.index,a)},h=()=>{var m;(m=o.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(m,g)=>{const f=il,p=js;return i.openBlock(),i.createBlock(i.unref(O.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(cr,{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(O.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(xt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(lt)(b)),onInput:g[1]||(g[1]=b=>i.unref(ze)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(O.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(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(O.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"])}}}),Ey={class:"my-2 flex w-full flex-col"},Fy={key:1},Ay={class:"text-lg font-semibold"},My={class:"flex gap-3"},Vy={},Sd=i.defineComponent({...Vy,__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 _;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(V.cloneDeep(r.value)),c=i.computed(()=>{const B={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]};return V.forEach(l.value,(C,T)=>{var $;B[`configuratorParams.linesWidths.${T}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),He.serverValidation(($=r.validation[`linesWidths.${T}`])==null?void 0:$.feedback)]}),B}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((B,C)=>(B??0)+(C??0),0)),h=i.computed(()=>r.settings.width-u.value),m=i.computed(()=>!r.value.some(({product:B})=>!B||B.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!m.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(B=>B.product.isNewRec())),f=i.computed(()=>B=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+B}]),p=i.computed(()=>{const{length:B}=r.value[0];return!B||u.value!==r.settings.width?null:(V.reduce(r.value,(T,$)=>{var v;const x=((v=$.product)==null?void 0:v.costRub)||0;return T+x},0)*r.value[0].quantity*B).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(B,C,T)=>{var x,v,w;l.value[C].product.id=-1;const{configuratorParams:$}=l.value[C];$.linesWidths[C]=B,y("configuratorParams",$),(w=(v=(x=a.value)==null?void 0:x.at(C))==null?void 0:v.formItemReference)==null||w.validate().catch(V.noop),i.nextTick(()=>{var R,N;(N=(R=a.value)==null?void 0:R.at(C))!=null&&N.isValid&&s("update:params",$,C,T)})},y=(B,C)=>{l.value.forEach(T=>{T[B]=C}),s("update:value",l.value)};return i.watch(()=>r.value,B=>{l.value=V.cloneDeep(B)},{deep:!0}),e({validate:(_=o.value)==null?void 0:_.validate,formReference:o}),(B,C)=>{const T=O.NCheckbox;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:C[15]||(C[15]=i.withKeys(i.withModifiers($=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var $;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(x,v)=>{var w,R;return i.openBlock(),i.createBlock(Cd,{key:v,ref_for:!0,ref:"line-items-reference",value:((w=x.configuratorParams)==null?void 0:w.linesWidths.at(v))??null,"auto-focus":!0,index:v,path:`configuratorParams.linesWidths.${v}`,product:x.product,settings:t.settings,validation:t.validation,"suggestion-option":f.value(((R=x.configuratorParams)==null?void 0:R.linesWidths.at(v))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(N=>N.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":b,"onClick:addLine":C[0]||(C[0]=N=>s("click:add-line",N)),"onClick:removeLine":C[1]||(C[1]=N=>s("click:remove-line",N))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Ey,[h.value<0?(i.openBlock(),i.createBlock(i.unref(O.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),m.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(O.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...C[16]||(C[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[C[17]||(C[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(O.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(O.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:C[2]||(C[2]=x=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...C[18]||(C[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(O.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:l.value[0].length,"onUpdate:value":[C[3]||(C[3]=x=>l.value[0].length=x),C[6]||(C[6]=x=>y("length",x))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:C[4]||(C[4]=x=>i.unref(lt)(x,!1)),onInput:C[5]||(C[5]=x=>i.unref(ze)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[C[7]||(C[7]=x=>l.value[0].quantity=x),C[10]||(C[10]=x=>y("quantity",x))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[8]||(C[8]=x=>i.unref(lt)(x,!1)),onInput:C[9]||(C[9]=x=>i.unref(ze)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:C[11]||(C[11]=x=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":C[12]||(C[12]=x=>{l.value[0].marker=x??null,y("marker",x??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(T,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":C[13]||(C[13]=x=>{l.value[0].isAdditionalSale=x??!1,y("isAdditionalSale",x??!1)})},{default:i.withCtx(()=>[...C[19]||(C[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",Fy,[C[20]||(C[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Ay,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",My,[i.createVNode(i.unref(O.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||h.value!=0||!(($=l.value[0])!=null&&$.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:C[14]||(C[14]=x=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),Iy={class:"flex grow flex-col"},Oy=["src"],zy={class:"w-full"},Ly={},Bd=i.defineComponent({...Ly,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Iy,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Oy),i.createElementVNode("div",zy,[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)])]))}}),Dy={class:"flex flex-col gap-2"},Hy={class:"w-104 flex grow flex-col px-5"},Wy={},Td=i.defineComponent({...Wy,__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(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var f;return(f=o.value[0].configuratorParams)==null?void 0:f.linesWidths.reduce((p,b)=>(p??0)+(b??0),0)}),u=f=>{f===void 0&&(f=o.value.length-1);const p=o.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,null),o.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const b=new U.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});o.value=o.value.toSpliced(f+1,0,b)},h=f=>{const p=o.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),o.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),o.value=o.value.toSpliced(f,1),delete a[`linesWidths.${f}`],delete a[`linesWidths.${f}`])},m=V.debounce(async(f,p,b)=>{const y={linesWidths:f.linesWidths.at(p)};b.value=!0,a.value[`linesWidths.${p}`]={},o.value[p].product=new U.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:o.value[p].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(o.value[p].product=_,p===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(o.value[p].product=new U.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),g=async()=>{var f,p;(p=(f=s.value)==null?void 0:f.formReference)==null||p.validate(b=>{if(!b){l.value=!0;const y=o.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,B;(B=(_=s.value)==null?void 0:_.formReference)==null||B.restoreValidation()})})}}).catch(V.noop)};return i.watch(()=>n.cartItems,f=>{o.value=f.map(p=>new U.OrderItemBase(p))}),(f,p)=>{const b=O.NButton;return i.openBlock(),i.createElementBlock("div",Dy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=y=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Hy,[i.createVNode(Bd,{value:o.value,"onUpdate:value":p[1]||(p[1]=y=>o.value=y),settings:t.settings},null,8,["value","settings"]),i.createVNode(Sd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":p[2]||(p[2]=y=>o.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(m),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),jy={class:"flex flex-col gap-3"},qy={},Rd=i.defineComponent({...qy,__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 g;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(V.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(f,p)=>{const b=new U.OrderItemBase(r.value);b[f]=p,f==="configuratorParams"&&(b.product=new U.ClientProduct),s("update:value",b)},m=()=>{var f;(f=a.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=V.cloneDeep(f)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{m()})}),e({validate:(g=o.value)==null?void 0:g.validate,formReference:o}),(f,p)=>{const b=O.NCheckbox;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:i.unref(xt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(lt)(y)),onInput:p[2]||(p[2]=y=>i.unref(ze)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:i.unref(xt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(lt)(y)),onInput:p[5]||(p[5]=y=>i.unref(ze)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(O.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(lt)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(ze)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>h("quantity",y??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>h("marker",y??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",jy,[i.createVNode(i.unref(O.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),Xy={class:"flex flex-col gap-2 w-72"},Yy={},$d=i.defineComponent({...Yy,__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=i.computed(()=>i.inject("debounce-input-time",300)),u=V.debounce(async m=>{var g,f;o.value.product=new U.ClientProduct,(f=(g=s.value)==null?void 0:g.formReference)==null||f.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:m,validationFieldResultData:a.value,callback:b=>{b?o.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(V.noop)},d.value),h=async()=>{var m,g;(g=(m=s.value)==null?void 0:m.formReference)==null||g.validate(f=>{f||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})}))}).catch(V.noop)};return i.watch(()=>n.cartItem,m=>{o.value=new U.OrderItemBase(m)},{deep:!0}),(m,g)=>{const f=O.NButton;return i.openBlock(),i.createElementBlock("div",Xy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(f,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Rd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=p=>o.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Uy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ky(t,e){return i.openBlock(),i.createElementBlock("svg",Uy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Gy=i.markRaw({name:"ion-add",render:Ky}),Zy={key:0,class:"ml-2 text-gray-500 text-sm"},Qy={class:"font-bold"},Jy={key:1,class:"flex flex-col gap-3"},e0={class:"w-full text-sm"},t0={"form-array-name":"items",class:"flex flex-col gap-3"},n0={class:"grid grow grid-cols-3 gap-2 items-start"},i0={key:0,class:"flex flex-wrap items-end gap-2"},r0={class:"whitespace-nowrap text-xl font-bold"},s0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},o0={class:"font-bold"},a0={class:"font-bold"},l0={class:"flex gap-3"},c0={},Nd=i.defineComponent({...c0,__name:"sandwich-configurator-form",props:{value:{},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:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var E;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(V.cloneDeep(r.value)),l=i.computed(()=>r.value.category),c=i.ref(null),d=i.ref(null),u=i.computed(()=>l.value.products??[]),h=i.computed(()=>u.value.map(A=>({label:A.name,value:A.id}))),m=i.ref(null),g=i.ref(!1),f=i.computed(()=>{var A,P;return(P=(A=c.value)==null?void 0:A.properties)!=null&&P.width?ae.max(c.value.properties.width):null}),p=i.computed(()=>{var A,P;return(P=(A=c.value)==null?void 0:A.properties)!=null&&P.length?ae.max(c.value.properties.length):null}),b=i.computed(()=>{const A={marker:[He.serverValidation(r.validation.marker.feedback)]};return a.value.configuratorParams.items.forEach((P,Y)=>{var ee,I,L,q,W,z,D;A[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(I=(ee=c.value)==null?void 0:ee.properties)!=null&&I.width?[ae.max(c.value.properties.width)]:[],ae.step(1),He.serverValidation((L=r.validation[`items.${Y}.width`])==null?void 0:L.feedback)],A[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(W=(q=c.value)==null?void 0:q.properties)!=null&&W.length?[ae.max(c.value.properties.length)]:[],ae.step(1),He.serverValidation((z=r.validation[`items.${Y}.length`])==null?void 0:z.feedback)],A[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),He.serverValidation((D=r.validation[`items.${Y}.count`])==null?void 0:D.feedback)]}),A}),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>a.value.configuratorParams.items.some(A=>{var P,Y;return!c.value||!A.width||A.width<r.settings.minWidth||A.width>(((P=c.value.properties)==null?void 0:P.width)??0)||A.length===0||A.length<r.settings.minLength||A.length>(((Y=c.value.properties)==null?void 0:Y.length)??0)||!A.count||A.count<1})),B=i.computed(()=>!c.value||_.value||a.value.configuratorParams.items.length===0),C=i.ref(null),T=A=>{if(!A){c.value=null,d.value=null,a.value.product=new U.ClientProduct,m.value=null;return}const P=u.value.find(Y=>Y.id===A);P&&(c.value=P,d.value=A,a.value.product=P,M("product",a.value.product),a.value.configuratorParams.items.forEach(Y=>{var ee,I;(ee=P.properties)!=null&&ee.width&&Y.width>P.properties.width&&(Y.width=P.properties.width),(I=P.properties)!=null&&I.length&&Y.length>P.properties.length&&(Y.length=P.properties.length)}),$())},$=()=>{m.value=null,C.value=null},x=async()=>{var A;if(!c.value||a.value.configuratorParams.items.length===0||_.value){$();return}(A=o.value)==null||A.validate(P=>{if(P){$();return}if(g.value=!0,!c.value||!l.value){$(),g.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:l.value,params:{productId:c.value.id,items:a.value.configuratorParams.items},callback:Y=>{Y?(m.value=Y,a.value.configuratorParams.calculationId=Y.id,a.value.quantity=Y.quantity,i.nextTick(()=>{M("quantity",Y.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,$()),M("configuratorParams",a.value.configuratorParams),v(),g.value=!1}})}).catch(()=>{$(),g.value=!1})},v=()=>{var P;if(!((P=c.value)!=null&&P.costRub)||!m.value){C.value=null;return}const A=m.value.quantity*c.value.costRub;C.value=Math.round(A*100)/100},w=A=>{var Y,ee;const P=a.value.configuratorParams.items[A];c.value&&((Y=c.value.properties)!=null&&Y.width&&P.width>c.value.properties.width&&(P.width=c.value.properties.width),(ee=c.value.properties)!=null&&ee.length&&P.length>c.value.properties.length&&(P.length=c.value.properties.length)),M("configuratorParams",a.value.configuratorParams),$()},R=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),M("configuratorParams",a.value.configuratorParams),$(),s("add-item",a.value.configuratorParams.items.length)},N=A=>{a.value.configuratorParams.items.splice(A,1),M("configuratorParams",a.value.configuratorParams),$(),s("remove-item",A)},M=(A,P)=>{const Y=new U.OrderItemBase(r.value);Y[A]=P,s("update:value",Y)};return i.watch(()=>r.value,A=>{const P=V.cloneDeep(i.toRaw(A));(!P.configuratorParams.items||P.configuratorParams.items.length===0)&&(P.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=P,r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id),r.value.product.isNewRec()&&(c.value=null,d.value=null)},{deep:!0}),i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id)}),e({validate:(E=o.value)==null?void 0:E.validate,formReference:o}),(A,P)=>{const Y=js,ee=Gy;return i.openBlock(),i.createBlock(i.unref(O.NForm),{ref:"form-reference",model:a.value,rules:b.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:P[8]||(P[8]=i.withKeys(i.withModifiers(I=>s("submit",a.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var I,L,q;return[i.createVNode(i.unref(O.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NSelect),{value:d.value,"onUpdate:value":[P[0]||(P[0]=W=>d.value=W),T],options:h.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",Zy,[P[9]||(P[9]=i.createTextVNode(" Стоимость: ",-1)),i.createElementVNode("span",Qy,i.toDisplayString((I=c.value.costRub)==null?void 0:I.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.",1)])):i.createCommentVNode("",!0),c.value&&f.value&&p.value?(i.openBlock(),i.createElementBlock("div",Jy,[P[15]||(P[15]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",e0,[i.createTextVNode(" Минимальная ширина: "+i.toDisplayString(t.settings.minWidth)+" мм. ",1),P[10]||(P[10]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная ширина: "+i.toDisplayString((L=c.value.properties)==null?void 0:L.width)+" мм. ",1),P[11]||(P[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная длина: "+i.toDisplayString(t.settings.minLength)+" мм. ",1),P[12]||(P[12]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная длина: "+i.toDisplayString((q=c.value.properties)==null?void 0:q.length)+" мм. ",1)]),i.createElementVNode("div",t0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(W,z)=>(i.openBlock(),i.createElementBlock("div",{key:z,class:"flex grow gap-2"},[i.createElementVNode("div",n0,[i.createVNode(i.unref(O.NFormItem),{path:`configuratorParams.items.${z}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:a.value.configuratorParams.items[z].width,"onUpdate:value":[D=>a.value.configuratorParams.items[z].width=D,D=>w(z)],parse:i.unref(xt),"show-button":!1,placeholder:"Ширина",class:"w-full",onKeydown:P[1]||(P[1]=D=>i.unref(lt)(D)),onInput:D=>i.unref(ze)(t.validation,`items.${z}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(O.NFormItem),{path:`configuratorParams.items.${z}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:a.value.configuratorParams.items[z].length,"onUpdate:value":[D=>a.value.configuratorParams.items[z].length=D,D=>w(z)],parse:i.unref(xt),"show-button":!1,placeholder:"Длина",class:"w-full",onKeydown:P[2]||(P[2]=D=>i.unref(lt)(D)),onInput:D=>i.unref(ze)(t.validation,`items.${z}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(O.NFormItem),{path:`configuratorParams.items.${z}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:a.value.configuratorParams.items[z].count,"onUpdate:value":[D=>a.value.configuratorParams.items[z].count=D,D=>w(z)],parse:i.unref(xt),"show-button":!1,placeholder:"Количество",class:"w-full",onKeydown:P[3]||(P[3]=D=>i.unref(lt)(D,!1)),onInput:D=>i.unref(ze)(t.validation,`items.${z}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(O.NButton),{disabled:a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:D=>N(z)},{default:i.withCtx(()=>[i.createVNode(Y)]),_:1},8,["disabled","onClick"])]))),128))]),i.createVNode(i.unref(O.NButton),{disabled:_.value,type:"default",class:"self-center",onClick:R},{default:i.withCtx(()=>[i.createVNode(ee),P[13]||(P[13]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"]),i.createVNode(i.unref(O.NButton),{disabled:B.value,loading:g.value,type:"info",class:"self-start",onClick:x},{default:i.withCtx(()=>[...P[14]||(P[14]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["disabled","loading"])])):c.value?(i.openBlock(),i.createBlock(i.unref(O.NText),{key:2,type:"error"},{default:i.withCtx(()=>[...P[16]||(P[16]=[i.createTextVNode(" Расчет по продукту невозможен. Обратитесь к менеджеру. ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(O.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:a.value.marker??null,placeholder:"Введите маркировку распила",onInput:P[4]||(P[4]=W=>i.unref(ze)(t.validation,"marker")),"onUpdate:value":P[5]||(P[5]=W=>M("marker",W??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock(i.unref(O.NCheckbox),{key:3,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":P[6]||(P[6]=W=>{a.value.isAdditionalSale=W??!1,M("isAdditionalSale",W??!1)})},{default:i.withCtx(()=>[...P[17]||(P[17]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(O.NSpin),{show:g.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var W;return[m.value&&c.value&&C.value?(i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("div",null,[P[18]||(P[18]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",r0,i.toDisplayString(C.value.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol),1)]),m.value.quantity&&c.value?(i.openBlock(),i.createElementBlock("div",s0,[i.createElementVNode("span",o0,"("+i.toDisplayString(m.value.quantity)+" шт.",1),P[19]||(P[19]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",a0,i.toDisplayString((W=c.value.costRub)==null?void 0:W.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",l0,[i.createVNode(i.unref(O.NButton),{loading:t.isSubmitProcessing,disabled:B.value||!m.value||g.value,type:"primary",class:"self-start",onClick:P[7]||(P[7]=W=>s("submit",a.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),d0={class:"flex flex-col gap-2"},u0={class:"w-104 flex grow flex-col px-5"},h0={},Pd=i.defineComponent({...h0,__name:"sandwich-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("sandwich-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,m;(m=(h=s.value)==null?void 0:h.formReference)==null||m.validate(g=>{if(!g){l.value=!0;const f=V.cloneDeep(o.value);"items"in f.configuratorParams&&delete f.configuratorParams.items,r("submit",f,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})})}}).catch(V.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,m)=>{a.value[`items.${m}.width`]={},a.value[`items.${m}.length`]={},a.value[`items.${m}.count`]={}})}),i.watch(()=>n.cartItem,h=>{o.value=new U.OrderItemBase(h)},{deep:!0}),(h,m)=>{const g=O.NButton;return i.openBlock(),i.createElementBlock("div",d0,[t.settings.allowShowTable&&o.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[2]||(m[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",u0,[i.createVNode(Nd,{ref:"sandwich-configurator-form",value:o.value,"onUpdate:value":m[1]||(m[1]=f=>o.value=f),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),f0={key:0,class:"flex justify-center p-4"},m0={key:1,class:"p-4 text-center text-red-500"},g0={key:2,class:"flex justify-center"},p0={class:"!bg-white p-4 m-2 rounded-md w-max"},y0={key:3,class:"p-4 text-center text-gray-500"},b0={},Ed=i.defineComponent({...b0,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.ref(e.cartItem??null),o=i.ref(null),a=()=>{var u,h,m;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const d={category:((u=e.cartItem)==null?void 0:u.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const g=e.settings;s.value=new U.OrderItemBase({...d,configuratorParams:{length:g.stripMinLength,linesAngles:[],linesWidths:[],startTailType:V.some(g.startTailConfigs,f=>f.isDefault)?(h=g.startTailConfigs)==null?void 0:h.findIndex(f=>f.isDefault):void 0,endTailType:V.some(g.endTailConfigs,f=>f.isDefault)?(m=g.endTailConfigs)==null?void 0:m.findIndex(f=>f.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const g=e.settings;s.value=new U.OrderItemBase({...d,configuratorParams:{width:0,height:0,netType:g.netType[0]||"",color:g.color[0]||"",mountType:g.mountType[0]||""}});break}case"strip":{const g=e.settings;o.value=[new U.OrderItemBase({...d,length:g.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const g=e.settings;s.value=new U.OrderItemBase({...d,configuratorParams:{width:g.minWidth,length:g.minLength}});break}case"sandwich":{s.value=new U.OrderItemBase({...d,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}s.value&&(s.value.marker=void 0)},l=(d,u,h)=>{const m=g=>{h==null||h(),g&&a()};e.eventEmitter.emit("configurator:submit",{cartItem:d,callback:m,validation:u})},c=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||a()}),(d,u)=>{const h=O.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",f0,[i.createVNode(h,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",m0,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(s.value!==null||o.value!==null)?(i.openBlock(),i.createElementBlock("div",g0,[i.createElementVNode("div",p0,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(wd,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(vd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock(Td,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":o.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock($d,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Pd,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",y0,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});var hs=(t=>(t.Kozyrek="kozyrek",t.Mosquitto="mosquitto",t.Strip="strip",t.MetalForDoors="metal_for_doors",t.Sandwich="sandwich",t))(hs||{});function Fd(t){return Object.values(hs).includes(t)}function Ad(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==hs.Sandwich?!0:t.properties.configuratorSettings!==void 0&&V.isArray(t.products)&&t.products.length>0}const _0={key:0,class:"pt-0.5"},w0={key:0},x0={class:"line-through"},k0={key:0},v0={key:1},C0={class:"flex flex-row gap-1"},S0={key:0},B0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},T0={class:"flex flex-col gap-2.5 sm:flex-row"},R0={class:"mt-2"},$0={key:1,class:"flex flex-col"},N0={},P0=i.defineComponent({...N0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(or,"medium"),r=i.computed(()=>{var j;return(j=e==null?void 0:e.filteredItems)==null?void 0:j[e.categoryItem.id]}),s=i.computed(()=>{var j,Z;return V.isArray((j=e.categoryItem)==null?void 0:j.categories)&&((Z=e.categoryItem.categories)==null?void 0:Z.length)>0}),o=i.computed(()=>{var j;return V.isArray((j=e.categoryItem)==null?void 0:j.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([j,Z])=>`${Z} руб./${N(j)}`).join(", ")),l=i.computed(()=>V.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(j=>{var ue;const Z=(ue=r.value)==null?void 0:ue.products;return V.isArray(Z)&&Z.includes(j.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>V.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>V.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>V.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>V.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var j,Z,ue;return((j=e.categoryItem.properties)==null?void 0:j.configurator)!==void 0&&Fd((Z=e.categoryItem.properties)==null?void 0:Z.configurator)&&Ad(e.categoryItem)&&((ue=e.categoryItem.properties)==null?void 0:ue.configuratorSettings)!==void 0&&(V.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),f=i.computed(()=>g.value&&(V.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>V.isNil(e.categoryContextButtonsConfig)?[]:V.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new U.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),B=i.computed(()=>!V.isUndefined(e.isCategoryItemSelected)),C=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),T=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),$=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),x=i.computed(()=>W.value&&kt.getDeviceTypeByResolution()===Ze.laptop?"auto":"fixed"),v=i.useTemplateRef("collapse-item-reference"),w=i.computed(()=>{var j,Z;return(Z=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:Z.priceCoefficient}),R=i.computed(()=>{var j,Z;return(Z=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:Z.increasePercent}),N=(j,Z="ru-RU")=>0 .toLocaleString(Z,{style:"currency",currency:j,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),M=j=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:j,target:v.value})},E=(j,Z)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:Z,isLoadingState:y,target:v.value})},A=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:v.value})},P=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:v.value})},Y=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:v.value})},ee=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:v.value})},I=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:v.value})},L=j=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:j,target:v.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},W=i.ref(0),z=i.computed(()=>W.value&&o.value.length>0?zm(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}):[]),D=V.debounce(()=>{W.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",D)}),window.addEventListener("resize",D),D(),(j,Z)=>{const ue=O.NCheckbox,oe=bf,re=O.NTooltip,Fe=gf,je=O.NTag,Ae=hf,Gt=cf,Te=O.NButton,sn=of,on=Ga,$t=Ka,Lt=Ua,an=Ds,wt=O.NDropdown,Dn=O.NDataTable,ln=O.NAlert,Zt=O.NSpin;return i.openBlock(),i.createBlock(Za,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":E},{"pre-arrow":i.withCtx(()=>{var Ne,G;return[B.value?(i.openBlock(),i.createElementBlock("div",_0,[i.createVNode(ue,{checked:C.value,indeterminate:$.value,disabled:T.value,"onUpdate:checked":M},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ne=b.value)!=null&&Ne.isDisabled)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[Z[1]||(Z[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((G=b.value)==null?void 0:G.isFavorite)??!1?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Fe,{class:"pt-1.5"})]),default:i.withCtx(()=>[Z[2]||(Z[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ne,G,se,Oe,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Ne=b.value)==null?void 0:Ne.isDisabled})},[i.createVNode(re,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[Z[3]||(Z[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:Z[0]||(Z[0]=i.withModifiers((...Je)=>i.unref(V.noop)&&i.unref(V.noop)(...Je),["prevent","stop"]))},[(G=t.categoryItem.properties)!=null&&G.m2Price?(i.openBlock(),i.createBlock(je,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((se=t.categoryItem.properties)==null?void 0:se.templateCost)&&t.categoryItem.properties.m2PriceRetail&&R.value}),round:""},{default:i.withCtx(()=>{var Je;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Je=t.categoryItem.properties)!=null&&Je.templateCost&&t.categoryItem.properties.m2PriceRetail&&R.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[R.value?(i.openBlock(),i.createBlock(je,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[R.value?(i.openBlock(),i.createElementBlock("span",w0,i.toDisplayString(R.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(je,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",x0,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"])):(Oe=t.categoryItem.properties)!=null&&Oe.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[w.value||R.value?(i.openBlock(),i.createBlock(je,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Je;return[w.value?(i.openBlock(),i.createElementBlock("span",k0,i.toDisplayString((Je=w.value)==null?void 0:Je.name),1)):i.createCommentVNode("",!0),R.value?(i.openBlock(),i.createElementBlock("span",v0,i.toDisplayString(R.value>0?"+":"")+i.toDisplayString(R.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(je,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=b.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(je,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ee},{default:i.withCtx(()=>[i.createVNode(re,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Je,Dt;return[i.createElementVNode("span",C0,[i.createVNode(Ae),i.createTextVNode(" "+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name),1)])]}),default:i.withCtx(()=>{var Je,Dt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",S0,[i.createElementVNode("ul",B0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ne,G)=>(i.openBlock(),i.createElementBlock("li",{key:G}," ("+i.toDisplayString(G)+"): "+i.toDisplayString(Ne),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Ne,G)=>(i.openBlock(),i.createElementBlock("li",{key:G}," ("+i.toDisplayString(G)+"): "+i.toDisplayString(Ne),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ne;return[i.createElementVNode("div",T0,[d.value?(i.openBlock(),i.createBlock(re,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:A},{default:i.withCtx(()=>{var G;return[(G=b.value)!=null&&G.isDisabled?(i.openBlock(),i.createBlock(oe,{key:1})):(i.openBlock(),i.createBlock(Gt,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var G;return[(G=b.value)!=null&&G.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),u.value&&!((Ne=b.value)!=null&&Ne.manager)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:Y},{default:i.withCtx(()=>[i.createVNode(sn)]),_:1},8,["size"])]),default:i.withCtx(()=>{var G,se,Oe;return[(G=b.value)!=null&&G.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Oe=(se=b.value)==null?void 0:se.manager)==null?void 0:Oe.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:P},{default:i.withCtx(()=>{var G;return[(G=b.value)!=null&&G.isRequired?(i.openBlock(),i.createBlock($t,{key:1})):(i.openBlock(),i.createBlock(on,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[Z[4]||(Z[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(re,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary",onClick:I},{default:i.withCtx(()=>[i.createVNode(Lt)]),_:1},8,["size"])]),default:i.withCtx(()=>[Z[5]||(Z[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(wt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:L},{default:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(an)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(j.$slots,"default",{},()=>{var Ne,G,se;return[i.createElementVNode("div",R0,[s.value?(i.openBlock(),i.createBlock(Vd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ne=r.value)==null?void 0:Ne.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)]),g.value&&f.value?(i.openBlock(),i.createBlock(Ed,{key:0,"event-emitter":t.eventEmitter,settings:(G=t.categoryItem.properties)==null?void 0:G.configuratorSettings,editor:(se=t.categoryItem.properties)==null?void 0:se.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",$0,[g.value?(i.openBlock(),i.createBlock(Te,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:i.withCtx(()=>[...Z[6]||(Z[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Dn,{columns:z.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Oe=>Oe.id,"table-layout":x.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(ln,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(ln,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Zt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...Z[7]||(Z[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),E0=Wn(P0,[["__scopeId","data-v-3560e7d3"]]),F0={class:"sc-collapse flex w-full flex-col"},A0={},Md=i.defineComponent({...A0,__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",F0,[i.renderSlot(o.$slots,"default")]))}}),M0={},Vd=i.defineComponent({...M0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(or,"medium"),r=i.computed(()=>V.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(V.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=O.NSpin,c=O.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Md,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(E0,{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)}}}),V0={},Id=i.defineComponent({...V0,__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(()=>V.isArray(r.value)),a=new U.Reference,l=i.computed(()=>V.isNil(r.value)?o.value?[]:null:V.isArray(r.value)?r.value.map(g=>g.id):r.value.id),c=i.computed(()=>Pt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var f;if(V.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||V.isNil(g)||(f=c.value.find(b=>b.value===g))==null?void 0:f.item;s("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),I0={},O0=i.defineComponent({...I0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var B,C;const n=t,r=e,s=()=>{const T=U.PriceCoefficient.getRetailPriceCoefficient();return V.unset(T,"isNewRec"),T},o=T=>!T||T.id===s().id,a=i.computed(()=>{var T;return((T=n.catalogItem)==null?void 0:T.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=T=>{var $,x,v,w;return T.id===s().id?($=l.value)==null?void 0:$.getRetailCost():(w=(v=(x=l.value)==null?void 0:x.priceCoefficients)==null?void 0:v.find(R=>R.coefficient.id===T.id))==null?void 0:w.cost},d=i.computed(()=>{var $;const T=[...(($=U.useReferencesStore().priceCoefficientsReference)==null?void 0:$.map(x=>structuredClone(i.toRaw(x))))??[],s()];return a.value&&T.forEach(x=>{var w;const v=c(x);v?x.name+=` (${v} ${(w=l.value)==null?void 0:w.currency.symbol})`:x.name=""}),T.filter(x=>x.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((C=(B=n.value)==null?void 0:B.value)==null?void 0:C.toString())??null),m=i.ref(null),g=i.computed(()=>{var T,$;return($=(T=l.value)==null?void 0:T.priceCoefficients)==null?void 0:$.find(x=>x.coefficient.slug===U.PriceCoefficientEnum.K0)}),f=i.ref(void 0),p=()=>{var $,x,v;f.value=void 0;let T=Number.parseFloat((($=h.value)==null?void 0:$.replace(",","."))??"");if(T=Number.isNaN(T)?void 0:T,a.value)if(u.value||h.value){const w=s(),R=c(u.value??w)??0,N=R+R*((T??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(N),N>(((x=l.value)==null?void 0:x.getRetailCost())??N)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&N<(((v=g.value)==null?void 0:v.cost)??0)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(T)?void 0:T,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=T=>{V.isArray(T)||V.isNull(T)||(u.value=T,h.value=null,!u.value&&h.value&&(u.value=s()),p())},y=()=>{u.value||(u.value=s()),p()},_=T=>{var x,v,w,R,N,M;const $=Number.parseFloat((T==null?void 0:T.replace(",","."))??"");if(a.value){let E=0;if($<=0)u.value=void 0,h.value=null;else if(g.value&&$<(((x=g.value)==null?void 0:x.cost)??0))u.value=(v=g.value)==null?void 0:v.coefficient,E=($-g.value.cost)*100/g.value.cost,f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if($>(((w=l.value)==null?void 0:w.getRetailCost())??$)){u.value=s();const A=((R=l.value)==null?void 0:R.getRetailCost())??0;E=($-A)*100/A,f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const A=(M=(N=l.value)==null?void 0:N.priceCoefficients)==null?void 0:M.filter(P=>P.cost<$);if(A&&A.length>0){const P=A.at(-1);u.value=P==null?void 0:P.coefficient,E=($-((P==null?void 0:P.cost)??0))*100/((P==null?void 0:P.cost)??1)}f.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(E),r("update:value",{value:Number.isNaN(E)?void 0:E,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN($)?void 0:$,coefficient:void 0})};return i.onMounted(()=>{var T,$,x,v;n.calculationType===U.CalculationTypeEnum.m2Cost?m.value=(($=(T=n.value)==null?void 0:T.value)==null?void 0:$.toString())??null:!((x=n.value)!=null&&x.coefficient)&&((v=n.value)!=null&&v.value)&&(u.value=s()),p()}),(T,$)=>{var w,R,N;const x=O.NInput,v=O.NInputGroup;return i.openBlock(),i.createBlock(i.unref(O.NFormItem),{"show-label":!i.unref(V.isNil)(t.label),label:t.label,"show-feedback":!i.unref(V.isNil)(((w=f.value)==null?void 0:w.feedback)??t.feedback),feedback:((R=f.value)==null?void 0:R.feedback)??t.feedback,"validation-status":((N=f.value)==null?void 0:N.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(v,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Id,{class:"w-full min-w-0 flex-1",value:u.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(x,{value:h.value,"onUpdate:value":[$[0]||($[0]=M=>h.value=M),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[$[3]||($[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[$[2]||($[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(x,{key:1,value:m.value,"onUpdate:value":[$[1]||($[1]=M=>m.value=M),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var M;return[i.createTextVNode(i.toDisplayString((M=l.value)==null?void 0:M.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),z0={key:0,class:"flex flex-row gap-2.5"},L0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},D0={},Od=i.defineComponent({...D0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=kt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=kt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{s("opening"),o.value=!0,s("update:show",o.value)},h=(g="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let f=!1;s("closing",g,()=>{f=!0}),f||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",f=>{a.value=f})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:m}),(g,f)=>{const p=O.NButton,b=O.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:f[1]||(f[1]=y=>h("header")),onEsc:f[2]||(f[2]=y=>h("esc")),onMaskClick:f[3]||(f[3]=y=>h("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",z0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",L0,[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:f[0]||(f[0]=y=>h("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"])}}}),H0={class:"text-sm"},W0={},j0=i.defineComponent({...W0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var x,v,w;return((x=o.value)==null?void 0:x.unit.isLinear)&&((w=(v=o.value)==null?void 0:v.properties)==null?void 0:w.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,m=()=>({length:{},quantity:{},marker:{}}),g=i.ref(m()),f=i.ref(!1),p=i.computed(()=>{var N,M,E,A;if(!o.value)return{};const x=U.UnitsHelper.getProductLengthMultiplicity(o.value),v=U.UnitsHelper.getProductMultiplicity(o.value),w=((M=(N=o.value)==null?void 0:N.properties)==null?void 0:M.minLength)||x,R=(A=(E=o.value)==null?void 0:E.properties)==null?void 0:A.maxLength;return{length:[ae.required,ae.min(w??.1),ae.max(R),ae.step(x),He.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(v),ae.step(v),He.serverValidation(g.value.quantity.feedback)],marker:[He.serverValidation(g.value.marker.feedback)]}}),b=i.computed(()=>{var x,v,w;return o.value?((x=o.value.properties)==null?void 0:x.lengthStep)??((v=o.value.properties)!=null&&v.ignoreMinCountCheck?0:((w=o.value.properties)==null?void 0:w.minCount)??0):0}),y=i.computed(()=>{var w,R,N,M,E,A,P,Y,ee;if(!o.value)return"";const x=((R=(w=o.value)==null?void 0:w.properties)==null?void 0:R.minLength)??((M=(N=o.value)==null?void 0:N.properties)!=null&&M.ignoreMinCountCheck?0:(A=(E=o.value)==null?void 0:E.properties)==null?void 0:A.minCount),v=(Y=(P=o.value)==null?void 0:P.properties)==null?void 0:Y.maxLength;return x||v?`(${x?`от ${x}`:""}${x&&v?" ":""}${v?`до ${v}`:""} ${(ee=o.value)==null?void 0:ee.unit.name})`:""}),_=x=>{var M,E;if(!((E=(M=o.value)==null?void 0:M.properties)!=null&&E.isLengthConfigurator)||!u.value||V.isNil(x)||b.value===0)return;const v=x/b.value,w=Math.round(v),R=U.UnitsHelper.getProductMultiplicity(o.value),N=Math.max(w,R);u.value.quantity=N},B=x=>{var N,M,E,A;if(!((M=(N=o.value)==null?void 0:N.properties)!=null&&M.isLengthConfigurator)||!u.value||V.isNil(x)||b.value===0)return;const v=x*b.value,w=((E=o.value.properties)==null?void 0:E.minLength)||U.UnitsHelper.getProductLengthMultiplicity(o.value),R=(A=o.value.properties)==null?void 0:A.maxLength;w!==void 0&&v<w?u.value.length=w:R!==void 0&&v>R?u.value.length=R:u.value.length=v},C=async x=>{var w;const v=V.cloneDeep(u.value);try{await((w=r.value)==null?void 0:w.validate(R=>{if(!R){if(!o.value||!v)return;U.UnitsHelper.productIsMeasurable(o.value)||delete v.length,a.value&&b.value&&(v.length=b.value),f.value=!0,h("submit",v,g.value,()=>{f.value=!1,x(!1),i.nextTick(()=>{var N;(N=r.value)==null||N.validate(V.noop).catch(V.noop)})})}}))}catch{}},T=()=>{o.value=null,l.value=void 0,u.value=null,g.value=m()};return e({show:(x,v)=>{var w,R,N,M,E;if(o.value=x,l.value=v==null?void 0:v.cartItemData,c.value=v==null?void 0:v.orderId,d.value=(v==null?void 0:v.canSetDopProdaga)??!1,u.value=new U.OrderItemBase((v==null?void 0:v.cartItemData)??new U.OrderItemBase({product:x,quantity:U.UnitsHelper.productIsMeasurable(o.value)?1:((w=x==null?void 0:x.properties)==null?void 0:w.minCount)??1,length:((R=x==null?void 0:x.properties)==null?void 0:R.minLength)||((N=x==null?void 0:x.properties)!=null&&N.ignoreMinCountCheck?0:(M=x==null?void 0:x.properties)==null?void 0:M.minCount)||0})),(E=x==null?void 0:x.properties)!=null&&E.isLengthConfigurator&&u.value&&b.value>0){const A=b.value,P=u.value.quantity||1;u.value.length=P*A}},closeDialog:T}),(x,v)=>{var E;const w=O.NFormItem,R=O.NInputGroupLabel,N=O.NInputGroup,M=O.NCheckbox;return i.openBlock(),i.createBlock(Od,{ref:"base-dialog-reference",show:!i.unref(V.isNil)(o.value)&&!i.unref(V.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(E=o.value)==null?void 0:E.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:f.value,"modal-width":500,onAccept:C,onClosing:T},{default:i.withCtx(()=>{var A;return[o.value&&u.value?(i.openBlock(),i.createBlock(i.unref(O.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((A=s.value)==null?void 0:A.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(w,{key:0,path:"length",label:`Метраж, ${y.value+o.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.length,"onUpdate:value":[v[0]||(v[0]=P=>u.value.length=P),_],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[1]||(v[1]=P=>i.unref(Ls)(P,".",!1)),onInput:v[2]||(v[2]=P=>i.unref(ze)(g.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(w,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode(N,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(O.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[3]||(v[3]=P=>u.value.quantity=P),B],parse:i.unref(xt),step:i.unref(U.UnitsHelper).getProductMultiplicity(o.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[4]||(v[4]=P=>i.unref(Ls)(P,".",!1)),onInput:v[5]||(v[5]=P=>i.unref(ze)(g.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock(R,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(o.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",H0,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(U.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(w,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(O.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[6]||(v[6]=P=>i.unref(ze)(g.value,"marker")),"onUpdate:value":v[7]||(v[7]=P=>u.value.marker=P??null),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(M,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":v[8]||(v[8]=P=>u.value.isAdditionalSale=P),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...v[9]||(v[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),q0={class:"flex flex-row gap-1"},X0={class:"sc-client-name flex flex-col gap-1 text-base"},Y0=["href"],U0={key:1,class:"text-sc-grey"},K0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},G0={key:0},Z0={key:1,class:"text-sm"},Q0={},pr=i.defineComponent({...Q0,__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?Tn.format(n.client.lastLoginAt,U.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),o=a=>{V.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Hs,d=O.NButton,u=O.NPopover;return i.openBlock(),i.createElementBlock("div",q0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(V.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",X0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>o(h))},[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",U0," [ Деактивирован ] "))],8,Y0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",K0," г. "+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",G0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Z0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),J0={class:"text-base"},eb={},zd=i.defineComponent({...eb,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",J0,i.toDisplayString(t.contragent.name),1))}}),tb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nb(t,e){return i.openBlock(),i.createElementBlock("svg",tb,[...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 ib=i.markRaw({name:"tabler-mail",render:nb}),rb=["href"],sb={},ob=i.defineComponent({...sb,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=ib;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,rb)],2)}}}),ab={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lb(t,e){return i.openBlock(),i.createElementBlock("svg",ab,[...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 Ld=i.markRaw({name:"fa6-brands-viber",render:lb}),cb={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},db=["id"],ub=["id"],hb=["fill"],fb=["fill"];function mb(t,e){return i.openBlock(),i.createElementBlock("svg",cb,[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,db),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,ub)]),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,hb),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,fb),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 Dd=i.markRaw({name:"logos-whatsapp-icon",render:mb,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),gb={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},pb=["id"],yb=["fill"];function bb(t,e){return i.openBlock(),i.createElementBlock("svg",gb,[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,pb)]),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,yb),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 Hd=i.markRaw({name:"logos-telegram",render:bb,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),_b={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wb(t,e){return i.openBlock(),i.createElementBlock("svg",_b,[...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 Wd=i.markRaw({name:"ion-call",render:wb}),xb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kb(t,e){return i.openBlock(),i.createElementBlock("svg",xb,[...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 vb=i.markRaw({name:"tabler-phone-call",render:kb}),Cb={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Sb=["href"],Bb=["href"],Tb=["href"],Rb=["href"],$b={},Nb=i.defineComponent({...$b,__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 V.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return V.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return V.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=vb,u=Wd,h=Hd,m=Dd,g=Ld;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]=f=>a.value=!a.value),onFocusout:c[1]||(c[1]=f=>a.value=!1),onMouseleave:c[2]||(c[2]=f=>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",Cb,[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(u)],8,Sb)):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(h)],8,Bb)):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,Tb)):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,Rb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Pb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Eb(t,e){return i.openBlock(),i.createElementBlock("svg",Pb,[...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 Fb=i.markRaw({name:"mdi-envelope",render:Eb}),Ab={class:"flex flex-col gap-1"},Mb={key:0,class:"mb-2 flex flex-col text-base"},Vb={key:0,class:"text-sc-dark-grey text-sm"},Ib={key:1,class:"whitespace-nowrap text-sm"},Ob={key:2,class:"whitespace-nowrap text-sm"},zb={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Lb=["href"],Db=["href"],Hb=["href"],Wb=["href"],jb=["href"],qb={key:0,class:"flex flex-col text-base"},Xb={key:0,class:"text-sc-dark-grey text-sm"},Yb={key:1,class:"mt-2 text-sm"},Ub={key:0,class:"-mt-1"},Kb={},Gb=i.defineComponent({...Kb,__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 V.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return V.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return V.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 u=Wd,h=Hd,m=Dd,g=Ld,f=Fb,p=O.NPopover;return i.openBlock(),i.createElementBlock("div",Ab,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,B,C,T;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]=$=>l.value=!0),onFocusin:d[1]||(d[1]=$=>l.value=!0),onMouseleave:d[2]||(d[2]=$=>l.value=!1),onFocusout:d[3]||(d[3]=$=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(B=t.contact)!=null&&B.position)?(i.openBlock(),i.createElementBlock("div",Mb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(C=t.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",Vb,i.toDisplayString((T=t.contact)==null?void 0:T.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Ib,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Ob,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",zb,[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(u)],8,Lb)):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(h)],8,Db)):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,Hb)):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,Wb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(f)],8,jb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,B,C,T;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",qb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",Xb,i.toDisplayString((B=t.contact)==null?void 0:B.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",Yb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((T=t.contact)==null?void 0:T.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",Ub,[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 Zb{constructor(e){S(this,"minHeight");S(this,"maxHeights");S(this,"minWidth");S(this,"maxWidths");S(this,"netType");S(this,"color");S(this,"mountType");S(this,"descriptions");S(this,"crossbarCount");S(this,"heightOverlaps");S(this,"widthOverlaps");S(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=zs.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=zs.objectToSnake(e.heightOverlaps),this.widthOverlaps=zs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}const Qb={class:"flex flex-wrap gap-2"},Jb={class:"flex flex-col"},e_={class:"flex flex-col"},t_={},n_=i.defineComponent({...t_,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>U.useBaseConfigStateStore().config.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 V.forOwn(U.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?Tn.startOfDay(new Date(a)):void 0,to:l?Tn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var u,h,m,g,f,p;const c=O.NButton,d=O.NDatePicker;return i.openBlock(),i.createElementBlock("div",Qb,[i.createVNode(d,{value:((h=(u=t.dateRange)==null?void 0:u.from)==null?void 0:h.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",Jb,[(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 B,C;return o((B=b==null?void 0:b.from)==null?void 0:B.getTime(),(C=b==null?void 0:b.to)==null?void 0:C.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:((f=(g=t.dateRange)==null?void 0:g.to)==null?void 0:f.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",e_,[(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 B,C;return o((B=b==null?void 0:b.from)==null?void 0:B.getTime(),(C=b==null?void 0:b.to)==null?void 0:C.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_={class:"sc-lbl-date text-nowrap"},r_={},fs=i.defineComponent({...r_,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>Tn.format(e.date,U.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>Tn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",i_,i.toDisplayString(n.value),1),t.isShowTime?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)):i.createCommentVNode("",!0)],2))}}),s_={class:"flex flex-row gap-2.5"},o_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},a_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},l_={class:"mb-0.5 sm:mb-0 sm:ml-3"},c_={},d_=i.defineComponent({...c_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=us,s=O.NButton,o=O.NPopover;return i.openBlock(),i.createElementBlock("div",s_,[i.createElementVNode("div",o_,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",a_,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",l_,[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)])])])])}}}),u_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function h_(t,e){return i.openBlock(),i.createElementBlock("svg",u_,[...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 f_=i.markRaw({name:"ion-download-outline",render:h_}),m_={},g_=i.defineComponent({...m_,__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 u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=f_;return i.openBlock(),i.createBlock(i.unref(O.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(O.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"])}}}),p_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function y_(t,e){return i.openBlock(),i.createElementBlock("svg",p_,[...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 b_=i.markRaw({name:"ion-checkmark-done-sharp",render:y_}),__={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function w_(t,e){return i.openBlock(),i.createElementBlock("svg",__,[...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 x_=i.markRaw({name:"ion-options-outline",render:w_}),k_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},v_={class:"flex-auto"},C_={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"},S_={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"},B_={},Ho=i.defineComponent({...B_,__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 u=x_,h=O.NButton,m=O.NPopover,g=b_,f=us;return i.openBlock(),i.createElementBlock("div",k_,[i.createElementVNode("div",v_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",C_,[i.createElementVNode("div",S_,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(u)]),_: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(h,{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(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),T_={},jd=i.defineComponent({...T_,__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(Ho,{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(Ho,{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"]))]))}}),R_={},$_=i.defineComponent({...R_,__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=V.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(O.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=u=>s.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),N_={},P_=i.defineComponent({...N_,__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","focus"],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=V.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,f)=>(i.openBlock(),i.createBlock(i.unref(O.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:f[0]||(f[0]=p=>s("keydown",p)),onInput:f[1]||(f[1]=p=>s("input",p)),onFocus:f[2]||(f[2]=p=>s("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),E_={},F_=i.defineComponent({...E_,__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=V.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(V.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(V.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 u=sr.parsePhoneNumberWithError(`+${d}`);u.isValid()?s.value=u.format("E.164"):u.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(u){if(u instanceof sr.ParseError)s.value=d;else throw u}};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(Uh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>s.value=u),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"]))}}),A_=Wn(F_,[["__scopeId","data-v-751dbb0e"]]),M_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V_(t,e){return i.openBlock(),i.createElementBlock("svg",M_,[...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 I_=i.markRaw({name:"tabler-external-link",render:V_}),O_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},z_=["href"],L_={},D_=i.defineComponent({...L_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=I_,s=O.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(V.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",O_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,z_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),H_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function W_(t,e){return i.openBlock(),i.createElementBlock("svg",H_,[...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 j_=i.markRaw({name:"ion-remove-circle-outline",render:W_});let ms=[];const qd=new WeakMap;function q_(){ms.forEach(t=>t(...qd.get(t))),ms=[]}function Xd(t,...e){qd.set(t,e),!ms.includes(t)&&ms.push(t)===1&&requestAnimationFrame(q_)}function yr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function br(t){return t.composedPath()[0]||null}function _r(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function wr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function en(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 Yd={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 X_(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 Y_(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 _n="^\\s*",wn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",zt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",Ud=new RegExp(`${_n}hsl\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Kd=new RegExp(`${_n}hsv\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Gd=new RegExp(`${_n}hsla\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),Zd=new RegExp(`${_n}hsva\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),U_=new RegExp(`${_n}rgb\\s*\\(${zt},${zt},${zt}\\)${wn}`),K_=new RegExp(`${_n}rgba\\s*\\(${zt},${zt},${zt},${zt}\\)${wn}`),G_=new RegExp(`${_n}#${mi}${mi}${mi}${wn}`),Z_=new RegExp(`${_n}#${gi}${gi}${gi}${wn}`),Q_=new RegExp(`${_n}#${mi}${mi}${mi}${mi}${wn}`),J_=new RegExp(`${_n}#${gi}${gi}${gi}${gi}${wn}`);function At(t){return parseInt(t,16)}function e1(t){try{let e;if(e=Gd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Ud.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function t1(t){try{let e;if(e=Zd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Kd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=Z_.exec(t))return[At(e[1]),At(e[2]),At(e[3]),1];if(e=U_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),1];if(e=K_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),yi(e[13])];if(e=G_.exec(t))return[At(e[1]+e[1]),At(e[2]+e[2]),At(e[3]+e[3]),1];if(e=J_.exec(t))return[At(e[1]),At(e[2]),At(e[3]),yi(At(e[4])/255)];if(e=Q_.exec(t))return[At(e[1]+e[1]),At(e[2]+e[2]),At(e[3]+e[3]),yi(At(e[4]+e[4])/255)];if(t in Yd)return pi(Yd[t]);if(Ud.test(t)||Gd.test(t)){const[n,r,s,o]=e1(t);return[...Y_(n,r,s),o]}else if(Kd.test(t)||Zd.test(t)){const[n,r,s,o]=t1(t);return[...X_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function n1(t){return t>1?1:t<0?0:t}function Wo(t,e,n,r){return`rgba(${mt(t)}, ${mt(e)}, ${mt(n)}, ${n1(r)})`}function jo(t,e,n,r,s){return mt((t*e*(1-r)+n*r)/s)}function i1(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],s=yi(n+r-n*r);return Wo(jo(t[0],n,e[0],r,s),jo(t[1],n,e[1],r,s),jo(t[2],n,e[2],r,s),s)}function Ie(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?Wo(n,r,s,e.alpha):Wo(n,r,s,o)}function gs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return r1([n*a,r*a,s*a,o*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function ps(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function mt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function r1(t){const[e,n,r]=t;return 3 in t?`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, ${yi(t[3])})`:`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, 1)`}function s1(t=8){return Math.random().toString(16).slice(2,2+t)}function Qd(t){return Array.isArray(t)?t:[t]}const qo={STOP:"STOP"};function Jd(t,e){const n=e(t);t.children!==void 0&&n!==qo.STOP&&t.children.forEach(r=>Jd(r,e))}function o1(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 a1(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function l1(t){return t.children}function c1(t){return t.key}function d1(){return!1}function u1(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function h1(t){return t.disabled===!0}function f1(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function m1(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Xo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Yo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function g1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function p1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function y1(t){return(t==null?void 0:t.type)==="group"}function b1(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 _1 extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function w1(t,e,n,r){return ys(e.concat(t),n,r,!1)}function x1(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 k1(t,e,n,r){const s=ys(e,n,r,!1),o=ys(t,n,r,!0),a=x1(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function Uo(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:g1(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:p1(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:u}=e;let h;s!==void 0?h=k1(s,n,e,d):r!==void 0?h=w1(r,n,e,d):h=ys(n,e,d,!1);const m=c==="parent",g=c==="child"||l,f=h,p=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,B=u.get(y);for(const C of B){if(C.isLeaf)continue;const{key:T,shallowLoaded:$}=C;if(g&&$&&C.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&f.has(R.key)&&f.delete(R.key)}),C.disabled||!$)continue;let x=!0,v=!1,w=!0;for(const R of C.children){const N=R.key;if(!R.disabled){if(w&&(w=!1),f.has(N))v=!0;else if(p.has(N)){v=!0,x=!1;break}else if(x=!1,v)break}}x&&!w?(m&&C.children.forEach(R=>{!R.disabled&&f.has(R.key)&&f.delete(R.key)}),f.add(T)):v&&p.add(T),_&&g&&f.has(T)&&f.delete(T)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(p)}}function ys(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&&Jd(d,u=>{if(u.disabled)return qo.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),f1(u.rawNode,o))){if(r)return qo.STOP;if(!n)throw new _1}})}),l}function v1(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 C1(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function S1(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 eu(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?B1:S1,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 u=Ko(d,o);u!==null?l=u:c(s(d,n))}else{const u=s(d,!1);if(u!==null)c(u);else{const h=T1(d);h!=null&&h.isGroup?c(s(h,n)):n&&c(s(d,!0))}}}}return c(t),l}function B1(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 T1(t){return t.parent}function Ko(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 u=Ko(d,e);if(u!==null)return u}else return d}}return null}const R1={getChild(){return this.ignored?null:Ko(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return eu(this,"next",t)},getPrev(t={}){return eu(this,"prev",t)}};function $1(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 N1(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var P1={};function tu(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var u;P1.NODE_ENV!=="production"&&m1(c,s)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=o,!h.ignored){const m=s(c);Array.isArray(m)&&(h.children=tu(m,e,n,r,s,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function E1(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=h1,getIgnored:a=d1,getIsGroup:l=y1,getKey:c=c1}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:l1,u=e.ignoreEmptyChildren?C=>{const T=d(C);return Array.isArray(T)?T.length?T:null:T}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return a1(this.rawNode,u)},get shallowLoaded(){return u1(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(C){return N1(this,C)}},R1),m=tu(t,r,s,h,u);function g(C){if(C==null)return null;const T=r.get(C);return T&&!T.isGroup&&!T.ignored?T:null}function f(C){if(C==null)return null;const T=r.get(C);return T&&!T.ignored?T:null}function p(C,T){const $=f(C);return $?$.getPrev(T):null}function b(C,T){const $=f(C);return $?$.getNext(T):null}function y(C){const T=f(C);return T?T.getParent():null}function _(C){const T=f(C);return T?T.getChild():null}const B={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:u,getFlattenedNodes(C){return $1(m,C)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return C1(m)},getPath(C,T={}){return v1(C,T,B)},getCheckedKeys(C,T={}){const{cascade:$=!0,leafOnly:x=!1,checkStrategy:v="all",allowNotLoaded:w=!1}=T;return Uo({checkedKeys:Xo(C),indeterminateKeys:Yo(C),cascade:$,leafOnly:x,checkStrategy:v,allowNotLoaded:w},B)},check(C,T,$={}){const{cascade:x=!0,leafOnly:v=!1,checkStrategy:w="all",allowNotLoaded:R=!1}=$;return Uo({checkedKeys:Xo(T),indeterminateKeys:Yo(T),keysToCheck:C==null?[]:Qd(C),cascade:x,leafOnly:v,checkStrategy:w,allowNotLoaded:R},B)},uncheck(C,T,$={}){const{cascade:x=!0,leafOnly:v=!1,checkStrategy:w="all",allowNotLoaded:R=!1}=$;return Uo({checkedKeys:Xo(T),indeterminateKeys:Yo(T),keysToUncheck:C==null?[]:Qd(C),cascade:x,leafOnly:v,checkStrategy:w,allowNotLoaded:R},B)},getNonLeafKeys(C={}){return o1(m,C)}};return B}function bs(t){return t.composedPath()[0]}const F1={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function A1(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(bs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(bs(a))},o=a=>{r&&(e.contains(bs(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 nu(t,e,n){const r=F1[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=A1(t,e,n)),o}function M1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=nu(t,e,n);return Object.keys(s).forEach(o=>{Tt(o,document,s[o],r)}),!0}return!1}function V1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=nu(t,e,n);return Object.keys(s).forEach(o=>{it(o,document,s[o],r)}),!0}return!1}function I1(){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(x,v,w){const R=x[v];return x[v]=function(){return w.apply(x,arguments),R.apply(x,arguments)},x}function o(x,v){x[v]=Event.prototype[v]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var x;return(x=a.get(this))!==null&&x!==void 0?x:null}function d(x,v){l!==void 0&&Object.defineProperty(x,"currentTarget",{configurable:!0,enumerable:!0,get:v??l.get})}const u={bubble:{},capture:{}},h={};function m(){const x=function(v){const{type:w,eventPhase:R,bubbles:N}=v,M=bs(v);if(R===2)return;const E=R===1?"capture":"bubble";let A=M;const P=[];for(;A===null&&(A=window),P.push(A),A!==window;)A=A.parentNode||null;const Y=u.capture[w],ee=u.bubble[w];if(s(v,"stopPropagation",n),s(v,"stopImmediatePropagation",r),d(v,c),E==="capture"){if(Y===void 0)return;for(let I=P.length-1;I>=0&&!t.has(v);--I){const L=P[I],q=Y.get(L);if(q!==void 0){a.set(v,L);for(const W of q){if(e.has(v))break;W(v)}}if(I===0&&!N&&ee!==void 0){const W=ee.get(L);if(W!==void 0)for(const z of W){if(e.has(v))break;z(v)}}}}else if(E==="bubble"){if(ee===void 0)return;for(let I=0;I<P.length&&!t.has(v);++I){const L=P[I],q=ee.get(L);if(q!==void 0){a.set(v,L);for(const W of q){if(e.has(v))break;W(v)}}}}o(v,"stopPropagation"),o(v,"stopImmediatePropagation"),d(v)};return x.displayName="evtdUnifiedHandler",x}function g(){const x=function(v){const{type:w,eventPhase:R}=v;if(R!==2)return;const N=h[w];N!==void 0&&N.forEach(M=>M(v))};return x.displayName="evtdUnifiedWindowEventHandler",x}const f=m(),p=g();function b(x,v){const w=u[x];return w[v]===void 0&&(w[v]=new Map,window.addEventListener(v,f,x==="capture")),w[v]}function y(x){return h[x]===void 0&&(h[x]=new Set,window.addEventListener(x,p)),h[x]}function _(x,v){let w=x.get(v);return w===void 0&&x.set(v,w=new Set),w}function B(x,v,w,R){const N=u[v][w];if(N!==void 0){const M=N.get(x);if(M!==void 0&&M.has(R))return!0}return!1}function C(x,v){const w=h[x];return!!(w!==void 0&&w.has(v))}function T(x,v,w,R){let N;if(typeof R=="object"&&R.once===!0?N=Y=>{$(x,v,N,R),w(Y)}:N=w,M1(x,v,N,R))return;const E=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=b(E,x),P=_(A,v);if(P.has(N)||P.add(N),v===window){const Y=y(x);Y.has(N)||Y.add(N)}}function $(x,v,w,R){if(V1(x,v,w,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0,E=M?"capture":"bubble",A=b(E,x),P=_(A,v);if(v===window&&!B(v,M?"bubble":"capture",x,w)&&C(x,w)){const ee=h[x];ee.delete(w),ee.size===0&&(window.removeEventListener(x,p),h[x]=void 0)}P.has(w)&&P.delete(w),P.size===0&&A.delete(v),A.size===0&&(window.removeEventListener(x,f,E==="capture"),u[E][x]=void 0)}return{on:T,off:$}}const{on:Tt,off:it}=I1(),Ki="@@mmoContext",O1={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Tt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(it("mousemoveoutside",t,n.handler),n.handler=e,Tt("mousemoveoutside",t,e)):(t[Ki].handler=e,Tt("mousemoveoutside",t,e)):n.handler&&(it("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&it("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",_s={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Tt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Tt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Tt("clickoutside",t,e,{capture:n.capture})):r.handler&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&it("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function z1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class L1{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&&z1("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 Go=new L1,Zi="@@ziContext",iu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Zi]={enabled:!!s,initialized:!1},s&&(Go.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Zi].enabled;s&&!o&&(Go.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!s},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Go.unregister(t,r)}};function D1(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 Ut(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 H1=typeof window<"u";let Qi,xr;(()=>{var t,e;Qi=H1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,xr=!1,Qi!==void 0?Qi.then(()=>{xr=!0}):xr=!0})();function W1(t){if(xr)return;let e=!1;i.onMounted(()=>{xr||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Zo(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function ws(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function ru(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 j1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function q1(){return j1}function Qo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Jo(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)){Jo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Jo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function su(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Jo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function ou(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function X1(t,e){const n=ou();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function ea(t){const e=t.getBoundingClientRect(),n=ou();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 Y1(t){return t.nodeType===9?null:t.parentNode}function au(t){if(t===null)return null;const e=Y1(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 au(e)}const lu=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=au(y),y!==null;)o.push(y);for(const _ of o)Tt("scroll",_,h,!0)},l=()=>{for(const y of o)it("scroll",y,h,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{Xd(m)},m=()=>{c.forEach(y=>y())},g=new Set,f=y=>{g.size===0&&Tt("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&it("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{it("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:u,addResizeListener:f,removeResizeListener:p}},render(){return Qo("binder",this.$slots)}}),cu=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(su("follower",this.$slots),[[e]]):su("follower",this.$slots)}}),U1="@css-render/vue3-ssr";function K1(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
105
|
</style>`}function G1(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(K1(t,e)))}const Z1=typeof document<"u";function bi(){if(Z1)return;const t=i.inject(U1,null);if(t!==null)return{adapter:(e,n)=>G1(e,n,t),context:t}}function du(t,e){console.error(`[vueuc/${t}]: ${e}`)}function Q1(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const uu=/\s*,(?![^(]*\))\s*/g,J1=/\s+/g;function ew(t,e){const n=[];return e.split(uu).forEach(r=>{let s=Q1(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 tw(t,e){const n=[];return e.split(uu).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function nw(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=ew(e,n):e=tw(e,n))}),e.join(", ").replace(J1," ")}function hu(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function xs(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function iw(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ks(t){return t?/^\s*@(s|m)/.test(t):!1}const rw=/[A-Z]/g;function fu(t){return t.replace(rw,e=>"-"+e.toLowerCase())}function sw(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(n=>e+` ${fu(n[0])}: ${n[1]};`).join(`
|
|
@@ -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
|
-
`,[ck(),ce("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),gk=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"}}),wh=i.defineComponent({name:"Scrollbar",props:gk,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),s=$r("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),B=i.ref(!1);let C=!1,T=!1,$,x,v=0,w=0,R=0,N=0;const M=q1(),E=pt("Scrollbar","-scrollbar",mk,wa,t,e),A=i.computed(()=>{const{value:F}=m,{value:X}=u,{value:ie}=f;return F===null||X===null||ie===null?0:Math.min(F,ie*F/X+_r(E.value.self.width)*1.5)}),P=i.computed(()=>`${A.value}px`),Y=i.computed(()=>{const{value:F}=g,{value:X}=h,{value:ie}=p;return F===null||X===null||ie===null?0:ie*F/X+_r(E.value.self.height)*1.5}),ee=i.computed(()=>`${Y.value}px`),I=i.computed(()=>{const{value:F}=m,{value:X}=b,{value:ie}=u,{value:de}=f;if(F===null||ie===null||de===null)return 0;{const he=ie-F;return he?X/he*(de-A.value):0}}),L=i.computed(()=>`${I.value}px`),q=i.computed(()=>{const{value:F}=g,{value:X}=y,{value:ie}=h,{value:de}=p;if(F===null||ie===null||de===null)return 0;{const he=ie-F;return he?X/he*(de-Y.value):0}}),W=i.computed(()=>`${q.value}px`),z=i.computed(()=>{const{value:F}=m,{value:X}=u;return F!==null&&X!==null&&X>F}),D=i.computed(()=>{const{value:F}=g,{value:X}=h;return F!==null&&X!==null&&X>F}),j=i.computed(()=>{const{trigger:F}=t;return F==="none"||_.value}),Z=i.computed(()=>{const{trigger:F}=t;return F==="none"||B.value}),ue=i.computed(()=>{const{container:F}=t;return F?F():a.value}),oe=i.computed(()=>{const{content:F}=t;return F?F():l.value}),re=(F,X)=>{if(!t.scrollable)return;if(typeof F=="number"){Te(F,X??0,0,!1,"auto");return}const{left:ie,top:de,index:he,elSize:ye,position:we,behavior:ke,el:Ge,debounce:Sn=!0}=F;(ie!==void 0||de!==void 0)&&Te(ie??0,de??0,0,!1,ke),Ge!==void 0?Te(0,Ge.offsetTop,Ge.offsetHeight,Sn,ke):he!==void 0&&ye!==void 0?Te(0,he*ye,ye,Sn,ke):we==="bottom"?Te(0,Number.MAX_SAFE_INTEGER,0,!1,ke):we==="top"&&Te(0,0,0,!1,ke)},Fe=Qw(()=>{t.container||re({top:b.value,left:y.value})}),je=()=>{Fe.isDeactivated||se()},Ae=F=>{if(Fe.isDeactivated)return;const{onResize:X}=t;X&&X(F),se()},Gt=(F,X)=>{if(!t.scrollable)return;const{value:ie}=ue;ie&&(typeof F=="object"?ie.scrollBy(F):ie.scrollBy(F,X||0))};function Te(F,X,ie,de,he){const{value:ye}=ue;if(ye){if(de){const{scrollTop:we,offsetHeight:ke}=ye;if(X>we){X+ie<=we+ke||ye.scrollTo({left:F,top:X+ie-ke,behavior:he});return}}ye.scrollTo({left:F,top:X,behavior:he})}}function sn(){wt(),Dn(),se()}function on(){$t()}function $t(){Lt(),an()}function Lt(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{B.value=!1},t.duration)}function an(){$!==void 0&&window.clearTimeout($),$=window.setTimeout(()=>{_.value=!1},t.duration)}function wt(){$!==void 0&&window.clearTimeout($),_.value=!0}function Dn(){x!==void 0&&window.clearTimeout(x),B.value=!0}function ln(F){const{onScroll:X}=t;X&&X(F),Zt()}function Zt(){const{value:F}=ue;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(s!=null&&s.value?-1:1))}function $e(){const{value:F}=oe;F&&(u.value=F.offsetHeight,h.value=F.offsetWidth);const{value:X}=ue;X&&(m.value=X.offsetHeight,g.value=X.offsetWidth);const{value:ie}=d,{value:de}=c;ie&&(p.value=ie.offsetWidth),de&&(f.value=de.offsetHeight)}function G(){const{value:F}=ue;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(s!=null&&s.value?-1:1),m.value=F.offsetHeight,g.value=F.offsetWidth,u.value=F.scrollHeight,h.value=F.scrollWidth);const{value:X}=d,{value:ie}=c;X&&(p.value=X.offsetWidth),ie&&(f.value=ie.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?G():($e(),Zt()))}function Oe(F){var X;return!(!((X=o.value)===null||X===void 0)&&X.contains(br(F)))}function ni(F){F.preventDefault(),F.stopPropagation(),T=!0,Tt("mousemove",window,Je,!0),Tt("mouseup",window,Dt,!0),w=y.value,R=s!=null&&s.value?window.innerWidth-F.clientX:F.clientX}function Je(F){if(!T)return;$!==void 0&&window.clearTimeout($),x!==void 0&&window.clearTimeout(x);const{value:X}=g,{value:ie}=h,{value:de}=Y;if(X===null||ie===null)return;const ye=(s!=null&&s.value?window.innerWidth-F.clientX-R:F.clientX-R)*(ie-X)/(X-de),we=ie-X;let ke=w+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ge}=ue;if(Ge){Ge.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Sn}=t;Sn&&Sn(ke)}}function Dt(F){F.preventDefault(),F.stopPropagation(),it("mousemove",window,Je,!0),it("mouseup",window,Dt,!0),T=!1,se(),Oe(F)&&$t()}function tr(F){F.preventDefault(),F.stopPropagation(),C=!0,Tt("mousemove",window,ii,!0),Tt("mouseup",window,$i,!0),v=b.value,N=F.clientY}function ii(F){if(!C)return;$!==void 0&&window.clearTimeout($),x!==void 0&&window.clearTimeout(x);const{value:X}=m,{value:ie}=u,{value:de}=A;if(X===null||ie===null)return;const ye=(F.clientY-N)*(ie-X)/(X-de),we=ie-X;let ke=v+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ge}=ue;Ge&&(Ge.scrollTop=ke)}function $i(F){F.preventDefault(),F.stopPropagation(),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0),C=!1,se(),Oe(F)&&$t()}i.watchEffect(()=>{const{value:F}=D,{value:X}=z,{value:ie}=e,{value:de}=d,{value:he}=c;de&&(F?de.classList.remove(`${ie}-scrollbar-rail--disabled`):de.classList.add(`${ie}-scrollbar-rail--disabled`)),he&&(X?he.classList.remove(`${ie}-scrollbar-rail--disabled`):he.classList.add(`${ie}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{$!==void 0&&window.clearTimeout($),x!==void 0&&window.clearTimeout(x),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:F},self:{color:X,colorHover:ie,height:de,width:he,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ke,railInsetVerticalRight:Ge,railInsetVerticalLeft:Sn,railColor:$a}}=E.value,{top:Na,right:Pa,bottom:Ea,left:Fa}=en(we),{top:Aa,right:Ma,bottom:Va,left:Ia}=en(ke),{top:Oa,right:za,bottom:La,left:Da}=en(s!=null&&s.value?nh(Ge):Ge),{top:Ha,right:Wa,bottom:ja,left:qa}=en(s!=null&&s.value?nh(Sn):Sn);return{"--n-scrollbar-bezier":F,"--n-scrollbar-color":X,"--n-scrollbar-color-hover":ie,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":he,"--n-scrollbar-height":de,"--n-scrollbar-rail-top-horizontal-top":Na,"--n-scrollbar-rail-right-horizontal-top":Pa,"--n-scrollbar-rail-bottom-horizontal-top":Ea,"--n-scrollbar-rail-left-horizontal-top":Fa,"--n-scrollbar-rail-top-horizontal-bottom":Aa,"--n-scrollbar-rail-right-horizontal-bottom":Ma,"--n-scrollbar-rail-bottom-horizontal-bottom":Va,"--n-scrollbar-rail-left-horizontal-bottom":Ia,"--n-scrollbar-rail-top-vertical-right":Oa,"--n-scrollbar-rail-right-vertical-right":za,"--n-scrollbar-rail-bottom-vertical-right":La,"--n-scrollbar-rail-left-vertical-right":Da,"--n-scrollbar-rail-top-vertical-left":Ha,"--n-scrollbar-rail-right-vertical-left":Wa,"--n-scrollbar-rail-bottom-vertical-left":ja,"--n-scrollbar-rail-left-vertical-left":qa,"--n-scrollbar-rail-color":$a}}),cn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Gt,sync:se,syncUnifiedContainer:G,handleMouseEnterWrapper:sn,handleMouseLeaveWrapper:on}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:z,needXBar:D,yBarSizePx:P,xBarSizePx:ee,yBarTopPx:L,xBarLeftPx:W,isShowXBar:j,isShowYBar:Z,isIos:M,handleScroll:ln,handleContentResize:je,handleContainerResize:Ae,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:cn==null?void 0:cn.themeClass,onRender:cn==null?void 0:cn.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",u=(g,f)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?pa: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})),h=()=>{var g,f;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?(f=e.default)===null||f===void 0?void 0:f.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($s,{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:u(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?pa: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?h():i.h($s,{onResize:this.handleContainerResize},{default:h});return o?i.h(i.Fragment,null,m,u(this.themeClass,this.cssVars)):m}}),pk=wh,yk={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function bk(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},yk),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const xh={name:"Empty",common:Si,self:bk},_k=ge("empty",`
|
|
297
|
+
`,[ck(),ce("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),gk=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"}}),wh=i.defineComponent({name:"Scrollbar",props:gk,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),s=$r("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),B=i.ref(!1);let C=!1,T=!1,$,x,v=0,w=0,R=0,N=0;const M=q1(),E=pt("Scrollbar","-scrollbar",mk,wa,t,e),A=i.computed(()=>{const{value:F}=m,{value:X}=u,{value:ie}=f;return F===null||X===null||ie===null?0:Math.min(F,ie*F/X+_r(E.value.self.width)*1.5)}),P=i.computed(()=>`${A.value}px`),Y=i.computed(()=>{const{value:F}=g,{value:X}=h,{value:ie}=p;return F===null||X===null||ie===null?0:ie*F/X+_r(E.value.self.height)*1.5}),ee=i.computed(()=>`${Y.value}px`),I=i.computed(()=>{const{value:F}=m,{value:X}=b,{value:ie}=u,{value:de}=f;if(F===null||ie===null||de===null)return 0;{const he=ie-F;return he?X/he*(de-A.value):0}}),L=i.computed(()=>`${I.value}px`),q=i.computed(()=>{const{value:F}=g,{value:X}=y,{value:ie}=h,{value:de}=p;if(F===null||ie===null||de===null)return 0;{const he=ie-F;return he?X/he*(de-Y.value):0}}),W=i.computed(()=>`${q.value}px`),z=i.computed(()=>{const{value:F}=m,{value:X}=u;return F!==null&&X!==null&&X>F}),D=i.computed(()=>{const{value:F}=g,{value:X}=h;return F!==null&&X!==null&&X>F}),j=i.computed(()=>{const{trigger:F}=t;return F==="none"||_.value}),Z=i.computed(()=>{const{trigger:F}=t;return F==="none"||B.value}),ue=i.computed(()=>{const{container:F}=t;return F?F():a.value}),oe=i.computed(()=>{const{content:F}=t;return F?F():l.value}),re=(F,X)=>{if(!t.scrollable)return;if(typeof F=="number"){Te(F,X??0,0,!1,"auto");return}const{left:ie,top:de,index:he,elSize:ye,position:we,behavior:ke,el:Ge,debounce:Sn=!0}=F;(ie!==void 0||de!==void 0)&&Te(ie??0,de??0,0,!1,ke),Ge!==void 0?Te(0,Ge.offsetTop,Ge.offsetHeight,Sn,ke):he!==void 0&&ye!==void 0?Te(0,he*ye,ye,Sn,ke):we==="bottom"?Te(0,Number.MAX_SAFE_INTEGER,0,!1,ke):we==="top"&&Te(0,0,0,!1,ke)},Fe=Qw(()=>{t.container||re({top:b.value,left:y.value})}),je=()=>{Fe.isDeactivated||se()},Ae=F=>{if(Fe.isDeactivated)return;const{onResize:X}=t;X&&X(F),se()},Gt=(F,X)=>{if(!t.scrollable)return;const{value:ie}=ue;ie&&(typeof F=="object"?ie.scrollBy(F):ie.scrollBy(F,X||0))};function Te(F,X,ie,de,he){const{value:ye}=ue;if(ye){if(de){const{scrollTop:we,offsetHeight:ke}=ye;if(X>we){X+ie<=we+ke||ye.scrollTo({left:F,top:X+ie-ke,behavior:he});return}}ye.scrollTo({left:F,top:X,behavior:he})}}function sn(){wt(),Dn(),se()}function on(){$t()}function $t(){Lt(),an()}function Lt(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{B.value=!1},t.duration)}function an(){$!==void 0&&window.clearTimeout($),$=window.setTimeout(()=>{_.value=!1},t.duration)}function wt(){$!==void 0&&window.clearTimeout($),_.value=!0}function Dn(){x!==void 0&&window.clearTimeout(x),B.value=!0}function ln(F){const{onScroll:X}=t;X&&X(F),Zt()}function Zt(){const{value:F}=ue;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(s!=null&&s.value?-1:1))}function Ne(){const{value:F}=oe;F&&(u.value=F.offsetHeight,h.value=F.offsetWidth);const{value:X}=ue;X&&(m.value=X.offsetHeight,g.value=X.offsetWidth);const{value:ie}=d,{value:de}=c;ie&&(p.value=ie.offsetWidth),de&&(f.value=de.offsetHeight)}function G(){const{value:F}=ue;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(s!=null&&s.value?-1:1),m.value=F.offsetHeight,g.value=F.offsetWidth,u.value=F.scrollHeight,h.value=F.scrollWidth);const{value:X}=d,{value:ie}=c;X&&(p.value=X.offsetWidth),ie&&(f.value=ie.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?G():(Ne(),Zt()))}function Oe(F){var X;return!(!((X=o.value)===null||X===void 0)&&X.contains(br(F)))}function ni(F){F.preventDefault(),F.stopPropagation(),T=!0,Tt("mousemove",window,Je,!0),Tt("mouseup",window,Dt,!0),w=y.value,R=s!=null&&s.value?window.innerWidth-F.clientX:F.clientX}function Je(F){if(!T)return;$!==void 0&&window.clearTimeout($),x!==void 0&&window.clearTimeout(x);const{value:X}=g,{value:ie}=h,{value:de}=Y;if(X===null||ie===null)return;const ye=(s!=null&&s.value?window.innerWidth-F.clientX-R:F.clientX-R)*(ie-X)/(X-de),we=ie-X;let ke=w+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ge}=ue;if(Ge){Ge.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Sn}=t;Sn&&Sn(ke)}}function Dt(F){F.preventDefault(),F.stopPropagation(),it("mousemove",window,Je,!0),it("mouseup",window,Dt,!0),T=!1,se(),Oe(F)&&$t()}function tr(F){F.preventDefault(),F.stopPropagation(),C=!0,Tt("mousemove",window,ii,!0),Tt("mouseup",window,$i,!0),v=b.value,N=F.clientY}function ii(F){if(!C)return;$!==void 0&&window.clearTimeout($),x!==void 0&&window.clearTimeout(x);const{value:X}=m,{value:ie}=u,{value:de}=A;if(X===null||ie===null)return;const ye=(F.clientY-N)*(ie-X)/(X-de),we=ie-X;let ke=v+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ge}=ue;Ge&&(Ge.scrollTop=ke)}function $i(F){F.preventDefault(),F.stopPropagation(),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0),C=!1,se(),Oe(F)&&$t()}i.watchEffect(()=>{const{value:F}=D,{value:X}=z,{value:ie}=e,{value:de}=d,{value:he}=c;de&&(F?de.classList.remove(`${ie}-scrollbar-rail--disabled`):de.classList.add(`${ie}-scrollbar-rail--disabled`)),he&&(X?he.classList.remove(`${ie}-scrollbar-rail--disabled`):he.classList.add(`${ie}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{$!==void 0&&window.clearTimeout($),x!==void 0&&window.clearTimeout(x),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:F},self:{color:X,colorHover:ie,height:de,width:he,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ke,railInsetVerticalRight:Ge,railInsetVerticalLeft:Sn,railColor:$a}}=E.value,{top:Na,right:Pa,bottom:Ea,left:Fa}=en(we),{top:Aa,right:Ma,bottom:Va,left:Ia}=en(ke),{top:Oa,right:za,bottom:La,left:Da}=en(s!=null&&s.value?nh(Ge):Ge),{top:Ha,right:Wa,bottom:ja,left:qa}=en(s!=null&&s.value?nh(Sn):Sn);return{"--n-scrollbar-bezier":F,"--n-scrollbar-color":X,"--n-scrollbar-color-hover":ie,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":he,"--n-scrollbar-height":de,"--n-scrollbar-rail-top-horizontal-top":Na,"--n-scrollbar-rail-right-horizontal-top":Pa,"--n-scrollbar-rail-bottom-horizontal-top":Ea,"--n-scrollbar-rail-left-horizontal-top":Fa,"--n-scrollbar-rail-top-horizontal-bottom":Aa,"--n-scrollbar-rail-right-horizontal-bottom":Ma,"--n-scrollbar-rail-bottom-horizontal-bottom":Va,"--n-scrollbar-rail-left-horizontal-bottom":Ia,"--n-scrollbar-rail-top-vertical-right":Oa,"--n-scrollbar-rail-right-vertical-right":za,"--n-scrollbar-rail-bottom-vertical-right":La,"--n-scrollbar-rail-left-vertical-right":Da,"--n-scrollbar-rail-top-vertical-left":Ha,"--n-scrollbar-rail-right-vertical-left":Wa,"--n-scrollbar-rail-bottom-vertical-left":ja,"--n-scrollbar-rail-left-vertical-left":qa,"--n-scrollbar-rail-color":$a}}),cn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Gt,sync:se,syncUnifiedContainer:G,handleMouseEnterWrapper:sn,handleMouseLeaveWrapper:on}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:z,needXBar:D,yBarSizePx:P,xBarSizePx:ee,yBarTopPx:L,xBarLeftPx:W,isShowXBar:j,isShowYBar:Z,isIos:M,handleScroll:ln,handleContentResize:je,handleContainerResize:Ae,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:cn==null?void 0:cn.themeClass,onRender:cn==null?void 0:cn.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",u=(g,f)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?pa: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})),h=()=>{var g,f;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?(f=e.default)===null||f===void 0?void 0:f.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($s,{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:u(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?pa: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?h():i.h($s,{onResize:this.handleContainerResize},{default:h});return o?i.h(i.Fragment,null,m,u(this.themeClass,this.cssVars)):m}}),pk=wh,yk={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function bk(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},yk),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const xh={name:"Empty",common:Si,self:bk},_k=ge("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
@@ -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
|
-
`,[Th({enterScale:"0.5"})])])]),Bk=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}=vi(t),r=$r("InternalSelectMenu",n,e),s=pt("InternalSelectMenu","-internal-select-menu",Sk,kh,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(()=>b1(c.value)),u=i.ref(null);function h(){const{treeMate:z}=t;let D=null;const{value:j}=t;j===null?D=z.getFirstAvailableNode():(t.multiple?D=z.getNode((j||[])[(j||[]).length-1]):D=z.getNode(j),(!D||D.disabled)&&(D=z.getFirstAvailableNode())),A(D||null)}function m(){const{value:z}=u;z&&!t.treeMate.getNode(z.key)&&(u.value=null)}let g;i.watch(()=>t.show,z=>{z?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():m(),i.nextTick(P)):m()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const f=i.computed(()=>_r(s.value.self[Qe("optionHeight",t.size)])),p=i.computed(()=>en(s.value.self[Qe("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const z=c.value;return z&&z.length===0});function _(z){const{onToggle:D}=t;D&&D(z)}function B(z){const{onScroll:D}=t;D&&D(z)}function C(z){var D;(D=l.value)===null||D===void 0||D.sync(),B(z)}function T(){var z;(z=l.value)===null||z===void 0||z.sync()}function $(){const{value:z}=u;return z||null}function x(z,D){D.disabled||A(D,!1)}function v(z,D){D.disabled||_(D)}function w(z){var D;yr(z,"action")||(D=t.onKeyup)===null||D===void 0||D.call(t,z)}function R(z){var D;yr(z,"action")||(D=t.onKeydown)===null||D===void 0||D.call(t,z)}function N(z){var D;(D=t.onMousedown)===null||D===void 0||D.call(t,z),!t.focusable&&z.preventDefault()}function M(){const{value:z}=u;z&&A(z.getNext({loop:!0}),!0)}function E(){const{value:z}=u;z&&A(z.getPrev({loop:!0}),!0)}function A(z,D=!1){u.value=z,D&&P()}function P(){var z,D;const j=u.value;if(!j)return;const Z=d.value(j.key);Z!==null&&(t.virtualScroll?(z=a.value)===null||z===void 0||z.scrollTo({index:Z}):(D=l.value)===null||D===void 0||D.scrollTo({index:Z,elSize:f.value}))}function Y(z){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(z.target)&&((j=t.onFocus)===null||j===void 0||j.call(t,z))}function ee(z){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(z.relatedTarget)||(j=t.onBlur)===null||j===void 0||j.call(t,z)}i.provide(da,{handleOptionMouseEnter:x,handleOptionClick:v,valueSetRef:b,pendingTmNodeRef:u,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(Uu,o),i.onMounted(()=>{const{value:z}=l;z&&z.sync()});const I=i.computed(()=>{const{size:z}=t,{common:{cubicBezierEaseInOut:D},self:{height:j,borderRadius:Z,color:ue,groupHeaderTextColor:oe,actionDividerColor:re,optionTextColorPressed:Fe,optionTextColor:je,optionTextColorDisabled:Ae,optionTextColorActive:Gt,optionOpacityDisabled:Te,optionCheckColor:sn,actionTextColor:on,optionColorPending:$t,optionColorActive:Lt,loadingColor:an,loadingSize:wt,optionColorActivePending:Dn,[Qe("optionFontSize",z)]:ln,[Qe("optionHeight",z)]:Zt,[Qe("optionPadding",z)]
|
|
427
|
+
`,[Th({enterScale:"0.5"})])])]),Bk=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}=vi(t),r=$r("InternalSelectMenu",n,e),s=pt("InternalSelectMenu","-internal-select-menu",Sk,kh,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(()=>b1(c.value)),u=i.ref(null);function h(){const{treeMate:z}=t;let D=null;const{value:j}=t;j===null?D=z.getFirstAvailableNode():(t.multiple?D=z.getNode((j||[])[(j||[]).length-1]):D=z.getNode(j),(!D||D.disabled)&&(D=z.getFirstAvailableNode())),A(D||null)}function m(){const{value:z}=u;z&&!t.treeMate.getNode(z.key)&&(u.value=null)}let g;i.watch(()=>t.show,z=>{z?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():m(),i.nextTick(P)):m()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const f=i.computed(()=>_r(s.value.self[Qe("optionHeight",t.size)])),p=i.computed(()=>en(s.value.self[Qe("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const z=c.value;return z&&z.length===0});function _(z){const{onToggle:D}=t;D&&D(z)}function B(z){const{onScroll:D}=t;D&&D(z)}function C(z){var D;(D=l.value)===null||D===void 0||D.sync(),B(z)}function T(){var z;(z=l.value)===null||z===void 0||z.sync()}function $(){const{value:z}=u;return z||null}function x(z,D){D.disabled||A(D,!1)}function v(z,D){D.disabled||_(D)}function w(z){var D;yr(z,"action")||(D=t.onKeyup)===null||D===void 0||D.call(t,z)}function R(z){var D;yr(z,"action")||(D=t.onKeydown)===null||D===void 0||D.call(t,z)}function N(z){var D;(D=t.onMousedown)===null||D===void 0||D.call(t,z),!t.focusable&&z.preventDefault()}function M(){const{value:z}=u;z&&A(z.getNext({loop:!0}),!0)}function E(){const{value:z}=u;z&&A(z.getPrev({loop:!0}),!0)}function A(z,D=!1){u.value=z,D&&P()}function P(){var z,D;const j=u.value;if(!j)return;const Z=d.value(j.key);Z!==null&&(t.virtualScroll?(z=a.value)===null||z===void 0||z.scrollTo({index:Z}):(D=l.value)===null||D===void 0||D.scrollTo({index:Z,elSize:f.value}))}function Y(z){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(z.target)&&((j=t.onFocus)===null||j===void 0||j.call(t,z))}function ee(z){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(z.relatedTarget)||(j=t.onBlur)===null||j===void 0||j.call(t,z)}i.provide(da,{handleOptionMouseEnter:x,handleOptionClick:v,valueSetRef:b,pendingTmNodeRef:u,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(Uu,o),i.onMounted(()=>{const{value:z}=l;z&&z.sync()});const I=i.computed(()=>{const{size:z}=t,{common:{cubicBezierEaseInOut:D},self:{height:j,borderRadius:Z,color:ue,groupHeaderTextColor:oe,actionDividerColor:re,optionTextColorPressed:Fe,optionTextColor:je,optionTextColorDisabled:Ae,optionTextColorActive:Gt,optionOpacityDisabled:Te,optionCheckColor:sn,actionTextColor:on,optionColorPending:$t,optionColorActive:Lt,loadingColor:an,loadingSize:wt,optionColorActivePending:Dn,[Qe("optionFontSize",z)]:ln,[Qe("optionHeight",z)]:Zt,[Qe("optionPadding",z)]:Ne}}=s.value;return{"--n-height":j,"--n-action-divider-color":re,"--n-action-text-color":on,"--n-bezier":D,"--n-border-radius":Z,"--n-color":ue,"--n-option-font-size":ln,"--n-group-header-text-color":oe,"--n-option-check-color":sn,"--n-option-color-pending":$t,"--n-option-color-active":Lt,"--n-option-color-active-pending":Dn,"--n-option-height":Zt,"--n-option-opacity-disabled":Te,"--n-option-text-color":je,"--n-option-text-color-active":Gt,"--n-option-text-color-disabled":Ae,"--n-option-text-color-pressed":Fe,"--n-option-padding":Ne,"--n-option-padding-left":en(Ne,"left"),"--n-option-padding-right":en(Ne,"right"),"--n-loading-color":an,"--n-loading-size":wt}}),{inlineThemeDisabled:L}=t,q=L?Ci("internal-select-menu",i.computed(()=>t.size[0]),I,t):void 0,W={selfRef:o,next:M,prev:E,getPendingTmNode:$};return Ju(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:f,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:z}=a;return z==null?void 0:z.listElRef},virtualListContent(){const{value:z}=a;return z==null?void 0:z.itemsElRef},doScroll:B,handleFocusin:Y,handleFocusout:ee,handleKeyUp:w,handleKeyDown:R,handleMouseDown:N,handleVirtualListResize:T,handleVirtualListScroll:C,cssVars:L?void 0:I,themeClass:q==null?void 0:q.themeClass,onRender:q==null?void 0:q.onRender},W)},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},xi(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(ph,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},ga(t.empty,()=>[i.h(xk,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(wh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(Uw,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(vh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(Ch,{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(vh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(Ch,{clsPrefix:n,key:a.key,tmNode:a})))}),xi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(ok,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Tk={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Rk(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},Tk),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const Rh={name:"Popover",common:Si,peers:{Scrollbar:wa},self:Rk},xa={top:"bottom",bottom:"top",left:"right",right:"left"},rt="var(--n-arrow-height) * 1.414",$k=ce([ge("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -810,7 +810,7 @@ ${s}
|
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),Zk=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}=vi(t),r=$r("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),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=pt("InternalSelection","-internal-selection",Gk,Nh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),B=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),C=i.computed(()=>{const G=t.selectedOption;if(G)return G[t.labelField]}),T=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function $(){var G;const{value:se}=s;if(se){const{value:Oe}=o;Oe&&(Oe.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((G=m.value)===null||G===void 0||G.sync({showAllItemsBeforeCalculate:!1})))}}function x(){const{value:G}=g;G&&(G.style.display="none")}function v(){const{value:G}=g;G&&(G.style.display="inline-block")}i.watch(i.toRef(t,"active"),G=>{G||x()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick($)});function w(G){const{onFocus:se}=t;se&&se(G)}function R(G){const{onBlur:se}=t;se&&se(G)}function N(G){const{onDeleteOption:se}=t;se&&se(G)}function M(G){const{onClear:se}=t;se&&se(G)}function E(G){const{onPatternInput:se}=t;se&&se(G)}function A(G){var se;(!G.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(G.relatedTarget)))&&w(G)}function P(G){var se;!((se=a.value)===null||se===void 0)&&se.contains(G.relatedTarget)||R(G)}function Y(G){M(G)}function ee(){b.value=!0}function I(){b.value=!1}function L(G){!t.active||!t.filterable||G.target!==o.value&&G.preventDefault()}function q(G){N(G)}const W=i.ref(!1);function z(G){if(G.key==="Backspace"&&!W.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let D=null;function j(G){const{value:se}=s;if(se){const Oe=G.target.value;se.textContent=Oe,$()}t.ignoreComposition&&W.value?D=G:E(G)}function Z(){W.value=!0}function ue(){W.value=!1,t.ignoreComposition&&E(D),D=null}function oe(G){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,G)}function re(G){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,G)}function Fe(){var G,se;if(t.filterable)p.value=!1,(G=d.value)===null||G===void 0||G.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Oe}=l;Oe==null||Oe.blur()}else{const{value:Oe}=c;Oe==null||Oe.blur()}}function je(){var G,se,Oe;t.filterable?(p.value=!1,(G=d.value)===null||G===void 0||G.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Oe=c.value)===null||Oe===void 0||Oe.focus()}function Ae(){const{value:G}=o;G&&(v(),G.focus())}function Gt(){const{value:G}=o;G&&G.blur()}function Te(G){const{value:se}=u;se&&se.setTextContent(`+${G}`)}function sn(){const{value:G}=h;return G}function on(){return o.value}let $t=null;function Lt(){$t!==null&&window.clearTimeout($t)}function an(){t.active||(Lt(),$t=window.setTimeout(()=>{T.value&&(f.value=!0)},100))}function wt(){Lt()}function Dn(G){G||(Lt(),f.value=!1)}i.watch(T,G=>{G||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const G=d.value;G&&(t.disabled?G.removeAttribute("tabindex"):G.tabIndex=p.value?-1:0)})}),Ju(a,t.onResize);const{inlineThemeDisabled:ln}=t,Zt=i.computed(()=>{const{size:G}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Oe,borderRadius:ni,color:Je,placeholderColor:Dt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:cn,textColorDisabled:Hn,placeholderColorDisabled:F,colorActive:X,boxShadowFocus:ie,boxShadowActive:de,boxShadowHover:he,border:ye,borderFocus:we,borderHover:ke,borderActive:Ge,arrowColor:Sn,arrowColorDisabled:$a,loadingColor:Na,colorActiveWarning:Pa,boxShadowFocusWarning:Ea,boxShadowActiveWarning:Fa,boxShadowHoverWarning:Aa,borderWarning:Ma,borderFocusWarning:Va,borderHoverWarning:Ia,borderActiveWarning:Oa,colorActiveError:za,boxShadowFocusError:La,boxShadowActiveError:Da,boxShadowHoverError:Ha,borderError:Wa,borderFocusError:ja,borderHoverError:qa,borderActiveError:q2,clearColor:X2,clearColorHover:Y2,clearColorPressed:U2,clearSize:K2,arrowSize:G2,[Qe("height",G)]:Z2,[Qe("fontSize",G)]:Q2}}=y.value,Vs=en(ii),Is=en($i);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Ge,"--n-border-focus":we,"--n-border-hover":ke,"--n-border-radius":ni,"--n-box-shadow-active":de,"--n-box-shadow-focus":ie,"--n-box-shadow-hover":he,"--n-caret-color":nr,"--n-color":Je,"--n-color-active":X,"--n-color-disabled":cn,"--n-font-size":Q2,"--n-height":Z2,"--n-padding-single-top":Vs.top,"--n-padding-multiple-top":Is.top,"--n-padding-single-right":Vs.right,"--n-padding-multiple-right":Is.right,"--n-padding-single-left":Vs.left,"--n-padding-multiple-left":Is.left,"--n-padding-single-bottom":Vs.bottom,"--n-padding-multiple-bottom":Is.bottom,"--n-placeholder-color":Dt,"--n-placeholder-color-disabled":F,"--n-text-color":tr,"--n-text-color-disabled":Hn,"--n-arrow-color":Sn,"--n-arrow-color-disabled":$a,"--n-loading-color":Na,"--n-color-active-warning":Pa,"--n-box-shadow-focus-warning":Ea,"--n-box-shadow-active-warning":Fa,"--n-box-shadow-hover-warning":Aa,"--n-border-warning":Ma,"--n-border-focus-warning":Va,"--n-border-hover-warning":Ia,"--n-border-active-warning":Oa,"--n-color-active-error":za,"--n-box-shadow-focus-error":La,"--n-box-shadow-active-error":Da,"--n-box-shadow-hover-error":Ha,"--n-border-error":Wa,"--n-border-focus-error":ja,"--n-border-hover-error":qa,"--n-border-active-error":q2,"--n-clear-size":K2,"--n-clear-color":X2,"--n-clear-color-hover":Y2,"--n-clear-color-pressed":U2,"--n-arrow-size":G2,"--n-font-weight":Oe}}),$e=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Zt,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:B,label:C,selected:T,showTagsPanel:f,isComposing:W,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:L,handleFocusin:A,handleClear:Y,handleMouseEnter:ee,handleMouseLeave:I,handleDeleteOption:q,handlePatternKeyDown:z,handlePatternInputInput:j,handlePatternInputBlur:re,handlePatternInputFocus:oe,handleMouseEnterCounter:an,handleMouseLeaveCounter:wt,handleFocusout:P,handleCompositionEnd:ue,handleCompositionStart:Z,onPopoverUpdateShow:Dn,focus:je,focusInput:Ae,blur:Fe,blurInput:Gt,updateCounter:Te,getCounter:sn,getTail:on,renderLabel:t.renderLabel,cssVars:ln?void 0:Zt,themeClass:$e==null?void 0:$e.themeClass,onRender:$e==null?void 0:$e.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",f=m||g,p=i.h(pa,null,{default:()=>i.h(Yk,{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,_=E=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:E.value},u?u({option:E,handleClose:()=>{this.handleDeleteOption(E)}}):i.h(ka,{size:n,closable:!E.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(E)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(E,!0):er(E[y],E,!0)})),B=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),C=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,T=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let $;if(g){const E=this.selectedOptions.length-o;E>0&&($=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${E}`})))}const x=m?s?i.h(Wu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:T,tail:()=>C}):i.h(Wu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:T}):g&&$?B().concat($):B(),v=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?B():this.selectedOptions.map(_)):void 0,w=f?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,N=(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,M=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},x,m?null:C,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},x,p);b=i.h(i.Fragment,null,f?i.h(Ok,Object.assign({},w,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>M,default:v}):M,N)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,B=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:oh(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})),B?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`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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:oh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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 Qk(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Jk={name:"Select",common:Si,peers:{InternalSelection:Nh,InternalSelectMenu:kh},self:Qk},ev=ce([ge("select",`
|
|
813
|
+
`)])])]),Zk=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}=vi(t),r=$r("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),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=pt("InternalSelection","-internal-selection",Gk,Nh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),B=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),C=i.computed(()=>{const G=t.selectedOption;if(G)return G[t.labelField]}),T=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function $(){var G;const{value:se}=s;if(se){const{value:Oe}=o;Oe&&(Oe.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((G=m.value)===null||G===void 0||G.sync({showAllItemsBeforeCalculate:!1})))}}function x(){const{value:G}=g;G&&(G.style.display="none")}function v(){const{value:G}=g;G&&(G.style.display="inline-block")}i.watch(i.toRef(t,"active"),G=>{G||x()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick($)});function w(G){const{onFocus:se}=t;se&&se(G)}function R(G){const{onBlur:se}=t;se&&se(G)}function N(G){const{onDeleteOption:se}=t;se&&se(G)}function M(G){const{onClear:se}=t;se&&se(G)}function E(G){const{onPatternInput:se}=t;se&&se(G)}function A(G){var se;(!G.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(G.relatedTarget)))&&w(G)}function P(G){var se;!((se=a.value)===null||se===void 0)&&se.contains(G.relatedTarget)||R(G)}function Y(G){M(G)}function ee(){b.value=!0}function I(){b.value=!1}function L(G){!t.active||!t.filterable||G.target!==o.value&&G.preventDefault()}function q(G){N(G)}const W=i.ref(!1);function z(G){if(G.key==="Backspace"&&!W.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let D=null;function j(G){const{value:se}=s;if(se){const Oe=G.target.value;se.textContent=Oe,$()}t.ignoreComposition&&W.value?D=G:E(G)}function Z(){W.value=!0}function ue(){W.value=!1,t.ignoreComposition&&E(D),D=null}function oe(G){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,G)}function re(G){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,G)}function Fe(){var G,se;if(t.filterable)p.value=!1,(G=d.value)===null||G===void 0||G.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Oe}=l;Oe==null||Oe.blur()}else{const{value:Oe}=c;Oe==null||Oe.blur()}}function je(){var G,se,Oe;t.filterable?(p.value=!1,(G=d.value)===null||G===void 0||G.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Oe=c.value)===null||Oe===void 0||Oe.focus()}function Ae(){const{value:G}=o;G&&(v(),G.focus())}function Gt(){const{value:G}=o;G&&G.blur()}function Te(G){const{value:se}=u;se&&se.setTextContent(`+${G}`)}function sn(){const{value:G}=h;return G}function on(){return o.value}let $t=null;function Lt(){$t!==null&&window.clearTimeout($t)}function an(){t.active||(Lt(),$t=window.setTimeout(()=>{T.value&&(f.value=!0)},100))}function wt(){Lt()}function Dn(G){G||(Lt(),f.value=!1)}i.watch(T,G=>{G||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const G=d.value;G&&(t.disabled?G.removeAttribute("tabindex"):G.tabIndex=p.value?-1:0)})}),Ju(a,t.onResize);const{inlineThemeDisabled:ln}=t,Zt=i.computed(()=>{const{size:G}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Oe,borderRadius:ni,color:Je,placeholderColor:Dt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:cn,textColorDisabled:Hn,placeholderColorDisabled:F,colorActive:X,boxShadowFocus:ie,boxShadowActive:de,boxShadowHover:he,border:ye,borderFocus:we,borderHover:ke,borderActive:Ge,arrowColor:Sn,arrowColorDisabled:$a,loadingColor:Na,colorActiveWarning:Pa,boxShadowFocusWarning:Ea,boxShadowActiveWarning:Fa,boxShadowHoverWarning:Aa,borderWarning:Ma,borderFocusWarning:Va,borderHoverWarning:Ia,borderActiveWarning:Oa,colorActiveError:za,boxShadowFocusError:La,boxShadowActiveError:Da,boxShadowHoverError:Ha,borderError:Wa,borderFocusError:ja,borderHoverError:qa,borderActiveError:q2,clearColor:X2,clearColorHover:Y2,clearColorPressed:U2,clearSize:K2,arrowSize:G2,[Qe("height",G)]:Z2,[Qe("fontSize",G)]:Q2}}=y.value,Vs=en(ii),Is=en($i);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Ge,"--n-border-focus":we,"--n-border-hover":ke,"--n-border-radius":ni,"--n-box-shadow-active":de,"--n-box-shadow-focus":ie,"--n-box-shadow-hover":he,"--n-caret-color":nr,"--n-color":Je,"--n-color-active":X,"--n-color-disabled":cn,"--n-font-size":Q2,"--n-height":Z2,"--n-padding-single-top":Vs.top,"--n-padding-multiple-top":Is.top,"--n-padding-single-right":Vs.right,"--n-padding-multiple-right":Is.right,"--n-padding-single-left":Vs.left,"--n-padding-multiple-left":Is.left,"--n-padding-single-bottom":Vs.bottom,"--n-padding-multiple-bottom":Is.bottom,"--n-placeholder-color":Dt,"--n-placeholder-color-disabled":F,"--n-text-color":tr,"--n-text-color-disabled":Hn,"--n-arrow-color":Sn,"--n-arrow-color-disabled":$a,"--n-loading-color":Na,"--n-color-active-warning":Pa,"--n-box-shadow-focus-warning":Ea,"--n-box-shadow-active-warning":Fa,"--n-box-shadow-hover-warning":Aa,"--n-border-warning":Ma,"--n-border-focus-warning":Va,"--n-border-hover-warning":Ia,"--n-border-active-warning":Oa,"--n-color-active-error":za,"--n-box-shadow-focus-error":La,"--n-box-shadow-active-error":Da,"--n-box-shadow-hover-error":Ha,"--n-border-error":Wa,"--n-border-focus-error":ja,"--n-border-hover-error":qa,"--n-border-active-error":q2,"--n-clear-size":K2,"--n-clear-color":X2,"--n-clear-color-hover":Y2,"--n-clear-color-pressed":U2,"--n-arrow-size":G2,"--n-font-weight":Oe}}),Ne=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Zt,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:B,label:C,selected:T,showTagsPanel:f,isComposing:W,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:L,handleFocusin:A,handleClear:Y,handleMouseEnter:ee,handleMouseLeave:I,handleDeleteOption:q,handlePatternKeyDown:z,handlePatternInputInput:j,handlePatternInputBlur:re,handlePatternInputFocus:oe,handleMouseEnterCounter:an,handleMouseLeaveCounter:wt,handleFocusout:P,handleCompositionEnd:ue,handleCompositionStart:Z,onPopoverUpdateShow:Dn,focus:je,focusInput:Ae,blur:Fe,blurInput:Gt,updateCounter:Te,getCounter:sn,getTail:on,renderLabel:t.renderLabel,cssVars:ln?void 0:Zt,themeClass:Ne==null?void 0:Ne.themeClass,onRender:Ne==null?void 0:Ne.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",f=m||g,p=i.h(pa,null,{default:()=>i.h(Yk,{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,_=E=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:E.value},u?u({option:E,handleClose:()=>{this.handleDeleteOption(E)}}):i.h(ka,{size:n,closable:!E.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(E)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(E,!0):er(E[y],E,!0)})),B=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),C=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,T=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let $;if(g){const E=this.selectedOptions.length-o;E>0&&($=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${E}`})))}const x=m?s?i.h(Wu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:T,tail:()=>C}):i.h(Wu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:T}):g&&$?B().concat($):B(),v=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?B():this.selectedOptions.map(_)):void 0,w=f?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,N=(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,M=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},x,m?null:C,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},x,p);b=i.h(i.Fragment,null,f?i.h(Ok,Object.assign({},w,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>M,default:v}):M,N)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,B=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:oh(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})),B?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`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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:oh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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 Qk(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Jk={name:"Select",common:Si,peers:{InternalSelection:Nh,InternalSelectMenu:kh},self:Qk},ev=ce([ge("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,4 +819,4 @@ ${s}
|
|
|
819
819
|
`),ge("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[Th({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Fs(t){return t.type==="group"}function Ph(t){return t.type==="ignored"}function va(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function tv(t,e){return{getIsGroup:Fs,getIgnored:Ph,getKey(r){return Fs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function nv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Fs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ph(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function iv(t,e,n){const r=new Map;return t.forEach(s=>{Fs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var rv={};const sv=Object.assign(Object.assign({},pt.props),{to:En.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}),ov=i.defineComponent({name:"Select",props:sv,slots:Object,setup(t){rv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=vi(t),o=pt("Select","-select",ev,Jk,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Zo(l,a),d=i.ref(!1),u=i.ref(""),h=ru(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(h.value)),p=i.computed(()=>{const{filter:F}=t;if(F)return F;const{labelField:X,valueField:ie}=t;return(de,he)=>{if(!he)return!1;const ye=he[X];if(typeof ye=="string")return va(de,ye);const we=he[ie];return typeof we=="string"?va(de,we):typeof we=="number"?va(de,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return h.value;{const{value:F}=f,{value:X}=u;return!X.length||!t.filterable?F:nv(F,p.value,X,t.childrenField)}}),y=i.computed(()=>{const{valueField:F,childrenField:X}=t,ie=tv(F,X);return E1(b.value,ie)}),_=i.computed(()=>iv(f.value,t.valueField,t.childrenField)),B=i.ref(!1),C=Zo(i.toRef(t,"show"),B),T=i.ref(null),$=i.ref(null),x=i.ref(null),{localeRef:v}=hh("Select"),w=i.computed(()=>{var F;return(F=t.placeholder)!==null&&F!==void 0?F:v.value.placeholder}),R=[],N=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:F}=t;if(F===void 0){const{labelField:X,valueField:ie}=t;return de=>({[X]:String(de),[ie]:de})}return F===!1?!1:X=>Object.assign(F(X),{value:X})});function E(F){const X=t.remote,{value:ie}=N,{value:de}=_,{value:he}=M,ye=[];return F.forEach(we=>{if(de.has(we))ye.push(de.get(we));else if(X&&ie.has(we))ye.push(ie.get(we));else if(he){const ke=he(we);ke&&ye.push(ke)}}),ye}const A=i.computed(()=>{if(t.multiple){const{value:F}=c;return Array.isArray(F)?E(F):[]}return null}),P=i.computed(()=>{const{value:F}=c;return!t.multiple&&!Array.isArray(F)?F===null?null:E([F])[0]||null:null}),Y=ux(t),{mergedSizeRef:ee,mergedDisabledRef:I,mergedStatusRef:L}=Y;function q(F,X){const{onChange:ie,"onUpdate:value":de,onUpdateValue:he}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=Y;ie&>(ie,F,X),he&>(he,F,X),de&>(de,F,X),a.value=F,ye(),we()}function W(F){const{onBlur:X}=t,{nTriggerFormBlur:ie}=Y;X&>(X,F),ie()}function z(){const{onClear:F}=t;F&>(F)}function D(F){const{onFocus:X,showOnFocus:ie}=t,{nTriggerFormFocus:de}=Y;X&>(X,F),de(),ie&&re()}function j(F){const{onSearch:X}=t;X&>(X,F)}function Z(F){const{onScroll:X}=t;X&>(X,F)}function ue(){var F;const{remote:X,multiple:ie}=t;if(X){const{value:de}=N;if(ie){const{valueField:he}=t;(F=A.value)===null||F===void 0||F.forEach(ye=>{de.set(ye[he],ye)})}else{const he=P.value;he&&de.set(he[t.valueField],he)}}}function oe(F){const{onUpdateShow:X,"onUpdate:show":ie}=t;X&>(X,F),ie&>(ie,F),B.value=F}function re(){I.value||(oe(!0),B.value=!0,t.filterable&&ii())}function Fe(){oe(!1)}function je(){u.value="",g.value=R}const Ae=i.ref(!1);function Gt(){t.filterable&&(Ae.value=!0)}function Te(){t.filterable&&(Ae.value=!1,C.value||je())}function sn(){I.value||(C.value?t.filterable?ii():Fe():re())}function on(F){var X,ie;!((ie=(X=x.value)===null||X===void 0?void 0:X.selfRef)===null||ie===void 0)&&ie.contains(F.relatedTarget)||(d.value=!1,W(F),Fe())}function $t(F){D(F),d.value=!0}function Lt(){d.value=!0}function an(F){var X;!((X=T.value)===null||X===void 0)&&X.$el.contains(F.relatedTarget)||(d.value=!1,W(F),Fe())}function wt(){var F;(F=T.value)===null||F===void 0||F.focus(),Fe()}function Dn(F){var X;C.value&&(!((X=T.value)===null||X===void 0)&&X.$el.contains(br(F))||Fe())}function ln(F){if(!Array.isArray(F))return[];if(M.value)return Array.from(F);{const{remote:X}=t,{value:ie}=_;if(X){const{value:de}=N;return F.filter(he=>ie.has(he)||de.has(he))}else return F.filter(de=>ie.has(de))}}function Zt(F){$e(F.rawNode)}function $e(F){if(I.value)return;const{tag:X,remote:ie,clearFilterAfterSelect:de,valueField:he}=t;if(X&&!ie){const{value:ye}=g,we=ye[0]||null;if(we){const ke=m.value;ke.length?ke.push(we):m.value=[we],g.value=R}}if(ie&&N.value.set(F[he],F),t.multiple){const ye=ln(c.value),we=ye.findIndex(ke=>ke===F[he]);if(~we){if(ye.splice(we,1),X&&!ie){const ke=G(F[he]);~ke&&(m.value.splice(ke,1),de&&(u.value=""))}}else ye.push(F[he]),de&&(u.value="");q(ye,E(ye))}else{if(X&&!ie){const ye=G(F[he]);~ye?m.value=[m.value[ye]]:m.value=R}tr(),Fe(),q(F[he],F)}}function G(F){return m.value.findIndex(ie=>ie[t.valueField]===F)}function se(F){C.value||re();const{value:X}=F.target;u.value=X;const{tag:ie,remote:de}=t;if(j(X),ie&&!de){if(!X){g.value=R;return}const{onCreate:he}=t,ye=he?he(X):{[t.labelField]:X,[t.valueField]:X},{valueField:we,labelField:ke}=t;h.value.some(Ge=>Ge[we]===ye[we]||Ge[ke]===ye[ke])||m.value.some(Ge=>Ge[we]===ye[we]||Ge[ke]===ye[ke])?g.value=R:g.value=[ye]}}function Oe(F){F.stopPropagation();const{multiple:X}=t;!X&&t.filterable&&Fe(),z(),X?q([],[]):q(null,null)}function ni(F){!yr(F,"action")&&!yr(F,"empty")&&!yr(F,"header")&&F.preventDefault()}function Je(F){Z(F)}function Dt(F){var X,ie,de,he,ye;if(!t.keyboard){F.preventDefault();return}switch(F.key){case" ":if(t.filterable)break;F.preventDefault();case"Enter":if(!(!((X=T.value)===null||X===void 0)&&X.isComposing)){if(C.value){const we=(ie=x.value)===null||ie===void 0?void 0:ie.getPendingTmNode();we?Zt(we):t.filterable||(Fe(),tr())}else if(re(),t.tag&&Ae.value){const we=g.value[0];if(we){const ke=we[t.valueField],{value:Ge}=c;t.multiple&&Array.isArray(Ge)&&Ge.includes(ke)||$e(we)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),t.loading)return;C.value&&((de=x.value)===null||de===void 0||de.prev());break;case"ArrowDown":if(F.preventDefault(),t.loading)return;C.value?(he=x.value)===null||he===void 0||he.next():re();break;case"Escape":C.value&&(ax(F),Fe()),(ye=T.value)===null||ye===void 0||ye.focus();break}}function tr(){var F;(F=T.value)===null||F===void 0||F.focus()}function ii(){var F;(F=T.value)===null||F===void 0||F.focusInput()}function $i(){var F;C.value&&((F=$.value)===null||F===void 0||F.syncPosition())}ue(),i.watch(i.toRef(t,"options"),ue);const nr={focus:()=>{var F;(F=T.value)===null||F===void 0||F.focus()},focusInput:()=>{var F;(F=T.value)===null||F===void 0||F.focusInput()},blur:()=>{var F;(F=T.value)===null||F===void 0||F.blur()},blurInput:()=>{var F;(F=T.value)===null||F===void 0||F.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:F}}=o.value;return{"--n-menu-box-shadow":F}}),Hn=s?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:L,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:ws(),triggerRef:T,menuRef:x,pattern:u,uncontrolledShow:B,mergedShow:C,adjustedTo:En(t),uncontrolledValue:a,mergedValue:c,followerRef:$,localizedPlaceholder:w,selectedOption:P,selectedOptions:A,mergedSize:ee,mergedDisabled:I,focused:d,activeWithoutMenuOpen:Ae,inlineThemeDisabled:s,onTriggerInputFocus:Gt,onTriggerInputBlur:Te,handleTriggerOrMenuResize:$i,handleMenuFocus:Lt,handleMenuBlur:an,handleMenuTabOut:wt,handleTriggerClick:sn,handleToggle:Zt,handleDeleteOption:$e,handlePatternInput:se,handleClear:Oe,handleTriggerBlur:on,handleTriggerFocus:$t,handleKeydown:Dt,handleMenuAfterLeave:je,handleMenuClickOutside:Dn,handleMenuScroll:Je,handleMenuKeydown:Dt,handleMenuMousedown:ni,mergedTheme:o,cssVars:s?void 0:cn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(lu,null,{default:()=>[i.h(cu,null,{default:()=>i.h(Zk,{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(Cu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===En.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(Bk,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],[_s,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[_s,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),av={},Eh=i.defineComponent({...av,__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=U.useBaseConfigStateStore().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(()=>V.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),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(B=>{if(V.isEmpty(B))return;const C=o.value?r.value:r.value?[r.value]:[],T=B.filter($=>!C.some(x=>x.id===$.id));l.value=r.optionsListConverter([...C,...T])}).finally(()=>{d.value=!1}))};let m="";const g=V.debounce(()=>h(m),800),f=_=>{m=_,g()},p=_=>{var B;if(V.isArray(_)){const C=_.length>0?_.map(T=>{var $;return i.toRaw(($=l.value.find(x=>x.value===T))==null?void 0:$.item)}):[];s("update:value",C)}else if(_>0){const C=i.toRaw((B=l.value.find(T=>T.value===_))==null?void 0:B.item);s("update:value",C)}else s("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,B)=>(i.openBlock(),i.createBlock(i.unref(ov),{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:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),lv={},Fh=i.defineComponent({...lv,__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=U.useBaseConfigStateStore().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 h=>r.searchType==="categories"?U.HttpRequester.getInstance(U.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?U.HttpRequester.getInstance(U.ProductDataProvider).publicSimpleSearch(h):new Promise(m=>{m([])}),l=h=>r.searchType==="categories"?Pt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Pt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(h,m)=>{if(r.renderLabel)return r.renderLabel(h,m);if(r.searchType==="products"){const g=h.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=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=o.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=o.value)==null?void 0:h.blur()}}),(h,m)=>(i.openBlock(),i.createBlock(Eh,{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"},dv={class:"flex-1"},uv={class:"text-sc-grey"},hv={class:"ml-2.5"},fv={key:0,class:"flex-none"},mv={},gv=i.defineComponent({...mv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(V.isArray(h)?h:[h]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=h=>{h&&(a.value=a.value.map(m=>m.id===h.id?h:i.toRaw(m)),l())},u=h=>{a.value=a.value.filter(m=>m.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(h,m)=>{const g=O.NListItem,f=j_,p=O.NButton,b=O.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Fh,{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:_=>u(y)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",cv,[i.createElementVNode("span",dv,[i.createElementVNode("span",uv,i.toDisplayString(y.code),1),i.createElementVNode("span",hv,i.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",fv,[i.renderSlot(h.$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 yv(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 bv=i.markRaw({name:"tabler-truck-filled",render:yv}),_v={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wv(t,e){return i.openBlock(),i.createElementBlock("svg",_v,[...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 xv=i.markRaw({name:"tabler-truck-delivery",render:wv}),kv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vv(t,e){return i.openBlock(),i.createElementBlock("svg",kv,[...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 Cv=i.markRaw({name:"tabler-truck-loading",render:vv}),Sv={class:"flex flex-col gap-1"},Bv={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},Tv={key:1,class:"text-base"},Rv={class:"text-sc-dark-grey mr-1.5"},$v={key:0},Nv={key:1},Pv={key:2},Ev={},As=i.defineComponent({...Ev,__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=U.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Tn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,u,h,m,g,f,p,b;const a=Cv,l=xv,c=bv;return i.openBlock(),i.createElementBlock("div",Sv,[t.showType?(i.openBlock(),i.createElementBlock("span",Bv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.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",Tv,[i.createElementVNode("span",Rv,i.toDisplayString(n.value),1),(f=(g=t.delivery)==null?void 0:g.address)!=null&&f.address?(i.openBlock(),i.createElementBlock("span",$v,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",Nv," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Pv," (не указано) "))])):i.createCommentVNode("",!0)])}}}),Fv={class:"flex flex-col gap-2.5"},Av={class:"text-base"},Mv=["href"],Vv={class:"text-sc-grey"},Iv={},Ah=i.defineComponent({...Iv,__name:"order-common-info",props:{order:{},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ne.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ne.Status)?(c=(l=U.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(Ne.CreatedAt)),o=i.computed(()=>e.fields.includes(Ne.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ne.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Fv,[i.createElementVNode("span",Av,[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,Mv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(fs,{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",Vv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(pr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(As,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Ov={},Ca=i.defineComponent({...Ov,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=U.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)}}}),zv={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},Lv={},Sa=i.defineComponent({...Lv,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const s={[U.UserTypeEnum.Manager]:"менеджером",[U.UserTypeEnum.Operator]:"оператором",[U.UserTypeEnum.Client]:"клиентом",[U.UserTypeEnum.Admin]:"администратором"};return`${r} ${s[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",zv,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),Dv={class:"flex flex-row gap-1.5"},Hv={class:"flex-none text-nowrap"},Wv={class:"flex flex-1 flex-col"},jv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},qv={key:0},Xv={key:1},Yv={},Mh=i.defineComponent({...Yv,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=Sa;return i.openBlock(),i.createElementBlock("div",Dv,[i.createElementVNode("span",Hv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Wv,[i.createVNode(lr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",jv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",qv,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Xv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),Uv={},Kv=i.defineComponent({...Uv,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},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,width:"45%",render:o=>i.h("div",{},[i.h(lr,{product:o.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in o&&o.creatorUser&&o.creatorUser.type?[i.h(Sa,{class:"mt-1",userType:o.creatorUser.type,prefixText:"Добавлено"})]:[]])},{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.name} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit.name}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"cost",showQuantityUnit:!0})}];switch(kt.getDeviceTypeByResolution()){case Ze.phone:case Ze.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Mh,{product:o,index:a})}];case Ze.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=O.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Vh=Wn(Kv,[["__scopeId","data-v-e5948917"]]),Gv={class:"text-base"},Zv={},Ba=i.defineComponent({...Zv,__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",Gv,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))}}),Qv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Jv={class:"col-span-2"},eC={class:"col-span-2"},tC={class:"btn btn-primary",href:"{{ invoice }}"},nC={},Ih=i.defineComponent({...nC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,s)=>(i.openBlock(),i.createElementBlock("div",null,[s[12]||(s[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Qv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[s[1]||(s[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ba,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),s[11]||(s[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(pr,{client:t.order.client,class:"col-span-2","onClick:clientName":s[0]||(s[0]=o=>n("click:client-name",t.order.client,o))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[s[2]||(s[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(zd,{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},[s[3]||(s[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),s[4]||(s[4]=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},[s[5]||(s[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Jv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[s[6]||(s[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ca,{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},[s[7]||(s[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(As,{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},[s[8]||(s[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",eC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[s[9]||(s[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ba,{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},[s[10]||(s[10]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(o,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"col-span-2"},[i.createElementVNode("a",tC," Скачать счет №"+i.toDisplayString(a+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),iC={key:0},rC={class:"text-sc-dark-grey my-2 text-center"},sC={key:1,class:"text-sc-dark-grey my-2 text-center"},oC={key:2},aC={class:"text-sc-dark-grey mt-4 text-right font-bold"},lC={class:"text-sc-primary"},cC={},Oh=i.defineComponent({...cC,__name:"order-info",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(new U.Order(n.order)),a=(c=!0)=>{c&&(s.value=!0),U.HttpRequester.getInstance(U.OrdersDataProvider).getOrder(n.order.id).then(d=>{o.value=d}).finally(()=>{c&&(s.value=!1)})},l=i.computed(()=>(o.value.products??[]).reduce((c,d)=>c+d.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=O.NSpin;return s.value?(i.openBlock(),i.createElementBlock("div",iC,[i.createElementVNode("div",rC,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):o.value.products.length===0?(i.openBlock(),i.createElementBlock("div",sC," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",oC,[i.createVNode(Vh,{products:o.value.products},null,8,["products"]),i.createElementVNode("div",aC,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",lC,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(Ih,{order:o.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",o.value.client,h))},null,8,["order"])]))}}}),dC={},uC=i.defineComponent({...dC,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(or,"small"),r=i.computed(()=>V.isNil(e.orderContextButtonsConfig)?[]:V.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),s=o=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,o)};return(o,a)=>{var u;const l=Ds,c=O.NButton,d=O.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:s},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),hC={},fC=i.defineComponent({...hC,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,s=()=>V.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),o=i.ref(s()),a=i.ref([]),l=i.ref(!1),c=i.computed(()=>U.useReferencesStore().orderStatusReference),d=v=>{var M,E;const w={onDblclick:()=>r("dblclick:row",v)};if(!n.useCellIndication)return w;const R=[];v.isOnOrder&&R.push("on-order"),v.isLargeOrder&&R.push("large-order"),v.isNotInStock&&R.push("not-in-stock");const N=(E=(M=c.value)==null?void 0:M.find(A=>A.id===(v.status??-1)))==null?void 0:E.slug;return N&&R.push("order-status",N),v.delivery.date&&Tn.isTomorrow(new Date(v.delivery.date))&&R.push("next-day-order"),R.length>0&&(w.class=R.join(" ")),w},u=()=>{const v=[Ne.CreatedAt,Ne.Id,Ne.ClientInfo,Ne.ClientCity,Ne.DeliveryDate,Ne.PaymentType,Ne.SalesDirections,Ne.Status,...n.showAttachedUserColumn?[Ne.AttachedUser]:[],Ne.actions],w=n.fields.length>0?n.fields:v,R={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},N={type:"expand",expandable:V.constant(!0),renderExpand:E=>i.h(Oh,{order:E,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",E.client,null)}}),width:"30"};let M=[{title:"Дата заказа",key:Ne.CreatedAt,resizable:!0,width:100,render:E=>i.h(fs,{date:E.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ne.Id,resizable:!0,width:75,className:"order-id",render:E=>i.h("a",{href:n.orderUrl.replace(":id",E.id.toString()),class:"text-base"},E.id)},{title:"Дата доставки / самовывоза",key:Ne.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:E=>i.h(fs,{date:E.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ne.ClientInfo,resizable:!0,minWidth:320,render:E=>i.h(pr,{client:E.client,"onClick:client-name":()=>{r("click:client-name",E.client,null)}})},{title:"Тип доставки",key:Ne.DeliveryInfo,resizable:!0,minWidth:320,render:E=>i.h(As,{delivery:E.delivery})},{title:"Клиент",key:Ne.ClientInfoShort,resizable:!0,minWidth:320,render:E=>i.h(pr,{client:E.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",E.client,null)}})},{title:"Город клиента",key:Ne.ClientCity,resizable:!0,minWidth:90,width:120,render:E=>{var A;return i.h("span",{class:"text-base"},((A=E.client)==null?void 0:A.city.name)??"—")}},{title:"Статус",key:Ne.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:E=>{var A,P;return i.h("span",{class:"text-base"},[((P=(A=c.value)==null?void 0:A.find(Y=>Y.id===(E.status??-1)))==null?void 0:P.name)??""])}},{title:"Тип оплаты",key:Ne.PaymentType,resizable:!0,width:115,minWidth:95,render:E=>E.payment?i.h(Ca,{payment:E.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ne.SalesDirections,resizable:!0,width:70,render:E=>{var A;return i.h("span",{class:"text-base"},[((A=E.salesDirection)==null?void 0:A.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Ne.AttachedUser,resizable:!0,minWidth:120,render:E=>{var A;return i.h("span",{class:"text-base"},[((A=E==null?void 0:E.attachedUser)==null?void 0:A.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&M.push({key:"actions",title:"",className:"align-top",width:50,render:E=>i.h(uC,{order:E,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(M=M.map(E=>[Ne.Id,Ne.CreatedAt,Ne.DeliveryDate].includes(E.key)?{...E,sorter:!0,sortOrder:!1,...E.width===void 0?{}:{width:E.width+16}}:E)),kt.getDeviceTypeByResolution()){case Ze.phone:case Ze.tablet:return[N,{key:"order",title:"Заказ",resizable:!0,render:E=>i.h(Ah,{order:E,fields:w,orderUrl:n.orderUrl})}];case Ze.laptop:{const E=n.showAttachedUserColumn?w:w.filter(A=>A!==Ne.AttachedUser);return[N,...E.map(A=>M.find(P=>P.key===A)??R)]}default:return[R]}},h=i.ref(u()),m=i.ref(new U.DataTablePagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),g=i.ref(null),f=i.ref(null),p=i.ref(null),b=()=>{p.value!==null&&(clearInterval(p.value),p.value=null)},y=()=>{b(),n.refreshInterval&&(p.value=setInterval(()=>{B()},n.refreshInterval))},_=()=>{var v,w;n.filters&&((v=f.value)==null||v.abort(),f.value=null,(w=g.value)==null||w.abort(),g.value=new AbortController,l.value=!0,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrders(n.filters,o.value,{page:m.value.page,pageSize:m.value.pageSize},g.value.signal).then(R=>{m.value.itemCount!==R.meta.total&&(m.value.itemCount=R.meta.total),m.value.page!==R.meta.currentPage&&(m.value.page=R.meta.currentPage),m.value.pageCount!==R.meta.lastPage&&(m.value.pageCount=R.meta.lastPage),m.value.pageSize!==R.meta.perPage&&(m.value.pageSize=R.meta.perPage),a.value=R.data,l.value=!1}).catch(R=>{if((R==null?void 0:R.name)!=="CanceledError")throw l.value=!1,R}))},B=()=>{var v;!n.filters||l.value||((v=f.value)==null||v.abort(),f.value=new AbortController,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrders(n.filters,o.value,{page:m.value.page,pageSize:m.value.pageSize},f.value.signal).then(w=>{a.value=a.value.map(R=>w.data.find(M=>M.id===R.id)??R),m.value.itemCount!==w.meta.total&&(m.value.itemCount=w.meta.total),m.value.pageCount!==w.meta.lastPage&&(m.value.pageCount=w.meta.lastPage)}).catch(w=>{if((w==null?void 0:w.name)!=="CanceledError")throw w}))},C=v=>{m.value.page=v,_(),r("update:pagination",m.value)},T=v=>{m.value.pageSize=v,m.value.page=1,_(),r("update:pagination",m.value)},$=v=>{if(V.isNull(v))o.value=s();else{const[w]=o.value;w.field=v.columnKey.toString(),w.direction=v.order==="ascend"?"asc":"desc",o.value=[w]}h.value.forEach(w=>{if(Object.hasOwn(w,"sortOrder")){const R=w;R.sortOrder=R.key===(v==null?void 0:v.columnKey)&&(v!=null&&v.sorter)&&v.order!==!1?v.order:!1}}),_(),r("update:sort",o.value)},x=()=>{h.value=u()};return i.watch(()=>n.filters,()=>{m.value.page=1,_(),y()}),i.watch(()=>n.sort,()=>{o.value=s(),m.value.page=1,_(),y()}),i.onMounted(()=>{x(),window.addEventListener("resize",x),i.nextTick(()=>{_(),y()})}),i.onUnmounted(()=>{var v,w;window.removeEventListener("resize",x),(v=g.value)==null||v.abort(),(w=f.value)==null||w.abort(),b()}),(v,w)=>{const R=O.NDataTable;return i.openBlock(),i.createBlock(R,{columns:h.value,data:a.value,"row-key":N=>N.id,"row-props":d,"scroll-x":t.tableMinWidth,pagination:m.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":C,"onUpdate:pageSize":T,"onUpdate:sorter":$},null,8,["columns","data","row-key","scroll-x","pagination","loading"])}}}),mC=Wn(fC,[["__scopeId","data-v-03e9242a"]]),gC=["href"],pC={class:"text-sc-dark-grey"},yC={},bC=i.defineComponent({...yC,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Tn.format(n.order.createdAt,U.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),o=a=>{V.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,gC),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",pC,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),_C={class:"sc-page flex flex-col bg-inherit"},wC={class:"my-2 flex flex-row items-end"},xC={class:"sc-title grow"},kC={key:0,class:"sc-title-buttons flex-1 grow-0"},vC={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},CC={key:0,class:"sc-title-extra mt-2 sm:mt-4"},SC={},zh=i.defineComponent({...SC,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=O.NH1;return i.openBlock(),i.createElementBlock("div",_C,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",wC,[i.createElementVNode("div",xC,[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",kC,[i.createElementVNode("div",vC,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",CC,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),BC={class:"overflow-hidden transition-all duration-300"},TC={class:"text-lg font-medium leading-none"},RC={},Lh=i.defineComponent({...RC,__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(kt.getDeviceTypeByResolution()){case Ze.phone:return window.innerWidth*.66;case Ze.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?V.isUndefined(n.drawerWidth)?s.value=a():s.value=V.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 u=O.NDrawerContent,h=O.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",BC,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{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(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",TC,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)}}}),$C={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},NC={key:0},PC={class:"sc-page-preview-panel grow"},EC={key:1,class:"sc-page-preview-panel-extra flex-none"},FC={},AC=i.defineComponent({...FC,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},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,u;window.scrollTo({top:(((u=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=O.NButton;return i.openBlock(),i.createBlock(zh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(Lh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),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,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",$C,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",NC,[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]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",PC,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",EC,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),MC={},VC=i.defineComponent({...MC,__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(()=>V.isArray(r.value)),a=i.computed(()=>{var f;return V.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{const f=new U.Curator({id:-1,name:"",contacts:{},curatedDirection:new U.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[f]:[];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 U.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Pt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,f=>{const p=V.some(o.value?r.value:[r.value],["id",f.id])?` (${f.curatedDirection.name}) `:"";return f.curatedDirection.isNewRec()?f.name:`${f.name}${p}`})),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(V.isArray(f)){const p=f.length>0?f.map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];s("update:value",p)}else{const p=f>0?l.value.find(b=>b.id===f):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.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":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),IC={},OC=i.defineComponent({...IC,__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(()=>V.isArray(r.value)),a=i.computed(()=>{var f;return V.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>r.showEmptyValue?[U.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let f=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=V.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=V.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),f=f.filter(_=>(r.showEmptyValue?U.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Pt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&V.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(V.isArray(f)){const p=f.length>0?f.filter(b=>!V.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];s("update:value",p)}else{const p=f>0&&!V.some(r.disabledManagerReferenceList,["id",f])?l.value.find(b=>b.id===f):new U.Manager;s("update:value",p??new U.Manager)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const p=r.value;V.some(p,b=>V.some(f,["id",b.id]))&&s("update:value",p.filter(b=>!V.some(f,["id",b.id])))}else{const p=r.value;V.some(f,["id",p.id])&&s("update:value",new U.Manager)}}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.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":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),zC={class:"m-0.5 flex flex-col p-0.5"},LC={class:"flex flex-row gap-1"},DC={key:0},HC={key:1},WC={key:2},jC={key:3},qC={class:"flex flex-row gap-1"},XC={key:0},YC={key:1},UC={key:2},KC={key:3},GC={},Dh=i.defineComponent({...GC,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",zC,[i.createElementVNode("span",LC,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",DC,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",HC,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",WC,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",jC,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",qC,[t.addr.street?(i.openBlock(),i.createElementBlock("span",XC,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",YC,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",UC,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",KC,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ta={clearable:!1,value:"",field:void 0,disabled:!1},ZC={},QC=i.defineComponent({...ZC,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ta,minTermLength:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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=V.debounce(()=>u(),800),u=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):U.HttpRequester.getInstance(U.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Dh,{addr:y,selected:b},{default:V.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=O.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":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),JC={class:"m-0.5 flex flex-col p-0.5"},e2={class:"font-medium"},t2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},n2={key:0},i2={key:1},r2={},Hh=i.defineComponent({...r2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",JC,[i.createElementVNode("span",e2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",t2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",n2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",i2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),s2={},o2=i.defineComponent({...s2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ta,minTermLength:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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=V.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Hh,{bank:y,selected:b},{default:V.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=O.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":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),a2={class:"font-medium"},l2={key:0,class:"flex flex-row gap-2"},c2={key:0,class:"text-xs font-light text-blue-800"},d2={key:1,class:"text-sc-dark-grey text-xs font-light"},u2={},Wh=i.defineComponent({...u2,__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",a2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",l2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",c2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",d2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),h2={},f2=i.defineComponent({...h2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ta,minTermLength:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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(()=>Pt.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 u=V.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(B=>B.id===b.value)||{};return i.h(Wh,{org:_,selected:y},{default:V.constant("-")})},g=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(b,y)=>{const _=O.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=B=>o.value=B),i.unref(u)],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"])}}}),m2={},g2=i.defineComponent({...m2,__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=O.NButton,u=O.NPopover,h=O.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{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(h,{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"])])}}}),p2={key:0,class:"whitespace-pre-line"},y2={key:1,class:"text-sc-dark-grey"},b2={},_2=i.defineComponent({...b2,__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=O.NInput;return i.openBlock(),i.createBlock(jd,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",p2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",y2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=u=>s.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),w2={},x2=i.defineComponent({...w2,__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)}}),k2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function v2(t,e){return i.openBlock(),i.createElementBlock("svg",k2,[...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 C2=i.markRaw({name:"ion-warning",render:v2}),S2={},B2=i.defineComponent({...S2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=C2,s=O.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),_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(V.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 U.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])}};S(_t,"messagesService"),S(_t,"notificationsService");let Ra=_t;const T2=i.computed(()=>U.useReferencesStore().deliveryTypeReference??[]),R2=i.computed(()=>U.useReferencesStore().managersList??[]),$2=i.computed(()=>U.useReferencesStore().opfReference??[]),N2=i.computed(()=>U.useReferencesStore().partnerGroupsReference??[]),P2=i.computed(()=>U.useReferencesStore().priceCoefficientsReference??[]),E2=i.computed(()=>U.useReferencesStore().productFilesTypesReference??[]),F2=i.computed(()=>U.useReferencesStore().resourceTypesReference),A2=i.computed(()=>U.useReferencesStore().salesDirectionsReference??[]),M2=i.computed(()=>U.useReferencesStore().warehousesReference??[]),V2=i.computed(()=>U.useReferencesStore().paymentTypeReference??[]),I2=i.computed(()=>U.useReferencesStore().orderStatusReference??[]),O2=i.computed(()=>U.useReferencesStore().operatorReference??[]),z2=i.computed(()=>Pt.convertReferencesToSelectOptionsList(U.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),L2=i.computed(()=>Pt.convertReferencesToSelectOptionsList(U.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),D2=t=>U.HttpRequester.getInstance(U.ReferenceDataProvider).searchCity(t),H2=t=>Pt.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()),W2=t=>U.HttpRequester.getInstance(U.ClientDataProvider).searchClient(t),j2=t=>Pt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());H.AddProductToCartDialog=j0,H.ConfiguratorSettingsKozyrek=_d,H.ConfiguratorSettingsMosquito=Zb,H.ConfiguratorsEnum=hs,H.ContentHelper=ai,H.KozyrekLine=bn,H.KozyrekTailTemplate=Lo,H.KozyrekTemplate=Ui,H.OrdersTableFields=Ne,H.Point=zo,H.ScAddressSuggestion=QC,H.ScAddressSuggestionLabel=Dh,H.ScBankSuggestion=o2,H.ScBankSuggestionLabel=Hh,H.ScBaseDialog=Od,H.ScButtonWithConfirmAction=g2,H.ScCategoryCollapse=Vd,H.ScClientNameWithShortInfo=pr,H.ScCollapse=Md,H.ScCollapseItem=Za,H.ScCommentEditor=_2,H.ScConfiguratorsProductInfo=cr,H.ScContragentWithShortInfo=zd,H.ScCreatorUserTypeTag=Sa,H.ScCuratorSelect=VC,H.ScDateRange=n_,H.ScDateTimeLabel=fs,H.ScDebouncedInput=$_,H.ScDebouncedInputNumber=P_,H.ScDebt=x2,H.ScDialogHeader=d_,H.ScDynamicConfigurator=Ed,H.ScEmail=ob,H.ScExternalLink=D_,H.ScImageGallery=nl,H.ScInlineEditableItem=jd,H.ScInlineView=Ho,H.ScKozyrekConfigurator=wd,H.ScKozyrekConfiguratorParamsForm=rl,H.ScKozyrekConfiguratorPreview=bd,H.ScKozyrekConfiguratorTemplates=yd,H.ScLightGallery=tl,H.ScManagerSelect=OC,H.ScMetalForDoorsConfigurator=$d,H.ScMetalForDoorsConfiguratorForm=Rd,H.ScMosquitoConfigurator=vd,H.ScMosquitoConfiguratorForm=xd,H.ScMosquitoConfiguratorMeasurementInstructions=kd,H.ScMosquitoConfiguratorPreview=Do,H.ScOrderCommonInfo=Ah,H.ScOrderDeliveryLabel=As,H.ScOrderDetails=Ih,H.ScOrderInfo=Oh,H.ScOrderItemsList=Vh,H.ScOrderPayment=Ca,H.ScOrderProductInfo=Mh,H.ScOrdersList=mC,H.ScOrgSuggestion=f2,H.ScOrgSuggestionLabel=Wh,H.ScPage=zh,H.ScPageWithSlidingPanel=AC,H.ScPersonContactsBlock=Gb,H.ScPhone=Nb,H.ScPhoneInput=A_,H.ScProductName=lr,H.ScProductsList=gv,H.ScReferenceSelect=Id,H.ScSandwichConfigurator=Pd,H.ScSandwichConfiguratorForm=Nd,H.ScSearchableProductSelect=Fh,H.ScSearchableReferenceSelect=Eh,H.ScSetClientPriceFormItem=O0,H.ScShortTextOrderInfo=bC,H.ScSingleFileUploadSelector=g_,H.ScSlidingContentWithDrawer=Lh,H.ScStripConfigurator=Td,H.ScStripConfiguratorForm=Sd,H.ScStripConfiguratorLineItem=Cd,H.ScStripConfiguratorPreview=Bd,H.ScUserShortInfo=Ba,H.ScWarningIcon=B2,H.SelectOptionHelper=Pt,H.UiNotificationProvider=Ra,H.WindowResolutionEnum=Ze,H.WindowResolutionProvider=kt,H.channelPrimaryInterestOptionsList=z2,H.componentSizeInjectionKey=or,H.deliveryTypeReferenceList=T2,H.handleFloatInput=Ls,H.handleIntegerInput=lt,H.isCanSandwichShow=Ad,H.isConfiguratorType=Fd,H.managersReferenceList=R2,H.naiveUiTheme=Mf,H.operatorReferenceList=O2,H.opfReferenceList=$2,H.orderStatusReferenceList=I2,H.parse=xt,H.partnerGroupReferenceList=N2,H.paymentTypeReferenceList=V2,H.priceCoefficientsReferenceList=P2,H.productFilesTypesReferenceList=E2,H.renderConfig=De,H.resetInputValidation=ze,H.resourceReferencesList=F2,H.salesDirectionsReferenceList=A2,H.searchCityReferenceDataHandler=D2,H.searchCityReferenceLabelRenderer=H2,H.searchClientReferenceDataHandler=W2,H.searchClientReferenceLabelRenderer=j2,H.selectAllTextOnFocus=Le,H.sourcePrimaryInterestOptionsList=L2,H.warehousesReferenceList=M2,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[Th({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Fs(t){return t.type==="group"}function Ph(t){return t.type==="ignored"}function va(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function tv(t,e){return{getIsGroup:Fs,getIgnored:Ph,getKey(r){return Fs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function nv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Fs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ph(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function iv(t,e,n){const r=new Map;return t.forEach(s=>{Fs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var rv={};const sv=Object.assign(Object.assign({},pt.props),{to:En.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}),ov=i.defineComponent({name:"Select",props:sv,slots:Object,setup(t){rv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=vi(t),o=pt("Select","-select",ev,Jk,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Zo(l,a),d=i.ref(!1),u=i.ref(""),h=ru(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(h.value)),p=i.computed(()=>{const{filter:F}=t;if(F)return F;const{labelField:X,valueField:ie}=t;return(de,he)=>{if(!he)return!1;const ye=he[X];if(typeof ye=="string")return va(de,ye);const we=he[ie];return typeof we=="string"?va(de,we):typeof we=="number"?va(de,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return h.value;{const{value:F}=f,{value:X}=u;return!X.length||!t.filterable?F:nv(F,p.value,X,t.childrenField)}}),y=i.computed(()=>{const{valueField:F,childrenField:X}=t,ie=tv(F,X);return E1(b.value,ie)}),_=i.computed(()=>iv(f.value,t.valueField,t.childrenField)),B=i.ref(!1),C=Zo(i.toRef(t,"show"),B),T=i.ref(null),$=i.ref(null),x=i.ref(null),{localeRef:v}=hh("Select"),w=i.computed(()=>{var F;return(F=t.placeholder)!==null&&F!==void 0?F:v.value.placeholder}),R=[],N=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:F}=t;if(F===void 0){const{labelField:X,valueField:ie}=t;return de=>({[X]:String(de),[ie]:de})}return F===!1?!1:X=>Object.assign(F(X),{value:X})});function E(F){const X=t.remote,{value:ie}=N,{value:de}=_,{value:he}=M,ye=[];return F.forEach(we=>{if(de.has(we))ye.push(de.get(we));else if(X&&ie.has(we))ye.push(ie.get(we));else if(he){const ke=he(we);ke&&ye.push(ke)}}),ye}const A=i.computed(()=>{if(t.multiple){const{value:F}=c;return Array.isArray(F)?E(F):[]}return null}),P=i.computed(()=>{const{value:F}=c;return!t.multiple&&!Array.isArray(F)?F===null?null:E([F])[0]||null:null}),Y=ux(t),{mergedSizeRef:ee,mergedDisabledRef:I,mergedStatusRef:L}=Y;function q(F,X){const{onChange:ie,"onUpdate:value":de,onUpdateValue:he}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=Y;ie&>(ie,F,X),he&>(he,F,X),de&>(de,F,X),a.value=F,ye(),we()}function W(F){const{onBlur:X}=t,{nTriggerFormBlur:ie}=Y;X&>(X,F),ie()}function z(){const{onClear:F}=t;F&>(F)}function D(F){const{onFocus:X,showOnFocus:ie}=t,{nTriggerFormFocus:de}=Y;X&>(X,F),de(),ie&&re()}function j(F){const{onSearch:X}=t;X&>(X,F)}function Z(F){const{onScroll:X}=t;X&>(X,F)}function ue(){var F;const{remote:X,multiple:ie}=t;if(X){const{value:de}=N;if(ie){const{valueField:he}=t;(F=A.value)===null||F===void 0||F.forEach(ye=>{de.set(ye[he],ye)})}else{const he=P.value;he&&de.set(he[t.valueField],he)}}}function oe(F){const{onUpdateShow:X,"onUpdate:show":ie}=t;X&>(X,F),ie&>(ie,F),B.value=F}function re(){I.value||(oe(!0),B.value=!0,t.filterable&&ii())}function Fe(){oe(!1)}function je(){u.value="",g.value=R}const Ae=i.ref(!1);function Gt(){t.filterable&&(Ae.value=!0)}function Te(){t.filterable&&(Ae.value=!1,C.value||je())}function sn(){I.value||(C.value?t.filterable?ii():Fe():re())}function on(F){var X,ie;!((ie=(X=x.value)===null||X===void 0?void 0:X.selfRef)===null||ie===void 0)&&ie.contains(F.relatedTarget)||(d.value=!1,W(F),Fe())}function $t(F){D(F),d.value=!0}function Lt(){d.value=!0}function an(F){var X;!((X=T.value)===null||X===void 0)&&X.$el.contains(F.relatedTarget)||(d.value=!1,W(F),Fe())}function wt(){var F;(F=T.value)===null||F===void 0||F.focus(),Fe()}function Dn(F){var X;C.value&&(!((X=T.value)===null||X===void 0)&&X.$el.contains(br(F))||Fe())}function ln(F){if(!Array.isArray(F))return[];if(M.value)return Array.from(F);{const{remote:X}=t,{value:ie}=_;if(X){const{value:de}=N;return F.filter(he=>ie.has(he)||de.has(he))}else return F.filter(de=>ie.has(de))}}function Zt(F){Ne(F.rawNode)}function Ne(F){if(I.value)return;const{tag:X,remote:ie,clearFilterAfterSelect:de,valueField:he}=t;if(X&&!ie){const{value:ye}=g,we=ye[0]||null;if(we){const ke=m.value;ke.length?ke.push(we):m.value=[we],g.value=R}}if(ie&&N.value.set(F[he],F),t.multiple){const ye=ln(c.value),we=ye.findIndex(ke=>ke===F[he]);if(~we){if(ye.splice(we,1),X&&!ie){const ke=G(F[he]);~ke&&(m.value.splice(ke,1),de&&(u.value=""))}}else ye.push(F[he]),de&&(u.value="");q(ye,E(ye))}else{if(X&&!ie){const ye=G(F[he]);~ye?m.value=[m.value[ye]]:m.value=R}tr(),Fe(),q(F[he],F)}}function G(F){return m.value.findIndex(ie=>ie[t.valueField]===F)}function se(F){C.value||re();const{value:X}=F.target;u.value=X;const{tag:ie,remote:de}=t;if(j(X),ie&&!de){if(!X){g.value=R;return}const{onCreate:he}=t,ye=he?he(X):{[t.labelField]:X,[t.valueField]:X},{valueField:we,labelField:ke}=t;h.value.some(Ge=>Ge[we]===ye[we]||Ge[ke]===ye[ke])||m.value.some(Ge=>Ge[we]===ye[we]||Ge[ke]===ye[ke])?g.value=R:g.value=[ye]}}function Oe(F){F.stopPropagation();const{multiple:X}=t;!X&&t.filterable&&Fe(),z(),X?q([],[]):q(null,null)}function ni(F){!yr(F,"action")&&!yr(F,"empty")&&!yr(F,"header")&&F.preventDefault()}function Je(F){Z(F)}function Dt(F){var X,ie,de,he,ye;if(!t.keyboard){F.preventDefault();return}switch(F.key){case" ":if(t.filterable)break;F.preventDefault();case"Enter":if(!(!((X=T.value)===null||X===void 0)&&X.isComposing)){if(C.value){const we=(ie=x.value)===null||ie===void 0?void 0:ie.getPendingTmNode();we?Zt(we):t.filterable||(Fe(),tr())}else if(re(),t.tag&&Ae.value){const we=g.value[0];if(we){const ke=we[t.valueField],{value:Ge}=c;t.multiple&&Array.isArray(Ge)&&Ge.includes(ke)||Ne(we)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),t.loading)return;C.value&&((de=x.value)===null||de===void 0||de.prev());break;case"ArrowDown":if(F.preventDefault(),t.loading)return;C.value?(he=x.value)===null||he===void 0||he.next():re();break;case"Escape":C.value&&(ax(F),Fe()),(ye=T.value)===null||ye===void 0||ye.focus();break}}function tr(){var F;(F=T.value)===null||F===void 0||F.focus()}function ii(){var F;(F=T.value)===null||F===void 0||F.focusInput()}function $i(){var F;C.value&&((F=$.value)===null||F===void 0||F.syncPosition())}ue(),i.watch(i.toRef(t,"options"),ue);const nr={focus:()=>{var F;(F=T.value)===null||F===void 0||F.focus()},focusInput:()=>{var F;(F=T.value)===null||F===void 0||F.focusInput()},blur:()=>{var F;(F=T.value)===null||F===void 0||F.blur()},blurInput:()=>{var F;(F=T.value)===null||F===void 0||F.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:F}}=o.value;return{"--n-menu-box-shadow":F}}),Hn=s?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:L,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:ws(),triggerRef:T,menuRef:x,pattern:u,uncontrolledShow:B,mergedShow:C,adjustedTo:En(t),uncontrolledValue:a,mergedValue:c,followerRef:$,localizedPlaceholder:w,selectedOption:P,selectedOptions:A,mergedSize:ee,mergedDisabled:I,focused:d,activeWithoutMenuOpen:Ae,inlineThemeDisabled:s,onTriggerInputFocus:Gt,onTriggerInputBlur:Te,handleTriggerOrMenuResize:$i,handleMenuFocus:Lt,handleMenuBlur:an,handleMenuTabOut:wt,handleTriggerClick:sn,handleToggle:Zt,handleDeleteOption:Ne,handlePatternInput:se,handleClear:Oe,handleTriggerBlur:on,handleTriggerFocus:$t,handleKeydown:Dt,handleMenuAfterLeave:je,handleMenuClickOutside:Dn,handleMenuScroll:Je,handleMenuKeydown:Dt,handleMenuMousedown:ni,mergedTheme:o,cssVars:s?void 0:cn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(lu,null,{default:()=>[i.h(cu,null,{default:()=>i.h(Zk,{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(Cu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===En.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(Bk,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],[_s,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[_s,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),av={},Eh=i.defineComponent({...av,__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=U.useBaseConfigStateStore().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(()=>V.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),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(B=>{if(V.isEmpty(B))return;const C=o.value?r.value:r.value?[r.value]:[],T=B.filter($=>!C.some(x=>x.id===$.id));l.value=r.optionsListConverter([...C,...T])}).finally(()=>{d.value=!1}))};let m="";const g=V.debounce(()=>h(m),800),f=_=>{m=_,g()},p=_=>{var B;if(V.isArray(_)){const C=_.length>0?_.map(T=>{var $;return i.toRaw(($=l.value.find(x=>x.value===T))==null?void 0:$.item)}):[];s("update:value",C)}else if(_>0){const C=i.toRaw((B=l.value.find(T=>T.value===_))==null?void 0:B.item);s("update:value",C)}else s("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,B)=>(i.openBlock(),i.createBlock(i.unref(ov),{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:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),lv={},Fh=i.defineComponent({...lv,__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=U.useBaseConfigStateStore().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 h=>r.searchType==="categories"?U.HttpRequester.getInstance(U.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?U.HttpRequester.getInstance(U.ProductDataProvider).publicSimpleSearch(h):new Promise(m=>{m([])}),l=h=>r.searchType==="categories"?Pt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Pt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(h,m)=>{if(r.renderLabel)return r.renderLabel(h,m);if(r.searchType==="products"){const g=h.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=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=o.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=o.value)==null?void 0:h.blur()}}),(h,m)=>(i.openBlock(),i.createBlock(Eh,{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"},dv={class:"flex-1"},uv={class:"text-sc-grey"},hv={class:"ml-2.5"},fv={key:0,class:"flex-none"},mv={},gv=i.defineComponent({...mv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(V.isArray(h)?h:[h]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=h=>{h&&(a.value=a.value.map(m=>m.id===h.id?h:i.toRaw(m)),l())},u=h=>{a.value=a.value.filter(m=>m.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(h,m)=>{const g=O.NListItem,f=j_,p=O.NButton,b=O.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Fh,{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:_=>u(y)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",cv,[i.createElementVNode("span",dv,[i.createElementVNode("span",uv,i.toDisplayString(y.code),1),i.createElementVNode("span",hv,i.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",fv,[i.renderSlot(h.$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 yv(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 bv=i.markRaw({name:"tabler-truck-filled",render:yv}),_v={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wv(t,e){return i.openBlock(),i.createElementBlock("svg",_v,[...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 xv=i.markRaw({name:"tabler-truck-delivery",render:wv}),kv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vv(t,e){return i.openBlock(),i.createElementBlock("svg",kv,[...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 Cv=i.markRaw({name:"tabler-truck-loading",render:vv}),Sv={class:"flex flex-col gap-1"},Bv={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},Tv={key:1,class:"text-base"},Rv={class:"text-sc-dark-grey mr-1.5"},$v={key:0},Nv={key:1},Pv={key:2},Ev={},As=i.defineComponent({...Ev,__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=U.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Tn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,u,h,m,g,f,p,b;const a=Cv,l=xv,c=bv;return i.openBlock(),i.createElementBlock("div",Sv,[t.showType?(i.openBlock(),i.createElementBlock("span",Bv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.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",Tv,[i.createElementVNode("span",Rv,i.toDisplayString(n.value),1),(f=(g=t.delivery)==null?void 0:g.address)!=null&&f.address?(i.openBlock(),i.createElementBlock("span",$v,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",Nv," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Pv," (не указано) "))])):i.createCommentVNode("",!0)])}}}),Fv={class:"flex flex-col gap-2.5"},Av={class:"text-base"},Mv=["href"],Vv={class:"text-sc-grey"},Iv={},Ah=i.defineComponent({...Iv,__name:"order-common-info",props:{order:{},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Re.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Re.Status)?(c=(l=U.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(Re.CreatedAt)),o=i.computed(()=>e.fields.includes(Re.ClientInfo)||e.fields.includes(Re.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Re.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Fv,[i.createElementVNode("span",Av,[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,Mv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(fs,{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",Vv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(pr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(As,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Ov={},Ca=i.defineComponent({...Ov,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=U.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)}}}),zv={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},Lv={},Sa=i.defineComponent({...Lv,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const s={[U.UserTypeEnum.Manager]:"менеджером",[U.UserTypeEnum.Operator]:"оператором",[U.UserTypeEnum.Client]:"клиентом",[U.UserTypeEnum.Admin]:"администратором"};return`${r} ${s[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",zv,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),Dv={class:"flex flex-row gap-1.5"},Hv={class:"flex-none text-nowrap"},Wv={class:"flex flex-1 flex-col"},jv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},qv={key:0},Xv={key:1},Yv={},Mh=i.defineComponent({...Yv,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=Sa;return i.openBlock(),i.createElementBlock("div",Dv,[i.createElementVNode("span",Hv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Wv,[i.createVNode(lr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",jv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",qv,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Xv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),Uv={},Kv=i.defineComponent({...Uv,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},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,width:"45%",render:o=>i.h("div",{},[i.h(lr,{product:o.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in o&&o.creatorUser&&o.creatorUser.type?[i.h(Sa,{class:"mt-1",userType:o.creatorUser.type,prefixText:"Добавлено"})]:[]])},{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.name} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit.name}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"cost",showQuantityUnit:!0})}];switch(kt.getDeviceTypeByResolution()){case Ze.phone:case Ze.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Mh,{product:o,index:a})}];case Ze.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=O.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Vh=Wn(Kv,[["__scopeId","data-v-e5948917"]]),Gv={class:"text-base"},Zv={},Ba=i.defineComponent({...Zv,__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",Gv,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))}}),Qv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Jv={class:"col-span-2"},eC={class:"col-span-2"},tC={class:"btn btn-primary",href:"{{ invoice }}"},nC={},Ih=i.defineComponent({...nC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,s)=>(i.openBlock(),i.createElementBlock("div",null,[s[12]||(s[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Qv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[s[1]||(s[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ba,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),s[11]||(s[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(pr,{client:t.order.client,class:"col-span-2","onClick:clientName":s[0]||(s[0]=o=>n("click:client-name",t.order.client,o))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[s[2]||(s[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(zd,{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},[s[3]||(s[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),s[4]||(s[4]=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},[s[5]||(s[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Jv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[s[6]||(s[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ca,{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},[s[7]||(s[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(As,{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},[s[8]||(s[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",eC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[s[9]||(s[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ba,{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},[s[10]||(s[10]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(o,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"col-span-2"},[i.createElementVNode("a",tC," Скачать счет №"+i.toDisplayString(a+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),iC={key:0},rC={class:"text-sc-dark-grey my-2 text-center"},sC={key:1,class:"text-sc-dark-grey my-2 text-center"},oC={key:2},aC={class:"text-sc-dark-grey mt-4 text-right font-bold"},lC={class:"text-sc-primary"},cC={},Oh=i.defineComponent({...cC,__name:"order-info",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(new U.Order(n.order)),a=(c=!0)=>{c&&(s.value=!0),U.HttpRequester.getInstance(U.OrdersDataProvider).getOrder(n.order.id).then(d=>{o.value=d}).finally(()=>{c&&(s.value=!1)})},l=i.computed(()=>(o.value.products??[]).reduce((c,d)=>c+d.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=O.NSpin;return s.value?(i.openBlock(),i.createElementBlock("div",iC,[i.createElementVNode("div",rC,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):o.value.products.length===0?(i.openBlock(),i.createElementBlock("div",sC," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",oC,[i.createVNode(Vh,{products:o.value.products},null,8,["products"]),i.createElementVNode("div",aC,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",lC,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(Ih,{order:o.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",o.value.client,h))},null,8,["order"])]))}}}),dC={},uC=i.defineComponent({...dC,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(or,"small"),r=i.computed(()=>V.isNil(e.orderContextButtonsConfig)?[]:V.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),s=o=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,o)};return(o,a)=>{var u;const l=Ds,c=O.NButton,d=O.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:s},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),hC={},fC=i.defineComponent({...hC,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,s=()=>V.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),o=i.ref(s()),a=i.ref([]),l=i.ref(!1),c=i.computed(()=>U.useReferencesStore().orderStatusReference),d=v=>{var M,E;const w={onDblclick:()=>r("dblclick:row",v)};if(!n.useCellIndication)return w;const R=[];v.isOnOrder&&R.push("on-order"),v.isLargeOrder&&R.push("large-order"),v.isNotInStock&&R.push("not-in-stock");const N=(E=(M=c.value)==null?void 0:M.find(A=>A.id===(v.status??-1)))==null?void 0:E.slug;return N&&R.push("order-status",N),v.delivery.date&&Tn.isTomorrow(new Date(v.delivery.date))&&R.push("next-day-order"),R.length>0&&(w.class=R.join(" ")),w},u=()=>{const v=[Re.CreatedAt,Re.Id,Re.ClientInfo,Re.ClientCity,Re.DeliveryDate,Re.PaymentType,Re.SalesDirections,Re.Status,...n.showAttachedUserColumn?[Re.AttachedUser]:[],Re.actions],w=n.fields.length>0?n.fields:v,R={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},N={type:"expand",expandable:V.constant(!0),renderExpand:E=>i.h(Oh,{order:E,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",E.client,null)}}),width:"30"};let M=[{title:"Дата заказа",key:Re.CreatedAt,resizable:!0,width:100,render:E=>i.h(fs,{date:E.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Re.Id,resizable:!0,width:75,className:"order-id",render:E=>i.h("a",{href:n.orderUrl.replace(":id",E.id.toString()),class:"text-base"},E.id)},{title:"Дата доставки / самовывоза",key:Re.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:E=>i.h(fs,{date:E.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Re.ClientInfo,resizable:!0,minWidth:320,render:E=>i.h(pr,{client:E.client,"onClick:client-name":()=>{r("click:client-name",E.client,null)}})},{title:"Тип доставки",key:Re.DeliveryInfo,resizable:!0,minWidth:320,render:E=>i.h(As,{delivery:E.delivery})},{title:"Клиент",key:Re.ClientInfoShort,resizable:!0,minWidth:320,render:E=>i.h(pr,{client:E.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",E.client,null)}})},{title:"Город клиента",key:Re.ClientCity,resizable:!0,minWidth:90,width:120,render:E=>{var A;return i.h("span",{class:"text-base"},((A=E.client)==null?void 0:A.city.name)??"—")}},{title:"Статус",key:Re.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:E=>{var A,P;return i.h("span",{class:"text-base"},[((P=(A=c.value)==null?void 0:A.find(Y=>Y.id===(E.status??-1)))==null?void 0:P.name)??""])}},{title:"Тип оплаты",key:Re.PaymentType,resizable:!0,width:115,minWidth:95,render:E=>E.payment?i.h(Ca,{payment:E.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Re.SalesDirections,resizable:!0,width:70,render:E=>{var A;return i.h("span",{class:"text-base"},[((A=E.salesDirection)==null?void 0:A.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Re.AttachedUser,resizable:!0,minWidth:120,render:E=>{var A;return i.h("span",{class:"text-base"},[((A=E==null?void 0:E.attachedUser)==null?void 0:A.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&M.push({key:"actions",title:"",className:"align-top",width:50,render:E=>i.h(uC,{order:E,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(M=M.map(E=>[Re.Id,Re.CreatedAt,Re.DeliveryDate].includes(E.key)?{...E,sorter:!0,sortOrder:!1,...E.width===void 0?{}:{width:E.width+16}}:E)),kt.getDeviceTypeByResolution()){case Ze.phone:case Ze.tablet:return[N,{key:"order",title:"Заказ",resizable:!0,render:E=>i.h(Ah,{order:E,fields:w,orderUrl:n.orderUrl})}];case Ze.laptop:{const E=n.showAttachedUserColumn?w:w.filter(A=>A!==Re.AttachedUser);return[N,...E.map(A=>M.find(P=>P.key===A)??R)]}default:return[R]}},h=i.ref(u()),m=i.ref(new U.DataTablePagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),g=i.ref(null),f=i.ref(null),p=i.ref(null),b=()=>{p.value!==null&&(clearInterval(p.value),p.value=null)},y=()=>{b(),n.refreshInterval&&(p.value=setInterval(()=>{B()},n.refreshInterval))},_=()=>{var v,w;n.filters&&((v=f.value)==null||v.abort(),f.value=null,(w=g.value)==null||w.abort(),g.value=new AbortController,l.value=!0,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrders(n.filters,o.value,{page:m.value.page,pageSize:m.value.pageSize},g.value.signal).then(R=>{m.value.itemCount!==R.meta.total&&(m.value.itemCount=R.meta.total),m.value.page!==R.meta.currentPage&&(m.value.page=R.meta.currentPage),m.value.pageCount!==R.meta.lastPage&&(m.value.pageCount=R.meta.lastPage),m.value.pageSize!==R.meta.perPage&&(m.value.pageSize=R.meta.perPage),a.value=R.data,l.value=!1}).catch(R=>{if((R==null?void 0:R.name)!=="CanceledError")throw l.value=!1,R}))},B=()=>{var v;!n.filters||l.value||((v=f.value)==null||v.abort(),f.value=new AbortController,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrders(n.filters,o.value,{page:m.value.page,pageSize:m.value.pageSize},f.value.signal).then(w=>{a.value=a.value.map(R=>w.data.find(M=>M.id===R.id)??R),m.value.itemCount!==w.meta.total&&(m.value.itemCount=w.meta.total),m.value.pageCount!==w.meta.lastPage&&(m.value.pageCount=w.meta.lastPage)}).catch(w=>{if((w==null?void 0:w.name)!=="CanceledError")throw w}))},C=v=>{m.value.page=v,_(),r("update:pagination",m.value)},T=v=>{m.value.pageSize=v,m.value.page=1,_(),r("update:pagination",m.value)},$=v=>{if(V.isNull(v))o.value=s();else{const[w]=o.value;w.field=v.columnKey.toString(),w.direction=v.order==="ascend"?"asc":"desc",o.value=[w]}h.value.forEach(w=>{if(Object.hasOwn(w,"sortOrder")){const R=w;R.sortOrder=R.key===(v==null?void 0:v.columnKey)&&(v!=null&&v.sorter)&&v.order!==!1?v.order:!1}}),_(),r("update:sort",o.value)},x=()=>{h.value=u()};return i.watch(()=>n.filters,()=>{m.value.page=1,_(),y()}),i.watch(()=>n.sort,()=>{o.value=s(),m.value.page=1,_(),y()}),i.onMounted(()=>{x(),window.addEventListener("resize",x),i.nextTick(()=>{_(),y()})}),i.onUnmounted(()=>{var v,w;window.removeEventListener("resize",x),(v=g.value)==null||v.abort(),(w=f.value)==null||w.abort(),b()}),(v,w)=>{const R=O.NDataTable;return i.openBlock(),i.createBlock(R,{columns:h.value,data:a.value,"row-key":N=>N.id,"row-props":d,"scroll-x":t.tableMinWidth,pagination:m.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":C,"onUpdate:pageSize":T,"onUpdate:sorter":$},null,8,["columns","data","row-key","scroll-x","pagination","loading"])}}}),mC=Wn(fC,[["__scopeId","data-v-03e9242a"]]),gC=["href"],pC={class:"text-sc-dark-grey"},yC={},bC=i.defineComponent({...yC,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Tn.format(n.order.createdAt,U.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),o=a=>{V.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,gC),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",pC,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),_C={class:"sc-page flex flex-col bg-inherit"},wC={class:"my-2 flex flex-row items-end"},xC={class:"sc-title grow"},kC={key:0,class:"sc-title-buttons flex-1 grow-0"},vC={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},CC={key:0,class:"sc-title-extra mt-2 sm:mt-4"},SC={},zh=i.defineComponent({...SC,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=O.NH1;return i.openBlock(),i.createElementBlock("div",_C,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",wC,[i.createElementVNode("div",xC,[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",kC,[i.createElementVNode("div",vC,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",CC,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),BC={class:"overflow-hidden transition-all duration-300"},TC={class:"text-lg font-medium leading-none"},RC={},Lh=i.defineComponent({...RC,__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(kt.getDeviceTypeByResolution()){case Ze.phone:return window.innerWidth*.66;case Ze.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?V.isUndefined(n.drawerWidth)?s.value=a():s.value=V.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 u=O.NDrawerContent,h=O.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",BC,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{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(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",TC,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)}}}),$C={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},NC={key:0},PC={class:"sc-page-preview-panel grow"},EC={key:1,class:"sc-page-preview-panel-extra flex-none"},FC={},AC=i.defineComponent({...FC,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},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,u;window.scrollTo({top:(((u=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=O.NButton;return i.openBlock(),i.createBlock(zh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(Lh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),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,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",$C,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",NC,[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]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",PC,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",EC,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),MC={},VC=i.defineComponent({...MC,__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(()=>V.isArray(r.value)),a=i.computed(()=>{var f;return V.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{const f=new U.Curator({id:-1,name:"",contacts:{},curatedDirection:new U.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[f]:[];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 U.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Pt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,f=>{const p=V.some(o.value?r.value:[r.value],["id",f.id])?` (${f.curatedDirection.name}) `:"";return f.curatedDirection.isNewRec()?f.name:`${f.name}${p}`})),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(V.isArray(f)){const p=f.length>0?f.map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];s("update:value",p)}else{const p=f>0?l.value.find(b=>b.id===f):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.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":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),IC={},OC=i.defineComponent({...IC,__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(()=>V.isArray(r.value)),a=i.computed(()=>{var f;return V.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>r.showEmptyValue?[U.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let f=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=V.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=V.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),f=f.filter(_=>(r.showEmptyValue?U.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Pt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&V.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(V.isArray(f)){const p=f.length>0?f.filter(b=>!V.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];s("update:value",p)}else{const p=f>0&&!V.some(r.disabledManagerReferenceList,["id",f])?l.value.find(b=>b.id===f):new U.Manager;s("update:value",p??new U.Manager)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const p=r.value;V.some(p,b=>V.some(f,["id",b.id]))&&s("update:value",p.filter(b=>!V.some(f,["id",b.id])))}else{const p=r.value;V.some(f,["id",p.id])&&s("update:value",new U.Manager)}}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.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":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),zC={class:"m-0.5 flex flex-col p-0.5"},LC={class:"flex flex-row gap-1"},DC={key:0},HC={key:1},WC={key:2},jC={key:3},qC={class:"flex flex-row gap-1"},XC={key:0},YC={key:1},UC={key:2},KC={key:3},GC={},Dh=i.defineComponent({...GC,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",zC,[i.createElementVNode("span",LC,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",DC,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",HC,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",WC,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",jC,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",qC,[t.addr.street?(i.openBlock(),i.createElementBlock("span",XC,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",YC,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",UC,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",KC,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ta={clearable:!1,value:"",field:void 0,disabled:!1},ZC={},QC=i.defineComponent({...ZC,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ta,minTermLength:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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=V.debounce(()=>u(),800),u=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):U.HttpRequester.getInstance(U.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Dh,{addr:y,selected:b},{default:V.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=O.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":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),JC={class:"m-0.5 flex flex-col p-0.5"},e2={class:"font-medium"},t2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},n2={key:0},i2={key:1},r2={},Hh=i.defineComponent({...r2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",JC,[i.createElementVNode("span",e2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",t2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",n2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",i2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),s2={},o2=i.defineComponent({...s2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ta,minTermLength:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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=V.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Hh,{bank:y,selected:b},{default:V.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=O.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":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),a2={class:"font-medium"},l2={key:0,class:"flex flex-row gap-2"},c2={key:0,class:"text-xs font-light text-blue-800"},d2={key:1,class:"text-sc-dark-grey text-xs font-light"},u2={},Wh=i.defineComponent({...u2,__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",a2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",l2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",c2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",d2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),h2={},f2=i.defineComponent({...h2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ta,minTermLength:()=>{var t,e;return((e=(t=U.useBaseConfigStateStore().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(()=>Pt.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 u=V.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(B=>B.id===b.value)||{};return i.h(Wh,{org:_,selected:y},{default:V.constant("-")})},g=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(b,y)=>{const _=O.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=B=>o.value=B),i.unref(u)],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"])}}}),m2={},g2=i.defineComponent({...m2,__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=O.NButton,u=O.NPopover,h=O.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{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(h,{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"])])}}}),p2={key:0,class:"whitespace-pre-line"},y2={key:1,class:"text-sc-dark-grey"},b2={},_2=i.defineComponent({...b2,__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=O.NInput;return i.openBlock(),i.createBlock(jd,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",p2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",y2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=u=>s.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),w2={},x2=i.defineComponent({...w2,__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)}}),k2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function v2(t,e){return i.openBlock(),i.createElementBlock("svg",k2,[...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 C2=i.markRaw({name:"ion-warning",render:v2}),S2={},B2=i.defineComponent({...S2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=C2,s=O.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),_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(V.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 U.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])}};S(_t,"messagesService"),S(_t,"notificationsService");let Ra=_t;const T2=i.computed(()=>U.useReferencesStore().deliveryTypeReference??[]),R2=i.computed(()=>U.useReferencesStore().managersList??[]),$2=i.computed(()=>U.useReferencesStore().opfReference??[]),N2=i.computed(()=>U.useReferencesStore().partnerGroupsReference??[]),P2=i.computed(()=>U.useReferencesStore().priceCoefficientsReference??[]),E2=i.computed(()=>U.useReferencesStore().productFilesTypesReference??[]),F2=i.computed(()=>U.useReferencesStore().resourceTypesReference),A2=i.computed(()=>U.useReferencesStore().salesDirectionsReference??[]),M2=i.computed(()=>U.useReferencesStore().warehousesReference??[]),V2=i.computed(()=>U.useReferencesStore().paymentTypeReference??[]),I2=i.computed(()=>U.useReferencesStore().orderStatusReference??[]),O2=i.computed(()=>U.useReferencesStore().operatorReference??[]),z2=i.computed(()=>Pt.convertReferencesToSelectOptionsList(U.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),L2=i.computed(()=>Pt.convertReferencesToSelectOptionsList(U.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),D2=t=>U.HttpRequester.getInstance(U.ReferenceDataProvider).searchCity(t),H2=t=>Pt.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()),W2=t=>U.HttpRequester.getInstance(U.ClientDataProvider).searchClient(t),j2=t=>Pt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());H.AddProductToCartDialog=j0,H.ConfiguratorSettingsKozyrek=_d,H.ConfiguratorSettingsMosquito=Zb,H.ConfiguratorsEnum=hs,H.ContentHelper=ai,H.KozyrekLine=bn,H.KozyrekTailTemplate=Lo,H.KozyrekTemplate=Ui,H.OrdersTableFields=Re,H.Point=zo,H.ScAddressSuggestion=QC,H.ScAddressSuggestionLabel=Dh,H.ScBankSuggestion=o2,H.ScBankSuggestionLabel=Hh,H.ScBaseDialog=Od,H.ScButtonWithConfirmAction=g2,H.ScCategoryCollapse=Vd,H.ScClientNameWithShortInfo=pr,H.ScCollapse=Md,H.ScCollapseItem=Za,H.ScCommentEditor=_2,H.ScConfiguratorsProductInfo=cr,H.ScContragentWithShortInfo=zd,H.ScCreatorUserTypeTag=Sa,H.ScCuratorSelect=VC,H.ScDateRange=n_,H.ScDateTimeLabel=fs,H.ScDebouncedInput=$_,H.ScDebouncedInputNumber=P_,H.ScDebt=x2,H.ScDialogHeader=d_,H.ScDynamicConfigurator=Ed,H.ScEmail=ob,H.ScExternalLink=D_,H.ScImageGallery=nl,H.ScInlineEditableItem=jd,H.ScInlineView=Ho,H.ScKozyrekConfigurator=wd,H.ScKozyrekConfiguratorParamsForm=rl,H.ScKozyrekConfiguratorPreview=bd,H.ScKozyrekConfiguratorTemplates=yd,H.ScLightGallery=tl,H.ScManagerSelect=OC,H.ScMetalForDoorsConfigurator=$d,H.ScMetalForDoorsConfiguratorForm=Rd,H.ScMosquitoConfigurator=vd,H.ScMosquitoConfiguratorForm=xd,H.ScMosquitoConfiguratorMeasurementInstructions=kd,H.ScMosquitoConfiguratorPreview=Do,H.ScOrderCommonInfo=Ah,H.ScOrderDeliveryLabel=As,H.ScOrderDetails=Ih,H.ScOrderInfo=Oh,H.ScOrderItemsList=Vh,H.ScOrderPayment=Ca,H.ScOrderProductInfo=Mh,H.ScOrdersList=mC,H.ScOrgSuggestion=f2,H.ScOrgSuggestionLabel=Wh,H.ScPage=zh,H.ScPageWithSlidingPanel=AC,H.ScPersonContactsBlock=Gb,H.ScPhone=Nb,H.ScPhoneInput=A_,H.ScProductName=lr,H.ScProductsList=gv,H.ScReferenceSelect=Id,H.ScSandwichConfigurator=Pd,H.ScSandwichConfiguratorForm=Nd,H.ScSearchableProductSelect=Fh,H.ScSearchableReferenceSelect=Eh,H.ScSetClientPriceFormItem=O0,H.ScShortTextOrderInfo=bC,H.ScSingleFileUploadSelector=g_,H.ScSlidingContentWithDrawer=Lh,H.ScStripConfigurator=Td,H.ScStripConfiguratorForm=Sd,H.ScStripConfiguratorLineItem=Cd,H.ScStripConfiguratorPreview=Bd,H.ScUserShortInfo=Ba,H.ScWarningIcon=B2,H.SelectOptionHelper=Pt,H.UiNotificationProvider=Ra,H.WindowResolutionEnum=Ze,H.WindowResolutionProvider=kt,H.channelPrimaryInterestOptionsList=z2,H.componentSizeInjectionKey=or,H.deliveryTypeReferenceList=T2,H.handleFloatInput=Ls,H.handleIntegerInput=lt,H.isCanSandwichShow=Ad,H.isConfiguratorType=Fd,H.managersReferenceList=R2,H.naiveUiTheme=Mf,H.operatorReferenceList=O2,H.opfReferenceList=$2,H.orderStatusReferenceList=I2,H.parse=xt,H.partnerGroupReferenceList=N2,H.paymentTypeReferenceList=V2,H.priceCoefficientsReferenceList=P2,H.productFilesTypesReferenceList=E2,H.renderConfig=De,H.resetInputValidation=ze,H.resourceReferencesList=F2,H.salesDirectionsReferenceList=A2,H.searchCityReferenceDataHandler=D2,H.searchCityReferenceLabelRenderer=H2,H.searchClientReferenceDataHandler=W2,H.searchClientReferenceLabelRenderer=j2,H.selectAllTextOnFocus=Le,H.sourcePrimaryInterestOptionsList=L2,H.warehousesReferenceList=M2,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
|