@snabcentr/vue-ui-lib 5.3.1 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +2 -2
- package/dist/release_notes.tmp +2 -2
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +1205 -1210
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +19 -19
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/components/orders/blocks/order-external-links.vue.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Y,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("date-fns"),require("vue"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","date-fns","vue","naive-ui","libphonenumber-js","ts-case-convert","vue-tel-input"],H):(Y=typeof globalThis<"u"?globalThis:Y||self,H(Y.SC_VueUiLib={},Y["@snabcentr/common-lib"],Y["lodash-es"],Y["date-fns"],Y.Vue,Y["naive-ui"],Y["libphonenumber-js"],Y["ts-case-convert"],Y["vue-tel-input"]))})(this,(function(Y,H,A,ke,n,F,xr,ws,wm){"use strict";var JN=Object.defineProperty;var gm=Y=>{throw TypeError(Y)};var eT=(Y,H,A)=>H in Y?JN(Y,H,{enumerable:!0,configurable:!0,writable:!0,value:A}):Y[H]=A;var B=(Y,H,A)=>eT(Y,typeof H!="symbol"?H+"":H,A),ym=(Y,H,A)=>H.has(Y)||gm("Cannot "+A);var zt=(Y,H,A)=>(ym(Y,H,"read from private field"),A?A.call(Y):H.get(Y)),Pa=(Y,H,A)=>H.has(Y)?gm("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(Y):H.set(Y,A),bm=(Y,H,A,ke)=>(ym(Y,H,"write to private field"),ke?ke.call(Y,A):H.set(Y,A),A);var zi,wt,gs;const $t=class $t{static init(e,i){$t.messagesService&&$t.notificationsService||($t.messagesService=e,$t.notificationsService=i)}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,i={}){var r,o;if(A.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,l=s?` [ ${s} ]`:"";$t.notificationsService?$t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${l}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(i,s)?i[s]=new H.FieldValidationResultData(e.errors[s].toString(),"error"):$t.messagesService?$t.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};B($t,"messagesService"),B($t,"notificationsService");let kr=$t;const Cr=new WeakMap,xm=async t=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(t);return}const i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.opacity="0",document.body.append(i),i.select();const r=document.execCommand("copy");if(i.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},Va=async t=>{const e=A.isNil(t)?"":String(t);if(e)try{await xm(e),kr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{kr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},km=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),Cm=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":km(t)?"click":"dblclick",Ma={mounted(t,e){t.style.setProperty("cursor","pointer");const i=Cm(t,e),r=o=>{var l;i==="dblclick"&&(o.preventDefault(),(l=globalThis.getSelection())==null||l.removeAllRanges());const s=Cr.get(t);Va(s==null?void 0:s.value).catch(A.noop)};Cr.set(t,{value:e.value,eventName:i,handler:r}),t.addEventListener(i,r)},updated(t,e){const i=Cr.get(t);i&&(i.value=e.value)},beforeUnmount(t){const e=Cr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),Cr.delete(t))}},vm=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),Sm=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",ro=new WeakMap,Ia=t=>!vm.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(Sm)===null&&t.getClientRects().length>0,Aa=t=>{var l;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!Ia(e))return;t.preventDefault();const i=t.currentTarget,r=[...i.querySelectorAll("input")].filter(a=>Ia(a)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(l=ro.get(i))==null||l()},ti={mounted(t,e){ro.set(t,e.value),t.addEventListener("keydown",Aa)},updated(t,e){ro.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",Aa),ro.delete(t)}};var it=(t=>(t.NotInStock="not_in_stock",t.OnOrder="on_order",t.LargeOrder="large_order",t.NextDayDelivery="next_day_delivery",t))(it||{});const xs={color:"#4b5563",backgroundColor:"#e5e7eb",textOnBackgroundColor:"#1f2937"},Oa=new Map([[H.OrderStatusEnum.New,{color:"#15803d",backgroundColor:"#bbf7d0",textOnBackgroundColor:"#166534"}],[H.OrderStatusEnum.Processing,{color:"#ea580c",backgroundColor:"#fed7aa",textOnBackgroundColor:"#9a3412"}],[H.OrderStatusEnum.AwaitingSupplyProducts,{color:"#ca8a04",backgroundColor:"#fef08a",textOnBackgroundColor:"#854d0e"}],[H.OrderStatusEnum.InvoiceIssued,{color:"#1d4ed8",backgroundColor:"#bfdbfe",textOnBackgroundColor:"#1e40af"}],[H.OrderStatusEnum.ProcessingOnStock,{color:"#0e7490",backgroundColor:"#a5f3fc",textOnBackgroundColor:"#155e75"}],[H.OrderStatusEnum.OrderUpdated,{color:"#6d28d9",backgroundColor:"#ddd6fe",textOnBackgroundColor:"#5b21b6"}],[H.OrderStatusEnum.Finished,{color:"#475569",backgroundColor:"#e2e8f0",textOnBackgroundColor:"#1e293b"}],[H.OrderStatusEnum.Canceled,{color:"#b91c1c",backgroundColor:"#fecaca",textOnBackgroundColor:"#991b1b"}],[H.OrderStatusEnum.Error,{color:"#991b1b",backgroundColor:"#fca5a5",textOnBackgroundColor:"#7f1d1d"}]]),bi=t=>Oa.get(t)??xs,za=t=>{const e=bi(t);return{color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}},Da=t=>{const e=bi(t);return{"--sc-order-status-color":e.color,"--sc-order-status-bg":e.backgroundColor,"--sc-order-status-text":e.textOnBackgroundColor}},ks=new Map([[it.NotInStock,{color:"#ef4444",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[it.OnOrder,{color:"#ca8a04",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[it.LargeOrder,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}],[it.NextDayDelivery,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}]]),La=new Map([[it.NotInStock,"Нет в наличии"],[it.OnOrder,"Под заказ"],[it.LargeOrder,"Крупный заказ"],[it.NextDayDelivery,"Доставка на завтра"]]),oo=[...ks.keys()],vr=t=>ks.get(t)??xs,Cs=t=>La.get(t)??t,vs=t=>{const e=[];return t.isNotInStock&&e.push(it.NotInStock),t.isOnOrder&&e.push(it.OnOrder),t.isLargeOrder&&e.push(it.LargeOrder),!A.isNil(t.delivery.date)&&ke.isTomorrow(new Date(t.delivery.date))&&e.push(it.NextDayDelivery),e};var Ve=(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))(Ve||{}),Xe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Xe||{});const Bm="(hover: hover) and (pointer: fine)",Ha=()=>{const t=A.isFunction(globalThis.matchMedia)?globalThis.matchMedia(Bm):void 0,e=n.ref(t?t.matches:!0),i=r=>{e.value=r.matches};return t==null||t.addEventListener("change",i),n.onScopeDispose(()=>{t==null||t.removeEventListener("change",i)},!0),n.readonly(e)};class _i{static isVnodeEmpty(e){return e.every(i=>i.type===n.Comment||i.type===n.Text&&A.isString(i.children)&&!i.children.trim()?!0:i.type===n.Fragment&&_i.isVnodeEmpty(i.children))}static hasSlotContent(e){return e?!_i.isVnodeEmpty(e()):!1}}const Nm={readAsFileData(t){return new Promise((e,i)=>{const r=new FileReader;r.addEventListener("load",()=>{e({name:t.name,content:r.result})}),r.addEventListener("error",()=>{i(new Error(`Не удалось прочитать файл «${t.name}».`))}),r.readAsDataURL(t)})}};class ni{static isDeleted(e){return!!(e.deletedAt&&!ke.isFuture(e.deletedAt))}static getFormatEntityName(e){return ni.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const lt=(t,e=!1)=>{const{key:i}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(i)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(i.toLowerCase()))){if(e&&i==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(i)||t.preventDefault()}},so=(t,e=".",i=!1)=>{const{key:r}=t,o=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())||i&&r==="-"&&!o.value.includes("-")&&((o.selectionStart??0)===0||o.value.length===0)||(r===e||r===(e==="."?",":"."))&&!o.value.includes(e)&&!o.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},ct=t=>t?Number.parseFloat(t.replace(",",".")):null,rt=(t,e)=>{t[e]={}},He=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class bt{static convertReferencesToOptionsList(e,i=!1,r=!1,o=!1,s=void 0,l=void 0){let a=e.map(c=>({label:s?s(c):ni.getFormatEntityName(c),value:c.id,item:c,disabled:l?l(c):!1}));return i&&(a=a.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>a.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...a]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(a,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=A.isString(r.key)?A.get(d,r.key):r.key(c),f=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(f)?"- Не определено -":f,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,i=!1,r=!1,o=!1,s=void 0,l=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,l)}static convertReferencesToAutocompleteOptionsList(e,i=!1,r=!1,o=!1,s=void 0,l=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,l)}}const Tm={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,i)=>i===null||Math.abs(i/t-Math.round(i/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},$m={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(t){return{validator:(e,i)=>i===null?!0:t?new Error(t):!0}}},Ss=t=>{var e;return((e=t.properties)==null?void 0:e.files)??[]},Wa=t=>{var e,i;return!!((e=t.properties)!=null&&e.description)||!!((i=t.properties)!=null&&i.specification)||Ss(t).length>0},Em={},Rm=n.defineComponent({...Em,__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 i=t,r=e,o=n.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},l=()=>{i.disableConfirm?s():o.value=!0};return(a,c)=>{const d=F.NButton,u=F.NPopover,f=F.NModal;return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:l},{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),n.createVNode(f,{show:o.value,"onUpdate:show":c[1]||(c[1]=h=>o.value=h),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:n.withCtx(()=>[n.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:n.withCtx(()=>[...c[2]||(c[2]=[n.createTextVNode(" Да ",-1)])]),_:1}),n.createVNode(d,{type:"default",onClick:c[0]||(c[0]=h=>o.value=!1)},{default:n.withCtx(()=>[...c[3]||(c[3]=[n.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),Pm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fm(t,e){return n.openBlock(),n.createElementBlock("svg",Pm,[...e[0]||(e[0]=[n.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),n.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),n.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Bs=n.markRaw({name:"ion-ellipsis-vertical-sharp",render:Fm}),Vm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mm(t,e){return n.openBlock(),n.createElementBlock("svg",Vm,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),n.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const ja=n.markRaw({name:"tabler-edit",render:Mm}),Im={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Am(t,e){return n.openBlock(),n.createElementBlock("svg",Im,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const qa=n.markRaw({name:"ion-checkmark-done-circle",render:Am}),Om={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zm(t,e){return n.openBlock(),n.createElementBlock("svg",Om,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Xa=n.markRaw({name:"ion-checkmark-done-circle-outline",render:zm}),Dm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Lm(t,e){return n.openBlock(),n.createElementBlock("svg",Dm,[...e[0]||(e[0]=[n.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 Hm=n.markRaw({name:"fluent-pin32-regular",render:Lm}),Wm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function jm(t,e){return n.openBlock(),n.createElementBlock("svg",Wm,[...e[0]||(e[0]=[n.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),n.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const qm=n.markRaw({name:"ion-eye-outline",render:jm}),Xm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Ym(t,e){return n.openBlock(),n.createElementBlock("svg",Xm,[...e[0]||(e[0]=[n.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 Um=n.markRaw({name:"fluent-pin32-filled",render:Ym}),Km={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gm(t,e){return n.openBlock(),n.createElementBlock("svg",Km,[...e[0]||(e[0]=[n.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 Zm=n.markRaw({name:"ion-bookmark-outline",render:Gm}),Qm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jm(t,e){return n.openBlock(),n.createElementBlock("svg",Qm,[...e[0]||(e[0]=[n.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),n.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 ep=n.markRaw({name:"ion-eye-off-sharp",render:Jm}),tp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function np(t,e){return n.openBlock(),n.createElementBlock("svg",tp,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const ip=n.markRaw({name:"ion-chevron-forward-outline",render:np}),rp=["data-name"],op={class:"sc-collapse-item-header flex flex-row gap-2.5"},sp={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},lp={key:0},ap={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},cp={class:"flex flex-1 flex-col"},dp={key:0,class:"sc-collapse-item-sub-title flex-1"},up={key:1,class:"sc-collapse-item-title-extra flex-none"},fp={key:0,class:"sc-collapse-item-content"},hp={},mp=n.defineComponent({...hp,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.inject("itemHeaderClickHandler",A.noop),l=n.inject("defaultExpandedNames",[]),a=n.inject("expandedNames",[]),c=A.some(l,g=>g===r.name),d=n.computed(()=>A.some(a,g=>g===r.name)),u=n.ref(c),f=()=>{r.disabled||(u.value=d.value||!u.value,o("header:click",r.name,u.value),s(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,o("header:click",r.name,u.value),s(r.name,u.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:n.readonly(u)}),(g,b)=>{const y=ip;return n.openBlock(),n.createElementBlock("div",{"data-name":t.name,class:n.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[n.createElementVNode("div",op,[n.createElementVNode("div",sp,[n.createElementVNode("div",{class:n.normalizeClass({"rotate-90":u.value}),onClick:f},[n.renderSlot(g.$slots,"arrow",{},()=>[n.createVNode(y)],!0)],2)]),n.unref(_i).hasSlotContent(g.$slots["pre-arrow"])?(n.openBlock(),n.createElementBlock("div",lp,[n.createElementVNode("div",ap,[n.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",cp,[n.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[n.renderSlot(g.$slots,"header",{},()=>[n.createTextVNode(n.toDisplayString(t.title),1)],!0)]),n.unref(_i).hasSlotContent(g.$slots["sub-header"])?(n.openBlock(),n.createElementBlock("div",dp,[n.renderSlot(g.$slots,"sub-header",{},void 0,!0)])):n.createCommentVNode("",!0)]),n.unref(_i).hasSlotContent(g.$slots["header-extra"])?(n.openBlock(),n.createElementBlock("div",up,[n.renderSlot(g.$slots,"header-extra",{},void 0,!0)])):n.createCommentVNode("",!0)]),n.createVNode(n.Transition,{name:"fade"},{default:n.withCtx(()=>[d.value||u.value?(n.openBlock(),n.createElementBlock("div",fp,[n.renderSlot(g.$slots,"default",{},void 0,!0)])):n.createCommentVNode("",!0)]),_:3})],10,rp)}}}),wn=(t,e)=>{const i=t.__vccOpts||t;for(const[r,o]of e)i[r]=o;return i},Ya=wn(mp,[["__scopeId","data-v-9f4b93c4"]]),pp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gp(t,e){return n.openBlock(),n.createElementBlock("svg",pp,[...e[0]||(e[0]=[n.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Ua=n.markRaw({name:"ion-cart-outline",render:gp}),Sr=Symbol(),yp={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"}},bp={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},_p={},Ka=n.defineComponent({..._p,__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,i=n.inject(Sr,"medium"),r=Ha(),o=n.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=n.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),l=n.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=n.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),c=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},d=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},u=()=>{e.eventEmitter.emit("product:required",{product:e.product})},f=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var N;const p=Xa,g=qa,b=F.NButton,y=F.NTooltip,_=ja,k=Ua,x=Bs,v=F.NDropdown;return n.openBlock(),n.createElementBlock("div",bp,[l.value?(n.openBlock(),n.createBlock(y,{key:0,placement:"bottom",trigger:"hover",disabled:!n.unref(r)},{trigger:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),disabled:l.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:u},{default:n.withCtx(()=>[t.product.isRequired?(n.openBlock(),n.createBlock(g,{key:1})):(n.openBlock(),n.createBlock(p,{key:0}))]),_:1},8,["size","disabled","type"])]),default:n.withCtx(()=>[m[0]||(m[0]=n.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createBlock(y,{key:1,placement:"bottom",trigger:"hover",disabled:!n.unref(r)},{trigger:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),type:"primary",disabled:s.value==="disabled",onClick:d},{default:n.withCtx(()=>[n.createVNode(_)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[m[1]||(m[1]=n.createTextVNode(" Редактировать ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(y,{key:2,placement:"bottom",trigger:"hover",disabled:!n.unref(r)},{trigger:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),disabled:o.value==="disabled",type:"primary",onClick:c},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[m[2]||(m[2]=n.createTextVNode(" Добавить в корзину ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(n.openBlock(),n.createBlock(v,{key:3,options:a.value,size:n.unref(i),trigger:"click",onSelect:f},{default:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(x)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)])}}}),wp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xp(t,e){return n.openBlock(),n.createElementBlock("svg",wp,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.createElementVNode("path",{d:"M12 8v4l2 2"}),n.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const kp=n.markRaw({name:"tabler-history",render:xp}),Cp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vp(t,e){return n.openBlock(),n.createElementBlock("svg",Cp,[...e[0]||(e[0]=[n.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 Sp=n.markRaw({name:"mdi-percent-outline",render:vp}),Bp={class:"flex flex-row gap-1"},Np={key:0,class:"flex gap-1"},Tp={key:0,class:"flex text-nowrap text-sm line-through"},$p={key:1,class:"flex flex-row text-nowrap text-sm"},Ep={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Rp={},ii=n.defineComponent({...Rp,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCurrency:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var k;const e=t,i=n.computed(()=>"product"in e.product),r=n.computed(()=>"discount"in e.product&&e.product.discount?ni.getFormatEntityName(e.product.discount):""),o=n.computed(()=>"product"in e.product?e.product.product:e.product),s=n.computed(()=>e.showQuantityUnit?`${o.value.currency.symbol}/${o.value.unit.name}`:e.showCurrency?o.value.currency.symbol:""),l=n.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),a=n.computed(()=>A.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=n.computed(()=>{const x=A.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return a.value||!x||A.isNil(u.value)||A.isNil(x.cost)?!1:u.value<x.cost}),d=((k=H.useBaseConfigStateStore().getConfig())==null?void 0:k.defaultCurrency)??"RUB",u=n.computed(()=>a.value?a.value.cost:A.get(e.product,e.costFieldName)),f=n.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),h=n.computed(()=>o.value.costDate?ke.format(o.value.costDate,H.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),m=n.computed(()=>e.currencyRates||o.value.currency.signature===d?e.currencyRates:{[o.value.currency.signature]:o.value.costRub/o.value.cost}),p=n.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!A.isNil(u.value)),g=n.computed(()=>A.isNil(u.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value))),b=n.computed(()=>{if(o.value.currency.signature===d||!m.value||!m.value[o.value.currency.signature])return null;const x=m.value[o.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value)*x)}),y=n.computed(()=>A.isNil(f.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(f.value)),_=n.computed(()=>{if(!f.value||!u.value||f.value===u.value||u.value===0)return null;const x=(u.value-f.value)/f.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(x)});return(x,v)=>{var $;const N=F.NTag,w=F.NTooltip,T=Sp,C=kp;return n.openBlock(),n.createElementBlock("div",Bp,[t.showTag?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(N,{round:"",bordered:!1,size:"small",class:n.normalizeClass(["text-slate-600",{"font-bold":!a.value}])},{default:n.withCtx(()=>{var E;return[n.createTextVNode(n.toDisplayString(((E=a.value)==null?void 0:E.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:n.withCtx(()=>{var E;return[n.createTextVNode(" "+n.toDisplayString(((E=a.value)==null?void 0:E.coefficient.name)??"Розничная цена"),1)]}),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass({"!text-red-600":c.value})},[f.value&&f.value!==u.value||_.value?(n.openBlock(),n.createElementBlock("div",Np,[f.value&&f.value!==u.value?(n.openBlock(),n.createElementBlock("span",Tp,n.toDisplayString(y.value)+" "+n.toDisplayString(s.value),1)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":c.value}])}," ("+n.toDisplayString(_.value)+"%) ",3)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":($=a.value)==null?void 0:$.readOnly,"font-bold":!a.value&&!i.value}])},[n.createElementVNode("span",{class:n.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":p.value&&t.eventEmitter}),onClick:v[0]||(v[0]=()=>{var E;p.value&&((E=t.eventEmitter)==null||E.emit("cost:click",{product:o.value,cost:u.value}))})},n.toDisplayString(g.value),3),n.createTextVNode(" "+n.toDisplayString(s.value)+" ",1),u.value&&!a.value&&"discount"in t.product&&t.product.discount?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(T,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:n.withCtx(()=>[n.createElementVNode("span",null,' На продукт действует скидка "'+n.toDisplayString(r.value)+'"; ',1)]),_:1})):n.createCommentVNode("",!0)],2),b.value?(n.openBlock(),n.createElementBlock("span",$p," ~ "+n.toDisplayString(b.value)+" "+n.toDisplayString(l.value),1)):n.createCommentVNode("",!0),t.showCostDate&&!n.unref(A.isNil)(h.value)?(n.openBlock(),n.createElementBlock("span",Ep,[n.createTextVNode(n.toDisplayString(h.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(n.openBlock(),n.createBlock(w,{key:0,placement:"top-end"},{trigger:n.withCtx(()=>[n.createVNode(C,{class:"cursor-pointer",onClick:v[1]||(v[1]=E=>{var V;return(V=t.eventEmitter)==null?void 0:V.emit("cost:show-price-history",{product:o.value})})})]),default:n.withCtx(()=>[v[2]||(v[2]=n.createTextVNode(" История цен ",-1))]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2)])}}}),Pp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fp(t,e){return n.openBlock(),n.createElementBlock("svg",Pp,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),n.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const lo=n.markRaw({name:"ion-information-circle-outline",render:Fp}),Vp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Mp(t,e){return n.openBlock(),n.createElementBlock("svg",Vp,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Ga=n.markRaw({name:"ion-images",render:Mp}),Ip={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ap(t,e){return n.openBlock(),n.createElementBlock("svg",Ip,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56m0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26m48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32"},null,-1)])])}const Op=n.markRaw({name:"ion-information-circle",render:Ap}),zp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dp(t,e){return n.openBlock(),n.createElementBlock("svg",zp,[...e[0]||(e[0]=[n.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 Lp=n.markRaw({name:"ion-bookmark",render:Dp});/*!
|
|
1
|
+
(function(Y,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("date-fns"),require("vue"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","date-fns","vue","naive-ui","libphonenumber-js","ts-case-convert","vue-tel-input"],H):(Y=typeof globalThis<"u"?globalThis:Y||self,H(Y.SC_VueUiLib={},Y["@snabcentr/common-lib"],Y["lodash-es"],Y["date-fns"],Y.Vue,Y["naive-ui"],Y["libphonenumber-js"],Y["ts-case-convert"],Y["vue-tel-input"]))})(this,(function(Y,H,A,ke,n,F,xr,ws,wm){"use strict";var GN=Object.defineProperty;var gm=Y=>{throw TypeError(Y)};var ZN=(Y,H,A)=>H in Y?GN(Y,H,{enumerable:!0,configurable:!0,writable:!0,value:A}):Y[H]=A;var B=(Y,H,A)=>ZN(Y,typeof H!="symbol"?H+"":H,A),ym=(Y,H,A)=>H.has(Y)||gm("Cannot "+A);var zt=(Y,H,A)=>(ym(Y,H,"read from private field"),A?A.call(Y):H.get(Y)),Pa=(Y,H,A)=>H.has(Y)?gm("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(Y):H.set(Y,A),bm=(Y,H,A,ke)=>(ym(Y,H,"write to private field"),ke?ke.call(Y,A):H.set(Y,A),A);var zi,wt,gs;const $t=class $t{static init(e,i){$t.messagesService&&$t.notificationsService||($t.messagesService=e,$t.notificationsService=i)}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,i={}){var r,o;if(A.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,l=s?` [ ${s} ]`:"";$t.notificationsService?$t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${l}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(i,s)?i[s]=new H.FieldValidationResultData(e.errors[s].toString(),"error"):$t.messagesService?$t.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};B($t,"messagesService"),B($t,"notificationsService");let kr=$t;const Cr=new WeakMap,xm=async t=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(t);return}const i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.opacity="0",document.body.append(i),i.select();const r=document.execCommand("copy");if(i.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},Va=async t=>{const e=A.isNil(t)?"":String(t);if(e)try{await xm(e),kr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{kr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},km=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),Cm=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":km(t)?"click":"dblclick",Ma={mounted(t,e){t.style.setProperty("cursor","pointer");const i=Cm(t,e),r=o=>{var l;i==="dblclick"&&(o.preventDefault(),(l=globalThis.getSelection())==null||l.removeAllRanges());const s=Cr.get(t);Va(s==null?void 0:s.value).catch(A.noop)};Cr.set(t,{value:e.value,eventName:i,handler:r}),t.addEventListener(i,r)},updated(t,e){const i=Cr.get(t);i&&(i.value=e.value)},beforeUnmount(t){const e=Cr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),Cr.delete(t))}},vm=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),Sm=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",ro=new WeakMap,Ia=t=>!vm.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(Sm)===null&&t.getClientRects().length>0,Aa=t=>{var l;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!Ia(e))return;t.preventDefault();const i=t.currentTarget,r=[...i.querySelectorAll("input")].filter(a=>Ia(a)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(l=ro.get(i))==null||l()},ti={mounted(t,e){ro.set(t,e.value),t.addEventListener("keydown",Aa)},updated(t,e){ro.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",Aa),ro.delete(t)}};var it=(t=>(t.NotInStock="not_in_stock",t.OnOrder="on_order",t.LargeOrder="large_order",t.NextDayDelivery="next_day_delivery",t))(it||{});const xs={color:"#4b5563",backgroundColor:"#e5e7eb",textOnBackgroundColor:"#1f2937"},Oa=new Map([[H.OrderStatusEnum.New,{color:"#15803d",backgroundColor:"#bbf7d0",textOnBackgroundColor:"#166534"}],[H.OrderStatusEnum.Processing,{color:"#ea580c",backgroundColor:"#fed7aa",textOnBackgroundColor:"#9a3412"}],[H.OrderStatusEnum.AwaitingSupplyProducts,{color:"#ca8a04",backgroundColor:"#fef08a",textOnBackgroundColor:"#854d0e"}],[H.OrderStatusEnum.InvoiceIssued,{color:"#1d4ed8",backgroundColor:"#bfdbfe",textOnBackgroundColor:"#1e40af"}],[H.OrderStatusEnum.ProcessingOnStock,{color:"#0e7490",backgroundColor:"#a5f3fc",textOnBackgroundColor:"#155e75"}],[H.OrderStatusEnum.OrderUpdated,{color:"#6d28d9",backgroundColor:"#ddd6fe",textOnBackgroundColor:"#5b21b6"}],[H.OrderStatusEnum.Finished,{color:"#475569",backgroundColor:"#e2e8f0",textOnBackgroundColor:"#1e293b"}],[H.OrderStatusEnum.Canceled,{color:"#b91c1c",backgroundColor:"#fecaca",textOnBackgroundColor:"#991b1b"}],[H.OrderStatusEnum.Error,{color:"#991b1b",backgroundColor:"#fca5a5",textOnBackgroundColor:"#7f1d1d"}]]),bi=t=>Oa.get(t)??xs,za=t=>{const e=bi(t);return{color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}},Da=t=>{const e=bi(t);return{"--sc-order-status-color":e.color,"--sc-order-status-bg":e.backgroundColor,"--sc-order-status-text":e.textOnBackgroundColor}},ks=new Map([[it.NotInStock,{color:"#ef4444",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[it.OnOrder,{color:"#ca8a04",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[it.LargeOrder,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}],[it.NextDayDelivery,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}]]),La=new Map([[it.NotInStock,"Нет в наличии"],[it.OnOrder,"Под заказ"],[it.LargeOrder,"Крупный заказ"],[it.NextDayDelivery,"Доставка на завтра"]]),oo=[...ks.keys()],vr=t=>ks.get(t)??xs,Cs=t=>La.get(t)??t,vs=t=>{const e=[];return t.isNotInStock&&e.push(it.NotInStock),t.isOnOrder&&e.push(it.OnOrder),t.isLargeOrder&&e.push(it.LargeOrder),!A.isNil(t.delivery.date)&&ke.isTomorrow(new Date(t.delivery.date))&&e.push(it.NextDayDelivery),e};var Ve=(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))(Ve||{}),Xe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Xe||{});const Bm="(hover: hover) and (pointer: fine)",Ha=()=>{const t=A.isFunction(globalThis.matchMedia)?globalThis.matchMedia(Bm):void 0,e=n.ref(t?t.matches:!0),i=r=>{e.value=r.matches};return t==null||t.addEventListener("change",i),n.onScopeDispose(()=>{t==null||t.removeEventListener("change",i)},!0),n.readonly(e)};class _i{static isVnodeEmpty(e){return e.every(i=>i.type===n.Comment||i.type===n.Text&&A.isString(i.children)&&!i.children.trim()?!0:i.type===n.Fragment&&_i.isVnodeEmpty(i.children))}static hasSlotContent(e){return e?!_i.isVnodeEmpty(e()):!1}}const Nm={readAsFileData(t){return new Promise((e,i)=>{const r=new FileReader;r.addEventListener("load",()=>{e({name:t.name,content:r.result})}),r.addEventListener("error",()=>{i(new Error(`Не удалось прочитать файл «${t.name}».`))}),r.readAsDataURL(t)})}};class ni{static isDeleted(e){return!!(e.deletedAt&&!ke.isFuture(e.deletedAt))}static getFormatEntityName(e){return ni.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const lt=(t,e=!1)=>{const{key:i}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(i)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(i.toLowerCase()))){if(e&&i==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(i)||t.preventDefault()}},so=(t,e=".",i=!1)=>{const{key:r}=t,o=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())||i&&r==="-"&&!o.value.includes("-")&&((o.selectionStart??0)===0||o.value.length===0)||(r===e||r===(e==="."?",":"."))&&!o.value.includes(e)&&!o.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},ct=t=>t?Number.parseFloat(t.replace(",",".")):null,rt=(t,e)=>{t[e]={}},He=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class bt{static convertReferencesToOptionsList(e,i=!1,r=!1,o=!1,s=void 0,l=void 0){let a=e.map(c=>({label:s?s(c):ni.getFormatEntityName(c),value:c.id,item:c,disabled:l?l(c):!1}));return i&&(a=a.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>a.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...a]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(a,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=A.isString(r.key)?A.get(d,r.key):r.key(c),f=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(f)?"- Не определено -":f,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,i=!1,r=!1,o=!1,s=void 0,l=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,l)}static convertReferencesToAutocompleteOptionsList(e,i=!1,r=!1,o=!1,s=void 0,l=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,l)}}const Tm={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,i)=>i===null||Math.abs(i/t-Math.round(i/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},$m={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(t){return{validator:(e,i)=>i===null?!0:t?new Error(t):!0}}},Ss=t=>{var e;return((e=t.properties)==null?void 0:e.files)??[]},Wa=t=>{var e,i;return!!((e=t.properties)!=null&&e.description)||!!((i=t.properties)!=null&&i.specification)||Ss(t).length>0},Em={},Rm=n.defineComponent({...Em,__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 i=t,r=e,o=n.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},l=()=>{i.disableConfirm?s():o.value=!0};return(a,c)=>{const d=F.NButton,u=F.NPopover,f=F.NModal;return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:l},{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),n.createVNode(f,{show:o.value,"onUpdate:show":c[1]||(c[1]=h=>o.value=h),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:n.withCtx(()=>[n.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:n.withCtx(()=>[...c[2]||(c[2]=[n.createTextVNode(" Да ",-1)])]),_:1}),n.createVNode(d,{type:"default",onClick:c[0]||(c[0]=h=>o.value=!1)},{default:n.withCtx(()=>[...c[3]||(c[3]=[n.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),Pm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fm(t,e){return n.openBlock(),n.createElementBlock("svg",Pm,[...e[0]||(e[0]=[n.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),n.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),n.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Bs=n.markRaw({name:"ion-ellipsis-vertical-sharp",render:Fm}),Vm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mm(t,e){return n.openBlock(),n.createElementBlock("svg",Vm,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),n.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const ja=n.markRaw({name:"tabler-edit",render:Mm}),Im={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Am(t,e){return n.openBlock(),n.createElementBlock("svg",Im,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const qa=n.markRaw({name:"ion-checkmark-done-circle",render:Am}),Om={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zm(t,e){return n.openBlock(),n.createElementBlock("svg",Om,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Xa=n.markRaw({name:"ion-checkmark-done-circle-outline",render:zm}),Dm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Lm(t,e){return n.openBlock(),n.createElementBlock("svg",Dm,[...e[0]||(e[0]=[n.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 Hm=n.markRaw({name:"fluent-pin32-regular",render:Lm}),Wm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function jm(t,e){return n.openBlock(),n.createElementBlock("svg",Wm,[...e[0]||(e[0]=[n.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),n.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const qm=n.markRaw({name:"ion-eye-outline",render:jm}),Xm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Ym(t,e){return n.openBlock(),n.createElementBlock("svg",Xm,[...e[0]||(e[0]=[n.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 Km=n.markRaw({name:"fluent-pin32-filled",render:Ym}),Um={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gm(t,e){return n.openBlock(),n.createElementBlock("svg",Um,[...e[0]||(e[0]=[n.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 Zm=n.markRaw({name:"ion-bookmark-outline",render:Gm}),Qm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jm(t,e){return n.openBlock(),n.createElementBlock("svg",Qm,[...e[0]||(e[0]=[n.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),n.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 ep=n.markRaw({name:"ion-eye-off-sharp",render:Jm}),tp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function np(t,e){return n.openBlock(),n.createElementBlock("svg",tp,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const ip=n.markRaw({name:"ion-chevron-forward-outline",render:np}),rp=["data-name"],op={class:"sc-collapse-item-header flex flex-row gap-2.5"},sp={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},lp={key:0},ap={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},cp={class:"flex flex-1 flex-col"},dp={key:0,class:"sc-collapse-item-sub-title flex-1"},up={key:1,class:"sc-collapse-item-title-extra flex-none"},fp={key:0,class:"sc-collapse-item-content"},hp={},mp=n.defineComponent({...hp,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.inject("itemHeaderClickHandler",A.noop),l=n.inject("defaultExpandedNames",[]),a=n.inject("expandedNames",[]),c=A.some(l,g=>g===r.name),d=n.computed(()=>A.some(a,g=>g===r.name)),u=n.ref(c),f=()=>{r.disabled||(u.value=d.value||!u.value,o("header:click",r.name,u.value),s(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,o("header:click",r.name,u.value),s(r.name,u.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:n.readonly(u)}),(g,b)=>{const y=ip;return n.openBlock(),n.createElementBlock("div",{"data-name":t.name,class:n.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[n.createElementVNode("div",op,[n.createElementVNode("div",sp,[n.createElementVNode("div",{class:n.normalizeClass({"rotate-90":u.value}),onClick:f},[n.renderSlot(g.$slots,"arrow",{},()=>[n.createVNode(y)],!0)],2)]),n.unref(_i).hasSlotContent(g.$slots["pre-arrow"])?(n.openBlock(),n.createElementBlock("div",lp,[n.createElementVNode("div",ap,[n.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",cp,[n.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[n.renderSlot(g.$slots,"header",{},()=>[n.createTextVNode(n.toDisplayString(t.title),1)],!0)]),n.unref(_i).hasSlotContent(g.$slots["sub-header"])?(n.openBlock(),n.createElementBlock("div",dp,[n.renderSlot(g.$slots,"sub-header",{},void 0,!0)])):n.createCommentVNode("",!0)]),n.unref(_i).hasSlotContent(g.$slots["header-extra"])?(n.openBlock(),n.createElementBlock("div",up,[n.renderSlot(g.$slots,"header-extra",{},void 0,!0)])):n.createCommentVNode("",!0)]),n.createVNode(n.Transition,{name:"fade"},{default:n.withCtx(()=>[d.value||u.value?(n.openBlock(),n.createElementBlock("div",fp,[n.renderSlot(g.$slots,"default",{},void 0,!0)])):n.createCommentVNode("",!0)]),_:3})],10,rp)}}}),cn=(t,e)=>{const i=t.__vccOpts||t;for(const[r,o]of e)i[r]=o;return i},Ya=cn(mp,[["__scopeId","data-v-9f4b93c4"]]),pp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gp(t,e){return n.openBlock(),n.createElementBlock("svg",pp,[...e[0]||(e[0]=[n.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),n.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 Ka=n.markRaw({name:"ion-cart-outline",render:gp}),Sr=Symbol(),yp={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"}},bp={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},_p={},Ua=n.defineComponent({..._p,__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,i=n.inject(Sr,"medium"),r=Ha(),o=n.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=n.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),l=n.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=n.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),c=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},d=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},u=()=>{e.eventEmitter.emit("product:required",{product:e.product})},f=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var N;const p=Xa,g=qa,b=F.NButton,y=F.NTooltip,_=ja,k=Ka,x=Bs,v=F.NDropdown;return n.openBlock(),n.createElementBlock("div",bp,[l.value?(n.openBlock(),n.createBlock(y,{key:0,placement:"bottom",trigger:"hover",disabled:!n.unref(r)},{trigger:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),disabled:l.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:u},{default:n.withCtx(()=>[t.product.isRequired?(n.openBlock(),n.createBlock(g,{key:1})):(n.openBlock(),n.createBlock(p,{key:0}))]),_:1},8,["size","disabled","type"])]),default:n.withCtx(()=>[m[0]||(m[0]=n.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createBlock(y,{key:1,placement:"bottom",trigger:"hover",disabled:!n.unref(r)},{trigger:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),type:"primary",disabled:s.value==="disabled",onClick:d},{default:n.withCtx(()=>[n.createVNode(_)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[m[1]||(m[1]=n.createTextVNode(" Редактировать ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(y,{key:2,placement:"bottom",trigger:"hover",disabled:!n.unref(r)},{trigger:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),disabled:o.value==="disabled",type:"primary",onClick:c},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[m[2]||(m[2]=n.createTextVNode(" Добавить в корзину ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(n.openBlock(),n.createBlock(v,{key:3,options:a.value,size:n.unref(i),trigger:"click",onSelect:f},{default:n.withCtx(()=>[n.createVNode(b,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(x)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)])}}}),wp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xp(t,e){return n.openBlock(),n.createElementBlock("svg",wp,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.createElementVNode("path",{d:"M12 8v4l2 2"}),n.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const kp=n.markRaw({name:"tabler-history",render:xp}),Cp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vp(t,e){return n.openBlock(),n.createElementBlock("svg",Cp,[...e[0]||(e[0]=[n.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 Sp=n.markRaw({name:"mdi-percent-outline",render:vp}),Bp={class:"flex flex-row gap-1"},Np={key:0,class:"flex gap-1"},Tp={key:0,class:"flex text-nowrap text-sm line-through"},$p={key:1,class:"flex flex-row text-nowrap text-sm"},Ep={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Rp={},ii=n.defineComponent({...Rp,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCurrency:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var k;const e=t,i=n.computed(()=>"product"in e.product),r=n.computed(()=>"discount"in e.product&&e.product.discount?ni.getFormatEntityName(e.product.discount):""),o=n.computed(()=>"product"in e.product?e.product.product:e.product),s=n.computed(()=>e.showQuantityUnit?`${o.value.currency.symbol}/${o.value.unit.name}`:e.showCurrency?o.value.currency.symbol:""),l=n.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),a=n.computed(()=>A.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=n.computed(()=>{const x=A.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return a.value||!x||A.isNil(u.value)||A.isNil(x.cost)?!1:u.value<x.cost}),d=((k=H.useBaseConfigStateStore().getConfig())==null?void 0:k.defaultCurrency)??"RUB",u=n.computed(()=>a.value?a.value.cost:A.get(e.product,e.costFieldName)),f=n.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),h=n.computed(()=>o.value.costDate?ke.format(o.value.costDate,H.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),m=n.computed(()=>e.currencyRates||o.value.currency.signature===d?e.currencyRates:{[o.value.currency.signature]:o.value.costRub/o.value.cost}),p=n.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!A.isNil(u.value)),g=n.computed(()=>A.isNil(u.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value))),b=n.computed(()=>{if(o.value.currency.signature===d||!m.value||!m.value[o.value.currency.signature])return null;const x=m.value[o.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value)*x)}),y=n.computed(()=>A.isNil(f.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(f.value)),_=n.computed(()=>{if(!f.value||!u.value||f.value===u.value||u.value===0)return null;const x=(u.value-f.value)/f.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(x)});return(x,v)=>{var $;const N=F.NTag,w=F.NTooltip,T=Sp,C=kp;return n.openBlock(),n.createElementBlock("div",Bp,[t.showTag?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(N,{round:"",bordered:!1,size:"small",class:n.normalizeClass(["text-slate-600",{"font-bold":!a.value}])},{default:n.withCtx(()=>{var E;return[n.createTextVNode(n.toDisplayString(((E=a.value)==null?void 0:E.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:n.withCtx(()=>{var E;return[n.createTextVNode(" "+n.toDisplayString(((E=a.value)==null?void 0:E.coefficient.name)??"Розничная цена"),1)]}),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass({"!text-red-600":c.value})},[f.value&&f.value!==u.value||_.value?(n.openBlock(),n.createElementBlock("div",Np,[f.value&&f.value!==u.value?(n.openBlock(),n.createElementBlock("span",Tp,n.toDisplayString(y.value)+" "+n.toDisplayString(s.value),1)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":c.value}])}," ("+n.toDisplayString(_.value)+"%) ",3)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":($=a.value)==null?void 0:$.readOnly,"font-bold":!a.value&&!i.value}])},[n.createElementVNode("span",{class:n.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":p.value&&t.eventEmitter}),onClick:v[0]||(v[0]=()=>{var E;p.value&&((E=t.eventEmitter)==null||E.emit("cost:click",{product:o.value,cost:u.value}))})},n.toDisplayString(g.value),3),n.createTextVNode(" "+n.toDisplayString(s.value)+" ",1),u.value&&!a.value&&"discount"in t.product&&t.product.discount?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(T,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:n.withCtx(()=>[n.createElementVNode("span",null,' На продукт действует скидка "'+n.toDisplayString(r.value)+'"; ',1)]),_:1})):n.createCommentVNode("",!0)],2),b.value?(n.openBlock(),n.createElementBlock("span",$p," ~ "+n.toDisplayString(b.value)+" "+n.toDisplayString(l.value),1)):n.createCommentVNode("",!0),t.showCostDate&&!n.unref(A.isNil)(h.value)?(n.openBlock(),n.createElementBlock("span",Ep,[n.createTextVNode(n.toDisplayString(h.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(n.openBlock(),n.createBlock(w,{key:0,placement:"top-end"},{trigger:n.withCtx(()=>[n.createVNode(C,{class:"cursor-pointer",onClick:v[1]||(v[1]=E=>{var V;return(V=t.eventEmitter)==null?void 0:V.emit("cost:show-price-history",{product:o.value})})})]),default:n.withCtx(()=>[v[2]||(v[2]=n.createTextVNode(" История цен ",-1))]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2)])}}}),Pp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fp(t,e){return n.openBlock(),n.createElementBlock("svg",Pp,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),n.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const lo=n.markRaw({name:"ion-information-circle-outline",render:Fp}),Vp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Mp(t,e){return n.openBlock(),n.createElementBlock("svg",Vp,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Ga=n.markRaw({name:"ion-images",render:Mp}),Ip={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ap(t,e){return n.openBlock(),n.createElementBlock("svg",Ip,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56m0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26m48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32"},null,-1)])])}const Op=n.markRaw({name:"ion-information-circle",render:Ap}),zp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dp(t,e){return n.openBlock(),n.createElementBlock("svg",zp,[...e[0]||(e[0]=[n.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 Lp=n.markRaw({name:"ion-bookmark",render:Dp});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
38
38
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
39
39
|
PERFORMANCE OF THIS SOFTWARE.
|
|
40
|
-
***************************************************************************** */var co=function(){return co=Object.assign||function(e){for(var i,r=1,o=arguments.length;r<o;r++){i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},co.apply(this,arguments)},jp={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},On={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ns=500,qp=(function(){function t(e,i){return this.core=e,this.$LG=i,this.settings=co(co({},jp),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var i=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){i.isImageSlide(i.core.index)&&(i.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===i.core.index&&i.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(On.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var i=e.touches[0].pageX,r=e.touches[0].pageY;return{x:i,y:r}},t.prototype.getDragAllowedAxises=function(e,i){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),o=0,s=0,l=r.getBoundingClientRect();e?(o=r.offsetHeight*e,s=r.offsetWidth*e):i?(o=l.height+i*l.height,s=l.width+i*l.width):(o=l.height,s=l.width);var a=o>this.containerRect.height,c=s>this.containerRect.width;return{allowX:c,allowY:a}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,i,r,o){if(!(!this.containerRect||Math.abs(i)<=0)){var s=this.containerRect.width/2+this.containerRect.left,l=this.containerRect.height/2+this.containerRect.top+this.scrollTop,a,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,i),u=d.allowY,f=d.allowX;this.positionChanged&&(a=this.left/(this.scale-i),c=this.top/(this.scale-i),this.pageX=s-a,this.pageY=l-c,this.positionChanged=!1);var h=this.getPossibleSwipeDragCords(i),m,p,g=s-this.pageX,b=l-this.pageY;if(e-i>1){var y=(e-i)/Math.abs(i);g=(i<0?-g:g)+this.left*(y+(i<0?-1:1)),b=(i<0?-b:b)+this.top*(y+(i<0?-1:1)),m=g/y,p=b/y}else{var y=(e-i)*i;m=g*y,p=b*y}r&&(f?this.isBeyondPossibleLeft(m,h.minX)?m=h.minX:this.isBeyondPossibleRight(m,h.maxX)&&(m=h.maxX):e>1&&(m<h.minX?m=h.minX:m>h.maxX&&(m=h.maxX)),u?this.isBeyondPossibleTop(p,h.minY)?p=h.minY:this.isBeyondPossibleBottom(p,h.maxY)&&(p=h.maxY):e>1&&(p<h.minY?p=h.minY:p>h.maxY&&(p=h.maxY))),this.setZoomStyles({x:m,y:p,scale:e}),this.left=m,this.top=p,o&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var i=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,i.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),i.css("width","auto").css("height","auto"),setTimeout(function(){i.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,i=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(i.addClass("no-transition"),e.imageReset=!0)},Ns),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var o=e.getDragAllowedAxises(e.scale);i.css("width",i.get().naturalWidth+"px").css("height",i.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),o.allowX&&o.allowY?i.addClass("reset-transition"):o.allowX&&!o.allowY?i.addClass("reset-transition-x"):!o.allowX&&o.allowY&&i.addClass("reset-transition-y")}},Ns+50)},t.prototype.setZoomStyles=function(e){var i=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),o.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var s="translate3d("+e.x+"px, "+e.y+"px, 0)";i.css("transform",s)},t.prototype.setActualSize=function(e,i){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var o=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!o.src||r.core.outer.hasClass("lg-first-slide-loading"))){var s=r.getCurrentImageActualSizeScale(),l=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(s),r.setPageCords(i),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-l,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ns+110)}},t.prototype.getNaturalWidth=function(e){var i=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):i.get().naturalWidth},t.prototype.getActualSizeScale=function(e,i){var r,o;return e>=i?(r=e/i,o=r||2):o=1,o},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),i=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||i;return this.getActualSizeScale(r,i)},t.prototype.getPageCords=function(e){var i={};if(e)i.x=e.pageX||e.touches[0].pageX,i.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();i.x=r.width/2+r.left,i.y=r.height/2+this.scrollTop+r.top}return i},t.prototype.setPageCords=function(e){var i=this.getPageCords(e);this.pageX=i.x,this.pageY=i.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var i=this.getCurrentImageActualSizeScale();return e<1?e=1:e>i&&(e=i),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var i=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var o=e.$LG(r.target);r.touches.length===1&&o.hasClass("lg-image")&&(i?(clearTimeout(i),i=null,r.preventDefault(),e.setActualSize(e.core.index,r)):i=setTimeout(function(){i=null},300))}),this.core.LGel.on(On.containerResize+".zoom "+On.rotateRight+".zoom "+On.rotateLeft+".zoom "+On.flipHorizontal+".zoom "+On.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var o=e.scale-e.settings.scale;o<1&&(o=1),e.beginZoom(o),e.zoomImage(o,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(On.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(On.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(On.afterSlide+".zoom",function(r){var o=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(o),e.resetImageTranslate(o),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var i=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);i.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,i=0,r=!1,o=1,s=0,l=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(a){if(l=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&a.touches.length===2){if(a.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;o=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(a),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",i=e.getTouchDistance(a)}}),this.core.$inner.on("touchmove.lg",function(a){if(a.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(a.target).hasClass("lg-item")||l.get().contains(a.target))){a.preventDefault();var c=e.getTouchDistance(a),d=i-c;if(!r&&Math.abs(d)>5&&(r=!0),r){s=e.scale;var u=Math.max(1,o+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var f=e.scale-s;e.zoomImage(e.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(a){if(e.core.touchAction==="pinch"&&(e.$LG(a.target).hasClass("lg-item")||l.get().contains(a.target))){if(r=!1,i=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,i,r,o,s){var l=i.x-e.x,a=i.y-e.y,c=Math.abs(l)/s+1,d=Math.abs(a)/s+1;c>2&&(c+=1),d>2&&(d+=1),l=l*c,a=a*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),f={};f.x=this.left+l,f.y=this.top+a;var h=this.getPossibleSwipeDragCords();(Math.abs(l)>15||Math.abs(a)>15)&&(o&&(this.isBeyondPossibleTop(f.y,h.minY)?f.y=h.minY:this.isBeyondPossibleBottom(f.y,h.maxY)&&(f.y=h.maxY)),r&&(this.isBeyondPossibleLeft(f.x,h.minX)?f.x=h.minX:this.isBeyondPossibleRight(f.x,h.maxX)&&(f.x=h.maxX)),o?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(u,f),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,i,r,o,s){var l={};if(o){if(l.y=this.top+(i.y-e.y),this.isBeyondPossibleTop(l.y,s.minY)){var a=s.minY-l.y;l.y=s.minY-a/6}else if(this.isBeyondPossibleBottom(l.y,s.maxY)){var c=l.y-s.maxY;l.y=s.maxY+c/6}}else l.y=this.top;if(r){if(l.x=this.left+(i.x-e.x),this.isBeyondPossibleLeft(l.x,s.minX)){var d=s.minX-l.x;l.x=s.minX-d/6}else if(this.isBeyondPossibleRight(l.x,s.maxX)){var u=l.x-s.maxX;l.x=s.maxX+u/6}}else l.x=this.left;return l},t.prototype.isBeyondPossibleLeft=function(e,i){return e>=i},t.prototype.isBeyondPossibleRight=function(e,i){return e<=i},t.prototype.isBeyondPossibleTop=function(e,i){return e>=i},t.prototype.isBeyondPossibleBottom=function(e,i){return e<=i},t.prototype.isImageSlide=function(e){var i=this.core.galleryItems[e];return this.core.getSlideType(i)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var i=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,o=i.get().getBoundingClientRect(),s=o.height,l=o.width;e&&(s=s+e*s,l=l+e*l);var a=(s-this.containerRect.height)/2,c=(this.containerRect.height-s)/2+r,d=(l-this.containerRect.width)/2,u=(this.containerRect.width-l)/2,f={minY:a,maxY:c,minX:d,maxX:u};return f},t.prototype.setZoomSwipeStyles=function(e,i){e.css("transform","translate3d("+i.x+"px, "+i.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,i={},r={},o=!1,s=!1,l=!1,a=new Date,c=new Date,d,u,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(h){if(e.isImageSlide(e.core.index)&&(f=e.core.getSlideItem(e.core.index),(e.$LG(h.target).hasClass("lg-item")||f.get().contains(h.target))&&h.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){h.preventDefault(),a=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);l=m.allowY,s=m.allowX,(s||l)&&(i=e.getSwipeCords(h)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(h){if(h.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(h.target).hasClass("lg-item")||f.get().contains(h.target))){h.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(h);var m=e.getZoomSwipeCords(i,r,s,l,d);(Math.abs(r.x-i.x)>15||Math.abs(r.y-i.y)>15)&&(o=!0,e.setZoomSwipeStyles(u,m))}}),this.core.$inner.on("touchend.lg",function(h){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(h.target).hasClass("lg-item")||f.get().contains(h.target))){if(h.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!o)return;o=!1,c=new Date;var m=c.valueOf()-a.valueOf();e.touchendZoom(i,r,s,l,m)}})},t.prototype.zoomDrag=function(){var e=this,i={},r={},o=!1,s=!1,l=!1,a=!1,c,d,u,f;this.core.outer.on("mousedown.lg.zoom",function(h){if(e.isImageSlide(e.core.index)){var m=e.core.getSlideItem(e.core.index);if(e.$LG(h.target).hasClass("lg-item")||m.get().contains(h.target)){c=new Date,f=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var p=e.getDragAllowedAxises(0);a=p.allowY,l=p.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(h.target).hasClass("lg-object")&&(l||a)&&(h.preventDefault(),i=e.getDragCords(h),u=e.getPossibleSwipeDragCords(),o=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(h){if(o){s=!0,r=e.getDragCords(h);var m=e.getZoomSwipeCords(i,r,l,a,u);e.setZoomSwipeStyles(f,m)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(h){if(o){if(d=new Date,o=!1,e.core.outer.removeClass("lg-zoom-dragging"),s&&(i.x!==r.x||i.y!==r.y)){r=e.getDragCords(h);var m=d.valueOf()-c.valueOf();e.touchendZoom(i,r,l,a,m)}s=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Xp={ref:"gallery-container",class:"lightgallery-wrapper"},Yp={},Za=n.defineComponent({...Yp,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,i={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=n.useTemplateRef("gallery-container"),o=n.ref(null);return n.onMounted(async()=>{if(!r.value)return;const s=await import("lightgallery");o.value=s.default(r.value,{...e.settings}),A.forOwn(i,(l,a)=>{var c;l&&((c=r.value)==null||c.addEventListener(a,l))})}),n.onBeforeUnmount(()=>{var s;o.value&&((s=o.value)==null||s.destroy(),o.value=null)}),(s,l)=>(n.openBlock(),n.createElementBlock("div",Xp,[n.renderSlot(s.$slots,"default")],512))}}),yt=class yt{static init(){yt.isInitialized||(yt.isInitialized=!0,yt.windowResizeHandler(),window.addEventListener("resize",yt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",yt.windowResizeHandler),yt.isInitialized=!1}static getDeviceTypeByResolution(){const e=H.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Xe.phone:window.innerWidth<e.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(e,i,r){const o=n.ref(r);return yt.setRefValueDependingOnDeviceResolution(o,e,i,r),yt.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:i,defaultValue:r}),o}static isPhoneDevice(){return yt.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return yt.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return yt.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(e,i,r,o){switch(yt.getDeviceTypeByResolution()){case Xe.phone:e.value=i;break;case Xe.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){A.forEach(yt.refsDependingOnDeviceResolution,e=>{yt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};B(yt,"isInitialized",!1),B(yt,"refsDependingOnDeviceResolution",[]);let Ye=yt;const Up=["href"],Kp=["src","alt"],Gp={},Qa=n.defineComponent({...Gp,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const i=n.ref(!1),r=n.ref(!1),o=n.ref({plugins:[Wp,qp],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(Ye.getDeviceTypeByResolution()===Xe.phone?.7:.8),l=n.ref(s()),a=()=>{l.value=s()},c=()=>{i.value=!0};return n.onUnmounted(()=>{window.removeEventListener("resize",a)}),e({show:c}),window.addEventListener("resize",a),(d,u)=>{const f=Ga,h=F.NPopover;return n.openBlock(),n.createBlock(h,{trigger:"manual",show:i.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(i.value=!1)})},{trigger:n.withCtx(()=>[n.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=m=>i.value=!i.value)},[n.renderSlot(d.$slots,"default",{},()=>[n.createVNode(f)])])]),default:n.withCtx(()=>[n.createVNode(Za,{settings:o.value,style:n.normalizeStyle(`max-width: ${l.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,i.value=!1})},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.images,(m,p)=>(n.openBlock(),n.createElementBlock("a",{key:p,href:m.image},[n.createElementVNode("img",{src:m.preview,alt:`Изображение #${p+1}`},null,8,Kp)],8,Up))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Zp={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},Qp={class:"pr-3"},Jp={class:"text-right"},eg={},tg=n.defineComponent({...eg,__name:"product-stock-count",props:{product:{}},setup(t){return(e,i)=>{const r=lo,o=F.NPopover;return n.openBlock(),n.createBlock(o,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:n.withCtx(()=>[n.renderSlot(e.$slots,"default",{},()=>[n.createVNode(r)])]),default:n.withCtx(()=>[n.createElementVNode("div",Zp,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.product.stockCount,(s,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:l},[n.createElementVNode("span",Qp,n.toDisplayString(s.warehouse.name),1),n.createElementVNode("span",Jp,[n.createTextVNode(n.toDisplayString(s.count??"В наличии")+" ",1),s.count?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.product.unit.name),1)],64)):n.createCommentVNode("",!0)])],64))),128))])]),_:3})}}}),ng=["innerHTML"],ig=["innerHTML"],rg={class:"m-0 flex list-none flex-col gap-1 p-0 text-sm"},og=["href"],sg={key:1,class:"text-sm text-gray-500"},lg={},Ts=n.defineComponent({...lg,__name:"product-info-content",props:{product:{},size:{default:"medium"},maxHeight:{default:void 0},activeTab:{default:void 0}},setup(t){const e=t,i=n.computed(()=>e.maxHeight?{maxHeight:e.maxHeight}:void 0),r=n.computed(()=>{var c;return((c=e.product.properties)==null?void 0:c.description)??""}),o=n.computed(()=>{var c;return((c=e.product.properties)==null?void 0:c.specification)??""}),s=n.computed(()=>Ss(e.product)),l=n.computed(()=>[r.value?"description":null,o.value?"specification":null,s.value.length>0?"files":null].filter(c=>c!==null)),a=n.ref(e.activeTab&&l.value.includes(e.activeTab)?e.activeTab:l.value[0]);return(c,d)=>{const u=F.NScrollbar,f=F.NTabPane,h=F.NTabs;return l.value.length>0?(n.openBlock(),n.createBlock(h,{key:0,value:a.value,"onUpdate:value":d[0]||(d[0]=m=>a.value=m),size:t.size,type:"line",class:"sc-product-info-content"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(f,{key:0,name:"description",tab:"Описание"},{default:n.withCtx(()=>[n.createVNode(u,{style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"sc-product-info-html",innerHTML:r.value},null,8,ng)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(f,{key:1,name:"specification",tab:"Характеристики"},{default:n.withCtx(()=>[n.createVNode(u,{style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"sc-product-info-html",innerHTML:o.value},null,8,ig)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),s.value.length>0?(n.openBlock(),n.createBlock(f,{key:2,name:"files",tab:`Файлы (${s.value.length})`},{default:n.withCtx(()=>[n.createVNode(u,{style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[n.createElementVNode("ul",rg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,m=>(n.openBlock(),n.createElementBlock("li",{key:m.id},[n.createElementVNode("a",{href:m.url,target:"_blank",rel:"noopener"},n.toDisplayString(m.typeName),9,og)]))),128))])]),_:1},8,["style"])]),_:1},8,["tab"])):n.createCommentVNode("",!0)]),_:1},8,["value","size"])):(n.openBlock(),n.createElementBlock("span",sg," Описание, характеристики и файлы не заданы. "))}}}),ag={key:0,class:"flex flex-row gap-2.5"},cg={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},dg={},$s=n.defineComponent({...dg,__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:i}){const r=t,o=i,s=n.ref(r.show),l=n.ref(r.processing),a=Ye.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=Ye.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=n.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{o("opening"),s.value=!0,o("update:show",s.value)},f=(m="other",p=!1)=>{if(l.value&&!p){o("processing:cancel",_=>{l.value=_});return}let g=!1;o("closing",m,()=>{g=!0}),g||(s.value=!1,o("update:show",s.value))},h=()=>{o("accept",p=>{l.value=p})};return n.watch(()=>r.show,m=>{m?u():f("other",!0)}),n.watch(()=>r.processing,m=>{l.value=m}),e({open:u,close:f,acceptHandler:h}),(m,p)=>{const g=F.NButton,b=F.NModal;return n.openBlock(),n.createBlock(b,{loading:l.value,show:s.value,"show-icon":!1,size:n.unref(a),style:n.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":m.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:p[1]||(p[1]=y=>f("header")),onEsc:p[2]||(p[2]=y=>f("esc")),onMaskClick:p[3]||(p[3]=y=>f("mask"))},n.createSlots({default:n.withCtx(()=>[n.renderSlot(m.$slots,"default")]),_:2},[m.$slots.header?{name:"header",fn:n.withCtx(()=>[n.renderSlot(m.$slots,"header")]),key:"0"}:void 0,m.$slots.action||m.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:n.withCtx(()=>[m.$slots["extra-action"]?(n.openBlock(),n.createElementBlock("div",ag,[n.renderSlot(m.$slots,"extra-action")])):n.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(n.openBlock(),n.createElementBlock("div",cg,[n.renderSlot(m.$slots,"action",{disabled:l.value}),t.acceptButton.show??!0?(n.openBlock(),n.createBlock(g,{key:0,disabled:l.value||!t.valid,loading:l.value,size:n.unref(a),type:"primary",onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","loading","size"])):n.createCommentVNode("",!0),t.cancelButton.show??!0?(n.openBlock(),n.createBlock(g,{key:1,disabled:l.value,size:n.unref(a),type:"default",onClick:p[0]||(p[0]=y=>f("footer"))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["disabled","size"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),ug={class:"flex flex-col gap-3"},fg={class:"text-xs text-gray-500"},hg={},Ja=n.defineComponent({...hg,__name:"product-info-dialog",props:{product:{},show:{type:Boolean,default:!1},activeTab:{default:void 0}},emits:["update:show"],setup(t,{emit:e}){const i=e,r=()=>{i("update:show",!1)};return(o,s)=>(n.openBlock(),n.createBlock($s,{show:t.show,title:t.product.name,"accept-button":{show:!1},"cancel-button":{show:!0,text:"Закрыть"},"trap-focus":!1,onClosing:r},{default:n.withCtx(()=>[n.createElementVNode("div",ug,[n.createElementVNode("span",fg,"Артикул: "+n.toDisplayString(t.product.code),1),n.createVNode(Ts,{product:t.product,"active-tab":t.activeTab,"max-height":"60vh"},null,8,["product","active-tab"])])]),_:1},8,["show","title"]))}}),mg={class:"flex flex-col gap-2"},pg={class:"flex justify-end border-0 border-t border-solid border-gray-200 pt-2"},gg={},ec=n.defineComponent({...gg,__name:"product-info-popover",props:{product:{}},setup(t){const e=n.ref(!1),i=n.ref(!1),r=n.ref(!1),o=()=>{e.value=!1,i.value=!0,r.value=!0};return(s,l)=>{const a=lo,c=F.NButton,d=F.NPopover;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,{show:e.value,"onUpdate:show":l[0]||(l[0]=u=>e.value=u),width:560,style:{maxWidth:"calc(100vw - 2rem)"},trigger:"click",placement:"bottom-start",class:"sc-product-info-popover"},{trigger:n.withCtx(()=>[n.renderSlot(s.$slots,"default",{},()=>[n.createVNode(a,{title:"Описание и характеристики",class:"cursor-pointer"})])]),default:n.withCtx(()=>[n.createElementVNode("div",mg,[n.createVNode(Ts,{product:t.product,size:"small","max-height":"16rem"},null,8,["product"]),n.createElementVNode("div",pg,[n.createVNode(c,{text:"",type:"info",size:"small",onClick:o},{default:n.withCtx(()=>[...l[2]||(l[2]=[n.createTextVNode(" Открыть полностью ",-1)])]),_:1})])])]),_:3},8,["show"]),i.value?(n.openBlock(),n.createBlock(Ja,{key:0,show:r.value,"onUpdate:show":l[1]||(l[1]=u=>r.value=u),product:t.product},null,8,["show","product"])):n.createCommentVNode("",!0)],64)}}}),yg={class:"flex flex-row justify-between"},bg={key:0,class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},_g={key:1},wg={class:"ml-2 align-sub"},xg={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},kg={key:2,class:"ml-2 align-sub"},Cg={class:"@container"},vg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},Sg={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Bg={class:"text-sc-dark-grey"},Ng={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Tg={class:"text-gray-600"},$g={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Eg={key:3,class:"underline decoration-dashed"},Rg={key:4,class:"sc-product-pack whitespace-nowrap"},Pg={class:"text-gray-600"},Fg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Vg={class:"text-gray-600"},Mg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Ig={key:0},Ag={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Og={},Nr=n.defineComponent({...Og,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showAdditionalSaleIcon:{type:Boolean,default:!1},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const i=t,r=n.computed(()=>A.isFunction(i.showProductCosts)?i.showProductCosts(i.product):i.showProductCosts),o=n.computed(()=>A.sortBy(i.product.priceCoefficients,["coefficient.slug"])),s=n.computed(()=>{var h,m;return(m=(h=i.product)==null?void 0:h.properties)==null?void 0:m.planingIncomingDate}),l=n.useTemplateRef("image-gallery"),a=()=>{var h;(h=l.value)==null||h.show()},c=n.computed(()=>A.isFunction(i.allowNameClick)?i.allowNameClick(i.product):i.allowNameClick),d=n.computed(()=>(A.isFunction(i.showProductInfoButton)?i.showProductInfoButton(i.product):i.showProductInfoButton)&&Wa(i.product)),u=n.computed(()=>{var h;return i.showProductAddToCartButton||i.showProductEditButton||i.showProductRequiredButton||(((h=i.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),f=()=>{var h;c.value&&((h=i.eventEmitter)==null||h.emit("product:name-click",{product:i.product,exposedMethods:{showProductImagesPreview:a}}))};return e({showProductImagesPreview:a}),(h,m)=>{var w,T,C,$;const p=Lp,g=F.NTooltip,b=Ua,y=Op,_=Ga,k=F.NText,x=Ka,v=lo,N=F.NScrollbar;return n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",yg,[n.createVNode(k,{type:"info",class:"sc-product-name text-balance text-base font-medium text-black"},{default:n.withCtx(()=>{var E,V,P,I;return[(E=t.product)!=null&&E.isFavorite||(V=t.product)!=null&&V.isPreviouslyOrdered||t.showAdditionalSaleIcon?(n.openBlock(),n.createElementBlock("div",bg,[((P=t.product)==null?void 0:P.isFavorite)??!1?(n.openBlock(),n.createBlock(g,{key:0,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(p,{class:"!text-yellow-300"})]),default:n.withCtx(()=>[m[0]||(m[0]=n.createTextVNode(" Избранный товар ",-1))]),_:1})):n.createCommentVNode("",!0),((I=t.product)==null?void 0:I.isPreviouslyOrdered)??!1?(n.openBlock(),n.createBlock(g,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(b,{class:"!text-green-700"})]),default:n.withCtx(()=>[m[1]||(m[1]=n.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):n.createCommentVNode("",!0),t.showAdditionalSaleIcon?(n.openBlock(),n.createBlock(g,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(y,{class:"!text-green-500"})]),default:n.withCtx(()=>[m[2]||(m[2]=n.createTextVNode(" Дополнительная продажа ",-1))]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:f},n.toDisplayString(t.product.name),3),t.product.onOrder?(n.openBlock(),n.createElementBlock("span",_g," [Под заказ] ")):n.createCommentVNode("",!0),n.createElementVNode("span",wg,[t.product.images&&t.product.images.length>0?(n.openBlock(),n.createBlock(Qa,{key:0,ref:"image-gallery",images:t.product.images},{default:n.withCtx(()=>[n.createElementVNode("div",xg,[n.createVNode(_)])]),_:1},8,["images"])):n.createCommentVNode("",!0)]),d.value?(n.openBlock(),n.createElementBlock("span",kg,[n.createVNode(ec,{product:t.product},null,8,["product"])])):n.createCommentVNode("",!0)]}),_:1}),u.value?(n.openBlock(),n.createBlock(x,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Cg,[n.createElementVNode("div",vg,[t.product.supplierSku?(n.openBlock(),n.createElementBlock("div",Sg,[m[3]||(m[3]=n.createTextVNode(" Артикул производителя/поставщика: ",-1)),n.createElementVNode("span",Bg,n.toDisplayString(t.product.supplierSku),1)])):n.createCommentVNode("",!0),t.showCode?(n.openBlock(),n.createElementBlock("span",Ng,[m[4]||(m[4]=n.createTextVNode(" Артикул: ",-1)),n.createElementVNode("span",Tg,n.toDisplayString(t.product.code),1)])):n.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(n.openBlock(),n.createBlock(tg,{key:2,product:t.product},{default:n.withCtx(()=>[n.createElementVNode("span",$g,[m[5]||(m[5]=n.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),n.createVNode(v,{class:"mt-0.5"})])]),_:1},8,["product"])):(n.openBlock(),n.createElementBlock("span",Eg," Нет в наличии ")),t.product.pack??((T=(w=t.product)==null?void 0:w.properties)==null?void 0:T.pack)?(n.openBlock(),n.createElementBlock("span",Rg,[m[6]||(m[6]=n.createTextVNode(" Норма упаковки: ",-1)),n.createElementVNode("span",Pg,n.toDisplayString(t.product.pack??(($=(C=t.product)==null?void 0:C.properties)==null?void 0:$.pack)),1)])):n.createCommentVNode("",!0),t.showPlanningDates&&s.value?(n.openBlock(),n.createElementBlock("span",Fg,[m[7]||(m[7]=n.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),n.createElementVNode("span",Vg,n.toDisplayString(s.value),1)])):n.createCommentVNode("",!0)])]),n.createVNode(N,{"x-scrollable":""},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",Mg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,E=>(n.openBlock(),n.createBlock(ii,{key:E.coefficient.slug,product:t.product,"cost-field-name":E.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),n.createVNode(ii,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):n.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(n.openBlock(),n.createElementBlock("div",Ig,[n.createElementVNode("ul",Ag,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.product.id,slug:t.product.slug},(E,V)=>(n.openBlock(),n.createElementBlock("li",{key:V}," ("+n.toDisplayString(V)+"): "+n.toDisplayString(E),1))),128)):n.createCommentVNode("",!0),t.showProperties?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(t.product.properties,(E,V)=>(n.openBlock(),n.createElementBlock("li",{key:V}," ("+n.toDisplayString(V)+"): "+n.toDisplayString(E),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)])}}}),zg=(t,e,i)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>n.h(ii,{product:r,costFieldName:t,eventEmitter:i.eventEmitter,allowPriceClick:i.allowPriceClick,currencyRates:i.currencyRates})}),Dg=(t,e)=>{if(t.length===0)return[];const i=[],r={};switch(A.isNil(e.isProductItemSelected)||i.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,l;return n.h(F.NCheckbox,{checked:!!((s=e.isProductItemSelected)!=null&&s.call(e,o)),disabled:((l=e.isProductItemSelected)==null?void 0:l.call(e,o))==="disabled",onUpdateChecked:a=>{e.eventEmitter.emit("product:checked",{product:o,checked:a})}})}}),Ye.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:i.push({key:"name",title:"Наименование",className:"align-top",render:o=>n.h(Nr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductInfoButton:e.showProductInfoButton,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:i.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:o=>n.h(Nr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductInfoButton:e.showProductInfoButton,currencyRates:e.currencyRates})}),e.showProductCosts&&(A.forEach(t,o=>{A.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),A.forEach(A.sortBy(r,["slug"]),o=>{i.push(zg(o.slug??"",o.name,e))}),i.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:o=>n.h(ii,{product:o,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!A.isNil(e.productContextButtonsConfig))&&i.push({key:"actions",title:"",className:"align-top",width:"50",render:o=>n.h(Ka,{product:o,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return i},Lg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hg(t,e){return n.openBlock(),n.createElementBlock("svg",Lg,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),n.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const uo=n.markRaw({name:"ion-trash",render:Hg}),Wg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function jg(t,e){return n.openBlock(),n.createElementBlock("svg",Wg,[...e[0]||(e[0]=[n.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const tc=n.markRaw({name:"ion-plus",render:jg}),qg={key:0,class:"flex w-fit items-center gap-2"},Xg={key:1,class:"flex flex-wrap gap-1"},Yg={key:0},Ug={key:2},Kg={},Tr=n.defineComponent({...Kg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,i=n.computed(()=>{var r,o;return(o=(r=e.product)==null?void 0:r.properties)==null?void 0:o.planingProductionDate});return(r,o)=>{const s=F.NSpin,l=F.NText;return t.isProductSearching?(n.openBlock(),n.createElementBlock("div",qg,[n.createVNode(s,{size:17,class:"w-fit"}),o[0]||(o[0]=n.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(n.openBlock(),n.createElementBlock("div",Xg,[n.createElementVNode("div",null,n.toDisplayString(t.product.code)+" - "+n.toDisplayString(t.product.name)+" - "+n.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+n.toDisplayString(t.product.unit.name),1),i.value?(n.openBlock(),n.createElementBlock("div",Yg,"(Планируемая дата производства: "+n.toDisplayString(i.value)+")",1)):n.createCommentVNode("",!0)])):t.validation?(n.openBlock(),n.createElementBlock("div",Ug,[n.createVNode(l,{type:t.validation.validationStatus},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):n.createCommentVNode("",!0)}}}),Gg={class:"flex flex-col gap-4"},Zg={class:"flex flex-col gap-2"},Qg={class:"mt-8 font-bold"},Jg={class:"grid grow grid-cols-2 items-start gap-2"},ey={key:2,class:"text-red-500 text-sm"},ty={key:3,class:"text-red-500 text-sm mb-2"},ny={class:"flex flex-col gap-4"},iy={key:1},ry={class:"text-lg font-semibold"},oy={class:"flex gap-3"},sy={},ly=n.defineComponent({...sy,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:i}){var b;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.ref(!1),a=n.ref(A.cloneDeep(r.value)),c=n.computed(()=>{var _,k,x;const y={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation((k=r.validation.quantity)==null?void 0:k.feedback)],marker:[We.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return A.forEach(a.value.configuratorParams.linesWidths,(v,N)=>{var C;const T=a.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(T),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((C=r.validation[`lines_widths[${N+1}]`])==null?void 0:C.feedback)]}),A.forEach(a.value.configuratorParams.linesAngles,(v,N)=>{var w;y[`configuratorParams.linesAngles.${N}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${N+1}]`])==null?void 0:w.feedback)]}),y}),d=n.ref(r.settings.canSetDopProdaga??!1),u=n.computed(()=>{var v;const{length:y}=a.value.configuratorParams,{quantity:_}=a.value,k=((v=a.value.product)==null?void 0:v.costRub)||0;if(!y||!_||k===0)return null;const x=y/1e3;return(k*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),f=n.computed(()=>A.reduce(a.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),h=n.computed(()=>{const y=f.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),m=n.computed(()=>{const{configuratorParams:y}=a.value,_=A.every(y.linesWidths,N=>!!(N&&N>0)),k=A.every(y.linesAngles,N=>!A.isNil(N)),x=!!(a.value.quantity&&a.value.quantity>0),v=y.length>0&&y.length>0;return _&&k&&x&&v&&h.value}),p=()=>{n.nextTick(()=>{var y;(y=s.value)==null||y.validate(_=>{_||(o("update:params",a.value.configuratorParams),g("configuratorParams",a.value.configuratorParams))}).catch(A.noop)})},g=(y,_)=>{const k=new H.OrderItemBase(a.value);k[y]=_,y==="configuratorParams"&&(k.product=new H.ClientProduct),o("update:value",k)};return n.watch(()=>r.previewParams,y=>{a.value.configuratorParams.linesWidths=y.linesWidths,a.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),n.watch(()=>r.value,y=>{a.value=A.cloneDeep(y)},{deep:!0}),e({validate:(b=s.value)==null?void 0:b.validate,formReference:s}),(y,_)=>{const k=tc,x=uo,v=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:a.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var N;return[n.createElementVNode("div",Gg,[_[21]||(_[21]=n.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(n.openBlock(),n.createBlock(n.unref(F.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:a.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>a.value.configuratorParams.startTailType=w),p],options:t.settings.startTailConfigs.map(({label:w},T)=>({label:w,value:T})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Zg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.configuratorParams.linesAngles,(w,T)=>(n.openBlock(),n.createElementBlock("div",{key:T,class:"flex items-start gap-2"},[n.createElementVNode("div",Qg,n.toDisplayString(T+1),1),n.createElementVNode("div",Jg,[n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.linesWidths.${T}`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.linesWidths[T],"onUpdate:value":[C=>a.value.configuratorParams.linesWidths[T]=C,_[2]||(_[2]=C=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=C=>n.unref(lt)(C)),onInput:C=>n.unref(rt)(t.validation,`lines_widths[${T+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.linesAngles.${T}`,label:"Угол сгиба, °"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.linesAngles[T],"onUpdate:value":[C=>a.value.configuratorParams.linesAngles[T]=C,_[4]||(_[4]=C=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=C=>n.unref(lt)(C,!0)),onInput:C=>n.unref(rt)(t.validation,`lines_angles[${T+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(F.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:n.withCtx(()=>[t.settings.showOnlyTemplates?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,size:"medium",onClick:C=>o("click:add-line",T)},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:1,disabled:a.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:C=>o("click:remove-line",T)},{default:n.withCtx(()=>[n.createVNode(x)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(n.openBlock(),n.createBlock(n.unref(F.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:a.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>a.value.configuratorParams.endTailType=w),p],options:t.settings.endTailConfigs.map(({label:w},T)=>({label:w,value:T})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:a.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),h.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ey," Суммарная ширина участков гиба должна быть от "+n.toDisplayString(t.settings.stripMinWidth)+" до "+n.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+n.toDisplayString(f.value)+" мм. ",1)),m.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ty," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((N=t.settings.allTemplates)==null?void 0:N.length)-1?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:4,type:"tertiary",class:"self-start",loading:l.value,onClick:_[6]||(_[6]=w=>o("click:save-template"))},{default:n.withCtx(()=>[..._[20]||(_[20]=[n.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",ny,[n.createVNode(n.unref(F.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:a.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>a.value.configuratorParams.colorSide=w),p],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>a.value.configuratorParams.length=w),_[11]||(_[11]=w=>p())],parse:n.unref(ct),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>n.unref(lt)(w)),onInput:_[10]||(_[10]=w=>n.unref(rt)(t.validation,"length")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>a.value.quantity=w),_[15]||(_[15]=w=>g("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>n.unref(lt)(w,!1)),onInput:_[14]||(_[14]=w=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:a.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{a.value.marker=w??null,g("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(v,{key:0,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{a.value.isAdditionalSale=w??!1,g("isAdditionalSale",w??!1)})},{default:n.withCtx(()=>[..._[22]||(_[22]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),u.value?(n.openBlock(),n.createElementBlock("div",iy,[_[23]||(_[23]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",ry,n.toDisplayString(u.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",oy,[n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||a.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>o("submit",a.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",a.value)]])}}}),nc=wn(ly,[["__scopeId","data-v-ac7f1192"]]);var ic=Object.defineProperty,ay=Object.defineProperties,cy=Object.getOwnPropertyDescriptors,rc=Object.getOwnPropertySymbols,dy=Object.prototype.hasOwnProperty,uy=Object.prototype.propertyIsEnumerable,oc=t=>{throw TypeError(t)},Es=(t,e,i)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$r=(t,e)=>{for(var i in e||(e={}))dy.call(e,i)&&Es(t,i,e[i]);if(rc)for(var i of rc(e))uy.call(e,i)&&Es(t,i,e[i]);return t},Rs=(t,e)=>ay(t,cy(e)),sc=(t,e)=>{for(var i in e)ic(t,i,{get:e[i],enumerable:!0})},S=(t,e,i)=>Es(t,typeof e!="symbol"?e+"":e,i),lc=(t,e,i)=>e.has(t)||oc("Cannot "+i),Dt=(t,e,i)=>(lc(t,e,"read from private field"),i?i.call(t):e.get(t)),ac=(t,e,i)=>e.has(t)?oc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),fy=(t,e,i,r)=>(lc(t,e,"write to private field"),e.set(t,i),i),Pt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(i){return this[i]},t.setAttribute=function(i,r){return this[i]=r,this},t},polyfill:function(t,e){return Pt.shim(t),typeof e<"u"&&(Pt.Image=e),Pt.isHeadless=!0,t}},cc={};sc(cc,{Curve:()=>Zi,getAnchorsFromArcData:()=>py,getComponentOnCubicBezier:()=>Er,getControlPoints:()=>wc,getCurveBoundingBox:()=>yc,getCurveFromPoints:()=>_c,getCurveLength:()=>gc,getReflection:()=>Ms,integrate:()=>bc,subdivide:()=>Vs});var dc={};sc(dc,{HALF_PI:()=>dt,NumArray:()=>xn,TWO_PI:()=>tt,decomposeMatrix:()=>wi,getComputedMatrix:()=>Ps,getEffectiveStrokeWidth:()=>kn,getPoT:()=>hc,lerp:()=>Ft,mod:()=>ot,setMatrix:()=>fc,toFixed:()=>ze});var Ke;typeof window<"u"?Ke=window:typeof global<"u"?Ke=global:typeof self<"u"&&(Ke=self);var uc,tt=Math.PI*2,dt=Math.PI*.5;function wi(t,e,i,r,o,s){let l;return arguments.length<=1?(l=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):l=t,{translateX:o,translateY:s,scaleX:Math.sqrt(l*l+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,l)/Math.PI}}function fc(t){uc=t}function Ps(t,e){e=e&&e.identity()||new uc;let i=t;const r=[];for(;i&&i._matrix;)r.push(i._matrix),i=i.parent;r.reverse();for(let o=0;o<r.length;o++){const l=r[o].elements;e.multiply(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8])}return e}function Ft(t,e,i){return i*(e-t)+t}var Fs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function hc(t){let e=0;for(;Fs[e]&&Fs[e]<t;)e++;return Fs[e]}function ot(t,e){for(;t<0;)t+=e;return t%e}var xn=Ke.Float32Array||Array,hy=Math.floor;function ze(t){return hy(t*1e6)/1e6}function kn(t,e){const i=t._linewidth;if(t.strokeAttenuation)return i;e||(e=t.worldMatrix||Ps(t));const r=wi(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),o=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return o>0?i/o:i}var ie={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},ee=class{constructor(){S(this,"_events",{}),S(this,"_bound",!1)}addEventListener(e,i){return(this._events[e]||(this._events[e]=[])).push(i),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,i){if(!this._events)return this;if(!e&&!i)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let l=this._events[e];if(l){let a=[];if(i)for(let c=0,d=l.length;c<d;c++){let u=l[c];u=u.handler?u.handler:u,i!==u&&a.push(u)}this._events[e]=a}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const i=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...i);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,i,r){const o=this;e&&(s.obj=e,s.name=i,s.handler=r,e.on(i,s));function s(){r.apply(o,arguments)}return o}ignore(e,i,r){return e.off(i,r),this}};S(ee,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(ee,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var mc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ee.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},cn=class _r extends ee{constructor(e=0,i=0){super(),S(this,"_x",0),S(this,"_y",0);for(let r in mc)Object.defineProperty(this,r,mc[r]);this.x=e,this.y=i}static add(e,i){return new _r(e.x+i.x,e.y+i.y)}static sub(e,i){return new _r(e.x-i.x,e.y-i.y)}static subtract(e,i){return _r.sub(e,i)}static ratioBetween(e,i){return(e.x*i.x+e.y*i.y)/(e.length()*i.length())}static angleBetween(e,i){if(arguments.length>=4){const s=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,s)}const r=e.x-i.x,o=e.y-i.y;return Math.atan2(o,r)}static distanceBetween(e,i){return Math.sqrt(_r.distanceBetweenSquared(e,i))}static distanceBetweenSquared(e,i){const r=e.x-i.x,o=e.y-i.y;return r*r+o*o}set(e,i){return this.x=e,this.y=i,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new _r(this.x,this.y)}add(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=i),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=i),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=i),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=i),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const i=this.x-e.x,r=this.y-e.y;return i*i+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,i){return i=typeof i>"u"?1e-4:i,this.distanceTo(e)<i}lerp(e,i){const r=(e.x-this.x)*i+this.x,o=(e.y-this.y)*i+this.y;return this.set(r,o)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:ze(this.x),y:ze(this.y)}}rotate(e){const i=this.x,r=this.y,o=Math.cos(e),s=Math.sin(e);return this.x=i*o-r*s,this.y=i*s+r*o,this}};S(cn,"zero",new cn),S(cn,"left",new cn(-1,0)),S(cn,"right",new cn(1,0)),S(cn,"up",new cn(0,-1)),S(cn,"down",new cn(0,1));var re=cn,$e=class _s extends re{constructor(e=0,i=0,r=0,o=0,s=0,l=0,a=ie.move){super(e,i),S(this,"controls",{left:new re,right:new re}),S(this,"_command",ie.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 d in pc)Object.defineProperty(this,d,pc[d]);this.command=a,this.relative=!0;const c=_s.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(ee.Types.change,c),this.controls.right.set(s,l).addEventListener(ee.Types.change,c)}static makeBroadcast(e){return i;function i(){e._bound&&e.dispatchEvent(ee.Types.change)}}static fromObject(e){return new _s().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new _s().copy(this)}toObject(){return{x:ze(this.x),y:ze(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:ze(this.rx),ry:ze(this.ry),xAxisRotation:ze(this.xAxisRotation),largeArcFlag:ze(this.largeArcFlag),sweepFlag:ze(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},pc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ee.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ee.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ee.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ee.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ee.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},my=0,kt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.23",PublishDate:"2025-12-22T19:59:24.486Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return my++}},Zi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function Er(t,e,i,r,o){const s=1-t;return s*s*s*e+3*s*s*t*i+3*s*t*t*r+t*t*t*o}function Vs(t,e,i,r,o,s,l,a,c){c=c||Zi.RecursionLimit;const d=c+1;if(Math.abs(t-l)<.001&&Math.abs(e-a)<.001)return[new $e(l,a)];const u=[];for(let f=0;f<d;f++){const h=f/d,m=Er(h,t,i,o,l),p=Er(h,e,r,s,a);u.push(new $e(m,p))}return u}function gc(t,e,i,r,o,s,l,a,c){if(t===i&&e===r&&o===l&&s===a){const b=l-t,y=a-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(l-t),u=6*(t+o)-12*i,f=3*(i-t),h=9*(r-s)+3*(a-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+f,_=(h*b+m)*b+p;return Math.sqrt(y*y+_*_)}return bc(g,0,1,c||Zi.RecursionLimit)}function yc(t,e,i,r,o,s,l,a){const c=[],d=[[],[]];let u,f,h,m,p,g,b,y;for(let v=0;v<2;++v){if(v===0?(f=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*l,h=3*i-3*t):(f=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*a,h=3*r-3*e),Math.abs(u)<.001){if(Math.abs(f)<.001)continue;m=-h/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*h*u,y=Math.sqrt(b),!(b<0)&&(p=(-f+y)/(2*u),0<p&&p<1&&c.push(p),g=(-f-y)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*i+3*x*m*m*o+m*m*m*l,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*a;return d[0][k]=t,d[1][k]=e,d[0][k+1]=l,d[1][k+1]=a,d[0].length=d[1].length=k+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 bc(t,e,i,r){let o=Zi.abscissas[r-2],s=Zi.weights[r-2],l=.5*(i-e),a=l+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(a):0;for(;c<d;){const f=l*o[c];u+=s[c++]*(t(a+f)+t(a-f))}return l*u}function _c(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],l=e?ot(o-1,i):Math.max(o-1,0),a=e?ot(o+1,i):Math.min(o+1,r),c=t[l],d=s,u=t[a];wc(c,d,u),d.command=o===0?ie.move:ie.curve}}function wc(t,e,i){const r=re.angleBetween(t,e),o=re.angleBetween(i,e);let s=re.distanceBetween(t,e),l=re.distanceBetween(i,e),a=(r+o)/2;return s<.001||l<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,l*=.33,o<r?a+=dt:a-=dt,e.controls.left.x=Math.cos(a)*s,e.controls.left.y=Math.sin(a)*s,a-=Math.PI,e.controls.right.x=Math.cos(a)*l,e.controls.right.y=Math.sin(a)*l,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ms(t,e,i){return new re(2*t.x-(e.x+t.x)-(i?t.x:0),2*t.y-(e.y+t.y)-(i?t.y:0))}function py(t,e,i,r,o,s,l){const a=kt.Resolution;for(let c=0;c<a;c++){let d=(c+1)/a;l&&(d=1-d);const u=d*s+o,f=i*Math.cos(u),h=r*Math.sin(u),m=new $e(f,h);m.command=ie.line}}var xc=Array.prototype.slice;function gy(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var oe={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=xc.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=xc.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,i){const r=i||this,o=!gy(t)&&Object.keys(t),s=(o||t).length;for(let l=0;l<s;l++){const a=o?o[l]:l;e.call(r,t[a],a,t)}return t},performance:Ke.performance&&Ke.performance.now?Ke.performance:Date},Ut={hasEventListeners:typeof Ke.addEventListener=="function",bind:function(t,e,i,r){return this.hasEventListeners?t.addEventListener(e,i,!!r):t.attachEvent("on"+e,i),Ut},unbind:function(t,e,i,r){return Ut.hasEventListeners?t.removeEventListeners(e,i,!!r):t.detachEvent("on"+e,i),Ut},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,i=Ke.requestAnimationFrame;if(!i){for(let o=0;o<t.length;o++)i=Ke[t[o]+"RequestAnimationFrame"]||i;i=i||r}function r(o,s){const l=new Date().getTime(),a=Math.max(0,16-(l-e)),c=Ke.setTimeout(d,a);e=l+a;function d(){o(l+a)}return c}return i}},Qi=Ke.document?Ke.document.createElement("div"):{};Qi.id="help-two-load",Object.defineProperty(Ut,"temp",{enumerable:!0,get:function(){return oe.isElement(Qi)&&!Ke.document.head.contains(Qi)&&(Qi.style.display="none",Ke.document.head.appendChild(Qi)),Qi}});var Lt=class extends Error{constructor(e){super(),S(this,"name","Two.js"),S(this,"message"),this.message=e}},yy=Ke.devicePixelRatio||1;function by(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Is(t){return yy/by(t)}var fo=class{constructor(){S(this,"map",{})}add(e,i){return this.map[e]=i,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},Ct,ri=class extends Array{constructor(){super(),ac(this,Ct,new ee),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 Dt(this,Ct)}set _events(e){fy(this,Ct,e)}get _bound(){return Dt(this,Ct)._bound}set _bound(e){Dt(this,Ct)._bound=e}addEventListener(){var e;return(e=Dt(this,Ct).addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=Dt(this,Ct).on)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=Dt(this,Ct).bind)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=Dt(this,Ct).removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=Dt(this,Ct).off)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=Dt(this,Ct).unbind)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=Dt(this,Ct).dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=Dt(this,Ct).trigger)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=Dt(this,Ct).listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=Dt(this,Ct).ignore)==null?void 0:e.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(ee.Types.remove,e),arguments.length>2){const i=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ee.Types.insert,i),this.trigger(ee.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(ee.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ee.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,i){const r=[];for(let o=0;o<this.length;o++){const s=this[o];let l;i?l=e.call(i,s,o):l=e(s,o),r.push(l)}return r}};Ct=new WeakMap;var kc=class _m extends ee{constructor(){super(),S(this,"_flagId",!1),S(this,"_flagClassName",!1),S(this,"_renderer",{}),S(this,"_id",kt.Identifier+kt.uniqueId()),S(this,"_className",""),S(this,"classList",[]);for(let e in Cc)Object.defineProperty(this,e,Cc[e])}static fromObject(e){const i=new _m().copy(e);return"id"in e&&(i.id=e.id),i}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const i=this.renderer.ctx;this._renderer.texture&&(i.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(i.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const e=this._renderer.type;return this._renderer={type:e},this}};S(kc,"Properties",["renderer","id","className"]);var Ji=kc,Cc={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)}}},ho,vc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ke.document&&(ho=document.createElement("a"));var dn=class Jt extends Ji{constructor(e,i){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 r in Sc)Object.defineProperty(this,r,Sc[r]);if(this._renderer.type="texture",this._renderer.flagOffset=_y.bind(this),this._renderer.flagScale=wy.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new re,typeof i=="function"){const r=(function(){this.unbind(ee.Types.load,r),typeof i=="function"&&i()}).bind(this);this.bind(ee.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const i=new Jt().copy(e);return"id"in e&&(i.id=e.id),i}static getAbsoluteURL(e){return ho?(ho.href=e,ho.href):e}static loadHeadlessBuffer(e,i){e.image.onload=i,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const i=Jt.getAbsoluteURL(e);if(Jt.ImageRegistry.contains(i))return Jt.ImageRegistry.get(i);let r;return Pt.Image?(r=new Pt.Image,Pt.shim(r,"img")):Ke.document?vc.video.test(i)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,i){let r=e.image,o=Jt.getTag(r);e._flagImage&&(/canvas/i.test(o)?Jt.Register.canvas(e,i):(e._src=!Pt.isHeadless&&r.getAttribute("two-src")||r.src,Jt.Register[o](e,i))),e._flagSrc&&(r||(r=Jt.getImage(e.src),e.image=r),o=Jt.getTag(r),Jt.Register[o](e,i))}clone(){const e=new Jt(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof re?e.offset:new re().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(ee.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Jt.load(this,(function(){this.loaded=!0,this.trigger(ee.Types.change).trigger(ee.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(dn,"Properties",["src","loaded","repeat","scale","offset","image"]),S(dn,"RegularExpressions",vc),S(dn,"ImageRegistry",new fo),S(dn,"Register",{canvas:function(t,e){t._src="#"+t.id,dn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const i=t.image,r=function(s){!Pt.isHeadless&&i.removeEventListener&&typeof i.removeEventListener=="function"&&(i.removeEventListener("load",r,!1),i.removeEventListener("error",o,!1)),typeof e=="function"&&e()},o=function(s){throw!Pt.isHeadless&&typeof i.removeEventListener=="function"&&(i.removeEventListener("load",r,!1),i.removeEventListener("error",o,!1)),new Lt("unable to load "+t.src)};typeof i.width=="number"&&i.width>0&&typeof i.height=="number"&&i.height>0?r():!Pt.isHeadless&&typeof i.addEventListener=="function"&&(i.addEventListener("load",r,!1),i.addEventListener("error",o,!1)),t._src=dn.getAbsoluteURL(t._src),!(!Pt.isHeadless&&i&&i.getAttribute("two-src"))&&(Pt.isHeadless||i.setAttribute("two-src",t.src),dn.ImageRegistry.add(t.src,i),Pt.isHeadless?dn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Pt.isHeadless)throw new Lt("video textures are not implemented in headless environments.");const i=function(o){t.image.removeEventListener("canplaythrough",i,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(o){throw t.image.removeEventListener("canplaythrough",i,!1),t.image.removeEventListener("error",r,!1),new Lt("unable to load "+t.src)};t._src=dn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),dn.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?i():(t.image.addEventListener("canplaythrough",i,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var De=dn,Sc={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=De.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}De.ImageRegistry.contains(i)?this._image=De.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(ee.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ee.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(ee.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function _y(){this._flagOffset=!0}function wy(){this._flagScale=!0}var As=class _n extends Ji{constructor(e,i,r){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 Bc)Object.defineProperty(this,o,Bc[o]);this._renderer.type="stop",this.offset=typeof e=="number"?e:_n.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof i=="string"?i:_n.Index<=0?"#fff":"#000",_n.Index=(_n.Index+1)%2}static fromObject(e){const i=new _n().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<_n.Properties.length;i++){const r=_n.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new _n;return oe.each(_n.Properties,function(r){i[r]=this[r]},this),e&&e.stops&&e.stops.push(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",oe.each(_n.Properties,i=>{e[i]=this[i]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(As,"Index",0),S(As,"Properties",["offset","opacity","color"]);var oi=As,Bc={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)}}},Os=class Wi extends Ji{constructor(e){super(),S(this,"_flagStops",!1),S(this,"_flagSpread",!1),S(this,"_flagUnits",!1),S(this,"_spread",""),S(this,"_units","");for(let i in Nc)Object.defineProperty(this,i,Nc[i]);this._renderer.type="gradient",this._renderer.flagStops=xy.bind(this),this._renderer.bindStops=ky.bind(this),this._renderer.unbindStops=Cy.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let i=e.stops;i&&i.length>0&&(i=i.map(o=>o instanceof oi?o:new oi().copy(o)));const r=new Wi(i).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const i=this.stops.map(o=>o.clone()),r=new Wi(i);return oe.each(Wi.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let i=0;i<Wi.Properties.length;i++){const r=Wi.Properties[i];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(i=>i.toObject())};return oe.each(Wi.Properties,i=>{e[i]=this[i]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ee.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(Os,"Stop",oi),S(Os,"Properties",["spread","stops","units"]);var ut=Os,Nc={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,i=this._renderer.unbindStops;this._stops&&this._stops.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),this._stops=new ri((t||[]).slice(0)),this._stops.bind(ee.Types.insert,e).bind(ee.Types.remove,i),e(this._stops)}}};function xy(){this._flagStops=!0}function ky(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Cy(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var zs=class eo extends ut{constructor(e,i,r,o,s){super(s),S(this,"_flagEndPoints",!1),S(this,"_left",null),S(this,"_right",null);for(let l in Tc)Object.defineProperty(this,l,Tc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=vy.bind(this),this.left=new re,this.right=new re,typeof e=="number"&&(this.left.x=e),typeof i=="number"&&(this.left.y=i),typeof r=="number"&&(this.right.x=r),typeof o=="number"&&(this.right.y=o)}static fromObject(e){const i=new eo().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<eo.Properties.length;i++){const r=eo.Properties[i];r in e&&(this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]))}return this}clone(e){const i=this.stops.map(function(o){return o.clone()}),r=new eo(this.left._x,this.left._y,this.right._x,this.right._y,i);return oe.each(ut.Properties,function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(ee.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(zs,"Stop",oi),S(zs,"Properties",["left","right"]);var Ge=zs,Tc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(ee.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ee.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof re&&this._right.unbind(ee.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ee.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function vy(){this._flagEndPoints=!0}var Ds=class ji extends ut{constructor(e,i,r,o,s,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 a in $c)Object.defineProperty(this,a,$c[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Sy.bind(this),this._renderer.flagFocal=By.bind(this),this.center=new re,this.radius=typeof r=="number"?r:1,this.focal=new re,typeof e=="number"&&(this.center.x=e),typeof i=="number"&&(this.center.y=i),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof l=="number"&&(this.focal.y=l)}static fromObject(e){const i=new ji().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<ji.Properties.length;i++){const r=ji.Properties[i];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const i=this.stops.map(function(o){return o.clone()}),r=new ji(this.center._x,this.center._y,this._radius,i,this.focal._x,this.focal._y);return oe.each(ut.Properties.concat(ji.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return oe.each(ji.Properties,function(i){e[i]=this[i]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(ee.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(Ds,"Stop",oi),S(Ds,"Properties",["center","radius","focal"]);var Ze=Ds,$c={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(ee.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ee.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ee.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ee.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Sy(){this._flagCenter=!0}function By(){this._flagFocal=!0}function Ec(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const l=t._lengths[s];if(o>=r)return r-o>=0;o+=l}return!1}function mo(t,e){const i=t._length;if(e<=0)return 0;if(e>=i)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function Rc(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),gc(r,a,o,c,s,d,l,u,i)}function Ls(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),Vs(r,a,o,c,s,d,l,u,i)}function xi(t){switch(t.renderer.type){case"texture":return De.fromObject(t);case"gradient":return ut.fromObject(t);case"linear-gradient":return Ge.fromObject(t);case"radial-gradient":return Ze.fromObject(t)}return t}var Ny=Math.cos,Ty=Math.sin,Pc=Math.tan,Hs=[],Fc=class en extends ee{constructor(e,i,r,o,s,l){super(),S(this,"elements",new xn(9)),S(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,i,r){if(i.length<=3){const N=e;let w,T,C;const $=i[0]||0,E=i[1]||0,V=i[2]||0;return w=N[0]*$+N[1]*E+N[2]*V,T=N[3]*$+N[4]*E+N[5]*V,C=N[6]*$+N[7]*E+N[8]*V,[w,T,C]}const o=e[0],s=e[1],l=e[2],a=e[3],c=e[4],d=e[5],u=e[6],f=e[7],h=e[8],m=i[0],p=i[1],g=i[2],b=i[3],y=i[4],_=i[5],k=i[6],x=i[7],v=i[8];return r=r||new xn(9),r[0]=o*m+s*b+l*k,r[1]=o*p+s*y+l*x,r[2]=o*g+s*_+l*v,r[3]=a*m+c*b+d*k,r[4]=a*p+c*y+d*x,r[5]=a*g+c*_+d*v,r[6]=u*m+f*b+h*k,r[7]=u*p+f*y+h*x,r[8]=u*g+f*_+h*v,r}static fromObject(e){return new en().copy(e)}set(e,i,r,o,s,l,a,c,d){if(typeof i>"u"){const u=e;e=u[0],i=u[1],r=u[2],o=u[3],s=u[4],l=u[5],a=u[6],c=u[7],d=u[8]}return this.elements[0]=e,this.elements[1]=i,this.elements[2]=r,this.elements[3]=o,this.elements[4]=s,this.elements[5]=l,this.elements[6]=a,this.elements[7]=c,this.elements[8]=d,this.trigger(ee.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(ee.Types.change)}identity(){return this.elements[0]=en.Identity[0],this.elements[1]=en.Identity[1],this.elements[2]=en.Identity[2],this.elements[3]=en.Identity[3],this.elements[4]=en.Identity[4],this.elements[5]=en.Identity[5],this.elements[6]=en.Identity[6],this.elements[7]=en.Identity[7],this.elements[8]=en.Identity[8],this.trigger(ee.Types.change)}multiply(e,i,r,o,s,l,a,c,d){if(typeof i>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(ee.Types.change);if(typeof r>"u"&&(r=1),typeof o>"u"){e=e||0,i=i||0,r=r||0,s=this.elements;const I=s[0]*e+s[1]*i+s[2]*r,K=s[3]*e+s[4]*i+s[5]*r,J=s[6]*e+s[7]*i+s[8]*r;return[I,K,J]}const u=this.elements,f=[e,i,r,o,s,l,a,c,d],h=u[0],m=u[1],p=u[2],g=u[3],b=u[4],y=u[5],_=u[6],k=u[7],x=u[8],v=f[0],N=f[1],w=f[2],T=f[3],C=f[4],$=f[5],E=f[6],V=f[7],P=f[8];return this.elements[0]=h*v+m*T+p*E,this.elements[1]=h*N+m*C+p*V,this.elements[2]=h*w+m*$+p*P,this.elements[3]=g*v+b*T+y*E,this.elements[4]=g*N+b*C+y*V,this.elements[5]=g*w+b*$+y*P,this.elements[6]=_*v+k*T+x*E,this.elements[7]=_*N+k*C+x*V,this.elements[8]=_*w+k*$+x*P,this.trigger(ee.Types.change)}inverse(e){const i=this.elements;e=e||new en;const r=i[0],o=i[1],s=i[2],l=i[3],a=i[4],c=i[5],d=i[6],u=i[7],f=i[8],h=f*a-c*u,m=-f*l+c*d,p=u*l-a*d;let g=r*h+o*m+s*p;return g?(g=1/g,e.elements[0]=h*g,e.elements[1]=(-f*o+s*u)*g,e.elements[2]=(c*o-s*a)*g,e.elements[3]=m*g,e.elements[4]=(f*r-s*d)*g,e.elements[5]=(-c*r+s*l)*g,e.elements[6]=p*g,e.elements[7]=(-u*r+o*d)*g,e.elements[8]=(a*r-o*l)*g,e):null}scale(e,i){return arguments.length<=1&&(i=e),this.multiply(e,0,0,0,i,0,0,0,1)}rotate(e){const i=Ny(e),r=Ty(e);return this.multiply(i,-r,0,r,i,0,0,0,1)}translate(e,i){return this.multiply(1,0,e,0,1,i,0,0,1)}skewX(e){const i=Pc(e);return this.multiply(1,i,0,0,1,0,0,0,1)}skewY(e){const i=Pc(e);return this.multiply(1,0,0,i,1,0,0,0,1)}toString(e){return Hs.length=0,this.toTransformArray(e,Hs),Hs.map(ze).join(" ")}toTransformArray(e,i){const r=this.elements,o=!!i,s=r[0],l=r[1],a=r[2],c=r[3],d=r[4],u=r[5];if(e){const f=r[6],h=r[7],m=r[8];if(o){i[0]=s,i[1]=c,i[2]=f,i[3]=l,i[4]=d,i[5]=h,i[6]=a,i[7]=u,i[8]=m;return}return[s,c,f,l,d,h,a,u,m]}if(o){i[0]=s,i[1]=c,i[2]=l,i[3]=d,i[4]=a,i[5]=u;return}return[s,c,l,d,a,u]}toArray(e,i){const r=this.elements,o=!!i,s=r[0],l=r[1],a=r[2],c=r[3],d=r[4],u=r[5];if(e){const f=r[6],h=r[7],m=r[8];if(o){i[0]=s,i[1]=l,i[2]=a,i[3]=c,i[4]=d,i[5]=u,i[6]=f,i[7]=h,i[8]=m;return}return[s,l,a,c,d,u,f,h,m]}if(o){i[0]=s,i[1]=l,i[2]=a,i[3]=c,i[4]=d,i[5]=u;return}return[s,l,a,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new en().copy(this)}};S(Fc,"Identity",[1,0,0,0,1,0,0,0,1]);var ki=Fc;fc(ki);var Vc=class Fa extends Ji{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 e in po)Object.defineProperty(this,e,po[e]);this._renderer.flagMatrix=Mc.bind(this),this.isShape=!0,this.matrix=new ki,this.worldMatrix=new ki,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const i=new Fa().copy(e);return"id"in e&&(i.id=e.id),i}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return po.position.get.apply(this,arguments)}set translation(e){po.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(e,i,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&"visible"in this&&this.visible===!1||!s&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const l=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const a=this.getBoundingClientRect();return a?e>=a.left-l&&e<=a.right+l&&i>=a.top-l&&i<=a.bottom+l:!1}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof re?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const i=new Fa;return i.position.copy(this.position),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof re?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof re?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};S(Vc,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var zn=Vc,po={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ee.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ee.Types.change,this._renderer.flagMatrix),Mc.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 re&&this._scale.unbind(ee.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.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 Ps(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Mc(){this._flagMatrix=!0}var Ic=/^(?:none|transparent)$/i,$y=8,Ws=Number.EPSILON;function Dn(t,e){return{x:t,y:e}}function go(t,e,i=Ws){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function Ac(t,e,i,r){const o=t*i+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+r*r)||1e-12;let l=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(l=-l),l}function Ey(t,e,i){if(!t)return[Dn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Dn(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,l=e.largeArcFlag?1:0,a=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,f=e.y,h=(c-u)/2,m=(d-f)/2,p=Math.cos(s),g=Math.sin(s);let b=p*h+g*m,y=-g*h+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const O=Math.sqrt(x);r*=O,o*=O,_=r*r,k=o*o}const v=_*y*y+k*b*b,N=v===0?0:(_*k-v)/v;let w=Math.sqrt(Math.max(0,N));l===a&&(w=-w);const T=w*r*y/o,C=-w*o*b/r,$=p*T-g*C+(c+u)/2,E=g*T+p*C+(d+f)/2,V=Ac(1,0,(b-T)/r,(y-C)/o),P=Ac((b-T)/r,(y-C)/o,(-b-T)/r,(-y-C)/o)%tt,I=V+P,K=a===0,J=(()=>{const O=I-V,z=Math.abs(O)<Number.EPSILON;let M=ot(O,tt);return M<Number.EPSILON&&(M=z?0:tt),K&&!z&&(M=M===tt?-tt:M-tt),M})(),Z=Math.max(kt.Resolution,Math.max(i*2,1)),L=[];for(let O=1;O<=Z;O++){const z=O/Z,M=V+z*J;let R=$+r*Math.cos(M),W=E+o*Math.sin(M);if(s!==0){const U=R-$,G=W-E,X=Math.cos(s),j=Math.sin(s);R=U*X-G*j+$,W=U*j+G*X+E}L.push(Dn(R,W))}return L}function Ry(t,e=$y){const i=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:i,segments:r};const s=Math.max(1,Math.floor(e));let l=null,a=null,c=null,d=null;const u=(h=!1)=>{if(l){if(h&&a&&c&&!go(a,c)){const m=Dn(a.x,a.y);r.push({a:c,b:m}),l.push(m),c=m}l.length>=3&&a&&c&&go(a,c)&&i.push(l),l=null,a=null,c=null}},f=h=>{if(!c){c=h,l&&l.push(h);return}go(c,h)||(r.push({a:c,b:h}),l&&l.push(h),c=h)};for(let h=0;h<o.length;h++){const m=o[h],p=m.command||(h===0?ie.move:ie.line);if(p===ie.move){u(!1);const g=Dn(m.x,m.y);l=[g],a=g,c=g,d=m;continue}if(d||(d=o[Math.max(h-1,0)]),p===ie.line)f(Dn(m.x,m.y));else if(p===ie.curve){const g=Ls(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];f(Dn(y.x,y.y))}f(Dn(m.x,m.y))}else if(p===ie.arc){const g=Ey(d,m,s);for(let b=0;b<g.length;b++)f(g[b])}else if(p===ie.close){u(!0),d=m;continue}else f(Dn(m.x,m.y));d=m}if(l){const h=!!t._closed||!!t.closed||a&&c&&!go(a,c);u(h)}return{polygons:i,segments:r}}function Py(t,e,i){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let l=s.length-1;for(let a=0;a<s.length;a++){const c=s[l],d=s[a];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),l=a}}return r}function Fy(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<Ws&&Math.abs(s)<Ws){const h=t-i.x,m=e-i.y;return h*h+m*m}const l=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),a=Math.max(0,Math.min(1,l)),c=i.x+a*o,d=i.y+a*s,u=t-c,f=e-d;return u*u+f*f}function Vy(t,e,i){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],l=Fy(e,i,s.a,s.b);l<r&&(r=l)}return Math.sqrt(r)}function My(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Ic.test(i):!0}function Iy(t,e){const i=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&i>0;if(!(i>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!Ic.test(r):!0}function Ay(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,l=t.top-r,a=t.bottom+r;return e>=o&&e<=s&&i>=l&&i<=a}var yo=Number.EPSILON;function bo(t){return typeof t.relative!="boolean"||!!t.relative}function un(t,e,i,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(i)<yo&&Math.abs(r)<yo){bo(t)?o[e].clear():o[e].set(t.x,t.y);return}bo(t)?o[e].set(i,r):o[e].set(t.x+i,t.y+r)}}function Ht(t,e){un(t,e,0,0)}function Oy(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:bo(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function er(t,e){const i=Oy(t,e);return Math.abs(i.x)>yo||Math.abs(i.y)>yo}function _o(t){t.command===ie.move||t.command===ie.close||(t.command=er(t,"left")||er(t,"right")?ie.curve:ie.line)}function Oc(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function zy(t,e){return er(e,"right")||er(t,"left")||er(t,"right")||er(e,"left")||t.command===ie.curve||e.command===ie.curve}function tr(t,e,i){return{x:Ft(t.x,e.x,i),y:Ft(t.y,e.y,i)}}function zc(t,e){const i=t.controls&&t.controls[e];return i?bo(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function Dy(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},l=r?zc(t,"right"):$r({},s),a={x:e.x,y:e.y},c=o?zc(e,"left"):$r({},a),d=tr(s,l,i),u=tr(l,c,i),f=tr(c,a,i),h=tr(d,u,i),m=tr(u,f,i),p=tr(h,m,i),g=new $e(p.x,p.y);return Oc(g,t),un(g,"left",h.x-p.x,h.y-p.y),un(g,"right",m.x-p.x,m.y-p.y),g.command=ie.curve,{anchor:g,startOut:d,endIn:f}}function Ly(t,e,i,r,o,s){const l=t.length,a=i-e+1;let c=a-1,d=o?Math.min(a,4):1,u=d,f=d;if(r||(u=Math.min(1,e),f=Math.min(1,l-i-1)),c+=u+f,c<=1)return;const h=new Array(c+1);for(let w=0,T=e-u;w<=c;w+=1,T+=1){const C=ot(T,l);h[w]=t[C]}let m=h[0].x+2*h[1].x,p=h[0].y+2*h[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),v=new Array(c+1);for(let w=1;w<c;w+=1){const T=w<b,C=T||s?1:2,$=T?4:s?2:7,E=T?4:s?3:8,V=T?2:s?0:1,P=C/g;g=k[w]=$-P,m=y[w]=E*h[w].x+V*h[w+1].x-P*m,p=_[w]=E*h[w].y+V*h[w+1].y-P*p}x[b]=y[b]/k[b],v[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],v[w]=(_[w]-v[w+1])/k[w];x[c]=(3*h[c].x-x[b])/2,v[c]=(3*h[c].y-v[b])/2;const N=c-f;for(let w=u,T=e;w<=N;w+=1,T+=1){const C=ot(T,l),$=t[C],E=x[w]-$.x,V=v[w]-$.y;o||w<N?un($,"right",E,V):Ht($,"right"),o||w>u?un($,"left",-E,-V):Ht($,"left"),_o($)}}function Hy(t,e,i,r,o,s){const l=e||t,a=t,c=i||t,d=re.distanceBetween(l,a),u=re.distanceBetween(a,c),f=r===void 0?.5:r,h=Math.pow(d,f),m=Math.pow(u,f),p=h*h,g=m*m;if(!o&&e){const b=2*g+3*m*h+p,y=3*m*(m+h);if(y!==0){const _=(g*l.x+b*a.x-p*c.x)/y-a.x,k=(g*l.y+b*a.y-p*c.y)/y-a.y;un(t,"left",_,k)}else Ht(t,"left")}else Ht(t,"left");if(!s&&i){const b=2*p+3*h*m+g,y=3*h*(h+m);if(y!==0){const _=(p*c.x+b*a.x-g*l.x)/y-a.x,k=(p*c.y+b*a.y-g*l.y)/y-a.y;un(t,"right",_,k)}else Ht(t,"right")}else Ht(t,"right");_o(t)}function Wy(t,e,i,r,o,s){if(!(e&&i)){e||Ht(t,"left"),i||Ht(t,"right"),_o(t);return}const l=e,a=t,c=i,d=re.distanceBetween(l,a),u=re.distanceBetween(a,c),f=d+u,h=r===void 0?.4:r,m={x:l.x-c.x,y:l.y-c.y};if(!o&&f!==0){const p=h*d/f;un(t,"left",m.x*p,m.y*p)}else Ht(t,"left");if(!s&&f!==0){const p=h*d/f-h;un(t,"right",m.x*p,m.y*p)}else Ht(t,"right");_o(t)}function jy(t,e,i,r,o,s){const l=s.type,a=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=ot(d,c),f=t[u];if(f.command===ie.move){Ht(f,"left"),Ht(f,"right");continue}const h=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=h===null?null:t[ot(h,c)],g=m===null?null:t[ot(m,c)],b=h===null,y=m===null;l==="geometric"?Wy(f,p,g,a,b,y):Hy(f,p,g,a,b,y)}}var nr=Math.min,ir=Math.max,qy=Math.ceil,Xy=Math.floor,Yy=new re,Uy=new ki,js=class gi extends zn{constructor(e,i,r,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 s in Dc)Object.defineProperty(this,s,Dc[s]);this._renderer.type="path",this._renderer.flagVertices=Lc.bind(this),this._renderer.bindVertices=Hc.bind(this),this._renderer.unbindVertices=Wc.bind(this),this._renderer.flagFill=jc.bind(this),this._renderer.flagStroke=qc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!i,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(e){const i=typeof e.fill=="string"?e.fill:xi(e.fill),r=typeof e.stroke=="string"?e.stroke:xi(e.stroke),o=new gi().copy(Rs($r({},e),{fill:i,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let i=0;i<e.vertices.length;i++){const r=e.vertices[i];r instanceof $e?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new $e().copy(r))}}for(let i=0;i<gi.Properties.length;i++){const r=gi.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new gi;for(let r=0;r<this.vertices.length;r++)i.vertices.push(this.vertices[r].clone());for(let r=0;r<gi.Properties.length;r++){const o=gi.Properties[r];i[o]=this[o]}return i.className=this.className,i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(i=>i.toObject()),oe.each(gi.Properties,i=>{typeof this[i]<"u"&&(this[i].toObject?e[i]=this[i].toObject():e[i]=this[i])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const i=this.vertices[e];typeof i.unbind=="function"&&i.unbind(),i.controls&&(i.controls.left&&typeof i.controls.left.unbind=="function"&&i.controls.left.unbind(),i.controls.right&&typeof i.controls.right.unbind=="function"&&i.controls.right.unbind())}return typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),i=e.width/2,r=e.height/2,o=e.left+e.width/2,s=e.top+e.height/2;for(let l=0;l<this.vertices.length;l++){const a=this.vertices[l];a.x-=o,a.y-=s,a.x+=i,a.y+=r}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=i,this.mask.translation.y-=s,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),i=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o];s.x-=i,s.y-=r}return this.mask&&(this.mask.translation.x-=i,this.mask.translation.y-=r),this}getBoundingClientRect(e){let i,r,o,s,l,a,c=1/0,d=-1/0,u=1/0,f=-1/0;if(this._update(!0),i=e?this.matrix:this.worldMatrix,r=(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:h,scaleY:m}=wi(i.elements[0],i.elements[3],i.elements[1],i.elements[4],i.elements[2],i.elements[5]);typeof h=="number"&&typeof m=="number"&&(r=Math.max(h,m)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(s=0;s<o;s++){a=this._renderer.vertices[s],l=this._renderer.vertices[(s+o-1)%o];const[h,m]=i.multiply(l.x,l.y),[p,g]=i.multiply(a.x,a.y);if(l.controls&&a.controls){let b=l.controls.right.x,y=l.controls.right.y;l.relative&&(b+=l.x,y+=l.y);let[_,k]=i.multiply(b,y),x=a.controls.left.x,v=a.controls.left.y;a.relative&&(x+=a.x,v+=a.y);let[N,w]=i.multiply(x,v);const T=yc(h,m,_,k,N,w,p,g);u=nr(T.min.y-r,u),c=nr(T.min.x-r,c),d=ir(T.max.x+r,d),f=ir(T.max.y+r,f)}else s<=1&&(u=nr(m-r,u),c=nr(h-r,c),d=ir(h+r,d),f=ir(m+r,f)),u=nr(g-r,u),c=nr(p-r,c),d=ir(p+r,d),f=ir(g+r,f)}return{top:u,left:c,right:d,bottom:f,width:d-c,height:f-u}}contains(e,i,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&this.visible===!1||!s&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const l=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const a=this.getBoundingClientRect();if(!a||e<a.left-l||e>a.right+l||i<a.top-l||i>a.bottom+l)return!1;const c=this.worldMatrix,d=c&&c.inverse(Uy);if(!d)return super.contains(e,i,o);const[u,f]=d.multiply(e,i,1),h=typeof o.precision=="number"&&!Number.isNaN(o.precision)?Math.max(1,Math.floor(o.precision)):8,m=My(this,o.fill),p=Iy(this,o.stroke),{polygons:g,segments:b}=Ry(this,h);if(m&&g.length>0&&Py(g,u,f))return!0;if(p&&b.length>0){const y=typeof this.linewidth=="number"?this.linewidth:0;if(y>0&&Vy(b,u,f)<=y/2+l)return!0}return!m&&!p?super.contains(e,i,o):m&&g.length===0?super.contains(e,i,o):!1}getPointAt(e,i){let r,o,s,l,a,c,d,u,f,h,m,p,g,b,y,_=this.length*Math.min(Math.max(e,0),1);const k=this.vertices.length,x=k-1;let v=null,N=null;for(let Z=0,L=this._lengths.length,O=0;Z<L;Z++){if(O+this._lengths[Z]>=_){this._closed?(r=ot(Z,k),o=ot(Z-1,k),Z===0&&(r=o,o=Z)):(r=Z,o=Math.min(Math.max(Z-1,0),x)),v=this.vertices[r],N=this.vertices[o],_-=O,this._lengths[Z]!==0?e=_/this._lengths[Z]:e=0;break}O+=this._lengths[Z]}if(v===null||N===null)return null;if(v){if(!N)return v}else return N;y=N.controls&&N.controls.right,b=v.controls&&v.controls.left,a=N.x,h=N.y,c=(y||N).x,m=(y||N).y,d=(b||v).x,p=(b||v).y,u=v.x,g=v.y,y&&N.relative&&(c+=N.x,m+=N.y),b&&v.relative&&(d+=v.x,p+=v.y),l=Er(e,a,c,d,u),f=Er(e,h,m,p,g);const w=Ft(a,c,e),T=Ft(h,m,e),C=Ft(c,d,e),$=Ft(m,p,e),E=Ft(d,u,e),V=Ft(p,g,e),P=Ft(w,C,e),I=Ft(T,$,e),K=Ft(C,E,e),J=Ft($,V,e);return oe.isObject(i)?(i.x=l,i.y=f,i instanceof $e&&(i.controls.left.x=P,i.controls.left.y=I,i.controls.right.x=K,i.controls.right.y=J,(typeof i.relative!="boolean"||i.relative)&&(i.controls.left.x-=l,i.controls.left.y-=f,i.controls.right.x-=l,i.controls.right.y-=f)),i.t=e,i):(s=new $e(l,f,P-l,I-f,K-l,J-f,this._curved?ie.curve:ie.line),s.t=e,s)}plot(){if(this.curved)return _c(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ie.move:ie.line;return this}smooth(e){const i=e||{},r=i.type||"continuous",o=this._collection,s=o.length;if(s<2)return this;const l=this._closed||s>0&&o[s-1]&&o[s-1].command===ie.close,a=(h,m)=>{if(h==null)return m;if(typeof h=="number"){if(l)return ot(h,s);let g=h;return g<0&&(g+=s),Math.min(Math.max(g,0),s-1)}const p=o.indexOf(h);return p!==-1?p:m},c=l&&i.from===void 0&&i.to===void 0;let d=a(i.from,0),u=a(i.to,s-1);if(d>u)if(l)d-=s;else{const h=d;d=u,u=h}const f=u-d+1;for(let h=0;h<f;h+=1){const m=ot(d+h,s),p=o[m],g=!l&&m===0;p.command===ie.move&&!g&&(p.command=ie.line)}if(r==="continuous"||r==="asymmetric")Ly(o,d,u,l,c,r==="asymmetric");else if(r==="catmull-rom"||r==="geometric"){const h={type:r,factor:i.factor};jy(o,d,u,l,c,h)}else throw new Error(`Path.smooth does not support type "${r}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(e){this._update();const i=this.vertices,r=i.length;if(r<2)return this;const o=[];let s=null,l=null;for(let a=0;a<r;a+=1){const c=i[a];if(!s||c.command===ie.move){const u=c.clone();o.push(u),s=c,l=c;continue}if(zy(c,s)){const f=Ls(c,s,e).length,h=o[o.length-1];let m=h.clone(),p=c.clone(),g=h,b=0;if(f<=1){const y=c.clone();o.push(y)}else{for(let _=1;_<f;_+=1){const k=_/f,x=1-b,v=x<=Number.EPSILON?k:(k-b)/x,N=Dy(m,p,v);un(g,"right",N.startOut.x-g.x,N.startOut.y-g.y);const w=N.anchor;o.push(w),g=w,m=w.clone(),b=k,un(p,"left",N.endIn.x-p.x,N.endIn.y-p.y)}const y=c.clone();y.controls.left.copy(p.controls.left),o.push(y)}}else{const u=Ls(c,s,e);for(let h=1;h<u.length;h+=1){const m=u[h];Oc(m,s),Ht(m,"left"),Ht(m,"right"),m.command=ie.line,o.push(m)}const f=c.clone();o.push(f)}s=c,c.command===ie.close&&(s=l)}return this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,i){i||this._update();const o=this.vertices.length-1;let s=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),oe.each(this.vertices,function(a,c){if(c<=0||a.command===ie.move){s=a,this._lengths[c]=0;return}this._lengths[c]=Rc(a,s,e),l+=this._lengths[c],s=a},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,i=this._closed,r=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),s=mo(this,r*this._length),l=mo(this,o*this._length),a=qy(s),c=Xy(l);let d,u,f,h,m,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new $e),p>c&&!u?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),u=m,f=this._collection[p-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(re.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):p>=a&&p<=c&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===c&&Ec(this,o)?(u=m,!i&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===a&&Ec(this,r)&&(d=m,d.command=ie.move,!i&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));a>0&&!d&&(p=a-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,m),m.command=ie.move,this._renderer.vertices.unshift(m),h=this._collection[p+1],h&&h.controls&&(m.controls.left.clear(),h.relative?this._renderer.collection[p+1].controls.left.copy(h.controls.left).lerp(re.zero,m.t):(Yy.copy(h),this._renderer.collection[p+1].controls.left.copy(h.controls.left).lerp(h,m.t))))}return zn.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,zn.prototype.flagReset.call(this),this}};S(js,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(js,"Utils",{getCurveLength:Rc});var Re=js,Dc={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 ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.bind(ee.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";oe.each(this.vertices,function(i){i[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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),t instanceof ri?this._collection=t:this._collection=new ri(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.Types.remove,i),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 Lc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Hc(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Wc(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function jc(){this._flagFill=!0}function qc(){this._flagStroke=!0}var Xc=class to extends Re{constructor(e,i,r,o){const s=[new $e,new $e,new $e,new $e];super(s,!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 Yc)Object.defineProperty(this,l,Yc[l]);this.width=typeof r=="number"?r:1,this.height=typeof o=="number"?o:1,this.origin=new re,typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i),this._update()}static fromObject(e){const i=new to().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<to.Properties.length;i++){const r=to.Properties[i];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof re&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,i=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new $e),this.vertices[0].set(-e,-i).sub(this._origin).command=ie.move,this.vertices[1].set(e,-i).sub(this._origin).command=ie.line,this.vertices[2].set(e,i).sub(this._origin).command=ie.line,this.vertices[3].set(-e,i).sub(this._origin).command=ie.line,this.vertices[4]&&(this.vertices[4].set(-e,-i).sub(this._origin).command=ie.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const i=new to(0,0,this.width,this.height);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix);for(let r=0;r<Re.Properties.length;r++){const o=Re.Properties[r];i[o]instanceof re?i[o].copy(this[o]):i[o]=this[o]}return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};S(Xc,"Properties",["width","height","origin"]);var si=Xc,Yc={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(ee.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ee.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Uc=class no extends si{constructor(e,i,r,o,s,l){super(i,r,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 a in Kc)Object.defineProperty(this,a,Kc[a]);this.noStroke(),this.noFill(),e instanceof De?this.texture=e:typeof e=="string"&&(this.texture=new De(e)),this.origin=new re,this._update(),typeof o=="number"&&(this.columns=o),typeof s=="number"&&(this.rows=s),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(e){const i=new no().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<no.Properties.length;i++){const r=no.Properties[i];r in e&&(this[r]=e[r])}return this}play(e,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=oe.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof i=="number"&&(this._lastFrame=i),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const i=new no(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&i.play(this._firstFrame,this._lastFrame),i.loop=this.loop,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,i=this._columns,r=this._rows;let o,s,l,a,c,d,u,f,h;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){u=e.image.width,f=e.image.height,o=u/i,s=f/r,a=this._amount,this.width!==o&&(this.width=o),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(oe.isNaN(this._lastFrame)&&(this._lastFrame=a-1),l=oe.performance.now()-this._startTime,h=this._lastFrame+1,c=1e3*(h-this._firstFrame)/this._frameRate,this._loop?l=l%c:l=Math.min(l,c),d=Ft(this._firstFrame,h,l/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%i,p=Math.floor(this._index/i),g=-o*m+(u-o)/2,b=-s*p+(f-s)/2;g!==e.offset.x&&(e.offset.x=g),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(Uc,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wo=Uc,Kc={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}}},qs,Gc=class extends ri{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),ac(this,qs,{}),this.attach(e),this.on(ee.Types.insert,this.attach),this.on(ee.Types.remove,this.detach)}get ids(){return Dt(this,qs)}attach(e){for(let i=0;i<e.length;i++){const r=e[i];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let i=0;i<e.length;i++)delete this.ids[e[i].id];return this}};qs=new WeakMap;var Zc=class qi extends Re{constructor(e,i,r,o,s,l,a){const c=a||kt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new $e);super(d,!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",tt),S(this,"_innerRadius",0),S(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Qc)Object.defineProperty(this,u,Qc[u]);typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.startAngle=s),typeof l=="number"&&(this.endAngle=l),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new qi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<qi.Properties.length;i++){const r=qi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,i=this._endAngle,r=this._innerRadius,o=this._outerRadius,s=ot(e,tt)===ot(i,tt),l=r>0,a=this.vertices;let c=l?a.length/2:a.length,d,u=0,f,h,m,p,g,b,y,_,k;for(s?c--:l||(c-=2),f=0,h=c-1;f<c;f++){switch(m=f/h,p=a[u],g=m*(i-e)+e,b=(i-e)/c,y=o*Math.cos(g),_=o*Math.sin(g),f){case 0:d=ie.move;break;default:d=ie.curve}p.command=d,p.x=y,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=o*b/Math.PI,p.controls.left.x=k*Math.cos(g-dt),p.controls.left.y=k*Math.sin(g-dt),p.controls.right.x=k*Math.cos(g+dt),p.controls.right.y=k*Math.sin(g+dt),f===1&&p.controls.left.multiplyScalar(2),f===h&&p.controls.right.multiplyScalar(2)),u++}if(l){for(s?(a[u].command=ie.close,u++):(c--,h=c-1),f=0;f<c;f++)m=f/h,p=a[u],g=(1-m)*(i-e)+e,b=(i-e)/c,y=r*Math.cos(g),_=r*Math.sin(g),d=ie.curve,f<=0&&(d=s?ie.move:ie.line),p.command=d,p.x=y,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=r*b/Math.PI,p.controls.left.x=k*Math.cos(g+dt),p.controls.left.y=k*Math.sin(g+dt),p.controls.right.x=k*Math.cos(g-dt),p.controls.right.y=k*Math.sin(g-dt),f===1&&p.controls.left.multiplyScalar(2),f===h&&p.controls.right.multiplyScalar(2)),u++;a[u].copy(a[0]),a[u].command=ie.line}else s||(a[u].command=ie.line,a[u].x=0,a[u].y=0,u++,a[u].copy(a[0]),a[u].command=ie.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const i=this.innerRadius,r=this.outerRadius,o=this.startAngle,s=this.endAngle,l=this.vertices.length,a=new qi(0,0,i,r,o,s,l);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 c=0;c<Re.Properties.length;c++){const d=Re.Properties[c];a[d]=this[d]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let i=0;i<qi.Properties.length;i++){const r=qi.Properties[i];e[r]=this[r]}return e}};S(Zc,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Xs=Zc,Qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Ys=Math.cos,Us=Math.sin,Jc=class Xi extends Re{constructor(e,i,r,o){const s=o?Math.max(o,2):4,l=[];for(let a=0;a<s;a++)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 a in ed)Object.defineProperty(this,a,ed[a]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Xi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Xi.Properties.length;i++){const r=Xi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const i=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,o=r*i;for(let s=0;s<this.vertices.length;s++){const a=s/e*tt,c=r*Ys(a),d=r*Us(a),u=o*Ys(a-dt),f=o*Us(a-dt),h=o*Ys(a+dt),m=o*Us(a+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,f),p.controls.right.set(h,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const i=new Xi(0,0,this.radius,this.vertices.length);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix);for(let r=0;r<Re.Properties.length;r++){const o=Re.Properties[r];i[o]=this[o]}return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let i=0;i<Xi.Properties.length;i++){const r=Xi.Properties[i];e[r]=this[r]}return e}};S(Jc,"Properties",["radius"]);var xo=Jc,ed={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Ks=Math.cos,Gs=Math.sin,td=class Yi extends Re{constructor(e,i,r,o,s){typeof o!="number"&&typeof r=="number"&&(o=r);const l=s?Math.max(s,2):4,a=[];for(let c=0;c<l;c++)a.push(new $e);super(a,!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 c in nd)Object.defineProperty(this,c,nd[c]);typeof r=="number"&&(this.width=r*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Yi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Yi.Properties.length;i++){const r=Yi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const i=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,o=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*tt,c=r*Ks(a),d=o*Gs(a),u=r*i*Ks(a-dt),f=o*i*Gs(a-dt),h=r*i*Ks(a+dt),m=o*i*Gs(a+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,f),p.controls.right.set(h,m)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const i=this.width/2,r=this.height/2,o=this.vertices.length,s=new Yi(0,0,i,r,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const a=Re.Properties[l];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let i=0;i<Yi.Properties.length;i++){const r=Yi.Properties[i];e[r]=this[r]}return e}};S(td,"Properties",["width","height"]);var ko=td,nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Ky=Math.ceil,Gy=Math.floor,id=class yi extends zn{constructor(e){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",Re.prototype.noFill),S(this,"noStroke",Re.prototype.noStroke),S(this,"corner",Re.prototype.corner),S(this,"center",Re.prototype.center),S(this,"getBoundingClientRect",Re.prototype.getBoundingClientRect),S(this,"_updateLength",Re.prototype._updateLength);for(let i in rd)Object.defineProperty(this,i,rd[i]);this._renderer.type="points",this._renderer.flagVertices=Lc.bind(this),this._renderer.bindVertices=Hc.bind(this),this._renderer.unbindVertices=Wc.bind(this),this._renderer.flagFill=jc.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=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const i=typeof e.fill=="string"?e.fill:xi(e.fill),r=typeof e.stroke=="string"?e.stroke:xi(e.stroke),o=new yi().copy(Rs($r({},e),{fill:i,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let i=0;i<e.vertices.length;i++){const r=e.vertices[i];r instanceof $e?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new $e().copy(r))}for(let i=0;i<yi.Properties.length;i++){const r=yi.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new yi;for(let r=0;r<this.vertices.length;r++)i.vertices.push(this.vertices[r].clone());for(let r=0;r<yi.Properties.length;r++){const o=yi.Properties[r];i[o]=this[o]}return i.className=this.className,i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(i=>i.toObject()),oe.each(yi.Properties,function(i){typeof this[i]<"u"&&(this[i].toObject?e[i]=this[i].toObject():e[i]=this[i])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const i=this.vertices[e];typeof i.unbind=="function"&&i.unbind()}return typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}subdivide(e){this._update();let i=[];for(let r=0;r<this.vertices.length;r++){const o=this.vertices[r],s=this.vertices[r-1];if(!s)continue;const l=o.x,a=o.y,c=s.x,d=s.y,u=Vs(l,a,l,a,c,d,c,d,e);i=i.concat(u)}return this.vertices=i,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),r=mo(this,e*this._length),o=mo(this,i*this._length),s=Ky(r),l=Gy(o);let a=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=s&&d<=l&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[a*2+0]=c.x,this._renderer.vertices[a*2+1]=c.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};S(id,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var Zs=id,rd={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 ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.bind(ee.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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),t instanceof ri?this._collection=t:this._collection=new ri(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.Types.remove,i),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}}},Zy=Math.cos,Qy=Math.sin,od=class Ui extends Re{constructor(e,i,r,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 s in sd)Object.defineProperty(this,s,sd[s]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Ui().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Ui.Properties.length;i++){const r=Ui.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,i=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<i;o++){const s=(o+.5)/e,l=tt*s+Math.PI/2,a=this._width*Zy(l)/2,c=this._height*Qy(l)/2;o>=r?this.vertices.push(new $e(a,c)):this.vertices[o].set(a,c),this.vertices[o].command=o===0?ie.move:ie.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const i=new Ui(0,0,0,this.sides);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,i.width=this.width,i.height=this.height,this.matrix.manual&&i.matrix.copy(this.matrix);for(let r=0;r<Re.Properties.length;r++){const o=Re.Properties[r];i[o]=this[o]}return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let i=0;i<Ui.Properties.length;i++){const r=Ui.Properties[i];e[r]=this[r]}return e}};S(od,"Properties",["width","height","sides"]);var Qs=od,sd={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}}},ld=class Ki extends Re{constructor(e,i,r,o,s){typeof s>"u"&&typeof r=="number"&&typeof o=="number"&&(s=Math.floor(Math.min(r,o)/12));const l=[];for(let a=0;a<10;a++)l.push(new $e(0,0,0,0,0,0,a===0?ie.move:ie.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 a in ad)Object.defineProperty(this,a,ad[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Jy.bind(this),typeof r=="number"&&(this.width=r),typeof o=="number"&&(this.height=o),(typeof s=="number"||s instanceof re)&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Ki().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Ki.Properties.length;i++){const r=Ki.Properties[i];if(r in e){const o=e[r];/radius/i.test(r)?this[r]=typeof o=="number"||o instanceof re?o:new re().copy(o):typeof o=="number"&&(this[r]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,i=this._height;let r,o;this._radius instanceof re?(r=this._radius.x,o=this._radius.y):(r=this._radius,o=this._radius);let s,l=e/2,a=i/2;s=this.vertices[0],s.x=-(l-r),s.y=-a,s=this.vertices[1],s.x=l-r,s.y=-a,s.controls.left.clear(),s.controls.right.x=r,s.controls.right.y=0,s=this.vertices[2],s.x=l,s.y=-(a-o),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=l,s.y=a-o,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=o,s=this.vertices[4],s.x=l-r,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(l-r),s.y=a,s.controls.left.clear(),s.controls.right.x=-r,s.controls.right.y=0,s=this.vertices[6],s.x=-l,s.y=a-o,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-l,s.y=-(a-o),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-o,s=this.vertices[8],s.x=-(l-r),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const i=this.width,r=this.height,o=this.radius,s=new Ki(0,0,i,r,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const a=Re.Properties[l];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let i=0;i<Ki.Properties.length;i++){const r=Ki.Properties[i];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};S(ld,"Properties",["width","height","radius"]);var Co=ld,ad={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 re&&this._radius.unbind(ee.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(ee.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Jy(){this._flagRadius=!0}var e0=Math.cos,t0=Math.sin,cd=class Gi extends Re{constructor(e,i,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=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 dd)Object.defineProperty(this,l,dd[l]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Gi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Gi.Properties.length;i++){const r=Gi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,i=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<i;o++){const s=(o+.5)/e,l=tt*s,a=(o%2?this._outerRadius:this._innerRadius)/2,c=a*e0(l),d=a*t0(l);o>=r?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ie.move:ie.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const i=this.innerRadius,r=this.outerRadius,o=this.sides,s=new Gi(0,0,i,r,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const a=Re.Properties[l];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let i=0;i<Gi.Properties.length;i++){const r=Gi.Properties[i];e[r]=this[r]}return e}};S(cd,"Properties",["innerRadius","outerRadius","sides"]);var Js=cd,dd={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}}},el,ud=Math.min,fd=Math.max;Ke.document&&(el=document.createElement("canvas"));var tl=class tn extends zn{constructor(e,i,r,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 s in hd)Object.defineProperty(this,s,hd[s]);if(this._renderer.type="text",this._renderer.flagFill=n0.bind(this),this._renderer.flagStroke=i0.bind(this),this.value=e,typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!oe.isObject(o))return this;for(let s=0;s<tn.Properties.length;s++){const l=tn.Properties[s];l in o&&(this[l]=o[l])}}static Measure(e){if(el){const i=el.getContext("2d");i.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=i.measureText(e.value,0,0),o=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:o}}else{const i=this.value.length*this.size*tn.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:i,height:r}}}static fromObject(e){const i=typeof e.fill=="string"?e.fill:xi(e.fill),r=typeof e.stroke=="string"?e.stroke:xi(e.stroke),o=new tn().copy(Rs($r({},e),{fill:i,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let i=0;i<tn.Properties.length;i++){const r=tn.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new tn(this.value);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale;for(let r=0;r<tn.Properties.length;r++){const o=tn.Properties[r];i[o]=this[o]}return this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let i=0;i<tn.Properties.length;i++){const r=tn.Properties[i];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let i,r,o,s,l;this._update(!0),i=e?this.matrix:this.worldMatrix;const{width:a,height:c}=tn.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,o=a+d;break;case"right":r=-(a+d),o=d;break;default:r=-(a/2+d),o=a/2+d}switch(this.baseline){case"middle":s=-(c/2+d),l=c/2+d;break;default:s=-(c+d),l=d}const[u,f]=i.multiply(r,s),[h,m]=i.multiply(r,l),[p,g]=i.multiply(o,s),[b,y]=i.multiply(o,l);return s=ud(f,m,g,y),r=ud(u,h,p,b),o=fd(u,h,p,b),l=fd(f,m,g,y),{top:s,left:r,right:o,bottom:l,width:o-r,height:l-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};S(tl,"Ratio",.6),S(tl,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var Cn=tl,hd={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 ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.bind(ee.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 n0(){this._flagFill=!0}function i0(){this._flagStroke=!0}var nl=class wr extends si{constructor(e,i,r,o){super(i,r,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 s in md)Object.defineProperty(this,s,md[s]);this._renderer.flagTextures=r0.bind(this),this._renderer.bindTextures=o0.bind(this),this._renderer.unbindTextures=s0.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(pd.bind(this)):typeof e=="string"&&(this.textures=[pd(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=wr.DefaultFrameRate,this.index=0}static fromObject(e){const i=new wr().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<wr.Properties.length;i++){const r=wr.Properties[i];r in e&&(this[r]=e[r])}return this}play(e,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=oe.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof i=="number"&&(this._lastFrame=i),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const i=new wr(this.textures,this.translation.x,this.translation.y,this.frameRate);return i._loop=this._loop,this._playing&&i.play(),e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(i){return i.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const i=this.textures[e];typeof i.dispose=="function"?i.dispose():typeof i.unbind=="function"&&i.unbind()}return this}_update(){const e=this._textures;let i,r,o,s,l,a,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,oe.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=oe.performance.now()-this._startTime,d=this._lastFrame+1,l=1e3*(d-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Ft(this._firstFrame,d,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,a=e[this._index],a.loaded&&(i=a.image.width,r=a.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r),this.fill=a,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof De))&&(a=e[this._index],a.loaded&&(i=a.image.width,r=a.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(nl,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(nl,"DefaultFrameRate",30);var il=nl,md={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,i=this._renderer.unbindTextures;this._textures&&this._textures.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),this._textures=new ri((t||[]).slice(0)),this._textures.bind(ee.Types.insert,e).bind(ee.Types.remove,i),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 r0(){this._flagTextures=!0}function o0(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function s0(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function pd(t){if(t instanceof De)return t;if(typeof t=="string")return new De(t)}var vo=Math.min,So=Math.max,l0={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},rl=class an extends zn{constructor(e){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 i in gd)Object.defineProperty(this,i,gd[i]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let i=0;i<e.length;i++)yd.call(this,e[i],this)}static RemoveChildren(e){for(let i=0;i<e.length;i++)yd.call(this,e[i])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const i=new an;for(let o=0;o<an.Properties.length;o++){const s=an.Properties[o];s in e&&(/(fill|stroke)/i.test(s)?i[s]=typeof e[s]=="string"?e[s]:xi(e[s]):i[s]=e[s])}return"mask"in e&&(i.mask=r(e.mask)),"id"in e&&(i.id=e.id),i.children=e.children.map(r),i;function r(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Xs.fromObject(o);case"circle":return xo.fromObject(o);case"element":return Ji.fromObject(o);case"ellipse":return ko.fromObject(o);case"group":return an.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return il.fromObject(o);case"path":return Re.fromObject(o);case"points":return Zs.fromObject(o);case"polygon":return Qs.fromObject(o);case"rectangle":return si.fromObject(o);case"rounded-rectangle":return Co.fromObject(o);case"shape":return zn.fromObject(o);case"sprite":return wo.fromObject(o);case"star":return Js.fromObject(o);case"text":return Cn.fromObject(o)}return o}}static IsVisible(e,i){if(!i)return!0;let r=e;for(;r;){if(typeof r.visible=="boolean"&&!r.visible||typeof r.opacity=="number"&&r.opacity<=0)return!1;r=r.parent}return!0}static VisitForHitTest(e,i,r,o,s,l,a){const c=e&&e.children;if(!c)return!1;const d=i.results;for(let u=c.length-1;u>=0;u--){const f=c[u];if(!f||!an.IsVisible(f,i.visibleOnly))continue;const h=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null;if(!(h&&!Ay(h,i.x,i.y,l))){if(f instanceof an){if(r&&(!o||o(f))&&typeof f.contains=="function"&&f.contains(i.x,i.y,s)&&(d.push(f),a)||an.VisitForHitTest(f,i,r,o,s,l,a))return!0;continue}if(f instanceof zn&&!(o&&!o(f))&&typeof f.contains=="function"&&f.contains(i.x,i.y,s)&&(d.push(f),a))return!0}}return!1}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let i=0;i<an.Properties.length;i++){const r=an.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new an,r=this.children.map(function(o){return o.clone()});return i.add(r),i.opacity=this.opacity,this.mask&&(i.mask=this.mask),i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.className=this.className,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,oe.each(this.children,(i,r)=>{e.children[r]=i.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const i=this.children[e];typeof i.dispose=="function"&&i.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}getShapesAtPoint(e,i,r){const o=r||{},{results:s,hitOptions:l,context:a,single:c,empty:d}=l0.getShapesAtPoint;s.length=0;const u=o.mode==="deepest"||o.deepest?"deepest":"all",f=o.visibleOnly!==!1,h=!!o.includeGroups,m=typeof o.filter=="function"?o.filter:null,p=typeof o.tolerance=="number"?o.tolerance:0;typeof o.precision=="number"?l.precision=o.precision:delete l.precision,typeof o.fill<"u"?l.fill=o.fill:delete l.fill,typeof o.stroke<"u"?l.stroke=o.stroke:delete l.stroke,l.tolerance=p,l.ignoreVisibility=!f;const g=u==="deepest";if(a.x=e,a.y=i,a.visibleOnly=f,a.results=s,an.VisitForHitTest(this,a,h,m,l,p,g),g){if(s.length>0){const y=s[0];return s.length=0,c[0]=y,c.length=1,c}return d.length=0,d}const b=s.slice();return s.length=0,b}corner(){const e=this.getBoundingClientRect(!0);for(let i=0;i<this.children.length;i++){const r=this.children[i];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),i=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const s=this.children[o];s.isShape&&(s.translation.x-=i,s.translation.y-=r)}return this.mask&&(this.mask.translation.x-=i,this.mask.translation.y-=r),this}getById(e){let i=null;function r(o){if(o.id===e)return o;if(o.children){if(o.children.ids[e])return o.children.ids[e];for(let s=0;s<o.children.length;s++)if(i=r(o.children[s]),i)return i}return null}return r(this)}getByClassName(e){const i=[];function r(o){if(Array.prototype.indexOf.call(o.classList,e)>=0&&i.push(o),o.children)for(let s=0;s<o.children.length;s++){const l=o.children[s];r(l)}return i}return r(this)}getByType(e){const i=[];function r(o){if(o instanceof e&&i.push(o),o.children)for(let s=0;s<o.children.length;s++){const l=o.children[s];r(l)}return i}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let i=0;i<e.length;i++){const r=e[i];if(!(r&&r.id))continue;const o=Array.prototype.indexOf.call(this.children,r);o>=0&&this.children.splice(o,1),this.children.push(r)}return this}remove(e){const i=arguments.length,r=this.parent;if(i<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let o=0;o<e.length;o++){const s=e[o];if(!s||!this.children.ids[s.id])continue;const l=this.children.indexOf(s);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(e){let i,r,o,s,l,a;this._update(!0);let c=1/0,d=-1/0,u=1/0,f=-1/0;const h=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||h.test(p._renderer.type))&&(i=p.getBoundingClientRect(e),o=typeof i.top!="number"||oe.isNaN(i.top)||!isFinite(i.top),s=typeof i.left!="number"||oe.isNaN(i.left)||!isFinite(i.left),l=typeof i.right!="number"||oe.isNaN(i.right)||!isFinite(i.right),a=typeof i.bottom!="number"||oe.isNaN(i.bottom)||!isFinite(i.bottom),!(o||s||l||a)))if(e){const[g,b]=r.multiply(i.left,i.top),[y,_]=r.multiply(i.right,i.top),[k,x]=r.multiply(i.left,i.bottom),[v,N]=r.multiply(i.right,i.bottom);u=vo(b,_,x,N,u),c=vo(g,y,k,v,c),d=So(g,y,k,v,d),f=So(b,_,x,N,f)}else u=vo(i.top,u),c=vo(i.left,c),d=So(i.right,d),f=So(i.bottom,f)}return{top:u,left:c,right:d,bottom:f,width:d-c,height:f-u}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(i){i.subdivide.apply(i,e)}),this}_update(){let e,i,r;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),l=this.length;let a=0;const c=o*l,d=s*l;for(e=0;e<this.children.length;e++)r=this.children[e],i=r.length,c>a+i?(r.beginning=1,r.ending=1):d<a?(r.beginning=0,r.ending=0):c>a&&c<a+i?(r.beginning=(c-a)/i,r.ending=1):d>a&&d<a+i?(r.beginning=0,r.ending=(d-a)/i):(r.beginning=0,r.ending=1),a+=i}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(rl,"Children",Gc),S(rl,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var pt=rl,gd={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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=pt.InsertChildren.bind(this),i=pt.RemoveChildren.bind(this),r=pt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&i(this._children)),this._children=new Gc(t),this._children.bind(ee.Types.insert,e),this._children.bind(ee.Types.remove,i),this._children.bind(ee.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,oe.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 i=this.children[e];i.strokeAttenuation!==void 0&&(i.strokeAttenuation=t)}}}};function yd(t,e){const i=t.parent;let r;if(i===e){o();return}if(i&&i.children.ids[t.id]&&(r=Array.prototype.indexOf.call(i.children,t),i.children.splice(r,1),s()),e){o();return}s(),i._flagAdditions&&i.additions.length===0&&(i._flagAdditions=!1),i._flagSubtractions&&i.subtractions.length===0&&(i._flagSubtractions=!1),delete t.parent;function o(){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 s(){r=Array.prototype.indexOf.call(i.additions,t),r>=0&&i.additions.splice(r,1),r=Array.prototype.indexOf.call(i.subtractions,t),r<0&&(i.subtractions.push(t),i._flagSubtractions=!0)}}var Bo=class extends Re{constructor(e,i,r,o){const s=[new $e(e,i),new $e(r,o)];super(s);for(let l in bd)Object.defineProperty(this,l,bd[l]);this.vertices[0].command=ie.move,this.vertices[1].command=ie.line,this.automatic=!1}};S(Bo,"Properties",["left","right"]);var bd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(oe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ie.move;else{const e=new Lt("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(oe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ie.line;else{const e=new Lt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},vn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},a0={start:"left",middle:"center",end:"right"},_d=["id","class","transform","xmlns","viewBox"],c0=["x","y","width","height","href","xlink:href"];function d0(t){return a0[t]}function u0(t){const e=t.getAttribute("dominant-baseline"),i=t.getAttribute("alignment-baseline");return e||i}function Rr(t){return t.replace(/svg:/gi,"").toLowerCase()}function wd(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const i=e.length();e.x=i*Math.cos(t.rotation),e.y=i*Math.sin(t.rotation)}}function f0(t,e){e||(e={});const i=t.split(";");for(let r=0;r<i.length;r++){const o=i[r].split(":"),s=o[0],l=o[1];if(typeof s>"u"||typeof l>"u")continue;const a=s.replace(/\s/g,""),c=l.replace(/\s/g,"");e[a]=c}return e}function h0(t){const e={},i=m0(t),r=Math.max(i.length,t.style.length);for(let o=0;o<r;o++){const s=t.style[o],l=i[o];s&&(e[s]=t.style[s]),l&&(e[l]=t.getAttribute(l))}return e}function m0(t){const e=t.getAttributeNames();for(let i=0;i<_d.length;i++){const r=_d[i],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function p0(t,e){const i=e.split(/[\s,]/),r=-parseFloat(i[0]),o=-parseFloat(i[1]),s=parseFloat(i[2]),l=parseFloat(i[3]);if(r&&o)for(let f=0;f<t.children.length;f++){const h=t.children[f];"translation"in h?h.translation.add(r,o):"x"in h?h.x=r:"y"in h&&(h.y=o)}const a=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return a&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new re(1,1)),d&&(t.scale.x=t.width/s),u&&(t.scale.y=t.height/l),t.mask=new si(0,0,s,l),t.mask.origin.set(-s/2,-l/2),t}function nn(t,e,i){const r={},o={},s={};let l,a,c,d,u,f,h,m,p,g,b,y,_,k,x,v,N;if(t===null)return r;if(Ke.getComputedStyle){const w=Ke.getComputedStyle(t);for(l=w.length;l--;)c=w[l],d=w[c],typeof d<"u"&&(r[c]=d)}for(l=0;l<t.attributes.length;l++)f=t.attributes[l],/style/i.test(f.nodeName)?f0(f.value,s):o[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),i&&oe.defaults(r,i),oe.extend(r,s,o),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(a=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,a===null))break;switch(h=wi(a),e._renderer.type){case"linear-gradient":wd(h,e.left),wd(h,e.right);break;case"radial-gradient":e.center.x+=h.translateX,e.center.y+=h.translateY,e.focal.x+=h.translateX,e.focal.y+=h.translateY,e.radius*=Math.max(h.scaleX,h.scaleY);break}break;case"transform":if(/none/i.test(d)||(a=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,a===null))break;h=wi(a),e.translation.set(h.translateX,h.translateY),e.rotation=Math.PI*(h.rotation/180),e.scale=new re(h.scaleX,h.scaleY),m=parseFloat((r.x+"").replace("px")),p=parseFloat((r.y+"").replace("px")),m&&(e.translation.x=m),p&&(e.translation.y=p);break;case"visible":if(e instanceof pt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof pt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof pt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof pt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof pt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof pt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(vn.cssBackgroundImage.test(d)&&(g=d.replace(vn.cssBackgroundImage,"$1"),Ue.defs.current&&Ue.defs.current.contains(g)&&(y=Ue.defs.current.get(g),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=Rr(y.nodeName),e.mask=Ue[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof pt?"_":"")+c,vn.cssBackgroundImage.test(d)?(g=d.replace(vn.cssBackgroundImage,"$1"),Ue.defs.current&&Ue.defs.current.contains(g)?(y=Ue.defs.current.get(g),y.object||(_=Rr(y.nodeName),y.object=Ue[_].call(this,y,{})),y=y.object):(b=y0(this),y=b.getById(g)),e[u]=y):e[u]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(k=e instanceof ut,x=e instanceof Ge,v=e instanceof Ze,k||x||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Lt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof Cn&&(e.family=d);break;case"font-size":e instanceof Cn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Lt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof Cn&&(e.weight=d);break;case"font-style":e instanceof Cn&&(e.style=d);break;case"text-decoration":e instanceof Cn&&(e.decoration=d);break;case"line-height":e instanceof Cn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function g0(t,e){for(let i=0,r=t.childNodes.length;i<r;i++){const o=t.childNodes[i];!o.id||Rr(t.nodeName)==="#text"||e.add(o.id,o)}}function y0(t){for(;t.parent;)t=t.parent;return t.scene}var Ue={svg:function(t){const e=Ue.defs.current=new fo,i=t.getElementsByTagName("defs");for(let p=0;p<i.length;p++)g0(i[p],e);const r=Ue.g.call(this,t),o=t.getAttribute("viewBox"),s=t.getAttribute("x"),l=t.getAttribute("y"),a=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=o!==null,u=s!==null,f=l!==null,h=a!==null,m=c!==null;return u&&(r.x=parseFloat(s.replace(vn.unitSuffix,""))),f&&(r.y=parseFloat(l.replace(vn.unitSuffix,""))),h&&(r.width=parseFloat(a.replace(vn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(vn.unitSuffix,""))),d&&p0(r,o),delete Ue.defs.current,r},defs:function(t){return null},use:function(t,e){let i;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return i=new Lt("encountered <use /> with no href."),console.warn(i.name,i.message),null;const o=r.slice(1);if(!Ue.defs.current.contains(o))return i=new Lt("unable to find element for reference "+r+"."),console.warn(i.name,i.message),null;const l=Ue.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=c0.includes(d.nodeName),f=!l.hasAttribute(d.nodeName);(u||f)&&l.setAttribute(d.nodeName,d.value)}const a=Rr(l.nodeName);return Ue[a].call(this,l,e)},g:function(t,e){const i=new pt;nn.call(this,t,i,e),this.add(i);const r=h0.call(this,t);for(let o=0,s=t.childNodes.length;o<s;o++){const l=t.childNodes[o],a=l.nodeName;if(!a)return;const c=Rr(a);if(c in Ue){const d=Ue[c].call(i,l,r);d&&!d.parent&&i.add(d)}}return i},polygon:function(t,e){let i;typeof t=="string"?i=t:i=t.getAttribute("points");const r=[];i.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(s,l,a){r.push(new $e(parseFloat(l),parseFloat(a)))});const o=new Re(r,!0);return o.stroke="none",o.fill="black",nn.call(this,t,o,e),o},polyline:function(t,e){const i=Ue.polygon.call(this,t,e);return i.closed=!1,i},path:function(t,e){let i;typeof t=="string"?(i=t,t=null):i=t.getAttribute("d");let r=[],o=!1,s=!1;if(i){let a=new $e,c,d,u=i.match(/[a-df-z][^a-df-z]*/gi);const f=u.length-1;oe.each(u.slice(0),function(h,m){const p=h.slice(1).trim().match(vn.path),g=h[0],b=g.toLowerCase();let y,_,k,x,v;const N=[];switch(m===0&&(u=[]),b){case"h":case"v":p.length>1&&(y=1);break;case"m":case"l":case"t":p.length>2&&(y=2);break;case"s":case"q":p.length>4&&(y=4);break;case"c":p.length>6&&(y=6);break;case"a":p.length>7&&(y=7);break}if(y){for(_=0,k=p.length,v=0;_<k;_+=y){if(x=g,v>0)switch(g){case"m":x="l";break;case"M":x="L";break}N.push(x+p.slice(_,_+y).join(" ")),v++}u=Array.prototype.concat.apply(u,N)}else u.push(h)}),oe.each(u,function(h,m){let p,g,b;const y=h[0],_=y.toLowerCase();d=h.slice(1).trim().match(vn.path),s=y===_;let k,x,v,N,w,T,C,$,E,V,P,I,K,J,Z,L,O;switch(_){case"z":if(m>=f)o=!0;else{g=a.x,b=a.y,p=new $e(g,b,void 0,void 0,void 0,void 0,ie.close);for(let z=r.length-1;z>=0;z--){const M=r[z];if(/m/i.test(M.command)){a=M;break}}}break;case"m":case"l":c=void 0,g=parseFloat(d[0]),b=parseFloat(d[1]),p=new $e(g,b,void 0,void 0,void 0,void 0,/m/i.test(_)?ie.move:ie.line),s&&p.addSelf(a),a=p;break;case"h":case"v":V=/h/i.test(_)?"x":"y",P=/x/i.test(V)?"y":"x",p=new $e(void 0,void 0,void 0,void 0,void 0,void 0,ie.line),p[V]=parseFloat(d[0]),p[P]=a[P],s&&(p[V]+=a[V]),a=p;break;case"c":case"s":k=a.x,x=a.y,c||(c=new re),/c/i.test(_)?(v=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[2]),T=parseFloat(d[3]),C=parseFloat(d[4]),$=parseFloat(d[5])):(E=Ms(a,c,s),v=E.x,N=E.y,w=parseFloat(d[0]),T=parseFloat(d[1]),C=parseFloat(d[2]),$=parseFloat(d[3])),s&&(v+=k,N+=x,w+=k,T+=x,C+=k,$+=x),a.controls.right.set(v-a.x,N-a.y),p=new $e(C,$,w-C,T-$,void 0,void 0,ie.curve),a=p,c=p.controls.left;break;case"t":case"q":k=a.x,x=a.y,c||(c=new re),/q/i.test(_)?(v=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[0]),T=parseFloat(d[1]),C=parseFloat(d[2]),$=parseFloat(d[3])):(E=Ms(a,c,s),v=E.x,N=E.y,w=E.x,T=E.y,C=parseFloat(d[0]),$=parseFloat(d[1])),s&&(v+=k,N+=x,w+=k,T+=x,C+=k,$+=x),a.controls.right.set((v-a.x)*.33,(N-a.y)*.33),p=new $e(C,$,w-C,T-$,void 0,void 0,ie.curve),a=p,c=p.controls.left;break;case"a":k=a.x,x=a.y,K=parseFloat(d[0]),J=parseFloat(d[1]),Z=parseFloat(d[2]),L=parseFloat(d[3]),O=parseFloat(d[4]),C=parseFloat(d[5]),$=parseFloat(d[6]),s&&(C+=k,$+=x),I=new $e(C,$),I.command=ie.arc,I.rx=K,I.ry=J,I.xAxisRotation=Z,I.largeArcFlag=L,I.sweepFlag=O,p=I,a=I,c=void 0;break}p&&(Array.isArray(p)?r=r.concat(p):r.push(p))})}i=new Re(r,o,void 0,!0),i.stroke="none",i.fill="black";const l=i.getBoundingClientRect(!0);return l.centroid={x:l.left+l.width/2,y:l.top+l.height/2},oe.each(i.vertices,function(a){a.subSelf(l.centroid)}),nn.call(this,t,i,e),i.translation.addSelf(l.centroid),i},circle:function(t,e){const i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("r")),s=new xo(0,0,o);return s.stroke="none",s.fill="black",nn.call(this,t,s,e),s.translation.x=i,s.translation.y=r,s},ellipse:function(t,e){const i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("rx")),s=parseFloat(t.getAttribute("ry")),l=new ko(0,0,o,s);return l.stroke="none",l.fill="black",nn.call(this,t,l,e),l.translation.x=i,l.translation.y=r,l},rect:function(t,e){const i=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!oe.isNaN(i)||!oe.isNaN(r))return Ue["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),l=o/2,a=s/2,c=new si(0,0,o,s);return c.stroke="none",c.fill="black",nn.call(this,t,c,e),c.translation.x+=l,c.translation.y+=a,c},"rounded-rect":function(t,e){const i=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),l=o/2,a=s/2,c=new re(i,r),d=new Co(0,0,o,s,c);return d.stroke="none",d.fill="black",nn.call(this,t,d,e),d.translation.x+=l,d.translation.y+=a,d},line:function(t,e){const i=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),o=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),l=new Bo(i,r,o,s).noFill();return nn.call(this,t,l,e),l},lineargradient:function(t,e){let i=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");i||(i="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("x1")||0),s=parseFloat(t.getAttribute("y1")||0),l=parseFloat(t.getAttribute("x2")||0),a=parseFloat(t.getAttribute("y2")||0);const c=(l+o)/2,d=(a+s)/2;/userSpaceOnUse/i.test(i)&&(o-=c,s-=d,l-=c,a-=d);const u=[];for(let h=0;h<t.children.length;h++){const m=t.children[h];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let g=m.getAttribute("stop-color"),b=m.getAttribute("stop-opacity"),y=m.getAttribute("style"),_;g===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,g=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),u.push(new oi(p,g,b))}const f=new Ge(o,s,l,a,u);return f.spread=r,f.units=i,nn.call(this,t,f,e),f},radialgradient:function(t,e){let i=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");i||(i="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("cx"))||0,s=parseFloat(t.getAttribute("cy"))||0,l=parseFloat(t.getAttribute("r")),a=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));oe.isNaN(a)&&(a=o),oe.isNaN(c)&&(c=s);const d=Math.abs(o+a)/2,u=Math.abs(s+c)/2;/userSpaceOnUse/i.test(i)&&(o-=d,s-=u,a-=d,c-=u);const f=[];for(let m=0;m<t.children.length;m++){const p=t.children[m];let g=p.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let b=p.getAttribute("stop-color"),y=p.getAttribute("stop-opacity"),_=p.getAttribute("style"),k;b===null&&(k=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=k&&k.length>1?k[1]:void 0),y===null?(k=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=k&&k.length>1?parseFloat(k[1]):1):y=parseFloat(y),f.push(new oi(g,b,y))}const h=new Ze(o,s,l,f,a,c);return h.spread=r,h.units=i,nn.call(this,t,h,e),h},text:function(t,e){const i=d0(t.getAttribute("text-anchor"))||"left",r=u0(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new Cn(o);return nn.call(this,t,s,e),s.alignment=i,s.baseline=r,s},clippath:function(t,e){return Ue.defs.current&&!Ue.defs.current.contains(t.id)&&Ue.defs.current.add(t.id,t),null},image:function(t,e){let i;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return i=new Lt("encountered <image /> with no href."),console.warn(i.name,i.message),null;const o=parseFloat(t.getAttribute("x"))||0,s=parseFloat(t.getAttribute("y"))||0,l=parseFloat(t.getAttribute("width")),a=parseFloat(t.getAttribute("height")),c=new wo(r,o,s);return oe.isNaN(l)||(c.width=l),oe.isNaN(a)||(c.height=a),nn.call(this,t,c,e),c}};function xd(t,e){const i=new XMLHttpRequest;return i.open("GET",t),i.onreadystatechange=function(){i.readyState===4&&i.status===200&&e(i.responseText)},i.send(),i}var ol=class An extends si{constructor(e,i,r,o,s,l){super(i,r,o||1,s||1),S(this,"_flagTexture",!1),S(this,"_flagMode",!1),S(this,"_texture",null),S(this,"_mode","fill"),this._renderer.type="image";for(let a in Cd)Object.defineProperty(this,a,Cd[a]);this.noStroke(),this.noFill(),e instanceof De?this.texture=e:typeof e=="string"&&(this.texture=new De(e)),typeof l=="string"&&(this.mode=l),this._update()}static fromObject(e){const i=new An().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<An.Properties.length;i++){const r=An.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new An(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const i=e.image.width,r=e.image.height,o=this.width,s=this.height,l=o/i,a=s/r;switch(this._mode){case An.Modes.fill:{const c=Math.max(l,a);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case An.Modes.fit:{const c=Math.min(l,a);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case An.Modes.crop:break;case An.Modes.tile:{e.offset.x=(i-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case An.Modes.stretch:default:e.scale=new re(l,a),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};S(ol,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),S(ol,"Properties",["texture","mode"]);var kd=ol,Cd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},sl=[],ll=Math.max,b0=Math.min,vd=Math.abs,No=Math.sin,To=Math.cos,_0=Math.acos,$o=Math.sqrt,Fe={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Fe?t:"path"},group:{renderChild:function(t){const e=Fe.getRendererType(t._renderer.type);Fe[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,i=this.parent;this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);const r=this._mask,o=Eo(e),s=!o||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,s&&(t.save(),o||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const l=Fe.getRendererType(r._renderer.type);Fe[l].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let l=0;l<this.children.length;l++){const a=this.children[l],c=Fe.getRendererType(a._renderer.type);Fe[c].render.call(a,t)}return s&&t.restore(),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,i){let r,o,s,l,a,c,d,u,f,h,m,p,g,b,y,_,k,x,v,N,w,T,C,$,E,V,P,I,K,J,Z,L,O,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,K=this._mask,J=this._clip,a=this._opacity*(z||1),c=this._visible,!e&&(!c||J||a===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,l=this._fill,d=this._cap,u=this._join,f=this._miter,h=this._closed,m=this._renderer.vertices,p=m.length,g=p-1,Z=Eo(r),O=this.dashes,Z||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),K){const q=Fe.getRendererType(K._renderer.type);Fe[q].render.call(K,t,!0)}if(l)if(typeof l=="string")t.fillStyle=l;else{const q=Fe.getRendererType(l._renderer.type);Fe[q].render.call(l,t,this),t.fillStyle=l._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const q=Fe.getRendererType(o._renderer.type);Fe[q].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=kn(this)),f&&(t.miterLimit=f),u&&(t.lineJoin=u),!h&&d&&(t.lineCap=d)}typeof a=="number"&&(t.globalAlpha=a),O&&O.length>0&&(t.lineDashOffset=O.offset||0,t.setLineDash(O)),t.beginPath();let M,R,W,U,G,X,j;for(let q=0;q<p;q++)switch(_=m[q],P=_.x,I=_.y,_.command){case ie.close:t.closePath();break;case ie.arc:M=_.rx,R=_.ry,W=_.xAxisRotation,U=_.largeArcFlag,G=_.sweepFlag,b=h?ot(q-1,p):ll(q-1,0),y=m[b],X=y.x,j=y.y,Fe.renderSvgArcCommand(t,X,j,M,R,U,G,W,P,I);break;case ie.curve:b=h?ot(q-1,p):Math.max(q-1,0),y=m[b],C=y.controls&&y.controls.right||re.zero,$=_.controls&&_.controls.left||re.zero,y._relative?(w=C.x+y.x,T=C.y+y.y):(w=C.x,T=C.y),_._relative?(v=$.x+_.x,N=$.y+_.y):(v=$.x,N=$.y),t.bezierCurveTo(w,T,v,N,P,I),q>=g&&h&&(k=x,E=_.controls&&_.controls.right||re.zero,V=k.controls&&k.controls.left||re.zero,_._relative?(w=E.x+_.x,T=E.y+_.y):(w=E.x,T=E.y),k._relative?(v=V.x+k.x,N=V.y+k.y):(v=V.x,N=V.y),P=k.x,I=k.y,t.bezierCurveTo(w,T,v,N,P,I));break;case ie.line:t.lineTo(P,I);break;case ie.move:x=_,t.moveTo(P,I);break}return h&&t.closePath(),!J&&!i&&(Fe.isHidden.test(l)||(L=l._renderer&&l._renderer.offset,L&&(t.save(),t.translate(-l._renderer.offset.x,-l._renderer.offset.y),t.scale(l._renderer.scale.x,l._renderer.scale.y)),t.fill(),L&&t.restore()),Fe.isHidden.test(o)||(L=o._renderer&&o._renderer.offset,L&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),L&&t.restore())),Z||t.restore(),J&&!i&&t.clip(),O&&O.length>0&&t.setLineDash(sl),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,i){let r,o,s,l,a,c,d,u,f,h,m,p,g,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,a=this._opacity*(_||1),c=this._visible,!e&&(!c||a===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,l=this._fill,u=this._renderer.collection,f=u.length,g=Eo(r),y=this.dashes,d=this._size,g||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),l)if(typeof l=="string")t.fillStyle=l;else{const v=Fe.getRendererType(l._renderer.type);Fe[v].render.call(l,t,this),t.fillStyle=l._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const v=Fe.getRendererType(o._renderer.type);Fe[v].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=kn(this))}typeof a=="number"&&(t.globalAlpha=a),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let k=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=wi(x[0],x[3],x[1],x[4],x[2],x[5]),k/=Math.max(x.scaleX,x.scaleY));for(let v=0;v<f;v++)h=u[v],m=h.x,p=h.y,t.moveTo(m+k,p),t.arc(m,p,k,0,tt);return i||(Fe.isHidden.test(l)||(b=l._renderer&&l._renderer.offset,b&&(t.save(),t.translate(-l._renderer.offset.x,-l._renderer.offset.y),t.scale(l._renderer.scale.x,l._renderer.scale.y)),t.fill(),b&&t.restore()),Fe.isHidden.test(o)||(b=o._renderer&&o._renderer.offset,b&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),b&&t.restore())),g||t.restore(),y&&y.length>0&&t.setLineDash(sl),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,i){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,o=this._opacity*r,s=this._visible,l=this._mask,a=this._clip;if(!e&&(!s||a||o===0))return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,f=this._fill,h=this._decoration,m=this._direction,p=Eo(c),g=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Fe.alignments[this._alignment]||this._alignment,_=Fe.baselines[this._baseline]||this._baseline;let k,x,v,N,w,T,C,$,E,V,P;if(p||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),l){const I=Fe.getRendererType(l._renderer.type);Fe[I].render.call(l,t,!0)}if(g||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=m,f)if(typeof f=="string")t.fillStyle=f;else{const I=Fe.getRendererType(f._renderer.type);Fe[I].render.call(f,t,this),t.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const I=Fe.getRendererType(d._renderer.type);Fe[I].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=kn(this))}if(typeof o=="number"&&(t.globalAlpha=o),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!a&&!i&&(Fe.isHidden.test(f)||(f._renderer&&f._renderer.offset?(T=f._renderer.scale.x,C=f._renderer.scale.y,t.save(),t.translate(-f._renderer.offset.x,-f._renderer.offset.y),t.scale(T,C),k=this._size/f._renderer.scale.y,x=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),v=f._renderer.offset.x/f._renderer.scale.x,N=f._renderer.offset.y/f._renderer.scale.y,t.fillText(this.value,v,N),t.restore()):t.fillText(this.value,0,0)),Fe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,C=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,C),k=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,N=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,v,N),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(h)){const I=t.measureText(this.value);let K=1;switch(h){case"underline":E=I.actualBoundingBoxDescent,P=I.actualBoundingBoxDescent;break;case"strikethrough":E=0,P=0,K=.5;break}switch(_){case"top":E+=this._size*K,P+=this._size*K;break;case"baseline":case"bottom":E-=this._size*K,P-=this._size*K;break}switch(y){case"left":case"start":$=0,V=I.width;break;case"right":case"end":$=-I.width,V=0;break;default:$=-I.width/2,V=I.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,E),t.lineTo(V,P),t.stroke()}return p||t.restore(),a&&!i&&t.clip(),b&&b.length>0&&t.setLineDash(sl),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let i,r=this.left._x,o=this.left._y,s=this.right._x,l=this.right._y;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width,o=(o-.5)*i.height,s=(s-.5)*i.width,l=(l-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,l);for(let a=0;a<this.stops.length;a++){const c=this.stops[a];this._renderer.effect.addColorStop(c._offset,c._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let i,r=this.center._x,o=this.center._y,s=this.focal._x,l=this.focal._y,a=this._radius;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width*.5,o=(o-.5)*i.height*.5,s=(s-.5)*i.width*.5,l=(l-.5)*i.height*.5,a*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,l,a);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof re?(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 re||(this._renderer.scale=new re),this._scale instanceof re?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,i,r,o,s,l,a,c,d){a=a*Math.PI/180,r=vd(r),o=vd(o);const u=(e-c)/2,f=(i-d)/2,h=To(a)*u+No(a)*f,m=-No(a)*u+To(a)*f,p=h*h,g=m*m;let b=r*r,y=o*o;const _=p/b+g/y;if(_>1){const I=$o(_);r=I*r,o=I*o,b=r*r,y=o*o}const k=b*g+y*p,x=(b*y-k)/k;let v=$o(ll(0,x));s===l&&(v=-v);const N=v*r*m/o,w=-v*o*h/r,T=To(a)*N-No(a)*w+(e+c)/2,C=No(a)*N+To(a)*w+(i+d)/2,$=Sd(1,0,(h-N)/r,(m-w)/o),E=Sd((h-N)/r,(m-w)/o,(-h-N)/r,(-m-w)/o)%tt,V=$+E;w0(t,T,C,r,o,$,V,l===0,a)}},vt=class extends ee{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new pt,this.scene.parent=this}setSize(t,e,i){return this.width=t,this.height=e,this.ratio=typeof i>"u"?Is(this.ctx):i,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&oe.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(ee.Types.resize,t,e,i)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Fe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};S(vt,"Utils",Fe);function w0(t,e,i,r,o,s,l,a,c){const d=l-s,u=Zi.Tolerance.epsilon,f=Math.abs(d)<u;let h=ot(d,tt);h<u&&(f?h=0:h=tt),a===!0&&!f&&(h===tt?h=-tt:h=h-tt);for(let m=0;m<kt.Resolution;m++){const p=m/(kt.Resolution-1),g=s+p*h;let b=e+r*Math.cos(g),y=i+o*Math.sin(g);if(c!==0){const _=Math.cos(c),k=Math.sin(c),x=b-e,v=y-i;b=x*_-v*k+e,y=x*k+v*_+i}t.lineTo(b,y)}}function Sd(t,e,i,r){const o=t*i+e*r,s=$o(t*t+e*e)*$o(i*i+r*r);let l=_0(ll(-1,b0(1,o/s)));return t*r-e*i<0&&(l=-l),l}function Eo(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ue={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const i=t,r=document.createElementNS(ue.ns,i);return i==="svg"&&(e=oe.defaults(e||{},{version:ue.version})),e&&Object.keys(e).length>0&&ue.setAttributes(r,e),r},setAttributes:function(t,e){const i=Object.keys(e);for(let r=0;r<i.length;r++)/href/.test(i[r])?t.setAttributeNS(ue.xlink,i[r],e[i[r]]):t.setAttribute(i[r],e[i[r]]);return this},removeAttributes:function(t,e){for(let i in e)t.removeAttribute(i);return this},toString:function(t,e){let i=t.length,r=i-1,o,s="";for(let l=0;l<i;l++){const a=t[l],c=e?ot(l-1,i):Math.max(l-1,0),d=t[c];let u,f,h,m,p,g,b,y,_,k,x,v,N,w,T,C=ze(a.x),$=ze(a.y);switch(a.command){case ie.close:u=ie.close;break;case ie.arc:x=a.rx,v=a.ry,N=a.xAxisRotation,w=a.largeArcFlag,T=a.sweepFlag,u=ie.arc+" "+x+" "+v+" "+N+" "+w+" "+T+" "+C+" "+$;break;case ie.curve:b=d.controls&&d.controls.right||re.zero,y=a.controls&&a.controls.left||re.zero,d.relative?(h=ze(b.x+d.x),m=ze(b.y+d.y)):(h=ze(b.x),m=ze(b.y)),a.relative?(p=ze(y.x+a.x),g=ze(y.y+a.y)):(p=ze(y.x),g=ze(y.y)),u=(l===0?ie.move:ie.curve)+" "+h+" "+m+" "+p+" "+g+" "+C+" "+$;break;case ie.move:o=a,u=ie.move+" "+C+" "+$;break;default:u=a.command+" "+C+" "+$}l>=r&&e&&(a.command===ie.curve&&(f=o,_=a.controls&&a.controls.right||a,k=f.controls&&f.controls.left||f,a.relative?(h=ze(_.x+a.x),m=ze(_.y+a.y)):(h=ze(_.x),m=ze(_.y)),f.relative?(p=ze(k.x+f.x),g=ze(k.y+f.y)):(p=ze(k.x),g=ze(k.y)),C=ze(f.x),$=ze(f.y),u+=" C "+h+" "+m+" "+p+" "+g+" "+C+" "+$),a.command!==ie.close&&(u+=" Z")),s+=u+" "}return s},pointsToString:function(t,e){let i="";const r=e*.5;for(let o=0;o<t.length;o++){const s=t[o].x,l=t[o].y-r;i+=ie.move+" "+s+" "+l+" ",i+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return i},getClip:function(t,e){let i=t._renderer.clip;return i||(i=t._renderer.clip=ue.createElement("clipPath",{"clip-rule":"nonzero"})),i.parentNode===null&&e.defs.appendChild(i),i},getRendererType:function(t){return t in ue?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const i=Array.prototype.slice.call(e.children,0);for(let r=0;r<i.length;r++){const o=i[r],s=o.id,l=`[fill="url(#${s})"],[stroke="url(#${s})"],[clip-path="url(#${s})"]`;t.querySelector(l)||e.removeChild(o)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const i=e.nodeName;!i||/(radial|linear)gradient/i.test(i)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=ue.getRendererType(t._renderer.type);ue[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ue.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,i={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const o=this.children[r],s=ue.getRendererType(o._renderer.type);ue[s].render.call(o,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(ue.group.appendChild,i),this._flagSubtractions&&this.subtractions.forEach(ue.group.removeChild,i),this._flagOrder&&this.children.forEach(ue.group.orderChild,i),this._flagMask)if(this._mask){const r=ue.getRendererType(this._mask._renderer.type);ue[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=ue.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ue.getRendererType(this._fill._renderer.type);ue[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ue.getRendererType(this._stroke._renderer.type);ue[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=kn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ue.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ue.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ue.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=ue.getRendererType(this._mask._renderer.type);ue[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const s=this.worldMatrix.elements,l=wi(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(l.scaleX,l.scaleY)}const o=ue.pointsToString(this._renderer.collection,r);e.d=o}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ue.getRendererType(this._fill._renderer.type);ue[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ue.getRendererType(this._stroke._renderer.type);ue[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=kn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ue.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ue.createElement("path",e),t.appendChild(this._renderer.elem)),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=ue.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ue.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ue.getRendererType(this._fill._renderer.type);ue[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ue.getRendererType(this._stroke._renderer.type);ue[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=kn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ue.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ue.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ue.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=ue.getRendererType(this._mask._renderer.type);ue[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const i={};if(this._flagId&&(i.id=this._id),this._flagEndPoints&&(i.x1=this.left._x,i.y1=this.left._y,i.x2=this.right._x,i.y2=this.right._y),this._flagSpread&&(i.spreadMethod=this._spread),this._flagUnits&&(i.gradientUnits=this._units),this._renderer.elem?ue.setAttributes(this._renderer.elem,i):(i.id=this._id,this._renderer.elem=ue.createElement("linearGradient",i)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],l={};s._flagOffset&&(l.offset=100*s._offset+"%"),s._flagColor&&(l["stop-color"]=s._color),s._flagOpacity&&(l["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,l):s._renderer.elem=ue.createElement("stop",l),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const i={};if(this._flagId&&(i.id=this._id),this._flagCenter&&(i.cx=this.center._x,i.cy=this.center._y),this._flagFocal&&(i.fx=this.focal._x,i.fy=this.focal._y),this._flagRadius&&(i.r=this._radius),this._flagSpread&&(i.spreadMethod=this._spread),this._flagUnits&&(i.gradientUnits=this._units),this._renderer.elem?ue.setAttributes(this._renderer.elem,i):(i.id=this._id,this._renderer.elem=ue.createElement("radialGradient",i)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],l={};s._flagOffset&&(l.offset=100*s._offset+"%"),s._flagColor&&(l["stop-color"]=s._color),s._flagOpacity&&(l["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,l):s._renderer.elem=ue.createElement("stop",l),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const i={},r={x:0,y:0},o=this.image;if(this._flagId&&(i.id=this._id),this._flagLoaded&&this.loaded)switch(o.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=o.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(i.x=this._offset.x,i.y=this._offset.y,o&&(i.x-=o.width/2,i.y-=o.height/2,this._scale instanceof re?(i.x*=this._scale.x,i.y*=this._scale.y):(i.x*=this._scale,i.y*=this._scale)),i.x>0&&(i.x*=-1),i.y>0&&(i.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(i.width=0,i.height=0,o)){switch(i.width=o.width,i.height=o.height,this._repeat){case"no-repeat":i.width+=1,i.height+=1;break}this._scale instanceof re?(i.width*=this._scale.x,i.height*=this._scale.y):(i.width*=this._scale,i.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=i.width,r.height=i.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?ue.setAttributes(this._renderer.image,r):this._renderer.image=ue.createElement("image",r)),this._renderer.elem?Object.keys(i).length!==0&&ue.setAttributes(this._renderer.elem,i):(i.id=this._id,i.patternUnits="userSpaceOnUse",this._renderer.elem=ue.createElement("pattern",i)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Bd=class extends ee{constructor(t){super(),this.domElement=t.domElement||ue.createElement("svg"),this.scene=new pt,this.scene.parent=this,this.defs=ue.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,ue.setAttributes(this.domElement,{width:t,height:e}),this.trigger(ee.Types.resize,t,e)}render(){return ue.group.render.call(this.scene,this.domElement),ue.defs.update(this.domElement),this}};S(Bd,"Utils",ue);var rn={create:function(t,e,i){const r=t.createShader(t[i]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const s=t.getShaderInfoLog(r);throw t.deleteShader(r),new Lt("unable to compile shader "+r+": "+s)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var co=function(){return co=Object.assign||function(e){for(var i,r=1,o=arguments.length;r<o;r++){i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},co.apply(this,arguments)},jp={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},On={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ns=500,qp=(function(){function t(e,i){return this.core=e,this.$LG=i,this.settings=co(co({},jp),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var i=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){i.isImageSlide(i.core.index)&&(i.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===i.core.index&&i.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(On.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var i=e.touches[0].pageX,r=e.touches[0].pageY;return{x:i,y:r}},t.prototype.getDragAllowedAxises=function(e,i){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),o=0,s=0,l=r.getBoundingClientRect();e?(o=r.offsetHeight*e,s=r.offsetWidth*e):i?(o=l.height+i*l.height,s=l.width+i*l.width):(o=l.height,s=l.width);var a=o>this.containerRect.height,c=s>this.containerRect.width;return{allowX:c,allowY:a}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,i,r,o){if(!(!this.containerRect||Math.abs(i)<=0)){var s=this.containerRect.width/2+this.containerRect.left,l=this.containerRect.height/2+this.containerRect.top+this.scrollTop,a,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,i),u=d.allowY,f=d.allowX;this.positionChanged&&(a=this.left/(this.scale-i),c=this.top/(this.scale-i),this.pageX=s-a,this.pageY=l-c,this.positionChanged=!1);var h=this.getPossibleSwipeDragCords(i),m,p,g=s-this.pageX,b=l-this.pageY;if(e-i>1){var y=(e-i)/Math.abs(i);g=(i<0?-g:g)+this.left*(y+(i<0?-1:1)),b=(i<0?-b:b)+this.top*(y+(i<0?-1:1)),m=g/y,p=b/y}else{var y=(e-i)*i;m=g*y,p=b*y}r&&(f?this.isBeyondPossibleLeft(m,h.minX)?m=h.minX:this.isBeyondPossibleRight(m,h.maxX)&&(m=h.maxX):e>1&&(m<h.minX?m=h.minX:m>h.maxX&&(m=h.maxX)),u?this.isBeyondPossibleTop(p,h.minY)?p=h.minY:this.isBeyondPossibleBottom(p,h.maxY)&&(p=h.maxY):e>1&&(p<h.minY?p=h.minY:p>h.maxY&&(p=h.maxY))),this.setZoomStyles({x:m,y:p,scale:e}),this.left=m,this.top=p,o&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var i=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,i.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),i.css("width","auto").css("height","auto"),setTimeout(function(){i.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,i=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(i.addClass("no-transition"),e.imageReset=!0)},Ns),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var o=e.getDragAllowedAxises(e.scale);i.css("width",i.get().naturalWidth+"px").css("height",i.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),o.allowX&&o.allowY?i.addClass("reset-transition"):o.allowX&&!o.allowY?i.addClass("reset-transition-x"):!o.allowX&&o.allowY&&i.addClass("reset-transition-y")}},Ns+50)},t.prototype.setZoomStyles=function(e){var i=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),o.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var s="translate3d("+e.x+"px, "+e.y+"px, 0)";i.css("transform",s)},t.prototype.setActualSize=function(e,i){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var o=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!o.src||r.core.outer.hasClass("lg-first-slide-loading"))){var s=r.getCurrentImageActualSizeScale(),l=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(s),r.setPageCords(i),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-l,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ns+110)}},t.prototype.getNaturalWidth=function(e){var i=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):i.get().naturalWidth},t.prototype.getActualSizeScale=function(e,i){var r,o;return e>=i?(r=e/i,o=r||2):o=1,o},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),i=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||i;return this.getActualSizeScale(r,i)},t.prototype.getPageCords=function(e){var i={};if(e)i.x=e.pageX||e.touches[0].pageX,i.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();i.x=r.width/2+r.left,i.y=r.height/2+this.scrollTop+r.top}return i},t.prototype.setPageCords=function(e){var i=this.getPageCords(e);this.pageX=i.x,this.pageY=i.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var i=this.getCurrentImageActualSizeScale();return e<1?e=1:e>i&&(e=i),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var i=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var o=e.$LG(r.target);r.touches.length===1&&o.hasClass("lg-image")&&(i?(clearTimeout(i),i=null,r.preventDefault(),e.setActualSize(e.core.index,r)):i=setTimeout(function(){i=null},300))}),this.core.LGel.on(On.containerResize+".zoom "+On.rotateRight+".zoom "+On.rotateLeft+".zoom "+On.flipHorizontal+".zoom "+On.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var o=e.scale-e.settings.scale;o<1&&(o=1),e.beginZoom(o),e.zoomImage(o,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(On.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(On.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(On.afterSlide+".zoom",function(r){var o=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(o),e.resetImageTranslate(o),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var i=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);i.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,i=0,r=!1,o=1,s=0,l=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(a){if(l=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&a.touches.length===2){if(a.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;o=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(a),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",i=e.getTouchDistance(a)}}),this.core.$inner.on("touchmove.lg",function(a){if(a.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(a.target).hasClass("lg-item")||l.get().contains(a.target))){a.preventDefault();var c=e.getTouchDistance(a),d=i-c;if(!r&&Math.abs(d)>5&&(r=!0),r){s=e.scale;var u=Math.max(1,o+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var f=e.scale-s;e.zoomImage(e.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(a){if(e.core.touchAction==="pinch"&&(e.$LG(a.target).hasClass("lg-item")||l.get().contains(a.target))){if(r=!1,i=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,i,r,o,s){var l=i.x-e.x,a=i.y-e.y,c=Math.abs(l)/s+1,d=Math.abs(a)/s+1;c>2&&(c+=1),d>2&&(d+=1),l=l*c,a=a*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),f={};f.x=this.left+l,f.y=this.top+a;var h=this.getPossibleSwipeDragCords();(Math.abs(l)>15||Math.abs(a)>15)&&(o&&(this.isBeyondPossibleTop(f.y,h.minY)?f.y=h.minY:this.isBeyondPossibleBottom(f.y,h.maxY)&&(f.y=h.maxY)),r&&(this.isBeyondPossibleLeft(f.x,h.minX)?f.x=h.minX:this.isBeyondPossibleRight(f.x,h.maxX)&&(f.x=h.maxX)),o?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(u,f),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,i,r,o,s){var l={};if(o){if(l.y=this.top+(i.y-e.y),this.isBeyondPossibleTop(l.y,s.minY)){var a=s.minY-l.y;l.y=s.minY-a/6}else if(this.isBeyondPossibleBottom(l.y,s.maxY)){var c=l.y-s.maxY;l.y=s.maxY+c/6}}else l.y=this.top;if(r){if(l.x=this.left+(i.x-e.x),this.isBeyondPossibleLeft(l.x,s.minX)){var d=s.minX-l.x;l.x=s.minX-d/6}else if(this.isBeyondPossibleRight(l.x,s.maxX)){var u=l.x-s.maxX;l.x=s.maxX+u/6}}else l.x=this.left;return l},t.prototype.isBeyondPossibleLeft=function(e,i){return e>=i},t.prototype.isBeyondPossibleRight=function(e,i){return e<=i},t.prototype.isBeyondPossibleTop=function(e,i){return e>=i},t.prototype.isBeyondPossibleBottom=function(e,i){return e<=i},t.prototype.isImageSlide=function(e){var i=this.core.galleryItems[e];return this.core.getSlideType(i)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var i=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,o=i.get().getBoundingClientRect(),s=o.height,l=o.width;e&&(s=s+e*s,l=l+e*l);var a=(s-this.containerRect.height)/2,c=(this.containerRect.height-s)/2+r,d=(l-this.containerRect.width)/2,u=(this.containerRect.width-l)/2,f={minY:a,maxY:c,minX:d,maxX:u};return f},t.prototype.setZoomSwipeStyles=function(e,i){e.css("transform","translate3d("+i.x+"px, "+i.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,i={},r={},o=!1,s=!1,l=!1,a=new Date,c=new Date,d,u,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(h){if(e.isImageSlide(e.core.index)&&(f=e.core.getSlideItem(e.core.index),(e.$LG(h.target).hasClass("lg-item")||f.get().contains(h.target))&&h.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){h.preventDefault(),a=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);l=m.allowY,s=m.allowX,(s||l)&&(i=e.getSwipeCords(h)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(h){if(h.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(h.target).hasClass("lg-item")||f.get().contains(h.target))){h.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(h);var m=e.getZoomSwipeCords(i,r,s,l,d);(Math.abs(r.x-i.x)>15||Math.abs(r.y-i.y)>15)&&(o=!0,e.setZoomSwipeStyles(u,m))}}),this.core.$inner.on("touchend.lg",function(h){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(h.target).hasClass("lg-item")||f.get().contains(h.target))){if(h.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!o)return;o=!1,c=new Date;var m=c.valueOf()-a.valueOf();e.touchendZoom(i,r,s,l,m)}})},t.prototype.zoomDrag=function(){var e=this,i={},r={},o=!1,s=!1,l=!1,a=!1,c,d,u,f;this.core.outer.on("mousedown.lg.zoom",function(h){if(e.isImageSlide(e.core.index)){var m=e.core.getSlideItem(e.core.index);if(e.$LG(h.target).hasClass("lg-item")||m.get().contains(h.target)){c=new Date,f=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var p=e.getDragAllowedAxises(0);a=p.allowY,l=p.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(h.target).hasClass("lg-object")&&(l||a)&&(h.preventDefault(),i=e.getDragCords(h),u=e.getPossibleSwipeDragCords(),o=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(h){if(o){s=!0,r=e.getDragCords(h);var m=e.getZoomSwipeCords(i,r,l,a,u);e.setZoomSwipeStyles(f,m)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(h){if(o){if(d=new Date,o=!1,e.core.outer.removeClass("lg-zoom-dragging"),s&&(i.x!==r.x||i.y!==r.y)){r=e.getDragCords(h);var m=d.valueOf()-c.valueOf();e.touchendZoom(i,r,l,a,m)}s=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Xp={ref:"gallery-container",class:"lightgallery-wrapper"},Yp={},Za=n.defineComponent({...Yp,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,i={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=n.useTemplateRef("gallery-container"),o=n.ref(null);return n.onMounted(async()=>{if(!r.value)return;const s=await import("lightgallery");o.value=s.default(r.value,{...e.settings}),A.forOwn(i,(l,a)=>{var c;l&&((c=r.value)==null||c.addEventListener(a,l))})}),n.onBeforeUnmount(()=>{var s;o.value&&((s=o.value)==null||s.destroy(),o.value=null)}),(s,l)=>(n.openBlock(),n.createElementBlock("div",Xp,[n.renderSlot(s.$slots,"default")],512))}}),yt=class yt{static init(){yt.isInitialized||(yt.isInitialized=!0,yt.windowResizeHandler(),window.addEventListener("resize",yt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",yt.windowResizeHandler),yt.isInitialized=!1}static getDeviceTypeByResolution(){const e=H.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Xe.phone:window.innerWidth<e.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(e,i,r){const o=n.ref(r);return yt.setRefValueDependingOnDeviceResolution(o,e,i,r),yt.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:i,defaultValue:r}),o}static isPhoneDevice(){return yt.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return yt.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return yt.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(e,i,r,o){switch(yt.getDeviceTypeByResolution()){case Xe.phone:e.value=i;break;case Xe.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){A.forEach(yt.refsDependingOnDeviceResolution,e=>{yt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};B(yt,"isInitialized",!1),B(yt,"refsDependingOnDeviceResolution",[]);let Ye=yt;const Kp=["href"],Up=["src","alt"],Gp={},Qa=n.defineComponent({...Gp,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const i=n.ref(!1),r=n.ref(!1),o=n.ref({plugins:[Wp,qp],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(Ye.getDeviceTypeByResolution()===Xe.phone?.7:.8),l=n.ref(s()),a=()=>{l.value=s()},c=()=>{i.value=!0};return n.onUnmounted(()=>{window.removeEventListener("resize",a)}),e({show:c}),window.addEventListener("resize",a),(d,u)=>{const f=Ga,h=F.NPopover;return n.openBlock(),n.createBlock(h,{trigger:"manual",show:i.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(i.value=!1)})},{trigger:n.withCtx(()=>[n.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=m=>i.value=!i.value)},[n.renderSlot(d.$slots,"default",{},()=>[n.createVNode(f)])])]),default:n.withCtx(()=>[n.createVNode(Za,{settings:o.value,style:n.normalizeStyle(`max-width: ${l.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,i.value=!1})},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.images,(m,p)=>(n.openBlock(),n.createElementBlock("a",{key:p,href:m.image},[n.createElementVNode("img",{src:m.preview,alt:`Изображение #${p+1}`},null,8,Up)],8,Kp))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Zp={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},Qp={class:"pr-3"},Jp={class:"text-right"},eg={},tg=n.defineComponent({...eg,__name:"product-stock-count",props:{product:{}},setup(t){return(e,i)=>{const r=lo,o=F.NPopover;return n.openBlock(),n.createBlock(o,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:n.withCtx(()=>[n.renderSlot(e.$slots,"default",{},()=>[n.createVNode(r)])]),default:n.withCtx(()=>[n.createElementVNode("div",Zp,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.product.stockCount,(s,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:l},[n.createElementVNode("span",Qp,n.toDisplayString(s.warehouse.name),1),n.createElementVNode("span",Jp,[n.createTextVNode(n.toDisplayString(s.count??"В наличии")+" ",1),s.count?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(n.toDisplayString(t.product.unit.name),1)],64)):n.createCommentVNode("",!0)])],64))),128))])]),_:3})}}}),ng=["innerHTML"],ig=["innerHTML"],rg={class:"m-0 flex list-none flex-col gap-1 p-0 text-sm"},og=["href"],sg={key:1,class:"text-sm text-gray-500"},lg={},Ts=n.defineComponent({...lg,__name:"product-info-content",props:{product:{},size:{default:"medium"},maxHeight:{default:void 0},activeTab:{default:void 0}},setup(t){const e=t,i=n.computed(()=>e.maxHeight?{maxHeight:e.maxHeight}:void 0),r=n.computed(()=>{var c;return((c=e.product.properties)==null?void 0:c.description)??""}),o=n.computed(()=>{var c;return((c=e.product.properties)==null?void 0:c.specification)??""}),s=n.computed(()=>Ss(e.product)),l=n.computed(()=>[r.value?"description":null,o.value?"specification":null,s.value.length>0?"files":null].filter(c=>c!==null)),a=n.ref(e.activeTab&&l.value.includes(e.activeTab)?e.activeTab:l.value[0]);return(c,d)=>{const u=F.NScrollbar,f=F.NTabPane,h=F.NTabs;return l.value.length>0?(n.openBlock(),n.createBlock(h,{key:0,value:a.value,"onUpdate:value":d[0]||(d[0]=m=>a.value=m),size:t.size,type:"line",class:"sc-product-info-content"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(f,{key:0,name:"description",tab:"Описание"},{default:n.withCtx(()=>[n.createVNode(u,{style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"sc-product-info-html",innerHTML:r.value},null,8,ng)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(f,{key:1,name:"specification",tab:"Характеристики"},{default:n.withCtx(()=>[n.createVNode(u,{style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"sc-product-info-html",innerHTML:o.value},null,8,ig)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),s.value.length>0?(n.openBlock(),n.createBlock(f,{key:2,name:"files",tab:`Файлы (${s.value.length})`},{default:n.withCtx(()=>[n.createVNode(u,{style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[n.createElementVNode("ul",rg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value,m=>(n.openBlock(),n.createElementBlock("li",{key:m.id},[n.createElementVNode("a",{href:m.url,target:"_blank",rel:"noopener"},n.toDisplayString(m.typeName),9,og)]))),128))])]),_:1},8,["style"])]),_:1},8,["tab"])):n.createCommentVNode("",!0)]),_:1},8,["value","size"])):(n.openBlock(),n.createElementBlock("span",sg," Описание, характеристики и файлы не заданы. "))}}}),ag={key:0,class:"flex flex-row gap-2.5"},cg={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},dg={},$s=n.defineComponent({...dg,__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:i}){const r=t,o=i,s=n.ref(r.show),l=n.ref(r.processing),a=Ye.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=Ye.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=n.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{o("opening"),s.value=!0,o("update:show",s.value)},f=(m="other",p=!1)=>{if(l.value&&!p){o("processing:cancel",_=>{l.value=_});return}let g=!1;o("closing",m,()=>{g=!0}),g||(s.value=!1,o("update:show",s.value))},h=()=>{o("accept",p=>{l.value=p})};return n.watch(()=>r.show,m=>{m?u():f("other",!0)}),n.watch(()=>r.processing,m=>{l.value=m}),e({open:u,close:f,acceptHandler:h}),(m,p)=>{const g=F.NButton,b=F.NModal;return n.openBlock(),n.createBlock(b,{loading:l.value,show:s.value,"show-icon":!1,size:n.unref(a),style:n.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":m.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:p[1]||(p[1]=y=>f("header")),onEsc:p[2]||(p[2]=y=>f("esc")),onMaskClick:p[3]||(p[3]=y=>f("mask"))},n.createSlots({default:n.withCtx(()=>[n.renderSlot(m.$slots,"default")]),_:2},[m.$slots.header?{name:"header",fn:n.withCtx(()=>[n.renderSlot(m.$slots,"header")]),key:"0"}:void 0,m.$slots.action||m.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:n.withCtx(()=>[m.$slots["extra-action"]?(n.openBlock(),n.createElementBlock("div",ag,[n.renderSlot(m.$slots,"extra-action")])):n.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(n.openBlock(),n.createElementBlock("div",cg,[n.renderSlot(m.$slots,"action",{disabled:l.value}),t.acceptButton.show??!0?(n.openBlock(),n.createBlock(g,{key:0,disabled:l.value||!t.valid,loading:l.value,size:n.unref(a),type:"primary",onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","loading","size"])):n.createCommentVNode("",!0),t.cancelButton.show??!0?(n.openBlock(),n.createBlock(g,{key:1,disabled:l.value,size:n.unref(a),type:"default",onClick:p[0]||(p[0]=y=>f("footer"))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["disabled","size"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),ug={class:"flex flex-col gap-3"},fg={class:"text-xs text-gray-500"},hg={},Ja=n.defineComponent({...hg,__name:"product-info-dialog",props:{product:{},show:{type:Boolean,default:!1},activeTab:{default:void 0}},emits:["update:show"],setup(t,{emit:e}){const i=e,r=()=>{i("update:show",!1)};return(o,s)=>(n.openBlock(),n.createBlock($s,{show:t.show,title:t.product.name,"accept-button":{show:!1},"cancel-button":{show:!0,text:"Закрыть"},"trap-focus":!1,onClosing:r},{default:n.withCtx(()=>[n.createElementVNode("div",ug,[n.createElementVNode("span",fg,"Артикул: "+n.toDisplayString(t.product.code),1),n.createVNode(Ts,{product:t.product,"active-tab":t.activeTab,"max-height":"60vh"},null,8,["product","active-tab"])])]),_:1},8,["show","title"]))}}),mg={class:"flex flex-col gap-2"},pg={class:"flex justify-end border-0 border-t border-solid border-gray-200 pt-2"},gg={},ec=n.defineComponent({...gg,__name:"product-info-popover",props:{product:{}},setup(t){const e=n.ref(!1),i=n.ref(!1),r=n.ref(!1),o=()=>{e.value=!1,i.value=!0,r.value=!0};return(s,l)=>{const a=lo,c=F.NButton,d=F.NPopover;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,{show:e.value,"onUpdate:show":l[0]||(l[0]=u=>e.value=u),width:560,style:{maxWidth:"calc(100vw - 2rem)"},trigger:"click",placement:"bottom-start",class:"sc-product-info-popover"},{trigger:n.withCtx(()=>[n.renderSlot(s.$slots,"default",{},()=>[n.createVNode(a,{title:"Описание и характеристики",class:"cursor-pointer"})])]),default:n.withCtx(()=>[n.createElementVNode("div",mg,[n.createVNode(Ts,{product:t.product,size:"small","max-height":"16rem"},null,8,["product"]),n.createElementVNode("div",pg,[n.createVNode(c,{text:"",type:"info",size:"small",onClick:o},{default:n.withCtx(()=>[...l[2]||(l[2]=[n.createTextVNode(" Открыть полностью ",-1)])]),_:1})])])]),_:3},8,["show"]),i.value?(n.openBlock(),n.createBlock(Ja,{key:0,show:r.value,"onUpdate:show":l[1]||(l[1]=u=>r.value=u),product:t.product},null,8,["show","product"])):n.createCommentVNode("",!0)],64)}}}),yg={class:"flex flex-row justify-between"},bg={key:0,class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},_g={key:1},wg={class:"ml-2 align-sub"},xg={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},kg={key:2,class:"ml-2 align-sub"},Cg={class:"@container"},vg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},Sg={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Bg={class:"text-sc-dark-grey"},Ng={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Tg={class:"text-gray-600"},$g={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Eg={key:3,class:"underline decoration-dashed"},Rg={key:4,class:"sc-product-pack whitespace-nowrap"},Pg={class:"text-gray-600"},Fg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Vg={class:"text-gray-600"},Mg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Ig={key:0},Ag={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Og={},Nr=n.defineComponent({...Og,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showAdditionalSaleIcon:{type:Boolean,default:!1},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const i=t,r=n.computed(()=>A.isFunction(i.showProductCosts)?i.showProductCosts(i.product):i.showProductCosts),o=n.computed(()=>A.sortBy(i.product.priceCoefficients,["coefficient.slug"])),s=n.computed(()=>{var h,m;return(m=(h=i.product)==null?void 0:h.properties)==null?void 0:m.planingIncomingDate}),l=n.useTemplateRef("image-gallery"),a=()=>{var h;(h=l.value)==null||h.show()},c=n.computed(()=>A.isFunction(i.allowNameClick)?i.allowNameClick(i.product):i.allowNameClick),d=n.computed(()=>(A.isFunction(i.showProductInfoButton)?i.showProductInfoButton(i.product):i.showProductInfoButton)&&Wa(i.product)),u=n.computed(()=>{var h;return i.showProductAddToCartButton||i.showProductEditButton||i.showProductRequiredButton||(((h=i.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),f=()=>{var h;c.value&&((h=i.eventEmitter)==null||h.emit("product:name-click",{product:i.product,exposedMethods:{showProductImagesPreview:a}}))};return e({showProductImagesPreview:a}),(h,m)=>{var w,T,C,$;const p=Lp,g=F.NTooltip,b=Ka,y=Op,_=Ga,k=F.NText,x=Ua,v=lo,N=F.NScrollbar;return n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",yg,[n.createVNode(k,{type:"info",class:"sc-product-name text-balance text-base font-medium text-black"},{default:n.withCtx(()=>{var E,V,P,I;return[(E=t.product)!=null&&E.isFavorite||(V=t.product)!=null&&V.isPreviouslyOrdered||t.showAdditionalSaleIcon?(n.openBlock(),n.createElementBlock("div",bg,[((P=t.product)==null?void 0:P.isFavorite)??!1?(n.openBlock(),n.createBlock(g,{key:0,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(p,{class:"!text-yellow-300"})]),default:n.withCtx(()=>[m[0]||(m[0]=n.createTextVNode(" Избранный товар ",-1))]),_:1})):n.createCommentVNode("",!0),((I=t.product)==null?void 0:I.isPreviouslyOrdered)??!1?(n.openBlock(),n.createBlock(g,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(b,{class:"!text-green-700"})]),default:n.withCtx(()=>[m[1]||(m[1]=n.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):n.createCommentVNode("",!0),t.showAdditionalSaleIcon?(n.openBlock(),n.createBlock(g,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(y,{class:"!text-green-500"})]),default:n.withCtx(()=>[m[2]||(m[2]=n.createTextVNode(" Дополнительная продажа ",-1))]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter,"text-gray-400 line-through":t.product.isHidden}),onClick:f},n.toDisplayString(t.product.name),3),t.product.onOrder?(n.openBlock(),n.createElementBlock("span",_g," [Под заказ] ")):n.createCommentVNode("",!0),n.createElementVNode("span",wg,[t.product.images&&t.product.images.length>0?(n.openBlock(),n.createBlock(Qa,{key:0,ref:"image-gallery",images:t.product.images},{default:n.withCtx(()=>[n.createElementVNode("div",xg,[n.createVNode(_)])]),_:1},8,["images"])):n.createCommentVNode("",!0)]),d.value?(n.openBlock(),n.createElementBlock("span",kg,[n.createVNode(ec,{product:t.product},null,8,["product"])])):n.createCommentVNode("",!0)]}),_:1}),u.value?(n.openBlock(),n.createBlock(x,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",Cg,[n.createElementVNode("div",vg,[t.product.supplierSku?(n.openBlock(),n.createElementBlock("div",Sg,[m[3]||(m[3]=n.createTextVNode(" Артикул производителя/поставщика: ",-1)),n.createElementVNode("span",Bg,n.toDisplayString(t.product.supplierSku),1)])):n.createCommentVNode("",!0),t.showCode?(n.openBlock(),n.createElementBlock("span",Ng,[m[4]||(m[4]=n.createTextVNode(" Артикул: ",-1)),n.createElementVNode("span",Tg,n.toDisplayString(t.product.code),1)])):n.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(n.openBlock(),n.createBlock(tg,{key:2,product:t.product},{default:n.withCtx(()=>[n.createElementVNode("span",$g,[m[5]||(m[5]=n.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),n.createVNode(v,{class:"mt-0.5"})])]),_:1},8,["product"])):(n.openBlock(),n.createElementBlock("span",Eg," Нет в наличии ")),t.product.pack??((T=(w=t.product)==null?void 0:w.properties)==null?void 0:T.pack)?(n.openBlock(),n.createElementBlock("span",Rg,[m[6]||(m[6]=n.createTextVNode(" Норма упаковки: ",-1)),n.createElementVNode("span",Pg,n.toDisplayString(t.product.pack??(($=(C=t.product)==null?void 0:C.properties)==null?void 0:$.pack)),1)])):n.createCommentVNode("",!0),t.showPlanningDates&&s.value?(n.openBlock(),n.createElementBlock("span",Fg,[m[7]||(m[7]=n.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),n.createElementVNode("span",Vg,n.toDisplayString(s.value),1)])):n.createCommentVNode("",!0)])]),n.createVNode(N,{"x-scrollable":""},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",Mg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,E=>(n.openBlock(),n.createBlock(ii,{key:E.coefficient.slug,product:t.product,"cost-field-name":E.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),n.createVNode(ii,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):n.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(n.openBlock(),n.createElementBlock("div",Ig,[n.createElementVNode("ul",Ag,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.product.id,slug:t.product.slug},(E,V)=>(n.openBlock(),n.createElementBlock("li",{key:V}," ("+n.toDisplayString(V)+"): "+n.toDisplayString(E),1))),128)):n.createCommentVNode("",!0),t.showProperties?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(t.product.properties,(E,V)=>(n.openBlock(),n.createElementBlock("li",{key:V}," ("+n.toDisplayString(V)+"): "+n.toDisplayString(E),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)])}}}),zg=(t,e,i)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>n.h(ii,{product:r,costFieldName:t,eventEmitter:i.eventEmitter,allowPriceClick:i.allowPriceClick,currencyRates:i.currencyRates})}),Dg=(t,e)=>{if(t.length===0)return[];const i=[],r={};switch(A.isNil(e.isProductItemSelected)||i.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,l;return n.h(F.NCheckbox,{checked:!!((s=e.isProductItemSelected)!=null&&s.call(e,o)),disabled:((l=e.isProductItemSelected)==null?void 0:l.call(e,o))==="disabled",onUpdateChecked:a=>{e.eventEmitter.emit("product:checked",{product:o,checked:a})}})}}),Ye.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:i.push({key:"name",title:"Наименование",className:"align-top",render:o=>n.h(Nr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductInfoButton:e.showProductInfoButton,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:i.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:o=>n.h(Nr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductInfoButton:e.showProductInfoButton,currencyRates:e.currencyRates})}),e.showProductCosts&&(A.forEach(t,o=>{A.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),A.forEach(A.sortBy(r,["slug"]),o=>{i.push(zg(o.slug??"",o.name,e))}),i.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:o=>n.h(ii,{product:o,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!A.isNil(e.productContextButtonsConfig))&&i.push({key:"actions",title:"",className:"align-top",width:"50",render:o=>n.h(Ua,{product:o,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return i},Lg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hg(t,e){return n.openBlock(),n.createElementBlock("svg",Lg,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),n.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const uo=n.markRaw({name:"ion-trash",render:Hg}),Wg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function jg(t,e){return n.openBlock(),n.createElementBlock("svg",Wg,[...e[0]||(e[0]=[n.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const tc=n.markRaw({name:"ion-plus",render:jg}),qg={key:0,class:"flex w-fit items-center gap-2"},Xg={key:1,class:"flex flex-wrap gap-1"},Yg={key:0},Kg={key:2},Ug={},Tr=n.defineComponent({...Ug,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,i=n.computed(()=>{var r,o;return(o=(r=e.product)==null?void 0:r.properties)==null?void 0:o.planingProductionDate});return(r,o)=>{const s=F.NSpin,l=F.NText;return t.isProductSearching?(n.openBlock(),n.createElementBlock("div",qg,[n.createVNode(s,{size:17,class:"w-fit"}),o[0]||(o[0]=n.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(n.openBlock(),n.createElementBlock("div",Xg,[n.createElementVNode("div",null,n.toDisplayString(t.product.code)+" - "+n.toDisplayString(t.product.name)+" - "+n.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+n.toDisplayString(t.product.unit.name),1),i.value?(n.openBlock(),n.createElementBlock("div",Yg,"(Планируемая дата производства: "+n.toDisplayString(i.value)+")",1)):n.createCommentVNode("",!0)])):t.validation?(n.openBlock(),n.createElementBlock("div",Kg,[n.createVNode(l,{type:t.validation.validationStatus},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):n.createCommentVNode("",!0)}}}),Gg={class:"flex flex-col gap-4"},Zg={class:"flex flex-col gap-2"},Qg={class:"mt-8 font-bold"},Jg={class:"grid grow grid-cols-2 items-start gap-2"},ey={key:2,class:"text-red-500 text-sm"},ty={key:3,class:"text-red-500 text-sm mb-2"},ny={class:"flex flex-col gap-4"},iy={key:1},ry={class:"text-lg font-semibold"},oy={class:"flex gap-3"},sy={},ly=n.defineComponent({...sy,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:i}){var b;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.ref(!1),a=n.ref(A.cloneDeep(r.value)),c=n.computed(()=>{var _,k,x;const y={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation((k=r.validation.quantity)==null?void 0:k.feedback)],marker:[We.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return A.forEach(a.value.configuratorParams.linesWidths,(v,N)=>{var C;const T=a.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(T),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((C=r.validation[`lines_widths[${N+1}]`])==null?void 0:C.feedback)]}),A.forEach(a.value.configuratorParams.linesAngles,(v,N)=>{var w;y[`configuratorParams.linesAngles.${N}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${N+1}]`])==null?void 0:w.feedback)]}),y}),d=n.ref(r.settings.canSetDopProdaga??!1),u=n.computed(()=>{var v;const{length:y}=a.value.configuratorParams,{quantity:_}=a.value,k=((v=a.value.product)==null?void 0:v.costRub)||0;if(!y||!_||k===0)return null;const x=y/1e3;return(k*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),f=n.computed(()=>A.reduce(a.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),h=n.computed(()=>{const y=f.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),m=n.computed(()=>{const{configuratorParams:y}=a.value,_=A.every(y.linesWidths,N=>!!(N&&N>0)),k=A.every(y.linesAngles,N=>!A.isNil(N)),x=!!(a.value.quantity&&a.value.quantity>0),v=y.length>0&&y.length>0;return _&&k&&x&&v&&h.value}),p=()=>{n.nextTick(()=>{var y;(y=s.value)==null||y.validate(_=>{_||(o("update:params",a.value.configuratorParams),g("configuratorParams",a.value.configuratorParams))}).catch(A.noop)})},g=(y,_)=>{const k=new H.OrderItemBase(a.value);k[y]=_,y==="configuratorParams"&&(k.product=new H.ClientProduct),o("update:value",k)};return n.watch(()=>r.previewParams,y=>{a.value.configuratorParams.linesWidths=y.linesWidths,a.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),n.watch(()=>r.value,y=>{a.value=A.cloneDeep(y)},{deep:!0}),e({validate:(b=s.value)==null?void 0:b.validate,formReference:s}),(y,_)=>{const k=tc,x=uo,v=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:a.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var N;return[n.createElementVNode("div",Gg,[_[21]||(_[21]=n.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(n.openBlock(),n.createBlock(n.unref(F.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:a.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>a.value.configuratorParams.startTailType=w),p],options:t.settings.startTailConfigs.map(({label:w},T)=>({label:w,value:T})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Zg,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.configuratorParams.linesAngles,(w,T)=>(n.openBlock(),n.createElementBlock("div",{key:T,class:"flex items-start gap-2"},[n.createElementVNode("div",Qg,n.toDisplayString(T+1),1),n.createElementVNode("div",Jg,[n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.linesWidths.${T}`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.linesWidths[T],"onUpdate:value":[C=>a.value.configuratorParams.linesWidths[T]=C,_[2]||(_[2]=C=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=C=>n.unref(lt)(C)),onInput:C=>n.unref(rt)(t.validation,`lines_widths[${T+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.linesAngles.${T}`,label:"Угол сгиба, °"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.linesAngles[T],"onUpdate:value":[C=>a.value.configuratorParams.linesAngles[T]=C,_[4]||(_[4]=C=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=C=>n.unref(lt)(C,!0)),onInput:C=>n.unref(rt)(t.validation,`lines_angles[${T+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(F.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:n.withCtx(()=>[t.settings.showOnlyTemplates?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,size:"medium",onClick:C=>o("click:add-line",T)},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:1,disabled:a.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:C=>o("click:remove-line",T)},{default:n.withCtx(()=>[n.createVNode(x)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(n.openBlock(),n.createBlock(n.unref(F.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:a.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>a.value.configuratorParams.endTailType=w),p],options:t.settings.endTailConfigs.map(({label:w},T)=>({label:w,value:T})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:a.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),h.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ey," Суммарная ширина участков гиба должна быть от "+n.toDisplayString(t.settings.stripMinWidth)+" до "+n.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+n.toDisplayString(f.value)+" мм. ",1)),m.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ty," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((N=t.settings.allTemplates)==null?void 0:N.length)-1?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:4,type:"tertiary",class:"self-start",loading:l.value,onClick:_[6]||(_[6]=w=>o("click:save-template"))},{default:n.withCtx(()=>[..._[20]||(_[20]=[n.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",ny,[n.createVNode(n.unref(F.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:a.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>a.value.configuratorParams.colorSide=w),p],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>a.value.configuratorParams.length=w),_[11]||(_[11]=w=>p())],parse:n.unref(ct),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>n.unref(lt)(w)),onInput:_[10]||(_[10]=w=>n.unref(rt)(t.validation,"length")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>a.value.quantity=w),_[15]||(_[15]=w=>g("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>n.unref(lt)(w,!1)),onInput:_[14]||(_[14]=w=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:a.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{a.value.marker=w??null,g("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(v,{key:0,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{a.value.isAdditionalSale=w??!1,g("isAdditionalSale",w??!1)})},{default:n.withCtx(()=>[..._[22]||(_[22]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),u.value?(n.openBlock(),n.createElementBlock("div",iy,[_[23]||(_[23]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",ry,n.toDisplayString(u.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",oy,[n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||a.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>o("submit",a.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",a.value)]])}}}),nc=cn(ly,[["__scopeId","data-v-ac7f1192"]]);var ic=Object.defineProperty,ay=Object.defineProperties,cy=Object.getOwnPropertyDescriptors,rc=Object.getOwnPropertySymbols,dy=Object.prototype.hasOwnProperty,uy=Object.prototype.propertyIsEnumerable,oc=t=>{throw TypeError(t)},Es=(t,e,i)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$r=(t,e)=>{for(var i in e||(e={}))dy.call(e,i)&&Es(t,i,e[i]);if(rc)for(var i of rc(e))uy.call(e,i)&&Es(t,i,e[i]);return t},Rs=(t,e)=>ay(t,cy(e)),sc=(t,e)=>{for(var i in e)ic(t,i,{get:e[i],enumerable:!0})},S=(t,e,i)=>Es(t,typeof e!="symbol"?e+"":e,i),lc=(t,e,i)=>e.has(t)||oc("Cannot "+i),Dt=(t,e,i)=>(lc(t,e,"read from private field"),i?i.call(t):e.get(t)),ac=(t,e,i)=>e.has(t)?oc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),fy=(t,e,i,r)=>(lc(t,e,"write to private field"),e.set(t,i),i),Pt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(i){return this[i]},t.setAttribute=function(i,r){return this[i]=r,this},t},polyfill:function(t,e){return Pt.shim(t),typeof e<"u"&&(Pt.Image=e),Pt.isHeadless=!0,t}},cc={};sc(cc,{Curve:()=>Zi,getAnchorsFromArcData:()=>py,getComponentOnCubicBezier:()=>Er,getControlPoints:()=>wc,getCurveBoundingBox:()=>yc,getCurveFromPoints:()=>_c,getCurveLength:()=>gc,getReflection:()=>Ms,integrate:()=>bc,subdivide:()=>Vs});var dc={};sc(dc,{HALF_PI:()=>dt,NumArray:()=>xn,TWO_PI:()=>tt,decomposeMatrix:()=>wi,getComputedMatrix:()=>Ps,getEffectiveStrokeWidth:()=>kn,getPoT:()=>hc,lerp:()=>Ft,mod:()=>ot,setMatrix:()=>fc,toFixed:()=>ze});var Ue;typeof window<"u"?Ue=window:typeof global<"u"?Ue=global:typeof self<"u"&&(Ue=self);var uc,tt=Math.PI*2,dt=Math.PI*.5;function wi(t,e,i,r,o,s){let l;return arguments.length<=1?(l=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):l=t,{translateX:o,translateY:s,scaleX:Math.sqrt(l*l+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,l)/Math.PI}}function fc(t){uc=t}function Ps(t,e){e=e&&e.identity()||new uc;let i=t;const r=[];for(;i&&i._matrix;)r.push(i._matrix),i=i.parent;r.reverse();for(let o=0;o<r.length;o++){const l=r[o].elements;e.multiply(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8])}return e}function Ft(t,e,i){return i*(e-t)+t}var Fs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function hc(t){let e=0;for(;Fs[e]&&Fs[e]<t;)e++;return Fs[e]}function ot(t,e){for(;t<0;)t+=e;return t%e}var xn=Ue.Float32Array||Array,hy=Math.floor;function ze(t){return hy(t*1e6)/1e6}function kn(t,e){const i=t._linewidth;if(t.strokeAttenuation)return i;e||(e=t.worldMatrix||Ps(t));const r=wi(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),o=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return o>0?i/o:i}var ie={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},ee=class{constructor(){S(this,"_events",{}),S(this,"_bound",!1)}addEventListener(e,i){return(this._events[e]||(this._events[e]=[])).push(i),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,i){if(!this._events)return this;if(!e&&!i)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let l=this._events[e];if(l){let a=[];if(i)for(let c=0,d=l.length;c<d;c++){let u=l[c];u=u.handler?u.handler:u,i!==u&&a.push(u)}this._events[e]=a}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const i=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...i);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,i,r){const o=this;e&&(s.obj=e,s.name=i,s.handler=r,e.on(i,s));function s(){r.apply(o,arguments)}return o}ignore(e,i,r){return e.off(i,r),this}};S(ee,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(ee,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var mc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ee.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},dn=class _r extends ee{constructor(e=0,i=0){super(),S(this,"_x",0),S(this,"_y",0);for(let r in mc)Object.defineProperty(this,r,mc[r]);this.x=e,this.y=i}static add(e,i){return new _r(e.x+i.x,e.y+i.y)}static sub(e,i){return new _r(e.x-i.x,e.y-i.y)}static subtract(e,i){return _r.sub(e,i)}static ratioBetween(e,i){return(e.x*i.x+e.y*i.y)/(e.length()*i.length())}static angleBetween(e,i){if(arguments.length>=4){const s=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,s)}const r=e.x-i.x,o=e.y-i.y;return Math.atan2(o,r)}static distanceBetween(e,i){return Math.sqrt(_r.distanceBetweenSquared(e,i))}static distanceBetweenSquared(e,i){const r=e.x-i.x,o=e.y-i.y;return r*r+o*o}set(e,i){return this.x=e,this.y=i,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new _r(this.x,this.y)}add(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=i),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=i),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=i),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,i){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=i),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const i=this.x-e.x,r=this.y-e.y;return i*i+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,i){return i=typeof i>"u"?1e-4:i,this.distanceTo(e)<i}lerp(e,i){const r=(e.x-this.x)*i+this.x,o=(e.y-this.y)*i+this.y;return this.set(r,o)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:ze(this.x),y:ze(this.y)}}rotate(e){const i=this.x,r=this.y,o=Math.cos(e),s=Math.sin(e);return this.x=i*o-r*s,this.y=i*s+r*o,this}};S(dn,"zero",new dn),S(dn,"left",new dn(-1,0)),S(dn,"right",new dn(1,0)),S(dn,"up",new dn(0,-1)),S(dn,"down",new dn(0,1));var re=dn,$e=class _s extends re{constructor(e=0,i=0,r=0,o=0,s=0,l=0,a=ie.move){super(e,i),S(this,"controls",{left:new re,right:new re}),S(this,"_command",ie.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 d in pc)Object.defineProperty(this,d,pc[d]);this.command=a,this.relative=!0;const c=_s.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(ee.Types.change,c),this.controls.right.set(s,l).addEventListener(ee.Types.change,c)}static makeBroadcast(e){return i;function i(){e._bound&&e.dispatchEvent(ee.Types.change)}}static fromObject(e){return new _s().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new _s().copy(this)}toObject(){return{x:ze(this.x),y:ze(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:ze(this.rx),ry:ze(this.ry),xAxisRotation:ze(this.xAxisRotation),largeArcFlag:ze(this.largeArcFlag),sweepFlag:ze(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},pc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ee.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ee.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ee.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ee.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ee.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},my=0,kt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.23",PublishDate:"2025-12-22T19:59:24.486Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return my++}},Zi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function Er(t,e,i,r,o){const s=1-t;return s*s*s*e+3*s*s*t*i+3*s*t*t*r+t*t*t*o}function Vs(t,e,i,r,o,s,l,a,c){c=c||Zi.RecursionLimit;const d=c+1;if(Math.abs(t-l)<.001&&Math.abs(e-a)<.001)return[new $e(l,a)];const u=[];for(let f=0;f<d;f++){const h=f/d,m=Er(h,t,i,o,l),p=Er(h,e,r,s,a);u.push(new $e(m,p))}return u}function gc(t,e,i,r,o,s,l,a,c){if(t===i&&e===r&&o===l&&s===a){const b=l-t,y=a-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(l-t),u=6*(t+o)-12*i,f=3*(i-t),h=9*(r-s)+3*(a-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+f,_=(h*b+m)*b+p;return Math.sqrt(y*y+_*_)}return bc(g,0,1,c||Zi.RecursionLimit)}function yc(t,e,i,r,o,s,l,a){const c=[],d=[[],[]];let u,f,h,m,p,g,b,y;for(let v=0;v<2;++v){if(v===0?(f=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*l,h=3*i-3*t):(f=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*a,h=3*r-3*e),Math.abs(u)<.001){if(Math.abs(f)<.001)continue;m=-h/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*h*u,y=Math.sqrt(b),!(b<0)&&(p=(-f+y)/(2*u),0<p&&p<1&&c.push(p),g=(-f-y)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*i+3*x*m*m*o+m*m*m*l,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*a;return d[0][k]=t,d[1][k]=e,d[0][k+1]=l,d[1][k+1]=a,d[0].length=d[1].length=k+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 bc(t,e,i,r){let o=Zi.abscissas[r-2],s=Zi.weights[r-2],l=.5*(i-e),a=l+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(a):0;for(;c<d;){const f=l*o[c];u+=s[c++]*(t(a+f)+t(a-f))}return l*u}function _c(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],l=e?ot(o-1,i):Math.max(o-1,0),a=e?ot(o+1,i):Math.min(o+1,r),c=t[l],d=s,u=t[a];wc(c,d,u),d.command=o===0?ie.move:ie.curve}}function wc(t,e,i){const r=re.angleBetween(t,e),o=re.angleBetween(i,e);let s=re.distanceBetween(t,e),l=re.distanceBetween(i,e),a=(r+o)/2;return s<.001||l<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,l*=.33,o<r?a+=dt:a-=dt,e.controls.left.x=Math.cos(a)*s,e.controls.left.y=Math.sin(a)*s,a-=Math.PI,e.controls.right.x=Math.cos(a)*l,e.controls.right.y=Math.sin(a)*l,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ms(t,e,i){return new re(2*t.x-(e.x+t.x)-(i?t.x:0),2*t.y-(e.y+t.y)-(i?t.y:0))}function py(t,e,i,r,o,s,l){const a=kt.Resolution;for(let c=0;c<a;c++){let d=(c+1)/a;l&&(d=1-d);const u=d*s+o,f=i*Math.cos(u),h=r*Math.sin(u),m=new $e(f,h);m.command=ie.line}}var xc=Array.prototype.slice;function gy(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var oe={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=xc.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=xc.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,i){const r=i||this,o=!gy(t)&&Object.keys(t),s=(o||t).length;for(let l=0;l<s;l++){const a=o?o[l]:l;e.call(r,t[a],a,t)}return t},performance:Ue.performance&&Ue.performance.now?Ue.performance:Date},Kt={hasEventListeners:typeof Ue.addEventListener=="function",bind:function(t,e,i,r){return this.hasEventListeners?t.addEventListener(e,i,!!r):t.attachEvent("on"+e,i),Kt},unbind:function(t,e,i,r){return Kt.hasEventListeners?t.removeEventListeners(e,i,!!r):t.detachEvent("on"+e,i),Kt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,i=Ue.requestAnimationFrame;if(!i){for(let o=0;o<t.length;o++)i=Ue[t[o]+"RequestAnimationFrame"]||i;i=i||r}function r(o,s){const l=new Date().getTime(),a=Math.max(0,16-(l-e)),c=Ue.setTimeout(d,a);e=l+a;function d(){o(l+a)}return c}return i}},Qi=Ue.document?Ue.document.createElement("div"):{};Qi.id="help-two-load",Object.defineProperty(Kt,"temp",{enumerable:!0,get:function(){return oe.isElement(Qi)&&!Ue.document.head.contains(Qi)&&(Qi.style.display="none",Ue.document.head.appendChild(Qi)),Qi}});var Lt=class extends Error{constructor(e){super(),S(this,"name","Two.js"),S(this,"message"),this.message=e}},yy=Ue.devicePixelRatio||1;function by(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Is(t){return yy/by(t)}var fo=class{constructor(){S(this,"map",{})}add(e,i){return this.map[e]=i,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},Ct,ri=class extends Array{constructor(){super(),ac(this,Ct,new ee),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 Dt(this,Ct)}set _events(e){fy(this,Ct,e)}get _bound(){return Dt(this,Ct)._bound}set _bound(e){Dt(this,Ct)._bound=e}addEventListener(){var e;return(e=Dt(this,Ct).addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=Dt(this,Ct).on)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=Dt(this,Ct).bind)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=Dt(this,Ct).removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=Dt(this,Ct).off)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=Dt(this,Ct).unbind)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=Dt(this,Ct).dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=Dt(this,Ct).trigger)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=Dt(this,Ct).listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=Dt(this,Ct).ignore)==null?void 0:e.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(ee.Types.remove,e),arguments.length>2){const i=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ee.Types.insert,i),this.trigger(ee.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(ee.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ee.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,i){const r=[];for(let o=0;o<this.length;o++){const s=this[o];let l;i?l=e.call(i,s,o):l=e(s,o),r.push(l)}return r}};Ct=new WeakMap;var kc=class _m extends ee{constructor(){super(),S(this,"_flagId",!1),S(this,"_flagClassName",!1),S(this,"_renderer",{}),S(this,"_id",kt.Identifier+kt.uniqueId()),S(this,"_className",""),S(this,"classList",[]);for(let e in Cc)Object.defineProperty(this,e,Cc[e])}static fromObject(e){const i=new _m().copy(e);return"id"in e&&(i.id=e.id),i}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const i=this.renderer.ctx;this._renderer.texture&&(i.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(i.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const e=this._renderer.type;return this._renderer={type:e},this}};S(kc,"Properties",["renderer","id","className"]);var Ji=kc,Cc={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)}}},ho,vc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ue.document&&(ho=document.createElement("a"));var un=class Jt extends Ji{constructor(e,i){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 r in Sc)Object.defineProperty(this,r,Sc[r]);if(this._renderer.type="texture",this._renderer.flagOffset=_y.bind(this),this._renderer.flagScale=wy.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new re,typeof i=="function"){const r=(function(){this.unbind(ee.Types.load,r),typeof i=="function"&&i()}).bind(this);this.bind(ee.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const i=new Jt().copy(e);return"id"in e&&(i.id=e.id),i}static getAbsoluteURL(e){return ho?(ho.href=e,ho.href):e}static loadHeadlessBuffer(e,i){e.image.onload=i,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const i=Jt.getAbsoluteURL(e);if(Jt.ImageRegistry.contains(i))return Jt.ImageRegistry.get(i);let r;return Pt.Image?(r=new Pt.Image,Pt.shim(r,"img")):Ue.document?vc.video.test(i)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,i){let r=e.image,o=Jt.getTag(r);e._flagImage&&(/canvas/i.test(o)?Jt.Register.canvas(e,i):(e._src=!Pt.isHeadless&&r.getAttribute("two-src")||r.src,Jt.Register[o](e,i))),e._flagSrc&&(r||(r=Jt.getImage(e.src),e.image=r),o=Jt.getTag(r),Jt.Register[o](e,i))}clone(){const e=new Jt(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof re?e.offset:new re().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(ee.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Jt.load(this,(function(){this.loaded=!0,this.trigger(ee.Types.change).trigger(ee.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(un,"Properties",["src","loaded","repeat","scale","offset","image"]),S(un,"RegularExpressions",vc),S(un,"ImageRegistry",new fo),S(un,"Register",{canvas:function(t,e){t._src="#"+t.id,un.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const i=t.image,r=function(s){!Pt.isHeadless&&i.removeEventListener&&typeof i.removeEventListener=="function"&&(i.removeEventListener("load",r,!1),i.removeEventListener("error",o,!1)),typeof e=="function"&&e()},o=function(s){throw!Pt.isHeadless&&typeof i.removeEventListener=="function"&&(i.removeEventListener("load",r,!1),i.removeEventListener("error",o,!1)),new Lt("unable to load "+t.src)};typeof i.width=="number"&&i.width>0&&typeof i.height=="number"&&i.height>0?r():!Pt.isHeadless&&typeof i.addEventListener=="function"&&(i.addEventListener("load",r,!1),i.addEventListener("error",o,!1)),t._src=un.getAbsoluteURL(t._src),!(!Pt.isHeadless&&i&&i.getAttribute("two-src"))&&(Pt.isHeadless||i.setAttribute("two-src",t.src),un.ImageRegistry.add(t.src,i),Pt.isHeadless?un.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Pt.isHeadless)throw new Lt("video textures are not implemented in headless environments.");const i=function(o){t.image.removeEventListener("canplaythrough",i,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(o){throw t.image.removeEventListener("canplaythrough",i,!1),t.image.removeEventListener("error",r,!1),new Lt("unable to load "+t.src)};t._src=un.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),un.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?i():(t.image.addEventListener("canplaythrough",i,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var De=un,Sc={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=De.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}De.ImageRegistry.contains(i)?this._image=De.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(ee.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ee.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(ee.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function _y(){this._flagOffset=!0}function wy(){this._flagScale=!0}var As=class wn extends Ji{constructor(e,i,r){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 Bc)Object.defineProperty(this,o,Bc[o]);this._renderer.type="stop",this.offset=typeof e=="number"?e:wn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof i=="string"?i:wn.Index<=0?"#fff":"#000",wn.Index=(wn.Index+1)%2}static fromObject(e){const i=new wn().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<wn.Properties.length;i++){const r=wn.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new wn;return oe.each(wn.Properties,function(r){i[r]=this[r]},this),e&&e.stops&&e.stops.push(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",oe.each(wn.Properties,i=>{e[i]=this[i]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(As,"Index",0),S(As,"Properties",["offset","opacity","color"]);var oi=As,Bc={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)}}},Os=class Wi extends Ji{constructor(e){super(),S(this,"_flagStops",!1),S(this,"_flagSpread",!1),S(this,"_flagUnits",!1),S(this,"_spread",""),S(this,"_units","");for(let i in Nc)Object.defineProperty(this,i,Nc[i]);this._renderer.type="gradient",this._renderer.flagStops=xy.bind(this),this._renderer.bindStops=ky.bind(this),this._renderer.unbindStops=Cy.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let i=e.stops;i&&i.length>0&&(i=i.map(o=>o instanceof oi?o:new oi().copy(o)));const r=new Wi(i).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const i=this.stops.map(o=>o.clone()),r=new Wi(i);return oe.each(Wi.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let i=0;i<Wi.Properties.length;i++){const r=Wi.Properties[i];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(i=>i.toObject())};return oe.each(Wi.Properties,i=>{e[i]=this[i]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ee.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(Os,"Stop",oi),S(Os,"Properties",["spread","stops","units"]);var ut=Os,Nc={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,i=this._renderer.unbindStops;this._stops&&this._stops.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),this._stops=new ri((t||[]).slice(0)),this._stops.bind(ee.Types.insert,e).bind(ee.Types.remove,i),e(this._stops)}}};function xy(){this._flagStops=!0}function ky(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Cy(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var zs=class eo extends ut{constructor(e,i,r,o,s){super(s),S(this,"_flagEndPoints",!1),S(this,"_left",null),S(this,"_right",null);for(let l in Tc)Object.defineProperty(this,l,Tc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=vy.bind(this),this.left=new re,this.right=new re,typeof e=="number"&&(this.left.x=e),typeof i=="number"&&(this.left.y=i),typeof r=="number"&&(this.right.x=r),typeof o=="number"&&(this.right.y=o)}static fromObject(e){const i=new eo().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<eo.Properties.length;i++){const r=eo.Properties[i];r in e&&(this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]))}return this}clone(e){const i=this.stops.map(function(o){return o.clone()}),r=new eo(this.left._x,this.left._y,this.right._x,this.right._y,i);return oe.each(ut.Properties,function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(ee.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(zs,"Stop",oi),S(zs,"Properties",["left","right"]);var Ge=zs,Tc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(ee.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ee.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof re&&this._right.unbind(ee.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ee.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function vy(){this._flagEndPoints=!0}var Ds=class ji extends ut{constructor(e,i,r,o,s,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 a in $c)Object.defineProperty(this,a,$c[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Sy.bind(this),this._renderer.flagFocal=By.bind(this),this.center=new re,this.radius=typeof r=="number"?r:1,this.focal=new re,typeof e=="number"&&(this.center.x=e),typeof i=="number"&&(this.center.y=i),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof l=="number"&&(this.focal.y=l)}static fromObject(e){const i=new ji().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<ji.Properties.length;i++){const r=ji.Properties[i];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const i=this.stops.map(function(o){return o.clone()}),r=new ji(this.center._x,this.center._y,this._radius,i,this.focal._x,this.focal._y);return oe.each(ut.Properties.concat(ji.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return oe.each(ji.Properties,function(i){e[i]=this[i]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(ee.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(Ds,"Stop",oi),S(Ds,"Properties",["center","radius","focal"]);var Ze=Ds,$c={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(ee.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ee.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ee.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ee.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Sy(){this._flagCenter=!0}function By(){this._flagFocal=!0}function Ec(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const l=t._lengths[s];if(o>=r)return r-o>=0;o+=l}return!1}function mo(t,e){const i=t._length;if(e<=0)return 0;if(e>=i)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function Rc(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),gc(r,a,o,c,s,d,l,u,i)}function Ls(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),Vs(r,a,o,c,s,d,l,u,i)}function xi(t){switch(t.renderer.type){case"texture":return De.fromObject(t);case"gradient":return ut.fromObject(t);case"linear-gradient":return Ge.fromObject(t);case"radial-gradient":return Ze.fromObject(t)}return t}var Ny=Math.cos,Ty=Math.sin,Pc=Math.tan,Hs=[],Fc=class en extends ee{constructor(e,i,r,o,s,l){super(),S(this,"elements",new xn(9)),S(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,i,r){if(i.length<=3){const N=e;let w,T,C;const $=i[0]||0,E=i[1]||0,V=i[2]||0;return w=N[0]*$+N[1]*E+N[2]*V,T=N[3]*$+N[4]*E+N[5]*V,C=N[6]*$+N[7]*E+N[8]*V,[w,T,C]}const o=e[0],s=e[1],l=e[2],a=e[3],c=e[4],d=e[5],u=e[6],f=e[7],h=e[8],m=i[0],p=i[1],g=i[2],b=i[3],y=i[4],_=i[5],k=i[6],x=i[7],v=i[8];return r=r||new xn(9),r[0]=o*m+s*b+l*k,r[1]=o*p+s*y+l*x,r[2]=o*g+s*_+l*v,r[3]=a*m+c*b+d*k,r[4]=a*p+c*y+d*x,r[5]=a*g+c*_+d*v,r[6]=u*m+f*b+h*k,r[7]=u*p+f*y+h*x,r[8]=u*g+f*_+h*v,r}static fromObject(e){return new en().copy(e)}set(e,i,r,o,s,l,a,c,d){if(typeof i>"u"){const u=e;e=u[0],i=u[1],r=u[2],o=u[3],s=u[4],l=u[5],a=u[6],c=u[7],d=u[8]}return this.elements[0]=e,this.elements[1]=i,this.elements[2]=r,this.elements[3]=o,this.elements[4]=s,this.elements[5]=l,this.elements[6]=a,this.elements[7]=c,this.elements[8]=d,this.trigger(ee.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(ee.Types.change)}identity(){return this.elements[0]=en.Identity[0],this.elements[1]=en.Identity[1],this.elements[2]=en.Identity[2],this.elements[3]=en.Identity[3],this.elements[4]=en.Identity[4],this.elements[5]=en.Identity[5],this.elements[6]=en.Identity[6],this.elements[7]=en.Identity[7],this.elements[8]=en.Identity[8],this.trigger(ee.Types.change)}multiply(e,i,r,o,s,l,a,c,d){if(typeof i>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(ee.Types.change);if(typeof r>"u"&&(r=1),typeof o>"u"){e=e||0,i=i||0,r=r||0,s=this.elements;const I=s[0]*e+s[1]*i+s[2]*r,U=s[3]*e+s[4]*i+s[5]*r,J=s[6]*e+s[7]*i+s[8]*r;return[I,U,J]}const u=this.elements,f=[e,i,r,o,s,l,a,c,d],h=u[0],m=u[1],p=u[2],g=u[3],b=u[4],y=u[5],_=u[6],k=u[7],x=u[8],v=f[0],N=f[1],w=f[2],T=f[3],C=f[4],$=f[5],E=f[6],V=f[7],P=f[8];return this.elements[0]=h*v+m*T+p*E,this.elements[1]=h*N+m*C+p*V,this.elements[2]=h*w+m*$+p*P,this.elements[3]=g*v+b*T+y*E,this.elements[4]=g*N+b*C+y*V,this.elements[5]=g*w+b*$+y*P,this.elements[6]=_*v+k*T+x*E,this.elements[7]=_*N+k*C+x*V,this.elements[8]=_*w+k*$+x*P,this.trigger(ee.Types.change)}inverse(e){const i=this.elements;e=e||new en;const r=i[0],o=i[1],s=i[2],l=i[3],a=i[4],c=i[5],d=i[6],u=i[7],f=i[8],h=f*a-c*u,m=-f*l+c*d,p=u*l-a*d;let g=r*h+o*m+s*p;return g?(g=1/g,e.elements[0]=h*g,e.elements[1]=(-f*o+s*u)*g,e.elements[2]=(c*o-s*a)*g,e.elements[3]=m*g,e.elements[4]=(f*r-s*d)*g,e.elements[5]=(-c*r+s*l)*g,e.elements[6]=p*g,e.elements[7]=(-u*r+o*d)*g,e.elements[8]=(a*r-o*l)*g,e):null}scale(e,i){return arguments.length<=1&&(i=e),this.multiply(e,0,0,0,i,0,0,0,1)}rotate(e){const i=Ny(e),r=Ty(e);return this.multiply(i,-r,0,r,i,0,0,0,1)}translate(e,i){return this.multiply(1,0,e,0,1,i,0,0,1)}skewX(e){const i=Pc(e);return this.multiply(1,i,0,0,1,0,0,0,1)}skewY(e){const i=Pc(e);return this.multiply(1,0,0,i,1,0,0,0,1)}toString(e){return Hs.length=0,this.toTransformArray(e,Hs),Hs.map(ze).join(" ")}toTransformArray(e,i){const r=this.elements,o=!!i,s=r[0],l=r[1],a=r[2],c=r[3],d=r[4],u=r[5];if(e){const f=r[6],h=r[7],m=r[8];if(o){i[0]=s,i[1]=c,i[2]=f,i[3]=l,i[4]=d,i[5]=h,i[6]=a,i[7]=u,i[8]=m;return}return[s,c,f,l,d,h,a,u,m]}if(o){i[0]=s,i[1]=c,i[2]=l,i[3]=d,i[4]=a,i[5]=u;return}return[s,c,l,d,a,u]}toArray(e,i){const r=this.elements,o=!!i,s=r[0],l=r[1],a=r[2],c=r[3],d=r[4],u=r[5];if(e){const f=r[6],h=r[7],m=r[8];if(o){i[0]=s,i[1]=l,i[2]=a,i[3]=c,i[4]=d,i[5]=u,i[6]=f,i[7]=h,i[8]=m;return}return[s,l,a,c,d,u,f,h,m]}if(o){i[0]=s,i[1]=l,i[2]=a,i[3]=c,i[4]=d,i[5]=u;return}return[s,l,a,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new en().copy(this)}};S(Fc,"Identity",[1,0,0,0,1,0,0,0,1]);var ki=Fc;fc(ki);var Vc=class Fa extends Ji{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 e in po)Object.defineProperty(this,e,po[e]);this._renderer.flagMatrix=Mc.bind(this),this.isShape=!0,this.matrix=new ki,this.worldMatrix=new ki,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const i=new Fa().copy(e);return"id"in e&&(i.id=e.id),i}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return po.position.get.apply(this,arguments)}set translation(e){po.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(e,i,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&"visible"in this&&this.visible===!1||!s&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const l=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const a=this.getBoundingClientRect();return a?e>=a.left-l&&e<=a.right+l&&i>=a.top-l&&i<=a.bottom+l:!1}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof re?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const i=new Fa;return i.position.copy(this.position),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof re?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof re?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};S(Vc,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var zn=Vc,po={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ee.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ee.Types.change,this._renderer.flagMatrix),Mc.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 re&&this._scale.unbind(ee.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.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 Ps(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Mc(){this._flagMatrix=!0}var Ic=/^(?:none|transparent)$/i,$y=8,Ws=Number.EPSILON;function Dn(t,e){return{x:t,y:e}}function go(t,e,i=Ws){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function Ac(t,e,i,r){const o=t*i+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+r*r)||1e-12;let l=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(l=-l),l}function Ey(t,e,i){if(!t)return[Dn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Dn(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,l=e.largeArcFlag?1:0,a=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,f=e.y,h=(c-u)/2,m=(d-f)/2,p=Math.cos(s),g=Math.sin(s);let b=p*h+g*m,y=-g*h+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const O=Math.sqrt(x);r*=O,o*=O,_=r*r,k=o*o}const v=_*y*y+k*b*b,N=v===0?0:(_*k-v)/v;let w=Math.sqrt(Math.max(0,N));l===a&&(w=-w);const T=w*r*y/o,C=-w*o*b/r,$=p*T-g*C+(c+u)/2,E=g*T+p*C+(d+f)/2,V=Ac(1,0,(b-T)/r,(y-C)/o),P=Ac((b-T)/r,(y-C)/o,(-b-T)/r,(-y-C)/o)%tt,I=V+P,U=a===0,J=(()=>{const O=I-V,z=Math.abs(O)<Number.EPSILON;let M=ot(O,tt);return M<Number.EPSILON&&(M=z?0:tt),U&&!z&&(M=M===tt?-tt:M-tt),M})(),Z=Math.max(kt.Resolution,Math.max(i*2,1)),L=[];for(let O=1;O<=Z;O++){const z=O/Z,M=V+z*J;let R=$+r*Math.cos(M),W=E+o*Math.sin(M);if(s!==0){const K=R-$,G=W-E,X=Math.cos(s),j=Math.sin(s);R=K*X-G*j+$,W=K*j+G*X+E}L.push(Dn(R,W))}return L}function Ry(t,e=$y){const i=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:i,segments:r};const s=Math.max(1,Math.floor(e));let l=null,a=null,c=null,d=null;const u=(h=!1)=>{if(l){if(h&&a&&c&&!go(a,c)){const m=Dn(a.x,a.y);r.push({a:c,b:m}),l.push(m),c=m}l.length>=3&&a&&c&&go(a,c)&&i.push(l),l=null,a=null,c=null}},f=h=>{if(!c){c=h,l&&l.push(h);return}go(c,h)||(r.push({a:c,b:h}),l&&l.push(h),c=h)};for(let h=0;h<o.length;h++){const m=o[h],p=m.command||(h===0?ie.move:ie.line);if(p===ie.move){u(!1);const g=Dn(m.x,m.y);l=[g],a=g,c=g,d=m;continue}if(d||(d=o[Math.max(h-1,0)]),p===ie.line)f(Dn(m.x,m.y));else if(p===ie.curve){const g=Ls(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];f(Dn(y.x,y.y))}f(Dn(m.x,m.y))}else if(p===ie.arc){const g=Ey(d,m,s);for(let b=0;b<g.length;b++)f(g[b])}else if(p===ie.close){u(!0),d=m;continue}else f(Dn(m.x,m.y));d=m}if(l){const h=!!t._closed||!!t.closed||a&&c&&!go(a,c);u(h)}return{polygons:i,segments:r}}function Py(t,e,i){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let l=s.length-1;for(let a=0;a<s.length;a++){const c=s[l],d=s[a];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),l=a}}return r}function Fy(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<Ws&&Math.abs(s)<Ws){const h=t-i.x,m=e-i.y;return h*h+m*m}const l=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),a=Math.max(0,Math.min(1,l)),c=i.x+a*o,d=i.y+a*s,u=t-c,f=e-d;return u*u+f*f}function Vy(t,e,i){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],l=Fy(e,i,s.a,s.b);l<r&&(r=l)}return Math.sqrt(r)}function My(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Ic.test(i):!0}function Iy(t,e){const i=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&i>0;if(!(i>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!Ic.test(r):!0}function Ay(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,l=t.top-r,a=t.bottom+r;return e>=o&&e<=s&&i>=l&&i<=a}var yo=Number.EPSILON;function bo(t){return typeof t.relative!="boolean"||!!t.relative}function fn(t,e,i,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(i)<yo&&Math.abs(r)<yo){bo(t)?o[e].clear():o[e].set(t.x,t.y);return}bo(t)?o[e].set(i,r):o[e].set(t.x+i,t.y+r)}}function Ht(t,e){fn(t,e,0,0)}function Oy(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:bo(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function er(t,e){const i=Oy(t,e);return Math.abs(i.x)>yo||Math.abs(i.y)>yo}function _o(t){t.command===ie.move||t.command===ie.close||(t.command=er(t,"left")||er(t,"right")?ie.curve:ie.line)}function Oc(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function zy(t,e){return er(e,"right")||er(t,"left")||er(t,"right")||er(e,"left")||t.command===ie.curve||e.command===ie.curve}function tr(t,e,i){return{x:Ft(t.x,e.x,i),y:Ft(t.y,e.y,i)}}function zc(t,e){const i=t.controls&&t.controls[e];return i?bo(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function Dy(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},l=r?zc(t,"right"):$r({},s),a={x:e.x,y:e.y},c=o?zc(e,"left"):$r({},a),d=tr(s,l,i),u=tr(l,c,i),f=tr(c,a,i),h=tr(d,u,i),m=tr(u,f,i),p=tr(h,m,i),g=new $e(p.x,p.y);return Oc(g,t),fn(g,"left",h.x-p.x,h.y-p.y),fn(g,"right",m.x-p.x,m.y-p.y),g.command=ie.curve,{anchor:g,startOut:d,endIn:f}}function Ly(t,e,i,r,o,s){const l=t.length,a=i-e+1;let c=a-1,d=o?Math.min(a,4):1,u=d,f=d;if(r||(u=Math.min(1,e),f=Math.min(1,l-i-1)),c+=u+f,c<=1)return;const h=new Array(c+1);for(let w=0,T=e-u;w<=c;w+=1,T+=1){const C=ot(T,l);h[w]=t[C]}let m=h[0].x+2*h[1].x,p=h[0].y+2*h[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),v=new Array(c+1);for(let w=1;w<c;w+=1){const T=w<b,C=T||s?1:2,$=T?4:s?2:7,E=T?4:s?3:8,V=T?2:s?0:1,P=C/g;g=k[w]=$-P,m=y[w]=E*h[w].x+V*h[w+1].x-P*m,p=_[w]=E*h[w].y+V*h[w+1].y-P*p}x[b]=y[b]/k[b],v[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],v[w]=(_[w]-v[w+1])/k[w];x[c]=(3*h[c].x-x[b])/2,v[c]=(3*h[c].y-v[b])/2;const N=c-f;for(let w=u,T=e;w<=N;w+=1,T+=1){const C=ot(T,l),$=t[C],E=x[w]-$.x,V=v[w]-$.y;o||w<N?fn($,"right",E,V):Ht($,"right"),o||w>u?fn($,"left",-E,-V):Ht($,"left"),_o($)}}function Hy(t,e,i,r,o,s){const l=e||t,a=t,c=i||t,d=re.distanceBetween(l,a),u=re.distanceBetween(a,c),f=r===void 0?.5:r,h=Math.pow(d,f),m=Math.pow(u,f),p=h*h,g=m*m;if(!o&&e){const b=2*g+3*m*h+p,y=3*m*(m+h);if(y!==0){const _=(g*l.x+b*a.x-p*c.x)/y-a.x,k=(g*l.y+b*a.y-p*c.y)/y-a.y;fn(t,"left",_,k)}else Ht(t,"left")}else Ht(t,"left");if(!s&&i){const b=2*p+3*h*m+g,y=3*h*(h+m);if(y!==0){const _=(p*c.x+b*a.x-g*l.x)/y-a.x,k=(p*c.y+b*a.y-g*l.y)/y-a.y;fn(t,"right",_,k)}else Ht(t,"right")}else Ht(t,"right");_o(t)}function Wy(t,e,i,r,o,s){if(!(e&&i)){e||Ht(t,"left"),i||Ht(t,"right"),_o(t);return}const l=e,a=t,c=i,d=re.distanceBetween(l,a),u=re.distanceBetween(a,c),f=d+u,h=r===void 0?.4:r,m={x:l.x-c.x,y:l.y-c.y};if(!o&&f!==0){const p=h*d/f;fn(t,"left",m.x*p,m.y*p)}else Ht(t,"left");if(!s&&f!==0){const p=h*d/f-h;fn(t,"right",m.x*p,m.y*p)}else Ht(t,"right");_o(t)}function jy(t,e,i,r,o,s){const l=s.type,a=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=ot(d,c),f=t[u];if(f.command===ie.move){Ht(f,"left"),Ht(f,"right");continue}const h=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=h===null?null:t[ot(h,c)],g=m===null?null:t[ot(m,c)],b=h===null,y=m===null;l==="geometric"?Wy(f,p,g,a,b,y):Hy(f,p,g,a,b,y)}}var nr=Math.min,ir=Math.max,qy=Math.ceil,Xy=Math.floor,Yy=new re,Ky=new ki,js=class gi extends zn{constructor(e,i,r,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 s in Dc)Object.defineProperty(this,s,Dc[s]);this._renderer.type="path",this._renderer.flagVertices=Lc.bind(this),this._renderer.bindVertices=Hc.bind(this),this._renderer.unbindVertices=Wc.bind(this),this._renderer.flagFill=jc.bind(this),this._renderer.flagStroke=qc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!i,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(e){const i=typeof e.fill=="string"?e.fill:xi(e.fill),r=typeof e.stroke=="string"?e.stroke:xi(e.stroke),o=new gi().copy(Rs($r({},e),{fill:i,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let i=0;i<e.vertices.length;i++){const r=e.vertices[i];r instanceof $e?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new $e().copy(r))}}for(let i=0;i<gi.Properties.length;i++){const r=gi.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new gi;for(let r=0;r<this.vertices.length;r++)i.vertices.push(this.vertices[r].clone());for(let r=0;r<gi.Properties.length;r++){const o=gi.Properties[r];i[o]=this[o]}return i.className=this.className,i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(i=>i.toObject()),oe.each(gi.Properties,i=>{typeof this[i]<"u"&&(this[i].toObject?e[i]=this[i].toObject():e[i]=this[i])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const i=this.vertices[e];typeof i.unbind=="function"&&i.unbind(),i.controls&&(i.controls.left&&typeof i.controls.left.unbind=="function"&&i.controls.left.unbind(),i.controls.right&&typeof i.controls.right.unbind=="function"&&i.controls.right.unbind())}return typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),i=e.width/2,r=e.height/2,o=e.left+e.width/2,s=e.top+e.height/2;for(let l=0;l<this.vertices.length;l++){const a=this.vertices[l];a.x-=o,a.y-=s,a.x+=i,a.y+=r}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=i,this.mask.translation.y-=s,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),i=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o];s.x-=i,s.y-=r}return this.mask&&(this.mask.translation.x-=i,this.mask.translation.y-=r),this}getBoundingClientRect(e){let i,r,o,s,l,a,c=1/0,d=-1/0,u=1/0,f=-1/0;if(this._update(!0),i=e?this.matrix:this.worldMatrix,r=(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:h,scaleY:m}=wi(i.elements[0],i.elements[3],i.elements[1],i.elements[4],i.elements[2],i.elements[5]);typeof h=="number"&&typeof m=="number"&&(r=Math.max(h,m)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(s=0;s<o;s++){a=this._renderer.vertices[s],l=this._renderer.vertices[(s+o-1)%o];const[h,m]=i.multiply(l.x,l.y),[p,g]=i.multiply(a.x,a.y);if(l.controls&&a.controls){let b=l.controls.right.x,y=l.controls.right.y;l.relative&&(b+=l.x,y+=l.y);let[_,k]=i.multiply(b,y),x=a.controls.left.x,v=a.controls.left.y;a.relative&&(x+=a.x,v+=a.y);let[N,w]=i.multiply(x,v);const T=yc(h,m,_,k,N,w,p,g);u=nr(T.min.y-r,u),c=nr(T.min.x-r,c),d=ir(T.max.x+r,d),f=ir(T.max.y+r,f)}else s<=1&&(u=nr(m-r,u),c=nr(h-r,c),d=ir(h+r,d),f=ir(m+r,f)),u=nr(g-r,u),c=nr(p-r,c),d=ir(p+r,d),f=ir(g+r,f)}return{top:u,left:c,right:d,bottom:f,width:d-c,height:f-u}}contains(e,i,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&this.visible===!1||!s&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const l=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const a=this.getBoundingClientRect();if(!a||e<a.left-l||e>a.right+l||i<a.top-l||i>a.bottom+l)return!1;const c=this.worldMatrix,d=c&&c.inverse(Ky);if(!d)return super.contains(e,i,o);const[u,f]=d.multiply(e,i,1),h=typeof o.precision=="number"&&!Number.isNaN(o.precision)?Math.max(1,Math.floor(o.precision)):8,m=My(this,o.fill),p=Iy(this,o.stroke),{polygons:g,segments:b}=Ry(this,h);if(m&&g.length>0&&Py(g,u,f))return!0;if(p&&b.length>0){const y=typeof this.linewidth=="number"?this.linewidth:0;if(y>0&&Vy(b,u,f)<=y/2+l)return!0}return!m&&!p?super.contains(e,i,o):m&&g.length===0?super.contains(e,i,o):!1}getPointAt(e,i){let r,o,s,l,a,c,d,u,f,h,m,p,g,b,y,_=this.length*Math.min(Math.max(e,0),1);const k=this.vertices.length,x=k-1;let v=null,N=null;for(let Z=0,L=this._lengths.length,O=0;Z<L;Z++){if(O+this._lengths[Z]>=_){this._closed?(r=ot(Z,k),o=ot(Z-1,k),Z===0&&(r=o,o=Z)):(r=Z,o=Math.min(Math.max(Z-1,0),x)),v=this.vertices[r],N=this.vertices[o],_-=O,this._lengths[Z]!==0?e=_/this._lengths[Z]:e=0;break}O+=this._lengths[Z]}if(v===null||N===null)return null;if(v){if(!N)return v}else return N;y=N.controls&&N.controls.right,b=v.controls&&v.controls.left,a=N.x,h=N.y,c=(y||N).x,m=(y||N).y,d=(b||v).x,p=(b||v).y,u=v.x,g=v.y,y&&N.relative&&(c+=N.x,m+=N.y),b&&v.relative&&(d+=v.x,p+=v.y),l=Er(e,a,c,d,u),f=Er(e,h,m,p,g);const w=Ft(a,c,e),T=Ft(h,m,e),C=Ft(c,d,e),$=Ft(m,p,e),E=Ft(d,u,e),V=Ft(p,g,e),P=Ft(w,C,e),I=Ft(T,$,e),U=Ft(C,E,e),J=Ft($,V,e);return oe.isObject(i)?(i.x=l,i.y=f,i instanceof $e&&(i.controls.left.x=P,i.controls.left.y=I,i.controls.right.x=U,i.controls.right.y=J,(typeof i.relative!="boolean"||i.relative)&&(i.controls.left.x-=l,i.controls.left.y-=f,i.controls.right.x-=l,i.controls.right.y-=f)),i.t=e,i):(s=new $e(l,f,P-l,I-f,U-l,J-f,this._curved?ie.curve:ie.line),s.t=e,s)}plot(){if(this.curved)return _c(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ie.move:ie.line;return this}smooth(e){const i=e||{},r=i.type||"continuous",o=this._collection,s=o.length;if(s<2)return this;const l=this._closed||s>0&&o[s-1]&&o[s-1].command===ie.close,a=(h,m)=>{if(h==null)return m;if(typeof h=="number"){if(l)return ot(h,s);let g=h;return g<0&&(g+=s),Math.min(Math.max(g,0),s-1)}const p=o.indexOf(h);return p!==-1?p:m},c=l&&i.from===void 0&&i.to===void 0;let d=a(i.from,0),u=a(i.to,s-1);if(d>u)if(l)d-=s;else{const h=d;d=u,u=h}const f=u-d+1;for(let h=0;h<f;h+=1){const m=ot(d+h,s),p=o[m],g=!l&&m===0;p.command===ie.move&&!g&&(p.command=ie.line)}if(r==="continuous"||r==="asymmetric")Ly(o,d,u,l,c,r==="asymmetric");else if(r==="catmull-rom"||r==="geometric"){const h={type:r,factor:i.factor};jy(o,d,u,l,c,h)}else throw new Error(`Path.smooth does not support type "${r}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(e){this._update();const i=this.vertices,r=i.length;if(r<2)return this;const o=[];let s=null,l=null;for(let a=0;a<r;a+=1){const c=i[a];if(!s||c.command===ie.move){const u=c.clone();o.push(u),s=c,l=c;continue}if(zy(c,s)){const f=Ls(c,s,e).length,h=o[o.length-1];let m=h.clone(),p=c.clone(),g=h,b=0;if(f<=1){const y=c.clone();o.push(y)}else{for(let _=1;_<f;_+=1){const k=_/f,x=1-b,v=x<=Number.EPSILON?k:(k-b)/x,N=Dy(m,p,v);fn(g,"right",N.startOut.x-g.x,N.startOut.y-g.y);const w=N.anchor;o.push(w),g=w,m=w.clone(),b=k,fn(p,"left",N.endIn.x-p.x,N.endIn.y-p.y)}const y=c.clone();y.controls.left.copy(p.controls.left),o.push(y)}}else{const u=Ls(c,s,e);for(let h=1;h<u.length;h+=1){const m=u[h];Oc(m,s),Ht(m,"left"),Ht(m,"right"),m.command=ie.line,o.push(m)}const f=c.clone();o.push(f)}s=c,c.command===ie.close&&(s=l)}return this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,i){i||this._update();const o=this.vertices.length-1;let s=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),oe.each(this.vertices,function(a,c){if(c<=0||a.command===ie.move){s=a,this._lengths[c]=0;return}this._lengths[c]=Rc(a,s,e),l+=this._lengths[c],s=a},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,i=this._closed,r=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),s=mo(this,r*this._length),l=mo(this,o*this._length),a=qy(s),c=Xy(l);let d,u,f,h,m,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new $e),p>c&&!u?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),u=m,f=this._collection[p-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(re.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):p>=a&&p<=c&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===c&&Ec(this,o)?(u=m,!i&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===a&&Ec(this,r)&&(d=m,d.command=ie.move,!i&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));a>0&&!d&&(p=a-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,m),m.command=ie.move,this._renderer.vertices.unshift(m),h=this._collection[p+1],h&&h.controls&&(m.controls.left.clear(),h.relative?this._renderer.collection[p+1].controls.left.copy(h.controls.left).lerp(re.zero,m.t):(Yy.copy(h),this._renderer.collection[p+1].controls.left.copy(h.controls.left).lerp(h,m.t))))}return zn.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,zn.prototype.flagReset.call(this),this}};S(js,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(js,"Utils",{getCurveLength:Rc});var Re=js,Dc={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 ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.bind(ee.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";oe.each(this.vertices,function(i){i[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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),t instanceof ri?this._collection=t:this._collection=new ri(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.Types.remove,i),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 Lc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Hc(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Wc(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function jc(){this._flagFill=!0}function qc(){this._flagStroke=!0}var Xc=class to extends Re{constructor(e,i,r,o){const s=[new $e,new $e,new $e,new $e];super(s,!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 Yc)Object.defineProperty(this,l,Yc[l]);this.width=typeof r=="number"?r:1,this.height=typeof o=="number"?o:1,this.origin=new re,typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i),this._update()}static fromObject(e){const i=new to().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<to.Properties.length;i++){const r=to.Properties[i];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof re&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,i=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new $e),this.vertices[0].set(-e,-i).sub(this._origin).command=ie.move,this.vertices[1].set(e,-i).sub(this._origin).command=ie.line,this.vertices[2].set(e,i).sub(this._origin).command=ie.line,this.vertices[3].set(-e,i).sub(this._origin).command=ie.line,this.vertices[4]&&(this.vertices[4].set(-e,-i).sub(this._origin).command=ie.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const i=new to(0,0,this.width,this.height);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix);for(let r=0;r<Re.Properties.length;r++){const o=Re.Properties[r];i[o]instanceof re?i[o].copy(this[o]):i[o]=this[o]}return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};S(Xc,"Properties",["width","height","origin"]);var si=Xc,Yc={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(ee.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ee.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Kc=class no extends si{constructor(e,i,r,o,s,l){super(i,r,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 a in Uc)Object.defineProperty(this,a,Uc[a]);this.noStroke(),this.noFill(),e instanceof De?this.texture=e:typeof e=="string"&&(this.texture=new De(e)),this.origin=new re,this._update(),typeof o=="number"&&(this.columns=o),typeof s=="number"&&(this.rows=s),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(e){const i=new no().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<no.Properties.length;i++){const r=no.Properties[i];r in e&&(this[r]=e[r])}return this}play(e,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=oe.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof i=="number"&&(this._lastFrame=i),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const i=new no(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&i.play(this._firstFrame,this._lastFrame),i.loop=this.loop,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,i=this._columns,r=this._rows;let o,s,l,a,c,d,u,f,h;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){u=e.image.width,f=e.image.height,o=u/i,s=f/r,a=this._amount,this.width!==o&&(this.width=o),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(oe.isNaN(this._lastFrame)&&(this._lastFrame=a-1),l=oe.performance.now()-this._startTime,h=this._lastFrame+1,c=1e3*(h-this._firstFrame)/this._frameRate,this._loop?l=l%c:l=Math.min(l,c),d=Ft(this._firstFrame,h,l/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%i,p=Math.floor(this._index/i),g=-o*m+(u-o)/2,b=-s*p+(f-s)/2;g!==e.offset.x&&(e.offset.x=g),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(Kc,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wo=Kc,Uc={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}}},qs,Gc=class extends ri{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),ac(this,qs,{}),this.attach(e),this.on(ee.Types.insert,this.attach),this.on(ee.Types.remove,this.detach)}get ids(){return Dt(this,qs)}attach(e){for(let i=0;i<e.length;i++){const r=e[i];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let i=0;i<e.length;i++)delete this.ids[e[i].id];return this}};qs=new WeakMap;var Zc=class qi extends Re{constructor(e,i,r,o,s,l,a){const c=a||kt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new $e);super(d,!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",tt),S(this,"_innerRadius",0),S(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Qc)Object.defineProperty(this,u,Qc[u]);typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.startAngle=s),typeof l=="number"&&(this.endAngle=l),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new qi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<qi.Properties.length;i++){const r=qi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,i=this._endAngle,r=this._innerRadius,o=this._outerRadius,s=ot(e,tt)===ot(i,tt),l=r>0,a=this.vertices;let c=l?a.length/2:a.length,d,u=0,f,h,m,p,g,b,y,_,k;for(s?c--:l||(c-=2),f=0,h=c-1;f<c;f++){switch(m=f/h,p=a[u],g=m*(i-e)+e,b=(i-e)/c,y=o*Math.cos(g),_=o*Math.sin(g),f){case 0:d=ie.move;break;default:d=ie.curve}p.command=d,p.x=y,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=o*b/Math.PI,p.controls.left.x=k*Math.cos(g-dt),p.controls.left.y=k*Math.sin(g-dt),p.controls.right.x=k*Math.cos(g+dt),p.controls.right.y=k*Math.sin(g+dt),f===1&&p.controls.left.multiplyScalar(2),f===h&&p.controls.right.multiplyScalar(2)),u++}if(l){for(s?(a[u].command=ie.close,u++):(c--,h=c-1),f=0;f<c;f++)m=f/h,p=a[u],g=(1-m)*(i-e)+e,b=(i-e)/c,y=r*Math.cos(g),_=r*Math.sin(g),d=ie.curve,f<=0&&(d=s?ie.move:ie.line),p.command=d,p.x=y,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=r*b/Math.PI,p.controls.left.x=k*Math.cos(g+dt),p.controls.left.y=k*Math.sin(g+dt),p.controls.right.x=k*Math.cos(g-dt),p.controls.right.y=k*Math.sin(g-dt),f===1&&p.controls.left.multiplyScalar(2),f===h&&p.controls.right.multiplyScalar(2)),u++;a[u].copy(a[0]),a[u].command=ie.line}else s||(a[u].command=ie.line,a[u].x=0,a[u].y=0,u++,a[u].copy(a[0]),a[u].command=ie.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const i=this.innerRadius,r=this.outerRadius,o=this.startAngle,s=this.endAngle,l=this.vertices.length,a=new qi(0,0,i,r,o,s,l);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 c=0;c<Re.Properties.length;c++){const d=Re.Properties[c];a[d]=this[d]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let i=0;i<qi.Properties.length;i++){const r=qi.Properties[i];e[r]=this[r]}return e}};S(Zc,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Xs=Zc,Qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Ys=Math.cos,Ks=Math.sin,Jc=class Xi extends Re{constructor(e,i,r,o){const s=o?Math.max(o,2):4,l=[];for(let a=0;a<s;a++)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 a in ed)Object.defineProperty(this,a,ed[a]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Xi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Xi.Properties.length;i++){const r=Xi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const i=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,o=r*i;for(let s=0;s<this.vertices.length;s++){const a=s/e*tt,c=r*Ys(a),d=r*Ks(a),u=o*Ys(a-dt),f=o*Ks(a-dt),h=o*Ys(a+dt),m=o*Ks(a+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,f),p.controls.right.set(h,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const i=new Xi(0,0,this.radius,this.vertices.length);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix);for(let r=0;r<Re.Properties.length;r++){const o=Re.Properties[r];i[o]=this[o]}return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let i=0;i<Xi.Properties.length;i++){const r=Xi.Properties[i];e[r]=this[r]}return e}};S(Jc,"Properties",["radius"]);var xo=Jc,ed={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Us=Math.cos,Gs=Math.sin,td=class Yi extends Re{constructor(e,i,r,o,s){typeof o!="number"&&typeof r=="number"&&(o=r);const l=s?Math.max(s,2):4,a=[];for(let c=0;c<l;c++)a.push(new $e);super(a,!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 c in nd)Object.defineProperty(this,c,nd[c]);typeof r=="number"&&(this.width=r*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Yi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Yi.Properties.length;i++){const r=Yi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const i=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,o=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*tt,c=r*Us(a),d=o*Gs(a),u=r*i*Us(a-dt),f=o*i*Gs(a-dt),h=r*i*Us(a+dt),m=o*i*Gs(a+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,f),p.controls.right.set(h,m)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const i=this.width/2,r=this.height/2,o=this.vertices.length,s=new Yi(0,0,i,r,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const a=Re.Properties[l];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let i=0;i<Yi.Properties.length;i++){const r=Yi.Properties[i];e[r]=this[r]}return e}};S(td,"Properties",["width","height"]);var ko=td,nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Uy=Math.ceil,Gy=Math.floor,id=class yi extends zn{constructor(e){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",Re.prototype.noFill),S(this,"noStroke",Re.prototype.noStroke),S(this,"corner",Re.prototype.corner),S(this,"center",Re.prototype.center),S(this,"getBoundingClientRect",Re.prototype.getBoundingClientRect),S(this,"_updateLength",Re.prototype._updateLength);for(let i in rd)Object.defineProperty(this,i,rd[i]);this._renderer.type="points",this._renderer.flagVertices=Lc.bind(this),this._renderer.bindVertices=Hc.bind(this),this._renderer.unbindVertices=Wc.bind(this),this._renderer.flagFill=jc.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=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const i=typeof e.fill=="string"?e.fill:xi(e.fill),r=typeof e.stroke=="string"?e.stroke:xi(e.stroke),o=new yi().copy(Rs($r({},e),{fill:i,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let i=0;i<e.vertices.length;i++){const r=e.vertices[i];r instanceof $e?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new $e().copy(r))}for(let i=0;i<yi.Properties.length;i++){const r=yi.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new yi;for(let r=0;r<this.vertices.length;r++)i.vertices.push(this.vertices[r].clone());for(let r=0;r<yi.Properties.length;r++){const o=yi.Properties[r];i[o]=this[o]}return i.className=this.className,i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(i=>i.toObject()),oe.each(yi.Properties,function(i){typeof this[i]<"u"&&(this[i].toObject?e[i]=this[i].toObject():e[i]=this[i])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const i=this.vertices[e];typeof i.unbind=="function"&&i.unbind()}return typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}subdivide(e){this._update();let i=[];for(let r=0;r<this.vertices.length;r++){const o=this.vertices[r],s=this.vertices[r-1];if(!s)continue;const l=o.x,a=o.y,c=s.x,d=s.y,u=Vs(l,a,l,a,c,d,c,d,e);i=i.concat(u)}return this.vertices=i,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),r=mo(this,e*this._length),o=mo(this,i*this._length),s=Uy(r),l=Gy(o);let a=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=s&&d<=l&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[a*2+0]=c.x,this._renderer.vertices[a*2+1]=c.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};S(id,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var Zs=id,rd={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 ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.bind(ee.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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),t instanceof ri?this._collection=t:this._collection=new ri(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.Types.remove,i),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}}},Zy=Math.cos,Qy=Math.sin,od=class Ki extends Re{constructor(e,i,r,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 s in sd)Object.defineProperty(this,s,sd[s]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Ki().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Ki.Properties.length;i++){const r=Ki.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,i=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<i;o++){const s=(o+.5)/e,l=tt*s+Math.PI/2,a=this._width*Zy(l)/2,c=this._height*Qy(l)/2;o>=r?this.vertices.push(new $e(a,c)):this.vertices[o].set(a,c),this.vertices[o].command=o===0?ie.move:ie.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const i=new Ki(0,0,0,this.sides);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.skewX=this.skewX,i.skewY=this.skewY,i.width=this.width,i.height=this.height,this.matrix.manual&&i.matrix.copy(this.matrix);for(let r=0;r<Re.Properties.length;r++){const o=Re.Properties[r];i[o]=this[o]}return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let i=0;i<Ki.Properties.length;i++){const r=Ki.Properties[i];e[r]=this[r]}return e}};S(od,"Properties",["width","height","sides"]);var Qs=od,sd={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}}},ld=class Ui extends Re{constructor(e,i,r,o,s){typeof s>"u"&&typeof r=="number"&&typeof o=="number"&&(s=Math.floor(Math.min(r,o)/12));const l=[];for(let a=0;a<10;a++)l.push(new $e(0,0,0,0,0,0,a===0?ie.move:ie.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 a in ad)Object.defineProperty(this,a,ad[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Jy.bind(this),typeof r=="number"&&(this.width=r),typeof o=="number"&&(this.height=o),(typeof s=="number"||s instanceof re)&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Ui().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Ui.Properties.length;i++){const r=Ui.Properties[i];if(r in e){const o=e[r];/radius/i.test(r)?this[r]=typeof o=="number"||o instanceof re?o:new re().copy(o):typeof o=="number"&&(this[r]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,i=this._height;let r,o;this._radius instanceof re?(r=this._radius.x,o=this._radius.y):(r=this._radius,o=this._radius);let s,l=e/2,a=i/2;s=this.vertices[0],s.x=-(l-r),s.y=-a,s=this.vertices[1],s.x=l-r,s.y=-a,s.controls.left.clear(),s.controls.right.x=r,s.controls.right.y=0,s=this.vertices[2],s.x=l,s.y=-(a-o),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=l,s.y=a-o,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=o,s=this.vertices[4],s.x=l-r,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(l-r),s.y=a,s.controls.left.clear(),s.controls.right.x=-r,s.controls.right.y=0,s=this.vertices[6],s.x=-l,s.y=a-o,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-l,s.y=-(a-o),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-o,s=this.vertices[8],s.x=-(l-r),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const i=this.width,r=this.height,o=this.radius,s=new Ui(0,0,i,r,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const a=Re.Properties[l];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let i=0;i<Ui.Properties.length;i++){const r=Ui.Properties[i];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};S(ld,"Properties",["width","height","radius"]);var Co=ld,ad={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 re&&this._radius.unbind(ee.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(ee.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Jy(){this._flagRadius=!0}var e0=Math.cos,t0=Math.sin,cd=class Gi extends Re{constructor(e,i,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=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 dd)Object.defineProperty(this,l,dd[l]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}static fromObject(e){const i=new Gi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Gi.Properties.length;i++){const r=Gi.Properties[i];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,i=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<i;o++){const s=(o+.5)/e,l=tt*s,a=(o%2?this._outerRadius:this._innerRadius)/2,c=a*e0(l),d=a*t0(l);o>=r?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ie.move:ie.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const i=this.innerRadius,r=this.outerRadius,o=this.sides,s=new Gi(0,0,i,r,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const a=Re.Properties[l];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let i=0;i<Gi.Properties.length;i++){const r=Gi.Properties[i];e[r]=this[r]}return e}};S(cd,"Properties",["innerRadius","outerRadius","sides"]);var Js=cd,dd={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}}},el,ud=Math.min,fd=Math.max;Ue.document&&(el=document.createElement("canvas"));var tl=class tn extends zn{constructor(e,i,r,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 s in hd)Object.defineProperty(this,s,hd[s]);if(this._renderer.type="text",this._renderer.flagFill=n0.bind(this),this._renderer.flagStroke=i0.bind(this),this.value=e,typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!oe.isObject(o))return this;for(let s=0;s<tn.Properties.length;s++){const l=tn.Properties[s];l in o&&(this[l]=o[l])}}static Measure(e){if(el){const i=el.getContext("2d");i.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=i.measureText(e.value,0,0),o=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:o}}else{const i=this.value.length*this.size*tn.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:i,height:r}}}static fromObject(e){const i=typeof e.fill=="string"?e.fill:xi(e.fill),r=typeof e.stroke=="string"?e.stroke:xi(e.stroke),o=new tn().copy(Rs($r({},e),{fill:i,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let i=0;i<tn.Properties.length;i++){const r=tn.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new tn(this.value);i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale;for(let r=0;r<tn.Properties.length;r++){const o=tn.Properties[r];i[o]=this[o]}return this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let i=0;i<tn.Properties.length;i++){const r=tn.Properties[i];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let i,r,o,s,l;this._update(!0),i=e?this.matrix:this.worldMatrix;const{width:a,height:c}=tn.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,o=a+d;break;case"right":r=-(a+d),o=d;break;default:r=-(a/2+d),o=a/2+d}switch(this.baseline){case"middle":s=-(c/2+d),l=c/2+d;break;default:s=-(c+d),l=d}const[u,f]=i.multiply(r,s),[h,m]=i.multiply(r,l),[p,g]=i.multiply(o,s),[b,y]=i.multiply(o,l);return s=ud(f,m,g,y),r=ud(u,h,p,b),o=fd(u,h,p,b),l=fd(f,m,g,y),{top:s,left:r,right:o,bottom:l,width:o-r,height:l-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};S(tl,"Ratio",.6),S(tl,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var Cn=tl,hd={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 ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ge||this._fill instanceof Ze||this._fill instanceof De)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ge||this._stroke instanceof Ze||this._stroke instanceof De)&&this._stroke.bind(ee.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 n0(){this._flagFill=!0}function i0(){this._flagStroke=!0}var nl=class wr extends si{constructor(e,i,r,o){super(i,r,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 s in md)Object.defineProperty(this,s,md[s]);this._renderer.flagTextures=r0.bind(this),this._renderer.bindTextures=o0.bind(this),this._renderer.unbindTextures=s0.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(pd.bind(this)):typeof e=="string"&&(this.textures=[pd(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=wr.DefaultFrameRate,this.index=0}static fromObject(e){const i=new wr().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<wr.Properties.length;i++){const r=wr.Properties[i];r in e&&(this[r]=e[r])}return this}play(e,i,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=oe.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof i=="number"&&(this._lastFrame=i),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const i=new wr(this.textures,this.translation.x,this.translation.y,this.frameRate);return i._loop=this._loop,this._playing&&i.play(),e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(i){return i.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const i=this.textures[e];typeof i.dispose=="function"?i.dispose():typeof i.unbind=="function"&&i.unbind()}return this}_update(){const e=this._textures;let i,r,o,s,l,a,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,oe.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=oe.performance.now()-this._startTime,d=this._lastFrame+1,l=1e3*(d-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Ft(this._firstFrame,d,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,a=e[this._index],a.loaded&&(i=a.image.width,r=a.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r),this.fill=a,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof De))&&(a=e[this._index],a.loaded&&(i=a.image.width,r=a.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(nl,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(nl,"DefaultFrameRate",30);var il=nl,md={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,i=this._renderer.unbindTextures;this._textures&&this._textures.unbind(ee.Types.insert,e).unbind(ee.Types.remove,i),this._textures=new ri((t||[]).slice(0)),this._textures.bind(ee.Types.insert,e).bind(ee.Types.remove,i),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 r0(){this._flagTextures=!0}function o0(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function s0(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function pd(t){if(t instanceof De)return t;if(typeof t=="string")return new De(t)}var vo=Math.min,So=Math.max,l0={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},rl=class an extends zn{constructor(e){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 i in gd)Object.defineProperty(this,i,gd[i]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let i=0;i<e.length;i++)yd.call(this,e[i],this)}static RemoveChildren(e){for(let i=0;i<e.length;i++)yd.call(this,e[i])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const i=new an;for(let o=0;o<an.Properties.length;o++){const s=an.Properties[o];s in e&&(/(fill|stroke)/i.test(s)?i[s]=typeof e[s]=="string"?e[s]:xi(e[s]):i[s]=e[s])}return"mask"in e&&(i.mask=r(e.mask)),"id"in e&&(i.id=e.id),i.children=e.children.map(r),i;function r(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Xs.fromObject(o);case"circle":return xo.fromObject(o);case"element":return Ji.fromObject(o);case"ellipse":return ko.fromObject(o);case"group":return an.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return il.fromObject(o);case"path":return Re.fromObject(o);case"points":return Zs.fromObject(o);case"polygon":return Qs.fromObject(o);case"rectangle":return si.fromObject(o);case"rounded-rectangle":return Co.fromObject(o);case"shape":return zn.fromObject(o);case"sprite":return wo.fromObject(o);case"star":return Js.fromObject(o);case"text":return Cn.fromObject(o)}return o}}static IsVisible(e,i){if(!i)return!0;let r=e;for(;r;){if(typeof r.visible=="boolean"&&!r.visible||typeof r.opacity=="number"&&r.opacity<=0)return!1;r=r.parent}return!0}static VisitForHitTest(e,i,r,o,s,l,a){const c=e&&e.children;if(!c)return!1;const d=i.results;for(let u=c.length-1;u>=0;u--){const f=c[u];if(!f||!an.IsVisible(f,i.visibleOnly))continue;const h=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null;if(!(h&&!Ay(h,i.x,i.y,l))){if(f instanceof an){if(r&&(!o||o(f))&&typeof f.contains=="function"&&f.contains(i.x,i.y,s)&&(d.push(f),a)||an.VisitForHitTest(f,i,r,o,s,l,a))return!0;continue}if(f instanceof zn&&!(o&&!o(f))&&typeof f.contains=="function"&&f.contains(i.x,i.y,s)&&(d.push(f),a))return!0}}return!1}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let i=0;i<an.Properties.length;i++){const r=an.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new an,r=this.children.map(function(o){return o.clone()});return i.add(r),i.opacity=this.opacity,this.mask&&(i.mask=this.mask),i.translation.copy(this.translation),i.rotation=this.rotation,i.scale=this.scale,i.className=this.className,this.matrix.manual&&i.matrix.copy(this.matrix),e&&e.add(i),i._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,oe.each(this.children,(i,r)=>{e.children[r]=i.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const i=this.children[e];typeof i.dispose=="function"&&i.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}getShapesAtPoint(e,i,r){const o=r||{},{results:s,hitOptions:l,context:a,single:c,empty:d}=l0.getShapesAtPoint;s.length=0;const u=o.mode==="deepest"||o.deepest?"deepest":"all",f=o.visibleOnly!==!1,h=!!o.includeGroups,m=typeof o.filter=="function"?o.filter:null,p=typeof o.tolerance=="number"?o.tolerance:0;typeof o.precision=="number"?l.precision=o.precision:delete l.precision,typeof o.fill<"u"?l.fill=o.fill:delete l.fill,typeof o.stroke<"u"?l.stroke=o.stroke:delete l.stroke,l.tolerance=p,l.ignoreVisibility=!f;const g=u==="deepest";if(a.x=e,a.y=i,a.visibleOnly=f,a.results=s,an.VisitForHitTest(this,a,h,m,l,p,g),g){if(s.length>0){const y=s[0];return s.length=0,c[0]=y,c.length=1,c}return d.length=0,d}const b=s.slice();return s.length=0,b}corner(){const e=this.getBoundingClientRect(!0);for(let i=0;i<this.children.length;i++){const r=this.children[i];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),i=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const s=this.children[o];s.isShape&&(s.translation.x-=i,s.translation.y-=r)}return this.mask&&(this.mask.translation.x-=i,this.mask.translation.y-=r),this}getById(e){let i=null;function r(o){if(o.id===e)return o;if(o.children){if(o.children.ids[e])return o.children.ids[e];for(let s=0;s<o.children.length;s++)if(i=r(o.children[s]),i)return i}return null}return r(this)}getByClassName(e){const i=[];function r(o){if(Array.prototype.indexOf.call(o.classList,e)>=0&&i.push(o),o.children)for(let s=0;s<o.children.length;s++){const l=o.children[s];r(l)}return i}return r(this)}getByType(e){const i=[];function r(o){if(o instanceof e&&i.push(o),o.children)for(let s=0;s<o.children.length;s++){const l=o.children[s];r(l)}return i}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let i=0;i<e.length;i++){const r=e[i];if(!(r&&r.id))continue;const o=Array.prototype.indexOf.call(this.children,r);o>=0&&this.children.splice(o,1),this.children.push(r)}return this}remove(e){const i=arguments.length,r=this.parent;if(i<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let o=0;o<e.length;o++){const s=e[o];if(!s||!this.children.ids[s.id])continue;const l=this.children.indexOf(s);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(e){let i,r,o,s,l,a;this._update(!0);let c=1/0,d=-1/0,u=1/0,f=-1/0;const h=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||h.test(p._renderer.type))&&(i=p.getBoundingClientRect(e),o=typeof i.top!="number"||oe.isNaN(i.top)||!isFinite(i.top),s=typeof i.left!="number"||oe.isNaN(i.left)||!isFinite(i.left),l=typeof i.right!="number"||oe.isNaN(i.right)||!isFinite(i.right),a=typeof i.bottom!="number"||oe.isNaN(i.bottom)||!isFinite(i.bottom),!(o||s||l||a)))if(e){const[g,b]=r.multiply(i.left,i.top),[y,_]=r.multiply(i.right,i.top),[k,x]=r.multiply(i.left,i.bottom),[v,N]=r.multiply(i.right,i.bottom);u=vo(b,_,x,N,u),c=vo(g,y,k,v,c),d=So(g,y,k,v,d),f=So(b,_,x,N,f)}else u=vo(i.top,u),c=vo(i.left,c),d=So(i.right,d),f=So(i.bottom,f)}return{top:u,left:c,right:d,bottom:f,width:d-c,height:f-u}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(i){i.subdivide.apply(i,e)}),this}_update(){let e,i,r;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),l=this.length;let a=0;const c=o*l,d=s*l;for(e=0;e<this.children.length;e++)r=this.children[e],i=r.length,c>a+i?(r.beginning=1,r.ending=1):d<a?(r.beginning=0,r.ending=0):c>a&&c<a+i?(r.beginning=(c-a)/i,r.ending=1):d>a&&d<a+i?(r.beginning=0,r.ending=(d-a)/i):(r.beginning=0,r.ending=1),a+=i}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(rl,"Children",Gc),S(rl,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var pt=rl,gd={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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=pt.InsertChildren.bind(this),i=pt.RemoveChildren.bind(this),r=pt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&i(this._children)),this._children=new Gc(t),this._children.bind(ee.Types.insert,e),this._children.bind(ee.Types.remove,i),this._children.bind(ee.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,oe.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 i=this.children[e];i.strokeAttenuation!==void 0&&(i.strokeAttenuation=t)}}}};function yd(t,e){const i=t.parent;let r;if(i===e){o();return}if(i&&i.children.ids[t.id]&&(r=Array.prototype.indexOf.call(i.children,t),i.children.splice(r,1),s()),e){o();return}s(),i._flagAdditions&&i.additions.length===0&&(i._flagAdditions=!1),i._flagSubtractions&&i.subtractions.length===0&&(i._flagSubtractions=!1),delete t.parent;function o(){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 s(){r=Array.prototype.indexOf.call(i.additions,t),r>=0&&i.additions.splice(r,1),r=Array.prototype.indexOf.call(i.subtractions,t),r<0&&(i.subtractions.push(t),i._flagSubtractions=!0)}}var Bo=class extends Re{constructor(e,i,r,o){const s=[new $e(e,i),new $e(r,o)];super(s);for(let l in bd)Object.defineProperty(this,l,bd[l]);this.vertices[0].command=ie.move,this.vertices[1].command=ie.line,this.automatic=!1}};S(Bo,"Properties",["left","right"]);var bd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(oe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ie.move;else{const e=new Lt("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(oe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ie.line;else{const e=new Lt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},vn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},a0={start:"left",middle:"center",end:"right"},_d=["id","class","transform","xmlns","viewBox"],c0=["x","y","width","height","href","xlink:href"];function d0(t){return a0[t]}function u0(t){const e=t.getAttribute("dominant-baseline"),i=t.getAttribute("alignment-baseline");return e||i}function Rr(t){return t.replace(/svg:/gi,"").toLowerCase()}function wd(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const i=e.length();e.x=i*Math.cos(t.rotation),e.y=i*Math.sin(t.rotation)}}function f0(t,e){e||(e={});const i=t.split(";");for(let r=0;r<i.length;r++){const o=i[r].split(":"),s=o[0],l=o[1];if(typeof s>"u"||typeof l>"u")continue;const a=s.replace(/\s/g,""),c=l.replace(/\s/g,"");e[a]=c}return e}function h0(t){const e={},i=m0(t),r=Math.max(i.length,t.style.length);for(let o=0;o<r;o++){const s=t.style[o],l=i[o];s&&(e[s]=t.style[s]),l&&(e[l]=t.getAttribute(l))}return e}function m0(t){const e=t.getAttributeNames();for(let i=0;i<_d.length;i++){const r=_d[i],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function p0(t,e){const i=e.split(/[\s,]/),r=-parseFloat(i[0]),o=-parseFloat(i[1]),s=parseFloat(i[2]),l=parseFloat(i[3]);if(r&&o)for(let f=0;f<t.children.length;f++){const h=t.children[f];"translation"in h?h.translation.add(r,o):"x"in h?h.x=r:"y"in h&&(h.y=o)}const a=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return a&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new re(1,1)),d&&(t.scale.x=t.width/s),u&&(t.scale.y=t.height/l),t.mask=new si(0,0,s,l),t.mask.origin.set(-s/2,-l/2),t}function nn(t,e,i){const r={},o={},s={};let l,a,c,d,u,f,h,m,p,g,b,y,_,k,x,v,N;if(t===null)return r;if(Ue.getComputedStyle){const w=Ue.getComputedStyle(t);for(l=w.length;l--;)c=w[l],d=w[c],typeof d<"u"&&(r[c]=d)}for(l=0;l<t.attributes.length;l++)f=t.attributes[l],/style/i.test(f.nodeName)?f0(f.value,s):o[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),i&&oe.defaults(r,i),oe.extend(r,s,o),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(a=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,a===null))break;switch(h=wi(a),e._renderer.type){case"linear-gradient":wd(h,e.left),wd(h,e.right);break;case"radial-gradient":e.center.x+=h.translateX,e.center.y+=h.translateY,e.focal.x+=h.translateX,e.focal.y+=h.translateY,e.radius*=Math.max(h.scaleX,h.scaleY);break}break;case"transform":if(/none/i.test(d)||(a=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,a===null))break;h=wi(a),e.translation.set(h.translateX,h.translateY),e.rotation=Math.PI*(h.rotation/180),e.scale=new re(h.scaleX,h.scaleY),m=parseFloat((r.x+"").replace("px")),p=parseFloat((r.y+"").replace("px")),m&&(e.translation.x=m),p&&(e.translation.y=p);break;case"visible":if(e instanceof pt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof pt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof pt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof pt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof pt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof pt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(vn.cssBackgroundImage.test(d)&&(g=d.replace(vn.cssBackgroundImage,"$1"),Ke.defs.current&&Ke.defs.current.contains(g)&&(y=Ke.defs.current.get(g),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=Rr(y.nodeName),e.mask=Ke[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof pt?"_":"")+c,vn.cssBackgroundImage.test(d)?(g=d.replace(vn.cssBackgroundImage,"$1"),Ke.defs.current&&Ke.defs.current.contains(g)?(y=Ke.defs.current.get(g),y.object||(_=Rr(y.nodeName),y.object=Ke[_].call(this,y,{})),y=y.object):(b=y0(this),y=b.getById(g)),e[u]=y):e[u]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(k=e instanceof ut,x=e instanceof Ge,v=e instanceof Ze,k||x||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Lt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof Cn&&(e.family=d);break;case"font-size":e instanceof Cn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Lt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof Cn&&(e.weight=d);break;case"font-style":e instanceof Cn&&(e.style=d);break;case"text-decoration":e instanceof Cn&&(e.decoration=d);break;case"line-height":e instanceof Cn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function g0(t,e){for(let i=0,r=t.childNodes.length;i<r;i++){const o=t.childNodes[i];!o.id||Rr(t.nodeName)==="#text"||e.add(o.id,o)}}function y0(t){for(;t.parent;)t=t.parent;return t.scene}var Ke={svg:function(t){const e=Ke.defs.current=new fo,i=t.getElementsByTagName("defs");for(let p=0;p<i.length;p++)g0(i[p],e);const r=Ke.g.call(this,t),o=t.getAttribute("viewBox"),s=t.getAttribute("x"),l=t.getAttribute("y"),a=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=o!==null,u=s!==null,f=l!==null,h=a!==null,m=c!==null;return u&&(r.x=parseFloat(s.replace(vn.unitSuffix,""))),f&&(r.y=parseFloat(l.replace(vn.unitSuffix,""))),h&&(r.width=parseFloat(a.replace(vn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(vn.unitSuffix,""))),d&&p0(r,o),delete Ke.defs.current,r},defs:function(t){return null},use:function(t,e){let i;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return i=new Lt("encountered <use /> with no href."),console.warn(i.name,i.message),null;const o=r.slice(1);if(!Ke.defs.current.contains(o))return i=new Lt("unable to find element for reference "+r+"."),console.warn(i.name,i.message),null;const l=Ke.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=c0.includes(d.nodeName),f=!l.hasAttribute(d.nodeName);(u||f)&&l.setAttribute(d.nodeName,d.value)}const a=Rr(l.nodeName);return Ke[a].call(this,l,e)},g:function(t,e){const i=new pt;nn.call(this,t,i,e),this.add(i);const r=h0.call(this,t);for(let o=0,s=t.childNodes.length;o<s;o++){const l=t.childNodes[o],a=l.nodeName;if(!a)return;const c=Rr(a);if(c in Ke){const d=Ke[c].call(i,l,r);d&&!d.parent&&i.add(d)}}return i},polygon:function(t,e){let i;typeof t=="string"?i=t:i=t.getAttribute("points");const r=[];i.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(s,l,a){r.push(new $e(parseFloat(l),parseFloat(a)))});const o=new Re(r,!0);return o.stroke="none",o.fill="black",nn.call(this,t,o,e),o},polyline:function(t,e){const i=Ke.polygon.call(this,t,e);return i.closed=!1,i},path:function(t,e){let i;typeof t=="string"?(i=t,t=null):i=t.getAttribute("d");let r=[],o=!1,s=!1;if(i){let a=new $e,c,d,u=i.match(/[a-df-z][^a-df-z]*/gi);const f=u.length-1;oe.each(u.slice(0),function(h,m){const p=h.slice(1).trim().match(vn.path),g=h[0],b=g.toLowerCase();let y,_,k,x,v;const N=[];switch(m===0&&(u=[]),b){case"h":case"v":p.length>1&&(y=1);break;case"m":case"l":case"t":p.length>2&&(y=2);break;case"s":case"q":p.length>4&&(y=4);break;case"c":p.length>6&&(y=6);break;case"a":p.length>7&&(y=7);break}if(y){for(_=0,k=p.length,v=0;_<k;_+=y){if(x=g,v>0)switch(g){case"m":x="l";break;case"M":x="L";break}N.push(x+p.slice(_,_+y).join(" ")),v++}u=Array.prototype.concat.apply(u,N)}else u.push(h)}),oe.each(u,function(h,m){let p,g,b;const y=h[0],_=y.toLowerCase();d=h.slice(1).trim().match(vn.path),s=y===_;let k,x,v,N,w,T,C,$,E,V,P,I,U,J,Z,L,O;switch(_){case"z":if(m>=f)o=!0;else{g=a.x,b=a.y,p=new $e(g,b,void 0,void 0,void 0,void 0,ie.close);for(let z=r.length-1;z>=0;z--){const M=r[z];if(/m/i.test(M.command)){a=M;break}}}break;case"m":case"l":c=void 0,g=parseFloat(d[0]),b=parseFloat(d[1]),p=new $e(g,b,void 0,void 0,void 0,void 0,/m/i.test(_)?ie.move:ie.line),s&&p.addSelf(a),a=p;break;case"h":case"v":V=/h/i.test(_)?"x":"y",P=/x/i.test(V)?"y":"x",p=new $e(void 0,void 0,void 0,void 0,void 0,void 0,ie.line),p[V]=parseFloat(d[0]),p[P]=a[P],s&&(p[V]+=a[V]),a=p;break;case"c":case"s":k=a.x,x=a.y,c||(c=new re),/c/i.test(_)?(v=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[2]),T=parseFloat(d[3]),C=parseFloat(d[4]),$=parseFloat(d[5])):(E=Ms(a,c,s),v=E.x,N=E.y,w=parseFloat(d[0]),T=parseFloat(d[1]),C=parseFloat(d[2]),$=parseFloat(d[3])),s&&(v+=k,N+=x,w+=k,T+=x,C+=k,$+=x),a.controls.right.set(v-a.x,N-a.y),p=new $e(C,$,w-C,T-$,void 0,void 0,ie.curve),a=p,c=p.controls.left;break;case"t":case"q":k=a.x,x=a.y,c||(c=new re),/q/i.test(_)?(v=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[0]),T=parseFloat(d[1]),C=parseFloat(d[2]),$=parseFloat(d[3])):(E=Ms(a,c,s),v=E.x,N=E.y,w=E.x,T=E.y,C=parseFloat(d[0]),$=parseFloat(d[1])),s&&(v+=k,N+=x,w+=k,T+=x,C+=k,$+=x),a.controls.right.set((v-a.x)*.33,(N-a.y)*.33),p=new $e(C,$,w-C,T-$,void 0,void 0,ie.curve),a=p,c=p.controls.left;break;case"a":k=a.x,x=a.y,U=parseFloat(d[0]),J=parseFloat(d[1]),Z=parseFloat(d[2]),L=parseFloat(d[3]),O=parseFloat(d[4]),C=parseFloat(d[5]),$=parseFloat(d[6]),s&&(C+=k,$+=x),I=new $e(C,$),I.command=ie.arc,I.rx=U,I.ry=J,I.xAxisRotation=Z,I.largeArcFlag=L,I.sweepFlag=O,p=I,a=I,c=void 0;break}p&&(Array.isArray(p)?r=r.concat(p):r.push(p))})}i=new Re(r,o,void 0,!0),i.stroke="none",i.fill="black";const l=i.getBoundingClientRect(!0);return l.centroid={x:l.left+l.width/2,y:l.top+l.height/2},oe.each(i.vertices,function(a){a.subSelf(l.centroid)}),nn.call(this,t,i,e),i.translation.addSelf(l.centroid),i},circle:function(t,e){const i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("r")),s=new xo(0,0,o);return s.stroke="none",s.fill="black",nn.call(this,t,s,e),s.translation.x=i,s.translation.y=r,s},ellipse:function(t,e){const i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("rx")),s=parseFloat(t.getAttribute("ry")),l=new ko(0,0,o,s);return l.stroke="none",l.fill="black",nn.call(this,t,l,e),l.translation.x=i,l.translation.y=r,l},rect:function(t,e){const i=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!oe.isNaN(i)||!oe.isNaN(r))return Ke["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),l=o/2,a=s/2,c=new si(0,0,o,s);return c.stroke="none",c.fill="black",nn.call(this,t,c,e),c.translation.x+=l,c.translation.y+=a,c},"rounded-rect":function(t,e){const i=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),l=o/2,a=s/2,c=new re(i,r),d=new Co(0,0,o,s,c);return d.stroke="none",d.fill="black",nn.call(this,t,d,e),d.translation.x+=l,d.translation.y+=a,d},line:function(t,e){const i=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),o=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),l=new Bo(i,r,o,s).noFill();return nn.call(this,t,l,e),l},lineargradient:function(t,e){let i=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");i||(i="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("x1")||0),s=parseFloat(t.getAttribute("y1")||0),l=parseFloat(t.getAttribute("x2")||0),a=parseFloat(t.getAttribute("y2")||0);const c=(l+o)/2,d=(a+s)/2;/userSpaceOnUse/i.test(i)&&(o-=c,s-=d,l-=c,a-=d);const u=[];for(let h=0;h<t.children.length;h++){const m=t.children[h];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let g=m.getAttribute("stop-color"),b=m.getAttribute("stop-opacity"),y=m.getAttribute("style"),_;g===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,g=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),u.push(new oi(p,g,b))}const f=new Ge(o,s,l,a,u);return f.spread=r,f.units=i,nn.call(this,t,f,e),f},radialgradient:function(t,e){let i=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");i||(i="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("cx"))||0,s=parseFloat(t.getAttribute("cy"))||0,l=parseFloat(t.getAttribute("r")),a=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));oe.isNaN(a)&&(a=o),oe.isNaN(c)&&(c=s);const d=Math.abs(o+a)/2,u=Math.abs(s+c)/2;/userSpaceOnUse/i.test(i)&&(o-=d,s-=u,a-=d,c-=u);const f=[];for(let m=0;m<t.children.length;m++){const p=t.children[m];let g=p.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let b=p.getAttribute("stop-color"),y=p.getAttribute("stop-opacity"),_=p.getAttribute("style"),k;b===null&&(k=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=k&&k.length>1?k[1]:void 0),y===null?(k=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=k&&k.length>1?parseFloat(k[1]):1):y=parseFloat(y),f.push(new oi(g,b,y))}const h=new Ze(o,s,l,f,a,c);return h.spread=r,h.units=i,nn.call(this,t,h,e),h},text:function(t,e){const i=d0(t.getAttribute("text-anchor"))||"left",r=u0(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new Cn(o);return nn.call(this,t,s,e),s.alignment=i,s.baseline=r,s},clippath:function(t,e){return Ke.defs.current&&!Ke.defs.current.contains(t.id)&&Ke.defs.current.add(t.id,t),null},image:function(t,e){let i;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return i=new Lt("encountered <image /> with no href."),console.warn(i.name,i.message),null;const o=parseFloat(t.getAttribute("x"))||0,s=parseFloat(t.getAttribute("y"))||0,l=parseFloat(t.getAttribute("width")),a=parseFloat(t.getAttribute("height")),c=new wo(r,o,s);return oe.isNaN(l)||(c.width=l),oe.isNaN(a)||(c.height=a),nn.call(this,t,c,e),c}};function xd(t,e){const i=new XMLHttpRequest;return i.open("GET",t),i.onreadystatechange=function(){i.readyState===4&&i.status===200&&e(i.responseText)},i.send(),i}var ol=class An extends si{constructor(e,i,r,o,s,l){super(i,r,o||1,s||1),S(this,"_flagTexture",!1),S(this,"_flagMode",!1),S(this,"_texture",null),S(this,"_mode","fill"),this._renderer.type="image";for(let a in Cd)Object.defineProperty(this,a,Cd[a]);this.noStroke(),this.noFill(),e instanceof De?this.texture=e:typeof e=="string"&&(this.texture=new De(e)),typeof l=="string"&&(this.mode=l),this._update()}static fromObject(e){const i=new An().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<An.Properties.length;i++){const r=An.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new An(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(i),i}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const i=e.image.width,r=e.image.height,o=this.width,s=this.height,l=o/i,a=s/r;switch(this._mode){case An.Modes.fill:{const c=Math.max(l,a);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case An.Modes.fit:{const c=Math.min(l,a);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case An.Modes.crop:break;case An.Modes.tile:{e.offset.x=(i-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case An.Modes.stretch:default:e.scale=new re(l,a),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};S(ol,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),S(ol,"Properties",["texture","mode"]);var kd=ol,Cd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},sl=[],ll=Math.max,b0=Math.min,vd=Math.abs,No=Math.sin,To=Math.cos,_0=Math.acos,$o=Math.sqrt,Fe={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Fe?t:"path"},group:{renderChild:function(t){const e=Fe.getRendererType(t._renderer.type);Fe[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,i=this.parent;this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);const r=this._mask,o=Eo(e),s=!o||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,s&&(t.save(),o||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const l=Fe.getRendererType(r._renderer.type);Fe[l].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let l=0;l<this.children.length;l++){const a=this.children[l],c=Fe.getRendererType(a._renderer.type);Fe[c].render.call(a,t)}return s&&t.restore(),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,i){let r,o,s,l,a,c,d,u,f,h,m,p,g,b,y,_,k,x,v,N,w,T,C,$,E,V,P,I,U,J,Z,L,O,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,U=this._mask,J=this._clip,a=this._opacity*(z||1),c=this._visible,!e&&(!c||J||a===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,l=this._fill,d=this._cap,u=this._join,f=this._miter,h=this._closed,m=this._renderer.vertices,p=m.length,g=p-1,Z=Eo(r),O=this.dashes,Z||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),U){const q=Fe.getRendererType(U._renderer.type);Fe[q].render.call(U,t,!0)}if(l)if(typeof l=="string")t.fillStyle=l;else{const q=Fe.getRendererType(l._renderer.type);Fe[q].render.call(l,t,this),t.fillStyle=l._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const q=Fe.getRendererType(o._renderer.type);Fe[q].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=kn(this)),f&&(t.miterLimit=f),u&&(t.lineJoin=u),!h&&d&&(t.lineCap=d)}typeof a=="number"&&(t.globalAlpha=a),O&&O.length>0&&(t.lineDashOffset=O.offset||0,t.setLineDash(O)),t.beginPath();let M,R,W,K,G,X,j;for(let q=0;q<p;q++)switch(_=m[q],P=_.x,I=_.y,_.command){case ie.close:t.closePath();break;case ie.arc:M=_.rx,R=_.ry,W=_.xAxisRotation,K=_.largeArcFlag,G=_.sweepFlag,b=h?ot(q-1,p):ll(q-1,0),y=m[b],X=y.x,j=y.y,Fe.renderSvgArcCommand(t,X,j,M,R,K,G,W,P,I);break;case ie.curve:b=h?ot(q-1,p):Math.max(q-1,0),y=m[b],C=y.controls&&y.controls.right||re.zero,$=_.controls&&_.controls.left||re.zero,y._relative?(w=C.x+y.x,T=C.y+y.y):(w=C.x,T=C.y),_._relative?(v=$.x+_.x,N=$.y+_.y):(v=$.x,N=$.y),t.bezierCurveTo(w,T,v,N,P,I),q>=g&&h&&(k=x,E=_.controls&&_.controls.right||re.zero,V=k.controls&&k.controls.left||re.zero,_._relative?(w=E.x+_.x,T=E.y+_.y):(w=E.x,T=E.y),k._relative?(v=V.x+k.x,N=V.y+k.y):(v=V.x,N=V.y),P=k.x,I=k.y,t.bezierCurveTo(w,T,v,N,P,I));break;case ie.line:t.lineTo(P,I);break;case ie.move:x=_,t.moveTo(P,I);break}return h&&t.closePath(),!J&&!i&&(Fe.isHidden.test(l)||(L=l._renderer&&l._renderer.offset,L&&(t.save(),t.translate(-l._renderer.offset.x,-l._renderer.offset.y),t.scale(l._renderer.scale.x,l._renderer.scale.y)),t.fill(),L&&t.restore()),Fe.isHidden.test(o)||(L=o._renderer&&o._renderer.offset,L&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),L&&t.restore())),Z||t.restore(),J&&!i&&t.clip(),O&&O.length>0&&t.setLineDash(sl),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,i){let r,o,s,l,a,c,d,u,f,h,m,p,g,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,a=this._opacity*(_||1),c=this._visible,!e&&(!c||a===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,l=this._fill,u=this._renderer.collection,f=u.length,g=Eo(r),y=this.dashes,d=this._size,g||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),l)if(typeof l=="string")t.fillStyle=l;else{const v=Fe.getRendererType(l._renderer.type);Fe[v].render.call(l,t,this),t.fillStyle=l._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const v=Fe.getRendererType(o._renderer.type);Fe[v].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=kn(this))}typeof a=="number"&&(t.globalAlpha=a),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let k=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=wi(x[0],x[3],x[1],x[4],x[2],x[5]),k/=Math.max(x.scaleX,x.scaleY));for(let v=0;v<f;v++)h=u[v],m=h.x,p=h.y,t.moveTo(m+k,p),t.arc(m,p,k,0,tt);return i||(Fe.isHidden.test(l)||(b=l._renderer&&l._renderer.offset,b&&(t.save(),t.translate(-l._renderer.offset.x,-l._renderer.offset.y),t.scale(l._renderer.scale.x,l._renderer.scale.y)),t.fill(),b&&t.restore()),Fe.isHidden.test(o)||(b=o._renderer&&o._renderer.offset,b&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),b&&t.restore())),g||t.restore(),y&&y.length>0&&t.setLineDash(sl),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,i){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,o=this._opacity*r,s=this._visible,l=this._mask,a=this._clip;if(!e&&(!s||a||o===0))return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,f=this._fill,h=this._decoration,m=this._direction,p=Eo(c),g=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Fe.alignments[this._alignment]||this._alignment,_=Fe.baselines[this._baseline]||this._baseline;let k,x,v,N,w,T,C,$,E,V,P;if(p||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),l){const I=Fe.getRendererType(l._renderer.type);Fe[I].render.call(l,t,!0)}if(g||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=m,f)if(typeof f=="string")t.fillStyle=f;else{const I=Fe.getRendererType(f._renderer.type);Fe[I].render.call(f,t,this),t.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const I=Fe.getRendererType(d._renderer.type);Fe[I].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=kn(this))}if(typeof o=="number"&&(t.globalAlpha=o),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!a&&!i&&(Fe.isHidden.test(f)||(f._renderer&&f._renderer.offset?(T=f._renderer.scale.x,C=f._renderer.scale.y,t.save(),t.translate(-f._renderer.offset.x,-f._renderer.offset.y),t.scale(T,C),k=this._size/f._renderer.scale.y,x=this._leading/f._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),v=f._renderer.offset.x/f._renderer.scale.x,N=f._renderer.offset.y/f._renderer.scale.y,t.fillText(this.value,v,N),t.restore()):t.fillText(this.value,0,0)),Fe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,C=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,C),k=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,N=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,v,N),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(h)){const I=t.measureText(this.value);let U=1;switch(h){case"underline":E=I.actualBoundingBoxDescent,P=I.actualBoundingBoxDescent;break;case"strikethrough":E=0,P=0,U=.5;break}switch(_){case"top":E+=this._size*U,P+=this._size*U;break;case"baseline":case"bottom":E-=this._size*U,P-=this._size*U;break}switch(y){case"left":case"start":$=0,V=I.width;break;case"right":case"end":$=-I.width,V=0;break;default:$=-I.width/2,V=I.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,E),t.lineTo(V,P),t.stroke()}return p||t.restore(),a&&!i&&t.clip(),b&&b.length>0&&t.setLineDash(sl),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let i,r=this.left._x,o=this.left._y,s=this.right._x,l=this.right._y;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width,o=(o-.5)*i.height,s=(s-.5)*i.width,l=(l-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,l);for(let a=0;a<this.stops.length;a++){const c=this.stops[a];this._renderer.effect.addColorStop(c._offset,c._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let i,r=this.center._x,o=this.center._y,s=this.focal._x,l=this.focal._y,a=this._radius;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width*.5,o=(o-.5)*i.height*.5,s=(s-.5)*i.width*.5,l=(l-.5)*i.height*.5,a*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,l,a);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof re?(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 re||(this._renderer.scale=new re),this._scale instanceof re?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,i,r,o,s,l,a,c,d){a=a*Math.PI/180,r=vd(r),o=vd(o);const u=(e-c)/2,f=(i-d)/2,h=To(a)*u+No(a)*f,m=-No(a)*u+To(a)*f,p=h*h,g=m*m;let b=r*r,y=o*o;const _=p/b+g/y;if(_>1){const I=$o(_);r=I*r,o=I*o,b=r*r,y=o*o}const k=b*g+y*p,x=(b*y-k)/k;let v=$o(ll(0,x));s===l&&(v=-v);const N=v*r*m/o,w=-v*o*h/r,T=To(a)*N-No(a)*w+(e+c)/2,C=No(a)*N+To(a)*w+(i+d)/2,$=Sd(1,0,(h-N)/r,(m-w)/o),E=Sd((h-N)/r,(m-w)/o,(-h-N)/r,(-m-w)/o)%tt,V=$+E;w0(t,T,C,r,o,$,V,l===0,a)}},vt=class extends ee{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new pt,this.scene.parent=this}setSize(t,e,i){return this.width=t,this.height=e,this.ratio=typeof i>"u"?Is(this.ctx):i,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&oe.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(ee.Types.resize,t,e,i)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Fe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};S(vt,"Utils",Fe);function w0(t,e,i,r,o,s,l,a,c){const d=l-s,u=Zi.Tolerance.epsilon,f=Math.abs(d)<u;let h=ot(d,tt);h<u&&(f?h=0:h=tt),a===!0&&!f&&(h===tt?h=-tt:h=h-tt);for(let m=0;m<kt.Resolution;m++){const p=m/(kt.Resolution-1),g=s+p*h;let b=e+r*Math.cos(g),y=i+o*Math.sin(g);if(c!==0){const _=Math.cos(c),k=Math.sin(c),x=b-e,v=y-i;b=x*_-v*k+e,y=x*k+v*_+i}t.lineTo(b,y)}}function Sd(t,e,i,r){const o=t*i+e*r,s=$o(t*t+e*e)*$o(i*i+r*r);let l=_0(ll(-1,b0(1,o/s)));return t*r-e*i<0&&(l=-l),l}function Eo(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ue={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const i=t,r=document.createElementNS(ue.ns,i);return i==="svg"&&(e=oe.defaults(e||{},{version:ue.version})),e&&Object.keys(e).length>0&&ue.setAttributes(r,e),r},setAttributes:function(t,e){const i=Object.keys(e);for(let r=0;r<i.length;r++)/href/.test(i[r])?t.setAttributeNS(ue.xlink,i[r],e[i[r]]):t.setAttribute(i[r],e[i[r]]);return this},removeAttributes:function(t,e){for(let i in e)t.removeAttribute(i);return this},toString:function(t,e){let i=t.length,r=i-1,o,s="";for(let l=0;l<i;l++){const a=t[l],c=e?ot(l-1,i):Math.max(l-1,0),d=t[c];let u,f,h,m,p,g,b,y,_,k,x,v,N,w,T,C=ze(a.x),$=ze(a.y);switch(a.command){case ie.close:u=ie.close;break;case ie.arc:x=a.rx,v=a.ry,N=a.xAxisRotation,w=a.largeArcFlag,T=a.sweepFlag,u=ie.arc+" "+x+" "+v+" "+N+" "+w+" "+T+" "+C+" "+$;break;case ie.curve:b=d.controls&&d.controls.right||re.zero,y=a.controls&&a.controls.left||re.zero,d.relative?(h=ze(b.x+d.x),m=ze(b.y+d.y)):(h=ze(b.x),m=ze(b.y)),a.relative?(p=ze(y.x+a.x),g=ze(y.y+a.y)):(p=ze(y.x),g=ze(y.y)),u=(l===0?ie.move:ie.curve)+" "+h+" "+m+" "+p+" "+g+" "+C+" "+$;break;case ie.move:o=a,u=ie.move+" "+C+" "+$;break;default:u=a.command+" "+C+" "+$}l>=r&&e&&(a.command===ie.curve&&(f=o,_=a.controls&&a.controls.right||a,k=f.controls&&f.controls.left||f,a.relative?(h=ze(_.x+a.x),m=ze(_.y+a.y)):(h=ze(_.x),m=ze(_.y)),f.relative?(p=ze(k.x+f.x),g=ze(k.y+f.y)):(p=ze(k.x),g=ze(k.y)),C=ze(f.x),$=ze(f.y),u+=" C "+h+" "+m+" "+p+" "+g+" "+C+" "+$),a.command!==ie.close&&(u+=" Z")),s+=u+" "}return s},pointsToString:function(t,e){let i="";const r=e*.5;for(let o=0;o<t.length;o++){const s=t[o].x,l=t[o].y-r;i+=ie.move+" "+s+" "+l+" ",i+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return i},getClip:function(t,e){let i=t._renderer.clip;return i||(i=t._renderer.clip=ue.createElement("clipPath",{"clip-rule":"nonzero"})),i.parentNode===null&&e.defs.appendChild(i),i},getRendererType:function(t){return t in ue?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const i=Array.prototype.slice.call(e.children,0);for(let r=0;r<i.length;r++){const o=i[r],s=o.id,l=`[fill="url(#${s})"],[stroke="url(#${s})"],[clip-path="url(#${s})"]`;t.querySelector(l)||e.removeChild(o)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const i=e.nodeName;!i||/(radial|linear)gradient/i.test(i)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=ue.getRendererType(t._renderer.type);ue[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ue.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,i={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const o=this.children[r],s=ue.getRendererType(o._renderer.type);ue[s].render.call(o,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(ue.group.appendChild,i),this._flagSubtractions&&this.subtractions.forEach(ue.group.removeChild,i),this._flagOrder&&this.children.forEach(ue.group.orderChild,i),this._flagMask)if(this._mask){const r=ue.getRendererType(this._mask._renderer.type);ue[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=ue.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ue.getRendererType(this._fill._renderer.type);ue[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ue.getRendererType(this._stroke._renderer.type);ue[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=kn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ue.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ue.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ue.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=ue.getRendererType(this._mask._renderer.type);ue[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const s=this.worldMatrix.elements,l=wi(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(l.scaleX,l.scaleY)}const o=ue.pointsToString(this._renderer.collection,r);e.d=o}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ue.getRendererType(this._fill._renderer.type);ue[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ue.getRendererType(this._stroke._renderer.type);ue[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=kn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ue.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ue.createElement("path",e),t.appendChild(this._renderer.elem)),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=ue.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ue.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ue.getRendererType(this._fill._renderer.type);ue[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=ue.getRendererType(this._stroke._renderer.type);ue[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=kn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?ue.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ue.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ue.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=ue.getRendererType(this._mask._renderer.type);ue[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const i={};if(this._flagId&&(i.id=this._id),this._flagEndPoints&&(i.x1=this.left._x,i.y1=this.left._y,i.x2=this.right._x,i.y2=this.right._y),this._flagSpread&&(i.spreadMethod=this._spread),this._flagUnits&&(i.gradientUnits=this._units),this._renderer.elem?ue.setAttributes(this._renderer.elem,i):(i.id=this._id,this._renderer.elem=ue.createElement("linearGradient",i)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],l={};s._flagOffset&&(l.offset=100*s._offset+"%"),s._flagColor&&(l["stop-color"]=s._color),s._flagOpacity&&(l["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,l):s._renderer.elem=ue.createElement("stop",l),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const i={};if(this._flagId&&(i.id=this._id),this._flagCenter&&(i.cx=this.center._x,i.cy=this.center._y),this._flagFocal&&(i.fx=this.focal._x,i.fy=this.focal._y),this._flagRadius&&(i.r=this._radius),this._flagSpread&&(i.spreadMethod=this._spread),this._flagUnits&&(i.gradientUnits=this._units),this._renderer.elem?ue.setAttributes(this._renderer.elem,i):(i.id=this._id,this._renderer.elem=ue.createElement("radialGradient",i)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],l={};s._flagOffset&&(l.offset=100*s._offset+"%"),s._flagColor&&(l["stop-color"]=s._color),s._flagOpacity&&(l["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,l):s._renderer.elem=ue.createElement("stop",l),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const i={},r={x:0,y:0},o=this.image;if(this._flagId&&(i.id=this._id),this._flagLoaded&&this.loaded)switch(o.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=o.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(i.x=this._offset.x,i.y=this._offset.y,o&&(i.x-=o.width/2,i.y-=o.height/2,this._scale instanceof re?(i.x*=this._scale.x,i.y*=this._scale.y):(i.x*=this._scale,i.y*=this._scale)),i.x>0&&(i.x*=-1),i.y>0&&(i.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(i.width=0,i.height=0,o)){switch(i.width=o.width,i.height=o.height,this._repeat){case"no-repeat":i.width+=1,i.height+=1;break}this._scale instanceof re?(i.width*=this._scale.x,i.height*=this._scale.y):(i.width*=this._scale,i.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=i.width,r.height=i.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?ue.setAttributes(this._renderer.image,r):this._renderer.image=ue.createElement("image",r)),this._renderer.elem?Object.keys(i).length!==0&&ue.setAttributes(this._renderer.elem,i):(i.id=this._id,i.patternUnits="userSpaceOnUse",this._renderer.elem=ue.createElement("pattern",i)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Bd=class extends ee{constructor(t){super(),this.domElement=t.domElement||ue.createElement("svg"),this.scene=new pt,this.scene.parent=this,this.defs=ue.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,ue.setAttributes(this.domElement,{width:t,height:e}),this.trigger(ee.Types.resize,t,e)}render(){return ue.group.render.call(this.scene,this.domElement),ue.defs.update(this.domElement),this}};S(Bd,"Utils",ue);var rn={create:function(t,e,i){const r=t.createShader(t[i]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const s=t.getShaderInfoLog(r);throw t.deleteShader(r),new Lt("unable to compile shader "+r+": "+s)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
41
41
|
precision mediump float;
|
|
42
42
|
attribute vec2 a_position;
|
|
43
43
|
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},Ro=ki.Multiply,x0=[1,0,0,0,1,0,0,0,1],li=new xn(9),k0=vt.Utils,Nd=new re,al=new xn([0,0,1,0,0,1,0,1,1,0,1,1]),Se={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ke.document?Ke.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new ki,group:{removeChild:function(t,e){if(t.children)for(let i=0;i<t.children.length;i++)Se.group.removeChild(t.children[i],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;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.parent,r=i._matrix&&i._matrix.manual||i._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((r||o)&&(this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,i._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re),this._scale instanceof re?(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(i._renderer.type)||(this._renderer.scale.x*=i._renderer.scale.x,this._renderer.scale.y*=i._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 l=vt.Utils.getRendererType(this._mask._renderer.type);Se[l].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=i._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);let s;if(this._flagSubtractions)for(s=0;s<this.subtractions.length;s++)Se.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const l=this.children[s],a=vt.Utils.getRendererType(l._renderer.type);Se[a].render.call(l,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let i,r,o,s,l,a,c,d,u,f,h,m,p,g;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,k=t.renderer.ratio,x=Nd.copy(e._renderer.scale).multiply(k),v=e._stroke,N=e._linewidth,w=e._fill,T=e._renderer.opacity||e._opacity,C=e._cap,$=e._join,E=e._miter,V=e._closed,P=e.dashes,I=b.length,K=I-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const J=e._renderer.rect.centroid,Z=J.x,L=J.y;if(_.clearRect(0,0,y.width,y.height),w)if(typeof w=="string")_.fillStyle=w;else{const j=vt.Utils.getRendererType(w._renderer.type);Se[j].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(v){if(typeof v=="string")_.strokeStyle=v;else{const j=vt.Utils.getRendererType(v._renderer.type);Se[j].render.call(v,_,e),_.strokeStyle=v._renderer.effect}N&&(_.lineWidth=kn(e)),E&&(_.miterLimit=E),$&&(_.lineJoin=$),!V&&C&&(_.lineCap=C)}typeof T=="number"&&(_.globalAlpha=T),P&&P.length>0&&(_.lineDashOffset=P.offset||0,_.setLineDash(P));let O,z,M,R,W,U,G,X;_.save(),_.scale(x.x,x.y),_.translate(Z,L),_.beginPath();for(let j=0;j<b.length;j++){const q=b[j];switch(m=q.x,p=q.y,q.command){case ie.close:_.closePath();break;case ie.arc:z=q.rx,M=q.ry,R=q.xAxisRotation,W=q.largeArcFlag,U=q.sweepFlag,i=V?ot(j-1,I):Math.max(j-1,0),r=b[i],G=r.x,X=r.y,k0.renderSvgArcCommand(_,G,X,z,M,W,U,R,m,p);break;case ie.curve:i=V?ot(j-1,I):Math.max(j-1,0),r=b[i],d=r.controls&&r.controls.right||re.zero,u=q.controls&&q.controls.left||re.zero,r._relative?(a=d.x+r.x,c=d.y+r.y):(a=d.x,c=d.y),q._relative?(s=u.x+q.x,l=u.y+q.y):(s=u.x,l=u.y),_.bezierCurveTo(a,c,s,l,m,p),j>=K&&V&&(o=O,f=q.controls&&q.controls.right||re.zero,h=o.controls&&o.controls.left||re.zero,q._relative?(a=f.x+q.x,c=f.y+q.y):(a=f.x,c=f.y),o._relative?(s=h.x+o.x,l=h.y+o.y):(s=h.x,l=h.y),m=o.x,p=o.y,_.bezierCurveTo(a,c,s,l,m,p));break;case ie.line:_.lineTo(m,p);break;case ie.move:O=q,_.moveTo(m,p);break}}V&&_.closePath(),Se.isHidden.test(w)||(g=w._renderer&&w._renderer.offset,g&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),g&&_.restore()),Se.isHidden.test(v)||(g=v._renderer&&v._renderer.offset,g&&(_.save(),_.translate(-v._renderer.offset.x,-v._renderer.offset.y),_.scale(v._renderer.scale.x,v._renderer.scale.y),_.lineWidth=N/v._renderer.scale.x),_.stroke(),g&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,i){let r=1/0,o=-1/0,s=1/0,l=-1/0,a,c;t.forEach(function(d){const u=d.x,f=d.y,h=d.controls;let m,p,g,b,y,_;s=Math.min(f,s),r=Math.min(u,r),o=Math.max(u,o),l=Math.max(f,l),d.controls&&(y=h.left,_=h.right,!(!y||!_)&&(m=d._relative?y.x+u:y.x,p=d._relative?y.y+f:y.y,g=d._relative?_.x+u:_.x,b=d._relative?_.y+f:_.y,!(!m||!p||!g||!b)&&(s=Math.min(p,b,s),r=Math.min(m,g,r),o=Math.max(m,g,o),l=Math.max(p,b,l))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,l+=e),a=o-r,c=l-s,i.top=s,i.left=r,i.right=o,i.bottom=l,i.width=a,i.height=c,i.centroid||(i.centroid={}),i.centroid.x=-r,i.centroid.y=-s},render:function(t,e,i){if(!this._visible||!this._opacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||this.parent,o=vt.Utils.getRendererType(this._renderer.type),s=e[o],l=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ze&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ze&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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(l||a||c){this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let f,h;this._scale instanceof re?(f=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=h<0?-h:h,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const f=vt.Utils.getRendererType(this._mask._renderer.type);Se[f].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Se.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Se.updateTexture.call(Se,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!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,al,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 u=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let i;const r=this.canvas,o=this.ctx,s=t.renderer.ratio,l=e._stroke,a=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._size*s;let h=f;Se.isHidden.test(l)||(h+=a),r.width=hc(h),r.height=r.width;const m=h/r.width,p=r.width/2,g=r.height/2;if(o.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")o.fillStyle=c;else{const b=vt.Utils.getRendererType(c._renderer.type);Se[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(l){if(typeof l=="string")o.strokeStyle=l;else{const b=vt.Utils.getRendererType(l._renderer.type);Se[b].render.call(l,o,e),o.strokeStyle=l._renderer.effect}a&&(o.lineWidth=kn(e)/m)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(p,g),o.scale(Se.precision,Se.precision),o.beginPath(),o.arc(0,0,f/m*.5,0,tt),o.restore(),closed&&o.closePath(),Se.isHidden.test(c)||(i=c._renderer&&c._renderer.offset,i&&(o.save(),o.translate(-c._renderer.offset.x,-c._renderer.offset.y),o.scale(c._renderer.scale.x,c._renderer.scale.y)),o.fill(),i&&o.restore()),Se.isHidden.test(l)||(i=l._renderer&&l._renderer.offset,i&&(o.save(),o.translate(-l._renderer.offset.x,-l._renderer.offset.y),o.scale(l._renderer.scale.x,l._renderer.scale.y),o.lineWidth=a/l._renderer.scale.x),o.stroke(),i&&o.restore())},render:function(t,e,i){if(!this._visible||!this._opacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const o=i||this.parent,s=e[this._renderer.type],l=this._sizeAttenuation,a=this._stroke,c=this._linewidth,d=o._matrix.manual||o._flagMatrix,u=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==o,h=this._renderer.vertices,m=this._renderer.collection.length,p=this._flagVertices,g=this._flagFill||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ze&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ze&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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||o._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||u||f){this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let b,y;this._scale instanceof re?(b=this._scale.x*o._renderer.scale.x,y=this._scale.y*o._renderer.scale.y):(b=this._scale*o._renderer.scale.x,y=this._scale*o._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=o)}if(p){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,h,t.STATIC_DRAW)}return g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Se.updateTexture.call(Se,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture?this:(Se.isHidden.test(a)||(r+=c),r/=Se.precision,l&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==s&&(t.useProgram(s),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),t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform1f(s.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,m),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const i=this.canvas,r=this.ctx,o=t.renderer.ratio,s=Nd.copy(e._renderer.scale).multiply(o),l=e._stroke,a=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._decoration,h=e._direction;i.width=Math.max(Math.ceil(e._renderer.rect.width*s.x),1),i.height=Math.max(Math.ceil(e._renderer.rect.height*s.y),1);const m=e._renderer.rect.centroid,p=m.x,g=m.y;let b,y,_,k,x,v,N,w,T,C,$;const E=c._renderer&&c._renderer.offset&&l._renderer&&l._renderer.offset;if(r.clearRect(0,0,i.width,i.height),E||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=h,c)if(typeof c=="string")r.fillStyle=c;else{const V=vt.Utils.getRendererType(c._renderer.type);Se[V].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(l){if(typeof l=="string")r.strokeStyle=l;else{const V=vt.Utils.getRendererType(l._renderer.type);Se[V].render.call(l,r,e),r.strokeStyle=l._renderer.effect}a&&(r.lineWidth=kn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(s.x,s.y),r.translate(p,g),Se.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,N=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,N),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,k=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,k),r.restore()):r.fillText(e.value,0,0)),Se.isHidden.test(l)||(l._renderer&&l._renderer.offset?(v=l._renderer.scale.x,N=l._renderer.scale.y,r.save(),r.translate(-l._renderer.offset.x,-l._renderer.offset.y),r.scale(v,N),b=e._size/l._renderer.scale.y,y=e._leading/l._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=l._renderer.offset.x/l._renderer.scale.x,k=l._renderer.offset.y/l._renderer.scale.y,x=a/l._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,k),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const V=r.measureText(e.value);switch(f){case"underline":T=V.actualBoundingBoxDescent,$=V.actualBoundingBoxDescent;break;case"strikethrough":T=0,$=0;break}w=-V.width/2,C=V.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,T),r.lineTo(C,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const i=Se.ctx;i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),i.textAlign="center",i.textBaseline=vt.Utils.baselines[t._baseline]||t._baseline;const r=i.measureText(t._value);let o=r.width,s=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!Se.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const l=o/2,a=s/2;switch(Se.alignments[t._alignment]||t._alignment){case Se.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Se.alignments.right:t.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-l,e.right=l}switch(t._baseline){case"bottom":e.top=-s,e.bottom=0;break;case"top":e.top=0,e.bottom=s;break;case"baseline":e.top=-a*1.5,e.bottom=a*.5;break;default:e.top=-a,e.bottom=a}e.width=o,e.height=s,e.centroid||(e.centroid={}),e.centroid.x=l,e.centroid.y=a},render:function(t,e,i){if(!this._visible||!this._opacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||this.parent,o=e[this._renderer.type],s=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,a=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ze&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ze&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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(s||l||a){this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,f;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,a&&(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=vt.Utils.getRendererType(this._mask._renderer.type);Se[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,Se.text.getBoundingClientRect(this,this._renderer.rect),Se.updateTexture.call(Se,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!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,al,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 d=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let i,r=this.left._x,o=this.left._y,s=this.right._x,l=this.right._y;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width,o=(o-.5)*i.height,s=(s-.5)*i.width,l=(l-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,l);for(let a=0;a<this.stops.length;a++){const c=this.stops[a];this._renderer.effect.addColorStop(c._offset,c._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let i,r=this.center._x,o=this.center._y,s=this.focal._x,l=this.focal._y,a=this._radius;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width*.5,o=(o-.5)*i.height*.5,s=(s-.5)*i.width*.5,l=(l-.5)*i.height*.5,a*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,l,a);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(i,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,i&&(this._renderer.offset.x+=i.width/2,this._renderer.offset.y+=i.height/2,this._scale instanceof re?(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 re||(this._renderer.scale=new re);let r,o;this._scale instanceof re?(r=this._scale.x,o=this._scale.y):(r=this._scale,o=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=o<0?-o:o}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const i=vt.Utils.getRendererType(e._renderer.type);if(this[i].updateCanvas.call(Se,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 i,r,o;if(i=t.createProgram(),oe.each(e,function(s){t.attachShader(i,s)}),t.linkProgram(i),r=t.getProgramParameter(i,t.LINK_STATUS),!r)throw o=t.getProgramInfoLog(i),t.deleteProgram(i),new Lt("unable to link program: "+o);return i}},extensions:{init:function(t){const e={},i=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<i.length;r++){const o=i[r];e[o]=Se.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new fo};Se.ctx=Se.canvas.getContext("2d");var Td=class extends ee{constructor(t){super();let e,i,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(Se.canvas=t.offscreenElement,Se.ctx=Se.canvas.getContext("2d")),this.scene=new pt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new xn(x0),scale:1,opacity:1},this._flagMatrix=!0,t=oe.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 Lt("unable to create a webgl context. Try using another renderer.");r=rn.create(e,rn.path.vertex,rn.types.vertex),o=rn.create(e,rn.path.fragment,rn.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},i=this.programs.path=Se.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Se.extensions.init(e),e.renderer=this,i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.rect=e.getUniformLocation(i,"u_rect");const s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,al,e.STATIC_DRAW),r=rn.create(e,rn.points.vertex,rn.types.vertex),o=rn.create(e,rn.points.fragment,rn.types.fragment),i=this.programs.points=Se.program.create(e,[r,o]),i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.size=e.getUniformLocation(i,"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,i){let r,o;const s=this.ctx;return this.width=t,this.height=e,this.ratio=typeof i>"u"?Is(s):i,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,oe.isObject(this.domElement.style)&&oe.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,o=e*this.ratio,s.viewport(0,0,r,o),this.programs.resolution.width=r,this.programs.resolution.height=o,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(ee.Types.resize,t,e,i)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),Se.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};S(Td,"Utils",Se);var C0=oe.extend({Error:Lt,getRatio:Is,read:Ue,xhr:xd},oe,Pt,cc,dc),Ne=class io{constructor(e){S(this,"_events",new ee),S(this,"type",""),S(this,"renderer",null),S(this,"scene",null),S(this,"width",0),S(this,"height",0),S(this,"frameCount",0),S(this,"timeDelta",0),S(this,"playing",!1);const i=oe.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:io.Types.svg,autostart:!1});if(oe.each(i,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),oe.isElement(i.domElement)){const r=i.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=io.Types[r])}this.renderer=new io[this.type](this),this.setPlaying(i.autostart),this.frameCount=0,i.fullscreen?(this.fit=v0.bind(this),this.fit.domElement=window,this.fit.attached=!0,oe.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),oe.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ut.bind(this.fit.domElement,"resize",this.fit),this.fit()):i.fitted?(this.fit=S0.bind(this),oe.extend(this.renderer.domElement.style,{display:"block"})):typeof i.width=="number"&&typeof i.height=="number"&&(this.renderer.setSize(i.width,i.height,this.ratio),this.width=i.width,this.height=i.height),this.renderer.bind(ee.Types.resize,B0.bind(this)),this.scene=this.renderer.scene,io.Instances.push(this),i.autostart&&Pr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=this._events.listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=this._events.ignore)==null?void 0:e.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,Pr.init(),this.trigger(ee.Types.play)}pause(){return this.playing=!1,this.trigger(ee.Types.pause)}setPlaying(e){this.playing=e}release(e){let i,r,o;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&typeof e.fill.unbind=="function"&&e.fill.unbind(),typeof e.stroke=="object"&&typeof e.stroke.unbind=="function"&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(i=0;i<e.vertices.length;i++)r=e.vertices[i],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(i=0;i<e.children.length;i++)o=e.children[i],this.release(o);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 s=this.renderer.ctx;e._renderer.texture&&(s.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(s.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}getShapesAtPoint(e,i,r){return this.scene&&typeof this.scene.getShapesAtPoint=="function"?this.scene.getShapesAtPoint(e,i,r):[]}update(){const e=!!this._lastFrame,i=oe.performance.now();e&&(this.timeDelta=parseFloat((i-this._lastFrame).toFixed(3))),this._lastFrame=i,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ut.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,o=this.height,s=this.renderer;return(r!==s.width||o!==s.height)&&s.setSize(r,o,this.ratio),this.trigger(ee.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(ee.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,i,r,o){const s=new Bo(e,i,r,o);return this.scene.add(s),s}makeArrow(e,i,r,o,s){const l=typeof s=="number"?s:10,a=Math.atan2(o-i,r-e),c=[new $e(e,i,void 0,void 0,void 0,void 0,ie.move),new $e(r,o,void 0,void 0,void 0,void 0,ie.line),new $e(r-l*Math.cos(a-Math.PI/4),o-l*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ie.line),new $e(r,o,void 0,void 0,void 0,void 0,ie.move),new $e(r-l*Math.cos(a+Math.PI/4),o-l*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ie.line)],d=new Re(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,i,r,o){const s=new si(e,i,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,i,r,o,s){const l=new Co(e,i,r,o,s);return this.scene.add(l),l}makeCircle(e,i,r,o){const s=new xo(e,i,r,o);return this.scene.add(s),s}makeEllipse(e,i,r,o,s){const l=new ko(e,i,r,o,s);return this.scene.add(l),l}makeStar(e,i,r,o,s){const l=new Js(e,i,r,o,s);return this.scene.add(l),l}makeCurve(e){const i=arguments.length;if(!Array.isArray(e)){e=[];for(let l=0;l<i;l+=2){const a=arguments[l];if(typeof a!="number")break;const c=arguments[l+1];e.push(new $e(a,c))}}const r=arguments[i-1],o=new Re(e,!(typeof r=="boolean"&&r),!0),s=o.getBoundingClientRect();return o.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(o),o}makePolygon(e,i,r,o){const s=new Qs(e,i,r,o);return this.scene.add(s),s}makeArcSegment(e,i,r,o,s,l,a){const c=new Xs(e,i,r,o,s,l,a);return this.scene.add(c),c}makePoints(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let s=0;s<i;s+=2){const l=arguments[s];if(typeof l!="number")break;const a=arguments[s+1];r.push(new re(l,a))}}const o=new Zs(r);return this.scene.add(o),o}makePath(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let a=0;a<i;a+=2){const c=arguments[a];if(typeof c!="number")break;const d=arguments[a+1];r.push(new $e(c,d))}}const o=arguments[i-1],s=new Re(r,!(typeof o=="boolean"&&o)),l=s.getBoundingClientRect();return typeof l.top=="number"&&typeof l.left=="number"&&typeof l.right=="number"&&typeof l.bottom=="number"&&s.center().translation.set(l.left+l.width/2,l.top+l.height/2),this.scene.add(s),s}makeText(e,i,r,o){const s=new Cn(e,i,r,o);return this.add(s),s}makeLinearGradient(e,i,r,o){const s=Array.prototype.slice.call(arguments,4),l=new Ge(e,i,r,o,s);return this.add(l),l}makeRadialGradient(e,i,r){const o=Array.prototype.slice.call(arguments,3),s=new Ze(e,i,r,o);return this.add(s),s}makeSprite(e,i,r,o,s,l,a){const c=new wo(e,i,r,o,s,l);return a&&c.play(),this.add(c),c}makeImage(e,i,r,o,s,l){const a=new kd(e,i,r,o,s,l);return this.add(a),a}makeImageSequence(e,i,r,o,s){const l=new il(e,i,r,o);return s&&l.play(),this.add(l),l}makeTexture(e,i){return new De(e,i)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const i=new pt;return this.scene.add(i),i.add(e),i}interpret(e,i,r){const o=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(o in Ue))return null;const s=Ue[o].call(this,e);return r?this.add(i&&s instanceof pt?s.children:s):s.parent&&s.remove(),s}load(e,i){const r=new pt;let o,s,l;const a=(function(c){for(Ut.temp.innerHTML=c,s=0;s<Ut.temp.children.length;s++)o=Ut.temp.children[s],l=this.interpret(o,!1,!1),l!==null&&r.add(l);if(typeof i=="function"){const d=Ut.temp.children.length<=1?Ut.temp.children[0]:Ut.temp.children;i(r,d)}}).bind(this);return/\.svg$/i.test(e)?(xd(e,a),r):(a(e),r)}};S(Ne,"NextFrameId",kt.NextFrameId),S(Ne,"Types",kt.Types),S(Ne,"Version",kt.Version),S(Ne,"PublishDate",kt.PublishDate),S(Ne,"Identifier",kt.Identifier),S(Ne,"Resolution",kt.Resolution),S(Ne,"AutoCalculateImportedMatrices",kt.AutoCalculateImportedMatrices),S(Ne,"Instances",kt.Instances),S(Ne,"uniqueId",kt.uniqueId),S(Ne,"Anchor",$e),S(Ne,"Collection",ri),S(Ne,"Events",ee),S(Ne,"Group",pt),S(Ne,"Matrix",ki),S(Ne,"Path",Re),S(Ne,"Registry",fo),S(Ne,"Element",Ji),S(Ne,"Shape",zn),S(Ne,"Text",Cn),S(Ne,"Vector",re),S(Ne,"Gradient",ut),S(Ne,"Image",kd),S(Ne,"ImageSequence",il),S(Ne,"LinearGradient",Ge),S(Ne,"RadialGradient",Ze),S(Ne,"Sprite",wo),S(Ne,"Stop",oi),S(Ne,"Texture",De),S(Ne,"ArcSegment",Xs),S(Ne,"Circle",xo),S(Ne,"Ellipse",ko),S(Ne,"Line",Bo),S(Ne,"Points",Zs),S(Ne,"Polygon",Qs),S(Ne,"Rectangle",si),S(Ne,"RoundedRectangle",Co),S(Ne,"Star",Js),S(Ne,"CanvasRenderer",vt),S(Ne,"SVGRenderer",Bd),S(Ne,"WebGLRenderer",Td),S(Ne,"Commands",ie),S(Ne,"Utils",C0);var Sn=Ne;function v0(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio)}function S0(){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(),i=this.width=e.width,r=this.height=e.height;this.renderer.setSize(i,r,this.ratio)}function B0(t,e){this.width=t,this.height=e,this.trigger(ee.Types.resize,t,e)}var Pr=Ut.getRequestAnimationFrame();function $d(){for(let t=0;t<Sn.Instances.length;t++){const e=Sn.Instances[t];e.playing&&e.update()}Sn.NextFrameId=Pr($d)}Pr.init=function(){$d(),Pr.init=function(){}};let Bn;typeof window<"u"?Bn=window:typeof global<"u"?Bn=global:typeof self<"u"&&(Bn=self);let Ed;const Kt=Math.PI*2,gt=Math.PI*.5;function N0(t,e,i,r,o,s){let l;return arguments.length<=1?(l=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):l=t,{translateX:o,translateY:s,scaleX:Math.sqrt(l*l+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,l)/Math.PI}}function T0(t){Ed=t}function $0(t,e){e=e&&e.identity()||new Ed;let i=t;const r=[];for(;i&&i._matrix;)r.push(i._matrix),i=i.parent;r.reverse();for(let o=0;o<r.length;o++){const l=r[o].elements;e.multiply(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8])}return e}function Wt(t,e,i){return i*(e-t)+t}function jt(t,e){for(;t<0;)t+=e;return t%e}const Rd=Bn.Float32Array||Array,E0=Math.floor;function Nn(t){return E0(t*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",arc:"A",close:"Z"};class ne{constructor(){B(this,"_events",{});B(this,"_bound",!1)}addEventListener(e,i){return(this._events[e]||(this._events[e]=[])).push(i),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,i){if(!this._events)return this;if(!e&&!i)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let l=this._events[e];if(l){let a=[];if(i)for(let c=0,d=l.length;c<d;c++){let u=l[c];u=u.handler?u.handler:u,i!==u&&a.push(u)}this._events[e]=a}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const i=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...i);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,i,r){const o=this;e&&(s.obj=e,s.name=i,s.handler=r,e.on(i,s));function s(){r.apply(o,arguments)}return o}ignore(e,i,r){return e.off(i,r),this}}B(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Pd={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ne.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ne.Types.change))}}},_t=class _t extends ne{constructor(i=0,r=0){super();B(this,"_x",0);B(this,"_y",0);for(let o in Pd)Object.defineProperty(this,o,Pd[o]);this.x=i,this.y=r}static add(i,r){return new _t(i.x+r.x,i.y+r.y)}static sub(i,r){return new _t(i.x-r.x,i.y-r.y)}static subtract(i,r){return _t.sub(i,r)}static ratioBetween(i,r){return(i.x*r.x+i.y*r.y)/(i.length()*r.length())}static angleBetween(i,r){if(arguments.length>=4){const l=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,l)}const o=i.x-r.x,s=i.y-r.y;return Math.atan2(s,o)}static distanceBetween(i,r){return Math.sqrt(_t.distanceBetweenSquared(i,r))}static distanceBetweenSquared(i,r){const o=i.x-r.x,s=i.y-r.y;return o*o+s*s}set(i,r){return this.x=i,this.y=r,this}copy(i){return this.x=i.x,this.y=i.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new _t(this.x,this.y)}add(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x+=i,this.y+=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x+=i.x,this.y+=i.y):(this.x+=i,this.y+=r),this)}addSelf(i){return this.add.apply(this,arguments)}sub(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x-=i,this.y-=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x-=i.x,this.y-=i.y):(this.x-=i,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(i){return this.sub.apply(this,arguments)}subtractSelf(i){return this.sub.apply(this,arguments)}multiply(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x*=i,this.y*=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x*=i.x,this.y*=i.y):(this.x*=i,this.y*=r),this)}multiplySelf(i){return this.multiply.apply(this,arguments)}multiplyScalar(i){return this.multiply(i)}divide(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x/=i,this.y/=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x/=i.x,this.y/=i.y):(this.x/=i,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(i){return this.divide.apply(this,arguments)}divideScalar(i){return this.divide(i)}negate(){return this.multiply(-1)}dot(i){return this.x*i.x+this.y*i.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(i){return Math.sqrt(this.distanceToSquared(i))}distanceToSquared(i){const r=this.x-i.x,o=this.y-i.y;return r*r+o*o}setLength(i){return this.normalize().multiplyScalar(i)}equals(i,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(i)<r}lerp(i,r){const o=(i.x-this.x)*r+this.x,s=(i.y-this.y)*r+this.y;return this.set(o,s)}isZero(i){return i=typeof i>"u"?1e-4:i,this.length()<i}toString(){return this.x+", "+this.y}toObject(){return{x:Nn(this.x),y:Nn(this.y)}}rotate(i){const r=this.x,o=this.y,s=Math.cos(i),l=Math.sin(i);return this.x=r*s-o*l,this.y=r*l+o*s,this}};B(_t,"zero",new _t),B(_t,"left",new _t(-1,0)),B(_t,"right",new _t(1,0)),B(_t,"up",new _t(0,-1)),B(_t,"down",new _t(0,1));let pe=_t;class Ae extends pe{constructor(i=0,r=0,o=0,s=0,l=0,a=0,c=fe.move){super(i,r);B(this,"controls",{left:new pe,right:new pe});B(this,"_command",fe.move);B(this,"_relative",!0);B(this,"_rx",0);B(this,"_ry",0);B(this,"_xAxisRotation",0);B(this,"_largeArcFlag",0);B(this,"_sweepFlag",1);for(let u in Fd)Object.defineProperty(this,u,Fd[u]);this.command=c,this.relative=!0;const d=Ae.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(ne.Types.change,d),this.controls.right.set(l,a).addEventListener(ne.Types.change,d)}static makeBroadcast(i){return r;function r(){i._bound&&i.dispatchEvent(ne.Types.change)}}static fromObject(i){return new Ae().copy(i)}copy(i){return this.x=i.x,this.y=i.y,typeof i.command=="string"&&(this.command=i.command),i.controls&&(i.controls.left&&this.controls.left.copy(i.controls.left),i.controls.right&&this.controls.right.copy(i.controls.right)),typeof i.relative=="boolean"&&(this.relative=i.relative),typeof i.rx=="number"&&(this.rx=i.rx),typeof i.ry=="number"&&(this.ry=i.ry),typeof i.xAxisRotation=="number"&&(this.xAxisRotation=i.xAxisRotation),typeof i.largeArcFlag=="number"&&(this.largeArcFlag=i.largeArcFlag),typeof i.sweepFlag=="number"&&(this.sweepFlag=i.sweepFlag),this}clone(){return new Ae().copy(this)}toObject(){return{x:Nn(this.x),y:Nn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Nn(this.rx),ry:Nn(this.ry),xAxisRotation:Nn(this.xAxisRotation),largeArcFlag:Nn(this.largeArcFlag),sweepFlag:Nn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Fd={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ne.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ne.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ne.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ne.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ne.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}}};let R0=0;const Po={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return R0++}},Fo={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 Vo(t,e,i,r,o){const s=1-t;return s*s*s*e+3*s*s*t*i+3*s*t*t*r+t*t*t*o}function Vd(t,e,i,r,o,s,l,a,c){c=c||Fo.RecursionLimit;const d=c+1;if(Math.abs(t-l)<.001&&Math.abs(e-a)<.001)return[new Ae(l,a)];const u=[];for(let f=0;f<d;f++){const h=f/d,m=Vo(h,t,i,o,l),p=Vo(h,e,r,s,a);u.push(new Ae(m,p))}return u}function P0(t,e,i,r,o,s,l,a,c){if(t===i&&e===r&&o===l&&s===a){const b=l-t,y=a-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(l-t),u=6*(t+o)-12*i,f=3*(i-t),h=9*(r-s)+3*(a-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+f,_=(h*b+m)*b+p;return Math.sqrt(y*y+_*_)}return V0(g,0,1,c||Fo.RecursionLimit)}function F0(t,e,i,r,o,s,l,a){const c=[],d=[[],[]];let u,f,h,m,p,g,b,y;for(let v=0;v<2;++v){if(v===0?(f=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*l,h=3*i-3*t):(f=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*a,h=3*r-3*e),Math.abs(u)<.001){if(Math.abs(f)<.001)continue;m=-h/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*h*u,y=Math.sqrt(b),!(b<0)&&(p=(-f+y)/(2*u),0<p&&p<1&&c.push(p),g=(-f-y)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*i+3*x*m*m*o+m*m*m*l,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*a;return d[0][k]=t,d[1][k]=e,d[0][k+1]=l,d[1][k+1]=a,d[0].length=d[1].length=k+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 V0(t,e,i,r){let o=Fo.abscissas[r-2],s=Fo.weights[r-2],l=.5*(i-e),a=l+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(a):0;for(;c<d;){const f=l*o[c];u+=s[c++]*(t(a+f)+t(a-f))}return l*u}function M0(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],l=e?jt(o-1,i):Math.max(o-1,0),a=e?jt(o+1,i):Math.min(o+1,r),c=t[l],d=s,u=t[a];I0(c,d,u),d.command=o===0?fe.move:fe.curve}}function I0(t,e,i){const r=pe.angleBetween(t,e),o=pe.angleBetween(i,e);let s=pe.distanceBetween(t,e),l=pe.distanceBetween(i,e),a=(r+o)/2;return s<.001||l<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,l*=.33,o<r?a+=gt:a-=gt,e.controls.left.x=Math.cos(a)*s,e.controls.left.y=Math.sin(a)*s,a-=Math.PI,e.controls.right.x=Math.cos(a)*l,e.controls.right.y=Math.sin(a)*l,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=(zi=class extends ne{constructor(){super();B(this,"_flagId",!1);B(this,"_flagClassName",!1);B(this,"_renderer",{});B(this,"_id",Po.Identifier+Po.uniqueId());B(this,"_className","");B(this,"classList",[]);for(let i in Md)Object.defineProperty(this,i,Md[i])}static fromObject(i){const r=new zi().copy(i);return"id"in i&&(r.id=i.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(i){return i.renderer&&typeof i.renderer.type=="string"&&(this.renderer.type=i.renderer.type),typeof i.className=="string"&&(this.className=i.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const r=this.renderer.ctx;this._renderer.texture&&(r.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(r.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const i=this._renderer.type;return this._renderer={type:i},this}},B(zi,"Properties",["renderer","id","className"]),zi);const Md={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 Mo extends Error{constructor(i){super();B(this,"name","Two.js");B(this,"message");this.message=i}}class A0{constructor(){B(this,"map",{})}add(e,i){return this.map[e]=i,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let Io;const Id={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Bn.document&&(Io=document.createElement("a"));const Je=class Je extends Fr{constructor(i,r){super();B(this,"_flagSrc",!1);B(this,"_flagImage",!1);B(this,"_flagVideo",!1);B(this,"_flagLoaded",!1);B(this,"_flagRepeat",!1);B(this,"_flagOffset",!1);B(this,"_flagScale",!1);B(this,"_src","");B(this,"_image",null);B(this,"_loaded",!1);B(this,"_repeat","no-repeat");B(this,"_scale",1);B(this,"_offset",null);for(let o in Ad)Object.defineProperty(this,o,Ad[o]);if(this._renderer.type="texture",this._renderer.flagOffset=O0.bind(this),this._renderer.flagScale=z0.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const o=(function(){this.unbind(ne.Types.load,o),typeof r=="function"&&r()}).bind(this);this.bind(ne.Types.load,o)}if(typeof i=="string")this.src=i;else if(typeof i=="object"){const o=Object.prototype.toString.call(i);(o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"||o==="[object HTMLVideoElement]"||o==="[object Image]")&&(this.image=i)}this._update()}fromObject(i){const r=new Je().copy(i);return"id"in i&&(r.id=i.id),r}static getAbsoluteURL(i){return Io?(Io.href=i,Io.href):i}static loadHeadlessBuffer(i,r){i.image.onload=r,i.image.src=i.src}static getTag(i){return i&&i.nodeName&&i.nodeName.toLowerCase()||"img"}static getImage(i){const r=Je.getAbsoluteURL(i);if(Je.ImageRegistry.contains(r))return Je.ImageRegistry.get(r);let o;return Bn.document?Id.video.test(r)?o=document.createElement("video"):o=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),o.crossOrigin="anonymous",o.referrerPolicy="no-referrer",o}static load(i,r){let o=i.image,s=Je.getTag(o);i._flagImage&&(/canvas/i.test(s)?Je.Register.canvas(i,r):(i._src=o.getAttribute("two-src")||o.src,Je.Register[s](i,r))),i._flagSrc&&(o||(o=Je.getImage(i.src),i.image=o),s=Je.getTag(o),Je.Register[s](i,r))}clone(){const i=new Je(this.src);return i.repeat=this.repeat,i.offset.copy(this.offset),i.scale=this.scale,i}copy(i){return this.src=i.src,this.repeat=i.repeat,this.offset=typeof i.offset=="number"||i.offset instanceof pe?i.offset:new pe().copy(i.offset),this.scale=typeof i.scale=="number"||i.scale instanceof pe?i.scale:new pe().copy(i.scale),this}toObject(){const i=super.toObject.call(this);return i.renderer.type="texture",i.src=this.src,i.repeat=this.repeat,i.offset=this.offset.toObject(),i.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),i}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(ne.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Je.load(this,(function(){this.loaded=!0,this.trigger(ne.Types.change).trigger(ne.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 i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(Je,"Properties",["src","loaded","repeat","scale","offset","image"]),B(Je,"RegularExpressions",Id),B(Je,"ImageRegistry",new A0),B(Je,"Register",{canvas:function(i,r){i._src="#"+i.id,Je.ImageRegistry.add(i.src,i.image),typeof r=="function"&&r()},img:function(i,r){const o=i.image,s=function(a){o.removeEventListener&&typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)),typeof r=="function"&&r()},l=function(a){throw typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)),new Mo("unable to load "+i.src)};typeof o.width=="number"&&o.width>0&&typeof o.height=="number"&&o.height>0?s():typeof o.addEventListener=="function"&&(o.addEventListener("load",s,!1),o.addEventListener("error",l,!1)),i._src=Je.getAbsoluteURL(i._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",i.src),Je.ImageRegistry.add(i.src,o),i.image.src=i.src)},video:function(i,r){const o=function(l){i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),i.image.width=i.image.videoWidth,i.image.height=i.image.videoHeight,typeof r=="function"&&r()},s=function(l){throw i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),new Mo("unable to load "+i.src)};i._src=Je.getAbsoluteURL(i._src),i.image.getAttribute("two-src")||(i.image.setAttribute("two-src",i.src),Je.ImageRegistry.add(i.src,i.image)),i.image.readyState>=4?o():(i.image.addEventListener("canplaythrough",o,!1),i.image.addEventListener("error",s,!1),i.image.src=i.src,i.image.load())}});let Qe=Je;const Ad={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=Qe.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}Qe.ImageRegistry.contains(i)?this._image=Qe.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(ne.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ne.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(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function O0(){this._flagOffset=!0}function z0(){this._flagScale=!0}class Ci extends Array{constructor(){super();Pa(this,wt,new ne);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 zt(this,wt)}set _events(i){bm(this,wt,i)}get _bound(){return zt(this,wt)._bound}set _bound(i){zt(this,wt)._bound=i}addEventListener(){var i;return(i=zt(this,wt).addEventListener)==null?void 0:i.apply(this,arguments)}on(){var i;return(i=zt(this,wt).on)==null?void 0:i.apply(this,arguments)}bind(){var i;return(i=zt(this,wt).bind)==null?void 0:i.apply(this,arguments)}removeEventListener(){var i;return(i=zt(this,wt).removeEventListener)==null?void 0:i.apply(this,arguments)}off(){var i;return(i=zt(this,wt).off)==null?void 0:i.apply(this,arguments)}unbind(){var i;return(i=zt(this,wt).unbind)==null?void 0:i.apply(this,arguments)}dispatchEvent(){var i;return(i=zt(this,wt).dispatchEvent)==null?void 0:i.apply(this,arguments)}trigger(){var i;return(i=zt(this,wt).trigger)==null?void 0:i.apply(this,arguments)}listen(){var i;return(i=zt(this,wt).listen)==null?void 0:i.apply(this,arguments)}ignore(){var i;return(i=zt(this,wt).ignore)==null?void 0:i.apply(this,arguments)}pop(){const i=super.pop.apply(this,arguments);return this.trigger(ne.Types.remove,[i]),i}shift(){const i=super.shift.apply(this,arguments);return this.trigger(ne.Types.remove,[i]),i}push(){const i=super.push.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),i}unshift(){const i=super.unshift.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),i}splice(){const i=super.splice.apply(this,arguments);if(this.trigger(ne.Types.remove,i),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ne.Types.insert,r),this.trigger(ne.Types.order)}return i}sort(){return super.sort.apply(this,arguments),this.trigger(ne.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ne.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(i,r){const o=[];for(let s=0;s<this.length;s++){const l=this[s];let a;r?a=i.call(r,l,s):a=i(l,s),o.push(a)}return o}}wt=new WeakMap;const Od=Array.prototype.slice;function D0(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const je={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=Od.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=Od.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,i){const r=i||this,o=!D0(t)&&Object.keys(t),s=(o||t).length;for(let l=0;l<s;l++){const a=o?o[l]:l;e.call(r,t[a],a,t)}return t},performance:Bn.performance&&Bn.performance.now?Bn.performance:Date},Yt=class Yt extends Fr{constructor(i,r,o){super();B(this,"_flagOffset",!0);B(this,"_flagOpacity",!0);B(this,"_flagColor",!0);B(this,"_offset",0);B(this,"_opacity",1);B(this,"_color","#fff");for(let s in zd)Object.defineProperty(this,s,zd[s]);this._renderer.type="stop",this.offset=typeof i=="number"?i:Yt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:Yt.Index<=0?"#fff":"#000",Yt.Index=(Yt.Index+1)%2}static fromObject(i){const r=new Yt().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Yt.Properties.length;r++){const o=Yt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Yt;return je.each(Yt.Properties,function(o){r[o]=this[o]},this),i&&i.stops&&i.stops.push(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="stop",je.each(Yt.Properties,r=>{i[r]=this[r]},this),i}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};B(Yt,"Index",0),B(Yt,"Properties",["offset","opacity","color"]);let vi=Yt;const zd={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)}}},Fn=class Fn extends Fr{constructor(i){super();B(this,"_flagStops",!1);B(this,"_flagSpread",!1);B(this,"_flagUnits",!1);B(this,"_spread","");B(this,"_units","");for(let r in Dd)Object.defineProperty(this,r,Dd[r]);this._renderer.type="gradient",this._renderer.flagStops=L0.bind(this),this._renderer.bindStops=H0.bind(this),this._renderer.unbindStops=W0.bind(this),this.spread="pad",this.units="objectBoundingBox",i&&(this.stops=i)}static fromObject(i){let r=i.stops;r&&r.length>0&&(r=r.map(s=>s instanceof vi?s:new vi().copy(s)));const o=new Fn(r).copy(i);return"id"in i&&(o.id=i.id),o}clone(i){const r=this.stops.map(s=>s.clone()),o=new Fn(r);return je.each(Fn.Properties,s=>{o[s]=this[s]},this),i&&i.add(o),o}copy(i){super.copy.call(this,i);for(let r=0;r<Fn.Properties.length;r++){const o=Fn.Properties[r];o in i&&(this[o]=i[o])}return this}toObject(){const i={stops:this.stops.map(r=>r.toObject())};return je.each(Fn.Properties,r=>{i[r]=this[r]},this),i}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ne.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(Fn,"Stop",vi),B(Fn,"Properties",["spread","stops","units"]);let ft=Fn;const Dd={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,i=this._renderer.unbindStops;this._stops&&this._stops.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),this._stops=new Ci((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,i),e(this._stops)}}};function L0(){this._flagStops=!0}function H0(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function W0(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const hi=class hi extends ft{constructor(i,r,o,s,l){super(l);B(this,"_flagEndPoints",!1);B(this,"_left",null);B(this,"_right",null);for(let a in Ld)Object.defineProperty(this,a,Ld[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=j0.bind(this),this.left=new pe,this.right=new pe,typeof i=="number"&&(this.left.x=i),typeof r=="number"&&(this.left.y=r),typeof o=="number"&&(this.right.x=o),typeof s=="number"&&(this.right.y=s)}static fromObject(i){const r=new hi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<hi.Properties.length;r++){const o=hi.Properties[r];o in i&&(this[o]=i[o]instanceof pe?i[o]:new pe().copy(i[o]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new hi(this.left._x,this.left._y,this.right._x,this.right._y,r);return je.each(ft.Properties,function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return i.left=this.left.toObject(),i.right=this.right.toObject(),i}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(ne.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};B(hi,"Stop",vi),B(hi,"Properties",["left","right"]);let Vt=hi;const Ld={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(ne.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ne.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(ne.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function j0(){this._flagEndPoints=!0}const Vn=class Vn extends ft{constructor(i,r,o,s,l,a){super(s);B(this,"_flagRadius",!1);B(this,"_flagCenter",!1);B(this,"_flagFocal",!1);B(this,"_radius",0);B(this,"_center",null);B(this,"_focal",null);for(let c in Hd)Object.defineProperty(this,c,Hd[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=q0.bind(this),this._renderer.flagFocal=X0.bind(this),this.center=new pe,this.radius=typeof o=="number"?o:1,this.focal=new pe,typeof i=="number"&&(this.center.x=i),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof l=="number"&&(this.focal.x=l),typeof a=="number"&&(this.focal.y=a)}static fromObject(i){const r=new Vn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Vn.Properties.length;r++){const o=Vn.Properties[r];o in i&&(/(center|focal)i/.test(o)?this[o]=i[o]instanceof pe?i[o]:new pe().copy(i[o]):typeof i[o]=="number"&&(this[o]=i[MediaKeySystemAccess]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new Vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(ft.Properties.concat(Vn.Properties),function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return je.each(Vn.Properties,function(r){i[r]=this[r]},this),i.center=this.center.toObject(),i.focal=this.focal.toObject(),i}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(ne.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};B(Vn,"Stop",vi),B(Vn,"Properties",["center","radius","focal"]);let Mt=Vn;const Hd={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(ne.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ne.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ne.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ne.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function q0(){this._flagCenter=!0}function X0(){this._flagFocal=!0}function Wd(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const l=t._lengths[s];if(o>=r)return r-o>=0;o+=l}return!1}function Ao(t,e){const i=t._length;if(e<=0)return 0;if(e>=i)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function jd(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),P0(r,a,o,c,s,d,l,u,i)}function cl(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),Vd(r,a,o,c,s,d,l,u,i)}function Si(t){switch(t.renderer.type){case"texture":return Qe.fromObject(t);case"gradient":return ft.fromObject(t);case"linear-gradient":return Vt.fromObject(t);case"radial-gradient":return Mt.fromObject(t)}return t}const Y0=Math.cos,U0=Math.sin,qd=Math.tan,dl=[],At=class At extends ne{constructor(i,r,o,s,l,a){super();B(this,"elements",new Rd(9));B(this,"manual",!1);let c=i;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(i,r,o){if(r.length<=3){const w=i;let T,C,$;const E=r[0]||0,V=r[1]||0,P=r[2]||0;return T=w[0]*E+w[1]*V+w[2]*P,C=w[3]*E+w[4]*V+w[5]*P,$=w[6]*E+w[7]*V+w[8]*P,[T,C,$]}const s=i[0],l=i[1],a=i[2],c=i[3],d=i[4],u=i[5],f=i[6],h=i[7],m=i[8],p=r[0],g=r[1],b=r[2],y=r[3],_=r[4],k=r[5],x=r[6],v=r[7],N=r[8];return o=o||new Rd(9),o[0]=s*p+l*y+a*x,o[1]=s*g+l*_+a*v,o[2]=s*b+l*k+a*N,o[3]=c*p+d*y+u*x,o[4]=c*g+d*_+u*v,o[5]=c*b+d*k+u*N,o[6]=f*p+h*y+m*x,o[7]=f*g+h*_+m*v,o[8]=f*b+h*k+m*N,o}static fromObject(i){return new At().copy(i)}set(i,r,o,s,l,a,c,d,u){if(typeof r>"u"){const f=i;i=f[0],r=f[1],o=f[2],s=f[3],l=f[4],a=f[5],c=f[6],d=f[7],u=f[8]}return this.elements[0]=i,this.elements[1]=r,this.elements[2]=o,this.elements[3]=s,this.elements[4]=l,this.elements[5]=a,this.elements[6]=c,this.elements[7]=d,this.elements[8]=u,this.trigger(ne.Types.change)}copy(i){return this.elements[0]=i.elements[0],this.elements[1]=i.elements[1],this.elements[2]=i.elements[2],this.elements[3]=i.elements[3],this.elements[4]=i.elements[4],this.elements[5]=i.elements[5],this.elements[6]=i.elements[6],this.elements[7]=i.elements[7],this.elements[8]=i.elements[8],this.manual=i.manual,this.trigger(ne.Types.change)}identity(){return this.elements[0]=At.Identity[0],this.elements[1]=At.Identity[1],this.elements[2]=At.Identity[2],this.elements[3]=At.Identity[3],this.elements[4]=At.Identity[4],this.elements[5]=At.Identity[5],this.elements[6]=At.Identity[6],this.elements[7]=At.Identity[7],this.elements[8]=At.Identity[8],this.trigger(ne.Types.change)}multiply(i,r,o,s,l,a,c,d,u){if(typeof r>"u")return this.elements[0]*=i,this.elements[1]*=i,this.elements[2]*=i,this.elements[3]*=i,this.elements[4]*=i,this.elements[5]*=i,this.elements[6]*=i,this.elements[7]*=i,this.elements[8]*=i,this.trigger(ne.Types.change);if(typeof o>"u"&&(o=1),typeof s>"u"){i=i||0,r=r||0,o=o||0,l=this.elements;const K=l[0]*i+l[1]*r+l[2]*o,J=l[3]*i+l[4]*r+l[5]*o,Z=l[6]*i+l[7]*r+l[8]*o;return[K,J,Z]}const f=this.elements,h=[i,r,o,s,l,a,c,d,u],m=f[0],p=f[1],g=f[2],b=f[3],y=f[4],_=f[5],k=f[6],x=f[7],v=f[8],N=h[0],w=h[1],T=h[2],C=h[3],$=h[4],E=h[5],V=h[6],P=h[7],I=h[8];return this.elements[0]=m*N+p*C+g*V,this.elements[1]=m*w+p*$+g*P,this.elements[2]=m*T+p*E+g*I,this.elements[3]=b*N+y*C+_*V,this.elements[4]=b*w+y*$+_*P,this.elements[5]=b*T+y*E+_*I,this.elements[6]=k*N+x*C+v*V,this.elements[7]=k*w+x*$+v*P,this.elements[8]=k*T+x*E+v*I,this.trigger(ne.Types.change)}inverse(i){const r=this.elements;i=i||new At;const o=r[0],s=r[1],l=r[2],a=r[3],c=r[4],d=r[5],u=r[6],f=r[7],h=r[8],m=h*c-d*f,p=-h*a+d*u,g=f*a-c*u;let b=o*m+s*p+l*g;return b?(b=1/b,i.elements[0]=m*b,i.elements[1]=(-h*s+l*f)*b,i.elements[2]=(d*s-l*c)*b,i.elements[3]=p*b,i.elements[4]=(h*o-l*u)*b,i.elements[5]=(-d*o+l*a)*b,i.elements[6]=g*b,i.elements[7]=(-f*o+s*u)*b,i.elements[8]=(c*o-s*a)*b,i):null}scale(i,r){return arguments.length<=1&&(r=i),this.multiply(i,0,0,0,r,0,0,0,1)}rotate(i){const r=Y0(i),o=U0(i);return this.multiply(r,-o,0,o,r,0,0,0,1)}translate(i,r){return this.multiply(1,0,i,0,1,r,0,0,1)}skewX(i){const r=qd(i);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(i){const r=qd(i);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(i){return dl.length=0,this.toTransformArray(i,dl),dl.map(Nn).join(" ")}toTransformArray(i,r){const o=this.elements,s=!!r,l=o[0],a=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],m=o[7],p=o[8];if(s){r[0]=l,r[1]=d,r[2]=h,r[3]=a,r[4]=u,r[5]=m,r[6]=c,r[7]=f,r[8]=p;return}return[l,d,h,a,u,m,c,f,p]}if(s){r[0]=l,r[1]=d,r[2]=a,r[3]=u,r[4]=c,r[5]=f;return}return[l,d,a,u,c,f]}toArray(i,r){const o=this.elements,s=!!r,l=o[0],a=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],m=o[7],p=o[8];if(s){r[0]=l,r[1]=a,r[2]=c,r[3]=d,r[4]=u,r[5]=f,r[6]=h,r[7]=m,r[8]=p;return}return[l,a,c,d,u,f,h,m,p]}if(s){r[0]=l,r[1]=a,r[2]=c,r[3]=d,r[4]=u,r[5]=f;return}return[l,a,c,d,u,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new At().copy(this)}};B(At,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=At;T0(rr);const Jr=class Jr extends Fr{constructor(){super();B(this,"_flagMatrix",!0);B(this,"_flagScale",!1);B(this,"_matrix",null);B(this,"_worldMatrix",null);B(this,"_position",null);B(this,"_rotation",0);B(this,"_scale",1);B(this,"_skewX",0);B(this,"_skewY",0);for(let i in Oo)Object.defineProperty(this,i,Oo[i]);this._renderer.flagMatrix=Xd.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(i){const r=new Jr().copy(i);return"id"in i&&(r.id=i.id),r}get renderer(){return this._renderer}set renderer(i){this._renderer=i}get translation(){return Oo.position.get.apply(this,arguments)}set translation(i){Oo.position.set.apply(this,arguments)}addTo(i){return i.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(i,r,o){const s=o||{},l=s.ignoreVisibility===!0;if(!l&&"visible"in this&&this.visible===!1||!l&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const a=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();return c?i>=c.left-a&&i<=c.right+a&&r>=c.top-a&&r<=c.bottom+a:!1}copy(i){return super.copy.call(this,i),"position"in i&&(i.position instanceof pe?this.position=i.position:this.position.copy(i.position)),"rotation"in i&&(this.rotation=i.rotation),"scale"in i&&(this.scale=typeof i.scale=="number"||i.scale instanceof pe?i.scale:new pe(i.scale.x,i.scale.y)),"skewX"in i&&(this.skewX=i.skewX),"skewY"in i&&(this.skewY=i.skewY),"matrix"in i&&i.matrix.manual&&(this.matrix.copy(i.matrix),this.matrix.manual=!0),this}clone(i){const r=new Jr;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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer={type:"shape"},i.isShape=!0,i.translation=this.translation.toObject(),i.rotation=this.translation.rotation,i.scale=this.scale instanceof pe?this.scale.toObject():this.scale,i.skewX=this.skewX,i.skewY=this.skewY,i.matrix=this.matrix.toObject(),i}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_update(i){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)),i&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};B(Jr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Tn=Jr;const Oo={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ne.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ne.Types.change,this._renderer.flagMatrix),Xd.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(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(ne.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 $0(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Xd(){this._flagMatrix=!0}const Yd=/^(?:none|transparent)$/i,K0=8,ul=Number.EPSILON;function Ln(t,e){return{x:t,y:e}}function zo(t,e,i=ul){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function Ud(t,e,i,r){const o=t*i+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+r*r)||1e-12;let l=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(l=-l),l}function G0(t,e,i){if(!t)return[Ln(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Ln(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,l=e.largeArcFlag?1:0,a=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,f=e.y,h=(c-u)/2,m=(d-f)/2,p=Math.cos(s),g=Math.sin(s);let b=p*h+g*m,y=-g*h+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const O=Math.sqrt(x);r*=O,o*=O,_=r*r,k=o*o}const v=_*y*y+k*b*b,N=v===0?0:(_*k-v)/v;let w=Math.sqrt(Math.max(0,N));l===a&&(w=-w);const T=w*r*y/o,C=-w*o*b/r,$=p*T-g*C+(c+u)/2,E=g*T+p*C+(d+f)/2,V=Ud(1,0,(b-T)/r,(y-C)/o),P=Ud((b-T)/r,(y-C)/o,(-b-T)/r,(-y-C)/o)%Kt,I=V+P,K=a===0,J=(()=>{const O=I-V,z=Math.abs(O)<Number.EPSILON;let M=jt(O,Kt);return M<Number.EPSILON&&(M=z?0:Kt),K&&!z&&(M=M===Kt?-Kt:M-Kt),M})(),Z=Math.max(Po.Resolution,Math.max(i*2,1)),L=[];for(let O=1;O<=Z;O++){const z=O/Z,M=V+z*J;let R=$+r*Math.cos(M),W=E+o*Math.sin(M);if(s!==0){const U=R-$,G=W-E,X=Math.cos(s),j=Math.sin(s);R=U*X-G*j+$,W=U*j+G*X+E}L.push(Ln(R,W))}return L}function Z0(t,e=K0){const i=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:i,segments:r};const s=Math.max(1,Math.floor(e));let l=null,a=null,c=null,d=null;const u=(h=!1)=>{if(l){if(h&&a&&c&&!zo(a,c)){const m=Ln(a.x,a.y);r.push({a:c,b:m}),l.push(m),c=m}l.length>=3&&a&&c&&zo(a,c)&&i.push(l),l=null,a=null,c=null}},f=h=>{if(!c){c=h,l&&l.push(h);return}zo(c,h)||(r.push({a:c,b:h}),l&&l.push(h),c=h)};for(let h=0;h<o.length;h++){const m=o[h],p=m.command||(h===0?fe.move:fe.line);if(p===fe.move){u(!1);const g=Ln(m.x,m.y);l=[g],a=g,c=g,d=m;continue}if(d||(d=o[Math.max(h-1,0)]),p===fe.line)f(Ln(m.x,m.y));else if(p===fe.curve){const g=cl(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];f(Ln(y.x,y.y))}f(Ln(m.x,m.y))}else if(p===fe.arc){const g=G0(d,m,s);for(let b=0;b<g.length;b++)f(g[b])}else if(p===fe.close){u(!0),d=m;continue}else f(Ln(m.x,m.y));d=m}if(l){const h=!!t._closed||!!t.closed||a&&c&&!zo(a,c);u(h)}return{polygons:i,segments:r}}function Q0(t,e,i){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let l=s.length-1;for(let a=0;a<s.length;a++){const c=s[l],d=s[a];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),l=a}}return r}function J0(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<ul&&Math.abs(s)<ul){const h=t-i.x,m=e-i.y;return h*h+m*m}const l=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),a=Math.max(0,Math.min(1,l)),c=i.x+a*o,d=i.y+a*s,u=t-c,f=e-d;return u*u+f*f}function e1(t,e,i){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],l=J0(e,i,s.a,s.b);l<r&&(r=l)}return Math.sqrt(r)}function t1(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Yd.test(i):!0}function n1(t,e){const i=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&i>0;if(!(i>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!Yd.test(r):!0}function i1(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,l=t.top-r,a=t.bottom+r;return e>=o&&e<=s&&i>=l&&i<=a}const Do=Number.EPSILON;function Lo(t){return typeof t.relative!="boolean"||!!t.relative}function fn(t,e,i,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(i)<Do&&Math.abs(r)<Do){Lo(t)?o[e].clear():o[e].set(t.x,t.y);return}Lo(t)?o[e].set(i,r):o[e].set(t.x+i,t.y+r)}}function qt(t,e){fn(t,e,0,0)}function r1(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:Lo(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function or(t,e){const i=r1(t,e);return Math.abs(i.x)>Do||Math.abs(i.y)>Do}function Ho(t){t.command===fe.move||t.command===fe.close||(t.command=or(t,"left")||or(t,"right")?fe.curve:fe.line)}function Kd(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function o1(t,e){return or(e,"right")||or(t,"left")||or(t,"right")||or(e,"left")||t.command===fe.curve||e.command===fe.curve}function sr(t,e,i){return{x:Wt(t.x,e.x,i),y:Wt(t.y,e.y,i)}}function Gd(t,e){const i=t.controls&&t.controls[e];return i?Lo(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function s1(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},l=r?Gd(t,"right"):{...s},a={x:e.x,y:e.y},c=o?Gd(e,"left"):{...a},d=sr(s,l,i),u=sr(l,c,i),f=sr(c,a,i),h=sr(d,u,i),m=sr(u,f,i),p=sr(h,m,i),g=new Ae(p.x,p.y);return Kd(g,t),fn(g,"left",h.x-p.x,h.y-p.y),fn(g,"right",m.x-p.x,m.y-p.y),g.command=fe.curve,{anchor:g,startOut:d,endIn:f}}function l1(t,e,i,r,o,s){const l=t.length,a=i-e+1;let c=a-1,d=o?Math.min(a,4):1,u=d,f=d;if(r||(u=Math.min(1,e),f=Math.min(1,l-i-1)),c+=u+f,c<=1)return;const h=new Array(c+1);for(let w=0,T=e-u;w<=c;w+=1,T+=1){const C=jt(T,l);h[w]=t[C]}let m=h[0].x+2*h[1].x,p=h[0].y+2*h[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),v=new Array(c+1);for(let w=1;w<c;w+=1){const T=w<b,C=T||s?1:2,$=T?4:s?2:7,E=T?4:s?3:8,V=T?2:s?0:1,P=C/g;g=k[w]=$-P,m=y[w]=E*h[w].x+V*h[w+1].x-P*m,p=_[w]=E*h[w].y+V*h[w+1].y-P*p}x[b]=y[b]/k[b],v[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],v[w]=(_[w]-v[w+1])/k[w];x[c]=(3*h[c].x-x[b])/2,v[c]=(3*h[c].y-v[b])/2;const N=c-f;for(let w=u,T=e;w<=N;w+=1,T+=1){const C=jt(T,l),$=t[C],E=x[w]-$.x,V=v[w]-$.y;o||w<N?fn($,"right",E,V):qt($,"right"),o||w>u?fn($,"left",-E,-V):qt($,"left"),Ho($)}}function a1(t,e,i,r,o,s){const l=e||t,a=t,c=i||t,d=pe.distanceBetween(l,a),u=pe.distanceBetween(a,c),f=r===void 0?.5:r,h=Math.pow(d,f),m=Math.pow(u,f),p=h*h,g=m*m;if(!o&&e){const b=2*g+3*m*h+p,y=3*m*(m+h);if(y!==0){const _=(g*l.x+b*a.x-p*c.x)/y-a.x,k=(g*l.y+b*a.y-p*c.y)/y-a.y;fn(t,"left",_,k)}else qt(t,"left")}else qt(t,"left");if(!s&&i){const b=2*p+3*h*m+g,y=3*h*(h+m);if(y!==0){const _=(p*c.x+b*a.x-g*l.x)/y-a.x,k=(p*c.y+b*a.y-g*l.y)/y-a.y;fn(t,"right",_,k)}else qt(t,"right")}else qt(t,"right");Ho(t)}function c1(t,e,i,r,o,s){if(!(e&&i)){e||qt(t,"left"),i||qt(t,"right"),Ho(t);return}const l=e,a=t,c=i,d=pe.distanceBetween(l,a),u=pe.distanceBetween(a,c),f=d+u,h=r===void 0?.4:r,m={x:l.x-c.x,y:l.y-c.y};if(!o&&f!==0){const p=h*d/f;fn(t,"left",m.x*p,m.y*p)}else qt(t,"left");if(!s&&f!==0){const p=h*d/f-h;fn(t,"right",m.x*p,m.y*p)}else qt(t,"right");Ho(t)}function d1(t,e,i,r,o,s){const l=s.type,a=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=jt(d,c),f=t[u];if(f.command===fe.move){qt(f,"left"),qt(f,"right");continue}const h=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=h===null?null:t[jt(h,c)],g=m===null?null:t[jt(m,c)],b=h===null,y=m===null;l==="geometric"?c1(f,p,g,a,b,y):a1(f,p,g,a,b,y)}}const lr=Math.min,ar=Math.max,u1=Math.ceil,f1=Math.floor,h1=new pe,m1=new rr,pn=class pn extends Tn{constructor(i,r,o,s){super();B(this,"_flagVertices",!0);B(this,"_flagLength",!0);B(this,"_flagFill",!0);B(this,"_flagStroke",!0);B(this,"_flagLinewidth",!0);B(this,"_flagOpacity",!0);B(this,"_flagVisible",!0);B(this,"_flagCap",!0);B(this,"_flagJoin",!0);B(this,"_flagMiter",!0);B(this,"_flagStrokeAttenuation",!0);B(this,"_flagMask",!1);B(this,"_flagClip",!1);B(this,"_length",0);B(this,"_fill","#fff");B(this,"_stroke","#000");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_cap","round");B(this,"_join","round");B(this,"_miter",4);B(this,"_closed",!0);B(this,"_curved",!1);B(this,"_automatic",!0);B(this,"_beginning",0);B(this,"_ending",1);B(this,"_mask",null);B(this,"_clip",!1);B(this,"_dashes",null);B(this,"_strokeAttenuation",!0);for(let l in Zd)Object.defineProperty(this,l,Zd[l]);this._renderer.type="path",this._renderer.flagVertices=Qd.bind(this),this._renderer.bindVertices=Jd.bind(this),this._renderer.unbindVertices=eu.bind(this),this._renderer.flagFill=tu.bind(this),this._renderer.flagStroke=nu.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!o,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=i,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Si(i.fill),o=typeof i.stroke=="string"?i.stroke:Si(i.stroke),s=new pn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){if(super.copy.call(this,i),i.vertices){this.vertices=[];for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}}for(let r=0;r<pn.Properties.length;r++){const o=pn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new pn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<pn.Properties.length;o++){const s=pn.Properties[o];r[s]=this[s]}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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="path",i.vertices=this.vertices.map(r=>r.toObject()),je.each(pn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const i=this.getBoundingClientRect(!0),r=i.width/2,o=i.height/2,s=i.left+i.width/2,l=i.top+i.height/2;for(let a=0;a<this.vertices.length;a++){const c=this.vertices[a];c.x-=s,c.y-=l,c.x+=r,c.y+=o}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=r,this.mask.translation.y-=l,this.mask.translation.y+=o),this}center(){const i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const l=this.vertices[s];l.x-=r,l.y-=o}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getBoundingClientRect(i){let r,o,s,l,a,c,d=1/0,u=-1/0,f=1/0,h=-1/0;if(this._update(!0),r=i?this.matrix:this.worldMatrix,o=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:p}=N0(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof m=="number"&&typeof p=="number"&&(o=Math.max(m,p)*(this.linewidth||0)/2)}else o*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(l=0;l<s;l++){c=this._renderer.vertices[l],a=this._renderer.vertices[(l+s-1)%s];const[m,p]=r.multiply(a.x,a.y),[g,b]=r.multiply(c.x,c.y);if(a.controls&&c.controls){let y=a.controls.right.x,_=a.controls.right.y;a.relative&&(y+=a.x,_+=a.y);let[k,x]=r.multiply(y,_),v=c.controls.left.x,N=c.controls.left.y;c.relative&&(v+=c.x,N+=c.y);let[w,T]=r.multiply(v,N);const C=F0(m,p,k,x,w,T,g,b);f=lr(C.min.y-o,f),d=lr(C.min.x-o,d),u=ar(C.max.x+o,u),h=ar(C.max.y+o,h)}else l<=1&&(f=lr(p-o,f),d=lr(m-o,d),u=ar(m+o,u),h=ar(p+o,h)),f=lr(b-o,f),d=lr(g-o,d),u=ar(g+o,u),h=ar(b+o,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}contains(i,r,o){const s=o||{},l=s.ignoreVisibility===!0;if(!l&&this.visible===!1||!l&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const a=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();if(!c||i<c.left-a||i>c.right+a||r<c.top-a||r>c.bottom+a)return!1;const d=this.worldMatrix,u=d&&d.inverse(m1);if(!u)return super.contains(i,r,s);const[f,h]=u.multiply(i,r,1),m=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,p=t1(this,s.fill),g=n1(this,s.stroke),{polygons:b,segments:y}=Z0(this,m);if(p&&b.length>0&&Q0(b,f,h))return!0;if(g&&y.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&e1(y,f,h)<=_/2+a)return!0}return!p&&!g?super.contains(i,r,s):p&&b.length===0?super.contains(i,r,s):!1}getPointAt(i,r){let o,s,l,a,c,d,u,f,h,m,p,g,b,y,_,k=this.length*Math.min(Math.max(i,0),1);const x=this.vertices.length,v=x-1;let N=null,w=null;for(let L=0,O=this._lengths.length,z=0;L<O;L++){if(z+this._lengths[L]>=k){this._closed?(o=jt(L,x),s=jt(L-1,x),L===0&&(o=s,s=L)):(o=L,s=Math.min(Math.max(L-1,0),v)),N=this.vertices[o],w=this.vertices[s],k-=z,this._lengths[L]!==0?i=k/this._lengths[L]:i=0;break}z+=this._lengths[L]}if(N===null||w===null)return null;if(N){if(!w)return N}else return w;_=w.controls&&w.controls.right,y=N.controls&&N.controls.left,c=w.x,m=w.y,d=(_||w).x,p=(_||w).y,u=(y||N).x,g=(y||N).y,f=N.x,b=N.y,_&&w.relative&&(d+=w.x,p+=w.y),y&&N.relative&&(u+=N.x,g+=N.y),a=Vo(i,c,d,u,f),h=Vo(i,m,p,g,b);const T=Wt(c,d,i),C=Wt(m,p,i),$=Wt(d,u,i),E=Wt(p,g,i),V=Wt(u,f,i),P=Wt(g,b,i),I=Wt(T,$,i),K=Wt(C,E,i),J=Wt($,V,i),Z=Wt(E,P,i);return je.isObject(r)?(r.x=a,r.y=h,r instanceof Ae&&(r.controls.left.x=I,r.controls.left.y=K,r.controls.right.x=J,r.controls.right.y=Z,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=a,r.controls.left.y-=h,r.controls.right.x-=a,r.controls.right.y-=h)),r.t=i,r):(l=new Ae(a,h,I-a,K-h,J-a,Z-h,this._curved?fe.curve:fe.line),l.t=i,l)}plot(){if(this.curved)return M0(this._collection,this.closed),this;for(let i=0;i<this._collection.length;i++)this._collection[i].command=i===0?fe.move:fe.line;return this}smooth(i){const r=i||{},o=r.type||"continuous",s=this._collection,l=s.length;if(l<2)return this;const a=this._closed||l>0&&s[l-1]&&s[l-1].command===fe.close,c=(m,p)=>{if(m==null)return p;if(typeof m=="number"){if(a)return jt(m,l);let b=m;return b<0&&(b+=l),Math.min(Math.max(b,0),l-1)}const g=s.indexOf(m);return g!==-1?g:p},d=a&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),f=c(r.to,l-1);if(u>f)if(a)u-=l;else{const m=u;u=f,f=m}const h=f-u+1;for(let m=0;m<h;m+=1){const p=jt(u+m,l),g=s[p],b=!a&&p===0;g.command===fe.move&&!b&&(g.command=fe.line)}if(o==="continuous"||o==="asymmetric")l1(s,u,f,a,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const m={type:o,factor:r.factor};d1(s,u,f,a,d,m)}else throw new Error(`Path.smooth does not support type "${o}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(i){this._update();const r=this.vertices,o=r.length;if(o<2)return this;const s=[];let l=null,a=null;for(let c=0;c<o;c+=1){const d=r[c];if(!l||d.command===fe.move){const f=d.clone();s.push(f),l=d,a=d;continue}if(o1(d,l)){const h=cl(d,l,i).length,m=s[s.length-1];let p=m.clone(),g=d.clone(),b=m,y=0;if(h<=1){const _=d.clone();s.push(_)}else{for(let k=1;k<h;k+=1){const x=k/h,v=1-y,N=v<=Number.EPSILON?x:(x-y)/v,w=s1(p,g,N);fn(b,"right",w.startOut.x-b.x,w.startOut.y-b.y);const T=w.anchor;s.push(T),b=T,p=T.clone(),y=x,fn(g,"left",w.endIn.x-g.x,w.endIn.y-g.y)}const _=d.clone();_.controls.left.copy(g.controls.left),s.push(_)}}else{const f=cl(d,l,i);for(let m=1;m<f.length;m+=1){const p=f[m];Kd(p,l),qt(p,"left"),qt(p,"right"),p.command=fe.line,s.push(p)}const h=d.clone();s.push(h)}l=d,d.command===fe.close&&(l=a)}return this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(i,r){r||this._update();const s=this.vertices.length-1;let l=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),je.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){l=c,this._lengths[d]=0;return}this._lengths[d]=jd(c,l,i),a+=this._lengths[d],l=c},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const i=this._collection.length,r=this._closed,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),l=Ao(this,o*this._length),a=Ao(this,s*this._length),c=u1(l),d=f1(a);let u,f,h,m,p,g;for(this._renderer.vertices.length=0,g=0;g<i;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Ae),g>d&&!f?(p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,p),p.command=this._renderer.collection[g].command,this._renderer.vertices.push(p),f=p,h=this._collection[g-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(pe.zero,1-p.t):this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):g>=c&&g<=d&&(p=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(p),g===d&&Wd(this,s)?(f=p,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):g===c&&Wd(this,o)&&(u=p,u.command=fe.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(g=c-1,p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(o,p),p.command=fe.move,this._renderer.vertices.unshift(p),m=this._collection[g+1],m&&m.controls&&(p.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(pe.zero,p.t):(h1.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,p.t))))}return Tn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Tn.prototype.flagReset.call(this),this}};B(pn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(pn,"Utils",{getCurveLength:jd});let Oe=pn;const Zd={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 ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.bind(ne.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";je.each(this.vertices,function(i){i[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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),t instanceof Ci?this._collection=t:this._collection=new Ci(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,i),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,je.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 Qd(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Jd(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function eu(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function tu(){this._flagFill=!0}function nu(){this._flagStroke=!0}const p1=Math.ceil,g1=Math.floor,Mn=class Mn extends Tn{constructor(i){super();B(this,"_flagVertices",!0);B(this,"_flagLength",!0);B(this,"_flagFill",!0);B(this,"_flagStroke",!0);B(this,"_flagLinewidth",!0);B(this,"_flagOpacity",!0);B(this,"_flagVisible",!0);B(this,"_flagSize",!0);B(this,"_flagSizeAttenuation",!0);B(this,"_flagStrokeAttenuation",!0);B(this,"_length",0);B(this,"_fill","#fff");B(this,"_stroke","#000");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_size",1);B(this,"_sizeAttenuation",!1);B(this,"_beginning",0);B(this,"_ending",1);B(this,"_dashes",null);B(this,"_strokeAttenuation",!0);B(this,"noFill",Oe.prototype.noFill);B(this,"noStroke",Oe.prototype.noStroke);B(this,"corner",Oe.prototype.corner);B(this,"center",Oe.prototype.center);B(this,"getBoundingClientRect",Oe.prototype.getBoundingClientRect);B(this,"_updateLength",Oe.prototype._updateLength);for(let r in iu)Object.defineProperty(this,r,iu[r]);this._renderer.type="points",this._renderer.flagVertices=Qd.bind(this),this._renderer.bindVertices=Jd.bind(this),this._renderer.unbindVertices=eu.bind(this),this._renderer.flagFill=tu.bind(this),this._renderer.flagStroke=nu.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=i,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Si(i.fill),o=typeof i.stroke=="string"?i.stroke:Si(i.stroke),s=new Mn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}for(let r=0;r<Mn.Properties.length;r++){const o=Mn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Mn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Mn.Properties.length;o++){const s=Mn.Properties[o];r[s]=this[s]}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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="points",i.vertices=this.vertices.map(r=>r.toObject()),je.each(Mn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}subdivide(i){this._update();let r=[];for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o],l=this.vertices[o-1];if(!l)continue;const a=s.x,c=s.y,d=l.x,u=l.y,f=Vd(a,c,a,c,d,u,d,u,i);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const i=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),o=Ao(this,i*this._length),s=Ao(this,r*this._length),l=p1(o),a=g1(s);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=l&&u<=a&&(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}};B(Mn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Wo=Mn;const iu={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 ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.bind(ne.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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),t instanceof Ci?this._collection=t:this._collection=new Ci(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,i),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 ru extends Ci{constructor(i){i=Array.isArray(i)?i:Array.prototype.slice.call(arguments);super(i);Pa(this,gs,{});this.attach(i),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return zt(this,gs)}attach(i){for(let r=0;r<i.length;r++){const o=i[r];o&&o.id&&(this.ids[o.id]=o)}return this}detach(i){for(let r=0;r<i.length;r++)delete this.ids[i[r].id];return this}}gs=new WeakMap;const Xn=class Xn extends Oe{constructor(i,r,o,s,l,a,c){const d=c||Po.Resolution*3,u=[];for(let f=0;f<d;f++)u.push(new Ae);super(u,!0,!1,!0);B(this,"_flagStartAngle",!1);B(this,"_flagEndAngle",!1);B(this,"_flagInnerRadius",!1);B(this,"_flagOuterRadius",!1);B(this,"_startAngle",0);B(this,"_endAngle",Kt);B(this,"_innerRadius",0);B(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in ou)Object.defineProperty(this,f,ou[f]);typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof l=="number"&&(this.startAngle=l),typeof a=="number"&&(this.endAngle=a),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Xn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Xn.Properties.length;r++){const o=Xn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const i=this._startAngle,r=this._endAngle,o=this._innerRadius,s=this._outerRadius,l=jt(i,Kt)===jt(r,Kt),a=o>0,c=this.vertices;let d=a?c.length/2:c.length,u,f=0,h,m,p,g,b,y,_,k,x;for(l?d--:a||(d-=2),h=0,m=d-1;h<d;h++){switch(p=h/m,g=c[f],b=p*(r-i)+i,y=(r-i)/d,_=s*Math.cos(b),k=s*Math.sin(b),h){case 0:u=fe.move;break;default:u=fe.curve}g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===fe.curve&&(x=s*y/Math.PI,g.controls.left.x=x*Math.cos(b-gt),g.controls.left.y=x*Math.sin(b-gt),g.controls.right.x=x*Math.cos(b+gt),g.controls.right.y=x*Math.sin(b+gt),h===1&&g.controls.left.multiplyScalar(2),h===m&&g.controls.right.multiplyScalar(2)),f++}if(a){for(l?(c[f].command=fe.close,f++):(d--,m=d-1),h=0;h<d;h++)p=h/m,g=c[f],b=(1-p)*(r-i)+i,y=(r-i)/d,_=o*Math.cos(b),k=o*Math.sin(b),u=fe.curve,h<=0&&(u=l?fe.move:fe.line),g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===fe.curve&&(x=o*y/Math.PI,g.controls.left.x=x*Math.cos(b+gt),g.controls.left.y=x*Math.sin(b+gt),g.controls.right.x=x*Math.cos(b-gt),g.controls.right.y=x*Math.sin(b-gt),h===1&&g.controls.left.multiplyScalar(2),h===m&&g.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=fe.line}else l||(c[f].command=fe.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(i){const r=this.innerRadius,o=this.outerRadius,s=this.startAngle,l=this.endAngle,a=this.vertices.length,c=new Xn(0,0,r,o,s,l,a);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<Oe.Properties.length;d++){const u=Oe.Properties[d];c[u]=this[u]}return i&&i.add(c),c}toObject(){const i=super.toObject.call(this);i.renderer.type="arc-segment";for(let r=0;r<Xn.Properties.length;r++){const o=Xn.Properties[r];i[o]=this[o]}return i}};B(Xn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let fl=Xn;const ou={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}}},hl=Math.cos,ml=Math.sin,Yn=class Yn extends Oe{constructor(i,r,o,s){const l=s?Math.max(s,2):4,a=[];for(let c=0;c<l;c++)a.push(new Ae(0,0,0,0,0,0));super(a,!0,!0,!0);B(this,"_flagRadius",!1);B(this,"_radius",0);this._renderer.type="circle";for(let c in su)Object.defineProperty(this,c,su[c]);typeof o=="number"&&(this.radius=o),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Yn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Yn.Properties.length;r++){const o=Yn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagRadius){let i=this.vertices.length;!this._closed&&i>2&&(i-=1);const r=4/3*Math.tan(Math.PI/(i*2)),o=this._radius,s=o*r;for(let l=0;l<this.vertices.length;l++){const c=l/i*Kt,d=o*hl(c),u=o*ml(c),f=s*hl(c-gt),h=s*ml(c-gt),m=s*hl(c+gt),p=s*ml(c+gt),g=this.vertices[l];g.command=l===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(m,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(i){const r=new Yn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let o=0;o<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="circle";for(let r=0;r<Yn.Properties.length;r++){const o=Yn.Properties[r];i[o]=this[o]}return i}};B(Yn,"Properties",["radius"]);let pl=Yn;const su={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},gl=Math.cos,yl=Math.sin,Un=class Un extends Oe{constructor(i,r,o,s,l){typeof s!="number"&&typeof o=="number"&&(s=o);const a=l?Math.max(l,2):4,c=[];for(let d=0;d<a;d++)c.push(new Ae);super(c,!0,!0,!0);B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_width",0);B(this,"_height",0);this._renderer.type="ellipse";for(let d in lu)Object.defineProperty(this,d,lu[d]);typeof o=="number"&&(this.width=o*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Un().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Un.Properties.length;r++){const o=Un.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let i=this.vertices.length;!this._closed&&i>2&&(i-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),o=this._width/2,s=this._height/2;for(let l=0;l<this.vertices.length;l++){const c=l/i*Kt,d=o*gl(c),u=s*yl(c),f=o*r*gl(c-gt),h=s*r*yl(c-gt),m=o*r*gl(c+gt),p=s*r*yl(c+gt),g=this.vertices[l];g.command=l===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(m,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=this.width/2,o=this.height/2,s=this.vertices.length,l=new Un(0,0,r,o,s);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let a=0;a<Oe.Properties.length;a++){const c=Oe.Properties[a];l[c]=this[c]}return i&&i.add(l),l}toObject(){const i=super.toObject.call(this);i.renderer.type="ellipse";for(let r=0;r<Un.Properties.length;r++){const o=Un.Properties[r];i[o]=this[o]}return i}};B(Un,"Properties",["width","height"]);let bl=Un;const lu={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}}},y1=Math.cos,b1=Math.sin,Kn=class Kn extends Oe{constructor(i,r,o,s){s=Math.max(s||0,3);super();B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_flagSides",!1);B(this,"_radius",0);B(this,"_width",0);B(this,"_height",0);B(this,"_sides",0);this._renderer.type="polygon";for(let l in au)Object.defineProperty(this,l,au[l]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.radius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Kn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Kn.Properties.length;r++){const o=Kn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const i=this._sides,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const l=(s+.5)/i,a=Kt*l+Math.PI/2,c=this._width*y1(a)/2,d=this._height*b1(a)/2;s>=o?this.vertices.push(new Ae(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=new Kn(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 o=0;o<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="polygon";for(let r=0;r<Kn.Properties.length;r++){const o=Kn.Properties[r];i[o]=this[o]}return i}};B(Kn,"Properties",["width","height","sides"]);let _l=Kn;const au={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}}},Di=class Di extends Oe{constructor(i,r,o,s){const l=[new Ae,new Ae,new Ae,new Ae];super(l,!0,!1,!0);B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_width",0);B(this,"_height",0);B(this,"_origin",null);this._renderer.type="rectangle";for(let a in cu)Object.defineProperty(this,a,cu[a]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new pe,typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(i){const r=new Di().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Di.Properties.length;r++){const o=Di.Properties[r];o in i&&(typeof i[o]=="number"?this[o]=i[o]:this[o]instanceof pe&&this[o].copy(i[o]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const i=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Ae),this.vertices[0].set(-i,-r).sub(this._origin).command=fe.move,this.vertices[1].set(i,-r).sub(this._origin).command=fe.line,this.vertices[2].set(i,r).sub(this._origin).command=fe.line,this.vertices[3].set(-i,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-i,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=new Di(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 o=0;o<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]instanceof pe?r[s].copy(this[s]):r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="rectangle",i.width=this.width,i.height=this.height,i.origin=this.origin.toObject(),i}};B(Di,"Properties",["width","height","origin"]);let Vr=Di;const cu={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(ne.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ne.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Gn=class Gn extends Oe{constructor(i,r,o,s,l){typeof l>"u"&&typeof o=="number"&&typeof s=="number"&&(l=Math.floor(Math.min(o,s)/12));const a=[];for(let c=0;c<10;c++)a.push(new Ae(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(a);B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_flagRadius",!1);B(this,"_width",0);B(this,"_height",0);B(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in du)Object.defineProperty(this,c,du[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=_1.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof l=="number"||l instanceof pe)&&(this.radius=l),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Gn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Gn.Properties.length;r++){const o=Gn.Properties[r];if(o in i){const s=i[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof pe?s:new pe().copy(s):typeof s=="number"&&(this[o]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const i=this._width,r=this._height;let o,s;this._radius instanceof pe?(o=this._radius.x,s=this._radius.y):(o=this._radius,s=this._radius);let l,a=i/2,c=r/2;l=this.vertices[0],l.x=-(a-o),l.y=-c,l=this.vertices[1],l.x=a-o,l.y=-c,l.controls.left.clear(),l.controls.right.x=o,l.controls.right.y=0,l=this.vertices[2],l.x=a,l.y=-(c-s),l.controls.right.clear(),l.controls.left.clear(),l=this.vertices[3],l.x=a,l.y=c-s,l.controls.left.clear(),l.controls.right.x=0,l.controls.right.y=s,l=this.vertices[4],l.x=a-o,l.y=c,l.controls.right.clear(),l.controls.left.clear(),l=this.vertices[5],l.x=-(a-o),l.y=c,l.controls.left.clear(),l.controls.right.x=-o,l.controls.right.y=0,l=this.vertices[6],l.x=-a,l.y=c-s,l.controls.left.clear(),l.controls.right.clear(),l=this.vertices[7],l.x=-a,l.y=-(c-s),l.controls.left.clear(),l.controls.right.x=0,l.controls.right.y=-s,l=this.vertices[8],l.x=-(a-o),l.y=-c,l.controls.left.clear(),l.controls.right.clear(),l=this.vertices[9],l.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(i){const r=this.width,o=this.height,s=this.radius,l=new Gn(0,0,r,o,s);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let a=0;a<Oe.Properties.length;a++){const c=Oe.Properties[a];l[c]=this[c]}return i&&i.add(l),l}toObject(){const i=super.toObject.call(this);i.renderer.type="rounded-rectangle";for(let r=0;r<Gn.Properties.length;r++){const o=Gn.Properties[r];i[o]=this[o]}return i.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),i}};B(Gn,"Properties",["width","height","radius"]);let wl=Gn;const du={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(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function _1(){this._flagRadius=!0}const w1=Math.cos,x1=Math.sin,Zn=class Zn extends Oe{constructor(i,r,o,s,l){arguments.length<=3&&(s=o,o=s/2),(typeof l!="number"||l<=0)&&(l=5);super();B(this,"_flagInnerRadius",!1);B(this,"_flagOuterRadius",!1);B(this,"_flagSides",!1);B(this,"_innerRadius",0);B(this,"_outerRadius",0);B(this,"_sides",0);this._renderer.type="star";for(let a in uu)Object.defineProperty(this,a,uu[a]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof l=="number"&&(this.sides=l),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Zn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Zn.Properties.length;r++){const o=Zn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const i=this._sides*2,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const l=(s+.5)/i,a=Kt*l,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*w1(a),u=c*x1(a);s>=o?this.vertices.push(new Ae(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=this.innerRadius,o=this.outerRadius,s=this.sides,l=new Zn(0,0,r,o,s);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let a=0;a<Oe.Properties.length;a++){const c=Oe.Properties[a];l[c]=this[c]}return i&&i.add(l),l}toObject(){const i=super.toObject.call(this);i.renderer.type="star";for(let r=0;r<Zn.Properties.length;r++){const o=Zn.Properties[r];i[o]=this[o]}return i}};B(Zn,"Properties",["innerRadius","outerRadius","sides"]);let xl=Zn;const uu={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 kl;const fu=Math.min,hu=Math.max;Bn.document&&(kl=document.createElement("canvas"));const Et=class Et extends Tn{constructor(i,r,o,s){super();B(this,"_flagValue",!0);B(this,"_flagFamily",!0);B(this,"_flagSize",!0);B(this,"_flagLeading",!0);B(this,"_flagAlignment",!0);B(this,"_flagBaseline",!0);B(this,"_flagStyle",!0);B(this,"_flagWeight",!0);B(this,"_flagDecoration",!0);B(this,"_flagFill",!0);B(this,"_flagStroke",!0);B(this,"_flagLinewidth",!0);B(this,"_flagOpacity",!0);B(this,"_flagVisible",!0);B(this,"_flagMask",!1);B(this,"_flagClip",!1);B(this,"_flagDirection",!0);B(this,"_flagStrokeAttenuation",!0);B(this,"_value","");B(this,"_family","sans-serif");B(this,"_size",13);B(this,"_leading",17);B(this,"_alignment","center");B(this,"_baseline","middle");B(this,"_style","normal");B(this,"_weight",500);B(this,"_decoration","none");B(this,"_direction","ltr");B(this,"_fill","#000");B(this,"_stroke","none");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_mask",null);B(this,"_clip",!1);B(this,"_dashes",null);B(this,"_strokeAttenuation",!0);for(let l in mu)Object.defineProperty(this,l,mu[l]);if(this._renderer.type="text",this._renderer.flagFill=k1.bind(this),this._renderer.flagStroke=C1.bind(this),this.value=i,typeof r=="number"&&(this.translation.x=r),typeof o=="number"&&(this.translation.y=o),this.dashes=[],this.dashes.offset=0,!je.isObject(s))return this;for(let l=0;l<Et.Properties.length;l++){const a=Et.Properties[l];a in s&&(this[a]=s[a])}}static Measure(i){if(kl){const r=kl.getContext("2d");r.font=[i._style,i._weight,`${i._size}px/${i._leading}px`,i._family].join(" ");const o=r.measureText(i.value,0,0),s=o.actualBoundingBoxDescent+o.actualBoundingBoxAscent;return{width:o.width,height:s}}else{const r=this.value.length*this.size*Et.Ratio,o=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:o}}}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Si(i.fill),o=typeof i.stroke=="string"?i.stroke:Si(i.stroke),s=new Et().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<Et.Properties.length;r++){const o=Et.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Et(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<Et.Properties.length;o++){const s=Et.Properties[o];r[s]=this[s]}return this.matrix.manual&&r.matrix.copy(this.matrix),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);i.renderer.type="text";for(let r=0;r<Et.Properties.length;r++){const o=Et.Properties[r];i[o]=this[o]}return i}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(i){let r,o,s,l,a;this._update(!0),r=i?this.matrix:this.worldMatrix;const{width:c,height:d}=Et.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":o=-u,s=c+u;break;case"right":o=-(c+u),s=u;break;default:o=-(c/2+u),s=c/2+u}switch(this.baseline){case"middle":l=-(d/2+u),a=d/2+u;break;default:l=-(d+u),a=u}const[f,h]=r.multiply(o,l),[m,p]=r.multiply(o,a),[g,b]=r.multiply(s,l),[y,_]=r.multiply(s,a);return l=fu(h,p,b,_),o=fu(f,m,g,y),s=hu(f,m,g,y),a=hu(h,p,b,_),{top:l,left:o,right:s,bottom:a,width:s-o,height:a-l}}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}};B(Et,"Ratio",.6),B(Et,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let cr=Et;const mu={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 ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,je.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 k1(){this._flagFill=!0}function C1(){this._flagStroke=!0}const Qn=class Qn extends Vr{constructor(i,r,o,s){super(r,o,0,0);B(this,"_flagTextures",!1);B(this,"_flagFrameRate",!1);B(this,"_flagIndex",!1);B(this,"_amount",1);B(this,"_duration",0);B(this,"_index",0);B(this,"_startTime",0);B(this,"_playing",!1);B(this,"_firstFrame",0);B(this,"_lastFrame",0);B(this,"_loop",!0);B(this,"_textures",null);B(this,"_frameRate",0);B(this,"_origin",null);this._renderer.type="image-sequence";for(let l in pu)Object.defineProperty(this,l,pu[l]);this._renderer.flagTextures=v1.bind(this),this._renderer.bindTextures=S1.bind(this),this._renderer.unbindTextures=B1.bind(this),this.noStroke(),this.noFill(),Array.isArray(i)?this.textures=i.map(gu.bind(this)):typeof i=="string"&&(this.textures=[gu(i)]),this.origin=new pe,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Qn.DefaultFrameRate,this.index=0}static fromObject(i){const r=new Qn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Qn.Properties.length;r++){const o=Qn.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o: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(i){const r=new Qn(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="image-sequence",i.textures=this.textures.map(function(r){return r.toObject()}),i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=0;i<this.textures.length;i++){const r=this.textures[i];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const i=this._textures;let r,o,s,l,a,c,d,u;return i&&(this._flagTextures&&(this._amount=i.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(l=this._amount,je.isNaN(this._lastFrame)&&(this._lastFrame=l-1),s=je.performance.now()-this._startTime,u=this._lastFrame+1,a=1e3*(u-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),d=Wt(this._firstFrame,u,s/a),d=Math.floor(d),d!==this._index&&(this._index=d,c=i[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Qe))&&(c=i[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};B(Qn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(Qn,"DefaultFrameRate",30);let Cl=Qn;const pu={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,i=this._renderer.unbindTextures;this._textures&&this._textures.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),this._textures=new Ci((t||[]).slice(0)),this._textures.bind(ne.Types.insert,e).bind(ne.Types.remove,i),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 v1(){this._flagTextures=!0}function S1(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function B1(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gu(t){if(t instanceof Qe)return t;if(typeof t=="string")return new Qe(t)}const Li=class Li extends Vr{constructor(i,r,o,s,l,a){super(r,o,0,0);B(this,"_flagTexture",!1);B(this,"_flagColumns",!1);B(this,"_flagRows",!1);B(this,"_flagFrameRate",!1);B(this,"_flagIndex",!1);B(this,"_amount",1);B(this,"_duration",0);B(this,"_startTime",0);B(this,"_playing",!1);B(this,"_firstFrame",0);B(this,"_lastFrame",0);B(this,"_loop",!0);B(this,"_texture",null);B(this,"_columns",1);B(this,"_rows",1);B(this,"_frameRate",0);B(this,"_index",0);B(this,"_origin",null);this._renderer.type="sprite";for(let c in yu)Object.defineProperty(this,c,yu[c]);this.noStroke(),this.noFill(),i instanceof Qe?this.texture=i:typeof i=="string"&&(this.texture=new Qe(i)),this.origin=new pe,this._update(),typeof s=="number"&&(this.columns=s),typeof l=="number"&&(this.rows=l),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(i){const r=new Li().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Li.Properties.length;r++){const o=Li.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o: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(i){const r=new Li(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,i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="sprite",i.texture=this.texture.toObject(),i.columns=this.columns,i.rows=this.rows,i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=this._texture,r=this._columns,o=this._rows;let s,l,a,c,d,u,f,h,m;if(i&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=i),i.loaded)){f=i.image.width,h=i.image.height,s=f/r,l=h/o,c=this._amount,this.width!==s&&(this.width=s),this.height!==l&&(this.height=l),this._playing&&this._frameRate>0&&(je.isNaN(this._lastFrame)&&(this._lastFrame=c-1),a=je.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%d:a=Math.min(a,d),u=Wt(this._firstFrame,m,a/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%r,g=Math.floor(this._index/r),b=-s*p+(f-s)/2,y=-l*g+(h-l)/2;b!==i.offset.x&&(i.offset.x=b),y!==i.offset.y&&(i.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}};B(Li,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let vl=Li;const yu={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}}},jo=Math.min,qo=Math.max,N1={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},Ot=class Ot extends Tn{constructor(i){super();B(this,"_flagAdditions",!1);B(this,"_flagSubtractions",!1);B(this,"_flagOrder",!1);B(this,"_flagOpacity",!0);B(this,"_flagBeginning",!1);B(this,"_flagEnding",!1);B(this,"_flagLength",!1);B(this,"_flagMask",!1);B(this,"_fill","#fff");B(this,"_stroke","#000");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_cap","round");B(this,"_join","round");B(this,"_miter",4);B(this,"_closed",!0);B(this,"_curved",!1);B(this,"_automatic",!0);B(this,"_beginning",0);B(this,"_ending",1);B(this,"_length",0);B(this,"_mask",null);B(this,"_strokeAttenuation",!0);for(let r in bu)Object.defineProperty(this,r,bu[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(i)?i:Array.prototype.slice.call(arguments)}static InsertChildren(i){for(let r=0;r<i.length;r++)_u.call(this,i[r],this)}static RemoveChildren(i){for(let r=0;r<i.length;r++)_u.call(this,i[r])}static OrderChildren(i){this._flagOrder=!0}static fromObject(i){const r=new Ot;for(let s=0;s<Ot.Properties.length;s++){const l=Ot.Properties[s];l in i&&(/(fill|stroke)/i.test(l)?r[l]=typeof i[l]=="string"?i[l]:Si(i[l]):r[l]=i[l])}return"mask"in i&&(r.mask=o(i.mask)),"id"in i&&(r.id=i.id),r.children=i.children.map(o),r;function o(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return fl.fromObject(s);case"circle":return pl.fromObject(s);case"element":return Fr.fromObject(s);case"ellipse":return bl.fromObject(s);case"group":return Ot.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return Cl.fromObject(s);case"path":return Oe.fromObject(s);case"points":return Wo.fromObject(s);case"polygon":return _l.fromObject(s);case"rectangle":return Vr.fromObject(s);case"rounded-rectangle":return wl.fromObject(s);case"shape":return Tn.fromObject(s);case"sprite":return vl.fromObject(s);case"star":return xl.fromObject(s);case"text":return cr.fromObject(s)}return s}}static IsVisible(i,r){if(!r)return!0;let o=i;for(;o;){if(typeof o.visible=="boolean"&&!o.visible||typeof o.opacity=="number"&&o.opacity<=0)return!1;o=o.parent}return!0}static VisitForHitTest(i,r,o,s,l,a,c){const d=i&&i.children;if(!d)return!1;const u=r.results;for(let f=d.length-1;f>=0;f--){const h=d[f];if(!h||!Ot.IsVisible(h,r.visibleOnly))continue;const m=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(m&&!i1(m,r.x,r.y,a))){if(h instanceof Ot){if(o&&(!s||s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,l)&&(u.push(h),c)||Ot.VisitForHitTest(h,r,o,s,l,a,c))return!0;continue}if(h instanceof Tn&&!(s&&!s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,l)&&(u.push(h),c))return!0}}return!1}copy(i){super.copy.call(this,i),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<Ot.Properties.length;r++){const o=Ot.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Ot,o=this.children.map(function(s){return s.clone()});return r.add(o),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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="group",i.children=[],i.opacity=this.opacity,i.className=this.className,i.mask=this.mask?this.mask.toObject():null,je.each(this.children,(r,o)=>{i.children[o]=r.toObject()},this),i}dispose(){if(super.dispose(),this.children)for(let i=0;i<this.children.length;i++){const r=this.children[i];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}getShapesAtPoint(i,r,o){const s=o||{},{results:l,hitOptions:a,context:c,single:d,empty:u}=N1.getShapesAtPoint;l.length=0;const f=s.mode==="deepest"||s.deepest?"deepest":"all",h=s.visibleOnly!==!1,m=!!s.includeGroups,p=typeof s.filter=="function"?s.filter:null,g=typeof s.tolerance=="number"?s.tolerance:0;typeof s.precision=="number"?a.precision=s.precision:delete a.precision,typeof s.fill<"u"?a.fill=s.fill:delete a.fill,typeof s.stroke<"u"?a.stroke=s.stroke:delete a.stroke,a.tolerance=g,a.ignoreVisibility=!h;const b=f==="deepest";if(c.x=i,c.y=r,c.visibleOnly=h,c.results=l,Ot.VisitForHitTest(this,c,m,p,a,g,b),b){if(l.length>0){const _=l[0];return l.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const y=l.slice();return l.length=0,y}corner(){const i=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const o=this.children[r];o.translation.x-=i.left,o.translation.y-=i.top}return this.mask&&(this.mask.translation.x-=i.left,this.mask.translation.y-=i.top),this}center(){const i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const l=this.children[s];l.isShape&&(l.translation.x-=r,l.translation.y-=o)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getById(i){let r=null;function o(s){if(s.id===i)return s;if(s.children){if(s.children.ids[i])return s.children.ids[i];for(let l=0;l<s.children.length;l++)if(r=o(s.children[l]),r)return r}return null}return o(this)}getByClassName(i){const r=[];function o(s){if(Array.prototype.indexOf.call(s.classList,i)>=0&&r.push(s),s.children)for(let l=0;l<s.children.length;l++){const a=s.children[l];o(a)}return r}return o(this)}getByType(i){const r=[];function o(s){if(s instanceof i&&r.push(s),s.children)for(let l=0;l<s.children.length;l++){const a=s.children[l];o(a)}return r}return o(this)}add(i){i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let r=0;r<i.length;r++){const o=i[r];if(!(o&&o.id))continue;const s=Array.prototype.indexOf.call(this.children,o);s>=0&&this.children.splice(s,1),this.children.push(o)}return this}remove(i){const r=arguments.length,o=this.parent;if(r<=0&&o)return o.remove(this),this;i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let s=0;s<i.length;s++){const l=i[s];if(!l||!this.children.ids[l.id])continue;const a=this.children.indexOf(l);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(i){let r,o,s,l,a,c;this._update(!0);let d=1/0,u=-1/0,f=1/0,h=-1/0;const m=/texture|gradient/i;o=i?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const g=this.children[p];if(!(!g.visible||m.test(g._renderer.type))&&(r=g.getBoundingClientRect(i),s=typeof r.top!="number"||je.isNaN(r.top)||!isFinite(r.top),l=typeof r.left!="number"||je.isNaN(r.left)||!isFinite(r.left),a=typeof r.right!="number"||je.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||je.isNaN(r.bottom)||!isFinite(r.bottom),!(s||l||a||c)))if(i){const[b,y]=o.multiply(r.left,r.top),[_,k]=o.multiply(r.right,r.top),[x,v]=o.multiply(r.left,r.bottom),[N,w]=o.multiply(r.right,r.bottom);f=jo(y,k,v,w,f),d=jo(b,_,x,N,d),u=qo(b,_,x,N,u),h=qo(y,k,v,w,h)}else f=jo(r.top,f),d=jo(r.left,d),u=qo(r.right,u),h=qo(r.bottom,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}noFill(){return this.children.forEach(function(i){i.noFill()}),this}noStroke(){return this.children.forEach(function(i){i.noStroke()}),this}subdivide(){const i=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,i)}),this}_update(){let i,r,o;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),l=Math.max(this._beginning,this._ending),a=this.length;let c=0;const d=s*a,u=l*a;for(i=0;i<this.children.length;i++)o=this.children[i],r=o.length,d>c+r?(o.beginning=1,o.ending=1):u<c?(o.beginning=0,o.ending=0):d>c&&d<c+r?(o.beginning=(d-c)/r,o.ending=1):u>c&&u<c+r?(o.beginning=0,o.ending=(u-c)/r):(o.beginning=0,o.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}};B(Ot,"Children",ru),B(Ot,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Hn=Ot;const bu={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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=Hn.InsertChildren.bind(this),i=Hn.RemoveChildren.bind(this),r=Hn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&i(this._children)),this._children=new ru(t),this._children.bind(ne.Types.insert,e),this._children.bind(ne.Types.remove,i),this._children.bind(ne.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,je.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 i=this.children[e];i.strokeAttenuation!==void 0&&(i.strokeAttenuation=t)}}}};function _u(t,e){const i=t.parent;let r;if(i===e){o();return}if(i&&i.children.ids[t.id]&&(r=Array.prototype.indexOf.call(i.children,t),i.children.splice(r,1),s()),e){o();return}s(),i._flagAdditions&&i.additions.length===0&&(i._flagAdditions=!1),i._flagSubtractions&&i.subtractions.length===0&&(i._flagSubtractions=!1),delete t.parent;function o(){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 s(){r=Array.prototype.indexOf.call(i.additions,t),r>=0&&i.additions.splice(r,1),r=Array.prototype.indexOf.call(i.subtractions,t),r<0&&(i.subtractions.push(t),i._flagSubtractions=!0)}}class Xo extends Oe{constructor(e,i,r,o){const s=[new Ae(e,i),new Ae(r,o)];super(s);for(let l in wu)Object.defineProperty(this,l,wu[l]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}B(Xo,"Properties",["left","right"]);const wu={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(je.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=fe.move;else{const e=new Mo("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(je.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=fe.line;else{const e=new Mo("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Sl{constructor(e=0,i=0){this.x=e,this.y=i}}class $n{constructor(e=10,i=0,r="A"){B(this,"start",new Sl);B(this,"end",new Sl);this.width=e,this.angle=i,this.label=r}}const qe={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"}},T1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $1(t,e){return n.openBlock(),n.createElementBlock("svg",T1,[...e[0]||(e[0]=[n.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 Yo=n.markRaw({name:"ion-close",render:$1}),E1={class:"mr-3 flex flex-col gap-2"},R1=["onClick"],P1={class:"h-full p-2"},F1={},V1=n.defineComponent({...F1,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const i=t,r=n.ref(!1),o=n.useTemplateRef("drawing-template-containers"),s=n.useTemplateRef("drawing-custom-template-containers"),l=e,a=c=>{r.value=!0,l("remove-custom-template",c,()=>{r.value=!1})};return n.onMounted(()=>{var c,d;(c=i.settings.templates)==null||c.forEach((u,f)=>{var m;const h=(m=o.value)==null?void 0:m.at(f);h&&l("init-draw-template",h,u)}),(d=i.settings.customTemplates)==null||d.forEach((u,f)=>{var m;const h=(m=s.value)==null?void 0:m.at(f);h&&l("init-draw-template",h,u)})}),n.watch(()=>[...i.settings.customTemplates],(c,d)=>{n.nextTick(()=>{c.forEach((u,f)=>{var h;if(!(d!=null&&d.includes(u))){const m=(h=s.value)==null?void 0:h.at(f);m&&l("init-draw-template",m,u)}}),d.length>c.length&&d.forEach((u,f)=>{var m;const h=(m=s.value)==null?void 0:m.at(f);h&&(h.innerHTML="",l("init-draw-template",h,u))})})},{deep:!0}),(c,d)=>{const u=Yo;return n.openBlock(),n.createBlock(n.unref(F.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:n.withCtx(()=>[n.createElementVNode("div",E1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.settings.allTemplates,(f,h)=>(n.openBlock(),n.createElementBlock("div",{key:`${f.id}-${h}`,class:"group relative"},[n.createVNode(n.unref(F.NPopover),{trigger:"hover",placement:"right"},{trigger:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":h===t.selectTemplateIndex}]),onClick:m=>l("template:select",h)},[n.createElementVNode("div",P1,[n.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,R1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:m=>a(h)},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):n.createCommentVNode("",!0)]))),128))])]),_:1})}}}),xu=wn(V1,[["__scopeId","data-v-afccb364"]]),M1={class:"flex gap-3 min-w-[20rem] relative"},I1={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},A1={ref:"drawing-container",class:"size-full"},O1={},ku=n.defineComponent({...O1,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const i=t,r=e,o=n.useTemplateRef("drawing-container");let s=[],l=[],a=[],c=null;const d=.75,u=n.computed(()=>i.value.configuratorParams.linesAngles.map((L,O)=>new $n(i.value.configuratorParams.linesWidths[O],L,`A-${O+1}`))),f=n.computed(()=>i.value.configuratorParams.colorSide==="bottom"),h=n.computed(()=>{var L,O;return i.value.configuratorParams.startTailType&&((L=i.settings.startTailConfigs)!=null&&L[i.value.configuratorParams.startTailType])?(O=i.settings.startTailConfigs)==null?void 0:O[i.value.configuratorParams.startTailType].points:[]}),m=n.computed(()=>{var O;const L=i.value.configuratorParams.endTailType!==void 0&&((O=i.settings.endTailConfigs)==null?void 0:O[i.value.configuratorParams.endTailType]);return!L||!L.points?[]:L.points.map((z,M)=>Array.isArray(z)?new $n(z[0],z[1],`A-${M+1}`):new $n(z.width,z.angle,`A-${M+1}`))}),p=(L,O=!1)=>{L[0].start.x=0,L[0].start.y=0;let z=0;for(let M=0;M<L.length;M++){const R=L[M],W=L[M-1]??new $n(0,z);z+=!O||M>1?W.angle:0;const U=(!O||M>0?R.angle:0)+z;if(L[M].end.x=R.width*Math.cos(U*Math.PI/180)+L[M].start.x,L[M].end.y=R.width*Math.sin(U*Math.PI/180)+L[M].start.y,M<L.length-1){const G=M+1;L[G].start.x=L[M].end.x,L[G].start.y=L[M].end.y}}return L},g=(L,O,z,M,R=!1)=>{let W=p([...z,...M]);O.length>0&&(W=[...p(O),...W]);let U=0,G=0,X=0,j=0;W.forEach(ve=>{U=Math.min(U,ve.start.x,ve.end.x),G=Math.min(G,ve.start.y,ve.end.y),X=Math.max(X,ve.start.x,ve.end.x),j=Math.max(j,ve.start.y,ve.end.y)});let q,le;U===0&&G===0&&X===0&&j===0?(q=1,le=1):(q=L.width/Math.abs(X-U),le=(R?L.height:L.height-qe.colorSideLabel.size)/Math.abs(j-G));const de=Math.min(q,le);return U=U<0?-U*de:0,G=G<0?-G*de:0,[de,U,G]},b=L=>{const O=new Wo([L]);return O._size=qe.anchorPoint.size,O.fill=qe.anchorPoint.color,O.stroke="transparent",O._linewidth=qe.anchorPoint.strokeSize,a.push(O),O},y=(L,O)=>{if(a=[],i.settings.allowChangeFirstPoint){const z=L[0],M=new pe(z.vertices[0].x,z.vertices[0].y);M.bind(ne.Types.change,()=>{z.vertices[0].copy(M)});const R=b(M);O.add(R)}L.forEach((z,M)=>{const R=L[M+1],W=new pe(z.vertices[1].x,z.vertices[1].y);W.bind(ne.Types.change,()=>{z.vertices[1].copy(W),R!==void 0&&R.vertices[0].copy(W)});const U=b(W);O.add(U)})},_=L=>L*(Math.PI/180),k=(L,O,z)=>{const M=O.vertices.length-1;L.position.x=O.vertices[M].x,L.position.y=O.vertices[M].y;const R=Math.atan2(O.vertices[M].y-O.vertices[0].y,O.vertices[M].x-O.vertices[0].x);L.rotation=_(z)+R},x=(L,O,z)=>{if(O.vertices[0]===void 0)return;L.position.x=O.vertices[0].x,L.position.y=O.vertices[0].y;const M=O.vertices.length-1,R=Math.atan2(O.vertices[M].y-O.vertices[0].y,O.vertices[M].x-O.vertices[0].x);L.rotation=_(z)+R},v=(L,O,z)=>{const M=new Hn;if(L.length===0)return M;const R=[];return[...L].reverse().forEach((W,U)=>{U!==0&&W.angle>0&&(W.angle*=-1),R.push(W)}),L=p(R,!0),x(M,O,L[0].angle),[O.vertices[0],O.vertices[1]].forEach(W=>{W.bind(ne.Types.change,()=>{x(M,O,L[0].angle)})}),L.forEach(W=>{const U=W.start.x*z,G=W.end.x*z,X=W.start.y*z,j=W.end.y*z,q=new Xo(U,X,G,j);q.linewidth=qe.line.size,q.stroke=qe.line.color,M.add(q)}),M},N=(L,O,z)=>{const M=new Hn;return L.length===0||(L=p(L,!0),k(M,O,L[0].angle),[O.vertices[0],O.vertices[1]].forEach(R=>{R.bind(ne.Types.change,()=>{k(M,O,L[0].angle)})}),L.forEach(R=>{const W=R.start.x*z,U=R.end.x*z,G=R.start.y*z,X=R.end.y*z,j=new Xo(W,G,U,X);j.linewidth=qe.line.size,j.stroke=qe.line.color,M.add(j)})),M},w=(L,O,z,M)=>{const R=O.vertices[0].x+(O.vertices[1].x-O.vertices[0].x)/2-8*Math.sin(L.angle*Math.PI/180),W=O.vertices[0].y+(O.vertices[1].y-O.vertices[0].y)/2-8*Math.cos(L.angle*Math.PI/180),U=new cr(L.label,R+10,W-10);let G;U.size=qe.lineLabel.size,U.weight=600,U.fill=qe.lineLabel.color,U.id+=1,U.rotation=qe.lineLabel.rotation,M>0&&(G=new cr(`${L.angle}°`,O.vertices[0].x+25,O.vertices[0].y-25),G.size=qe.angleLabel.size,G.weight=600,G.fill=qe.angleLabel.color,G.rotation=qe.angleLabel.rotation,G.id+=M,s.push(G),z.add(G)),z.add(U),C(U,O,0,G),C(U,O,1)},T=()=>{const{size:L}=qe.colorSideLabel,O=0,z=0,M=f.value?L/2:L/2-L,R=f.value?L/2-L:L/2,W=new Hn;if(!c)return W;const U=5,G=Math.atan2(R-M,z-O),X=[new Ae(O,M,0,0,0,0,Sn.Commands.move),new Ae(z,R,0,0,0,0,Sn.Commands.line),new Ae(z-U*Math.cos(G-Math.PI/4),R-U*Math.sin(G-Math.PI/4),0,0,0,0,Sn.Commands.line),new Ae(z,R,0,0,0,0,Sn.Commands.move),new Ae(z-U*Math.cos(G+Math.PI/4),R-U*Math.sin(G+Math.PI/4),0,0,0,0,Sn.Commands.line)],j=new Oe(X,!1,!1,!0);j.noFill(),j.cap="round",j.join="round",j.linewidth=L/7,j.stroke=qe.colorSideLabel.color,W.add(j);const q=new cr(f.value?"Цвет снизу":"Цвет сверху",10,0);q.size=L,q.weight=600,q.fill=qe.colorSideLabel.color,q.alignment="left",W.add(q);const le=W.getBoundingClientRect();return W.position.x=(c.width-le.width)*d+10,W.position.y=f.value?c.height+le.height*2:le.height/2,W},C=(L,O,z,M)=>{O.vertices[z].bind(ne.Types.change,()=>{const R=O.vertices.length-1,W=Math.atan2(O.vertices[0].y-O.vertices[R].y,O.vertices[0].x-O.vertices[R].x)*180/Math.PI,U=O.vertices[0].x+(O.vertices[R].x-O.vertices[0].x)/2-8*Math.sin(W*Math.PI/180),G=O.vertices[0].y+(O.vertices[R].y-O.vertices[0].y)/2-8*Math.cos(W*Math.PI/180);L.position.x=U+10,L.position.y=G-10,L.rotation=-.5,M&&(M.position.x=O.vertices[0].x+25,M.position.y=O.vertices[0].y-25)})},$=(L,O,z,M,R=!1)=>{var st;if(L.clear(),z.length===0){L.update();return}const W=p(z),[U,G,X]=g(L,O,W,M,R),j=new Hn,q=new Array,le=new Array;R||(s=[],l=[]),W.forEach((_e,we)=>{const xt=_e.start.x*U+G,Ee=_e.end.x*U+G,Zt=_e.start.y*U+X,gn=_e.end.y*U+X,Rt=new Xo(xt,Zt,Ee,gn);Rt.linewidth=R?qe.previewLine.size:qe.line.size,Rt.stroke=R?qe.previewLine.color:qe.line.color,l.push(Rt),q.push(Rt),j.add(Rt),!R&&_e.label!==""&&w(_e,Rt,j,we)});const de=q.at(-1);let ve=j.getBoundingClientRect();if(!R){const _e=T();le.push(_e)}if(O.length>0){const _e=v(O,q[0],U);j.add(_e)}if(M.length>0&&de){const _e=N(M,de,U);j.add(_e)}if(le.push(j),L.makeGroup(le),ve=j.getBoundingClientRect(),j.position.x=0-ve.left+(L.width-ve.width)/(2*(R?1:d)),j.position.y=0-ve.top+(L.height-ve.height)/(2*(R?1:d)),L.update(),!R){const _e=((st=i.value.configuratorParams)==null?void 0:st.colorSide)==="top";j.position.y=j.position.y+qe.colorSideLabel.size*Number(_e),y(q,j),L.update()}},E=(L,O)=>{if(L&&!O.isNewRec()){const z=new Sn({width:L.scrollWidth,height:L.scrollHeight});z.appendTo(L),$(z,[],O.points,[],!0)}},V=()=>{c&&$(c,h.value,u.value,m.value,!1)},P=L=>L*(180/Math.PI),I=(L,O)=>{const z=L[1].x-L[0].x,M=L[1].y-L[0].y,R=O[1].x-O[0].x,W=O[1].y-O[0].y;let U=Math.atan2(z*W-M*R,z*R+M*W);return U=P(U),Math.round(U)*-1},K=L=>{const O=l.map((z,M,R)=>{const W=R[M-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let U=Math.ceil(z._length/L/i.settings.lineWidthStep)*i.settings.lineWidthStep;const G=s[M-1];U<(R.length>1?i.settings.minLineWidth:i.settings.stripMinWidth)&&(U=R.length>1?i.settings.minLineWidth:i.settings.stripMinWidth),U>i.settings.maxLineWidth&&(U=i.settings.maxLineWidth);const X=I(z.vertices,W.vertices);return G&&(G.value=`${X}°`),new $n(U,X,`A-${M+1}`)});r("pointer:move",O)},J=L=>{let O=null,z;const M=G=>{O=a.find(X=>{const j=X.renderer;return(j==null?void 0:j.elem)===G.target}),[z]=g(L,h.value,u.value.map(X=>X),m.value)},R=G=>{if(O){const X=O.renderer,j=X==null?void 0:X.elem;if(!j)return;const q=j.getBoundingClientRect();O.vertices[0].x-=q.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+qe.anchorPoint.size/2,O.vertices[0].y-=q.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+qe.anchorPoint.size/2,K(z),L.update()}},W=()=>{O&&r("pointer:up",u.value),O=null},U=o.value;U&&(U.addEventListener("touchstart",M,{passive:!0}),U.addEventListener("touchend",W,{passive:!0}),U.addEventListener("mousedown",M),U.addEventListener("mouseup",W),U.addEventListener("mousemove",R),U.addEventListener("touchmove",R,{passive:!0}))},Z=(L,O)=>{r("remove-custom-template",L,O)};return n.onMounted(()=>{o.value&&(c=new Sn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),n.watch(()=>i.value,()=>{V()},{deep:!0,immediate:!0}),J(c))}),n.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(L,O)=>(n.openBlock(),n.createElementBlock("div",M1,[n.createVNode(xu,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":O[0]||(O[0]=z=>r("template:select",z)),onInitDrawTemplate:E,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),n.createElementVNode("div",I1,[n.createElementVNode("div",A1,null,512)])]))}});class dr extends H.Identity{constructor(i,r){super();B(this,"label","");B(this,"points",[]);B(this,"isCustom",!1);B(this,"id",-1);B(this,"guid","");i?(this.label=i.label,this.points=i.points.map((o,s)=>A.isArray(o)?new $n(o[0],o[1],`A-${s+1}`):new $n(o.width,o.angle,`A-${s+1}`)),this.isCustom=i.isCustom):(this.label="-- Новая конфигурация --",this.points=[new $n(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Bl extends dr{constructor(i){super(i);B(this,"isDefault");this.isDefault=i.isDefault??!1}}class Cu{constructor(e){B(this,"minLineWidth");B(this,"maxLineWidth");B(this,"lineWidthStep");B(this,"minLineAngle");B(this,"maxLineAngle");B(this,"lineAngleStep");B(this,"stripMinWidth");B(this,"stripMaxWidth");B(this,"stripMinLength");B(this,"stripMaxLength");B(this,"allowShowTable");B(this,"showOnlyTemplates");B(this,"templates");B(this,"customTemplates",[]);B(this,"startTailConfigs");B(this,"endTailConfigs");B(this,"bendCountForExtended");B(this,"extendedProductCatalog");B(this,"allowChangeFirstPoint");B(this,"allowSaveTemplates");B(this,"userTemplatesPrefix");B(this,"lengthStep");B(this,"canSetDopProdaga");var i,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(o=>new dr(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((i=e.startTailConfigs)==null?void 0:i.map(o=>new Bl(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Bl(o)))??[],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(([,o])=>o.id!==-1).map(([o,s])=>{const l=new dr(s);return l.isCustom=!0,l.id=+o,l}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new dr({label:"-- Новая конфигурация --",points:[new $n(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findLast(o=>!o.isNewRec()),r=new dr(e);r.isCustom=!0,r.id=i?i.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findIndex(r=>r.id===e);i!==-1&&this.customTemplates.splice(i,1)}}const z1={class:"flex flex-col gap-3"},D1={class:"grid gap-5 md:grid-cols-5"},L1={},vu=n.defineComponent({...L1,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.ref(!1),s=n.ref(!1),l=n.ref(!1),a=n.ref(i.cartItem),c=n.ref(new Cu(i.settings)),d=n.ref({linesWidths:[...i.cartItem.configuratorParams.linesWidths],linesAngles:[...i.cartItem.configuratorParams.linesAngles]}),u=n.ref({quantity:{},marker:{},length:{}}),f=n.ref(0),h=n.useTemplateRef("kozyrek-configurator-params-form"),m=(C=0)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(C);$!==void 0&&(f.value=C,a.value.configuratorParams.linesWidths=$.points.map(V=>A.isArray(V)?V[0]:V.width),a.value.configuratorParams.linesAngles=$.points.map(V=>A.isArray(V)?V[1]:V.angle),k()),y(a.value.configuratorParams)},p=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;l.value=!0;const $={label:C,points:a.value.configuratorParams.linesWidths.map((V,P)=>[V,a.value.configuratorParams.linesAngles[P]])},E=V=>{V&&(c.value.addCustomTemplate($),f.value=c.value.allTemplates.length-2),l.value=!1};i.eventEmitter.emit("configurator:create-template",{category:i.cartItem.category,template:$,callback:E})},g=async(C,$)=>{var P;const E=(P=c.value.allTemplates)==null?void 0:P.at(C);if(!E||!E.isCustom)return;const V=I=>{I&&(c.value.removeCustomTemplate(E.id),m()),$==null||$()};i.eventEmitter.emit("configurator:remove-template",{category:i.cartItem.category,templateId:E.id,callback:V})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async C=>{var $,E;a.value.product=new H.ClientProduct,(E=($=h.value)==null?void 0:$.formReference)==null||E.validate(V=>{V||(k(),o.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:C,validationFieldResultData:u.value,callback:P=>{P?a.value.product=P:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(A.noop)},_=async()=>{var C,$;($=(C=h.value)==null?void 0:C.formReference)==null||$.validate(E=>{var V,P;if(!E){s.value=!0;const I=new H.OrderItemBase(a.value);(V=c.value.startTailConfigs)!=null&&V.length||delete I.configuratorParams.startTailType,(P=c.value.endTailConfigs)!=null&&P.length||delete I.configuratorParams.endTailType,r("submit",I,u.value,()=>{s.value=!1,n.nextTick(()=>{var K,J;(J=(K=h.value)==null?void 0:K.formReference)==null||J.restoreValidation()})})}}).catch(A.noop)},k=()=>{const C={quantity:u.value.quantity,marker:u.value.marker};a.value.configuratorParams.linesWidths.forEach(($,E)=>{C[`lines_widths[${E+1}]`]={},C[`lines_angles[${E+1}]`]={}}),u.value=C},x=C=>{d.value.linesWidths=C.map($=>$.width),d.value.linesAngles=C.map($=>$.angle)},v=C=>{a.value.configuratorParams.linesWidths=d.value.linesWidths,a.value.configuratorParams.linesAngles=d.value.linesAngles,k(),b(),y(a.value.configuratorParams)},N=(C,$)=>{d.value.linesWidths=C,d.value.linesAngles=$},w=C=>{const $=a.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,E=0;a.value.configuratorParams.linesWidths.splice(C+1,0,$),a.value.configuratorParams.linesAngles.splice(C+1,0,E),d.value.linesWidths=[...a.value.configuratorParams.linesWidths],d.value.linesAngles=[...a.value.configuratorParams.linesAngles],k(),b(),y(a.value.configuratorParams)},T=C=>{a.value.configuratorParams.linesWidths.length<=1||(a.value.configuratorParams.linesWidths.splice(C,1),a.value.configuratorParams.linesAngles.splice(C,1),d.value.linesWidths=[...a.value.configuratorParams.linesWidths],d.value.linesAngles=[...a.value.configuratorParams.linesAngles],k(),b(),y(a.value.configuratorParams))};return n.onMounted(()=>{i.cartItem.isNewRec()?m():(k(),f.value=-1,y(a.value.configuratorParams))}),n.watch(()=>i.cartItem,C=>{a.value=new H.OrderItemBase(C),C.isNewRec()?m():(k(),f.value=-1,y(a.value.configuratorParams))}),(C,$)=>{const E=F.NButton;return n.openBlock(),n.createElementBlock("div",z1,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(E,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=V=>r("click:view-switch"))},{default:n.withCtx(()=>[...$[3]||($[3]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",D1,[n.createVNode(ku,{value:a.value,"select-template-index":f.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":v,"onPointer:move":x,"onTemplate:select":m,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),n.createVNode(nc,{ref:"kozyrek-configurator-params-form",value:a.value,"onUpdate:value":$[1]||($[1]=V=>a.value=V),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":f.value,class:"col-span-2","onUpdate:params":$[2]||($[2]=V=>y(V)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":p,"onClick:addLine":w,"onClick:removeLine":T},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),H1={class:"flex flex-col items-center justify-between rounded-xl"},W1={class:"img-preview relative flex justify-center"},j1={},q1=n.defineComponent({...j1,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const i=t,r=n.computed(()=>{const{height:s}=i.configuratorParams;return A.keys(i.settings.crossbarCount).reverse().find(l=>s>=i.settings.crossbarCount[Number(l)])}),o=e;return(s,l)=>{const a=F.NButton;return n.openBlock(),n.createElementBlock("div",H1,[n.createElementVNode("div",W1,[l[1]||(l[1]=n.createElementVNode("div",{class:"window"},null,-1)),n.createElementVNode("div",{class:n.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),n.createElementVNode("div",{class:n.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),n.createElementVNode("div",{class:n.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),n.createVNode(a,{type:"primary",class:"block justify-self-center",onClick:l[0]||(l[0]=c=>o("open-instructions"))},{default:n.withCtx(()=>[...l[2]||(l[2]=[n.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Nl=wn(q1,[["__scopeId","data-v-2a790a20"]]),X1={key:0,class:"flex items-baseline gap-1"},Y1={key:0,class:"flex items-baseline gap-1"},U1={key:1},K1={class:"text-lg font-semibold"},G1={key:2,class:"text-red-500 text-sm mb-2"},Z1={class:"flex gap-3"},Q1={},Su=n.defineComponent({...Q1,__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:i}){var w;const r=t,o=i,s=n.computed(()=>Ye.isPhoneDevice()),l=n.useTemplateRef("form-reference"),a=n.useTemplateRef("width-form-item-reference"),c=n.useTemplateRef("height-form-item-reference"),d=n.useTemplateRef("width-input-reference"),u=n.ref(A.cloneDeep(r.value)),f=n.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),h=n.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),m=n.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),p=n.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),g=n.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+f.value:0),b=n.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+h.value:0),y=n.ref(r.settings.canSetDopProdaga??!1),_=n.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-f.value),ae.max(m.value-f.value),ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-h.value),ae.max(p.value-h.value),ae.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),k=n.computed(()=>{var P;const T=g.value,C=b.value,{quantity:$}=r.value,E=((P=r.value.product)==null?void 0:P.costRub)||0;if(!T||!C||!$||E===0)return null;const V=T*C/1e6;return(E*$*V).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=n.computed(()=>{const T=g.value,C=b.value,$=!!(T&&T>=r.settings.minWidth&&T<=r.settings.maxWidths[u.value.configuratorParams.netType]),E=!!(C&&C>=r.settings.minHeight&&C<=r.settings.maxHeights[u.value.configuratorParams.netType]),V=!!(r.value.quantity&&r.value.quantity>0);return $&&E&&V}),v=(T,C)=>{var V,P;const $=u.value.configuratorParams;T&&T in $&&($[T]=C);const E={...$,width:g.value??0,height:b.value??0};T==="width"&&((V=a.value)==null||V.validate().catch(A.noop)),T==="height"&&((P=c.value)==null||P.validate().catch(A.noop)),n.nextTick(()=>{var K,J;!((K=a.value)!=null&&K.validationErrored)&&!((J=c.value)!=null&&J.validationErrored)&&E.height&&E.width&&o("update:params",E),N("configuratorParams",E)})},N=(T,C)=>{const $=new H.OrderItemBase(r.value);$[T]=C,T==="configuratorParams"&&($.product=new H.ClientProduct),o("update:value",$)};return n.watch(()=>r.value,T=>{const C=A.cloneDeep(n.toRaw(T)),$=C.configuratorParams.mountType,E=r.settings.widthOverlaps[$]??0,V=r.settings.heightOverlaps[$]??0;C.configuratorParams.width&&C.configuratorParams.width>0&&(C.configuratorParams.width-=E),C.configuratorParams.height&&C.configuratorParams.height>0&&(C.configuratorParams.height-=V),u.value=C},{deep:!0,immediate:!0}),n.onMounted(()=>{var T;(T=d.value)==null||T.select()}),e({validate:(w=l.value)==null?void 0:w.validate,formReference:l}),(T,C)=>{const $=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.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"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[C[0]||(C[0]=E=>u.value.configuratorParams.netType=E),C[1]||(C[1]=E=>v("netType",E))],options:t.settings.netType.map(E=>({label:t.settings.descriptions.net_type[E],value:E}))},null,8,["value","options"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[C[2]||(C[2]=E=>u.value.configuratorParams.color=E),C[3]||(C[3]=E=>v("color",E))],options:t.settings.color.map(E=>({label:t.settings.descriptions.color[E],value:E}))},null,8,["value","options"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[C[4]||(C[4]=E=>u.value.configuratorParams.mountType=E),C[5]||(C[5]=E=>v("mountType",E))],options:t.settings.mountType.map(E=>({label:t.settings.descriptions.mount_type[E],value:E}))},null,8,["value","options"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:n.withCtx(()=>[!t.validation.width.showFeedback&&g.value>=t.settings.minWidth&&g.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(n.openBlock(),n.createElementBlock("div",X1,[n.createVNode(n.unref(F.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Ширина готового изделия "+n.toDisplayString(g.value),1)]),_:1}),n.createVNode(n.unref(F.NButton),{quaternary:"",type:"info",size:"tiny",onClick:C[10]||(C[10]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...C[25]||(C[25]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[C[6]||(C[6]=E=>u.value.configuratorParams.width=E),C[9]||(C[9]=E=>v("width",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:C[7]||(C[7]=E=>n.unref(lt)(E)),onInput:C[8]||(C[8]=E=>n.unref(rt)(t.validation,"width")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-h.value} ${p.value?" до "+(p.value-h.value):""} мм.`},{feedback:n.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(n.openBlock(),n.createElementBlock("div",Y1,[n.createVNode(n.unref(F.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Высота готового изделия "+n.toDisplayString(b.value),1)]),_:1}),n.createVNode(n.unref(F.NButton),{quaternary:"",type:"info",size:"tiny",onClick:C[15]||(C[15]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...C[26]||(C[26]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[C[11]||(C[11]=E=>u.value.configuratorParams.height=E),C[14]||(C[14]=E=>v("height",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:C[12]||(C[12]=E=>n.unref(lt)(E)),onInput:C[13]||(C[13]=E=>n.unref(rt)(t.validation,"height")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:u.value.quantity,"onUpdate:value":[C[16]||(C[16]=E=>u.value.quantity=E),C[19]||(C[19]=E=>N("quantity",E??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[17]||(C[17]=E=>n.unref(lt)(E,!1)),onInput:C[18]||(C[18]=E=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:C[20]||(C[20]=E=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":C[21]||(C[21]=E=>{u.value.marker=E??null,N("marker",E??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),y.value?(n.openBlock(),n.createBlock($,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":C[22]||(C[22]=E=>{u.value.isAdditionalSale=E??!1,N("isAdditionalSale",E??!1)})},{default:n.withCtx(()=>[...C[27]||(C[27]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),k.value?(n.openBlock(),n.createElementBlock("div",U1,[C[28]||(C[28]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",K1,n.toDisplayString(k.value)+" ₽",1)])):n.createCommentVNode("",!0),x.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",G1," Пожалуйста, заполните все обязательные поля корректно. ")),n.createElementVNode("div",Z1,[n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:C[23]||(C[23]=E=>o("submit",t.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,type:"default",onClick:C[24]||(C[24]=E=>o("click:show-preview-drawer"))},{default:n.withCtx(()=>[...C[29]||(C[29]=[n.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):n.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",u.value)]])}}}),J1="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",eb="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",tb="/img/configurators/mosquitto/measurement-instructions/mount.png",nb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ib="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",rb={class:"flex flex-col gap-6"},ob={class:"flex gap-4"},sb={class:"flex flex-col gap-2"},lb={class:"flex gap-4"},ab={class:"flex flex-col gap-2"},cb={class:"flex gap-4"},db={class:"flex flex-col gap-2"},ub={},Bu=n.defineComponent({...ub,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const i=Ye.initRefDependingOnDeviceResolution("small","small","medium"),r=Ye.initRefDependingOnDeviceResolution(.98,.95,.8),o=n.computed(()=>window.innerWidth*r.value),s=e;return(l,a)=>{const c=F.NText;return n.openBlock(),n.createBlock(n.unref(F.NModal),{show:t.show,"show-icon":!1,size:n.unref(i),style:n.normalizeStyle(`width: ${o.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:a[0]||(a[0]=d=>s("update:show",!1)),onEsc:a[1]||(a[1]=d=>s("update:show",!1)),onMaskClick:a[2]||(a[2]=d=>s("update:show",!1))},{default:n.withCtx(()=>[n.createElementVNode("div",rb,[n.createVNode(c,{type:"error",class:"text-base font-medium"},{default:n.withCtx(()=>[...a[3]||(a[3]=[n.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),a[22]||(a[22]=n.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[n.createElementVNode("div",{class:"flex items-start gap-4"},[n.createElementVNode("img",{src:J1,alt:"measurement-height",class:"w-[7.5rem]"}),n.createElementVNode("div",{class:"flex flex-col gap-2"},[n.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),n.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),n.createElementVNode("div",{class:"flex items-start gap-4"},[n.createElementVNode("img",{src:eb,alt:"measurement-height",class:"w-[7.5rem]"}),n.createElementVNode("div",{class:"flex flex-col gap-2"},[n.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),n.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),n.createElementVNode("div",ob,[a[9]||(a[9]=n.createElementVNode("img",{src:tb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",sb,[a[8]||(a[8]=n.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),n.createElementVNode("span",null,[a[4]||(a[4]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),a[5]||(a[5]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),a[6]||(a[6]=n.createElementVNode("br",null,null,-1)),a[7]||(a[7]=n.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),n.createElementVNode("div",lb,[a[15]||(a[15]=n.createElementVNode("img",{src:nb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",ab,[a[14]||(a[14]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),n.createElementVNode("span",null,[a[10]||(a[10]=n.createTextVNode(" Расчетные размеры москитной сетки:",-1)),a[11]||(a[11]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),a[12]||(a[12]=n.createElementVNode("br",null,null,-1)),a[13]||(a[13]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),n.createElementVNode("div",cb,[a[21]||(a[21]=n.createElementVNode("img",{src:ib,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",db,[a[20]||(a[20]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),n.createElementVNode("span",null,[a[16]||(a[16]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),a[17]||(a[17]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),a[18]||(a[18]=n.createElementVNode("br",null,null,-1)),a[19]||(a[19]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),fb={class:"grid md:grid-cols-2"},hb={},Nu=n.defineComponent({...hb,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.computed(()=>Ye.isPhoneDevice()),s=n.ref(!1),l=n.ref(!1),a=n.ref(i.cartItem),c=n.useTemplateRef("mosquito-configurator-form"),d=n.ref({width:{},height:{},quantity:{},marker:{}}),u=n.ref(!1),f=n.ref(!1),h=n.computed(()=>n.inject("debounce-input-time",300)),m=A.debounce(async g=>{var b,y;a.value.product=new H.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:g,validationFieldResultData:d.value,callback:k=>{k?a.value.product=k:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(A.noop)},h.value),p=()=>{f.value=!0,r("submit",a.value,d.value,()=>{f.value=!1})};return n.watch(()=>i.cartItem,g=>{a.value=g},{deep:!0}),(g,b)=>{const y=Yo;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(Bu,{show:l.value,"onUpdate:show":b[0]||(b[0]=_=>l.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),n.createElementVNode("div",fb,[o.value?(n.openBlock(),n.createBlock(n.unref(F.NDrawer),{key:1,show:s.value,"onUpdate:show":b[4]||(b[4]=_=>s.value=_),"default-width":375,resizable:""},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NDrawerContent),null,{header:n.withCtx(()=>[n.createVNode(n.unref(F.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>s.value=!1)},{default:n.withCtx(()=>[n.createVNode(y)]),_:1})]),default:n.withCtx(()=>[n.createVNode(Nl,{"configurator-params":a.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>l.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(n.openBlock(),n.createBlock(Nl,{key:0,"configurator-params":a.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>l.value=!0)},null,8,["configurator-params","settings"])),n.createVNode(Su,{ref:"mosquito-configurator-form",value:a.value,"onUpdate:value":b[5]||(b[5]=_=>a.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":f.value,"onUpdate:params":b[6]||(b[6]=_=>n.unref(m)(_)),onSubmit:b[7]||(b[7]=_=>p()),"onClick:instructionsToggle":b[8]||(b[8]=_=>l.value=!l.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),mb={},Tu=n.defineComponent({...mb,__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},isLastLine:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.useTemplateRef("width-input-element"),l=n.ref(!1),a=n.ref(r.value),c=n.useTemplateRef("form-item-reference"),d=n.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{a.value=m,o("update:value",m,r.index,l)},f=m=>{lt(m),(m.key==="Enter"||m.code==="Enter")&&!r.isLastLine&&(m.preventDefault(),m.stopPropagation())},h=()=>{var m;(m=s.value)==null||m.select()};return n.watch(()=>r.value,m=>{a.value=m}),n.onMounted(()=>{r.autoFocus&&n.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(m,p)=>{const g=tc,b=uo;return n.openBlock(),n.createBlock(n.unref(F.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(Tr,{key:0,"is-product-searching":l.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(F.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref:"width-input-element",value:a.value??null,class:"w-full","show-button":!1,parse:n.unref(ct),placeholder:"Введите ширину",onKeydown:f,onInput:p[0]||(p[0]=y=>n.unref(rt)(t.validation,`linesWidths.${t.index}`)),onFocus:n.unref(He),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),n.createVNode(n.unref(F.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[1]||(p[1]=y=>o("click:add-line",t.index))},{default:n.withCtx(()=>[n.createVNode(g)]),_:1},8,["disabled"]),n.createVNode(n.unref(F.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[2]||(p[2]=y=>o("click:remove-line",t.index))},{default:n.withCtx(()=>[n.createVNode(b)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),pb={class:"my-2 flex w-full flex-col"},gb={key:1},yb={class:"text-lg font-semibold"},bb={class:"flex gap-3"},_b={},$u=n.defineComponent({..._b,__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:i}){var _;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.useTemplateRef("line-items-reference"),a=n.ref(A.cloneDeep(r.value)),c=n.computed(()=>{const k={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return A.forEach(a.value,(x,v)=>{var N;k[`configuratorParams.linesWidths.${v}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${v}`])==null?void 0:N.feedback)]}),k}),d=n.ref(r.settings.canSetDopProdaga??!1),u=n.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((k,x)=>(k??0)+(x??0),0)),f=n.computed(()=>r.settings.width-u.value),h=n.computed(()=>!r.value.some(({product:k})=>!k||k.isNewRec())),m=n.computed(()=>r.isSubmitProcessing||!h.value||f.value<=0||a.value.length>=r.settings.maxLinesCount||r.value.some(k=>k.product.isNewRec())),p=n.computed(()=>k=>f.value===0?void 0:[{label:`${(f.value>0?"Остаток +":"Излишек ")+f.value} мм.`,key:f.value+k}]),g=n.computed(()=>{const{length:k}=r.value[0];return!k||u.value!==r.settings.width?null:(A.reduce(r.value,(v,N)=>{var T;const w=((T=N.product)==null?void 0:T.costRub)||0;return v+w},0)*r.value[0].quantity*k).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(k,x,v)=>{var w,T,C;a.value[x].product.id=-1;const{configuratorParams:N}=a.value[x];N.linesWidths[x]=k,y("configuratorParams",N),(C=(T=(w=l.value)==null?void 0:w.at(x))==null?void 0:T.formItemReference)==null||C.validate().catch(A.noop),n.nextTick(()=>{var $,E;(E=($=l.value)==null?void 0:$.at(x))!=null&&E.isValid&&o("update:params",N,x,v)})},y=(k,x)=>{a.value.forEach(v=>{v[k]=x}),o("update:value",a.value)};return n.watch(()=>r.value,k=>{a.value=A.cloneDeep(k)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(k,x)=>{const v=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:a.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var N;return[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,(w,T)=>{var C,$,E;return n.openBlock(),n.createBlock(Tu,{key:T,ref_for:!0,ref:"line-items-reference",value:((C=w.configuratorParams)==null?void 0:C.linesWidths.at(T))??null,"auto-focus":((($=w.configuratorParams)==null?void 0:$.linesWidths.at(T))??0)===0,index:T,path:`configuratorParams.linesWidths.${T}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":p.value(((E=w.configuratorParams)==null?void 0:E.linesWidths.at(T))??0),"add-line-button-disabled":f.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(V=>V.product.isNewRec()),"remove-line-button-disabled":a.value.length===1,"is-last-line":T===a.value.length-1&&f.value===0,"onUpdate:value":b,"onClick:addLine":x[0]||(x[0]=V=>o("click:add-line",V)),"onClick:removeLine":x[1]||(x[1]=V=>o("click:remove-line",V))},null,8,["value","auto-focus","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled","is-last-line"])}),128)),n.createElementVNode("div",pb,[f.value<0?(n.openBlock(),n.createBlock(n.unref(F.NText),{key:0,type:"error"},{default:n.withCtx(()=>[n.createTextVNode(" Сумма ширин всех полос должна быть равна "+n.toDisplayString(t.settings.width),1)]),_:1})):n.createCommentVNode("",!0),h.value&&a.value.length===t.settings.maxLinesCount&&f.value>0?(n.openBlock(),n.createBlock(n.unref(F.NText),{key:1,type:"error"},{default:n.withCtx(()=>[...x[15]||(x[15]=[n.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",null,[x[16]||(x[16]=n.createTextVNode(" Остаток для резки: ",-1)),n.createVNode(n.unref(F.NText),{type:f.value>=0?"Success":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f.value),1)]),_:1},8,["type"]),n.createTextVNode(" из "+n.toDisplayString(t.settings.width)+" мм ",1)])]),n.createVNode(n.unref(F.NButton),{disabled:m.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",a.value.length))},{default:n.withCtx(()=>[...x[17]||(x[17]=[n.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),n.createVNode(n.unref(F.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>a.value[0].length=w),x[6]||(x[6]=w=>y("length",w))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>n.unref(lt)(w,!1)),onInput:x[5]||(x[5]=w=>n.unref(rt)(t.validation,"length")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>a.value[0].quantity=w),x[10]||(x[10]=w=>y("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>n.unref(lt)(w,!1)),onInput:x[9]||(x[9]=w=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:a.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{a.value[0].marker=w??null,y("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(v,{key:0,checked:a.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{a.value[0].isAdditionalSale=w??!1,y("isAdditionalSale",w??!1)})},{default:n.withCtx(()=>[...x[18]||(x[18]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock("div",gb,[x[19]||(x[19]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",yb,n.toDisplayString(g.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",bb,[n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:!h.value||f.value!=0||!((N=a.value[0])!=null&&N.length)||a.value[0].length>t.settings.maxLength||a.value[0].length<t.settings.minLength||a.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>o("submit",a.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",a.value)]])}}}),wb={class:"flex grow flex-col"},xb=["src"],kb={class:"w-full"},Cb={},Eu=n.defineComponent({...Cb,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",wb,[n.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,xb),n.createElementVNode("div",kb,[n.createTextVNode(" Число полос можно указать от "+n.toDisplayString(t.settings.minLinesCount)+" до "+n.toDisplayString(t.settings.maxLinesCount)+". ",1),i[0]||(i[0]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Минимальная ширина полосы "+n.toDisplayString(t.settings.minLineWidth)+" мм. ",1),i[1]||(i[1]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина всех полос "+n.toDisplayString(t.settings.width)+" мм. ",1),i[2]||(i[2]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Шаг ширины полосы - "+n.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),vb={class:"flex flex-col gap-2"},Sb={class:"w-104 flex grow flex-col px-5"},Bb={},Ru=n.defineComponent({...Bb,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.useTemplateRef("strip-configurator-form"),s=n.ref(i.cartItems),l=n.ref({width:{},length:{},quantity:{},marker:{}}),a=n.ref(!1),c=n.computed(()=>n.inject("debounce-input-time",300)),d=n.computed(()=>{var p;return(p=s.value[0].configuratorParams)==null?void 0:p.linesWidths.reduce((g,b)=>(g??0)+(b??0),0)}),u=p=>{p===void 0&&(p=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p+1,0,null),s.value.forEach(y=>{y.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const b=new H.OrderItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??i.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,b)},f=p=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(b=>{b.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete l[`linesWidths.${p}`],delete l[`linesWidths.${p}`])},h=A.debounce(async(p,g,b)=>{const y={linesWidths:p.linesWidths.at(g)};b.value=!0,l.value[`linesWidths.${g}`]={},s.value[g].product=new H.ClientProduct,i.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:y,validationFieldResultData:l.value,callback:_=>{_?(s.value[g].product=_,g===s.value.length-1&&s.value.length<i.settings.maxLinesCount&&d.value&&d.value<i.settings.width&&u()):(s.value[g].product=new H.ClientProduct,l.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),m=async()=>{var p,g;(g=(p=o.value)==null?void 0:p.formReference)==null||g.validate(b=>{if(!b){a.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,l.value,()=>{a.value=!1,n.nextTick(()=>{var _,k;(k=(_=o.value)==null?void 0:_.formReference)==null||k.restoreValidation()})})}}).catch(A.noop)};return n.watch(()=>i.cartItems,p=>{s.value=p.map(g=>new H.OrderItemBase(g))}),(p,g)=>{const b=F.NButton;return n.openBlock(),n.createElementBlock("div",vb,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=y=>r("click:view-switch"))},{default:n.withCtx(()=>[...g[3]||(g[3]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Sb,[n.createVNode(Eu,{value:s.value,"onUpdate:value":g[1]||(g[1]=y=>s.value=y),settings:t.settings},null,8,["value","settings"]),n.createVNode($u,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y),validation:l.value,settings:t.settings,"is-submit-processing":a.value,"onUpdate:params":n.unref(h),onSubmit:m,"onClick:addLine":u,"onClick:removeLine":f},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Nb={class:"flex flex-col gap-3"},Tb={},Pu=n.defineComponent({...Tb,__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:i}){var m;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.useTemplateRef("first-input-element"),a=n.ref(A.cloneDeep(r.value)),c=n.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),d=n.ref(r.settings.canSetDopProdaga??!1),u=()=>{o("update:params",a.value.configuratorParams),f("configuratorParams",a.value.configuratorParams)},f=(p,g)=>{const b=new H.OrderItemBase(r.value);b[p]=g,p==="configuratorParams"&&(b.product=new H.ClientProduct),o("update:value",b)},h=()=>{var p;(p=l.value)==null||p.select()};return n.watch(()=>r.value,p=>{a.value=A.cloneDeep(p)},{deep:!0}),n.onMounted(()=>{r.value.isNewRec()&&n.nextTick(()=>{h()})}),e({validate:(m=s.value)==null?void 0:m.validate,formReference:s}),(p,g)=>{const b=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:a.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref:"first-input-element",value:a.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=y=>a.value.configuratorParams.width=y),u],class:"w-full",parse:n.unref(ct),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=y=>n.unref(lt)(y)),onInput:g[2]||(g[2]=y=>n.unref(rt)(t.validation,"width")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=y=>a.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=y=>n.unref(lt)(y)),onInput:g[5]||(g[5]=y=>n.unref(rt)(t.validation,"length")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=y=>n.unref(lt)(y,!1)),onInput:g[7]||(g[7]=y=>n.unref(rt)(t.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=y=>f("quantity",y??0)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:g[9]||(g[9]=y=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":g[10]||(g[10]=y=>f("marker",y??null)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(b,{key:0,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=y=>{a.value.isAdditionalSale=y??!1,f("isAdditionalSale",y??!1)})},{default:n.withCtx(()=>[...g[13]||(g[13]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),n.createElementVNode("div",Nb,[n.createVNode(n.unref(F.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:g[12]||(g[12]=y=>o("submit",t.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])),[[n.unref(ti),()=>o("submit",a.value)]])}}}),$b={class:"flex flex-col gap-2 w-72"},Eb={},Fu=n.defineComponent({...Eb,__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]},showProductInfoButton:{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 i=t,r=e,o=n.useTemplateRef("metal-for-doors-configurator-form"),s=n.ref(i.cartItem),l=n.ref({width:{},length:{},quantity:{},marker:{}}),a=n.ref(!1),c=n.ref(!1),d=n.computed(()=>n.inject("debounce-input-time",300)),u=A.debounce(async h=>{var m,p;s.value.product=new H.ClientProduct,(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(g=>{g||(a.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:h,validationFieldResultData:l.value,callback:b=>{b?s.value.product=b:l.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},a.value=!1}}))}).catch(A.noop)},d.value),f=async()=>{var h,m;(m=(h=o.value)==null?void 0:h.formReference)==null||m.validate(p=>{p||(c.value=!0,r("submit",s.value,l.value,()=>{c.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})}))}).catch(A.noop)};return n.watch(()=>i.cartItem,h=>{s.value=new H.OrderItemBase(h)},{deep:!0}),(h,m)=>{const p=F.NButton;return n.openBlock(),n.createElementBlock("div",$b,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=g=>r("click:view-switch"))},{default:n.withCtx(()=>[...m[4]||(m[4]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Pu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":m[1]||(m[1]=g=>s.value=g),validation:l.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":a.value,"onUpdate:params":m[2]||(m[2]=g=>n.unref(u)(g)),onSubmit:m[3]||(m[3]=g=>f())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Rb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pb(t,e){return n.openBlock(),n.createElementBlock("svg",Rb,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Vu=n.markRaw({name:"ion-add",render:Pb}),Fb={key:0,class:"-mt-1 text-sm text-gray-500"},Vb={class:"font-bold"},Mb={class:"flex flex-col gap-3"},Ib={key:0,class:"mt-4 flex flex-col gap-1.5"},Ab={class:"flex flex-col gap-1 text-sm text-gray-700"},Ob={key:0},zb={key:1},Db={"form-array-name":"items",class:"flex flex-col gap-3"},Lb={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},Hb={key:0,class:"flex flex-wrap items-end gap-2"},Wb={class:"whitespace-nowrap text-xl font-bold"},jb={key:0,class:"whitespace-nowrap text-lg text-gray-500"},qb={class:"font-bold"},Xb={class:"font-bold"},Yb={class:"flex gap-3"},Ub={},Mu=n.defineComponent({...Ub,__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]},showProductInfoButton:{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:i}){var O;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.ref(A.cloneDeep(r.value)),a=n.ref({...r.validation}),c=z=>{var M;delete a.value[z],(M=s.value)==null||M.restoreValidation()};n.watch(()=>r.validation,z=>{a.value={...z},Object.values(z).some(R=>R==null?void 0:R.feedback)&&n.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.validate(A.noop).catch(A.noop)})},{deep:!0});const d=n.computed(()=>r.value.category),u=n.ref(null),f=n.ref(null),h=n.computed(()=>d.value.products??[]),m=n.computed(()=>h.value.map(z=>({label:z.name,value:z.id}))),p=(z,M,R)=>{const W=z!=null&&z>0,U=M!=null&&M>0;return!W&&!U?null:W&&U?`от ${z} ${R} до ${M} ${R}`:W?`от ${z} ${R}`:`до ${M} ${R}`},g=n.computed(()=>{var z,M;return p(r.settings.minWidth,(M=(z=u.value)==null?void 0:z.properties)==null?void 0:M.width,"мм")}),b=n.computed(()=>{var z,M;return p(r.settings.minLength,(M=(z=u.value)==null?void 0:z.properties)==null?void 0:M.length,"мм")}),y=n.ref(null),_=n.ref(!1),k=n.computed(()=>{var M;const z={marker:[We.serverValidation((M=a.value.marker)==null?void 0:M.feedback)]};return l.value.configuratorParams.items.forEach((R,W)=>{var U,G,X,j,q,le,de;z[`configuratorParams.items.${W}.width`]=[ae.required,ae.min(r.settings.minWidth),...(G=(U=u.value)==null?void 0:U.properties)!=null&&G.width?[ae.max(u.value.properties.width)]:[],ae.step(1),We.serverValidation((X=a.value[`items.${W}.width`])==null?void 0:X.feedback)],z[`configuratorParams.items.${W}.length`]=[ae.required,ae.min(r.settings.minLength),...(q=(j=u.value)==null?void 0:j.properties)!=null&&q.length?[ae.max(u.value.properties.length)]:[],ae.step(1),We.serverValidation((le=a.value[`items.${W}.length`])==null?void 0:le.feedback)],z[`configuratorParams.items.${W}.count`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((de=a.value[`items.${W}.count`])==null?void 0:de.feedback)]}),z}),x=n.ref(r.settings.canSetDopProdaga??!1),v=n.computed(()=>l.value.configuratorParams.items.some(z=>{var M,R;return!u.value||!z.width||z.width<r.settings.minWidth||z.width>(((M=u.value.properties)==null?void 0:M.width)??0)||z.length===0||z.length<r.settings.minLength||z.length>(((R=u.value.properties)==null?void 0:R.length)??0)||!z.count||z.count<1})),N=n.computed(()=>!u.value||v.value||l.value.configuratorParams.items.length===0),w=n.ref(null),T=z=>{if(!z){u.value=null,f.value=null,l.value.product=new H.ClientProduct,y.value=null;return}const M=h.value.find(R=>R.id===z);M&&(u.value=M,f.value=z,l.value.product=M,Z("product",l.value.product),l.value.configuratorParams.items.forEach(R=>{var W,U;(W=M.properties)!=null&&W.width&&R.width>M.properties.width&&(R.width=M.properties.width),(U=M.properties)!=null&&U.length&&R.length>M.properties.length&&(R.length=M.properties.length)}),$())};let C=!1;const $=()=>{C=!0,y.value=null,w.value=null,l.value.configuratorParams.calculationId="",l.value.quantity=0},E=async()=>{var z;if(!u.value||l.value.configuratorParams.items.length===0||v.value){$();return}(z=s.value)==null||z.validate(M=>{if(M){$();return}if(_.value=!0,!u.value||!d.value){$(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:l.value.configuratorParams.items},callback:R=>{R?(y.value=R,l.value.configuratorParams.calculationId=R.id,l.value.quantity=R.quantity,n.nextTick(()=>{Z("quantity",R.quantity)})):(l.value.configuratorParams.calculationId="",l.value.quantity=0,$()),Z("configuratorParams",l.value.configuratorParams),V(),_.value=!1}})}).catch(()=>{$(),_.value=!1})},V=()=>{var M;if(!((M=u.value)!=null&&M.costRub)||!y.value){w.value=null;return}const z=y.value.quantity*u.value.costRub;w.value=Math.round(z*100)/100},P=z=>{var R,W;const M=l.value.configuratorParams.items[z];u.value&&((R=u.value.properties)!=null&&R.width&&M.width>u.value.properties.width&&(M.width=u.value.properties.width),(W=u.value.properties)!=null&&W.length&&M.length>u.value.properties.length&&(M.length=u.value.properties.length)),Z("configuratorParams",l.value.configuratorParams),$()},I=()=>{l.value.configuratorParams.calculationId="",l.value.configuratorParams.items.push({width:0,length:0,count:1}),Z("configuratorParams",l.value.configuratorParams),$(),o("add-item",l.value.configuratorParams.items.length)},K=z=>{l.value.configuratorParams.items.splice(z,1),Z("configuratorParams",l.value.configuratorParams),$(),o("remove-item",z)},J=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!y.value){E();return}o("submit",l.value)}},Z=(z,M)=>{const R=new H.OrderItemBase(r.value);R[z]=M,o("update:value",R)};n.watch(()=>r.value,z=>{const M=A.cloneDeep(n.toRaw(z));(!M.configuratorParams.items||M.configuratorParams.items.length===0)&&(M.configuratorParams.items=[{width:0,length:0,count:1}]),l.value=M,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,f.value=null),C?C=!1:L()},{deep:!0});const L=()=>{const{calculationId:z}=l.value.configuratorParams,M=l.value.quantity??0;z&&M>0&&l.value.product&&!l.value.product.isNewRec()&&(y.value={id:z,quantity:M,sheets:[]},V())};return n.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),L()}),e({validate:(O=s.value)==null?void 0:O.validate,formReference:s}),(z,M)=>{const R=uo,W=Vu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:l.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var U;return[n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:f.value,"onUpdate:value":[M[0]||(M[0]=G=>f.value=G),T],options:m.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((U=u.value)==null?void 0:U.costRub)!=null?(n.openBlock(),n.createElementBlock("div",Fb,[n.createElementVNode("span",Vb,n.toDisplayString(u.value.code),1),n.createTextVNode(" — "+n.toDisplayString(u.value.costRub.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Mb,[u.value?(n.openBlock(),n.createElementBlock("div",Ib,[M[7]||(M[7]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",Ab,[g.value?(n.openBlock(),n.createElementBlock("div",Ob,"Ширина "+n.toDisplayString(g.value)+".",1)):n.createCommentVNode("",!0),b.value?(n.openBlock(),n.createElementBlock("div",zb,"Длина "+n.toDisplayString(b.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",Db,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.configuratorParams.items,(G,X)=>(n.openBlock(),n.createElementBlock("div",{key:X,class:"flex grow gap-2"},[n.createElementVNode("div",Lb,[n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.items.${X}.width`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:l.value.configuratorParams.items[X].width,"onUpdate:value":[j=>l.value.configuratorParams.items[X].width=j,j=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:M[1]||(M[1]=j=>n.unref(lt)(j)),onInput:j=>c(`items.${X}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.items.${X}.length`,label:"Длина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:l.value.configuratorParams.items[X].length,"onUpdate:value":[j=>l.value.configuratorParams.items[X].length=j,j=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:M[2]||(M[2]=j=>n.unref(lt)(j)),onInput:j=>c(`items.${X}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.items.${X}.count`,label:"Количество, шт"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:l.value.configuratorParams.items[X].count,"onUpdate:value":[j=>l.value.configuratorParams.items[X].count=j,j=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:M[3]||(M[3]=j=>n.unref(lt)(j,!1)),onInput:j=>c(`items.${X}.count`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(F.NButton),{disabled:!u.value||l.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:j=>K(X)},{default:n.withCtx(()=>[n.createVNode(R)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:1,disabled:v.value,type:"default",class:"self-center",onClick:I},{default:n.withCtx(()=>[n.createVNode(W),M[8]||(M[8]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0)]),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка распила"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:l.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:M[4]||(M[4]=G=>c("marker")),"onUpdate:value":M[5]||(M[5]=G=>Z("marker",G??null)),onFocus:n.unref(He)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(n.openBlock(),n.createBlock(n.unref(F.NCheckbox),{key:1,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":M[6]||(M[6]=G=>{l.value.isAdditionalSale=G??!1,Z("isAdditionalSale",G??!1)})},{default:n.withCtx(()=>[...M[9]||(M[9]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(n.unref(F.NSpin),{show:_.value,size:"small",class:"grow"},{default:n.withCtx(()=>{var G;return[y.value&&u.value&&w.value?(n.openBlock(),n.createElementBlock("div",Hb,[n.createElementVNode("div",null,[M[10]||(M[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",Wb,n.toDisplayString(w.value.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(n.openBlock(),n.createElementBlock("div",jb,[n.createElementVNode("span",qb,"("+n.toDisplayString(y.value.quantity)+" шт.",1),M[11]||(M[11]=n.createTextVNode(" x ",-1)),n.createElementVNode("span",Xb,n.toDisplayString((G=u.value.costRub)==null?void 0:G.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]}),_:1},8,["show"]),n.createElementVNode("div",Yb,[y.value&&!_.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,loading:t.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:J},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:E},{default:n.withCtx(()=>[...M[12]||(M[12]=[n.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[n.unref(ti),J]])}}}),Kb={class:"flex flex-col gap-2"},Gb={class:"w-104 flex grow flex-col px-5"},Zb={},Iu=n.defineComponent({...Zb,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.useTemplateRef("sandwich-configurator-form"),s=n.ref(i.cartItem),l=n.ref({width:{},length:{},quantity:{},marker:{},product:{}}),a=n.ref(!1),c=async()=>{var f,h;(h=(f=o.value)==null?void 0:f.formReference)==null||h.validate(m=>{if(!m){a.value=!0;const p=A.cloneDeep(s.value);"items"in p.configuratorParams&&delete p.configuratorParams.items,r("submit",p,l.value,()=>{a.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})})}}).catch(A.noop)},d=f=>{l.value[`items.${f}.width`]={},l.value[`items.${f}.length`]={},l.value[`items.${f}.count`]={}},u=f=>{delete l.value[`items.${f}.width`],delete l.value[`items.${f}.length`],delete l.value[`items.${f}.count`]};return n.onMounted(()=>{i.cartItem.configuratorParams.items.forEach((f,h)=>{l.value[`items.${h}.width`]={},l.value[`items.${h}.length`]={},l.value[`items.${h}.count`]={}})}),n.watch(()=>i.cartItem,f=>{s.value=new H.OrderItemBase(f)},{deep:!0}),(f,h)=>{const m=F.NButton;return n.openBlock(),n.createElementBlock("div",Kb,[t.settings.allowShowTable&&s.value.isNewRec()?(n.openBlock(),n.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:h[0]||(h[0]=p=>r("click:view-switch"))},{default:n.withCtx(()=>[...h[2]||(h[2]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Gb,[n.createVNode(Mu,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":h[1]||(h[1]=p=>s.value=p),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":a.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),Qb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jb(t,e){return n.openBlock(),n.createElementBlock("svg",Qb,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const e_=n.markRaw({name:"ion-checkmark",render:Jb}),t_={key:0,class:"-mt-1 text-sm text-gray-500"},n_={class:"font-bold"},i_={class:"flex flex-col gap-3"},r_={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},o_={class:"flex flex-col gap-1 text-sm text-gray-700"},s_={key:0},l_={key:1},a_={"form-array-name":"items",class:"flex flex-col gap-3"},c_={class:"min-w-0 flex-1"},d_={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},u_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},f_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},h_={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},m_={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},p_={key:0,class:"lg:!flex-[2]"},g_={class:"font-bold"},y_={key:1,class:"lg:!flex-[3]"},b_={class:"font-bold"},__={key:1,class:"min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2"},w_={key:0},x_={class:"font-bold"},k_={key:1},C_={class:"font-bold"},v_={class:"flex flex-wrap items-center gap-3"},S_={},Au=n.defineComponent({...S_,__name:"sandwich-m2-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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},itemStates:{default:()=>[]}},emits:["submit","update:value","add-item","remove-item","item-reset"],setup(t,{expose:e,emit:i}){var G;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.useTemplateRef("widthInputs"),a=r.value==null?[]:A.cloneDeep(n.toRaw(r.value)),c=n.ref(a.map(X=>new H.OrderItemBase(X))),d=n.computed(()=>({items:c.value})),u=n.ref({...r.validation}),f=X=>{var j;delete u.value[X],(j=s.value)==null||j.restoreValidation()},h=n.ref(null),m=n.ref(null),p=n.computed(()=>{var X,j;return((j=(X=c.value[0])==null?void 0:X.category)==null?void 0:j.products)??[]}),g=n.computed(()=>p.value.map(X=>({label:X.name,value:X.id}))),b=(X,j,q)=>{const le=X!=null&&X>0,de=j!=null&&j>0;return!le&&!de?null:le&&de?`от ${X} ${q} до ${j} ${q}`:le?`от ${X} ${q}`:`до ${j} ${q}`},y=n.computed(()=>{var X,j;return b(r.settings.minWidth,(j=(X=h.value)==null?void 0:X.properties)==null?void 0:j.width,"мм")}),_=n.computed(()=>{var X,j;return b(r.settings.minLength,(j=(X=h.value)==null?void 0:X.properties)==null?void 0:j.length,"мм")}),k=n.computed(()=>{const X={};return c.value.forEach((j,q)=>{var le,de,ve,st,_e,we,xt,Ee;X[`items.${q}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(de=(le=h.value)==null?void 0:le.properties)!=null&&de.width?[ae.max(h.value.properties.width)]:[],ae.step(1),We.serverValidation((ve=u.value[`items.${q}.width`])==null?void 0:ve.feedback)],X[`items.${q}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(_e=(st=h.value)==null?void 0:st.properties)!=null&&_e.length?[ae.max(h.value.properties.length)]:[],ae.step(1),We.serverValidation((we=u.value[`items.${q}.length`])==null?void 0:we.feedback)],X[`items.${q}.quantity`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((xt=u.value[`items.${q}.quantity`])==null?void 0:xt.feedback)],X[`items.${q}.marker`]=[We.serverValidation((Ee=u.value[`items.${q}.marker`])==null?void 0:Ee.feedback)]}),X});n.watch(()=>r.validation,X=>{u.value={...X},Object.values(X).some(q=>q==null?void 0:q.feedback)&&n.nextTick(()=>{var q;return(q=s.value)==null?void 0:q.validate(A.noop).catch(A.noop)})},{deep:!0});const x=n.ref(r.settings.canSetDopProdaga??!1),v=n.computed(()=>{const X=h.value;return X?c.value.some(j=>{var ve,st;const q=j.configuratorParams,le=(ve=X.properties)==null?void 0:ve.width,de=(st=X.properties)==null?void 0:st.length;return q.width===0||q.width<r.settings.minWidth||le!=null&&q.width>le||q.length===0||q.length<r.settings.minLength||de!=null&&q.length>de||j.quantity===0||j.quantity<1}):!0}),N=n.computed(()=>!h.value||v.value||c.value.length===0),w=n.computed(()=>{const X=c.value[0];return X!=null&&!X.isNewRec()}),T=X=>r.itemStates[X]??"idle",C=X=>T(X)==="success",$=X=>T(X)==="loading",E=n.computed(()=>c.value.length===0?!0:c.value.every((X,j)=>{const q=T(j);return q==="success"||q==="loading"})),V=X=>X.width===0||X.length===0?0:X.width*X.length/1e6,P=X=>V(X).toLocaleString(void 0,{maximumFractionDigits:4}),I=X=>{var ve;const j=X.configuratorParams,q=V(j),le=((ve=h.value)==null?void 0:ve.costRub)??0,de=X.quantity??0;return!q||!de?0:Math.round(q*le*de*100)/100},K=n.computed(()=>A.sum(c.value.map(X=>{const j=X.configuratorParams;return!j.width||j.length===0||!X.quantity?0:j.width*j.length*X.quantity/1e6}))),J=n.computed(()=>Math.round(A.sum(c.value.map(X=>I(X)))*100)/100),Z=()=>{var X,j,q;return new H.OrderItemBase({category:(X=c.value[0])==null?void 0:X.category,configurator:(j=c.value[0])==null?void 0:j.configurator,product:h.value??new H.ClientProduct,quantity:1,isAdditionalSale:(q=c.value[0])==null?void 0:q.isAdditionalSale,configuratorParams:{width:0,length:0}})},L=X=>{if(!X){h.value=null,m.value=null,c.value.forEach(q=>{q.product=new H.ClientProduct}),o("update:value",c.value);return}const j=p.value.find(q=>q.id===X);j&&(h.value=j,m.value=X,c.value.forEach((q,le)=>{var de,ve;q.product=j,(de=j.properties)!=null&&de.width&&q.configuratorParams.width>j.properties.width&&(q.configuratorParams.width=j.properties.width),(ve=j.properties)!=null&&ve.length&&q.configuratorParams.length>j.properties.length&&(q.configuratorParams.length=j.properties.length),o("item-reset",le)}),o("update:value",c.value))},O=X=>{var le,de;const j=c.value[X],q=h.value;q&&((le=q.properties)!=null&&le.width&&j.configuratorParams.width>q.properties.width&&(j.configuratorParams.width=q.properties.width),(de=q.properties)!=null&&de.length&&j.configuratorParams.length>q.properties.length&&(j.configuratorParams.length=q.properties.length)),o("item-reset",X),o("update:value",c.value)},z=(X,j)=>{c.value[X].marker=j===null||j===""?void 0:j,o("item-reset",X),o("update:value",c.value)},M=X=>{c.value.forEach(j=>{j.isAdditionalSale=X}),o("update:value",c.value)},R=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),n.nextTick(()=>{var j,q,le,de;const X=c.value.length-1;(q=(j=l.value)==null?void 0:j[X])==null||q.focus(),(de=(le=l.value)==null?void 0:le[X])==null||de.select()})},W=X=>{c.value.splice(X,1),o("update:value",c.value),o("remove-item",X)};n.watch(()=>r.value,X=>{var de;const q=(X==null?[]:A.cloneDeep(n.toRaw(X))).map(ve=>new H.OrderItemBase(ve));c.value=q.length>0?q:[Z()];const le=(de=c.value[0])==null?void 0:de.product;le&&!le.isNewRec()?(h.value=le,m.value=le.id):(h.value=null,m.value=null)},{deep:!0});const U=()=>{var j;if(h.value!==null)return;const X=(j=p.value[0])==null?void 0:j.id;X!=null&&L(X)};return n.watch(p,()=>{U()}),n.onMounted(()=>{var j;c.value.length===0&&(c.value=[Z()]);const X=(j=c.value[0])==null?void 0:j.product;X&&!X.isNewRec()&&(h.value=X,m.value=X.id),U()}),e({validate:(G=s.value)==null?void 0:G.validate,formReference:s}),(X,j)=>{const q=e_,le=uo,de=Vu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:d.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var ve,st;return[n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:m.value,"onUpdate:value":[j[0]||(j[0]=_e=>m.value=_e),L],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=h.value)==null?void 0:ve.costRub)!=null?(n.openBlock(),n.createElementBlock("div",t_,[n.createElementVNode("span",n_,n.toDisplayString(h.value.code),1),n.createTextVNode(" — "+n.toDisplayString(h.value.costRub.toLocaleString())+" "+n.toDisplayString(h.value.currency.symbol)+"/м² ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",i_,[h.value?(n.openBlock(),n.createElementBlock("div",r_,[j[6]||(j[6]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",o_,[y.value?(n.openBlock(),n.createElementBlock("div",s_,"Ширина "+n.toDisplayString(y.value)+".",1)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock("div",l_,"Длина "+n.toDisplayString(_.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",a_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value.items,(_e,we)=>{var xt;return n.openBlock(),n.createElementBlock("div",{key:we,class:n.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",C(we)?"opacity-70":""])},[n.createElementVNode("div",c_,[n.createElementVNode("div",d_,[n.createElementVNode("div",u_,[n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[we].configuratorParams.width,"onUpdate:value":[Ee=>d.value.items[we].configuratorParams.width=Ee,Ee=>O(we)],parse:n.unref(ct),"show-button":!1,disabled:!h.value||C(we)||$(we),placeholder:"Ширина",class:"w-full",onKeydown:j[1]||(j[1]=Ee=>n.unref(lt)(Ee)),onInput:Ee=>f(`items.${we}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:d.value.items[we].configuratorParams.length,"onUpdate:value":[Ee=>d.value.items[we].configuratorParams.length=Ee,Ee=>O(we)],parse:n.unref(ct),"show-button":!1,disabled:!h.value||C(we)||$(we),placeholder:"Длина",class:"w-full",onKeydown:j[2]||(j[2]=Ee=>n.unref(lt)(Ee)),onInput:Ee=>f(`items.${we}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createElementVNode("div",f_,[n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:d.value.items[we].quantity,"onUpdate:value":[Ee=>d.value.items[we].quantity=Ee,Ee=>O(we)],parse:n.unref(ct),"show-button":!1,disabled:!h.value||C(we)||$(we),placeholder:"Кол-во",class:"w-full",onKeydown:j[3]||(j[3]=Ee=>n.unref(lt)(Ee,!1)),onInput:Ee=>f(`items.${we}.quantity`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.marker`,label:"Маркировка",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:d.value.items[we].marker??null,disabled:!h.value||C(we)||$(we),placeholder:"Маркировка",class:"w-full",onInput:Ee=>f(`items.${we}.marker`),"onUpdate:value":Ee=>z(we,Ee??null),onFocus:n.unref(He)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),$(we)||C(we)?(n.openBlock(),n.createElementBlock("div",h_,[$(we)?(n.openBlock(),n.createBlock(n.unref(F.NSpin),{key:0,size:14})):C(we)?(n.openBlock(),n.createBlock(q,{key:1,class:"text-green-600 text-xl"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),n.createElementVNode("div",m_,[_e.configuratorParams.width>0&&_e.configuratorParams.length>0?(n.openBlock(),n.createElementBlock("div",p_,[j[7]||(j[7]=n.createTextVNode(" Площадь (S) = ",-1)),n.createElementVNode("span",g_,n.toDisplayString(P(_e.configuratorParams))+" м²",1)])):n.createCommentVNode("",!0),I(_e)>0?(n.openBlock(),n.createElementBlock("div",y_,[j[8]||(j[8]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",b_,n.toDisplayString(I(_e).toLocaleString())+" "+n.toDisplayString((xt=h.value)==null?void 0:xt.currency.symbol),1)])):n.createCommentVNode("",!0)])]),w.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,disabled:$(we)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:Ee=>W(we)},{default:n.withCtx(()=>[n.createVNode(le)]),_:1},8,["disabled","onClick"]))],2)}),128))]),h.value?(n.openBlock(),n.createElementBlock("div",__,[K.value>0?(n.openBlock(),n.createElementBlock("div",w_,[j[9]||(j[9]=n.createTextVNode(" Общая площадь: ",-1)),n.createElementVNode("span",x_,n.toDisplayString(K.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):n.createCommentVNode("",!0),J.value>0?(n.openBlock(),n.createElementBlock("div",k_,[j[10]||(j[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",C_,n.toDisplayString(J.value.toLocaleString())+" "+n.toDisplayString(h.value.currency.symbol),1)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),x.value?(n.openBlock(),n.createBlock(n.unref(F.NCheckbox),{key:1,checked:((st=c.value[0])==null?void 0:st.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":j[4]||(j[4]=_e=>M(_e??!1))},{default:n.withCtx(()=>[...j[11]||(j[11]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createElementVNode("div",v_,[h.value&&!w.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,disabled:v.value,type:"default",onClick:R},{default:n.withCtx(()=>[n.createVNode(de),j[12]||(j[12]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:N.value||E.value,type:"primary",class:"ml-auto",onClick:j[5]||(j[5]=_e=>o("submit",c.value))},{default:n.withCtx(()=>{var _e;return[n.createTextVNode(n.toDisplayString((_e=c.value[0])!=null&&_e.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",c.value)]])}}}),B_={class:"flex flex-col gap-2"},N_={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},T_={},Ou=n.defineComponent({...T_,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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:["click:view-switch","submit"],setup(t,{emit:e}){const i=t,r=e,o=n.useTemplateRef("sandwich-m2-configurator-form"),s=n.ref((i.cartItems??[]).map(k=>new H.OrderItemBase(k))),l=n.ref([]),a=n.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=k=>{c.forEach(x=>{a.value[`items.${k}.${x}`]={}})},u=k=>{c.forEach(x=>{delete a.value[`items.${k}.${x}`]})},f=n.computed(()=>l.value.includes("loading")),h=()=>({width:{},length:{},quantity:{},marker:{}}),m=(k,x)=>{let v=!1;return c.forEach(N=>{var V,P;const w=`items.0.${N}`,T=(V=k[N])==null?void 0:V.feedback,$=((P=k[w])==null?void 0:P.feedback)??T,E=`items.${x}.${N}`;$?(a.value[E]=k[w]??k[N],v=!0):a.value[E]={}}),v},p=(k,x,v)=>new Promise(N=>{const w=h();let T=!1;const C=$=>{if(T)return;T=!0;const E=m(w,x),V=($===void 0?!E:$)&&!E;l.value[x]=V?"success":"error",n.nextTick(()=>{var P,I;(I=(P=o.value)==null?void 0:P.formReference)==null||I.restoreValidation()}),N(V)};l.value[x]="loading",r("submit",[A.cloneDeep(k)],w,C,{isFinalSuccessfulCompletion:v})}),g=async()=>{var v,N;try{await((N=(v=o.value)==null?void 0:v.formReference)==null?void 0:N.validate())}catch{return}const k=s.value.map((w,T)=>T).filter(w=>{const T=l.value[w]??"idle";return T!=="success"&&T!=="loading"});let x=!0;for(let w=0;w<k.length;w+=1){const T=k[w],C=s.value[T];if(!C)break;const E=w===k.length-1&&x;await p(C,T,E)||(x=!1)}},b=k=>{const x=k-1;l.value[x]="idle",d(x)},y=k=>{l.value.splice(k,1),u(k);for(let x=k;x<s.value.length;x+=1)d(x)},_=k=>{const x=l.value[k];(x==="success"||x==="error")&&(l.value[k]="idle")};return n.onMounted(()=>{(i.cartItems??[]).forEach((k,x)=>{l.value[x]="idle",d(x)})}),n.watch(()=>i.cartItems,k=>{const x=(k??[]).map(v=>new H.OrderItemBase(v));s.value=x,l.value=x.map(()=>"idle"),x.forEach((v,N)=>{d(N)})},{deep:!0}),(k,x)=>{var N;const v=F.NButton;return n.openBlock(),n.createElementBlock("div",B_,[t.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(n.openBlock(),n.createBlock(v,{key:0,type:"tertiary",class:"self-center",onClick:x[0]||(x[0]=w=>r("click:view-switch"))},{default:n.withCtx(()=>[...x[2]||(x[2]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",N_,[n.createVNode(Au,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":x[1]||(x[1]=w=>s.value=w),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":f.value,"item-states":l.value,onSubmit:g,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),$_={key:0,class:"flex justify-center p-4"},E_={key:1,class:"p-4 text-center text-red-500"},R_={key:2,class:"flex justify-center"},P_={class:"!bg-white p-4 m-2 rounded-md w-max"},F_={key:3,class:"p-4 text-center text-gray-500"},V_={},zu=n.defineComponent({...V_,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(t){const e=t,i=n.ref(!1),r=n.ref(null),o=n.ref(e.cartItem??null),s=n.ref(e.cartItems??null),l=h=>{const m=h.configuratorParams;return[new H.OrderItemBase({...h,quantity:h.quantity??1,marker:h.marker,configuratorParams:{width:(m==null?void 0:m.width)??h.width??0,length:(m==null?void 0:m.length)??h.length??0}})]},a=n.ref(e.editor===H.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?l(e.cartItem):null),c=()=>{var m,p,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const h={category:((m=e.cartItem)==null?void 0:m.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const b=e.settings;o.value=new H.OrderItemBase({...h,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:A.some(b.startTailConfigs,y=>y.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(y=>y.isDefault):void 0,endTailType:A.some(b.endTailConfigs,y=>y.isDefault)?(g=b.endTailConfigs)==null?void 0:g.findIndex(y=>y.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=e.settings;o.value=new H.OrderItemBase({...h,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{const b=e.settings;s.value=[new H.OrderItemBase({...h,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new H.OrderItemBase({...h,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new H.OrderItemBase({...h,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{a.value=[new H.OrderItemBase({...h,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(h,m,p)=>{const g=b=>{p==null||p(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:h,callback:g,validation:m})},u=(h,m,p,g)=>{const b=h[0];if(!b){p==null||p();return}const y=(g==null?void 0:g.isFinalSuccessfulCompletion)===!0,_=k=>{p==null||p(k),y&&k&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:b,callback:_,validation:m,additionalParams:g})},f=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return n.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(h,m)=>{const p=F.NSpin;return n.openBlock(),n.createElementBlock(n.Fragment,null,[i.value?(n.openBlock(),n.createElementBlock("div",$_,[n.createVNode(p,{size:"large"})])):r.value?(n.openBlock(),n.createElementBlock("div",E_,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0),t.settings!==null&&(o.value!==null||s.value!==null||a.value!==null)?(n.openBlock(),n.createElementBlock("div",R_,[n.createElementVNode("div",P_,[t.editor==="kozyrek"?(n.openBlock(),n.createBlock(vu,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(n.openBlock(),n.createBlock(Nu,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(n.openBlock(),n.createBlock(Ru,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":s.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(n.openBlock(),n.createBlock(Fu,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(n.openBlock(),n.createBlock(Iu,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(n.openBlock(),n.createBlock(Ou,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":a.value,"onClick:viewSwitch":f,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):n.createCommentVNode("",!0)])])):(n.openBlock(),n.createElementBlock("div",F_,' Конфигуратор "'+n.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function Du(t){return Object.values(H.ConfiguratorsEnum).includes(t)}function Lu(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==H.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&A.isArray(t.products)&&t.products.length>0}const M_={key:0,class:"pt-0.5"},I_={key:0},A_={class:"line-through"},O_={key:0},z_={key:1},D_={class:"flex flex-row gap-1"},L_={key:0},H_={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},W_={class:"flex flex-col gap-2.5 sm:flex-row"},j_={key:0,class:"header-extra"},q_={class:"mt-2"},X_={key:1,class:"flex flex-col"},Y_={},U_=n.defineComponent({...Y_,__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},showProductInfoButton:{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,i=n.inject(Sr,"medium"),r=n.computed(()=>{var U;return(U=e==null?void 0:e.filteredItems)==null?void 0:U[e.categoryItem.id]}),o=n.computed(()=>{var U,G;return A.isArray((U=e.categoryItem)==null?void 0:U.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),s=n.computed(()=>{var U;return A.isArray((U=e.categoryItem)==null?void 0:U.products)?e.categoryItem.products:[]}),l=n.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([U,G])=>`${G} руб./${E(U)}`).join(", ")),a=n.computed(()=>A.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(U=>{var X;const G=(X=r.value)==null?void 0:X.products;return A.isArray(G)&&G.includes(U.id)})),c=n.computed(()=>a.value.length>0),d=n.computed(()=>A.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=n.computed(()=>A.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),f=n.computed(()=>A.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),h=n.computed(()=>A.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=n.computed(()=>{var U,G,X;return((U=e.categoryItem.properties)==null?void 0:U.configurator)!==void 0&&Du((G=e.categoryItem.properties)==null?void 0:G.configurator)&&Lu(e.categoryItem)&&((X=e.categoryItem.properties)==null?void 0:X.configuratorSettings)!==void 0&&(A.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),p=n.computed(()=>m.value&&(A.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),g=n.computed(()=>A.isNil(e.categoryContextButtonsConfig)?[]:A.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=n.computed(()=>new H.ClientCategory(e.categoryItem)),y=n.ref(!1),_=n.ref(!1),k=n.computed(()=>!A.isUndefined(e.isCategoryItemSelected)),x=n.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),v=n.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),N=n.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=n.computed(()=>M.value&&Ye.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),T=n.useTemplateRef("collapse-item-reference"),C=n.computed(()=>{var U,G;return(G=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:G.priceCoefficient}),$=n.computed(()=>{var U,G;return(G=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:G.increasePercent}),E=(U,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:U,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),V=U=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:U,target:T.value})},P=(U,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:y,target:T.value})},I=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:T.value})},K=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:T.value})},J=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:T.value})},Z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:T.value})},L=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:T.value})},O=U=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:U,target:T.value})},z=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},M=n.ref(0),R=n.computed(()=>M.value&&s.value.length>0?Dg(s.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,showProductInfoButton:e.showProductInfoButton,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),W=A.debounce(()=>{M.value=window.innerWidth},20);return n.onUnmounted(()=>{window.removeEventListener("resize",W)}),window.addEventListener("resize",W),W(),(U,G)=>{const X=F.NCheckbox,j=ep,q=F.NTooltip,le=Zm,de=F.NTag,ve=Um,st=qm,_e=F.NButton,we=Hm,xt=Xa,Ee=qa,Zt=ja,gn=Bs,Rt=F.NDropdown,Jn=F.NDataTable,yn=F.NAlert,ln=F.NSpin;return n.openBlock(),n.createBlock(Ya,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":n.withCtx(()=>{var Me,te;return[k.value?(n.openBlock(),n.createElementBlock("div",M_,[n.createVNode(X,{checked:x.value,indeterminate:N.value,disabled:v.value,"onUpdate:checked":V},null,8,["checked","indeterminate","disabled"])])):n.createCommentVNode("",!0),!d.value&&((Me=b.value)!=null&&Me.isDisabled)?(n.openBlock(),n.createBlock(q,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(j,{class:"pt-1.5"})]),default:n.withCtx(()=>[G[1]||(G[1]=n.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):n.createCommentVNode("",!0),((te=b.value)==null?void 0:te.isFavorite)??!1?(n.openBlock(),n.createBlock(q,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(le,{class:"pt-1.5"})]),default:n.withCtx(()=>[G[2]||(G[2]=n.createTextVNode(" Избранная категория ",-1))]),_:1})):n.createCommentVNode("",!0)]}),header:n.withCtx(()=>{var Me,te,ce,Ie,mi;return[n.createElementVNode("div",{class:n.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Me=b.value)==null?void 0:Me.isDisabled})},[n.createVNode(q,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(t.categoryItem.name),1)]),default:n.withCtx(()=>[G[3]||(G[3]=n.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),n.createElementVNode("div",{class:"w-fit",onClick:G[0]||(G[0]=n.withModifiers((...at)=>n.unref(A.noop)&&n.unref(A.noop)(...at),["prevent","stop"]))},[(te=t.categoryItem.properties)!=null&&te.m2Price?(n.openBlock(),n.createBlock(de,{key:0,size:n.unref(i),class:n.normalizeClass({"!pr-0":((ce=t.categoryItem.properties)==null?void 0:ce.templateCost)&&t.categoryItem.properties.m2PriceRetail&&$.value}),round:""},{default:n.withCtx(()=>{var at;return[n.createTextVNode(" Установленная стоимость: "+n.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(at=t.categoryItem.properties)!=null&&at.templateCost&&t.categoryItem.properties.m2PriceRetail&&$.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[$.value?(n.openBlock(),n.createBlock(de,{key:0,type:"success",bordered:!1,size:n.unref(i),class:"ml-2 !pr-0",round:""},{default:n.withCtx(()=>[$.value?(n.openBlock(),n.createElementBlock("span",I_,n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0),n.createVNode(de,{size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createElementVNode("span",A_,n.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Ie=t.categoryItem.properties)!=null&&Ie.templateCost?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[C.value||$.value?(n.openBlock(),n.createBlock(de,{key:0,size:n.unref(i),round:""},{default:n.withCtx(()=>{var at;return[C.value?(n.openBlock(),n.createElementBlock("span",O_,n.toDisplayString((at=C.value)==null?void 0:at.name),1)):n.createCommentVNode("",!0),$.value?(n.openBlock(),n.createElementBlock("span",z_,n.toDisplayString($.value>0?"+":"")+n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0)]}),_:1},8,["size"])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),l.value?(n.openBlock(),n.createBlock(de,{key:2,size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createTextVNode(" Фиксированный курс: "+n.toDisplayString(l.value),1)]),_:1},8,["size"])):n.createCommentVNode("",!0),u.value&&((mi=b.value)!=null&&mi.manager)?(n.openBlock(),n.createBlock(de,{key:3,size:n.unref(i),closable:!0,round:"",class:"align-bottom",onClose:Z},{default:n.withCtx(()=>[n.createVNode(q,{placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>{var at,Qt;return[n.createElementVNode("span",D_,[n.createVNode(ve),n.createTextVNode(" "+n.toDisplayString((Qt=(at=b.value)==null?void 0:at.manager)==null?void 0:Qt.name),1)])]}),default:n.withCtx(()=>{var at,Qt;return[n.createTextVNode(' Категория закреплена за "'+n.toDisplayString((Qt=(at=b.value)==null?void 0:at.manager)==null?void 0:Qt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):n.createCommentVNode("",!0)])]}),"sub-header":n.withCtx(()=>[t.showSlugs||t.showProperties?(n.openBlock(),n.createElementBlock("div",L_,[n.createElementVNode("ul",H_,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Me,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Me),1))),128)):n.createCommentVNode("",!0),t.showProperties?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(t.categoryItem.properties,(Me,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Me),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),"header-extra":n.withCtx(()=>{var Me;return[n.createElementVNode("div",W_,[U.$slots["header-extra"]?(n.openBlock(),n.createElementBlock("div",j_,[n.renderSlot(U.$slots,"header-extra",{categoryItem:t.categoryItem},void 0,!0)])):n.createCommentVNode("",!0),d.value?(n.openBlock(),n.createBlock(q,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),onClick:I},{default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isDisabled?(n.openBlock(),n.createBlock(j,{key:1})):(n.openBlock(),n.createBlock(st,{key:0}))]}),_:1},8,["size"])]),default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isDisabled?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(" Скрыто для клиента"+n.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode("Видимо клиенту")],64))]}),_:1})):n.createCommentVNode("",!0),u.value&&!((Me=b.value)!=null&&Me.manager)?(n.openBlock(),n.createBlock(q,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),onClick:J},{default:n.withCtx(()=>[n.createVNode(we)]),_:1},8,["size"])]),default:n.withCtx(()=>{var te,ce,Ie;return[(te=b.value)!=null&&te.manager?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode('Категория закреплена за "'+n.toDisplayString(((Ie=(ce=b.value)==null?void 0:ce.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Закрепить")],64))]}),_:1})):n.createCommentVNode("",!0),f.value?(n.openBlock(),n.createBlock(q,{key:3,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,disabled:f.value==="disabled",size:n.unref(i),onClick:K},{default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isRequired?(n.openBlock(),n.createBlock(Ee,{key:1})):(n.openBlock(),n.createBlock(xt,{key:0}))]}),_:1},8,["disabled","size"])]),default:n.withCtx(()=>[G[4]||(G[4]=n.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):n.createCommentVNode("",!0),h.value?(n.openBlock(),n.createBlock(q,{key:4,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),type:"primary",onClick:L},{default:n.withCtx(()=>[n.createVNode(Zt)]),_:1},8,["size"])]),default:n.withCtx(()=>[G[5]||(G[5]=n.createTextVNode(" Редактировать ",-1))]),_:1})):n.createCommentVNode("",!0),g.value.length>0?(n.openBlock(),n.createBlock(Rt,{key:5,options:g.value,size:n.unref(i),trigger:"click",onSelect:O},{default:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(gn)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)])]}),default:n.withCtx(()=>[n.renderSlot(U.$slots,"default",{},()=>{var Me,te,ce;return[n.createElementVNode("div",q_,[o.value?(n.openBlock(),n.createBlock(Wu,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Me=r.value)==null?void 0:Me.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-product-info-button":t.showProductInfoButton,"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},n.createSlots({_:2},[U.$slots["header-extra"]?{name:"header-extra",fn:n.withCtx(({categoryItem:Ie})=>[n.renderSlot(U.$slots,"header-extra",{categoryItem:Ie},void 0,!0)]),key:"0"}:void 0]),1032,["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-product-info-button","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"])):n.createCommentVNode("",!0)]),m.value&&p.value?(n.openBlock(),n.createBlock(zu,{key:0,"event-emitter":t.eventEmitter,settings:(te=t.categoryItem.properties)==null?void 0:te.configuratorSettings,editor:(ce=t.categoryItem.properties)==null?void 0:ce.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(n.openBlock(),n.createElementBlock("div",X_,[m.value?(n.openBlock(),n.createBlock(_e,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:z},{default:n.withCtx(()=>[...G[6]||(G[6]=[n.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Jn,{columns:R.value,data:a.value,bordered:!0,loading:y.value,remote:!0,"row-key":Ie=>Ie.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):n.createCommentVNode("",!0),!y.value&&!_.value&&!o.value&&!c.value?(n.openBlock(),n.createBlock(yn,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createBlock(yn,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):n.createCommentVNode("",!0),y.value?(n.openBlock(),n.createBlock(ln,{key:4,size:n.unref(i),class:"w-full"},{description:n.withCtx(()=>[...G[7]||(G[7]=[n.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):n.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),K_=wn(U_,[["__scopeId","data-v-fac0d674"]]),G_={class:"sc-collapse flex w-full flex-col"},Z_={},Hu=n.defineComponent({...Z_,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const i=t,r=e,o=(s,l)=>{r("on-item-header-click",s,l)};return n.provide("itemHeaderClickHandler",o),n.provide("defaultExpandedNames",i.defaultExpandedNames),n.provide("expandedNames",i.expandedNames),(s,l)=>(n.openBlock(),n.createElementBlock("div",G_,[n.renderSlot(s.$slots,"default")]))}}),Q_={},Wu=n.defineComponent({...Q_,__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},showProductInfoButton:{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,i=n.inject(Sr,"medium"),r=n.computed(()=>A.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var l;return!!((l=e.filteredItems)!=null&&l[s.id])})),o=(s,l)=>{if(A.isUndefined(l))return;const a=l[s.id];if(a==="*")return;const c={};return c[s.id]=structuredClone(n.toRaw(a)),c};return(s,l)=>{const a=F.NSpin,c=F.NAlert;return n.openBlock(),n.createElementBlock(n.Fragment,null,[r.value.length>0?(n.openBlock(),n.createBlock(Hu,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,d=>(n.openBlock(),n.createBlock(K_,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":o(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-product-info-button":t.showProductInfoButton,"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},n.createSlots({_:2},[s.$slots["header-extra"]?{name:"header-extra",fn:n.withCtx(({categoryItem:u})=>[n.renderSlot(s.$slots,"header-extra",{categoryItem:u})]),key:"0"}:void 0]),1032,["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-product-info-button","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))]),_:3})):t.loading?(n.openBlock(),n.createBlock(a,{key:1,size:n.unref(i),class:"w-full"},{description:n.withCtx(()=>[...l[0]||(l[0]=[n.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):n.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(n.openBlock(),n.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):n.createCommentVNode("",!0)],64)}}}),J_={},ju=n.defineComponent({...J_,__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,default:!1},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0},disabledItem:{type:Function,default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=new H.Reference,a=n.computed(()=>A.isNil(r.value)?s.value?[]:null:A.isArray(r.value)?r.value.filter(p=>!A.isNil(p)).map(p=>p.id):r.value.id),c=n.computed(()=>bt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=n.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=p=>{var g;if(A.isArray(p)){const b=p.length>0?p.map(y=>{var _;return(_=c.value.find(k=>k.value===y))==null?void 0:_.item}).filter(y=>!A.isNil(y)):[];o("update:value",b)}else{const b=p===l.id||A.isNil(p)||(g=c.value.find(y=>y.value===p))==null?void 0:g.item;o("update:value",b)}},f=n.useTemplateRef("select-component");return e({focus:()=>{var p;return(p=f.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=f.value)==null?void 0:p.blur()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:a.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:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":u},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),ew={},tw=n.defineComponent({...ew,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:["update:value"],setup(t,{emit:e}){var x,v;const i=t,r=e,o=()=>{const N=H.PriceCoefficient.getRetailPriceCoefficient();return A.unset(N,"isNewRec"),N},s=N=>!N||N.id===o().id,l=n.computed(()=>{var N;return((N=i.catalogItem)==null?void 0:N.type)==="product"}),a=n.computed(()=>l.value?i.catalogItem:void 0),c=N=>{var w,T,C,$;return N.id===o().id?(w=a.value)==null?void 0:w.getRetailCost():($=(C=(T=a.value)==null?void 0:T.priceCoefficients)==null?void 0:C.find(E=>E.coefficient.id===N.id))==null?void 0:$.cost},d=n.computed(()=>{var T;const w=[...((T=H.useReferencesStore().priceCoefficientsReference)==null?void 0:T.map(C=>structuredClone(n.toRaw(C))))??[],o()].filter(C=>{var $;return(($=i.visibleCoefficient)==null?void 0:$.call(i,C))??!0});return l.value&&w.forEach(C=>{var E;const $=c(C);$?C.name+=` (${$} ${(E=a.value)==null?void 0:E.currency.symbol})`:C.name=""}),w.filter(C=>C.name!=="")}),u=n.ref(i.value.coefficient),f=n.ref(((v=(x=i.value)==null?void 0:x.value)==null?void 0:v.toString())??null),h=n.ref(null),m=n.computed(()=>{var N,w;return(w=(N=a.value)==null?void 0:N.priceCoefficients)==null?void 0:w.find(T=>T.coefficient.slug===H.PriceCoefficientEnum.K0)}),p=n.ref(void 0),g=N=>Number.parseFloat((N??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),b=()=>{var w,T;p.value=void 0;let N=g(f.value);if(N=Number.isNaN(N)?void 0:N,l.value)if(u.value||f.value){const C=o(),$=c(u.value??C)??0,E=$+$*((N??0)/100);h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(E),E>(((w=a.value)==null?void 0:w.getRetailCost())??E)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&E<(((T=m.value)==null?void 0:T.cost)??0)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else h.value=null;r("update:value",{value:Number.isNaN(N)?void 0:N,coefficient:s(u.value)?void 0:structuredClone(n.toRaw(u.value))})},y=N=>{A.isArray(N)||A.isNull(N)||(u.value=N,f.value=null,!u.value&&f.value&&(u.value=o()),b())},_=()=>{u.value||(u.value=o()),b()},k=N=>{var T,C,$,E,V;const w=g(N);if(l.value){if(Number.isNaN(w)){u.value=void 0,f.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let P=0;if(w<=0)u.value=void 0,f.value=null;else if(m.value&&w<(((T=m.value)==null?void 0:T.cost)??0))u.value=(C=m.value)==null?void 0:C.coefficient,P=(w-m.value.cost)*100/m.value.cost,p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>((($=a.value)==null?void 0:$.getRetailCost())??w)){u.value=o();const I=((E=a.value)==null?void 0:E.getRetailCost())??0;P=(w-I)*100/I,p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const I=((V=a.value)==null?void 0:V.priceCoefficients)??[],K=A.sortBy(I,[L=>L.cost]),Z=K.filter(L=>L.cost<=w).at(-1)??K.at(0);Z&&(u.value=Z.coefficient,P=(w-Z.cost)*100/Z.cost),p.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(P),r("update:value",{value:Number.isNaN(P)?void 0:P,coefficient:s(u.value)?void 0:structuredClone(n.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:void 0})};return n.onMounted(()=>{var N,w,T,C;i.calculationType===H.CalculationTypeEnum.m2Cost?h.value=((w=(N=i.value)==null?void 0:N.value)==null?void 0:w.toString())??null:!((T=i.value)!=null&&T.coefficient)&&((C=i.value)!=null&&C.value)&&(u.value=o()),b()}),(N,w)=>{var $,E,V;const T=F.NInput,C=F.NInputGroup;return n.openBlock(),n.createBlock(n.unref(F.NFormItem),{"show-label":!n.unref(A.isNil)(t.label),label:t.label,"show-feedback":!n.unref(A.isNil)((($=p.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=p.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((V=p.value)==null?void 0:V.validationStatus)??t.validationStatus},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass([{"sm:grid-cols-3":l.value&&t.calculationType!==n.unref(H.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==n.unref(H.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(C,{key:0,class:n.normalizeClass(["w-full flex-row",{"sm:col-span-2":l.value}])},{default:n.withCtx(()=>[n.createVNode(ju,{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,"disabled-item":t.disabledCoefficient,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled","disabled-item"]),n.createVNode(T,{value:f.value,"onUpdate:value":[w[0]||(w[0]=P=>f.value=P),_],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},n.createSlots({suffix:n.withCtx(()=>[w[3]||(w[3]=n.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:n.withCtx(()=>[w[2]||(w[2]=n.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):n.createCommentVNode("",!0),l.value||t.calculationType===n.unref(H.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(T,{key:1,value:h.value,"onUpdate:value":[w[1]||(w[1]=P=>h.value=P),k],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},n.createSlots({_:2},[l.value?{name:"suffix",fn:n.withCtx(()=>{var P;return[n.createTextVNode(n.toDisplayString((P=a.value)==null?void 0:P.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):n.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),nw={class:"text-sm"},iw={class:"text-sm"},rw={},ow=n.defineComponent({...rw,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:i}){const r=n.useTemplateRef("form-reference"),o=n.useTemplateRef("base-dialog-reference"),s=n.ref(!1),l=n.ref(null),a=n.computed(()=>{var P,I,K;return((P=l.value)==null?void 0:P.unit.isLinear)&&((K=(I=l.value)==null?void 0:I.properties)==null?void 0:K.isLengthConfigurator)}),c=n.computed(()=>l.value?H.UnitsHelper.productIsMeasurable(l.value)||a.value?"шт.":l.value.unit.name:"шт."),d=n.ref(void 0),u=n.ref(void 0),f=n.ref(!0),h=n.ref(null),m=n.computed({get:()=>{var P;return((P=h.value)==null?void 0:P.quantity)??null},set:P=>{h.value&&(h.value.quantity=P??0)}}),p=n.computed({get:()=>{var P;return((P=h.value)==null?void 0:P.length)??null},set:P=>{h.value&&(h.value.length=P??void 0)}}),g=P=>{h.value&&(h.value.marker=P??void 0)},b=i,y=()=>({length:{},quantity:{},marker:{}}),_=n.ref(y()),k=n.ref(!1),x=n.computed(()=>{var Z,L,O,z;if(!l.value)return{};const P=H.UnitsHelper.getProductLengthMultiplicity(l.value),I=H.UnitsHelper.getProductMultiplicity(l.value),K=((L=(Z=l.value)==null?void 0:Z.properties)==null?void 0:L.minLength)||P,J=(z=(O=l.value)==null?void 0:O.properties)==null?void 0:z.maxLength;return{length:[ae.required,ae.min(K??.1),ae.max(J),ae.step(P),We.serverValidation(_.value.length.feedback)],quantity:[ae.required,ae.min(I),ae.step(I),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),v=n.computed(()=>{var P,I,K;return l.value?((P=l.value.properties)==null?void 0:P.lengthStep)??((I=l.value.properties)!=null&&I.ignoreMinCountCheck?0:((K=l.value.properties)==null?void 0:K.minCount)??0):0}),N=n.computed(()=>{var K,J,Z,L,O,z,M,R,W;if(!l.value)return"";const P=((J=(K=l.value)==null?void 0:K.properties)==null?void 0:J.minLength)??((L=(Z=l.value)==null?void 0:Z.properties)!=null&&L.ignoreMinCountCheck?0:(z=(O=l.value)==null?void 0:O.properties)==null?void 0:z.minCount),I=(R=(M=l.value)==null?void 0:M.properties)==null?void 0:R.maxLength;return P||I?`(${P?`от ${P}`:""}${P&&I?" ":""}${I?`до ${I}`:""} ${(W=l.value)==null?void 0:W.unit.name})`:""}),w=P=>{var L,O;if(!((O=(L=l.value)==null?void 0:L.properties)!=null&&O.isLengthConfigurator)||!h.value||A.isNil(P)||v.value===0)return;const I=P/v.value,K=Math.round(I),J=H.UnitsHelper.getProductMultiplicity(l.value),Z=Math.max(K,J);h.value.quantity=Z},T=P=>{var Z,L,O,z;if(!((L=(Z=l.value)==null?void 0:Z.properties)!=null&&L.isLengthConfigurator)||!h.value||A.isNil(P)||v.value===0)return;const I=P*v.value,K=((O=l.value.properties)==null?void 0:O.minLength)||H.UnitsHelper.getProductLengthMultiplicity(l.value),J=(z=l.value.properties)==null?void 0:z.maxLength;K!==void 0&&I<K?h.value.length=K:J!==void 0&&I>J?h.value.length=J:h.value.length=I},C=async P=>{var K;const I=A.cloneDeep(h.value);try{await((K=r.value)==null?void 0:K.validate(J=>{if(!J){if(!l.value||!I)return;H.UnitsHelper.productIsMeasurable(l.value)||delete I.length,a.value&&v.value&&(I.length=v.value),k.value=!0,b("submit",I,_.value,()=>{k.value=!1,P(!1),n.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(A.noop).catch(A.noop)})})}}))}catch{}},$=()=>{l.value=null,d.value=void 0,h.value=null,_.value=y()},E=()=>{s.value=!1};return e({show:(P,I)=>{var K,J,Z,L,O;if($(),s.value=!0,l.value=P,d.value=I==null?void 0:I.cartItemData,u.value=I==null?void 0:I.orderId,f.value=(I==null?void 0:I.canSetDopProdaga)??!1,h.value=new H.OrderItemBase((I==null?void 0:I.cartItemData)??new H.OrderItemBase({product:P,quantity:H.UnitsHelper.productIsMeasurable(l.value)?1:((K=P==null?void 0:P.properties)==null?void 0:K.minCount)??1,length:((J=P==null?void 0:P.properties)==null?void 0:J.minLength)||((Z=P==null?void 0:P.properties)!=null&&Z.ignoreMinCountCheck?0:(L=P==null?void 0:P.properties)==null?void 0:L.minCount)||0})),(O=P==null?void 0:P.properties)!=null&&O.isLengthConfigurator&&h.value&&v.value>0){const z=v.value,M=h.value.quantity||1;h.value.length=M*z}},closeDialog:E}),(P,I)=>{var O;const K=F.NFormItem,J=F.NInputGroupLabel,Z=F.NInputGroup,L=F.NCheckbox;return n.openBlock(),n.createBlock($s,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(O=l.value)==null?void 0:O.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:k.value,"modal-width":500,onAccept:C,onClosing:E},{default:n.withCtx(()=>[l.value&&h.value?n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{key:0,ref:"form-reference",model:h.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>[n.unref(H.UnitsHelper).productIsMeasurable(l.value)?(n.openBlock(),n.createBlock(K,{key:0,path:"length",label:`Метраж, ${N.value+l.value.unit.name}`},n.createSlots({default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:p.value,"onUpdate:value":[I[0]||(I[0]=z=>p.value=z),w],parse:n.unref(ct),step:n.unref(H.UnitsHelper).getProductLengthMultiplicity(l.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:I[1]||(I[1]=z=>n.unref(so)(z,".",!1)),onInput:I[2]||(I[2]=z=>n.unref(rt)(_.value,"length")),onFocus:n.unref(He)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&n.unref(H.UnitsHelper).getProductLengthMultiplicity(l.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",nw,"Метраж должно быть кратно "+n.toDisplayString(n.unref(H.UnitsHelper).getProductLengthMultiplicity(l.value)),1)]),key:"0"}:void 0]),1032,["label"])):n.createCommentVNode("",!0),n.createVNode(K,{path:"quantity",label:`Количество, ${c.value}`},{default:n.withCtx(()=>[n.createVNode(Z,null,n.createSlots({default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:m.value,"onUpdate:value":[I[3]||(I[3]=z=>m.value=z),T],parse:n.unref(ct),step:n.unref(H.UnitsHelper).getProductMultiplicity(l.value),"show-button":n.unref(H.UnitsHelper).getProductMultiplicity(l.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:I[4]||(I[4]=z=>n.unref(so)(z,".",!1)),onInput:I[5]||(I[5]=z=>n.unref(rt)(_.value,"quantity")),onFocus:n.unref(He)},null,8,["value","parse","step","show-button","onFocus"]),a.value?(n.openBlock(),n.createBlock(J,{key:0,class:"bg-orange-100 font-bold"},{default:n.withCtx(()=>[n.createTextVNode(" x "+n.toDisplayString(v.value)+" "+n.toDisplayString(l.value.unit.name),1)]),_:1})):n.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&n.unref(H.UnitsHelper).getProductMultiplicity(l.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",iw,"Количество должно быть кратно "+n.toDisplayString(n.unref(H.UnitsHelper).getProductMultiplicity(l.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),n.unref(H.UnitsHelper).productIsMeasurable(l.value)?(n.openBlock(),n.createBlock(K,{key:1,path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:I[6]||(I[6]=z=>n.unref(rt)(_.value,"marker")),"onUpdate:value":I[7]||(I[7]=z=>g(z)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1})):n.createCommentVNode("",!0),f.value?(n.openBlock(),n.createBlock(L,{key:2,checked:h.value.isAdditionalSale,"onUpdate:checked":I[8]||(I[8]=z=>h.value.isAdditionalSale=z),"true-value":!0,"false-value":!1},{default:n.withCtx(()=>[...I[9]||(I[9]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0)]),_:1},8,["model","rules"])),[[n.unref(ti),()=>{var z,M;return(M=(z=o.value)==null?void 0:z.acceptHandler)==null?void 0:M.call(z)}]]):n.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),sw={class:"flex flex-row gap-1"},lw={class:"sc-client-name flex flex-col gap-1 text-base"},aw=["href"],cw={key:1,class:"text-sc-grey"},dw={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},uw={key:0},fw={key:1,class:"text-sm"},hw={},Mr=n.defineComponent({...hw,__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 i=t,r=e,o=n.computed(()=>i.client.lastLoginAt?ke.format(i.client.lastLoginAt,H.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=l=>{A.isNil(i.nameLink)&&(l.preventDefault(),l.stopPropagation()),r("click:client-name",i.client,l)};return(l,a)=>{const c=lo,d=F.NButton,u=F.NPopover;return n.openBlock(),n.createElementBlock("div",sw,[t.showClientInfoIcon?(n.openBlock(),n.createBlock(d,{key:0,quaternary:"",size:"small",onClick:a[0]||(a[0]=f=>l.$emit("click:client-info",t.client))},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})):n.createCommentVNode("",!0),n.createVNode(u,{disabled:n.unref(A.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:n.withCtx(()=>[n.createElementVNode("div",lw,[n.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:a[1]||(a[1]=f=>s(f))},[n.createElementVNode("span",{class:n.normalizeClass({"line-through":!t.client.isActive})},n.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass({"line-through":!t.client.isActive})}," ("+n.toDisplayString(t.client.salesDirection.name)+") ",3)):n.createCommentVNode("",!0),t.client.isActive?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",cw," [ Деактивирован ] "))],8,aw),t.showCityAndRegion&&t.client.city?(n.openBlock(),n.createElementBlock("span",dw," г. "+n.toDisplayString(t.client.city.name)+", "+n.toDisplayString(t.client.city.region.name),1)):n.createCommentVNode("",!0)])]),default:n.withCtx(()=>[t.client.alternativeName?(n.openBlock(),n.createElementBlock("div",uw,n.toDisplayString(t.client.alternativeName),1)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("span",fw," Последний вход: "+n.toDisplayString(o.value),1)):n.createCommentVNode("",!0),n.renderSlot(l.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),mw={class:"text-base"},pw={},qu=n.defineComponent({...pw,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){const e=t,i=n.computed(()=>ni.getFormatEntityName(e.contragent));return(r,o)=>(n.openBlock(),n.createElementBlock("span",mw,n.toDisplayString(i.value),1))}}),gw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yw(t,e){return n.openBlock(),n.createElementBlock("svg",gw,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.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"}),n.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const bw=n.markRaw({name:"tabler-mail",render:yw}),_w=["href"],ww={},xw=n.defineComponent({...ww,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,i)=>{const r=bw;return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(n.openBlock(),n.createBlock(r,{key:0})):n.createCommentVNode("",!0),n.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},n.toDisplayString(t.email),9,_w)],2)}}}),kw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cw(t,e){return n.openBlock(),n.createElementBlock("svg",kw,[...e[0]||(e[0]=[n.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 Xu=n.markRaw({name:"fa6-brands-viber",render:Cw}),vw={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Sw=["id"],Bw=["id"],Nw=["fill"],Tw=["fill"];function $w(t,e){return n.openBlock(),n.createElementBlock("svg",vw,[n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[n.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),n.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,Sw),n.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[n.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),n.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,Bw)]),n.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,Nw),n.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,Tw),e[2]||(e[2]=n.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 Yu=n.markRaw({name:"logos-whatsapp-icon",render:$w,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Ew={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},Rw=["id"],Pw=["fill"];function Fw(t,e){return n.openBlock(),n.createElementBlock("svg",Ew,[n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[n.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),n.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,Rw)]),n.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,Pw),e[1]||(e[1]=n.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 Uu=n.markRaw({name:"logos-telegram",render:Fw,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Vw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Mw(t,e){return n.openBlock(),n.createElementBlock("svg",Vw,[...e[0]||(e[0]=[n.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 Ku=n.markRaw({name:"ion-call",render:Mw}),Iw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Aw(t,e){return n.openBlock(),n.createElementBlock("svg",Iw,[...e[0]||(e[0]=[n.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 Ow=n.markRaw({name:"tabler-phone-call",render:Aw}),zw={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Dw=["href"],Lw=["href"],Hw=["href"],Ww=["href"],jw={},qw=n.defineComponent({...jw,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,i=n.computed(()=>{try{return e.phone?xr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=n.computed(()=>{var a;return A.isString(i.value)?!1:((a=i.value)==null?void 0:a.isValid())??!1}),o=n.computed(()=>{var a;return A.isString(i.value)?i.value:((a=i.value)==null?void 0:a.format("INTERNATIONAL"))??""}),s=n.computed(()=>{var a;return A.isString(i.value)?i.value:((a=i.value)==null?void 0:a.format("E.164"))??""}),l=n.ref(!1);return(a,c)=>{const d=Ow,u=Ku,f=Uu,h=Yu,m=Xu;return n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",{class:n.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&l.value,"min-w-10":!0}),onClick:c[0]||(c[0]=p=>l.value=!l.value),onFocusout:c[1]||(c[1]=p=>l.value=!1),onMouseleave:c[2]||(c[2]=p=>l.value=!1)},[n.createElementVNode("div",{class:n.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(n.openBlock(),n.createBlock(d,{key:0})):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)],2),r.value&&l.value?(n.openBlock(),n.createElementBlock("div",zw,[r.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[n.createVNode(u)],8,Dw)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[n.createVNode(f)],8,Lw)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[n.createVNode(h)],8,Hw)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[n.createVNode(m)],8,Ww)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],34)])}}}),Xw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yw(t,e){return n.openBlock(),n.createElementBlock("svg",Xw,[...e[0]||(e[0]=[n.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 Uw=n.markRaw({name:"mdi-envelope",render:Yw}),Kw={class:"flex flex-col gap-1"},Gw={key:0,class:"mb-2 flex flex-col text-base"},Zw={key:0,class:"text-sc-dark-grey text-sm"},Qw={key:1,class:"whitespace-nowrap text-sm"},Jw={key:2,class:"whitespace-nowrap text-sm"},ex={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},tx=["href"],nx=["href"],ix=["href"],rx=["href"],ox=["href"],sx={key:0,class:"flex flex-col text-base"},lx={key:0,class:"text-sc-dark-grey text-sm"},ax={key:1,class:"mt-2 text-sm"},cx={key:0,class:"-mt-1"},dx={},ux=n.defineComponent({...dx,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,i=n.computed(()=>ni.getFormatEntityName(e.contact)),r=n.computed(()=>{try{return e.contact.phone?xr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=n.computed(()=>{var d;return A.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=n.computed(()=>{var d;return A.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),l=n.computed(()=>{var d;return A.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),a=n.computed(()=>o.value||e.contact.email),c=n.ref(!1);return(d,u)=>{var y,_;const f=Ku,h=Uu,m=Yu,p=Xu,g=Uw,b=F.NPopover;return n.openBlock(),n.createElementBlock("div",Kw,[n.createVNode(b,{disabled:t.fullView,placement:"bottom"},{trigger:n.withCtx(()=>{var k,x,v,N;return[n.createElementVNode("div",{class:n.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(k=t.contact)!=null&&k.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:n.normalizeStyle(t.styles),onMouseenter:u[0]||(u[0]=w=>c.value=!0),onFocusin:u[1]||(u[1]=w=>c.value=!0),onMouseleave:u[2]||(u[2]=w=>c.value=!1),onFocusout:u[3]||(u[3]=w=>c.value=!1)},[n.createElementVNode("div",null,[t.fullView&&(t.contact.name||(x=t.contact)!=null&&x.position)?(n.openBlock(),n.createElementBlock("div",Gw,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(v=t.contact)!=null&&v.position?(n.openBlock(),n.createElementBlock("span",Zw,n.toDisplayString((N=t.contact)==null?void 0:N.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),t.contact.phone?(n.openBlock(),n.createElementBlock("div",Qw,n.toDisplayString(s.value),1)):n.createCommentVNode("",!0),t.contact.email?(n.openBlock(),n.createElementBlock("div",Jw,n.toDisplayString(t.contact.email),1)):n.createCommentVNode("",!0),a.value&&c.value?(n.openBlock(),n.createElementBlock("div",ex,[o.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:`tel:${l.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[n.createVNode(f)],8,tx)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:1,href:`https://t.me/${l.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(h)],8,nx)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:2,href:`https://wa.me/${l.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(m)],8,ix)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:3,href:`viber://chat?number=${l.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[n.createVNode(p)],8,rx)):n.createCommentVNode("",!0),t.contact.email?(n.openBlock(),n.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[n.createVNode(g)],8,ox)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])],38)]}),default:n.withCtx(()=>{var k,x,v,N;return[t.contact.name?(n.openBlock(),n.createElementBlock("div",sx,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(k=t.contact)!=null&&k.position?(n.openBlock(),n.createElementBlock("span",lx,n.toDisplayString((x=t.contact)==null?void 0:x.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),(v=t.contact)!=null&&v.comment?(n.openBlock(),n.createElementBlock("div",ax,[u[4]||(u[4]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((N=t.contact)==null?void 0:N.comment),1)])):n.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(n.openBlock(),n.createElementBlock("div",cx,[u[5]||(u[5]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((_=t.contact)==null?void 0:_.comment),1)])):n.createCommentVNode("",!0)])}}});class fx{constructor(e){B(this,"minHeight");B(this,"maxHeights");B(this,"minWidth");B(this,"maxWidths");B(this,"netType");B(this,"color");B(this,"mountType");B(this,"descriptions");B(this,"crossbarCount");B(this,"heightOverlaps");B(this,"widthOverlaps");B(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=ws.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=ws.objectToSnake(e.heightOverlaps),this.widthOverlaps=ws.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function hx(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==H.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&A.isArray(t.products)&&t.products.length>0}const mx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function px(t,e){return n.openBlock(),n.createElementBlock("svg",mx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2"},null,-1)])])}const gx=n.markRaw({name:"mdi-dots-horizontal",render:px}),yx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bx(t,e){return n.openBlock(),n.createElementBlock("svg",yx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 0 0 9.5 3A6.5 6.5 0 0 0 3 9.5A6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5l1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5S14 7 14 9.5S12 14 9.5 14M7 9h5v1H7z"},null,-1)])])}const _x=n.markRaw({name:"mdi-magnify-minus-outline",render:bx}),wx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xx(t,e){return n.openBlock(),n.createElementBlock("svg",wx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"m15.5 14l5 5l-1.5 1.5l-5-5v-.79l-.27-.28A6.47 6.47 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5S5 7 5 9.5S7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z"},null,-1)])])}const kx=n.markRaw({name:"mdi-magnify-plus-outline",render:xx}),Cx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vx(t,e){return n.openBlock(),n.createElementBlock("svg",Cx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"},null,-1)])])}const Gu=n.markRaw({name:"mdi-chevron-right",render:vx}),Sx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bx(t,e){return n.openBlock(),n.createElementBlock("svg",Sx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"},null,-1)])])}const Zu=n.markRaw({name:"mdi-chevron-left",render:Bx}),Nx={heightMedium:"40px",paddingMedium:"0 16px",borderRadiusMedium:"10px",fontSizeMedium:"14px",iconSizeMedium:"18px",iconMarginMedium:"8px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},Ir={heightSmall:"36px",paddingSmall:"0 10px",borderRadiusSmall:"8px",iconSizeSmall:"18px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},Qu="date-range.dialog.mode",Ju="date-range.dialog.scale",ef="date-range.quick-periods",tf=["thisMonth","lastMonth","thisQuarter","lastQuarter","thisYear","lastYear","fromBeginningOfThisYear"],nf=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Tx=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],$x=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],rf=new Date(2e3,0,1),Bi=t=>ke.differenceInCalendarDays(t,rf),of=t=>ke.addDays(rf,t),sf=(t,e,i)=>{let r=t??void 0,o=e??void 0;return r&&o&&r>o&&(i!=null&&i.from?o=r:i!=null&&i.to?r=o:[r,o]=[o,r]),{from:r?ke.startOfDay(r):void 0,to:o?ke.endOfDay(o):void 0}},Tl=t=>Object.entries(t).map(([e,i])=>({value:e,label:i.label,item:i})),lf=(t,e)=>{const i=Object.entries(t).filter(([,r])=>r.group===e);return e!=="other"?[{type:"group",key:e,children:Tl(Object.fromEntries(i))}]:H.STANDARD_PERIOD_SECTIONS.map(r=>{const o=i.filter(([,s])=>s.section===r.key);return{type:"group",key:r.key,label:r.label,children:Tl(Object.fromEntries(o))}}).filter(r=>r.children.length>0)},af=(t,e)=>{const i=n.ref(null),r=n.ref(null),o=n.ref(!1),s=n.ref(null),l=(g,b)=>g<=b?[g,b]:[b,g],a=n.computed(()=>o.value&&r.value!==null&&s.value!==null?l(r.value,s.value):i.value!==null?s.value===null?[i.value,i.value]:l(i.value,s.value):t.value),c=(g,b)=>{i.value=null,e(...l(g,b))},d=g=>{i.value===null?(i.value=g,e(g,g)):c(i.value,g)},u=()=>{globalThis.removeEventListener("pointerup",u);const g=r.value;if(g!==null){if(r.value=null,o.value){o.value=!1,s.value!==null&&c(g,s.value);return}d(g)}},f=g=>{r.value=g,o.value=!1,globalThis.addEventListener("pointerup",u)},h=g=>{s.value=g,r.value!==null&&g!==r.value&&(o.value=!0)},m=()=>{s.value=null},p=g=>{const b=a.value;return!b||g<b[0]||g>b[1]?null:g===b[0]||g===b[1]?"bound":"in-range"};return n.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",u)}),{activeRange:a,cellPosition:p,pointerDownHandler:f,pointerEnterHandler:h,pointerLeaveHandler:m,selectHandler:d}},Ex={class:"flex items-center justify-between gap-2"},Rx={class:"flex items-center gap-2"},Px={class:"text-center font-semibold"},Fx={class:"grid grid-cols-7 gap-0.5 text-center text-xs text-gray-500"},Vx={class:"grid grid-cols-7 gap-0.5"},Mx=["disabled","onPointerdown","onPointerenter","onKeydown"],Ix={},Ax=n.defineComponent({...Ix,__name:"day-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const i=t,r=e,o=42,s=F.useThemeVars(),l=n.computed(()=>({"--sc-primary-color":s.value.primaryColor,"--sc-primary-color-hover":s.value.primaryColorHover,"--sc-primary-color-suppl":s.value.primaryColorSuppl,"--sc-hover-color":s.value.hoverColor})),a=Ye.initRefDependingOnDeviceResolution(1,2,3),c=n.computed(()=>["grid-cols-1","grid-cols-2","grid-cols-3"][a.value-1]),d=y=>ke.subMonths(ke.startOfMonth(y),a.value===3?1:0),u=y=>y&&ke.isValid(y)?y:new Date,f=n.ref(d(u(i.from??i.to))),h=n.computed(()=>{const{from:y,to:_}=i;return!y||!_||!ke.isValid(y)||!ke.isValid(_)?null:[Bi(y),Bi(_)]}),m=af(h,(y,_)=>{r("select",{from:ke.startOfDay(of(y)),to:ke.endOfDay(of(_))})}),p=y=>{const _=ke.subDays(y,(ke.getDay(y)+6)%7);return A.times(o,k=>{const x=ke.addDays(_,k);return{index:Bi(x),day:x.getDate(),isCurrentMonth:ke.isSameMonth(x,y),isToday:ke.isToday(x)}})},g=n.computed(()=>A.times(a.value,y=>{const _=ke.addMonths(f.value,y);return{key:`${_.getFullYear()}-${_.getMonth()}`,title:`${Tx[_.getMonth()]} ${_.getFullYear()}`,cells:p(_)}})),b=y=>{if(!y.isCurrentMonth)return["sc-day--outside"];const _=y.isToday?["sc-day--today"]:[],k=m.cellPosition(y.index);return k&&_.push(`sc-day--${k}`),_};return n.watch(()=>[i.from,i.to],()=>{const y=i.from??i.to;if(!y||!ke.isValid(y))return;const _=`${y.getFullYear()}-${y.getMonth()}`;A.some(g.value,["key",_])||(f.value=d(y))}),(y,_)=>{const k=Zu,x=F.NButton,v=Gu;return n.openBlock(),n.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:n.normalizeStyle(l.value),onPointerleave:_[2]||(_[2]=(...N)=>n.unref(m).pointerLeaveHandler&&n.unref(m).pointerLeaveHandler(...N))},[n.createElementVNode("div",Ex,[n.createVNode(x,{size:"small","aria-label":"Предыдущий месяц","theme-overrides":n.unref(Ir),onClick:_[0]||(_[0]=N=>f.value=n.unref(ke.subMonths)(f.value,1))},{icon:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["theme-overrides"]),_[3]||(_[3]=n.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон на календаре",-1)),n.createElementVNode("div",Rx,[n.renderSlot(y.$slots,"actions",{},void 0,!0),n.createVNode(x,{size:"small","aria-label":"Следующий месяц","theme-overrides":n.unref(Ir),onClick:_[1]||(_[1]=N=>f.value=n.unref(ke.addMonths)(f.value,1))},{icon:n.withCtx(()=>[n.createVNode(v)]),_:1},8,["theme-overrides"])])]),n.createElementVNode("div",{class:n.normalizeClass(["grid gap-3",c.value])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,N=>(n.openBlock(),n.createElementBlock("div",{key:N.key,class:"flex flex-col gap-1"},[n.createElementVNode("div",Px,n.toDisplayString(N.title),1),n.createElementVNode("div",Fx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref($x),w=>(n.openBlock(),n.createElementBlock("span",{key:w},n.toDisplayString(w),1))),128))]),n.createElementVNode("div",Vx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.cells,w=>(n.openBlock(),n.createElementBlock("button",{key:w.index,type:"button",class:n.normalizeClass(["sc-day h-7 rounded border-0 p-0 text-xs",b(w)]),disabled:!w.isCurrentMonth,onPointerdown:n.withModifiers(T=>n.unref(m).pointerDownHandler(w.index),["prevent"]),onPointerenter:T=>n.unref(m).pointerEnterHandler(w.index),onKeydown:[n.withKeys(n.withModifiers(T=>n.unref(m).selectHandler(w.index),["prevent"]),["enter"]),n.withKeys(n.withModifiers(T=>n.unref(m).selectHandler(w.index),["prevent"]),["space"])]},n.toDisplayString(w.day),43,Mx))),128))])]))),128))],2),_[4]||(_[4]=n.createStaticVNode('<div class="flex flex-wrap items-center gap-x-6 gap-y-1 text-xs text-gray-700" data-v-a41e813d><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата начала</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--in-range" data-v-a41e813d></i>Выбранный период</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата окончания</span></div>',1))],36)}}}),Ox=wn(Ax,[["__scopeId","data-v-a41e813d"]]),zx={class:"flex items-center justify-between gap-2"},Dx={class:"flex items-center gap-2"},Lx={class:"text-center font-semibold"},Hx={class:"grid grid-cols-3 gap-2"},Wx=["onPointerdown","onPointerenter","onKeydown"],jx={},qx=n.defineComponent({...jx,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const i=t,r=e,o=F.useThemeVars(),s=n.computed(()=>({"--sc-primary-color":o.value.primaryColor,"--sc-primary-color-hover":o.value.primaryColorHover,"--sc-primary-color-suppl":o.value.primaryColorSuppl,"--sc-hover-color":o.value.hoverColor})),l=m=>{const p=new Date().getFullYear();return m&&ke.isValid(m)?m.getFullYear():p},a=n.ref(l(i.from??i.to)),c=Ye.initRefDependingOnDeviceResolution(1,3,3),d=n.computed(()=>c.value===1?[a.value]:[a.value-1,a.value,a.value+1]),u=n.computed(()=>{const{from:m,to:p}=i;return!m||!p||!ke.isValid(m)||!ke.isValid(p)?null:[m.getFullYear()*12+m.getMonth(),p.getFullYear()*12+p.getMonth()]}),f=af(u,(m,p)=>{r("select",{from:new Date(Math.floor(m/12),m%12,1),to:ke.endOfMonth(new Date(Math.floor(p/12),p%12,1))})}),h=(m,p)=>{const g=f.cellPosition(m*12+p);return g?[`sc-month--${g}`]:[]};return n.watch(()=>[i.from,i.to],()=>{const m=i.from??i.to;if(!m||!ke.isValid(m))return;const p=m.getFullYear();(p<a.value-1||p>a.value+1)&&(a.value=p)}),(m,p)=>{const g=Zu,b=F.NButton,y=Gu;return n.openBlock(),n.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:n.normalizeStyle(s.value),onPointerleave:p[2]||(p[2]=(..._)=>n.unref(f).pointerLeaveHandler&&n.unref(f).pointerLeaveHandler(..._))},[n.createElementVNode("div",zx,[n.createVNode(b,{size:"small","aria-label":"Предыдущий год","theme-overrides":n.unref(Ir),onClick:p[0]||(p[0]=_=>a.value-=1)},{icon:n.withCtx(()=>[n.createVNode(g)]),_:1},8,["theme-overrides"]),p[3]||(p[3]=n.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон месяцев",-1)),n.createElementVNode("div",Dx,[n.renderSlot(m.$slots,"actions",{},void 0,!0),n.createVNode(b,{size:"small","aria-label":"Следующий год","theme-overrides":n.unref(Ir),onClick:p[1]||(p[1]=_=>a.value+=1)},{icon:n.withCtx(()=>[n.createVNode(y)]),_:1},8,["theme-overrides"])])]),n.createElementVNode("div",{class:n.normalizeClass(["grid gap-4 sm:gap-6",d.value.length===1?"grid-cols-1":"grid-cols-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,_=>(n.openBlock(),n.createElementBlock("div",{key:_,class:"flex flex-col gap-2"},[n.createElementVNode("div",Lx,n.toDisplayString(_),1),n.createElementVNode("div",Hx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(nf),(k,x)=>(n.openBlock(),n.createElementBlock("button",{key:k,type:"button",class:n.normalizeClass(["sc-month cursor-pointer rounded-lg px-1 py-2.5 text-sm",h(_,x)]),onPointerdown:n.withModifiers(v=>n.unref(f).pointerDownHandler(_*12+x),["prevent"]),onPointerenter:v=>n.unref(f).pointerEnterHandler(_*12+x),onKeydown:[n.withKeys(n.withModifiers(v=>n.unref(f).selectHandler(_*12+x),["prevent"]),["enter"]),n.withKeys(n.withModifiers(v=>n.unref(f).selectHandler(_*12+x),["prevent"]),["space"])]},n.toDisplayString(k),43,Wx))),128))])]))),128))],2)],36)}}}),Xx=wn(qx,[["__scopeId","data-v-dd09a19d"]]),Yx={class:"sc-date-range-sidebar flex flex-col gap-1"},Ux={class:"flex items-center justify-center gap-1"},Kx={class:"min-w-12 text-center font-semibold"},Gx={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},Zx={},Qx=n.defineComponent({...Zx,__name:"month-year-sidebar",props:{year:{},month:{}},emits:["update:year","select-month","today"],setup(t,{emit:e}){const i=e;return(r,o)=>{const s=F.NButton;return n.openBlock(),n.createElementBlock("div",Yx,[n.createElementVNode("div",Ux,[n.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=l=>i("update:year",t.year-1))},{default:n.withCtx(()=>[...o[3]||(o[3]=[n.createTextVNode(" ‹ ",-1)])]),_:1}),n.createElementVNode("span",Kx,n.toDisplayString(t.year),1),n.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=l=>i("update:year",t.year+1))},{default:n.withCtx(()=>[...o[4]||(o[4]=[n.createTextVNode(" › ",-1)])]),_:1})]),n.createElementVNode("div",Gx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(nf),(l,a)=>(n.openBlock(),n.createBlock(s,{key:l,size:"small",quaternary:"",type:a===t.month?"primary":"default",onClick:c=>i("select-month",a)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l),1)]),_:2},1032,["type","onClick"]))),128))]),n.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=l=>i("today"))},{default:n.withCtx(()=>[...o[5]||(o[5]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),Jx={},cf=n.defineComponent({...Jx,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>H.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=Ye.initRefDependingOnDeviceResolution(!0,!1,!1),s=n.ref(null),l=n.ref(!1),a=n.ref(0),c=n.ref(i.value&&ke.isValid(i.value)?i.value:new Date),d=n.computed(()=>{const k=i.value&&ke.isValid(i.value)?i.value:c.value;return k.getFullYear()===c.value.getFullYear()?k.getMonth():null});let u=0;const f=k=>{var x,v;(v=(x=k.target)==null?void 0:x.closest)!=null&&v.call(x,".n-base-clear")&&(u=performance.now())},h=k=>{k&&performance.now()-u<300||(l.value=k,k&&(c.value=i.value&&ke.isValid(i.value)?i.value:new Date))},m=k=>{r("update:value",k===null?null:new Date(k))},p=(k,x)=>{const v=new Date(k,x,1);if(c.value=v,i.value&&ke.isValid(i.value)){const N=Math.min(ke.getDate(i.value),ke.getDaysInMonth(v));r("update:value",new Date(k,x,N));return}a.value+=1,n.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(k,x)=>{c.value=ke.addYears(ke.addMonths(c.value,k),x)},b=k=>{p(k,c.value.getMonth())},y=k=>{p(c.value.getFullYear(),k)},_=()=>{l.value=!1,r("update:value",new Date)};return(k,x)=>{const v=F.NButton,N=F.NDatePicker;return n.openBlock(),n.createBlock(N,{ref_key:"pickerReference",ref:s,key:a.value,value:i.value?i.value.getTime():null,show:l.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,format:t.dateFormat,actions:[],"default-calendar-start-time":c.value.getTime(),type:"date",class:"w-full min-w-0",onMousedownCapture:f,"onUpdate:show":h,"onUpdate:value":m,onNextMonth:x[0]||(x[0]=w=>g(1,0)),onPrevMonth:x[1]||(x[1]=w=>g(-1,0)),onNextYear:x[2]||(x[2]=w=>g(0,1)),onPrevYear:x[3]||(x[3]=w=>g(0,-1))},{footer:n.withCtx(()=>[n.unref(o)?(n.openBlock(),n.createBlock(v,{key:1,size:"small",text:"",type:"info",onClick:_},{default:n.withCtx(()=>[...x[4]||(x[4]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})):(n.openBlock(),n.createBlock(Qx,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":b,onSelectMonth:y,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),ek={key:0,class:"text-gray-400"},tk={},df=n.defineComponent({...tk,__name:"date-range-fields",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},from:{default:null},to:{default:null},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:from","update:to"],setup(t,{emit:e}){const i=Ye.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var l,a;return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex w-full min-w-0 gap-1",n.unref(i)?"flex-col":"flex-row items-center"])},[n.createVNode(cf,{value:t.from,clearable:t.clearable,disabled:(l=t.disabled)==null?void 0:l.from,placeholder:t.placeholderFrom,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:value":s[0]||(s[0]=c=>r("update:from",c))},null,8,["value","clearable","disabled","placeholder","date-format"]),n.unref(i)?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",ek," – ")),n.createVNode(cf,{value:t.to,clearable:t.clearable,disabled:(a=t.disabled)==null?void 0:a.to,placeholder:t.placeholderTo,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:value":s[1]||(s[1]=c=>r("update:to",c))},null,8,["value","clearable","disabled","placeholder","date-format"])],2)}}}),nk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ik(t,e){return n.openBlock(),n.createElementBlock("svg",nk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M7 11h2v2H7zm14-6v14c0 1.11-.89 2-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2M5 7h14V5H5zm14 12V9H5v10zm-4-6v-2h2v2zm-4 0v-2h2v2zm-4 2h2v2H7zm8 2v-2h2v2zm-4 0v-2h2v2z"},null,-1)])])}const rk=n.markRaw({name:"mdi-calendar-month-outline",render:ik}),ok={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sk(t,e){return n.openBlock(),n.createElementBlock("svg",ok,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"m16 11.78l4.24-7.33l1.73 1l-5.23 9.05l-6.51-3.75L5.46 19H22v2H2V3h2v14.54L9.5 8z"},null,-1)])])}const lk=n.markRaw({name:"mdi-chart-line",render:sk}),ak={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ck(t,e){return n.openBlock(),n.createElementBlock("svg",ak,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M22 21H2V3h2v16h2v-9h4v9h2V6h4v13h2v-5h4z"},null,-1)])])}const dk=n.markRaw({name:"mdi-chart-bar",render:ck}),uk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fk(t,e){return n.openBlock(),n.createElementBlock("svg",uk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M5 3h1V1h2v2h8V1h2v2h1c1.11 0 2 .89 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 16h14V9H5zM5 7h14V5H5zm12 4v2H7v-2z"},null,-1)])])}const hk=n.markRaw({name:"mdi-calendar-week-outline",render:fk}),mk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pk(t,e){return n.openBlock(),n.createElementBlock("svg",mk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2m0 16H5V9h14zm0-12H5V5h14M7 11h5v5H7"},null,-1)])])}const gk=n.markRaw({name:"mdi-calendar-today-outline",render:pk}),yk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bk(t,e){return n.openBlock(),n.createElementBlock("svg",yk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z"},null,-1)])])}const _k=n.markRaw({name:"mdi-cog-outline",render:bk}),wk={class:"grid gap-x-6 gap-y-4 pr-3 sm:grid-cols-2"},xk={class:"font-medium"},kk={key:0,class:"pt-1 text-xs text-gray-500"},Ck={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},vk={class:"flex items-center gap-3"},Sk={class:"text-sm text-gray-600"},Bk={class:"flex gap-2"},Nk={},Tk=n.defineComponent({...Nk,__name:"quick-periods-settings",props:{show:{type:Boolean},selectedKeys:{}},emits:["update:show","save"],setup(t,{emit:e}){const i=t,r=e,o=Ye.initRefDependingOnDeviceResolution("100%","90%","40rem"),s=H.DateTimeProvider.standardPeriods(),l=H.STANDARD_PERIOD_GROUPS.map(u=>({key:u.key,label:u.label,sections:lf(s,u.key)})),a=n.ref([]),c=n.computed(()=>{const u=a.value.length;return`Выбрано: ${u} ${H.pluralize(u,["период","периода","периодов"])}`}),d=()=>{r("save",[...a.value]),r("update:show",!1)};return n.watch(()=>i.show,u=>{u&&(a.value=[...i.selectedKeys])}),(u,f)=>{const h=F.NCheckbox,m=F.NCheckboxGroup,p=F.NScrollbar,g=F.NButton,b=F.NModal;return n.openBlock(),n.createBlock(b,{show:t.show,preset:"card",title:"Настройка быстрого выбора",closable:"",style:n.normalizeStyle({width:n.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":f[4]||(f[4]=y=>r("update:show",y))},{footer:n.withCtx(()=>[n.createElementVNode("div",Ck,[n.createElementVNode("div",vk,[n.createElementVNode("span",Sk,n.toDisplayString(c.value),1),n.createVNode(g,{text:"",type:"info",onClick:f[1]||(f[1]=y=>a.value=[...n.unref(tf)])},{default:n.withCtx(()=>[...f[5]||(f[5]=[n.createTextVNode(" По умолчанию ",-1)])]),_:1}),n.createVNode(g,{text:"",type:"info",disabled:a.value.length===0,onClick:f[2]||(f[2]=y=>a.value=[])},{default:n.withCtx(()=>[...f[6]||(f[6]=[n.createTextVNode(" Снять все ",-1)])]),_:1},8,["disabled"])]),n.createElementVNode("div",Bk,[n.createVNode(g,{type:"primary",onClick:d},{default:n.withCtx(()=>[...f[7]||(f[7]=[n.createTextVNode(" Сохранить ",-1)])]),_:1}),n.createVNode(g,{onClick:f[3]||(f[3]=y=>r("update:show",!1))},{default:n.withCtx(()=>[...f[8]||(f[8]=[n.createTextVNode("Отмена",-1)])]),_:1})])])]),default:n.withCtx(()=>[n.createVNode(p,{class:"max-h-[60vh]"},{default:n.withCtx(()=>[n.createVNode(m,{value:a.value,"onUpdate:value":f[0]||(f[0]=y=>a.value=y)},{default:n.withCtx(()=>[n.createElementVNode("div",wk,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(l),y=>(n.openBlock(),n.createElementBlock("div",{key:y.key,class:"flex flex-col gap-1.5"},[n.createElementVNode("div",xk,n.toDisplayString(y.label),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.sections,_=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:_.key},[_.label?(n.openBlock(),n.createElementBlock("div",kk,n.toDisplayString(_.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.children,k=>(n.openBlock(),n.createBlock(h,{key:k.value,value:k.value,label:k.label},null,8,["value","label"]))),128))],64))),128))]))),128))])]),_:1},8,["value"])]),_:1})]),_:1},8,["show","style"])}}}),$k={class:"flex flex-col gap-2"},Ek={class:"flex items-center gap-2"},Rk={class:"flex gap-2 px-px pb-4 pt-px"},Pk={key:0,class:"text-sm text-gray-500"},Fk={},Vk=n.defineComponent({...Fk,__name:"quick-periods",props:{from:{},to:{}},emits:["apply","preview"],setup(t,{emit:e}){const i=t,r=e,o=H.DateTimeProvider.standardPeriods(),s=()=>{const f=ef,h=H.PreferencesStorageProvider.getActualDataFromStorage(f);return(A.isArray(h)?h:tf).filter(p=>A.isString(p)&&p in o)},l=n.ref(s()),a=n.ref(!1),c=n.computed(()=>Object.entries(o).filter(([f])=>l.value.includes(f)).map(([f,h])=>({value:f,label:h.label,item:h,group:h.group}))),d=n.computed(()=>{const f=i.from?Bi(i.from):null,h=i.to?Bi(i.to):null;if(f===null||h===null)return null;const m=c.value.find(p=>{const{from:g,to:b}=p.item;return!g||!b?!1:Bi(g)===f&&Bi(b)===h});return m?String(m.value):null}),u=f=>{l.value=f;const h=ef;H.PreferencesStorageProvider.saveActualDataToStorage(h,f,ke.addYears(ke.startOfToday(),1))};return(f,h)=>{const m=_k,p=F.NButton,g=gk,b=hk,y=dk,_=lk,k=rk,x=F.NScrollbar;return n.openBlock(),n.createElementBlock("div",$k,[n.createElementVNode("div",Ek,[h[3]||(h[3]=n.createElementVNode("span",{class:"text-sm font-medium text-gray-700"},"Быстрый выбор",-1)),n.createVNode(p,{size:"tiny",quaternary:"",circle:"","aria-label":"Настроить быстрый выбор",onClick:h[0]||(h[0]=v=>a.value=!0)},{icon:n.withCtx(()=>[n.createVNode(m)]),_:1})]),n.createVNode(x,{"x-scrollable":""},{default:n.withCtx(()=>[n.createElementVNode("div",Rk,[c.value.length===0?(n.openBlock(),n.createElementBlock("span",Pk," Периоды не выбраны ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,v=>(n.openBlock(),n.createBlock(p,{key:v.value,type:v.value===d.value?"primary":"default",ghost:v.value===d.value,"theme-overrides":n.unref(Nx),class:"shrink-0",onClick:N=>r("apply",v),onMouseenter:N=>r("preview",v),onMouseleave:h[1]||(h[1]=N=>r("preview"))},{icon:n.withCtx(()=>[v.group==="day"?(n.openBlock(),n.createBlock(g,{key:0})):v.group==="week"||v.group==="decade"?(n.openBlock(),n.createBlock(b,{key:1})):v.group==="quarter"||v.group==="halfYear"?(n.openBlock(),n.createBlock(y,{key:2})):v.group==="other"?(n.openBlock(),n.createBlock(_,{key:3})):(n.openBlock(),n.createBlock(k,{key:4}))]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(v.label),1)]),_:2},1032,["type","ghost","theme-overrides","onClick","onMouseenter"]))),128))])]),_:1}),n.createVNode(Tk,{show:a.value,"onUpdate:show":h[2]||(h[2]=v=>a.value=v),"selected-keys":l.value,onSave:u},null,8,["show","selected-keys"])])}}}),Mk={class:"flex flex-col items-stretch gap-3 sm:flex-row"},Ik={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},Ak={class:"flex flex-col items-stretch pr-3"},Ok={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},zk={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},Dk={},Lk=n.defineComponent({...Dk,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const i=t,r=e,o="custom",s=Ye.initRefDependingOnDeviceResolution(!0,!1,!1),l=H.DateTimeProvider.standardPeriods(),a=n.ref(H.STANDARD_PERIOD_GROUPS[0].key),c=n.computed(()=>{const u=H.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return A.isEmpty(i.customPeriods)||u.push({key:o,value:o,label:"Пользовательские"}),u}),d=n.computed(()=>a.value===o?[{type:"group",key:o,children:Tl(i.customPeriods??{})}]:lf(l,a.value));return(u,f)=>{const h=F.NButton,m=F.NScrollbar,p=F.NSelect,g=F.NMenu;return n.openBlock(),n.createElementBlock("div",Mk,[n.createElementVNode("div",Ik,[n.createVNode(m,{class:"max-h-96"},{default:n.withCtx(()=>[n.createElementVNode("div",Ak,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,b=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:b.key},[b.label?(n.openBlock(),n.createElementBlock("div",Ok,n.toDisplayString(b.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.children,y=>(n.openBlock(),n.createBlock(h,{key:y.value,size:"small",quaternary:"",type:y.value===t.activeKey?"primary":"default",class:"justify-start",onClick:_=>r("apply",y),onMouseenter:_=>r("preview",y),onMouseleave:f[0]||(f[0]=_=>r("preview"))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),n.unref(s)?(n.openBlock(),n.createBlock(p,{key:0,value:a.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=b=>a.value=b)},null,8,["value","options"])):(n.openBlock(),n.createElementBlock("div",zk,[n.createVNode(g,{value:a.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=b=>a.value=b)},null,8,["value","options"])]))])}}}),Hk={class:"flex flex-col gap-3"},Wk={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},jk={key:1,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},qk={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},Xk={class:"flex gap-2"},Yk={},Uk=n.defineComponent({...Yk,__name:"date-range-dialog",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},show:{type:Boolean},dateRange:{default:void 0},customPeriods:{default:void 0},dateFormat:{default:void 0}},emits:["update:show","select"],setup(t,{emit:e}){const i=t,r=e,o=Ye.initRefDependingOnDeviceResolution("100%","90%","48rem"),s=n.ref("custom"),l=n.ref("months"),a=n.computed(()=>l.value==="months"?"Показать по дням":"Показать по месяцам"),c=()=>H.PreferencesStorageProvider.getActualDataFromStorage(Qu)==="standard"?"standard":"custom",d=()=>H.PreferencesStorageProvider.getActualDataFromStorage(Ju)==="days"?"days":"months",u=(C,$)=>{H.PreferencesStorageProvider.saveActualDataToStorage(C,$,ke.addYears(ke.startOfToday(),1))},f=n.ref({}),h=n.ref(null),m=n.ref(null),p=n.computed(()=>h.value??f.value),g=(C,$)=>{var P,I;const E=(P=i.disabled)!=null&&P.from?f.value.from:C,V=(I=i.disabled)!=null&&I.to?f.value.to:$;h.value=null,f.value=sf(E,V,i.disabled)},b=C=>{m.value=null,g(C,f.value.to)},y=C=>{m.value=null,g(f.value.from,C)},_=()=>{m.value=null,g(null,null)},k=C=>{m.value=null,g(C.from,C.to)},x=C=>{const $=C.item;g($.from,$.to),m.value=String(C.value)},v=C=>{const $=C==null?void 0:C.item;h.value=$?{from:$.from,to:$.to}:null},N=()=>{h.value=null,s.value=s.value==="custom"?"standard":"custom",u(Qu,s.value)},w=()=>{l.value=l.value==="months"?"days":"months",u(Ju,l.value)},T=()=>{r("select",f.value),r("update:show",!1)};return n.watch(()=>i.show,C=>{C&&(s.value=c(),l.value=d(),m.value=null,h.value=null,f.value={...i.dateRange})}),(C,$)=>{const E=F.NButton,V=kx,P=_x,I=F.NTooltip,K=F.NModal;return n.openBlock(),n.createBlock(K,{show:t.show,preset:"card",title:"Выберите период",closable:"",style:n.normalizeStyle({width:n.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":$[1]||($[1]=J=>r("update:show",J))},{footer:n.withCtx(()=>[n.createElementVNode("div",qk,[n.createVNode(E,{text:"",type:"info",onClick:N},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),n.createElementVNode("div",Xk,[n.createVNode(E,{type:"primary",onClick:T},{default:n.withCtx(()=>[...$[3]||($[3]=[n.createTextVNode(" Выбрать ",-1)])]),_:1}),n.createVNode(E,{onClick:$[0]||($[0]=J=>r("update:show",!1))},{default:n.withCtx(()=>[...$[4]||($[4]=[n.createTextVNode("Отмена",-1)])]),_:1})])])]),default:n.withCtx(()=>[n.createElementVNode("div",Hk,[s.value==="custom"?(n.openBlock(),n.createBlock(Vk,{key:0,from:f.value.from,to:f.value.to,onApply:x,onPreview:v},null,8,["from","to"])):n.createCommentVNode("",!0),n.createElementVNode("div",Wk,[n.createVNode(df,{from:p.value.from,to:p.value.to,clearable:t.clearable,disabled:t.disabled,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":b,"onUpdate:to":y},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(n.openBlock(),n.createBlock(E,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:_},{default:n.withCtx(()=>[...$[2]||($[2]=[n.createTextVNode(" Очистить период ",-1)])]),_:1})):n.createCommentVNode("",!0)]),s.value==="custom"?(n.openBlock(),n.createElementBlock("div",jk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value==="months"?Xx:Ox),{from:f.value.from,to:f.value.to,onSelect:k},{actions:n.withCtx(()=>[n.createVNode(I,{placement:"top",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(E,{size:"small","aria-label":a.value,"theme-overrides":n.unref(Ir),onClick:w},{icon:n.withCtx(()=>[l.value==="months"?(n.openBlock(),n.createBlock(V,{key:0})):(n.openBlock(),n.createBlock(P,{key:1}))]),_:1},8,["aria-label","theme-overrides"])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(a.value),1)]),_:1})]),_:1},40,["from","to"]))])):(n.openBlock(),n.createBlock(Lk,{key:2,"active-key":m.value,"custom-periods":t.customPeriods,onApply:x,onPreview:v},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),Kk={class:"flex w-full min-w-0 items-center gap-1"},Gk={},Zk=n.defineComponent({...Gk,__name:"date-range",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},dateRange:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:date-range"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(!1),s=n.computed(()=>{const u={...i.useDefaultPredefinedDateRanges?H.DateTimeProvider.defaultDateRanges():{},...i.predefinedDateRanges};return A.isEmpty(u)?void 0:u}),l=(u,f)=>{r("update:date-range",sf(u,f,i.disabled))},a=u=>{var f;l(u,(f=i.dateRange)==null?void 0:f.to)},c=u=>{var f;l((f=i.dateRange)==null?void 0:f.from,u)},d=u=>{l(u.from,u.to)};return(u,f)=>{var p,g,b,y;const h=gx,m=F.NButton;return n.openBlock(),n.createElementBlock("div",Kk,[n.createVNode(df,{from:(p=t.dateRange)==null?void 0:p.from,to:(g=t.dateRange)==null?void 0:g.to,clearable:t.clearable,disabled:t.disabled,"placeholder-from":t.placeholderFrom,"placeholder-to":t.placeholderTo,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:from":a,"onUpdate:to":c},null,8,["from","to","clearable","disabled","placeholder-from","placeholder-to","date-format"]),n.createVNode(m,{disabled:!!((b=t.disabled)!=null&&b.from&&((y=t.disabled)!=null&&y.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:f[0]||(f[0]=_=>o.value=!0)},{default:n.withCtx(()=>[n.createVNode(h)]),_:1},8,["disabled"]),n.createVNode(Uk,{show:o.value,"onUpdate:show":f[1]||(f[1]=_=>o.value=_),"date-range":t.dateRange,clearable:t.clearable,disabled:t.disabled,"custom-periods":s.value,"date-format":t.dateFormat,onSelect:d},null,8,["show","date-range","clearable","disabled","custom-periods","date-format"])])}}}),Qk={class:"sc-lbl-date text-nowrap"},Jk={},Uo=n.defineComponent({...Jk,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,i=n.computed(()=>ke.format(e.date,H.useBaseConfigStateStore().config.dateFormats.uiDate)),r=n.computed(()=>ke.format(e.date,"HH:mm"));return(o,s)=>(n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[n.createElementVNode("span",Qk,n.toDisplayString(i.value),1),t.isShowTime?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},n.toDisplayString(r.value),3)):n.createCommentVNode("",!0)],2))}}),e2={},t2=n.defineComponent({...e2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,i=n.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass({"text-sm":t.wrapAsSmall})},[n.createTextVNode(n.toDisplayString(i.value)+" ",1),n.createElementVNode("span",{class:n.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},n.toDisplayString(t.debt)+" ₽ ",3)],2)):n.createCommentVNode("",!0)}}),n2={class:"flex flex-row gap-2.5"},i2={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},r2={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},o2={class:"mb-0.5 sm:mb-0 sm:ml-3"},s2={},l2=n.defineComponent({...s2,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,i)=>{const r=Yo,o=F.NButton,s=F.NPopover;return n.openBlock(),n.createElementBlock("div",n2,[n.createElementVNode("div",i2,[n.renderSlot(e.$slots,"main")]),n.createElementVNode("div",null,[n.createElementVNode("div",r2,[n.renderSlot(e.$slots,"extra-buttons"),n.createElementVNode("div",o2,[t.showCloseButton?(n.openBlock(),n.createBlock(s,{key:0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(o,{size:"small",type:"error",onClick:i[0]||(i[0]=l=>e.$emit("close"))},{default:n.withCtx(()=>[n.createVNode(r)]),_:1})]),default:n.withCtx(()=>[i[1]||(i[1]=n.createTextVNode(" Закрыть ",-1))]),_:1})):n.createCommentVNode("",!0)])])])])}}}),a2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function c2(t,e){return n.openBlock(),n.createElementBlock("svg",a2,[...e[0]||(e[0]=[n.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 d2=n.markRaw({name:"ion-checkmark-done-sharp",render:c2}),u2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function f2(t,e){return n.openBlock(),n.createElementBlock("svg",u2,[...e[0]||(e[0]=[n.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),n.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const h2=n.markRaw({name:"ion-options-outline",render:f2}),m2={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},p2={class:"flex-auto"},g2={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"},y2={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"},b2={},$l=n.defineComponent({...b2,__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 i=e,r=n.ref(!1),o=()=>{i("edit")},s=()=>{r.value=!1},l=()=>{r.value=!0,i("apply",s)},a=()=>{i("cancel",s)};return(c,d)=>{const u=h2,f=F.NButton,h=F.NPopover,m=d2,p=Yo;return n.openBlock(),n.createElementBlock("div",m2,[n.createElementVNode("div",p2,[n.renderSlot(c.$slots,"default")]),n.createElementVNode("div",null,[n.createElementVNode("div",g2,[n.createElementVNode("div",y2,[t.showEditButton?(n.openBlock(),n.createBlock(h,{key:0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(f,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:o},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["disabled"])]),default:n.withCtx(()=>[d[0]||(d[0]=n.createTextVNode(" Редактировать данные ",-1))]),_:1})):n.createCommentVNode("",!0),t.showApplyButton?(n.openBlock(),n.createBlock(h,{key:1,disabled:r.value,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(f,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:l},{default:n.withCtx(()=>[n.createVNode(m)]),_:1},8,["disabled"])]),default:n.withCtx(()=>[d[1]||(d[1]=n.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),t.showCancelButton?(n.openBlock(),n.createBlock(h,{key:2,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(f,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:a},{default:n.withCtx(()=>[n.createVNode(p)]),_:1},8,["disabled"])]),default:n.withCtx(()=>[d[2]||(d[2]=n.createTextVNode(" Отменить изменения ",-1))]),_:1})):n.createCommentVNode("",!0)]),n.renderSlot(c.$slots,"extra-buttons")])])])}}}),_2={},uf=n.defineComponent({..._2,__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 i=t,r=e,o=n.ref(i.showEditor),s=a=>{r("editor:apply",d=>{o.value=!d,a()})},l=a=>{o.value=!1,a(),r("editor:cancel")};return n.onMounted(()=>{n.watch(()=>i.showEditor,a=>{o.value=a})}),(a,c)=>(n.openBlock(),n.createElementBlock("div",null,[o.value?(n.openBlock(),n.createBlock($l,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,onCancel:l},{"extra-buttons":n.withCtx(()=>[n.renderSlot(a.$slots,"extra-editor-buttons")]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"editor")]),_:3},8,["disabled"])):(n.openBlock(),n.createBlock($l,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>o.value=!0)},{"extra-buttons":n.withCtx(()=>[n.renderSlot(a.$slots,"extra-viewer-buttons")]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),w2={key:0,class:"whitespace-pre-line"},x2={key:1,class:"text-sc-dark-grey"},k2={},C2=n.defineComponent({...k2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(i.comment);n.watch(()=>o.value,a=>{o.value=a});const s=a=>{r("update:comment",o.value,a)},l=()=>{o.value=i.comment};return(a,c)=>{const d=F.NInput;return n.openBlock(),n.createBlock(uf,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":l},{viewer:n.withCtx(()=>[n.createElementVNode("div",null,[t.comment?(n.openBlock(),n.createElementBlock("span",w2,n.toDisplayString(t.comment),1)):(n.openBlock(),n.createElementBlock("span",x2," - Комментарий отсутствует - "))])]),editor:n.withCtx(()=>[n.createVNode(d,{value:o.value,"onUpdate:value":c[0]||(c[0]=u=>o.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),v2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function S2(t,e){return n.openBlock(),n.createElementBlock("svg",v2,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const B2=n.markRaw({name:"ion-download-outline",render:S2}),N2={},T2=n.defineComponent({...N2,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const i=t,r=e,o=n.ref([]),s=n.computed(()=>o.value.map(a=>(a.status=i.isError?"error":"finished",a))),l=a=>{o.value=a;const c={name:"",content:""};if(a.length===0){r("update:file",null);return}const d=a[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(a,c)=>{const d=B2;return n.openBlock(),n.createBlock(n.unref(F.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":l},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NUploadDragger),null,{default:n.withCtx(()=>[n.renderSlot(a.$slots,"dragged-area",{},()=>[n.createElementVNode("div",null,[n.createVNode(d,{class:"text-2xl"}),n.createElementVNode("div",null,n.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),$2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function E2(t,e){return n.openBlock(),n.createElementBlock("svg",$2,[...e[0]||(e[0]=[n.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 R2=n.markRaw({name:"ion-warning",render:E2}),P2={},F2=n.defineComponent({...P2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,i)=>{const r=R2,o=F.NPopover;return n.openBlock(),n.createBlock(o,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(r,{class:n.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),V2={},M2=n.defineComponent({...V2,__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 i=t,r=e,o=n.ref(i.value),s=n.computed(()=>n.inject("debounce-input-time",i.debounceTime)),l=A.debounce(()=>r("update:value",o.value),s.value),a=c=>{o.value=c,l()};return n.watch(()=>i.value,c=>{o.value=c}),(c,d)=>(n.openBlock(),n.createBlock(n.unref(F.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),a],clearable:t.clearable,placeholder:t.placeholder},{prefix:n.withCtx(()=>[n.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),I2={},A2=n.defineComponent({...I2,__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:i}){const r=t,o=i,s=n.ref(r.value),l=n.computed(()=>n.inject("debounce-input-time",r.debounceTime)),a=A.debounce(()=>o("update:value",s.value),l.value),c=m=>{s.value=m,a()};n.watch(()=>r.value,m=>{s.value=m});const d=n.ref(null);return e({focus:()=>{var m;return(m=d.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=d.value)==null?void 0:m.blur()},select:()=>{var m;return(m=d.value)==null?void 0:m.select()}}),(m,p)=>(n.openBlock(),n.createBlock(n.unref(F.NInputNumber),{ref_key:"inputReference",ref:d,value:s.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:p[0]||(p[0]=g=>o("keydown",g)),onInput:p[1]||(p[1]=g=>o("input",g)),onFocus:p[2]||(p[2]=g=>o("focus",g))},{prefix:n.withCtx(()=>[n.renderSlot(m.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),O2={},z2=n.defineComponent({...O2,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=n.ref((i.value??"").replaceAll(/\D*/g,"")),s=A.debounce(c=>r("update:value",c),i.debounceTime??0),l=c=>{let d="";if(A.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(A.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof xr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}i.debounceTime?s(d):r("update:value",d)},a=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=xr.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof xr.ParseError)o.value=d;else throw u}};return n.watch(()=>i.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=o.value)==null?void 0:d.replaceAll(/\D*/g,""))&&a(c)},{immediate:!0}),n.onBeforeMount(()=>a(o.value??"")),(c,d)=>(n.openBlock(),n.createBlock(n.unref(wm.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),l],"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"]))}}),D2=wn(z2,[["__scopeId","data-v-751dbb0e"]]),L2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H2(t,e){return n.openBlock(),n.createElementBlock("svg",L2,[...e[0]||(e[0]=[n.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 W2=n.markRaw({name:"tabler-external-link",render:H2}),j2={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},q2=["href"],X2={},Y2=n.defineComponent({...X2,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,i)=>{const r=W2,o=F.NTooltip;return n.openBlock(),n.createBlock(o,{disabled:n.unref(A.isUndefined)(t.description),placement:"top-start"},{trigger:n.withCtx(()=>[n.createElementVNode("span",j2,[n.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},n.toDisplayString(t.text),9,q2),n.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),U2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function K2(t,e){return n.openBlock(),n.createElementBlock("svg",U2,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const G2=n.markRaw({name:"ion-remove-circle-outline",render:K2});let Ko=[];const ff=new WeakMap;function Z2(){Ko.forEach(t=>t(...ff.get(t))),Ko=[]}function hf(t,...e){ff.set(t,e),!Ko.includes(t)&&Ko.push(t)===1&&requestAnimationFrame(Z2)}function Ar(t,e){let{target:i}=t;for(;i;){if(i.dataset&&i.dataset[e]!==void 0)return!0;i=i.parentElement}return!1}function Or(t){return t.composedPath()[0]||null}function zr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Dr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function hn(t,e){const i=t.trim().split(/\s+/g),r={top:i[0]};switch(i.length){case 1:r.right=i[0],r.bottom=i[0],r.left=i[0];break;case 2:r.right=i[1],r.left=i[1],r.bottom=i[0];break;case 3:r.right=i[1],r.bottom=i[2],r.left=i[1];break;case 4:r.right=i[1],r.bottom=i[2],r.left=i[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const mf={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 Q2(t,e,i){e/=100,i/=100;let r=(o,s=(o+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function J2(t,e,i){e/=100,i/=100;let r=e*Math.min(i,1-i),o=(s,l=(s+t/30)%12)=>i-r*Math.max(Math.min(l-3,9-l,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const En="^\\s*",Rn="\\s*$",ai="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Gt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Ni="([0-9A-Fa-f])",Ti="([0-9A-Fa-f]{2})",pf=new RegExp(`${En}hsl\\s*\\(${Gt},${ai},${ai}\\)${Rn}`),gf=new RegExp(`${En}hsv\\s*\\(${Gt},${ai},${ai}\\)${Rn}`),yf=new RegExp(`${En}hsla\\s*\\(${Gt},${ai},${ai},${Gt}\\)${Rn}`),bf=new RegExp(`${En}hsva\\s*\\(${Gt},${ai},${ai},${Gt}\\)${Rn}`),eC=new RegExp(`${En}rgb\\s*\\(${Gt},${Gt},${Gt}\\)${Rn}`),tC=new RegExp(`${En}rgba\\s*\\(${Gt},${Gt},${Gt},${Gt}\\)${Rn}`),nC=new RegExp(`${En}#${Ni}${Ni}${Ni}${Rn}`),iC=new RegExp(`${En}#${Ti}${Ti}${Ti}${Rn}`),rC=new RegExp(`${En}#${Ni}${Ni}${Ni}${Ni}${Rn}`),oC=new RegExp(`${En}#${Ti}${Ti}${Ti}${Ti}${Rn}`);function Xt(t){return parseInt(t,16)}function sC(t){try{let e;if(e=yf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),Ei(e[13])];if(e=pf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function lC(t){try{let e;if(e=bf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),Ei(e[13])];if(e=gf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function $i(t){try{let e;if(e=iC.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),1];if(e=eC.exec(t))return[St(e[1]),St(e[5]),St(e[9]),1];if(e=tC.exec(t))return[St(e[1]),St(e[5]),St(e[9]),Ei(e[13])];if(e=nC.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),1];if(e=oC.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),Ei(Xt(e[4])/255)];if(e=rC.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),Ei(Xt(e[4]+e[4])/255)];if(t in mf)return $i(mf[t]);if(pf.test(t)||yf.test(t)){const[i,r,o,s]=sC(t);return[...J2(i,r,o),s]}else if(gf.test(t)||bf.test(t)){const[i,r,o,s]=lC(t);return[...Q2(i,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function aC(t){return t>1?1:t<0?0:t}function El(t,e,i,r){return`rgba(${St(t)}, ${St(e)}, ${St(i)}, ${aC(r)})`}function Rl(t,e,i,r,o){return St((t*e*(1-r)+i*r)/o)}function cC(t,e){Array.isArray(t)||(t=$i(t)),Array.isArray(e)||(e=$i(e));const i=t[3],r=e[3],o=Ei(i+r-i*r);return El(Rl(t[0],i,e[0],r,o),Rl(t[1],i,e[1],r,o),Rl(t[2],i,e[2],r,o),o)}function Le(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:$i(t);return typeof e.alpha=="number"?El(i,r,o,e.alpha):El(i,r,o,s)}function Go(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:$i(t),{lightness:l=1,alpha:a=1}=e;return dC([i*l,r*l,o*l,s*a])}function Ei(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function Zo(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function St(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function ci(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function dC(t){const[e,i,r]=t;return 3 in t?`rgba(${St(e)}, ${St(i)}, ${St(r)}, ${Ei(t[3])})`:`rgba(${St(e)}, ${St(i)}, ${St(r)}, 1)`}function uC(t=8){return Math.random().toString(16).slice(2,2+t)}function _f(t){return Array.isArray(t)?t:[t]}const Pl={STOP:"STOP"};function wf(t,e){const i=e(t);t.children!==void 0&&i!==Pl.STOP&&t.children.forEach(r=>wf(r,e))}function fC(t,e={}){const{preserveGroup:i=!1}=e,r=[],o=i?l=>{l.isLeaf||(r.push(l.key),s(l.children))}:l=>{l.isLeaf||(l.isGroup||r.push(l.key),s(l.children))};function s(l){l.forEach(o)}return s(t),r}function hC(t,e){const{isLeaf:i}=t;return i!==void 0?i:!e(t)}function mC(t){return t.children}function pC(t){return t.key}function gC(){return!1}function yC(t,e){const{isLeaf:i}=t;return!(i===!1&&!Array.isArray(e(t)))}function bC(t){return t.disabled===!0}function _C(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function wC(t,e){if(t.isLeaf===!0){const i=e(t);if(Array.isArray(i)&&i.length>0)return!0}return!1}function Fl(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Vl(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function xC(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)||i.add(r)}),Array.from(i)}function kC(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)&&i.delete(r)}),Array.from(i)}function CC(t){return(t==null?void 0:t.type)==="group"}function vC(t){const e=new Map;return t.forEach((i,r)=>{e.set(i.key,r)}),i=>{var r;return(r=e.get(i))!==null&&r!==void 0?r:null}}class SC extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function BC(t,e,i,r){return Qo(e.concat(t),i,r,!1)}function NC(t,e){const i=new Set;return t.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let s=o.parent;for(;s!==null&&!(s.disabled||i.has(s.key));)i.add(s.key),s=s.parent}}),i}function TC(t,e,i,r){const o=Qo(e,i,r,!1),s=Qo(t,i,r,!0),l=NC(t,i),a=[];return o.forEach(c=>{(s.has(c)||l.has(c))&&a.push(c)}),a.forEach(c=>o.delete(c)),o}function Ml(t,e){const{checkedKeys:i,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:l,leafOnly:a,checkStrategy:c,allowNotLoaded:d}=t;if(!l)return r!==void 0?{checkedKeys:xC(i,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:kC(i,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(i),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let f;o!==void 0?f=TC(o,i,e,d):r!==void 0?f=BC(r,i,e,d):f=Qo(i,e,d,!1);const h=c==="parent",m=c==="child"||a,p=f,g=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,k=u.get(y);for(const x of k){if(x.isLeaf)continue;const{key:v,shallowLoaded:N}=x;if(m&&N&&x.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&p.has($.key)&&p.delete($.key)}),x.disabled||!N)continue;let w=!0,T=!1,C=!0;for(const $ of x.children){const E=$.key;if(!$.disabled){if(C&&(C=!1),p.has(E))T=!0;else if(g.has(E)){T=!0,w=!1;break}else if(w=!1,T)break}}w&&!C?(h&&x.children.forEach($=>{!$.disabled&&p.has($.key)&&p.delete($.key)}),p.add(v)):T&&g.add(v),_&&m&&p.has(v)&&p.delete(v)}}return{checkedKeys:Array.from(p),indeterminateKeys:Array.from(g)}}function Qo(t,e,i,r){const{treeNodeMap:o,getChildren:s}=e,l=new Set,a=new Set(t);return t.forEach(c=>{const d=o.get(c);d!==void 0&&wf(d,u=>{if(u.disabled)return Pl.STOP;const{key:f}=u;if(!l.has(f)&&(l.add(f),a.add(f),_C(u.rawNode,s))){if(r)return Pl.STOP;if(!i)throw new SC}})}),a}function $C(t,{includeGroup:e=!1,includeSelf:i=!0},r){var o;const s=r.treeNodeMap;let l=t==null?null:(o=s.get(t))!==null&&o!==void 0?o:null;const a={keyPath:[],treeNodePath:[],treeNode:l};if(l!=null&&l.ignored)return a.treeNode=null,a;for(;l;)!l.ignored&&(e||!l.isGroup)&&a.treeNodePath.push(l),l=l.parent;return a.treeNodePath.reverse(),i||a.treeNodePath.pop(),a.keyPath=a.treeNodePath.map(c=>c.key),a}function EC(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function RC(t,e){const i=t.siblings,r=i.length,{index:o}=t;return e?i[(o+1)%r]:o===i.length-1?null:i[o+1]}function xf(t,e,{loop:i=!1,includeDisabled:r=!1}={}){const o=e==="prev"?PC:RC,s={reverse:e==="prev"};let l=!1,a=null;function c(d){if(d!==null){if(d===t){if(!l)l=!0;else if(!t.disabled&&!t.isGroup){a=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){a=d;return}if(d.isGroup){const u=Il(d,s);u!==null?a=u:c(o(d,i))}else{const u=o(d,!1);if(u!==null)c(u);else{const f=FC(d);f!=null&&f.isGroup?c(o(f,i)):i&&c(o(d,!0))}}}}return c(t),a}function PC(t,e){const i=t.siblings,r=i.length,{index:o}=t;return e?i[(o-1+r)%r]:o===0?null:i[o-1]}function FC(t){return t.parent}function Il(t,e={}){const{reverse:i=!1}=e,{children:r}=t;if(r){const{length:o}=r,s=i?o-1:0,l=i?-1:o,a=i?-1:1;for(let c=s;c!==l;c+=a){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Il(d,e);if(u!==null)return u}else return d}}return null}const VC={getChild(){return this.ignored?null:Il(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return xf(this,"next",t)},getPrev(t={}){return xf(this,"prev",t)}};function MC(t,e){const i=e?new Set(e):void 0,r=[];function o(s){s.forEach(l=>{r.push(l),!(l.isLeaf||!l.children||l.ignored)&&(l.isGroup||i===void 0||i.has(l.key))&&o(l.children)})}return o(t),r}function IC(t,e){const i=t.key;for(;e;){if(e.key===i)return!0;e=e.parent}return!1}var AC={};function kf(t,e,i,r,o,s=null,l=0){const a=[];return t.forEach((c,d)=>{var u;AC.NODE_ENV!=="production"&&wC(c,o)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=a,f.level=l,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===t.length,f.parent=s,!f.ignored){const h=o(c);Array.isArray(h)&&(f.children=kf(h,e,i,r,o,f,l+1))}a.push(f),e.set(f.key,f),i.has(l)||i.set(l,[]),(u=i.get(l))===null||u===void 0||u.push(f)}),a}function OC(t,e={}){var i;const r=new Map,o=new Map,{getDisabled:s=bC,getIgnored:l=gC,getIsGroup:a=CC,getKey:c=pC}=e,d=(i=e.getChildren)!==null&&i!==void 0?i:mC,u=e.ignoreEmptyChildren?x=>{const v=d(x);return Array.isArray(v)?v.length?v:null:v}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return a(this.rawNode)},get isLeaf(){return hC(this.rawNode,u)},get shallowLoaded(){return yC(this.rawNode,u)},get ignored(){return l(this.rawNode)},contains(x){return IC(this,x)}},VC),h=kf(t,r,o,f,u);function m(x){if(x==null)return null;const v=r.get(x);return v&&!v.isGroup&&!v.ignored?v:null}function p(x){if(x==null)return null;const v=r.get(x);return v&&!v.ignored?v:null}function g(x,v){const N=p(x);return N?N.getPrev(v):null}function b(x,v){const N=p(x);return N?N.getNext(v):null}function y(x){const v=p(x);return v?v.getParent():null}function _(x){const v=p(x);return v?v.getChild():null}const k={treeNodes:h,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return MC(h,x)},getNode:m,getPrev:g,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return EC(h)},getPath(x,v={}){return $C(x,v,k)},getCheckedKeys(x,v={}){const{cascade:N=!0,leafOnly:w=!1,checkStrategy:T="all",allowNotLoaded:C=!1}=v;return Ml({checkedKeys:Fl(x),indeterminateKeys:Vl(x),cascade:N,leafOnly:w,checkStrategy:T,allowNotLoaded:C},k)},check(x,v,N={}){const{cascade:w=!0,leafOnly:T=!1,checkStrategy:C="all",allowNotLoaded:$=!1}=N;return Ml({checkedKeys:Fl(v),indeterminateKeys:Vl(v),keysToCheck:x==null?[]:_f(x),cascade:w,leafOnly:T,checkStrategy:C,allowNotLoaded:$},k)},uncheck(x,v,N={}){const{cascade:w=!0,leafOnly:T=!1,checkStrategy:C="all",allowNotLoaded:$=!1}=N;return Ml({checkedKeys:Fl(v),indeterminateKeys:Vl(v),keysToUncheck:x==null?[]:_f(x),cascade:w,leafOnly:T,checkStrategy:C,allowNotLoaded:$},k)},getNonLeafKeys(x={}){return fC(h,x)}};return k}function Jo(t){return t.composedPath()[0]}const zC={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function DC(t,e,i){if(t==="mousemoveoutside"){const r=o=>{e.contains(Jo(o))||i(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=l=>{r=!e.contains(Jo(l))},s=l=>{r&&(e.contains(Jo(l))||i(l))};return{mousedown:o,mouseup:s,touchstart:o,touchend:s}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Cf(t,e,i){const r=zC[t];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let s=o.get(i);return s===void 0&&o.set(i,s=DC(t,e,i)),s}function LC(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=Cf(t,e,i);return Object.keys(o).forEach(s=>{It(s,document,o[s],r)}),!0}return!1}function HC(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=Cf(t,e,i);return Object.keys(o).forEach(s=>{ht(s,document,o[s],r)}),!0}return!1}function WC(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function i(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function o(w,T,C){const $=w[T];return w[T]=function(){return C.apply(w,arguments),$.apply(w,arguments)},w}function s(w,T){w[T]=Event.prototype[T]}const l=new WeakMap,a=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=l.get(this))!==null&&w!==void 0?w:null}function d(w,T){a!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:T??a.get})}const u={bubble:{},capture:{}},f={};function h(){const w=function(T){const{type:C,eventPhase:$,bubbles:E}=T,V=Jo(T);if($===2)return;const P=$===1?"capture":"bubble";let I=V;const K=[];for(;I===null&&(I=window),K.push(I),I!==window;)I=I.parentNode||null;const J=u.capture[C],Z=u.bubble[C];if(o(T,"stopPropagation",i),o(T,"stopImmediatePropagation",r),d(T,c),P==="capture"){if(J===void 0)return;for(let L=K.length-1;L>=0&&!t.has(T);--L){const O=K[L],z=J.get(O);if(z!==void 0){l.set(T,O);for(const M of z){if(e.has(T))break;M(T)}}if(L===0&&!E&&Z!==void 0){const M=Z.get(O);if(M!==void 0)for(const R of M){if(e.has(T))break;R(T)}}}}else if(P==="bubble"){if(Z===void 0)return;for(let L=0;L<K.length&&!t.has(T);++L){const O=K[L],z=Z.get(O);if(z!==void 0){l.set(T,O);for(const M of z){if(e.has(T))break;M(T)}}}}s(T,"stopPropagation"),s(T,"stopImmediatePropagation"),d(T)};return w.displayName="evtdUnifiedHandler",w}function m(){const w=function(T){const{type:C,eventPhase:$}=T;if($!==2)return;const E=f[C];E!==void 0&&E.forEach(V=>V(T))};return w.displayName="evtdUnifiedWindowEventHandler",w}const p=h(),g=m();function b(w,T){const C=u[w];return C[T]===void 0&&(C[T]=new Map,window.addEventListener(T,p,w==="capture")),C[T]}function y(w){return f[w]===void 0&&(f[w]=new Set,window.addEventListener(w,g)),f[w]}function _(w,T){let C=w.get(T);return C===void 0&&w.set(T,C=new Set),C}function k(w,T,C,$){const E=u[T][C];if(E!==void 0){const V=E.get(w);if(V!==void 0&&V.has($))return!0}return!1}function x(w,T){const C=f[w];return!!(C!==void 0&&C.has(T))}function v(w,T,C,$){let E;if(typeof $=="object"&&$.once===!0?E=J=>{N(w,T,E,$),C(J)}:E=C,LC(w,T,E,$))return;const P=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",I=b(P,w),K=_(I,T);if(K.has(E)||K.add(E),T===window){const J=y(w);J.has(E)||J.add(E)}}function N(w,T,C,$){if(HC(w,T,C,$))return;const V=$===!0||typeof $=="object"&&$.capture===!0,P=V?"capture":"bubble",I=b(P,w),K=_(I,T);if(T===window&&!k(T,V?"bubble":"capture",w,C)&&x(w,C)){const Z=f[w];Z.delete(C),Z.size===0&&(window.removeEventListener(w,g),f[w]=void 0)}K.has(C)&&K.delete(C),K.size===0&&I.delete(T),I.size===0&&(window.removeEventListener(w,p,P==="capture"),u[P][w]=void 0)}return{on:v,off:N}}const{on:It,off:ht}=WC(),ur="@@mmoContext",jC={mounted(t,{value:e}){t[ur]={handler:void 0},typeof e=="function"&&(t[ur].handler=e,It("mousemoveoutside",t,e))},updated(t,{value:e}){const i=t[ur];typeof e=="function"?i.handler?i.handler!==e&&(ht("mousemoveoutside",t,i.handler),i.handler=e,It("mousemoveoutside",t,e)):(t[ur].handler=e,It("mousemoveoutside",t,e)):i.handler&&(ht("mousemoveoutside",t,i.handler),i.handler=void 0)},unmounted(t){const{handler:e}=t[ur];e&&ht("mousemoveoutside",t,e),t[ur].handler=void 0}},fr="@@coContext",es={mounted(t,{value:e,modifiers:i}){t[fr]={handler:void 0},typeof e=="function"&&(t[fr].handler=e,It("clickoutside",t,e,{capture:i.capture}))},updated(t,{value:e,modifiers:i}){const r=t[fr];typeof e=="function"?r.handler?r.handler!==e&&(ht("clickoutside",t,r.handler,{capture:i.capture}),r.handler=e,It("clickoutside",t,e,{capture:i.capture})):(t[fr].handler=e,It("clickoutside",t,e,{capture:i.capture})):r.handler&&(ht("clickoutside",t,r.handler,{capture:i.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:i}=t[fr];i&&ht("clickoutside",t,i,{capture:e.capture}),t[fr].handler=void 0}};function qC(t,e){console.error(`[vdirs/${t}]: ${e}`)}class XC{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,i){const{elementZIndex:r}=this;if(i!==void 0){e.style.zIndex=`${i}`,r.delete(e);return}const{nextZIndex:o}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${o}`,r.set(e,o),this.nextZIndex=o+1,this.squashState())}unregister(e,i){const{elementZIndex:r}=this;r.has(e)?r.delete(e):i===void 0&&qC("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((i,r)=>i[1]-r[1]),this.nextZIndex=2e3,e.forEach(i=>{const r=i[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Al=new XC,hr="@@ziContext",vf={mounted(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i;t[hr]={enabled:!!o,initialized:!1},o&&(Al.ensureZIndex(t,r),t[hr].initialized=!0)},updated(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i,s=t[hr].enabled;o&&!s&&(Al.ensureZIndex(t,r),t[hr].initialized=!0),t[hr].enabled=!!o},unmounted(t,e){if(!t[hr].initialized)return;const{value:i={}}=e,{zIndex:r}=i;Al.unregister(t,r)}};function YC(t){const e=n.ref(!!t.value);if(e.value)return n.readonly(e);const i=n.watch(t,r=>{r&&(e.value=!0,i())});return n.readonly(e)}function on(t){const e=n.computed(t),i=n.ref(e.value);return n.watch(e,r=>{i.value=r}),typeof t=="function"?i:{__v_isRef:!0,get value(){return i.value},set value(r){t.set(r)}}}const UC=typeof window<"u";let mr,Lr;(()=>{var t,e;mr=UC?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,Lr=!1,mr!==void 0?mr.then(()=>{Lr=!0}):Lr=!0})();function KC(t){if(Lr)return;let e=!1;n.onMounted(()=>{Lr||mr==null||mr.then(()=>{e||t()})}),n.onBeforeUnmount(()=>{e=!0})}function Ol(t,e){return n.watch(t,i=>{i!==void 0&&(e.value=i)}),n.computed(()=>t.value===void 0?e.value:t.value)}function ts(){const t=n.ref(!1);return n.onMounted(()=>{t.value=!0}),n.readonly(t)}function Sf(t,e){return n.computed(()=>{for(const i of e)if(t[i]!==void 0)return t[i];return t[e[e.length-1]]})}const GC=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function ZC(){return GC}function zl(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);return r()}function Dl(t,e=!0,i=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(n.createTextVNode(String(r)));return}if(Array.isArray(r)){Dl(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Dl(r.children,e,i)}else r.type!==n.Comment&&i.push(r)}}),i}function Bf(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);const o=Dl(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${i}] should have exactly one child.`)}let di=null;function Nf(){if(di===null&&(di=document.getElementById("v-binder-view-measurer"),di===null)){di=document.createElement("div"),di.id="v-binder-view-measurer";const{style:t}=di;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(di)}return di.getBoundingClientRect()}function QC(t,e){const i=Nf();return{top:e,left:t,height:0,width:0,right:i.width-t,bottom:i.height-e}}function Ll(t){const e=t.getBoundingClientRect(),i=Nf();return{left:e.left-i.left,top:e.top-i.top,bottom:i.height+i.top-e.bottom,right:i.width+i.left-e.right,width:e.width,height:e.height}}function JC(t){return t.nodeType===9?null:t.parentNode}function Tf(t){if(t===null)return null;const e=JC(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:i,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(i+o+r))return e}return Tf(e)}const $f=n.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;n.provide("VBinder",(e=n.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const i=n.inject("VBinder",null),r=n.ref(null),o=y=>{r.value=y,i&&t.syncTargetWithParent&&i.setTargetRef(y)};let s=[];const l=()=>{let y=r.value;for(;y=Tf(y),y!==null;)s.push(y);for(const _ of s)It("scroll",_,f,!0)},a=()=>{for(const y of s)ht("scroll",y,f,!0);s=[]},c=new Set,d=y=>{c.size===0&&l(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&a()},f=()=>{hf(h)},h=()=>{c.forEach(y=>y())},m=new Set,p=y=>{m.size===0&&It("resize",window,b),m.has(y)||m.add(y)},g=y=>{m.has(y)&&m.delete(y),m.size===0&&ht("resize",window,b)},b=()=>{m.forEach(y=>y())};return n.onBeforeUnmount(()=>{ht("resize",window,b),a()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:p,removeResizeListener:g}},render(){return zl("binder",this.$slots)}}),Ef=n.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=n.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?n.withDirectives(Bf("follower",this.$slots),[[e]]):Bf("follower",this.$slots)}}),ev="@css-render/vue3-ssr";function tv(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},Ro=ki.Multiply,x0=[1,0,0,0,1,0,0,0,1],li=new xn(9),k0=vt.Utils,Nd=new re,al=new xn([0,0,1,0,0,1,0,1,1,0,1,1]),Se={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ue.document?Ue.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new ki,group:{removeChild:function(t,e){if(t.children)for(let i=0;i<t.children.length;i++)Se.group.removeChild(t.children[i],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;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.parent,r=i._matrix&&i._matrix.manual||i._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((r||o)&&(this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,i._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re),this._scale instanceof re?(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(i._renderer.type)||(this._renderer.scale.x*=i._renderer.scale.x,this._renderer.scale.y*=i._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 l=vt.Utils.getRendererType(this._mask._renderer.type);Se[l].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=i._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);let s;if(this._flagSubtractions)for(s=0;s<this.subtractions.length;s++)Se.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const l=this.children[s],a=vt.Utils.getRendererType(l._renderer.type);Se[a].render.call(l,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let i,r,o,s,l,a,c,d,u,f,h,m,p,g;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,k=t.renderer.ratio,x=Nd.copy(e._renderer.scale).multiply(k),v=e._stroke,N=e._linewidth,w=e._fill,T=e._renderer.opacity||e._opacity,C=e._cap,$=e._join,E=e._miter,V=e._closed,P=e.dashes,I=b.length,U=I-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const J=e._renderer.rect.centroid,Z=J.x,L=J.y;if(_.clearRect(0,0,y.width,y.height),w)if(typeof w=="string")_.fillStyle=w;else{const j=vt.Utils.getRendererType(w._renderer.type);Se[j].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(v){if(typeof v=="string")_.strokeStyle=v;else{const j=vt.Utils.getRendererType(v._renderer.type);Se[j].render.call(v,_,e),_.strokeStyle=v._renderer.effect}N&&(_.lineWidth=kn(e)),E&&(_.miterLimit=E),$&&(_.lineJoin=$),!V&&C&&(_.lineCap=C)}typeof T=="number"&&(_.globalAlpha=T),P&&P.length>0&&(_.lineDashOffset=P.offset||0,_.setLineDash(P));let O,z,M,R,W,K,G,X;_.save(),_.scale(x.x,x.y),_.translate(Z,L),_.beginPath();for(let j=0;j<b.length;j++){const q=b[j];switch(m=q.x,p=q.y,q.command){case ie.close:_.closePath();break;case ie.arc:z=q.rx,M=q.ry,R=q.xAxisRotation,W=q.largeArcFlag,K=q.sweepFlag,i=V?ot(j-1,I):Math.max(j-1,0),r=b[i],G=r.x,X=r.y,k0.renderSvgArcCommand(_,G,X,z,M,W,K,R,m,p);break;case ie.curve:i=V?ot(j-1,I):Math.max(j-1,0),r=b[i],d=r.controls&&r.controls.right||re.zero,u=q.controls&&q.controls.left||re.zero,r._relative?(a=d.x+r.x,c=d.y+r.y):(a=d.x,c=d.y),q._relative?(s=u.x+q.x,l=u.y+q.y):(s=u.x,l=u.y),_.bezierCurveTo(a,c,s,l,m,p),j>=U&&V&&(o=O,f=q.controls&&q.controls.right||re.zero,h=o.controls&&o.controls.left||re.zero,q._relative?(a=f.x+q.x,c=f.y+q.y):(a=f.x,c=f.y),o._relative?(s=h.x+o.x,l=h.y+o.y):(s=h.x,l=h.y),m=o.x,p=o.y,_.bezierCurveTo(a,c,s,l,m,p));break;case ie.line:_.lineTo(m,p);break;case ie.move:O=q,_.moveTo(m,p);break}}V&&_.closePath(),Se.isHidden.test(w)||(g=w._renderer&&w._renderer.offset,g&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),g&&_.restore()),Se.isHidden.test(v)||(g=v._renderer&&v._renderer.offset,g&&(_.save(),_.translate(-v._renderer.offset.x,-v._renderer.offset.y),_.scale(v._renderer.scale.x,v._renderer.scale.y),_.lineWidth=N/v._renderer.scale.x),_.stroke(),g&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,i){let r=1/0,o=-1/0,s=1/0,l=-1/0,a,c;t.forEach(function(d){const u=d.x,f=d.y,h=d.controls;let m,p,g,b,y,_;s=Math.min(f,s),r=Math.min(u,r),o=Math.max(u,o),l=Math.max(f,l),d.controls&&(y=h.left,_=h.right,!(!y||!_)&&(m=d._relative?y.x+u:y.x,p=d._relative?y.y+f:y.y,g=d._relative?_.x+u:_.x,b=d._relative?_.y+f:_.y,!(!m||!p||!g||!b)&&(s=Math.min(p,b,s),r=Math.min(m,g,r),o=Math.max(m,g,o),l=Math.max(p,b,l))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,l+=e),a=o-r,c=l-s,i.top=s,i.left=r,i.right=o,i.bottom=l,i.width=a,i.height=c,i.centroid||(i.centroid={}),i.centroid.x=-r,i.centroid.y=-s},render:function(t,e,i){if(!this._visible||!this._opacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||this.parent,o=vt.Utils.getRendererType(this._renderer.type),s=e[o],l=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ze&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ze&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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(l||a||c){this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let f,h;this._scale instanceof re?(f=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=h<0?-h:h,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const f=vt.Utils.getRendererType(this._mask._renderer.type);Se[f].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Se.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Se.updateTexture.call(Se,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!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,al,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 u=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let i;const r=this.canvas,o=this.ctx,s=t.renderer.ratio,l=e._stroke,a=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._size*s;let h=f;Se.isHidden.test(l)||(h+=a),r.width=hc(h),r.height=r.width;const m=h/r.width,p=r.width/2,g=r.height/2;if(o.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")o.fillStyle=c;else{const b=vt.Utils.getRendererType(c._renderer.type);Se[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(l){if(typeof l=="string")o.strokeStyle=l;else{const b=vt.Utils.getRendererType(l._renderer.type);Se[b].render.call(l,o,e),o.strokeStyle=l._renderer.effect}a&&(o.lineWidth=kn(e)/m)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(p,g),o.scale(Se.precision,Se.precision),o.beginPath(),o.arc(0,0,f/m*.5,0,tt),o.restore(),closed&&o.closePath(),Se.isHidden.test(c)||(i=c._renderer&&c._renderer.offset,i&&(o.save(),o.translate(-c._renderer.offset.x,-c._renderer.offset.y),o.scale(c._renderer.scale.x,c._renderer.scale.y)),o.fill(),i&&o.restore()),Se.isHidden.test(l)||(i=l._renderer&&l._renderer.offset,i&&(o.save(),o.translate(-l._renderer.offset.x,-l._renderer.offset.y),o.scale(l._renderer.scale.x,l._renderer.scale.y),o.lineWidth=a/l._renderer.scale.x),o.stroke(),i&&o.restore())},render:function(t,e,i){if(!this._visible||!this._opacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const o=i||this.parent,s=e[this._renderer.type],l=this._sizeAttenuation,a=this._stroke,c=this._linewidth,d=o._matrix.manual||o._flagMatrix,u=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==o,h=this._renderer.vertices,m=this._renderer.collection.length,p=this._flagVertices,g=this._flagFill||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ze&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ze&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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||o._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||u||f){this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let b,y;this._scale instanceof re?(b=this._scale.x*o._renderer.scale.x,y=this._scale.y*o._renderer.scale.y):(b=this._scale*o._renderer.scale.x,y=this._scale*o._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=o)}if(p){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,h,t.STATIC_DRAW)}return g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Se.updateTexture.call(Se,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture?this:(Se.isHidden.test(a)||(r+=c),r/=Se.precision,l&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==s&&(t.useProgram(s),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),t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform1f(s.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,m),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const i=this.canvas,r=this.ctx,o=t.renderer.ratio,s=Nd.copy(e._renderer.scale).multiply(o),l=e._stroke,a=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._decoration,h=e._direction;i.width=Math.max(Math.ceil(e._renderer.rect.width*s.x),1),i.height=Math.max(Math.ceil(e._renderer.rect.height*s.y),1);const m=e._renderer.rect.centroid,p=m.x,g=m.y;let b,y,_,k,x,v,N,w,T,C,$;const E=c._renderer&&c._renderer.offset&&l._renderer&&l._renderer.offset;if(r.clearRect(0,0,i.width,i.height),E||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=h,c)if(typeof c=="string")r.fillStyle=c;else{const V=vt.Utils.getRendererType(c._renderer.type);Se[V].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(l){if(typeof l=="string")r.strokeStyle=l;else{const V=vt.Utils.getRendererType(l._renderer.type);Se[V].render.call(l,r,e),r.strokeStyle=l._renderer.effect}a&&(r.lineWidth=kn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(s.x,s.y),r.translate(p,g),Se.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,N=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,N),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,k=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,k),r.restore()):r.fillText(e.value,0,0)),Se.isHidden.test(l)||(l._renderer&&l._renderer.offset?(v=l._renderer.scale.x,N=l._renderer.scale.y,r.save(),r.translate(-l._renderer.offset.x,-l._renderer.offset.y),r.scale(v,N),b=e._size/l._renderer.scale.y,y=e._leading/l._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=l._renderer.offset.x/l._renderer.scale.x,k=l._renderer.offset.y/l._renderer.scale.y,x=a/l._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,k),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const V=r.measureText(e.value);switch(f){case"underline":T=V.actualBoundingBoxDescent,$=V.actualBoundingBoxDescent;break;case"strikethrough":T=0,$=0;break}w=-V.width/2,C=V.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,T),r.lineTo(C,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const i=Se.ctx;i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),i.textAlign="center",i.textBaseline=vt.Utils.baselines[t._baseline]||t._baseline;const r=i.measureText(t._value);let o=r.width,s=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!Se.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const l=o/2,a=s/2;switch(Se.alignments[t._alignment]||t._alignment){case Se.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Se.alignments.right:t.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-l,e.right=l}switch(t._baseline){case"bottom":e.top=-s,e.bottom=0;break;case"top":e.top=0,e.bottom=s;break;case"baseline":e.top=-a*1.5,e.bottom=a*.5;break;default:e.top=-a,e.bottom=a}e.width=o,e.height=s,e.centroid||(e.centroid={}),e.centroid.x=l,e.centroid.y=a},render:function(t,e,i){if(!this._visible||!this._opacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||this.parent,o=e[this._renderer.type],s=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,a=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ze&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ze&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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(s||l||a){this._renderer.matrix||(this._renderer.matrix=new xn(9)),this._matrix.toTransformArray(!0,li),Ro(li,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,f;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,a&&(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=vt.Utils.getRendererType(this._mask._renderer.type);Se[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,Se.text.getBoundingClientRect(this,this._renderer.rect),Se.updateTexture.call(Se,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!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,al,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 d=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let i,r=this.left._x,o=this.left._y,s=this.right._x,l=this.right._y;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width,o=(o-.5)*i.height,s=(s-.5)*i.width,l=(l-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,l);for(let a=0;a<this.stops.length;a++){const c=this.stops[a];this._renderer.effect.addColorStop(c._offset,c._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let i,r=this.center._x,o=this.center._y,s=this.focal._x,l=this.focal._y,a=this._radius;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width*.5,o=(o-.5)*i.height*.5,s=(s-.5)*i.width*.5,l=(l-.5)*i.height*.5,a*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,l,a);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(i,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,i&&(this._renderer.offset.x+=i.width/2,this._renderer.offset.y+=i.height/2,this._scale instanceof re?(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 re||(this._renderer.scale=new re);let r,o;this._scale instanceof re?(r=this._scale.x,o=this._scale.y):(r=this._scale,o=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=o<0?-o:o}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const i=vt.Utils.getRendererType(e._renderer.type);if(this[i].updateCanvas.call(Se,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 i,r,o;if(i=t.createProgram(),oe.each(e,function(s){t.attachShader(i,s)}),t.linkProgram(i),r=t.getProgramParameter(i,t.LINK_STATUS),!r)throw o=t.getProgramInfoLog(i),t.deleteProgram(i),new Lt("unable to link program: "+o);return i}},extensions:{init:function(t){const e={},i=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<i.length;r++){const o=i[r];e[o]=Se.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new fo};Se.ctx=Se.canvas.getContext("2d");var Td=class extends ee{constructor(t){super();let e,i,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(Se.canvas=t.offscreenElement,Se.ctx=Se.canvas.getContext("2d")),this.scene=new pt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new xn(x0),scale:1,opacity:1},this._flagMatrix=!0,t=oe.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 Lt("unable to create a webgl context. Try using another renderer.");r=rn.create(e,rn.path.vertex,rn.types.vertex),o=rn.create(e,rn.path.fragment,rn.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},i=this.programs.path=Se.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Se.extensions.init(e),e.renderer=this,i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.rect=e.getUniformLocation(i,"u_rect");const s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,al,e.STATIC_DRAW),r=rn.create(e,rn.points.vertex,rn.types.vertex),o=rn.create(e,rn.points.fragment,rn.types.fragment),i=this.programs.points=Se.program.create(e,[r,o]),i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.size=e.getUniformLocation(i,"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,i){let r,o;const s=this.ctx;return this.width=t,this.height=e,this.ratio=typeof i>"u"?Is(s):i,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,oe.isObject(this.domElement.style)&&oe.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,o=e*this.ratio,s.viewport(0,0,r,o),this.programs.resolution.width=r,this.programs.resolution.height=o,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(ee.Types.resize,t,e,i)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),Se.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};S(Td,"Utils",Se);var C0=oe.extend({Error:Lt,getRatio:Is,read:Ke,xhr:xd},oe,Pt,cc,dc),Ne=class io{constructor(e){S(this,"_events",new ee),S(this,"type",""),S(this,"renderer",null),S(this,"scene",null),S(this,"width",0),S(this,"height",0),S(this,"frameCount",0),S(this,"timeDelta",0),S(this,"playing",!1);const i=oe.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:io.Types.svg,autostart:!1});if(oe.each(i,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),oe.isElement(i.domElement)){const r=i.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=io.Types[r])}this.renderer=new io[this.type](this),this.setPlaying(i.autostart),this.frameCount=0,i.fullscreen?(this.fit=v0.bind(this),this.fit.domElement=window,this.fit.attached=!0,oe.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),oe.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Kt.bind(this.fit.domElement,"resize",this.fit),this.fit()):i.fitted?(this.fit=S0.bind(this),oe.extend(this.renderer.domElement.style,{display:"block"})):typeof i.width=="number"&&typeof i.height=="number"&&(this.renderer.setSize(i.width,i.height,this.ratio),this.width=i.width,this.height=i.height),this.renderer.bind(ee.Types.resize,B0.bind(this)),this.scene=this.renderer.scene,io.Instances.push(this),i.autostart&&Pr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=this._events.listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=this._events.ignore)==null?void 0:e.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,Pr.init(),this.trigger(ee.Types.play)}pause(){return this.playing=!1,this.trigger(ee.Types.pause)}setPlaying(e){this.playing=e}release(e){let i,r,o;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&typeof e.fill.unbind=="function"&&e.fill.unbind(),typeof e.stroke=="object"&&typeof e.stroke.unbind=="function"&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(i=0;i<e.vertices.length;i++)r=e.vertices[i],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(i=0;i<e.children.length;i++)o=e.children[i],this.release(o);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 s=this.renderer.ctx;e._renderer.texture&&(s.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(s.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}getShapesAtPoint(e,i,r){return this.scene&&typeof this.scene.getShapesAtPoint=="function"?this.scene.getShapesAtPoint(e,i,r):[]}update(){const e=!!this._lastFrame,i=oe.performance.now();e&&(this.timeDelta=parseFloat((i-this._lastFrame).toFixed(3))),this._lastFrame=i,this.fit&&this.fit.domElement&&!this.fit.attached&&(Kt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,o=this.height,s=this.renderer;return(r!==s.width||o!==s.height)&&s.setSize(r,o,this.ratio),this.trigger(ee.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(ee.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,i,r,o){const s=new Bo(e,i,r,o);return this.scene.add(s),s}makeArrow(e,i,r,o,s){const l=typeof s=="number"?s:10,a=Math.atan2(o-i,r-e),c=[new $e(e,i,void 0,void 0,void 0,void 0,ie.move),new $e(r,o,void 0,void 0,void 0,void 0,ie.line),new $e(r-l*Math.cos(a-Math.PI/4),o-l*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ie.line),new $e(r,o,void 0,void 0,void 0,void 0,ie.move),new $e(r-l*Math.cos(a+Math.PI/4),o-l*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ie.line)],d=new Re(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,i,r,o){const s=new si(e,i,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,i,r,o,s){const l=new Co(e,i,r,o,s);return this.scene.add(l),l}makeCircle(e,i,r,o){const s=new xo(e,i,r,o);return this.scene.add(s),s}makeEllipse(e,i,r,o,s){const l=new ko(e,i,r,o,s);return this.scene.add(l),l}makeStar(e,i,r,o,s){const l=new Js(e,i,r,o,s);return this.scene.add(l),l}makeCurve(e){const i=arguments.length;if(!Array.isArray(e)){e=[];for(let l=0;l<i;l+=2){const a=arguments[l];if(typeof a!="number")break;const c=arguments[l+1];e.push(new $e(a,c))}}const r=arguments[i-1],o=new Re(e,!(typeof r=="boolean"&&r),!0),s=o.getBoundingClientRect();return o.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(o),o}makePolygon(e,i,r,o){const s=new Qs(e,i,r,o);return this.scene.add(s),s}makeArcSegment(e,i,r,o,s,l,a){const c=new Xs(e,i,r,o,s,l,a);return this.scene.add(c),c}makePoints(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let s=0;s<i;s+=2){const l=arguments[s];if(typeof l!="number")break;const a=arguments[s+1];r.push(new re(l,a))}}const o=new Zs(r);return this.scene.add(o),o}makePath(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let a=0;a<i;a+=2){const c=arguments[a];if(typeof c!="number")break;const d=arguments[a+1];r.push(new $e(c,d))}}const o=arguments[i-1],s=new Re(r,!(typeof o=="boolean"&&o)),l=s.getBoundingClientRect();return typeof l.top=="number"&&typeof l.left=="number"&&typeof l.right=="number"&&typeof l.bottom=="number"&&s.center().translation.set(l.left+l.width/2,l.top+l.height/2),this.scene.add(s),s}makeText(e,i,r,o){const s=new Cn(e,i,r,o);return this.add(s),s}makeLinearGradient(e,i,r,o){const s=Array.prototype.slice.call(arguments,4),l=new Ge(e,i,r,o,s);return this.add(l),l}makeRadialGradient(e,i,r){const o=Array.prototype.slice.call(arguments,3),s=new Ze(e,i,r,o);return this.add(s),s}makeSprite(e,i,r,o,s,l,a){const c=new wo(e,i,r,o,s,l);return a&&c.play(),this.add(c),c}makeImage(e,i,r,o,s,l){const a=new kd(e,i,r,o,s,l);return this.add(a),a}makeImageSequence(e,i,r,o,s){const l=new il(e,i,r,o);return s&&l.play(),this.add(l),l}makeTexture(e,i){return new De(e,i)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const i=new pt;return this.scene.add(i),i.add(e),i}interpret(e,i,r){const o=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(o in Ke))return null;const s=Ke[o].call(this,e);return r?this.add(i&&s instanceof pt?s.children:s):s.parent&&s.remove(),s}load(e,i){const r=new pt;let o,s,l;const a=(function(c){for(Kt.temp.innerHTML=c,s=0;s<Kt.temp.children.length;s++)o=Kt.temp.children[s],l=this.interpret(o,!1,!1),l!==null&&r.add(l);if(typeof i=="function"){const d=Kt.temp.children.length<=1?Kt.temp.children[0]:Kt.temp.children;i(r,d)}}).bind(this);return/\.svg$/i.test(e)?(xd(e,a),r):(a(e),r)}};S(Ne,"NextFrameId",kt.NextFrameId),S(Ne,"Types",kt.Types),S(Ne,"Version",kt.Version),S(Ne,"PublishDate",kt.PublishDate),S(Ne,"Identifier",kt.Identifier),S(Ne,"Resolution",kt.Resolution),S(Ne,"AutoCalculateImportedMatrices",kt.AutoCalculateImportedMatrices),S(Ne,"Instances",kt.Instances),S(Ne,"uniqueId",kt.uniqueId),S(Ne,"Anchor",$e),S(Ne,"Collection",ri),S(Ne,"Events",ee),S(Ne,"Group",pt),S(Ne,"Matrix",ki),S(Ne,"Path",Re),S(Ne,"Registry",fo),S(Ne,"Element",Ji),S(Ne,"Shape",zn),S(Ne,"Text",Cn),S(Ne,"Vector",re),S(Ne,"Gradient",ut),S(Ne,"Image",kd),S(Ne,"ImageSequence",il),S(Ne,"LinearGradient",Ge),S(Ne,"RadialGradient",Ze),S(Ne,"Sprite",wo),S(Ne,"Stop",oi),S(Ne,"Texture",De),S(Ne,"ArcSegment",Xs),S(Ne,"Circle",xo),S(Ne,"Ellipse",ko),S(Ne,"Line",Bo),S(Ne,"Points",Zs),S(Ne,"Polygon",Qs),S(Ne,"Rectangle",si),S(Ne,"RoundedRectangle",Co),S(Ne,"Star",Js),S(Ne,"CanvasRenderer",vt),S(Ne,"SVGRenderer",Bd),S(Ne,"WebGLRenderer",Td),S(Ne,"Commands",ie),S(Ne,"Utils",C0);var Sn=Ne;function v0(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio)}function S0(){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(),i=this.width=e.width,r=this.height=e.height;this.renderer.setSize(i,r,this.ratio)}function B0(t,e){this.width=t,this.height=e,this.trigger(ee.Types.resize,t,e)}var Pr=Kt.getRequestAnimationFrame();function $d(){for(let t=0;t<Sn.Instances.length;t++){const e=Sn.Instances[t];e.playing&&e.update()}Sn.NextFrameId=Pr($d)}Pr.init=function(){$d(),Pr.init=function(){}};let Bn;typeof window<"u"?Bn=window:typeof global<"u"?Bn=global:typeof self<"u"&&(Bn=self);let Ed;const Ut=Math.PI*2,gt=Math.PI*.5;function N0(t,e,i,r,o,s){let l;return arguments.length<=1?(l=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):l=t,{translateX:o,translateY:s,scaleX:Math.sqrt(l*l+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,l)/Math.PI}}function T0(t){Ed=t}function $0(t,e){e=e&&e.identity()||new Ed;let i=t;const r=[];for(;i&&i._matrix;)r.push(i._matrix),i=i.parent;r.reverse();for(let o=0;o<r.length;o++){const l=r[o].elements;e.multiply(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8])}return e}function Wt(t,e,i){return i*(e-t)+t}function jt(t,e){for(;t<0;)t+=e;return t%e}const Rd=Bn.Float32Array||Array,E0=Math.floor;function Nn(t){return E0(t*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",arc:"A",close:"Z"};class ne{constructor(){B(this,"_events",{});B(this,"_bound",!1)}addEventListener(e,i){return(this._events[e]||(this._events[e]=[])).push(i),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,i){if(!this._events)return this;if(!e&&!i)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let l=this._events[e];if(l){let a=[];if(i)for(let c=0,d=l.length;c<d;c++){let u=l[c];u=u.handler?u.handler:u,i!==u&&a.push(u)}this._events[e]=a}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const i=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...i);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,i,r){const o=this;e&&(s.obj=e,s.name=i,s.handler=r,e.on(i,s));function s(){r.apply(o,arguments)}return o}ignore(e,i,r){return e.off(i,r),this}}B(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Pd={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ne.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ne.Types.change))}}},_t=class _t extends ne{constructor(i=0,r=0){super();B(this,"_x",0);B(this,"_y",0);for(let o in Pd)Object.defineProperty(this,o,Pd[o]);this.x=i,this.y=r}static add(i,r){return new _t(i.x+r.x,i.y+r.y)}static sub(i,r){return new _t(i.x-r.x,i.y-r.y)}static subtract(i,r){return _t.sub(i,r)}static ratioBetween(i,r){return(i.x*r.x+i.y*r.y)/(i.length()*r.length())}static angleBetween(i,r){if(arguments.length>=4){const l=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,l)}const o=i.x-r.x,s=i.y-r.y;return Math.atan2(s,o)}static distanceBetween(i,r){return Math.sqrt(_t.distanceBetweenSquared(i,r))}static distanceBetweenSquared(i,r){const o=i.x-r.x,s=i.y-r.y;return o*o+s*s}set(i,r){return this.x=i,this.y=r,this}copy(i){return this.x=i.x,this.y=i.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new _t(this.x,this.y)}add(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x+=i,this.y+=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x+=i.x,this.y+=i.y):(this.x+=i,this.y+=r),this)}addSelf(i){return this.add.apply(this,arguments)}sub(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x-=i,this.y-=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x-=i.x,this.y-=i.y):(this.x-=i,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(i){return this.sub.apply(this,arguments)}subtractSelf(i){return this.sub.apply(this,arguments)}multiply(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x*=i,this.y*=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x*=i.x,this.y*=i.y):(this.x*=i,this.y*=r),this)}multiplySelf(i){return this.multiply.apply(this,arguments)}multiplyScalar(i){return this.multiply(i)}divide(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x/=i,this.y/=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x/=i.x,this.y/=i.y):(this.x/=i,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(i){return this.divide.apply(this,arguments)}divideScalar(i){return this.divide(i)}negate(){return this.multiply(-1)}dot(i){return this.x*i.x+this.y*i.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(i){return Math.sqrt(this.distanceToSquared(i))}distanceToSquared(i){const r=this.x-i.x,o=this.y-i.y;return r*r+o*o}setLength(i){return this.normalize().multiplyScalar(i)}equals(i,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(i)<r}lerp(i,r){const o=(i.x-this.x)*r+this.x,s=(i.y-this.y)*r+this.y;return this.set(o,s)}isZero(i){return i=typeof i>"u"?1e-4:i,this.length()<i}toString(){return this.x+", "+this.y}toObject(){return{x:Nn(this.x),y:Nn(this.y)}}rotate(i){const r=this.x,o=this.y,s=Math.cos(i),l=Math.sin(i);return this.x=r*s-o*l,this.y=r*l+o*s,this}};B(_t,"zero",new _t),B(_t,"left",new _t(-1,0)),B(_t,"right",new _t(1,0)),B(_t,"up",new _t(0,-1)),B(_t,"down",new _t(0,1));let pe=_t;class Ae extends pe{constructor(i=0,r=0,o=0,s=0,l=0,a=0,c=fe.move){super(i,r);B(this,"controls",{left:new pe,right:new pe});B(this,"_command",fe.move);B(this,"_relative",!0);B(this,"_rx",0);B(this,"_ry",0);B(this,"_xAxisRotation",0);B(this,"_largeArcFlag",0);B(this,"_sweepFlag",1);for(let u in Fd)Object.defineProperty(this,u,Fd[u]);this.command=c,this.relative=!0;const d=Ae.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(ne.Types.change,d),this.controls.right.set(l,a).addEventListener(ne.Types.change,d)}static makeBroadcast(i){return r;function r(){i._bound&&i.dispatchEvent(ne.Types.change)}}static fromObject(i){return new Ae().copy(i)}copy(i){return this.x=i.x,this.y=i.y,typeof i.command=="string"&&(this.command=i.command),i.controls&&(i.controls.left&&this.controls.left.copy(i.controls.left),i.controls.right&&this.controls.right.copy(i.controls.right)),typeof i.relative=="boolean"&&(this.relative=i.relative),typeof i.rx=="number"&&(this.rx=i.rx),typeof i.ry=="number"&&(this.ry=i.ry),typeof i.xAxisRotation=="number"&&(this.xAxisRotation=i.xAxisRotation),typeof i.largeArcFlag=="number"&&(this.largeArcFlag=i.largeArcFlag),typeof i.sweepFlag=="number"&&(this.sweepFlag=i.sweepFlag),this}clone(){return new Ae().copy(this)}toObject(){return{x:Nn(this.x),y:Nn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Nn(this.rx),ry:Nn(this.ry),xAxisRotation:Nn(this.xAxisRotation),largeArcFlag:Nn(this.largeArcFlag),sweepFlag:Nn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Fd={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ne.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ne.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ne.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ne.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ne.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}}};let R0=0;const Po={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return R0++}},Fo={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 Vo(t,e,i,r,o){const s=1-t;return s*s*s*e+3*s*s*t*i+3*s*t*t*r+t*t*t*o}function Vd(t,e,i,r,o,s,l,a,c){c=c||Fo.RecursionLimit;const d=c+1;if(Math.abs(t-l)<.001&&Math.abs(e-a)<.001)return[new Ae(l,a)];const u=[];for(let f=0;f<d;f++){const h=f/d,m=Vo(h,t,i,o,l),p=Vo(h,e,r,s,a);u.push(new Ae(m,p))}return u}function P0(t,e,i,r,o,s,l,a,c){if(t===i&&e===r&&o===l&&s===a){const b=l-t,y=a-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(l-t),u=6*(t+o)-12*i,f=3*(i-t),h=9*(r-s)+3*(a-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+f,_=(h*b+m)*b+p;return Math.sqrt(y*y+_*_)}return V0(g,0,1,c||Fo.RecursionLimit)}function F0(t,e,i,r,o,s,l,a){const c=[],d=[[],[]];let u,f,h,m,p,g,b,y;for(let v=0;v<2;++v){if(v===0?(f=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*l,h=3*i-3*t):(f=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*a,h=3*r-3*e),Math.abs(u)<.001){if(Math.abs(f)<.001)continue;m=-h/f,0<m&&m<1&&c.push(m);continue}b=f*f-4*h*u,y=Math.sqrt(b),!(b<0)&&(p=(-f+y)/(2*u),0<p&&p<1&&c.push(p),g=(-f-y)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*i+3*x*m*m*o+m*m*m*l,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*a;return d[0][k]=t,d[1][k]=e,d[0][k+1]=l,d[1][k+1]=a,d[0].length=d[1].length=k+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 V0(t,e,i,r){let o=Fo.abscissas[r-2],s=Fo.weights[r-2],l=.5*(i-e),a=l+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(a):0;for(;c<d;){const f=l*o[c];u+=s[c++]*(t(a+f)+t(a-f))}return l*u}function M0(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],l=e?jt(o-1,i):Math.max(o-1,0),a=e?jt(o+1,i):Math.min(o+1,r),c=t[l],d=s,u=t[a];I0(c,d,u),d.command=o===0?fe.move:fe.curve}}function I0(t,e,i){const r=pe.angleBetween(t,e),o=pe.angleBetween(i,e);let s=pe.distanceBetween(t,e),l=pe.distanceBetween(i,e),a=(r+o)/2;return s<.001||l<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,l*=.33,o<r?a+=gt:a-=gt,e.controls.left.x=Math.cos(a)*s,e.controls.left.y=Math.sin(a)*s,a-=Math.PI,e.controls.right.x=Math.cos(a)*l,e.controls.right.y=Math.sin(a)*l,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=(zi=class extends ne{constructor(){super();B(this,"_flagId",!1);B(this,"_flagClassName",!1);B(this,"_renderer",{});B(this,"_id",Po.Identifier+Po.uniqueId());B(this,"_className","");B(this,"classList",[]);for(let i in Md)Object.defineProperty(this,i,Md[i])}static fromObject(i){const r=new zi().copy(i);return"id"in i&&(r.id=i.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(i){return i.renderer&&typeof i.renderer.type=="string"&&(this.renderer.type=i.renderer.type),typeof i.className=="string"&&(this.className=i.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const r=this.renderer.ctx;this._renderer.texture&&(r.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(r.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const i=this._renderer.type;return this._renderer={type:i},this}},B(zi,"Properties",["renderer","id","className"]),zi);const Md={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 Mo extends Error{constructor(i){super();B(this,"name","Two.js");B(this,"message");this.message=i}}class A0{constructor(){B(this,"map",{})}add(e,i){return this.map[e]=i,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let Io;const Id={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Bn.document&&(Io=document.createElement("a"));const Je=class Je extends Fr{constructor(i,r){super();B(this,"_flagSrc",!1);B(this,"_flagImage",!1);B(this,"_flagVideo",!1);B(this,"_flagLoaded",!1);B(this,"_flagRepeat",!1);B(this,"_flagOffset",!1);B(this,"_flagScale",!1);B(this,"_src","");B(this,"_image",null);B(this,"_loaded",!1);B(this,"_repeat","no-repeat");B(this,"_scale",1);B(this,"_offset",null);for(let o in Ad)Object.defineProperty(this,o,Ad[o]);if(this._renderer.type="texture",this._renderer.flagOffset=O0.bind(this),this._renderer.flagScale=z0.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const o=(function(){this.unbind(ne.Types.load,o),typeof r=="function"&&r()}).bind(this);this.bind(ne.Types.load,o)}if(typeof i=="string")this.src=i;else if(typeof i=="object"){const o=Object.prototype.toString.call(i);(o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"||o==="[object HTMLVideoElement]"||o==="[object Image]")&&(this.image=i)}this._update()}fromObject(i){const r=new Je().copy(i);return"id"in i&&(r.id=i.id),r}static getAbsoluteURL(i){return Io?(Io.href=i,Io.href):i}static loadHeadlessBuffer(i,r){i.image.onload=r,i.image.src=i.src}static getTag(i){return i&&i.nodeName&&i.nodeName.toLowerCase()||"img"}static getImage(i){const r=Je.getAbsoluteURL(i);if(Je.ImageRegistry.contains(r))return Je.ImageRegistry.get(r);let o;return Bn.document?Id.video.test(r)?o=document.createElement("video"):o=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),o.crossOrigin="anonymous",o.referrerPolicy="no-referrer",o}static load(i,r){let o=i.image,s=Je.getTag(o);i._flagImage&&(/canvas/i.test(s)?Je.Register.canvas(i,r):(i._src=o.getAttribute("two-src")||o.src,Je.Register[s](i,r))),i._flagSrc&&(o||(o=Je.getImage(i.src),i.image=o),s=Je.getTag(o),Je.Register[s](i,r))}clone(){const i=new Je(this.src);return i.repeat=this.repeat,i.offset.copy(this.offset),i.scale=this.scale,i}copy(i){return this.src=i.src,this.repeat=i.repeat,this.offset=typeof i.offset=="number"||i.offset instanceof pe?i.offset:new pe().copy(i.offset),this.scale=typeof i.scale=="number"||i.scale instanceof pe?i.scale:new pe().copy(i.scale),this}toObject(){const i=super.toObject.call(this);return i.renderer.type="texture",i.src=this.src,i.repeat=this.repeat,i.offset=this.offset.toObject(),i.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),i}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(ne.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Je.load(this,(function(){this.loaded=!0,this.trigger(ne.Types.change).trigger(ne.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 i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(Je,"Properties",["src","loaded","repeat","scale","offset","image"]),B(Je,"RegularExpressions",Id),B(Je,"ImageRegistry",new A0),B(Je,"Register",{canvas:function(i,r){i._src="#"+i.id,Je.ImageRegistry.add(i.src,i.image),typeof r=="function"&&r()},img:function(i,r){const o=i.image,s=function(a){o.removeEventListener&&typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)),typeof r=="function"&&r()},l=function(a){throw typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)),new Mo("unable to load "+i.src)};typeof o.width=="number"&&o.width>0&&typeof o.height=="number"&&o.height>0?s():typeof o.addEventListener=="function"&&(o.addEventListener("load",s,!1),o.addEventListener("error",l,!1)),i._src=Je.getAbsoluteURL(i._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",i.src),Je.ImageRegistry.add(i.src,o),i.image.src=i.src)},video:function(i,r){const o=function(l){i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),i.image.width=i.image.videoWidth,i.image.height=i.image.videoHeight,typeof r=="function"&&r()},s=function(l){throw i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),new Mo("unable to load "+i.src)};i._src=Je.getAbsoluteURL(i._src),i.image.getAttribute("two-src")||(i.image.setAttribute("two-src",i.src),Je.ImageRegistry.add(i.src,i.image)),i.image.readyState>=4?o():(i.image.addEventListener("canplaythrough",o,!1),i.image.addEventListener("error",s,!1),i.image.src=i.src,i.image.load())}});let Qe=Je;const Ad={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=Qe.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}Qe.ImageRegistry.contains(i)?this._image=Qe.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(ne.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ne.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(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function O0(){this._flagOffset=!0}function z0(){this._flagScale=!0}class Ci extends Array{constructor(){super();Pa(this,wt,new ne);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 zt(this,wt)}set _events(i){bm(this,wt,i)}get _bound(){return zt(this,wt)._bound}set _bound(i){zt(this,wt)._bound=i}addEventListener(){var i;return(i=zt(this,wt).addEventListener)==null?void 0:i.apply(this,arguments)}on(){var i;return(i=zt(this,wt).on)==null?void 0:i.apply(this,arguments)}bind(){var i;return(i=zt(this,wt).bind)==null?void 0:i.apply(this,arguments)}removeEventListener(){var i;return(i=zt(this,wt).removeEventListener)==null?void 0:i.apply(this,arguments)}off(){var i;return(i=zt(this,wt).off)==null?void 0:i.apply(this,arguments)}unbind(){var i;return(i=zt(this,wt).unbind)==null?void 0:i.apply(this,arguments)}dispatchEvent(){var i;return(i=zt(this,wt).dispatchEvent)==null?void 0:i.apply(this,arguments)}trigger(){var i;return(i=zt(this,wt).trigger)==null?void 0:i.apply(this,arguments)}listen(){var i;return(i=zt(this,wt).listen)==null?void 0:i.apply(this,arguments)}ignore(){var i;return(i=zt(this,wt).ignore)==null?void 0:i.apply(this,arguments)}pop(){const i=super.pop.apply(this,arguments);return this.trigger(ne.Types.remove,[i]),i}shift(){const i=super.shift.apply(this,arguments);return this.trigger(ne.Types.remove,[i]),i}push(){const i=super.push.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),i}unshift(){const i=super.unshift.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),i}splice(){const i=super.splice.apply(this,arguments);if(this.trigger(ne.Types.remove,i),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ne.Types.insert,r),this.trigger(ne.Types.order)}return i}sort(){return super.sort.apply(this,arguments),this.trigger(ne.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ne.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(i,r){const o=[];for(let s=0;s<this.length;s++){const l=this[s];let a;r?a=i.call(r,l,s):a=i(l,s),o.push(a)}return o}}wt=new WeakMap;const Od=Array.prototype.slice;function D0(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const je={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=Od.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=Od.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,i){const r=i||this,o=!D0(t)&&Object.keys(t),s=(o||t).length;for(let l=0;l<s;l++){const a=o?o[l]:l;e.call(r,t[a],a,t)}return t},performance:Bn.performance&&Bn.performance.now?Bn.performance:Date},Yt=class Yt extends Fr{constructor(i,r,o){super();B(this,"_flagOffset",!0);B(this,"_flagOpacity",!0);B(this,"_flagColor",!0);B(this,"_offset",0);B(this,"_opacity",1);B(this,"_color","#fff");for(let s in zd)Object.defineProperty(this,s,zd[s]);this._renderer.type="stop",this.offset=typeof i=="number"?i:Yt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:Yt.Index<=0?"#fff":"#000",Yt.Index=(Yt.Index+1)%2}static fromObject(i){const r=new Yt().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Yt.Properties.length;r++){const o=Yt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Yt;return je.each(Yt.Properties,function(o){r[o]=this[o]},this),i&&i.stops&&i.stops.push(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="stop",je.each(Yt.Properties,r=>{i[r]=this[r]},this),i}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};B(Yt,"Index",0),B(Yt,"Properties",["offset","opacity","color"]);let vi=Yt;const zd={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)}}},Fn=class Fn extends Fr{constructor(i){super();B(this,"_flagStops",!1);B(this,"_flagSpread",!1);B(this,"_flagUnits",!1);B(this,"_spread","");B(this,"_units","");for(let r in Dd)Object.defineProperty(this,r,Dd[r]);this._renderer.type="gradient",this._renderer.flagStops=L0.bind(this),this._renderer.bindStops=H0.bind(this),this._renderer.unbindStops=W0.bind(this),this.spread="pad",this.units="objectBoundingBox",i&&(this.stops=i)}static fromObject(i){let r=i.stops;r&&r.length>0&&(r=r.map(s=>s instanceof vi?s:new vi().copy(s)));const o=new Fn(r).copy(i);return"id"in i&&(o.id=i.id),o}clone(i){const r=this.stops.map(s=>s.clone()),o=new Fn(r);return je.each(Fn.Properties,s=>{o[s]=this[s]},this),i&&i.add(o),o}copy(i){super.copy.call(this,i);for(let r=0;r<Fn.Properties.length;r++){const o=Fn.Properties[r];o in i&&(this[o]=i[o])}return this}toObject(){const i={stops:this.stops.map(r=>r.toObject())};return je.each(Fn.Properties,r=>{i[r]=this[r]},this),i}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ne.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(Fn,"Stop",vi),B(Fn,"Properties",["spread","stops","units"]);let ft=Fn;const Dd={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,i=this._renderer.unbindStops;this._stops&&this._stops.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),this._stops=new Ci((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,i),e(this._stops)}}};function L0(){this._flagStops=!0}function H0(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function W0(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const hi=class hi extends ft{constructor(i,r,o,s,l){super(l);B(this,"_flagEndPoints",!1);B(this,"_left",null);B(this,"_right",null);for(let a in Ld)Object.defineProperty(this,a,Ld[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=j0.bind(this),this.left=new pe,this.right=new pe,typeof i=="number"&&(this.left.x=i),typeof r=="number"&&(this.left.y=r),typeof o=="number"&&(this.right.x=o),typeof s=="number"&&(this.right.y=s)}static fromObject(i){const r=new hi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<hi.Properties.length;r++){const o=hi.Properties[r];o in i&&(this[o]=i[o]instanceof pe?i[o]:new pe().copy(i[o]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new hi(this.left._x,this.left._y,this.right._x,this.right._y,r);return je.each(ft.Properties,function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return i.left=this.left.toObject(),i.right=this.right.toObject(),i}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(ne.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};B(hi,"Stop",vi),B(hi,"Properties",["left","right"]);let Vt=hi;const Ld={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(ne.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ne.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(ne.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function j0(){this._flagEndPoints=!0}const Vn=class Vn extends ft{constructor(i,r,o,s,l,a){super(s);B(this,"_flagRadius",!1);B(this,"_flagCenter",!1);B(this,"_flagFocal",!1);B(this,"_radius",0);B(this,"_center",null);B(this,"_focal",null);for(let c in Hd)Object.defineProperty(this,c,Hd[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=q0.bind(this),this._renderer.flagFocal=X0.bind(this),this.center=new pe,this.radius=typeof o=="number"?o:1,this.focal=new pe,typeof i=="number"&&(this.center.x=i),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof l=="number"&&(this.focal.x=l),typeof a=="number"&&(this.focal.y=a)}static fromObject(i){const r=new Vn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Vn.Properties.length;r++){const o=Vn.Properties[r];o in i&&(/(center|focal)i/.test(o)?this[o]=i[o]instanceof pe?i[o]:new pe().copy(i[o]):typeof i[o]=="number"&&(this[o]=i[MediaKeySystemAccess]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new Vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(ft.Properties.concat(Vn.Properties),function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return je.each(Vn.Properties,function(r){i[r]=this[r]},this),i.center=this.center.toObject(),i.focal=this.focal.toObject(),i}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(ne.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};B(Vn,"Stop",vi),B(Vn,"Properties",["center","radius","focal"]);let Mt=Vn;const Hd={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(ne.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ne.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ne.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ne.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function q0(){this._flagCenter=!0}function X0(){this._flagFocal=!0}function Wd(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const l=t._lengths[s];if(o>=r)return r-o>=0;o+=l}return!1}function Ao(t,e){const i=t._length;if(e<=0)return 0;if(e>=i)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function jd(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),P0(r,a,o,c,s,d,l,u,i)}function cl(t,e,i){let r,o,s,l,a,c,d,u;const f=e.controls&&e.controls.right,h=t.controls&&t.controls.left;return r=e.x,a=e.y,o=(f||e).x,c=(f||e).y,s=(h||t).x,d=(h||t).y,l=t.x,u=t.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&t._relative&&(s+=t.x,d+=t.y),Vd(r,a,o,c,s,d,l,u,i)}function Si(t){switch(t.renderer.type){case"texture":return Qe.fromObject(t);case"gradient":return ft.fromObject(t);case"linear-gradient":return Vt.fromObject(t);case"radial-gradient":return Mt.fromObject(t)}return t}const Y0=Math.cos,K0=Math.sin,qd=Math.tan,dl=[],At=class At extends ne{constructor(i,r,o,s,l,a){super();B(this,"elements",new Rd(9));B(this,"manual",!1);let c=i;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(i,r,o){if(r.length<=3){const w=i;let T,C,$;const E=r[0]||0,V=r[1]||0,P=r[2]||0;return T=w[0]*E+w[1]*V+w[2]*P,C=w[3]*E+w[4]*V+w[5]*P,$=w[6]*E+w[7]*V+w[8]*P,[T,C,$]}const s=i[0],l=i[1],a=i[2],c=i[3],d=i[4],u=i[5],f=i[6],h=i[7],m=i[8],p=r[0],g=r[1],b=r[2],y=r[3],_=r[4],k=r[5],x=r[6],v=r[7],N=r[8];return o=o||new Rd(9),o[0]=s*p+l*y+a*x,o[1]=s*g+l*_+a*v,o[2]=s*b+l*k+a*N,o[3]=c*p+d*y+u*x,o[4]=c*g+d*_+u*v,o[5]=c*b+d*k+u*N,o[6]=f*p+h*y+m*x,o[7]=f*g+h*_+m*v,o[8]=f*b+h*k+m*N,o}static fromObject(i){return new At().copy(i)}set(i,r,o,s,l,a,c,d,u){if(typeof r>"u"){const f=i;i=f[0],r=f[1],o=f[2],s=f[3],l=f[4],a=f[5],c=f[6],d=f[7],u=f[8]}return this.elements[0]=i,this.elements[1]=r,this.elements[2]=o,this.elements[3]=s,this.elements[4]=l,this.elements[5]=a,this.elements[6]=c,this.elements[7]=d,this.elements[8]=u,this.trigger(ne.Types.change)}copy(i){return this.elements[0]=i.elements[0],this.elements[1]=i.elements[1],this.elements[2]=i.elements[2],this.elements[3]=i.elements[3],this.elements[4]=i.elements[4],this.elements[5]=i.elements[5],this.elements[6]=i.elements[6],this.elements[7]=i.elements[7],this.elements[8]=i.elements[8],this.manual=i.manual,this.trigger(ne.Types.change)}identity(){return this.elements[0]=At.Identity[0],this.elements[1]=At.Identity[1],this.elements[2]=At.Identity[2],this.elements[3]=At.Identity[3],this.elements[4]=At.Identity[4],this.elements[5]=At.Identity[5],this.elements[6]=At.Identity[6],this.elements[7]=At.Identity[7],this.elements[8]=At.Identity[8],this.trigger(ne.Types.change)}multiply(i,r,o,s,l,a,c,d,u){if(typeof r>"u")return this.elements[0]*=i,this.elements[1]*=i,this.elements[2]*=i,this.elements[3]*=i,this.elements[4]*=i,this.elements[5]*=i,this.elements[6]*=i,this.elements[7]*=i,this.elements[8]*=i,this.trigger(ne.Types.change);if(typeof o>"u"&&(o=1),typeof s>"u"){i=i||0,r=r||0,o=o||0,l=this.elements;const U=l[0]*i+l[1]*r+l[2]*o,J=l[3]*i+l[4]*r+l[5]*o,Z=l[6]*i+l[7]*r+l[8]*o;return[U,J,Z]}const f=this.elements,h=[i,r,o,s,l,a,c,d,u],m=f[0],p=f[1],g=f[2],b=f[3],y=f[4],_=f[5],k=f[6],x=f[7],v=f[8],N=h[0],w=h[1],T=h[2],C=h[3],$=h[4],E=h[5],V=h[6],P=h[7],I=h[8];return this.elements[0]=m*N+p*C+g*V,this.elements[1]=m*w+p*$+g*P,this.elements[2]=m*T+p*E+g*I,this.elements[3]=b*N+y*C+_*V,this.elements[4]=b*w+y*$+_*P,this.elements[5]=b*T+y*E+_*I,this.elements[6]=k*N+x*C+v*V,this.elements[7]=k*w+x*$+v*P,this.elements[8]=k*T+x*E+v*I,this.trigger(ne.Types.change)}inverse(i){const r=this.elements;i=i||new At;const o=r[0],s=r[1],l=r[2],a=r[3],c=r[4],d=r[5],u=r[6],f=r[7],h=r[8],m=h*c-d*f,p=-h*a+d*u,g=f*a-c*u;let b=o*m+s*p+l*g;return b?(b=1/b,i.elements[0]=m*b,i.elements[1]=(-h*s+l*f)*b,i.elements[2]=(d*s-l*c)*b,i.elements[3]=p*b,i.elements[4]=(h*o-l*u)*b,i.elements[5]=(-d*o+l*a)*b,i.elements[6]=g*b,i.elements[7]=(-f*o+s*u)*b,i.elements[8]=(c*o-s*a)*b,i):null}scale(i,r){return arguments.length<=1&&(r=i),this.multiply(i,0,0,0,r,0,0,0,1)}rotate(i){const r=Y0(i),o=K0(i);return this.multiply(r,-o,0,o,r,0,0,0,1)}translate(i,r){return this.multiply(1,0,i,0,1,r,0,0,1)}skewX(i){const r=qd(i);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(i){const r=qd(i);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(i){return dl.length=0,this.toTransformArray(i,dl),dl.map(Nn).join(" ")}toTransformArray(i,r){const o=this.elements,s=!!r,l=o[0],a=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],m=o[7],p=o[8];if(s){r[0]=l,r[1]=d,r[2]=h,r[3]=a,r[4]=u,r[5]=m,r[6]=c,r[7]=f,r[8]=p;return}return[l,d,h,a,u,m,c,f,p]}if(s){r[0]=l,r[1]=d,r[2]=a,r[3]=u,r[4]=c,r[5]=f;return}return[l,d,a,u,c,f]}toArray(i,r){const o=this.elements,s=!!r,l=o[0],a=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],m=o[7],p=o[8];if(s){r[0]=l,r[1]=a,r[2]=c,r[3]=d,r[4]=u,r[5]=f,r[6]=h,r[7]=m,r[8]=p;return}return[l,a,c,d,u,f,h,m,p]}if(s){r[0]=l,r[1]=a,r[2]=c,r[3]=d,r[4]=u,r[5]=f;return}return[l,a,c,d,u,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new At().copy(this)}};B(At,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=At;T0(rr);const Jr=class Jr extends Fr{constructor(){super();B(this,"_flagMatrix",!0);B(this,"_flagScale",!1);B(this,"_matrix",null);B(this,"_worldMatrix",null);B(this,"_position",null);B(this,"_rotation",0);B(this,"_scale",1);B(this,"_skewX",0);B(this,"_skewY",0);for(let i in Oo)Object.defineProperty(this,i,Oo[i]);this._renderer.flagMatrix=Xd.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(i){const r=new Jr().copy(i);return"id"in i&&(r.id=i.id),r}get renderer(){return this._renderer}set renderer(i){this._renderer=i}get translation(){return Oo.position.get.apply(this,arguments)}set translation(i){Oo.position.set.apply(this,arguments)}addTo(i){return i.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(i,r,o){const s=o||{},l=s.ignoreVisibility===!0;if(!l&&"visible"in this&&this.visible===!1||!l&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const a=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();return c?i>=c.left-a&&i<=c.right+a&&r>=c.top-a&&r<=c.bottom+a:!1}copy(i){return super.copy.call(this,i),"position"in i&&(i.position instanceof pe?this.position=i.position:this.position.copy(i.position)),"rotation"in i&&(this.rotation=i.rotation),"scale"in i&&(this.scale=typeof i.scale=="number"||i.scale instanceof pe?i.scale:new pe(i.scale.x,i.scale.y)),"skewX"in i&&(this.skewX=i.skewX),"skewY"in i&&(this.skewY=i.skewY),"matrix"in i&&i.matrix.manual&&(this.matrix.copy(i.matrix),this.matrix.manual=!0),this}clone(i){const r=new Jr;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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer={type:"shape"},i.isShape=!0,i.translation=this.translation.toObject(),i.rotation=this.translation.rotation,i.scale=this.scale instanceof pe?this.scale.toObject():this.scale,i.skewX=this.skewX,i.skewY=this.skewY,i.matrix=this.matrix.toObject(),i}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_update(i){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)),i&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};B(Jr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Tn=Jr;const Oo={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ne.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ne.Types.change,this._renderer.flagMatrix),Xd.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(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(ne.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 $0(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Xd(){this._flagMatrix=!0}const Yd=/^(?:none|transparent)$/i,U0=8,ul=Number.EPSILON;function Ln(t,e){return{x:t,y:e}}function zo(t,e,i=ul){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function Kd(t,e,i,r){const o=t*i+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+r*r)||1e-12;let l=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(l=-l),l}function G0(t,e,i){if(!t)return[Ln(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Ln(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,l=e.largeArcFlag?1:0,a=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,f=e.y,h=(c-u)/2,m=(d-f)/2,p=Math.cos(s),g=Math.sin(s);let b=p*h+g*m,y=-g*h+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const O=Math.sqrt(x);r*=O,o*=O,_=r*r,k=o*o}const v=_*y*y+k*b*b,N=v===0?0:(_*k-v)/v;let w=Math.sqrt(Math.max(0,N));l===a&&(w=-w);const T=w*r*y/o,C=-w*o*b/r,$=p*T-g*C+(c+u)/2,E=g*T+p*C+(d+f)/2,V=Kd(1,0,(b-T)/r,(y-C)/o),P=Kd((b-T)/r,(y-C)/o,(-b-T)/r,(-y-C)/o)%Ut,I=V+P,U=a===0,J=(()=>{const O=I-V,z=Math.abs(O)<Number.EPSILON;let M=jt(O,Ut);return M<Number.EPSILON&&(M=z?0:Ut),U&&!z&&(M=M===Ut?-Ut:M-Ut),M})(),Z=Math.max(Po.Resolution,Math.max(i*2,1)),L=[];for(let O=1;O<=Z;O++){const z=O/Z,M=V+z*J;let R=$+r*Math.cos(M),W=E+o*Math.sin(M);if(s!==0){const K=R-$,G=W-E,X=Math.cos(s),j=Math.sin(s);R=K*X-G*j+$,W=K*j+G*X+E}L.push(Ln(R,W))}return L}function Z0(t,e=U0){const i=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:i,segments:r};const s=Math.max(1,Math.floor(e));let l=null,a=null,c=null,d=null;const u=(h=!1)=>{if(l){if(h&&a&&c&&!zo(a,c)){const m=Ln(a.x,a.y);r.push({a:c,b:m}),l.push(m),c=m}l.length>=3&&a&&c&&zo(a,c)&&i.push(l),l=null,a=null,c=null}},f=h=>{if(!c){c=h,l&&l.push(h);return}zo(c,h)||(r.push({a:c,b:h}),l&&l.push(h),c=h)};for(let h=0;h<o.length;h++){const m=o[h],p=m.command||(h===0?fe.move:fe.line);if(p===fe.move){u(!1);const g=Ln(m.x,m.y);l=[g],a=g,c=g,d=m;continue}if(d||(d=o[Math.max(h-1,0)]),p===fe.line)f(Ln(m.x,m.y));else if(p===fe.curve){const g=cl(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];f(Ln(y.x,y.y))}f(Ln(m.x,m.y))}else if(p===fe.arc){const g=G0(d,m,s);for(let b=0;b<g.length;b++)f(g[b])}else if(p===fe.close){u(!0),d=m;continue}else f(Ln(m.x,m.y));d=m}if(l){const h=!!t._closed||!!t.closed||a&&c&&!zo(a,c);u(h)}return{polygons:i,segments:r}}function Q0(t,e,i){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let l=s.length-1;for(let a=0;a<s.length;a++){const c=s[l],d=s[a];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),l=a}}return r}function J0(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<ul&&Math.abs(s)<ul){const h=t-i.x,m=e-i.y;return h*h+m*m}const l=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),a=Math.max(0,Math.min(1,l)),c=i.x+a*o,d=i.y+a*s,u=t-c,f=e-d;return u*u+f*f}function e1(t,e,i){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],l=J0(e,i,s.a,s.b);l<r&&(r=l)}return Math.sqrt(r)}function t1(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Yd.test(i):!0}function n1(t,e){const i=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&i>0;if(!(i>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!Yd.test(r):!0}function i1(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,l=t.top-r,a=t.bottom+r;return e>=o&&e<=s&&i>=l&&i<=a}const Do=Number.EPSILON;function Lo(t){return typeof t.relative!="boolean"||!!t.relative}function hn(t,e,i,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(i)<Do&&Math.abs(r)<Do){Lo(t)?o[e].clear():o[e].set(t.x,t.y);return}Lo(t)?o[e].set(i,r):o[e].set(t.x+i,t.y+r)}}function qt(t,e){hn(t,e,0,0)}function r1(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:Lo(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function or(t,e){const i=r1(t,e);return Math.abs(i.x)>Do||Math.abs(i.y)>Do}function Ho(t){t.command===fe.move||t.command===fe.close||(t.command=or(t,"left")||or(t,"right")?fe.curve:fe.line)}function Ud(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function o1(t,e){return or(e,"right")||or(t,"left")||or(t,"right")||or(e,"left")||t.command===fe.curve||e.command===fe.curve}function sr(t,e,i){return{x:Wt(t.x,e.x,i),y:Wt(t.y,e.y,i)}}function Gd(t,e){const i=t.controls&&t.controls[e];return i?Lo(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function s1(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},l=r?Gd(t,"right"):{...s},a={x:e.x,y:e.y},c=o?Gd(e,"left"):{...a},d=sr(s,l,i),u=sr(l,c,i),f=sr(c,a,i),h=sr(d,u,i),m=sr(u,f,i),p=sr(h,m,i),g=new Ae(p.x,p.y);return Ud(g,t),hn(g,"left",h.x-p.x,h.y-p.y),hn(g,"right",m.x-p.x,m.y-p.y),g.command=fe.curve,{anchor:g,startOut:d,endIn:f}}function l1(t,e,i,r,o,s){const l=t.length,a=i-e+1;let c=a-1,d=o?Math.min(a,4):1,u=d,f=d;if(r||(u=Math.min(1,e),f=Math.min(1,l-i-1)),c+=u+f,c<=1)return;const h=new Array(c+1);for(let w=0,T=e-u;w<=c;w+=1,T+=1){const C=jt(T,l);h[w]=t[C]}let m=h[0].x+2*h[1].x,p=h[0].y+2*h[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),v=new Array(c+1);for(let w=1;w<c;w+=1){const T=w<b,C=T||s?1:2,$=T?4:s?2:7,E=T?4:s?3:8,V=T?2:s?0:1,P=C/g;g=k[w]=$-P,m=y[w]=E*h[w].x+V*h[w+1].x-P*m,p=_[w]=E*h[w].y+V*h[w+1].y-P*p}x[b]=y[b]/k[b],v[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],v[w]=(_[w]-v[w+1])/k[w];x[c]=(3*h[c].x-x[b])/2,v[c]=(3*h[c].y-v[b])/2;const N=c-f;for(let w=u,T=e;w<=N;w+=1,T+=1){const C=jt(T,l),$=t[C],E=x[w]-$.x,V=v[w]-$.y;o||w<N?hn($,"right",E,V):qt($,"right"),o||w>u?hn($,"left",-E,-V):qt($,"left"),Ho($)}}function a1(t,e,i,r,o,s){const l=e||t,a=t,c=i||t,d=pe.distanceBetween(l,a),u=pe.distanceBetween(a,c),f=r===void 0?.5:r,h=Math.pow(d,f),m=Math.pow(u,f),p=h*h,g=m*m;if(!o&&e){const b=2*g+3*m*h+p,y=3*m*(m+h);if(y!==0){const _=(g*l.x+b*a.x-p*c.x)/y-a.x,k=(g*l.y+b*a.y-p*c.y)/y-a.y;hn(t,"left",_,k)}else qt(t,"left")}else qt(t,"left");if(!s&&i){const b=2*p+3*h*m+g,y=3*h*(h+m);if(y!==0){const _=(p*c.x+b*a.x-g*l.x)/y-a.x,k=(p*c.y+b*a.y-g*l.y)/y-a.y;hn(t,"right",_,k)}else qt(t,"right")}else qt(t,"right");Ho(t)}function c1(t,e,i,r,o,s){if(!(e&&i)){e||qt(t,"left"),i||qt(t,"right"),Ho(t);return}const l=e,a=t,c=i,d=pe.distanceBetween(l,a),u=pe.distanceBetween(a,c),f=d+u,h=r===void 0?.4:r,m={x:l.x-c.x,y:l.y-c.y};if(!o&&f!==0){const p=h*d/f;hn(t,"left",m.x*p,m.y*p)}else qt(t,"left");if(!s&&f!==0){const p=h*d/f-h;hn(t,"right",m.x*p,m.y*p)}else qt(t,"right");Ho(t)}function d1(t,e,i,r,o,s){const l=s.type,a=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=jt(d,c),f=t[u];if(f.command===fe.move){qt(f,"left"),qt(f,"right");continue}const h=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=h===null?null:t[jt(h,c)],g=m===null?null:t[jt(m,c)],b=h===null,y=m===null;l==="geometric"?c1(f,p,g,a,b,y):a1(f,p,g,a,b,y)}}const lr=Math.min,ar=Math.max,u1=Math.ceil,f1=Math.floor,h1=new pe,m1=new rr,gn=class gn extends Tn{constructor(i,r,o,s){super();B(this,"_flagVertices",!0);B(this,"_flagLength",!0);B(this,"_flagFill",!0);B(this,"_flagStroke",!0);B(this,"_flagLinewidth",!0);B(this,"_flagOpacity",!0);B(this,"_flagVisible",!0);B(this,"_flagCap",!0);B(this,"_flagJoin",!0);B(this,"_flagMiter",!0);B(this,"_flagStrokeAttenuation",!0);B(this,"_flagMask",!1);B(this,"_flagClip",!1);B(this,"_length",0);B(this,"_fill","#fff");B(this,"_stroke","#000");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_cap","round");B(this,"_join","round");B(this,"_miter",4);B(this,"_closed",!0);B(this,"_curved",!1);B(this,"_automatic",!0);B(this,"_beginning",0);B(this,"_ending",1);B(this,"_mask",null);B(this,"_clip",!1);B(this,"_dashes",null);B(this,"_strokeAttenuation",!0);for(let l in Zd)Object.defineProperty(this,l,Zd[l]);this._renderer.type="path",this._renderer.flagVertices=Qd.bind(this),this._renderer.bindVertices=Jd.bind(this),this._renderer.unbindVertices=eu.bind(this),this._renderer.flagFill=tu.bind(this),this._renderer.flagStroke=nu.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!o,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=i,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Si(i.fill),o=typeof i.stroke=="string"?i.stroke:Si(i.stroke),s=new gn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){if(super.copy.call(this,i),i.vertices){this.vertices=[];for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}}for(let r=0;r<gn.Properties.length;r++){const o=gn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new gn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<gn.Properties.length;o++){const s=gn.Properties[o];r[s]=this[s]}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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="path",i.vertices=this.vertices.map(r=>r.toObject()),je.each(gn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const i=this.getBoundingClientRect(!0),r=i.width/2,o=i.height/2,s=i.left+i.width/2,l=i.top+i.height/2;for(let a=0;a<this.vertices.length;a++){const c=this.vertices[a];c.x-=s,c.y-=l,c.x+=r,c.y+=o}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=r,this.mask.translation.y-=l,this.mask.translation.y+=o),this}center(){const i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const l=this.vertices[s];l.x-=r,l.y-=o}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getBoundingClientRect(i){let r,o,s,l,a,c,d=1/0,u=-1/0,f=1/0,h=-1/0;if(this._update(!0),r=i?this.matrix:this.worldMatrix,o=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:p}=N0(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof m=="number"&&typeof p=="number"&&(o=Math.max(m,p)*(this.linewidth||0)/2)}else o*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(l=0;l<s;l++){c=this._renderer.vertices[l],a=this._renderer.vertices[(l+s-1)%s];const[m,p]=r.multiply(a.x,a.y),[g,b]=r.multiply(c.x,c.y);if(a.controls&&c.controls){let y=a.controls.right.x,_=a.controls.right.y;a.relative&&(y+=a.x,_+=a.y);let[k,x]=r.multiply(y,_),v=c.controls.left.x,N=c.controls.left.y;c.relative&&(v+=c.x,N+=c.y);let[w,T]=r.multiply(v,N);const C=F0(m,p,k,x,w,T,g,b);f=lr(C.min.y-o,f),d=lr(C.min.x-o,d),u=ar(C.max.x+o,u),h=ar(C.max.y+o,h)}else l<=1&&(f=lr(p-o,f),d=lr(m-o,d),u=ar(m+o,u),h=ar(p+o,h)),f=lr(b-o,f),d=lr(g-o,d),u=ar(g+o,u),h=ar(b+o,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}contains(i,r,o){const s=o||{},l=s.ignoreVisibility===!0;if(!l&&this.visible===!1||!l&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const a=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();if(!c||i<c.left-a||i>c.right+a||r<c.top-a||r>c.bottom+a)return!1;const d=this.worldMatrix,u=d&&d.inverse(m1);if(!u)return super.contains(i,r,s);const[f,h]=u.multiply(i,r,1),m=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,p=t1(this,s.fill),g=n1(this,s.stroke),{polygons:b,segments:y}=Z0(this,m);if(p&&b.length>0&&Q0(b,f,h))return!0;if(g&&y.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&e1(y,f,h)<=_/2+a)return!0}return!p&&!g?super.contains(i,r,s):p&&b.length===0?super.contains(i,r,s):!1}getPointAt(i,r){let o,s,l,a,c,d,u,f,h,m,p,g,b,y,_,k=this.length*Math.min(Math.max(i,0),1);const x=this.vertices.length,v=x-1;let N=null,w=null;for(let L=0,O=this._lengths.length,z=0;L<O;L++){if(z+this._lengths[L]>=k){this._closed?(o=jt(L,x),s=jt(L-1,x),L===0&&(o=s,s=L)):(o=L,s=Math.min(Math.max(L-1,0),v)),N=this.vertices[o],w=this.vertices[s],k-=z,this._lengths[L]!==0?i=k/this._lengths[L]:i=0;break}z+=this._lengths[L]}if(N===null||w===null)return null;if(N){if(!w)return N}else return w;_=w.controls&&w.controls.right,y=N.controls&&N.controls.left,c=w.x,m=w.y,d=(_||w).x,p=(_||w).y,u=(y||N).x,g=(y||N).y,f=N.x,b=N.y,_&&w.relative&&(d+=w.x,p+=w.y),y&&N.relative&&(u+=N.x,g+=N.y),a=Vo(i,c,d,u,f),h=Vo(i,m,p,g,b);const T=Wt(c,d,i),C=Wt(m,p,i),$=Wt(d,u,i),E=Wt(p,g,i),V=Wt(u,f,i),P=Wt(g,b,i),I=Wt(T,$,i),U=Wt(C,E,i),J=Wt($,V,i),Z=Wt(E,P,i);return je.isObject(r)?(r.x=a,r.y=h,r instanceof Ae&&(r.controls.left.x=I,r.controls.left.y=U,r.controls.right.x=J,r.controls.right.y=Z,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=a,r.controls.left.y-=h,r.controls.right.x-=a,r.controls.right.y-=h)),r.t=i,r):(l=new Ae(a,h,I-a,U-h,J-a,Z-h,this._curved?fe.curve:fe.line),l.t=i,l)}plot(){if(this.curved)return M0(this._collection,this.closed),this;for(let i=0;i<this._collection.length;i++)this._collection[i].command=i===0?fe.move:fe.line;return this}smooth(i){const r=i||{},o=r.type||"continuous",s=this._collection,l=s.length;if(l<2)return this;const a=this._closed||l>0&&s[l-1]&&s[l-1].command===fe.close,c=(m,p)=>{if(m==null)return p;if(typeof m=="number"){if(a)return jt(m,l);let b=m;return b<0&&(b+=l),Math.min(Math.max(b,0),l-1)}const g=s.indexOf(m);return g!==-1?g:p},d=a&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),f=c(r.to,l-1);if(u>f)if(a)u-=l;else{const m=u;u=f,f=m}const h=f-u+1;for(let m=0;m<h;m+=1){const p=jt(u+m,l),g=s[p],b=!a&&p===0;g.command===fe.move&&!b&&(g.command=fe.line)}if(o==="continuous"||o==="asymmetric")l1(s,u,f,a,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const m={type:o,factor:r.factor};d1(s,u,f,a,d,m)}else throw new Error(`Path.smooth does not support type "${o}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(i){this._update();const r=this.vertices,o=r.length;if(o<2)return this;const s=[];let l=null,a=null;for(let c=0;c<o;c+=1){const d=r[c];if(!l||d.command===fe.move){const f=d.clone();s.push(f),l=d,a=d;continue}if(o1(d,l)){const h=cl(d,l,i).length,m=s[s.length-1];let p=m.clone(),g=d.clone(),b=m,y=0;if(h<=1){const _=d.clone();s.push(_)}else{for(let k=1;k<h;k+=1){const x=k/h,v=1-y,N=v<=Number.EPSILON?x:(x-y)/v,w=s1(p,g,N);hn(b,"right",w.startOut.x-b.x,w.startOut.y-b.y);const T=w.anchor;s.push(T),b=T,p=T.clone(),y=x,hn(g,"left",w.endIn.x-g.x,w.endIn.y-g.y)}const _=d.clone();_.controls.left.copy(g.controls.left),s.push(_)}}else{const f=cl(d,l,i);for(let m=1;m<f.length;m+=1){const p=f[m];Ud(p,l),qt(p,"left"),qt(p,"right"),p.command=fe.line,s.push(p)}const h=d.clone();s.push(h)}l=d,d.command===fe.close&&(l=a)}return this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(i,r){r||this._update();const s=this.vertices.length-1;let l=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),je.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){l=c,this._lengths[d]=0;return}this._lengths[d]=jd(c,l,i),a+=this._lengths[d],l=c},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const i=this._collection.length,r=this._closed,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),l=Ao(this,o*this._length),a=Ao(this,s*this._length),c=u1(l),d=f1(a);let u,f,h,m,p,g;for(this._renderer.vertices.length=0,g=0;g<i;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Ae),g>d&&!f?(p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,p),p.command=this._renderer.collection[g].command,this._renderer.vertices.push(p),f=p,h=this._collection[g-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(pe.zero,1-p.t):this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):g>=c&&g<=d&&(p=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(p),g===d&&Wd(this,s)?(f=p,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):g===c&&Wd(this,o)&&(u=p,u.command=fe.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(g=c-1,p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(o,p),p.command=fe.move,this._renderer.vertices.unshift(p),m=this._collection[g+1],m&&m.controls&&(p.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(pe.zero,p.t):(h1.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,p.t))))}return Tn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Tn.prototype.flagReset.call(this),this}};B(gn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(gn,"Utils",{getCurveLength:jd});let Oe=gn;const Zd={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 ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.bind(ne.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";je.each(this.vertices,function(i){i[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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),t instanceof Ci?this._collection=t:this._collection=new Ci(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,i),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,je.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 Qd(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Jd(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function eu(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function tu(){this._flagFill=!0}function nu(){this._flagStroke=!0}const p1=Math.ceil,g1=Math.floor,Mn=class Mn extends Tn{constructor(i){super();B(this,"_flagVertices",!0);B(this,"_flagLength",!0);B(this,"_flagFill",!0);B(this,"_flagStroke",!0);B(this,"_flagLinewidth",!0);B(this,"_flagOpacity",!0);B(this,"_flagVisible",!0);B(this,"_flagSize",!0);B(this,"_flagSizeAttenuation",!0);B(this,"_flagStrokeAttenuation",!0);B(this,"_length",0);B(this,"_fill","#fff");B(this,"_stroke","#000");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_size",1);B(this,"_sizeAttenuation",!1);B(this,"_beginning",0);B(this,"_ending",1);B(this,"_dashes",null);B(this,"_strokeAttenuation",!0);B(this,"noFill",Oe.prototype.noFill);B(this,"noStroke",Oe.prototype.noStroke);B(this,"corner",Oe.prototype.corner);B(this,"center",Oe.prototype.center);B(this,"getBoundingClientRect",Oe.prototype.getBoundingClientRect);B(this,"_updateLength",Oe.prototype._updateLength);for(let r in iu)Object.defineProperty(this,r,iu[r]);this._renderer.type="points",this._renderer.flagVertices=Qd.bind(this),this._renderer.bindVertices=Jd.bind(this),this._renderer.unbindVertices=eu.bind(this),this._renderer.flagFill=tu.bind(this),this._renderer.flagStroke=nu.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=i,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Si(i.fill),o=typeof i.stroke=="string"?i.stroke:Si(i.stroke),s=new Mn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}for(let r=0;r<Mn.Properties.length;r++){const o=Mn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Mn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Mn.Properties.length;o++){const s=Mn.Properties[o];r[s]=this[s]}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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="points",i.vertices=this.vertices.map(r=>r.toObject()),je.each(Mn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}subdivide(i){this._update();let r=[];for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o],l=this.vertices[o-1];if(!l)continue;const a=s.x,c=s.y,d=l.x,u=l.y,f=Vd(a,c,a,c,d,u,d,u,i);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const i=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),o=Ao(this,i*this._length),s=Ao(this,r*this._length),l=p1(o),a=g1(s);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=l&&u<=a&&(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}};B(Mn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Wo=Mn;const iu={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 ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.bind(ne.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,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),t instanceof Ci?this._collection=t:this._collection=new Ci(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,i),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 ru extends Ci{constructor(i){i=Array.isArray(i)?i:Array.prototype.slice.call(arguments);super(i);Pa(this,gs,{});this.attach(i),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return zt(this,gs)}attach(i){for(let r=0;r<i.length;r++){const o=i[r];o&&o.id&&(this.ids[o.id]=o)}return this}detach(i){for(let r=0;r<i.length;r++)delete this.ids[i[r].id];return this}}gs=new WeakMap;const Xn=class Xn extends Oe{constructor(i,r,o,s,l,a,c){const d=c||Po.Resolution*3,u=[];for(let f=0;f<d;f++)u.push(new Ae);super(u,!0,!1,!0);B(this,"_flagStartAngle",!1);B(this,"_flagEndAngle",!1);B(this,"_flagInnerRadius",!1);B(this,"_flagOuterRadius",!1);B(this,"_startAngle",0);B(this,"_endAngle",Ut);B(this,"_innerRadius",0);B(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in ou)Object.defineProperty(this,f,ou[f]);typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof l=="number"&&(this.startAngle=l),typeof a=="number"&&(this.endAngle=a),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Xn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Xn.Properties.length;r++){const o=Xn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const i=this._startAngle,r=this._endAngle,o=this._innerRadius,s=this._outerRadius,l=jt(i,Ut)===jt(r,Ut),a=o>0,c=this.vertices;let d=a?c.length/2:c.length,u,f=0,h,m,p,g,b,y,_,k,x;for(l?d--:a||(d-=2),h=0,m=d-1;h<d;h++){switch(p=h/m,g=c[f],b=p*(r-i)+i,y=(r-i)/d,_=s*Math.cos(b),k=s*Math.sin(b),h){case 0:u=fe.move;break;default:u=fe.curve}g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===fe.curve&&(x=s*y/Math.PI,g.controls.left.x=x*Math.cos(b-gt),g.controls.left.y=x*Math.sin(b-gt),g.controls.right.x=x*Math.cos(b+gt),g.controls.right.y=x*Math.sin(b+gt),h===1&&g.controls.left.multiplyScalar(2),h===m&&g.controls.right.multiplyScalar(2)),f++}if(a){for(l?(c[f].command=fe.close,f++):(d--,m=d-1),h=0;h<d;h++)p=h/m,g=c[f],b=(1-p)*(r-i)+i,y=(r-i)/d,_=o*Math.cos(b),k=o*Math.sin(b),u=fe.curve,h<=0&&(u=l?fe.move:fe.line),g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===fe.curve&&(x=o*y/Math.PI,g.controls.left.x=x*Math.cos(b+gt),g.controls.left.y=x*Math.sin(b+gt),g.controls.right.x=x*Math.cos(b-gt),g.controls.right.y=x*Math.sin(b-gt),h===1&&g.controls.left.multiplyScalar(2),h===m&&g.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=fe.line}else l||(c[f].command=fe.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(i){const r=this.innerRadius,o=this.outerRadius,s=this.startAngle,l=this.endAngle,a=this.vertices.length,c=new Xn(0,0,r,o,s,l,a);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<Oe.Properties.length;d++){const u=Oe.Properties[d];c[u]=this[u]}return i&&i.add(c),c}toObject(){const i=super.toObject.call(this);i.renderer.type="arc-segment";for(let r=0;r<Xn.Properties.length;r++){const o=Xn.Properties[r];i[o]=this[o]}return i}};B(Xn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let fl=Xn;const ou={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}}},hl=Math.cos,ml=Math.sin,Yn=class Yn extends Oe{constructor(i,r,o,s){const l=s?Math.max(s,2):4,a=[];for(let c=0;c<l;c++)a.push(new Ae(0,0,0,0,0,0));super(a,!0,!0,!0);B(this,"_flagRadius",!1);B(this,"_radius",0);this._renderer.type="circle";for(let c in su)Object.defineProperty(this,c,su[c]);typeof o=="number"&&(this.radius=o),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Yn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Yn.Properties.length;r++){const o=Yn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagRadius){let i=this.vertices.length;!this._closed&&i>2&&(i-=1);const r=4/3*Math.tan(Math.PI/(i*2)),o=this._radius,s=o*r;for(let l=0;l<this.vertices.length;l++){const c=l/i*Ut,d=o*hl(c),u=o*ml(c),f=s*hl(c-gt),h=s*ml(c-gt),m=s*hl(c+gt),p=s*ml(c+gt),g=this.vertices[l];g.command=l===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(m,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(i){const r=new Yn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let o=0;o<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="circle";for(let r=0;r<Yn.Properties.length;r++){const o=Yn.Properties[r];i[o]=this[o]}return i}};B(Yn,"Properties",["radius"]);let pl=Yn;const su={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},gl=Math.cos,yl=Math.sin,Kn=class Kn extends Oe{constructor(i,r,o,s,l){typeof s!="number"&&typeof o=="number"&&(s=o);const a=l?Math.max(l,2):4,c=[];for(let d=0;d<a;d++)c.push(new Ae);super(c,!0,!0,!0);B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_width",0);B(this,"_height",0);this._renderer.type="ellipse";for(let d in lu)Object.defineProperty(this,d,lu[d]);typeof o=="number"&&(this.width=o*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Kn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Kn.Properties.length;r++){const o=Kn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let i=this.vertices.length;!this._closed&&i>2&&(i-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),o=this._width/2,s=this._height/2;for(let l=0;l<this.vertices.length;l++){const c=l/i*Ut,d=o*gl(c),u=s*yl(c),f=o*r*gl(c-gt),h=s*r*yl(c-gt),m=o*r*gl(c+gt),p=s*r*yl(c+gt),g=this.vertices[l];g.command=l===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(m,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=this.width/2,o=this.height/2,s=this.vertices.length,l=new Kn(0,0,r,o,s);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let a=0;a<Oe.Properties.length;a++){const c=Oe.Properties[a];l[c]=this[c]}return i&&i.add(l),l}toObject(){const i=super.toObject.call(this);i.renderer.type="ellipse";for(let r=0;r<Kn.Properties.length;r++){const o=Kn.Properties[r];i[o]=this[o]}return i}};B(Kn,"Properties",["width","height"]);let bl=Kn;const lu={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}}},y1=Math.cos,b1=Math.sin,Un=class Un extends Oe{constructor(i,r,o,s){s=Math.max(s||0,3);super();B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_flagSides",!1);B(this,"_radius",0);B(this,"_width",0);B(this,"_height",0);B(this,"_sides",0);this._renderer.type="polygon";for(let l in au)Object.defineProperty(this,l,au[l]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.radius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Un().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Un.Properties.length;r++){const o=Un.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const i=this._sides,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const l=(s+.5)/i,a=Ut*l+Math.PI/2,c=this._width*y1(a)/2,d=this._height*b1(a)/2;s>=o?this.vertices.push(new Ae(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=new Un(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 o=0;o<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="polygon";for(let r=0;r<Un.Properties.length;r++){const o=Un.Properties[r];i[o]=this[o]}return i}};B(Un,"Properties",["width","height","sides"]);let _l=Un;const au={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}}},Di=class Di extends Oe{constructor(i,r,o,s){const l=[new Ae,new Ae,new Ae,new Ae];super(l,!0,!1,!0);B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_width",0);B(this,"_height",0);B(this,"_origin",null);this._renderer.type="rectangle";for(let a in cu)Object.defineProperty(this,a,cu[a]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new pe,typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(i){const r=new Di().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Di.Properties.length;r++){const o=Di.Properties[r];o in i&&(typeof i[o]=="number"?this[o]=i[o]:this[o]instanceof pe&&this[o].copy(i[o]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const i=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Ae),this.vertices[0].set(-i,-r).sub(this._origin).command=fe.move,this.vertices[1].set(i,-r).sub(this._origin).command=fe.line,this.vertices[2].set(i,r).sub(this._origin).command=fe.line,this.vertices[3].set(-i,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-i,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=new Di(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 o=0;o<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]instanceof pe?r[s].copy(this[s]):r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="rectangle",i.width=this.width,i.height=this.height,i.origin=this.origin.toObject(),i}};B(Di,"Properties",["width","height","origin"]);let Vr=Di;const cu={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(ne.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ne.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Gn=class Gn extends Oe{constructor(i,r,o,s,l){typeof l>"u"&&typeof o=="number"&&typeof s=="number"&&(l=Math.floor(Math.min(o,s)/12));const a=[];for(let c=0;c<10;c++)a.push(new Ae(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(a);B(this,"_flagWidth",!1);B(this,"_flagHeight",!1);B(this,"_flagRadius",!1);B(this,"_width",0);B(this,"_height",0);B(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in du)Object.defineProperty(this,c,du[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=_1.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof l=="number"||l instanceof pe)&&(this.radius=l),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Gn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Gn.Properties.length;r++){const o=Gn.Properties[r];if(o in i){const s=i[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof pe?s:new pe().copy(s):typeof s=="number"&&(this[o]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const i=this._width,r=this._height;let o,s;this._radius instanceof pe?(o=this._radius.x,s=this._radius.y):(o=this._radius,s=this._radius);let l,a=i/2,c=r/2;l=this.vertices[0],l.x=-(a-o),l.y=-c,l=this.vertices[1],l.x=a-o,l.y=-c,l.controls.left.clear(),l.controls.right.x=o,l.controls.right.y=0,l=this.vertices[2],l.x=a,l.y=-(c-s),l.controls.right.clear(),l.controls.left.clear(),l=this.vertices[3],l.x=a,l.y=c-s,l.controls.left.clear(),l.controls.right.x=0,l.controls.right.y=s,l=this.vertices[4],l.x=a-o,l.y=c,l.controls.right.clear(),l.controls.left.clear(),l=this.vertices[5],l.x=-(a-o),l.y=c,l.controls.left.clear(),l.controls.right.x=-o,l.controls.right.y=0,l=this.vertices[6],l.x=-a,l.y=c-s,l.controls.left.clear(),l.controls.right.clear(),l=this.vertices[7],l.x=-a,l.y=-(c-s),l.controls.left.clear(),l.controls.right.x=0,l.controls.right.y=-s,l=this.vertices[8],l.x=-(a-o),l.y=-c,l.controls.left.clear(),l.controls.right.clear(),l=this.vertices[9],l.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(i){const r=this.width,o=this.height,s=this.radius,l=new Gn(0,0,r,o,s);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let a=0;a<Oe.Properties.length;a++){const c=Oe.Properties[a];l[c]=this[c]}return i&&i.add(l),l}toObject(){const i=super.toObject.call(this);i.renderer.type="rounded-rectangle";for(let r=0;r<Gn.Properties.length;r++){const o=Gn.Properties[r];i[o]=this[o]}return i.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),i}};B(Gn,"Properties",["width","height","radius"]);let wl=Gn;const du={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(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function _1(){this._flagRadius=!0}const w1=Math.cos,x1=Math.sin,Zn=class Zn extends Oe{constructor(i,r,o,s,l){arguments.length<=3&&(s=o,o=s/2),(typeof l!="number"||l<=0)&&(l=5);super();B(this,"_flagInnerRadius",!1);B(this,"_flagOuterRadius",!1);B(this,"_flagSides",!1);B(this,"_innerRadius",0);B(this,"_outerRadius",0);B(this,"_sides",0);this._renderer.type="star";for(let a in uu)Object.defineProperty(this,a,uu[a]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof l=="number"&&(this.sides=l),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Zn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Zn.Properties.length;r++){const o=Zn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const i=this._sides*2,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const l=(s+.5)/i,a=Ut*l,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*w1(a),u=c*x1(a);s>=o?this.vertices.push(new Ae(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=this.innerRadius,o=this.outerRadius,s=this.sides,l=new Zn(0,0,r,o,s);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let a=0;a<Oe.Properties.length;a++){const c=Oe.Properties[a];l[c]=this[c]}return i&&i.add(l),l}toObject(){const i=super.toObject.call(this);i.renderer.type="star";for(let r=0;r<Zn.Properties.length;r++){const o=Zn.Properties[r];i[o]=this[o]}return i}};B(Zn,"Properties",["innerRadius","outerRadius","sides"]);let xl=Zn;const uu={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 kl;const fu=Math.min,hu=Math.max;Bn.document&&(kl=document.createElement("canvas"));const Et=class Et extends Tn{constructor(i,r,o,s){super();B(this,"_flagValue",!0);B(this,"_flagFamily",!0);B(this,"_flagSize",!0);B(this,"_flagLeading",!0);B(this,"_flagAlignment",!0);B(this,"_flagBaseline",!0);B(this,"_flagStyle",!0);B(this,"_flagWeight",!0);B(this,"_flagDecoration",!0);B(this,"_flagFill",!0);B(this,"_flagStroke",!0);B(this,"_flagLinewidth",!0);B(this,"_flagOpacity",!0);B(this,"_flagVisible",!0);B(this,"_flagMask",!1);B(this,"_flagClip",!1);B(this,"_flagDirection",!0);B(this,"_flagStrokeAttenuation",!0);B(this,"_value","");B(this,"_family","sans-serif");B(this,"_size",13);B(this,"_leading",17);B(this,"_alignment","center");B(this,"_baseline","middle");B(this,"_style","normal");B(this,"_weight",500);B(this,"_decoration","none");B(this,"_direction","ltr");B(this,"_fill","#000");B(this,"_stroke","none");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_mask",null);B(this,"_clip",!1);B(this,"_dashes",null);B(this,"_strokeAttenuation",!0);for(let l in mu)Object.defineProperty(this,l,mu[l]);if(this._renderer.type="text",this._renderer.flagFill=k1.bind(this),this._renderer.flagStroke=C1.bind(this),this.value=i,typeof r=="number"&&(this.translation.x=r),typeof o=="number"&&(this.translation.y=o),this.dashes=[],this.dashes.offset=0,!je.isObject(s))return this;for(let l=0;l<Et.Properties.length;l++){const a=Et.Properties[l];a in s&&(this[a]=s[a])}}static Measure(i){if(kl){const r=kl.getContext("2d");r.font=[i._style,i._weight,`${i._size}px/${i._leading}px`,i._family].join(" ");const o=r.measureText(i.value,0,0),s=o.actualBoundingBoxDescent+o.actualBoundingBoxAscent;return{width:o.width,height:s}}else{const r=this.value.length*this.size*Et.Ratio,o=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:o}}}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Si(i.fill),o=typeof i.stroke=="string"?i.stroke:Si(i.stroke),s=new Et().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<Et.Properties.length;r++){const o=Et.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Et(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<Et.Properties.length;o++){const s=Et.Properties[o];r[s]=this[s]}return this.matrix.manual&&r.matrix.copy(this.matrix),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);i.renderer.type="text";for(let r=0;r<Et.Properties.length;r++){const o=Et.Properties[r];i[o]=this[o]}return i}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(i){let r,o,s,l,a;this._update(!0),r=i?this.matrix:this.worldMatrix;const{width:c,height:d}=Et.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":o=-u,s=c+u;break;case"right":o=-(c+u),s=u;break;default:o=-(c/2+u),s=c/2+u}switch(this.baseline){case"middle":l=-(d/2+u),a=d/2+u;break;default:l=-(d+u),a=u}const[f,h]=r.multiply(o,l),[m,p]=r.multiply(o,a),[g,b]=r.multiply(s,l),[y,_]=r.multiply(s,a);return l=fu(h,p,b,_),o=fu(f,m,g,y),s=hu(f,m,g,y),a=hu(h,p,b,_),{top:l,left:o,right:s,bottom:a,width:s-o,height:a-l}}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}};B(Et,"Ratio",.6),B(Et,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let cr=Et;const mu={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 ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ft||this._fill instanceof Vt||this._fill instanceof Mt||this._fill instanceof Qe)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ft||this._stroke instanceof Vt||this._stroke instanceof Mt||this._stroke instanceof Qe)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,je.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 k1(){this._flagFill=!0}function C1(){this._flagStroke=!0}const Qn=class Qn extends Vr{constructor(i,r,o,s){super(r,o,0,0);B(this,"_flagTextures",!1);B(this,"_flagFrameRate",!1);B(this,"_flagIndex",!1);B(this,"_amount",1);B(this,"_duration",0);B(this,"_index",0);B(this,"_startTime",0);B(this,"_playing",!1);B(this,"_firstFrame",0);B(this,"_lastFrame",0);B(this,"_loop",!0);B(this,"_textures",null);B(this,"_frameRate",0);B(this,"_origin",null);this._renderer.type="image-sequence";for(let l in pu)Object.defineProperty(this,l,pu[l]);this._renderer.flagTextures=v1.bind(this),this._renderer.bindTextures=S1.bind(this),this._renderer.unbindTextures=B1.bind(this),this.noStroke(),this.noFill(),Array.isArray(i)?this.textures=i.map(gu.bind(this)):typeof i=="string"&&(this.textures=[gu(i)]),this.origin=new pe,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Qn.DefaultFrameRate,this.index=0}static fromObject(i){const r=new Qn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Qn.Properties.length;r++){const o=Qn.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o: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(i){const r=new Qn(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="image-sequence",i.textures=this.textures.map(function(r){return r.toObject()}),i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=0;i<this.textures.length;i++){const r=this.textures[i];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const i=this._textures;let r,o,s,l,a,c,d,u;return i&&(this._flagTextures&&(this._amount=i.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(l=this._amount,je.isNaN(this._lastFrame)&&(this._lastFrame=l-1),s=je.performance.now()-this._startTime,u=this._lastFrame+1,a=1e3*(u-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),d=Wt(this._firstFrame,u,s/a),d=Math.floor(d),d!==this._index&&(this._index=d,c=i[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Qe))&&(c=i[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};B(Qn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(Qn,"DefaultFrameRate",30);let Cl=Qn;const pu={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,i=this._renderer.unbindTextures;this._textures&&this._textures.unbind(ne.Types.insert,e).unbind(ne.Types.remove,i),this._textures=new Ci((t||[]).slice(0)),this._textures.bind(ne.Types.insert,e).bind(ne.Types.remove,i),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 v1(){this._flagTextures=!0}function S1(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function B1(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gu(t){if(t instanceof Qe)return t;if(typeof t=="string")return new Qe(t)}const Li=class Li extends Vr{constructor(i,r,o,s,l,a){super(r,o,0,0);B(this,"_flagTexture",!1);B(this,"_flagColumns",!1);B(this,"_flagRows",!1);B(this,"_flagFrameRate",!1);B(this,"_flagIndex",!1);B(this,"_amount",1);B(this,"_duration",0);B(this,"_startTime",0);B(this,"_playing",!1);B(this,"_firstFrame",0);B(this,"_lastFrame",0);B(this,"_loop",!0);B(this,"_texture",null);B(this,"_columns",1);B(this,"_rows",1);B(this,"_frameRate",0);B(this,"_index",0);B(this,"_origin",null);this._renderer.type="sprite";for(let c in yu)Object.defineProperty(this,c,yu[c]);this.noStroke(),this.noFill(),i instanceof Qe?this.texture=i:typeof i=="string"&&(this.texture=new Qe(i)),this.origin=new pe,this._update(),typeof s=="number"&&(this.columns=s),typeof l=="number"&&(this.rows=l),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(i){const r=new Li().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Li.Properties.length;r++){const o=Li.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o: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(i){const r=new Li(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,i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="sprite",i.texture=this.texture.toObject(),i.columns=this.columns,i.rows=this.rows,i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=this._texture,r=this._columns,o=this._rows;let s,l,a,c,d,u,f,h,m;if(i&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=i),i.loaded)){f=i.image.width,h=i.image.height,s=f/r,l=h/o,c=this._amount,this.width!==s&&(this.width=s),this.height!==l&&(this.height=l),this._playing&&this._frameRate>0&&(je.isNaN(this._lastFrame)&&(this._lastFrame=c-1),a=je.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%d:a=Math.min(a,d),u=Wt(this._firstFrame,m,a/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%r,g=Math.floor(this._index/r),b=-s*p+(f-s)/2,y=-l*g+(h-l)/2;b!==i.offset.x&&(i.offset.x=b),y!==i.offset.y&&(i.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}};B(Li,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let vl=Li;const yu={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}}},jo=Math.min,qo=Math.max,N1={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},Ot=class Ot extends Tn{constructor(i){super();B(this,"_flagAdditions",!1);B(this,"_flagSubtractions",!1);B(this,"_flagOrder",!1);B(this,"_flagOpacity",!0);B(this,"_flagBeginning",!1);B(this,"_flagEnding",!1);B(this,"_flagLength",!1);B(this,"_flagMask",!1);B(this,"_fill","#fff");B(this,"_stroke","#000");B(this,"_linewidth",1);B(this,"_opacity",1);B(this,"_visible",!0);B(this,"_cap","round");B(this,"_join","round");B(this,"_miter",4);B(this,"_closed",!0);B(this,"_curved",!1);B(this,"_automatic",!0);B(this,"_beginning",0);B(this,"_ending",1);B(this,"_length",0);B(this,"_mask",null);B(this,"_strokeAttenuation",!0);for(let r in bu)Object.defineProperty(this,r,bu[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(i)?i:Array.prototype.slice.call(arguments)}static InsertChildren(i){for(let r=0;r<i.length;r++)_u.call(this,i[r],this)}static RemoveChildren(i){for(let r=0;r<i.length;r++)_u.call(this,i[r])}static OrderChildren(i){this._flagOrder=!0}static fromObject(i){const r=new Ot;for(let s=0;s<Ot.Properties.length;s++){const l=Ot.Properties[s];l in i&&(/(fill|stroke)/i.test(l)?r[l]=typeof i[l]=="string"?i[l]:Si(i[l]):r[l]=i[l])}return"mask"in i&&(r.mask=o(i.mask)),"id"in i&&(r.id=i.id),r.children=i.children.map(o),r;function o(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return fl.fromObject(s);case"circle":return pl.fromObject(s);case"element":return Fr.fromObject(s);case"ellipse":return bl.fromObject(s);case"group":return Ot.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return Cl.fromObject(s);case"path":return Oe.fromObject(s);case"points":return Wo.fromObject(s);case"polygon":return _l.fromObject(s);case"rectangle":return Vr.fromObject(s);case"rounded-rectangle":return wl.fromObject(s);case"shape":return Tn.fromObject(s);case"sprite":return vl.fromObject(s);case"star":return xl.fromObject(s);case"text":return cr.fromObject(s)}return s}}static IsVisible(i,r){if(!r)return!0;let o=i;for(;o;){if(typeof o.visible=="boolean"&&!o.visible||typeof o.opacity=="number"&&o.opacity<=0)return!1;o=o.parent}return!0}static VisitForHitTest(i,r,o,s,l,a,c){const d=i&&i.children;if(!d)return!1;const u=r.results;for(let f=d.length-1;f>=0;f--){const h=d[f];if(!h||!Ot.IsVisible(h,r.visibleOnly))continue;const m=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(m&&!i1(m,r.x,r.y,a))){if(h instanceof Ot){if(o&&(!s||s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,l)&&(u.push(h),c)||Ot.VisitForHitTest(h,r,o,s,l,a,c))return!0;continue}if(h instanceof Tn&&!(s&&!s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,l)&&(u.push(h),c))return!0}}return!1}copy(i){super.copy.call(this,i),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<Ot.Properties.length;r++){const o=Ot.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Ot,o=this.children.map(function(s){return s.clone()});return r.add(o),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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="group",i.children=[],i.opacity=this.opacity,i.className=this.className,i.mask=this.mask?this.mask.toObject():null,je.each(this.children,(r,o)=>{i.children[o]=r.toObject()},this),i}dispose(){if(super.dispose(),this.children)for(let i=0;i<this.children.length;i++){const r=this.children[i];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}getShapesAtPoint(i,r,o){const s=o||{},{results:l,hitOptions:a,context:c,single:d,empty:u}=N1.getShapesAtPoint;l.length=0;const f=s.mode==="deepest"||s.deepest?"deepest":"all",h=s.visibleOnly!==!1,m=!!s.includeGroups,p=typeof s.filter=="function"?s.filter:null,g=typeof s.tolerance=="number"?s.tolerance:0;typeof s.precision=="number"?a.precision=s.precision:delete a.precision,typeof s.fill<"u"?a.fill=s.fill:delete a.fill,typeof s.stroke<"u"?a.stroke=s.stroke:delete a.stroke,a.tolerance=g,a.ignoreVisibility=!h;const b=f==="deepest";if(c.x=i,c.y=r,c.visibleOnly=h,c.results=l,Ot.VisitForHitTest(this,c,m,p,a,g,b),b){if(l.length>0){const _=l[0];return l.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const y=l.slice();return l.length=0,y}corner(){const i=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const o=this.children[r];o.translation.x-=i.left,o.translation.y-=i.top}return this.mask&&(this.mask.translation.x-=i.left,this.mask.translation.y-=i.top),this}center(){const i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const l=this.children[s];l.isShape&&(l.translation.x-=r,l.translation.y-=o)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getById(i){let r=null;function o(s){if(s.id===i)return s;if(s.children){if(s.children.ids[i])return s.children.ids[i];for(let l=0;l<s.children.length;l++)if(r=o(s.children[l]),r)return r}return null}return o(this)}getByClassName(i){const r=[];function o(s){if(Array.prototype.indexOf.call(s.classList,i)>=0&&r.push(s),s.children)for(let l=0;l<s.children.length;l++){const a=s.children[l];o(a)}return r}return o(this)}getByType(i){const r=[];function o(s){if(s instanceof i&&r.push(s),s.children)for(let l=0;l<s.children.length;l++){const a=s.children[l];o(a)}return r}return o(this)}add(i){i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let r=0;r<i.length;r++){const o=i[r];if(!(o&&o.id))continue;const s=Array.prototype.indexOf.call(this.children,o);s>=0&&this.children.splice(s,1),this.children.push(o)}return this}remove(i){const r=arguments.length,o=this.parent;if(r<=0&&o)return o.remove(this),this;i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let s=0;s<i.length;s++){const l=i[s];if(!l||!this.children.ids[l.id])continue;const a=this.children.indexOf(l);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(i){let r,o,s,l,a,c;this._update(!0);let d=1/0,u=-1/0,f=1/0,h=-1/0;const m=/texture|gradient/i;o=i?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const g=this.children[p];if(!(!g.visible||m.test(g._renderer.type))&&(r=g.getBoundingClientRect(i),s=typeof r.top!="number"||je.isNaN(r.top)||!isFinite(r.top),l=typeof r.left!="number"||je.isNaN(r.left)||!isFinite(r.left),a=typeof r.right!="number"||je.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||je.isNaN(r.bottom)||!isFinite(r.bottom),!(s||l||a||c)))if(i){const[b,y]=o.multiply(r.left,r.top),[_,k]=o.multiply(r.right,r.top),[x,v]=o.multiply(r.left,r.bottom),[N,w]=o.multiply(r.right,r.bottom);f=jo(y,k,v,w,f),d=jo(b,_,x,N,d),u=qo(b,_,x,N,u),h=qo(y,k,v,w,h)}else f=jo(r.top,f),d=jo(r.left,d),u=qo(r.right,u),h=qo(r.bottom,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}noFill(){return this.children.forEach(function(i){i.noFill()}),this}noStroke(){return this.children.forEach(function(i){i.noStroke()}),this}subdivide(){const i=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,i)}),this}_update(){let i,r,o;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),l=Math.max(this._beginning,this._ending),a=this.length;let c=0;const d=s*a,u=l*a;for(i=0;i<this.children.length;i++)o=this.children[i],r=o.length,d>c+r?(o.beginning=1,o.ending=1):u<c?(o.beginning=0,o.ending=0):d>c&&d<c+r?(o.beginning=(d-c)/r,o.ending=1):u>c&&u<c+r?(o.beginning=0,o.ending=(u-c)/r):(o.beginning=0,o.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}};B(Ot,"Children",ru),B(Ot,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Hn=Ot;const bu={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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.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 i=this.children[e];i.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=Hn.InsertChildren.bind(this),i=Hn.RemoveChildren.bind(this),r=Hn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&i(this._children)),this._children=new ru(t),this._children.bind(ne.Types.insert,e),this._children.bind(ne.Types.remove,i),this._children.bind(ne.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,je.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 i=this.children[e];i.strokeAttenuation!==void 0&&(i.strokeAttenuation=t)}}}};function _u(t,e){const i=t.parent;let r;if(i===e){o();return}if(i&&i.children.ids[t.id]&&(r=Array.prototype.indexOf.call(i.children,t),i.children.splice(r,1),s()),e){o();return}s(),i._flagAdditions&&i.additions.length===0&&(i._flagAdditions=!1),i._flagSubtractions&&i.subtractions.length===0&&(i._flagSubtractions=!1),delete t.parent;function o(){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 s(){r=Array.prototype.indexOf.call(i.additions,t),r>=0&&i.additions.splice(r,1),r=Array.prototype.indexOf.call(i.subtractions,t),r<0&&(i.subtractions.push(t),i._flagSubtractions=!0)}}class Xo extends Oe{constructor(e,i,r,o){const s=[new Ae(e,i),new Ae(r,o)];super(s);for(let l in wu)Object.defineProperty(this,l,wu[l]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}B(Xo,"Properties",["left","right"]);const wu={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(je.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=fe.move;else{const e=new Mo("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(je.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=fe.line;else{const e=new Mo("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Sl{constructor(e=0,i=0){this.x=e,this.y=i}}class $n{constructor(e=10,i=0,r="A"){B(this,"start",new Sl);B(this,"end",new Sl);this.width=e,this.angle=i,this.label=r}}const qe={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"}},T1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $1(t,e){return n.openBlock(),n.createElementBlock("svg",T1,[...e[0]||(e[0]=[n.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 Yo=n.markRaw({name:"ion-close",render:$1}),E1={class:"mr-3 flex flex-col gap-2"},R1=["onClick"],P1={class:"h-full p-2"},F1={},V1=n.defineComponent({...F1,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const i=t,r=n.ref(!1),o=n.useTemplateRef("drawing-template-containers"),s=n.useTemplateRef("drawing-custom-template-containers"),l=e,a=c=>{r.value=!0,l("remove-custom-template",c,()=>{r.value=!1})};return n.onMounted(()=>{var c,d;(c=i.settings.templates)==null||c.forEach((u,f)=>{var m;const h=(m=o.value)==null?void 0:m.at(f);h&&l("init-draw-template",h,u)}),(d=i.settings.customTemplates)==null||d.forEach((u,f)=>{var m;const h=(m=s.value)==null?void 0:m.at(f);h&&l("init-draw-template",h,u)})}),n.watch(()=>[...i.settings.customTemplates],(c,d)=>{n.nextTick(()=>{c.forEach((u,f)=>{var h;if(!(d!=null&&d.includes(u))){const m=(h=s.value)==null?void 0:h.at(f);m&&l("init-draw-template",m,u)}}),d.length>c.length&&d.forEach((u,f)=>{var m;const h=(m=s.value)==null?void 0:m.at(f);h&&(h.innerHTML="",l("init-draw-template",h,u))})})},{deep:!0}),(c,d)=>{const u=Yo;return n.openBlock(),n.createBlock(n.unref(F.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:n.withCtx(()=>[n.createElementVNode("div",E1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.settings.allTemplates,(f,h)=>(n.openBlock(),n.createElementBlock("div",{key:`${f.id}-${h}`,class:"group relative"},[n.createVNode(n.unref(F.NPopover),{trigger:"hover",placement:"right"},{trigger:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":h===t.selectTemplateIndex}]),onClick:m=>l("template:select",h)},[n.createElementVNode("div",P1,[n.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,R1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:m=>a(h)},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):n.createCommentVNode("",!0)]))),128))])]),_:1})}}}),xu=cn(V1,[["__scopeId","data-v-afccb364"]]),M1={class:"flex gap-3 min-w-[20rem] relative"},I1={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},A1={ref:"drawing-container",class:"size-full"},O1={},ku=n.defineComponent({...O1,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const i=t,r=e,o=n.useTemplateRef("drawing-container");let s=[],l=[],a=[],c=null;const d=.75,u=n.computed(()=>i.value.configuratorParams.linesAngles.map((L,O)=>new $n(i.value.configuratorParams.linesWidths[O],L,`A-${O+1}`))),f=n.computed(()=>i.value.configuratorParams.colorSide==="bottom"),h=n.computed(()=>{var L,O;return i.value.configuratorParams.startTailType&&((L=i.settings.startTailConfigs)!=null&&L[i.value.configuratorParams.startTailType])?(O=i.settings.startTailConfigs)==null?void 0:O[i.value.configuratorParams.startTailType].points:[]}),m=n.computed(()=>{var O;const L=i.value.configuratorParams.endTailType!==void 0&&((O=i.settings.endTailConfigs)==null?void 0:O[i.value.configuratorParams.endTailType]);return!L||!L.points?[]:L.points.map((z,M)=>Array.isArray(z)?new $n(z[0],z[1],`A-${M+1}`):new $n(z.width,z.angle,`A-${M+1}`))}),p=(L,O=!1)=>{L[0].start.x=0,L[0].start.y=0;let z=0;for(let M=0;M<L.length;M++){const R=L[M],W=L[M-1]??new $n(0,z);z+=!O||M>1?W.angle:0;const K=(!O||M>0?R.angle:0)+z;if(L[M].end.x=R.width*Math.cos(K*Math.PI/180)+L[M].start.x,L[M].end.y=R.width*Math.sin(K*Math.PI/180)+L[M].start.y,M<L.length-1){const G=M+1;L[G].start.x=L[M].end.x,L[G].start.y=L[M].end.y}}return L},g=(L,O,z,M,R=!1)=>{let W=p([...z,...M]);O.length>0&&(W=[...p(O),...W]);let K=0,G=0,X=0,j=0;W.forEach(ve=>{K=Math.min(K,ve.start.x,ve.end.x),G=Math.min(G,ve.start.y,ve.end.y),X=Math.max(X,ve.start.x,ve.end.x),j=Math.max(j,ve.start.y,ve.end.y)});let q,le;K===0&&G===0&&X===0&&j===0?(q=1,le=1):(q=L.width/Math.abs(X-K),le=(R?L.height:L.height-qe.colorSideLabel.size)/Math.abs(j-G));const de=Math.min(q,le);return K=K<0?-K*de:0,G=G<0?-G*de:0,[de,K,G]},b=L=>{const O=new Wo([L]);return O._size=qe.anchorPoint.size,O.fill=qe.anchorPoint.color,O.stroke="transparent",O._linewidth=qe.anchorPoint.strokeSize,a.push(O),O},y=(L,O)=>{if(a=[],i.settings.allowChangeFirstPoint){const z=L[0],M=new pe(z.vertices[0].x,z.vertices[0].y);M.bind(ne.Types.change,()=>{z.vertices[0].copy(M)});const R=b(M);O.add(R)}L.forEach((z,M)=>{const R=L[M+1],W=new pe(z.vertices[1].x,z.vertices[1].y);W.bind(ne.Types.change,()=>{z.vertices[1].copy(W),R!==void 0&&R.vertices[0].copy(W)});const K=b(W);O.add(K)})},_=L=>L*(Math.PI/180),k=(L,O,z)=>{const M=O.vertices.length-1;L.position.x=O.vertices[M].x,L.position.y=O.vertices[M].y;const R=Math.atan2(O.vertices[M].y-O.vertices[0].y,O.vertices[M].x-O.vertices[0].x);L.rotation=_(z)+R},x=(L,O,z)=>{if(O.vertices[0]===void 0)return;L.position.x=O.vertices[0].x,L.position.y=O.vertices[0].y;const M=O.vertices.length-1,R=Math.atan2(O.vertices[M].y-O.vertices[0].y,O.vertices[M].x-O.vertices[0].x);L.rotation=_(z)+R},v=(L,O,z)=>{const M=new Hn;if(L.length===0)return M;const R=[];return[...L].reverse().forEach((W,K)=>{K!==0&&W.angle>0&&(W.angle*=-1),R.push(W)}),L=p(R,!0),x(M,O,L[0].angle),[O.vertices[0],O.vertices[1]].forEach(W=>{W.bind(ne.Types.change,()=>{x(M,O,L[0].angle)})}),L.forEach(W=>{const K=W.start.x*z,G=W.end.x*z,X=W.start.y*z,j=W.end.y*z,q=new Xo(K,X,G,j);q.linewidth=qe.line.size,q.stroke=qe.line.color,M.add(q)}),M},N=(L,O,z)=>{const M=new Hn;return L.length===0||(L=p(L,!0),k(M,O,L[0].angle),[O.vertices[0],O.vertices[1]].forEach(R=>{R.bind(ne.Types.change,()=>{k(M,O,L[0].angle)})}),L.forEach(R=>{const W=R.start.x*z,K=R.end.x*z,G=R.start.y*z,X=R.end.y*z,j=new Xo(W,G,K,X);j.linewidth=qe.line.size,j.stroke=qe.line.color,M.add(j)})),M},w=(L,O,z,M)=>{const R=O.vertices[0].x+(O.vertices[1].x-O.vertices[0].x)/2-8*Math.sin(L.angle*Math.PI/180),W=O.vertices[0].y+(O.vertices[1].y-O.vertices[0].y)/2-8*Math.cos(L.angle*Math.PI/180),K=new cr(L.label,R+10,W-10);let G;K.size=qe.lineLabel.size,K.weight=600,K.fill=qe.lineLabel.color,K.id+=1,K.rotation=qe.lineLabel.rotation,M>0&&(G=new cr(`${L.angle}°`,O.vertices[0].x+25,O.vertices[0].y-25),G.size=qe.angleLabel.size,G.weight=600,G.fill=qe.angleLabel.color,G.rotation=qe.angleLabel.rotation,G.id+=M,s.push(G),z.add(G)),z.add(K),C(K,O,0,G),C(K,O,1)},T=()=>{const{size:L}=qe.colorSideLabel,O=0,z=0,M=f.value?L/2:L/2-L,R=f.value?L/2-L:L/2,W=new Hn;if(!c)return W;const K=5,G=Math.atan2(R-M,z-O),X=[new Ae(O,M,0,0,0,0,Sn.Commands.move),new Ae(z,R,0,0,0,0,Sn.Commands.line),new Ae(z-K*Math.cos(G-Math.PI/4),R-K*Math.sin(G-Math.PI/4),0,0,0,0,Sn.Commands.line),new Ae(z,R,0,0,0,0,Sn.Commands.move),new Ae(z-K*Math.cos(G+Math.PI/4),R-K*Math.sin(G+Math.PI/4),0,0,0,0,Sn.Commands.line)],j=new Oe(X,!1,!1,!0);j.noFill(),j.cap="round",j.join="round",j.linewidth=L/7,j.stroke=qe.colorSideLabel.color,W.add(j);const q=new cr(f.value?"Цвет снизу":"Цвет сверху",10,0);q.size=L,q.weight=600,q.fill=qe.colorSideLabel.color,q.alignment="left",W.add(q);const le=W.getBoundingClientRect();return W.position.x=(c.width-le.width)*d+10,W.position.y=f.value?c.height+le.height*2:le.height/2,W},C=(L,O,z,M)=>{O.vertices[z].bind(ne.Types.change,()=>{const R=O.vertices.length-1,W=Math.atan2(O.vertices[0].y-O.vertices[R].y,O.vertices[0].x-O.vertices[R].x)*180/Math.PI,K=O.vertices[0].x+(O.vertices[R].x-O.vertices[0].x)/2-8*Math.sin(W*Math.PI/180),G=O.vertices[0].y+(O.vertices[R].y-O.vertices[0].y)/2-8*Math.cos(W*Math.PI/180);L.position.x=K+10,L.position.y=G-10,L.rotation=-.5,M&&(M.position.x=O.vertices[0].x+25,M.position.y=O.vertices[0].y-25)})},$=(L,O,z,M,R=!1)=>{var st;if(L.clear(),z.length===0){L.update();return}const W=p(z),[K,G,X]=g(L,O,W,M,R),j=new Hn,q=new Array,le=new Array;R||(s=[],l=[]),W.forEach((_e,we)=>{const xt=_e.start.x*K+G,Ee=_e.end.x*K+G,Zt=_e.start.y*K+X,yn=_e.end.y*K+X,Rt=new Xo(xt,Zt,Ee,yn);Rt.linewidth=R?qe.previewLine.size:qe.line.size,Rt.stroke=R?qe.previewLine.color:qe.line.color,l.push(Rt),q.push(Rt),j.add(Rt),!R&&_e.label!==""&&w(_e,Rt,j,we)});const de=q.at(-1);let ve=j.getBoundingClientRect();if(!R){const _e=T();le.push(_e)}if(O.length>0){const _e=v(O,q[0],K);j.add(_e)}if(M.length>0&&de){const _e=N(M,de,K);j.add(_e)}if(le.push(j),L.makeGroup(le),ve=j.getBoundingClientRect(),j.position.x=0-ve.left+(L.width-ve.width)/(2*(R?1:d)),j.position.y=0-ve.top+(L.height-ve.height)/(2*(R?1:d)),L.update(),!R){const _e=((st=i.value.configuratorParams)==null?void 0:st.colorSide)==="top";j.position.y=j.position.y+qe.colorSideLabel.size*Number(_e),y(q,j),L.update()}},E=(L,O)=>{if(L&&!O.isNewRec()){const z=new Sn({width:L.scrollWidth,height:L.scrollHeight});z.appendTo(L),$(z,[],O.points,[],!0)}},V=()=>{c&&$(c,h.value,u.value,m.value,!1)},P=L=>L*(180/Math.PI),I=(L,O)=>{const z=L[1].x-L[0].x,M=L[1].y-L[0].y,R=O[1].x-O[0].x,W=O[1].y-O[0].y;let K=Math.atan2(z*W-M*R,z*R+M*W);return K=P(K),Math.round(K)*-1},U=L=>{const O=l.map((z,M,R)=>{const W=R[M-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let K=Math.ceil(z._length/L/i.settings.lineWidthStep)*i.settings.lineWidthStep;const G=s[M-1];K<(R.length>1?i.settings.minLineWidth:i.settings.stripMinWidth)&&(K=R.length>1?i.settings.minLineWidth:i.settings.stripMinWidth),K>i.settings.maxLineWidth&&(K=i.settings.maxLineWidth);const X=I(z.vertices,W.vertices);return G&&(G.value=`${X}°`),new $n(K,X,`A-${M+1}`)});r("pointer:move",O)},J=L=>{let O=null,z;const M=G=>{O=a.find(X=>{const j=X.renderer;return(j==null?void 0:j.elem)===G.target}),[z]=g(L,h.value,u.value.map(X=>X),m.value)},R=G=>{if(O){const X=O.renderer,j=X==null?void 0:X.elem;if(!j)return;const q=j.getBoundingClientRect();O.vertices[0].x-=q.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+qe.anchorPoint.size/2,O.vertices[0].y-=q.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+qe.anchorPoint.size/2,U(z),L.update()}},W=()=>{O&&r("pointer:up",u.value),O=null},K=o.value;K&&(K.addEventListener("touchstart",M,{passive:!0}),K.addEventListener("touchend",W,{passive:!0}),K.addEventListener("mousedown",M),K.addEventListener("mouseup",W),K.addEventListener("mousemove",R),K.addEventListener("touchmove",R,{passive:!0}))},Z=(L,O)=>{r("remove-custom-template",L,O)};return n.onMounted(()=>{o.value&&(c=new Sn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),n.watch(()=>i.value,()=>{V()},{deep:!0,immediate:!0}),J(c))}),n.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(L,O)=>(n.openBlock(),n.createElementBlock("div",M1,[n.createVNode(xu,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":O[0]||(O[0]=z=>r("template:select",z)),onInitDrawTemplate:E,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),n.createElementVNode("div",I1,[n.createElementVNode("div",A1,null,512)])]))}});class dr extends H.Identity{constructor(i,r){super();B(this,"label","");B(this,"points",[]);B(this,"isCustom",!1);B(this,"id",-1);B(this,"guid","");i?(this.label=i.label,this.points=i.points.map((o,s)=>A.isArray(o)?new $n(o[0],o[1],`A-${s+1}`):new $n(o.width,o.angle,`A-${s+1}`)),this.isCustom=i.isCustom):(this.label="-- Новая конфигурация --",this.points=[new $n(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Bl extends dr{constructor(i){super(i);B(this,"isDefault");this.isDefault=i.isDefault??!1}}class Cu{constructor(e){B(this,"minLineWidth");B(this,"maxLineWidth");B(this,"lineWidthStep");B(this,"minLineAngle");B(this,"maxLineAngle");B(this,"lineAngleStep");B(this,"stripMinWidth");B(this,"stripMaxWidth");B(this,"stripMinLength");B(this,"stripMaxLength");B(this,"allowShowTable");B(this,"showOnlyTemplates");B(this,"templates");B(this,"customTemplates",[]);B(this,"startTailConfigs");B(this,"endTailConfigs");B(this,"bendCountForExtended");B(this,"extendedProductCatalog");B(this,"allowChangeFirstPoint");B(this,"allowSaveTemplates");B(this,"userTemplatesPrefix");B(this,"lengthStep");B(this,"canSetDopProdaga");var i,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(o=>new dr(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((i=e.startTailConfigs)==null?void 0:i.map(o=>new Bl(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Bl(o)))??[],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(([,o])=>o.id!==-1).map(([o,s])=>{const l=new dr(s);return l.isCustom=!0,l.id=+o,l}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new dr({label:"-- Новая конфигурация --",points:[new $n(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findLast(o=>!o.isNewRec()),r=new dr(e);r.isCustom=!0,r.id=i?i.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findIndex(r=>r.id===e);i!==-1&&this.customTemplates.splice(i,1)}}const z1={class:"flex flex-col gap-3"},D1={class:"grid gap-5 md:grid-cols-5"},L1={},vu=n.defineComponent({...L1,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.ref(!1),s=n.ref(!1),l=n.ref(!1),a=n.ref(i.cartItem),c=n.ref(new Cu(i.settings)),d=n.ref({linesWidths:[...i.cartItem.configuratorParams.linesWidths],linesAngles:[...i.cartItem.configuratorParams.linesAngles]}),u=n.ref({quantity:{},marker:{},length:{}}),f=n.ref(0),h=n.useTemplateRef("kozyrek-configurator-params-form"),m=(C=0)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(C);$!==void 0&&(f.value=C,a.value.configuratorParams.linesWidths=$.points.map(V=>A.isArray(V)?V[0]:V.width),a.value.configuratorParams.linesAngles=$.points.map(V=>A.isArray(V)?V[1]:V.angle),k()),y(a.value.configuratorParams)},p=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;l.value=!0;const $={label:C,points:a.value.configuratorParams.linesWidths.map((V,P)=>[V,a.value.configuratorParams.linesAngles[P]])},E=V=>{V&&(c.value.addCustomTemplate($),f.value=c.value.allTemplates.length-2),l.value=!1};i.eventEmitter.emit("configurator:create-template",{category:i.cartItem.category,template:$,callback:E})},g=async(C,$)=>{var P;const E=(P=c.value.allTemplates)==null?void 0:P.at(C);if(!E||!E.isCustom)return;const V=I=>{I&&(c.value.removeCustomTemplate(E.id),m()),$==null||$()};i.eventEmitter.emit("configurator:remove-template",{category:i.cartItem.category,templateId:E.id,callback:V})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async C=>{var $,E;a.value.product=new H.ClientProduct,(E=($=h.value)==null?void 0:$.formReference)==null||E.validate(V=>{V||(k(),o.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:C,validationFieldResultData:u.value,callback:P=>{P?a.value.product=P:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(A.noop)},_=async()=>{var C,$;($=(C=h.value)==null?void 0:C.formReference)==null||$.validate(E=>{var V,P;if(!E){s.value=!0;const I=new H.OrderItemBase(a.value);(V=c.value.startTailConfigs)!=null&&V.length||delete I.configuratorParams.startTailType,(P=c.value.endTailConfigs)!=null&&P.length||delete I.configuratorParams.endTailType,r("submit",I,u.value,()=>{s.value=!1,n.nextTick(()=>{var U,J;(J=(U=h.value)==null?void 0:U.formReference)==null||J.restoreValidation()})})}}).catch(A.noop)},k=()=>{const C={quantity:u.value.quantity,marker:u.value.marker};a.value.configuratorParams.linesWidths.forEach(($,E)=>{C[`lines_widths[${E+1}]`]={},C[`lines_angles[${E+1}]`]={}}),u.value=C},x=C=>{d.value.linesWidths=C.map($=>$.width),d.value.linesAngles=C.map($=>$.angle)},v=C=>{a.value.configuratorParams.linesWidths=d.value.linesWidths,a.value.configuratorParams.linesAngles=d.value.linesAngles,k(),b(),y(a.value.configuratorParams)},N=(C,$)=>{d.value.linesWidths=C,d.value.linesAngles=$},w=C=>{const $=a.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,E=0;a.value.configuratorParams.linesWidths.splice(C+1,0,$),a.value.configuratorParams.linesAngles.splice(C+1,0,E),d.value.linesWidths=[...a.value.configuratorParams.linesWidths],d.value.linesAngles=[...a.value.configuratorParams.linesAngles],k(),b(),y(a.value.configuratorParams)},T=C=>{a.value.configuratorParams.linesWidths.length<=1||(a.value.configuratorParams.linesWidths.splice(C,1),a.value.configuratorParams.linesAngles.splice(C,1),d.value.linesWidths=[...a.value.configuratorParams.linesWidths],d.value.linesAngles=[...a.value.configuratorParams.linesAngles],k(),b(),y(a.value.configuratorParams))};return n.onMounted(()=>{i.cartItem.isNewRec()?m():(k(),f.value=-1,y(a.value.configuratorParams))}),n.watch(()=>i.cartItem,C=>{a.value=new H.OrderItemBase(C),C.isNewRec()?m():(k(),f.value=-1,y(a.value.configuratorParams))}),(C,$)=>{const E=F.NButton;return n.openBlock(),n.createElementBlock("div",z1,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(E,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=V=>r("click:view-switch"))},{default:n.withCtx(()=>[...$[3]||($[3]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",D1,[n.createVNode(ku,{value:a.value,"select-template-index":f.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":v,"onPointer:move":x,"onTemplate:select":m,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),n.createVNode(nc,{ref:"kozyrek-configurator-params-form",value:a.value,"onUpdate:value":$[1]||($[1]=V=>a.value=V),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":f.value,class:"col-span-2","onUpdate:params":$[2]||($[2]=V=>y(V)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":p,"onClick:addLine":w,"onClick:removeLine":T},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),H1={class:"flex flex-col items-center justify-between rounded-xl"},W1={class:"img-preview relative flex justify-center"},j1={},q1=n.defineComponent({...j1,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const i=t,r=n.computed(()=>{const{height:s}=i.configuratorParams;return A.keys(i.settings.crossbarCount).reverse().find(l=>s>=i.settings.crossbarCount[Number(l)])}),o=e;return(s,l)=>{const a=F.NButton;return n.openBlock(),n.createElementBlock("div",H1,[n.createElementVNode("div",W1,[l[1]||(l[1]=n.createElementVNode("div",{class:"window"},null,-1)),n.createElementVNode("div",{class:n.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),n.createElementVNode("div",{class:n.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),n.createElementVNode("div",{class:n.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),n.createVNode(a,{type:"primary",class:"block justify-self-center",onClick:l[0]||(l[0]=c=>o("open-instructions"))},{default:n.withCtx(()=>[...l[2]||(l[2]=[n.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Nl=cn(q1,[["__scopeId","data-v-2a790a20"]]),X1={key:0,class:"flex items-baseline gap-1"},Y1={key:0,class:"flex items-baseline gap-1"},K1={key:1},U1={class:"text-lg font-semibold"},G1={key:2,class:"text-red-500 text-sm mb-2"},Z1={class:"flex gap-3"},Q1={},Su=n.defineComponent({...Q1,__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:i}){var w;const r=t,o=i,s=n.computed(()=>Ye.isPhoneDevice()),l=n.useTemplateRef("form-reference"),a=n.useTemplateRef("width-form-item-reference"),c=n.useTemplateRef("height-form-item-reference"),d=n.useTemplateRef("width-input-reference"),u=n.ref(A.cloneDeep(r.value)),f=n.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),h=n.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),m=n.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),p=n.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),g=n.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+f.value:0),b=n.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+h.value:0),y=n.ref(r.settings.canSetDopProdaga??!1),_=n.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-f.value),ae.max(m.value-f.value),ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-h.value),ae.max(p.value-h.value),ae.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),k=n.computed(()=>{var P;const T=g.value,C=b.value,{quantity:$}=r.value,E=((P=r.value.product)==null?void 0:P.costRub)||0;if(!T||!C||!$||E===0)return null;const V=T*C/1e6;return(E*$*V).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=n.computed(()=>{const T=g.value,C=b.value,$=!!(T&&T>=r.settings.minWidth&&T<=r.settings.maxWidths[u.value.configuratorParams.netType]),E=!!(C&&C>=r.settings.minHeight&&C<=r.settings.maxHeights[u.value.configuratorParams.netType]),V=!!(r.value.quantity&&r.value.quantity>0);return $&&E&&V}),v=(T,C)=>{var V,P;const $=u.value.configuratorParams;T&&T in $&&($[T]=C);const E={...$,width:g.value??0,height:b.value??0};T==="width"&&((V=a.value)==null||V.validate().catch(A.noop)),T==="height"&&((P=c.value)==null||P.validate().catch(A.noop)),n.nextTick(()=>{var U,J;!((U=a.value)!=null&&U.validationErrored)&&!((J=c.value)!=null&&J.validationErrored)&&E.height&&E.width&&o("update:params",E),N("configuratorParams",E)})},N=(T,C)=>{const $=new H.OrderItemBase(r.value);$[T]=C,T==="configuratorParams"&&($.product=new H.ClientProduct),o("update:value",$)};return n.watch(()=>r.value,T=>{const C=A.cloneDeep(n.toRaw(T)),$=C.configuratorParams.mountType,E=r.settings.widthOverlaps[$]??0,V=r.settings.heightOverlaps[$]??0;C.configuratorParams.width&&C.configuratorParams.width>0&&(C.configuratorParams.width-=E),C.configuratorParams.height&&C.configuratorParams.height>0&&(C.configuratorParams.height-=V),u.value=C},{deep:!0,immediate:!0}),n.onMounted(()=>{var T;(T=d.value)==null||T.select()}),e({validate:(w=l.value)==null?void 0:w.validate,formReference:l}),(T,C)=>{const $=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.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"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[C[0]||(C[0]=E=>u.value.configuratorParams.netType=E),C[1]||(C[1]=E=>v("netType",E))],options:t.settings.netType.map(E=>({label:t.settings.descriptions.net_type[E],value:E}))},null,8,["value","options"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[C[2]||(C[2]=E=>u.value.configuratorParams.color=E),C[3]||(C[3]=E=>v("color",E))],options:t.settings.color.map(E=>({label:t.settings.descriptions.color[E],value:E}))},null,8,["value","options"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[C[4]||(C[4]=E=>u.value.configuratorParams.mountType=E),C[5]||(C[5]=E=>v("mountType",E))],options:t.settings.mountType.map(E=>({label:t.settings.descriptions.mount_type[E],value:E}))},null,8,["value","options"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:n.withCtx(()=>[!t.validation.width.showFeedback&&g.value>=t.settings.minWidth&&g.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(n.openBlock(),n.createElementBlock("div",X1,[n.createVNode(n.unref(F.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Ширина готового изделия "+n.toDisplayString(g.value),1)]),_:1}),n.createVNode(n.unref(F.NButton),{quaternary:"",type:"info",size:"tiny",onClick:C[10]||(C[10]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...C[25]||(C[25]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[C[6]||(C[6]=E=>u.value.configuratorParams.width=E),C[9]||(C[9]=E=>v("width",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:C[7]||(C[7]=E=>n.unref(lt)(E)),onInput:C[8]||(C[8]=E=>n.unref(rt)(t.validation,"width")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-h.value} ${p.value?" до "+(p.value-h.value):""} мм.`},{feedback:n.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(n.openBlock(),n.createElementBlock("div",Y1,[n.createVNode(n.unref(F.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Высота готового изделия "+n.toDisplayString(b.value),1)]),_:1}),n.createVNode(n.unref(F.NButton),{quaternary:"",type:"info",size:"tiny",onClick:C[15]||(C[15]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...C[26]||(C[26]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[C[11]||(C[11]=E=>u.value.configuratorParams.height=E),C[14]||(C[14]=E=>v("height",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:C[12]||(C[12]=E=>n.unref(lt)(E)),onInput:C[13]||(C[13]=E=>n.unref(rt)(t.validation,"height")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:u.value.quantity,"onUpdate:value":[C[16]||(C[16]=E=>u.value.quantity=E),C[19]||(C[19]=E=>N("quantity",E??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[17]||(C[17]=E=>n.unref(lt)(E,!1)),onInput:C[18]||(C[18]=E=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:C[20]||(C[20]=E=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":C[21]||(C[21]=E=>{u.value.marker=E??null,N("marker",E??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),y.value?(n.openBlock(),n.createBlock($,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":C[22]||(C[22]=E=>{u.value.isAdditionalSale=E??!1,N("isAdditionalSale",E??!1)})},{default:n.withCtx(()=>[...C[27]||(C[27]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),k.value?(n.openBlock(),n.createElementBlock("div",K1,[C[28]||(C[28]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",U1,n.toDisplayString(k.value)+" ₽",1)])):n.createCommentVNode("",!0),x.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",G1," Пожалуйста, заполните все обязательные поля корректно. ")),n.createElementVNode("div",Z1,[n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:C[23]||(C[23]=E=>o("submit",t.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,type:"default",onClick:C[24]||(C[24]=E=>o("click:show-preview-drawer"))},{default:n.withCtx(()=>[...C[29]||(C[29]=[n.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):n.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",u.value)]])}}}),J1="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",eb="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",tb="/img/configurators/mosquitto/measurement-instructions/mount.png",nb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ib="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",rb={class:"flex flex-col gap-6"},ob={class:"flex gap-4"},sb={class:"flex flex-col gap-2"},lb={class:"flex gap-4"},ab={class:"flex flex-col gap-2"},cb={class:"flex gap-4"},db={class:"flex flex-col gap-2"},ub={},Bu=n.defineComponent({...ub,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const i=Ye.initRefDependingOnDeviceResolution("small","small","medium"),r=Ye.initRefDependingOnDeviceResolution(.98,.95,.8),o=n.computed(()=>window.innerWidth*r.value),s=e;return(l,a)=>{const c=F.NText;return n.openBlock(),n.createBlock(n.unref(F.NModal),{show:t.show,"show-icon":!1,size:n.unref(i),style:n.normalizeStyle(`width: ${o.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:a[0]||(a[0]=d=>s("update:show",!1)),onEsc:a[1]||(a[1]=d=>s("update:show",!1)),onMaskClick:a[2]||(a[2]=d=>s("update:show",!1))},{default:n.withCtx(()=>[n.createElementVNode("div",rb,[n.createVNode(c,{type:"error",class:"text-base font-medium"},{default:n.withCtx(()=>[...a[3]||(a[3]=[n.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),a[22]||(a[22]=n.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[n.createElementVNode("div",{class:"flex items-start gap-4"},[n.createElementVNode("img",{src:J1,alt:"measurement-height",class:"w-[7.5rem]"}),n.createElementVNode("div",{class:"flex flex-col gap-2"},[n.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),n.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),n.createElementVNode("div",{class:"flex items-start gap-4"},[n.createElementVNode("img",{src:eb,alt:"measurement-height",class:"w-[7.5rem]"}),n.createElementVNode("div",{class:"flex flex-col gap-2"},[n.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),n.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),n.createElementVNode("div",ob,[a[9]||(a[9]=n.createElementVNode("img",{src:tb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",sb,[a[8]||(a[8]=n.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),n.createElementVNode("span",null,[a[4]||(a[4]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),a[5]||(a[5]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),a[6]||(a[6]=n.createElementVNode("br",null,null,-1)),a[7]||(a[7]=n.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),n.createElementVNode("div",lb,[a[15]||(a[15]=n.createElementVNode("img",{src:nb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",ab,[a[14]||(a[14]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),n.createElementVNode("span",null,[a[10]||(a[10]=n.createTextVNode(" Расчетные размеры москитной сетки:",-1)),a[11]||(a[11]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),a[12]||(a[12]=n.createElementVNode("br",null,null,-1)),a[13]||(a[13]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),n.createElementVNode("div",cb,[a[21]||(a[21]=n.createElementVNode("img",{src:ib,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",db,[a[20]||(a[20]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),n.createElementVNode("span",null,[a[16]||(a[16]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),a[17]||(a[17]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),a[18]||(a[18]=n.createElementVNode("br",null,null,-1)),a[19]||(a[19]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),fb={class:"grid md:grid-cols-2"},hb={},Nu=n.defineComponent({...hb,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.computed(()=>Ye.isPhoneDevice()),s=n.ref(!1),l=n.ref(!1),a=n.ref(i.cartItem),c=n.useTemplateRef("mosquito-configurator-form"),d=n.ref({width:{},height:{},quantity:{},marker:{}}),u=n.ref(!1),f=n.ref(!1),h=n.computed(()=>n.inject("debounce-input-time",300)),m=A.debounce(async g=>{var b,y;a.value.product=new H.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:g,validationFieldResultData:d.value,callback:k=>{k?a.value.product=k:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(A.noop)},h.value),p=()=>{f.value=!0,r("submit",a.value,d.value,()=>{f.value=!1})};return n.watch(()=>i.cartItem,g=>{a.value=g},{deep:!0}),(g,b)=>{const y=Yo;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(Bu,{show:l.value,"onUpdate:show":b[0]||(b[0]=_=>l.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),n.createElementVNode("div",fb,[o.value?(n.openBlock(),n.createBlock(n.unref(F.NDrawer),{key:1,show:s.value,"onUpdate:show":b[4]||(b[4]=_=>s.value=_),"default-width":375,resizable:""},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NDrawerContent),null,{header:n.withCtx(()=>[n.createVNode(n.unref(F.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>s.value=!1)},{default:n.withCtx(()=>[n.createVNode(y)]),_:1})]),default:n.withCtx(()=>[n.createVNode(Nl,{"configurator-params":a.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>l.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(n.openBlock(),n.createBlock(Nl,{key:0,"configurator-params":a.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>l.value=!0)},null,8,["configurator-params","settings"])),n.createVNode(Su,{ref:"mosquito-configurator-form",value:a.value,"onUpdate:value":b[5]||(b[5]=_=>a.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":f.value,"onUpdate:params":b[6]||(b[6]=_=>n.unref(m)(_)),onSubmit:b[7]||(b[7]=_=>p()),"onClick:instructionsToggle":b[8]||(b[8]=_=>l.value=!l.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),mb={},Tu=n.defineComponent({...mb,__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},isLastLine:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.useTemplateRef("width-input-element"),l=n.ref(!1),a=n.ref(r.value),c=n.useTemplateRef("form-item-reference"),d=n.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{a.value=m,o("update:value",m,r.index,l)},f=m=>{lt(m),(m.key==="Enter"||m.code==="Enter")&&!r.isLastLine&&(m.preventDefault(),m.stopPropagation())},h=()=>{var m;(m=s.value)==null||m.select()};return n.watch(()=>r.value,m=>{a.value=m}),n.onMounted(()=>{r.autoFocus&&n.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(m,p)=>{const g=tc,b=uo;return n.openBlock(),n.createBlock(n.unref(F.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(Tr,{key:0,"is-product-searching":l.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(F.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref:"width-input-element",value:a.value??null,class:"w-full","show-button":!1,parse:n.unref(ct),placeholder:"Введите ширину",onKeydown:f,onInput:p[0]||(p[0]=y=>n.unref(rt)(t.validation,`linesWidths.${t.index}`)),onFocus:n.unref(He),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),n.createVNode(n.unref(F.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[1]||(p[1]=y=>o("click:add-line",t.index))},{default:n.withCtx(()=>[n.createVNode(g)]),_:1},8,["disabled"]),n.createVNode(n.unref(F.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[2]||(p[2]=y=>o("click:remove-line",t.index))},{default:n.withCtx(()=>[n.createVNode(b)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),pb={class:"my-2 flex w-full flex-col"},gb={key:1},yb={class:"text-lg font-semibold"},bb={class:"flex gap-3"},_b={},$u=n.defineComponent({..._b,__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:i}){var _;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.useTemplateRef("line-items-reference"),a=n.ref(A.cloneDeep(r.value)),c=n.computed(()=>{const k={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return A.forEach(a.value,(x,v)=>{var N;k[`configuratorParams.linesWidths.${v}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${v}`])==null?void 0:N.feedback)]}),k}),d=n.ref(r.settings.canSetDopProdaga??!1),u=n.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((k,x)=>(k??0)+(x??0),0)),f=n.computed(()=>r.settings.width-u.value),h=n.computed(()=>!r.value.some(({product:k})=>!k||k.isNewRec())),m=n.computed(()=>r.isSubmitProcessing||!h.value||f.value<=0||a.value.length>=r.settings.maxLinesCount||r.value.some(k=>k.product.isNewRec())),p=n.computed(()=>k=>f.value===0?void 0:[{label:`${(f.value>0?"Остаток +":"Излишек ")+f.value} мм.`,key:f.value+k}]),g=n.computed(()=>{const{length:k}=r.value[0];return!k||u.value!==r.settings.width?null:(A.reduce(r.value,(v,N)=>{var T;const w=((T=N.product)==null?void 0:T.costRub)||0;return v+w},0)*r.value[0].quantity*k).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(k,x,v)=>{var w,T,C;a.value[x].product.id=-1;const{configuratorParams:N}=a.value[x];N.linesWidths[x]=k,y("configuratorParams",N),(C=(T=(w=l.value)==null?void 0:w.at(x))==null?void 0:T.formItemReference)==null||C.validate().catch(A.noop),n.nextTick(()=>{var $,E;(E=($=l.value)==null?void 0:$.at(x))!=null&&E.isValid&&o("update:params",N,x,v)})},y=(k,x)=>{a.value.forEach(v=>{v[k]=x}),o("update:value",a.value)};return n.watch(()=>r.value,k=>{a.value=A.cloneDeep(k)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(k,x)=>{const v=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:a.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var N;return[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,(w,T)=>{var C,$,E;return n.openBlock(),n.createBlock(Tu,{key:T,ref_for:!0,ref:"line-items-reference",value:((C=w.configuratorParams)==null?void 0:C.linesWidths.at(T))??null,"auto-focus":((($=w.configuratorParams)==null?void 0:$.linesWidths.at(T))??0)===0,index:T,path:`configuratorParams.linesWidths.${T}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":p.value(((E=w.configuratorParams)==null?void 0:E.linesWidths.at(T))??0),"add-line-button-disabled":f.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(V=>V.product.isNewRec()),"remove-line-button-disabled":a.value.length===1,"is-last-line":T===a.value.length-1&&f.value===0,"onUpdate:value":b,"onClick:addLine":x[0]||(x[0]=V=>o("click:add-line",V)),"onClick:removeLine":x[1]||(x[1]=V=>o("click:remove-line",V))},null,8,["value","auto-focus","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled","is-last-line"])}),128)),n.createElementVNode("div",pb,[f.value<0?(n.openBlock(),n.createBlock(n.unref(F.NText),{key:0,type:"error"},{default:n.withCtx(()=>[n.createTextVNode(" Сумма ширин всех полос должна быть равна "+n.toDisplayString(t.settings.width),1)]),_:1})):n.createCommentVNode("",!0),h.value&&a.value.length===t.settings.maxLinesCount&&f.value>0?(n.openBlock(),n.createBlock(n.unref(F.NText),{key:1,type:"error"},{default:n.withCtx(()=>[...x[15]||(x[15]=[n.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",null,[x[16]||(x[16]=n.createTextVNode(" Остаток для резки: ",-1)),n.createVNode(n.unref(F.NText),{type:f.value>=0?"Success":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f.value),1)]),_:1},8,["type"]),n.createTextVNode(" из "+n.toDisplayString(t.settings.width)+" мм ",1)])]),n.createVNode(n.unref(F.NButton),{disabled:m.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",a.value.length))},{default:n.withCtx(()=>[...x[17]||(x[17]=[n.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),n.createVNode(n.unref(F.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>a.value[0].length=w),x[6]||(x[6]=w=>y("length",w))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>n.unref(lt)(w,!1)),onInput:x[5]||(x[5]=w=>n.unref(rt)(t.validation,"length")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>a.value[0].quantity=w),x[10]||(x[10]=w=>y("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>n.unref(lt)(w,!1)),onInput:x[9]||(x[9]=w=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:a.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{a.value[0].marker=w??null,y("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(v,{key:0,checked:a.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{a.value[0].isAdditionalSale=w??!1,y("isAdditionalSale",w??!1)})},{default:n.withCtx(()=>[...x[18]||(x[18]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock("div",gb,[x[19]||(x[19]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",yb,n.toDisplayString(g.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",bb,[n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:!h.value||f.value!=0||!((N=a.value[0])!=null&&N.length)||a.value[0].length>t.settings.maxLength||a.value[0].length<t.settings.minLength||a.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>o("submit",a.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",a.value)]])}}}),wb={class:"flex grow flex-col"},xb=["src"],kb={class:"w-full"},Cb={},Eu=n.defineComponent({...Cb,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",wb,[n.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,xb),n.createElementVNode("div",kb,[n.createTextVNode(" Число полос можно указать от "+n.toDisplayString(t.settings.minLinesCount)+" до "+n.toDisplayString(t.settings.maxLinesCount)+". ",1),i[0]||(i[0]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Минимальная ширина полосы "+n.toDisplayString(t.settings.minLineWidth)+" мм. ",1),i[1]||(i[1]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина всех полос "+n.toDisplayString(t.settings.width)+" мм. ",1),i[2]||(i[2]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Шаг ширины полосы - "+n.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),vb={class:"flex flex-col gap-2"},Sb={class:"w-104 flex grow flex-col px-5"},Bb={},Ru=n.defineComponent({...Bb,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.useTemplateRef("strip-configurator-form"),s=n.ref(i.cartItems),l=n.ref({width:{},length:{},quantity:{},marker:{}}),a=n.ref(!1),c=n.computed(()=>n.inject("debounce-input-time",300)),d=n.computed(()=>{var p;return(p=s.value[0].configuratorParams)==null?void 0:p.linesWidths.reduce((g,b)=>(g??0)+(b??0),0)}),u=p=>{p===void 0&&(p=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p+1,0,null),s.value.forEach(y=>{y.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const b=new H.OrderItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??i.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,b)},f=p=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(b=>{b.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete l[`linesWidths.${p}`],delete l[`linesWidths.${p}`])},h=A.debounce(async(p,g,b)=>{const y={linesWidths:p.linesWidths.at(g)};b.value=!0,l.value[`linesWidths.${g}`]={},s.value[g].product=new H.ClientProduct,i.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:y,validationFieldResultData:l.value,callback:_=>{_?(s.value[g].product=_,g===s.value.length-1&&s.value.length<i.settings.maxLinesCount&&d.value&&d.value<i.settings.width&&u()):(s.value[g].product=new H.ClientProduct,l.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),m=async()=>{var p,g;(g=(p=o.value)==null?void 0:p.formReference)==null||g.validate(b=>{if(!b){a.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,l.value,()=>{a.value=!1,n.nextTick(()=>{var _,k;(k=(_=o.value)==null?void 0:_.formReference)==null||k.restoreValidation()})})}}).catch(A.noop)};return n.watch(()=>i.cartItems,p=>{s.value=p.map(g=>new H.OrderItemBase(g))}),(p,g)=>{const b=F.NButton;return n.openBlock(),n.createElementBlock("div",vb,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=y=>r("click:view-switch"))},{default:n.withCtx(()=>[...g[3]||(g[3]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Sb,[n.createVNode(Eu,{value:s.value,"onUpdate:value":g[1]||(g[1]=y=>s.value=y),settings:t.settings},null,8,["value","settings"]),n.createVNode($u,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y),validation:l.value,settings:t.settings,"is-submit-processing":a.value,"onUpdate:params":n.unref(h),onSubmit:m,"onClick:addLine":u,"onClick:removeLine":f},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Nb={class:"flex flex-col gap-3"},Tb={},Pu=n.defineComponent({...Tb,__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:i}){var m;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.useTemplateRef("first-input-element"),a=n.ref(A.cloneDeep(r.value)),c=n.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),d=n.ref(r.settings.canSetDopProdaga??!1),u=()=>{o("update:params",a.value.configuratorParams),f("configuratorParams",a.value.configuratorParams)},f=(p,g)=>{const b=new H.OrderItemBase(r.value);b[p]=g,p==="configuratorParams"&&(b.product=new H.ClientProduct),o("update:value",b)},h=()=>{var p;(p=l.value)==null||p.select()};return n.watch(()=>r.value,p=>{a.value=A.cloneDeep(p)},{deep:!0}),n.onMounted(()=>{r.value.isNewRec()&&n.nextTick(()=>{h()})}),e({validate:(m=s.value)==null?void 0:m.validate,formReference:s}),(p,g)=>{const b=F.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:a.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref:"first-input-element",value:a.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=y=>a.value.configuratorParams.width=y),u],class:"w-full",parse:n.unref(ct),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=y=>n.unref(lt)(y)),onInput:g[2]||(g[2]=y=>n.unref(rt)(t.validation,"width")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:a.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=y=>a.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=y=>n.unref(lt)(y)),onInput:g[5]||(g[5]=y=>n.unref(rt)(t.validation,"length")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(F.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=y=>n.unref(lt)(y,!1)),onInput:g[7]||(g[7]=y=>n.unref(rt)(t.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=y=>f("quantity",y??0)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:g[9]||(g[9]=y=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":g[10]||(g[10]=y=>f("marker",y??null)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(b,{key:0,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=y=>{a.value.isAdditionalSale=y??!1,f("isAdditionalSale",y??!1)})},{default:n.withCtx(()=>[...g[13]||(g[13]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),n.createElementVNode("div",Nb,[n.createVNode(n.unref(F.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:g[12]||(g[12]=y=>o("submit",t.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])),[[n.unref(ti),()=>o("submit",a.value)]])}}}),$b={class:"flex flex-col gap-2 w-72"},Eb={},Fu=n.defineComponent({...Eb,__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]},showProductInfoButton:{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 i=t,r=e,o=n.useTemplateRef("metal-for-doors-configurator-form"),s=n.ref(i.cartItem),l=n.ref({width:{},length:{},quantity:{},marker:{}}),a=n.ref(!1),c=n.ref(!1),d=n.computed(()=>n.inject("debounce-input-time",300)),u=A.debounce(async h=>{var m,p;s.value.product=new H.ClientProduct,(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(g=>{g||(a.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:h,validationFieldResultData:l.value,callback:b=>{b?s.value.product=b:l.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},a.value=!1}}))}).catch(A.noop)},d.value),f=async()=>{var h,m;(m=(h=o.value)==null?void 0:h.formReference)==null||m.validate(p=>{p||(c.value=!0,r("submit",s.value,l.value,()=>{c.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})}))}).catch(A.noop)};return n.watch(()=>i.cartItem,h=>{s.value=new H.OrderItemBase(h)},{deep:!0}),(h,m)=>{const p=F.NButton;return n.openBlock(),n.createElementBlock("div",$b,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=g=>r("click:view-switch"))},{default:n.withCtx(()=>[...m[4]||(m[4]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Pu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":m[1]||(m[1]=g=>s.value=g),validation:l.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":a.value,"onUpdate:params":m[2]||(m[2]=g=>n.unref(u)(g)),onSubmit:m[3]||(m[3]=g=>f())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Rb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pb(t,e){return n.openBlock(),n.createElementBlock("svg",Rb,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Vu=n.markRaw({name:"ion-add",render:Pb}),Fb={key:0,class:"-mt-1 text-sm text-gray-500"},Vb={class:"font-bold"},Mb={class:"flex flex-col gap-3"},Ib={key:0,class:"mt-4 flex flex-col gap-1.5"},Ab={class:"flex flex-col gap-1 text-sm text-gray-700"},Ob={key:0},zb={key:1},Db={"form-array-name":"items",class:"flex flex-col gap-3"},Lb={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},Hb={key:0,class:"flex flex-wrap items-end gap-2"},Wb={class:"whitespace-nowrap text-xl font-bold"},jb={key:0,class:"whitespace-nowrap text-lg text-gray-500"},qb={class:"font-bold"},Xb={class:"font-bold"},Yb={class:"flex gap-3"},Kb={},Mu=n.defineComponent({...Kb,__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]},showProductInfoButton:{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:i}){var O;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.ref(A.cloneDeep(r.value)),a=n.ref({...r.validation}),c=z=>{var M;delete a.value[z],(M=s.value)==null||M.restoreValidation()};n.watch(()=>r.validation,z=>{a.value={...z},Object.values(z).some(R=>R==null?void 0:R.feedback)&&n.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.validate(A.noop).catch(A.noop)})},{deep:!0});const d=n.computed(()=>r.value.category),u=n.ref(null),f=n.ref(null),h=n.computed(()=>d.value.products??[]),m=n.computed(()=>h.value.map(z=>({label:z.name,value:z.id}))),p=(z,M,R)=>{const W=z!=null&&z>0,K=M!=null&&M>0;return!W&&!K?null:W&&K?`от ${z} ${R} до ${M} ${R}`:W?`от ${z} ${R}`:`до ${M} ${R}`},g=n.computed(()=>{var z,M;return p(r.settings.minWidth,(M=(z=u.value)==null?void 0:z.properties)==null?void 0:M.width,"мм")}),b=n.computed(()=>{var z,M;return p(r.settings.minLength,(M=(z=u.value)==null?void 0:z.properties)==null?void 0:M.length,"мм")}),y=n.ref(null),_=n.ref(!1),k=n.computed(()=>{var M;const z={marker:[We.serverValidation((M=a.value.marker)==null?void 0:M.feedback)]};return l.value.configuratorParams.items.forEach((R,W)=>{var K,G,X,j,q,le,de;z[`configuratorParams.items.${W}.width`]=[ae.required,ae.min(r.settings.minWidth),...(G=(K=u.value)==null?void 0:K.properties)!=null&&G.width?[ae.max(u.value.properties.width)]:[],ae.step(1),We.serverValidation((X=a.value[`items.${W}.width`])==null?void 0:X.feedback)],z[`configuratorParams.items.${W}.length`]=[ae.required,ae.min(r.settings.minLength),...(q=(j=u.value)==null?void 0:j.properties)!=null&&q.length?[ae.max(u.value.properties.length)]:[],ae.step(1),We.serverValidation((le=a.value[`items.${W}.length`])==null?void 0:le.feedback)],z[`configuratorParams.items.${W}.count`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((de=a.value[`items.${W}.count`])==null?void 0:de.feedback)]}),z}),x=n.ref(r.settings.canSetDopProdaga??!1),v=n.computed(()=>l.value.configuratorParams.items.some(z=>{var M,R;return!u.value||!z.width||z.width<r.settings.minWidth||z.width>(((M=u.value.properties)==null?void 0:M.width)??0)||z.length===0||z.length<r.settings.minLength||z.length>(((R=u.value.properties)==null?void 0:R.length)??0)||!z.count||z.count<1})),N=n.computed(()=>!u.value||v.value||l.value.configuratorParams.items.length===0),w=n.ref(null),T=z=>{if(!z){u.value=null,f.value=null,l.value.product=new H.ClientProduct,y.value=null;return}const M=h.value.find(R=>R.id===z);M&&(u.value=M,f.value=z,l.value.product=M,Z("product",l.value.product),l.value.configuratorParams.items.forEach(R=>{var W,K;(W=M.properties)!=null&&W.width&&R.width>M.properties.width&&(R.width=M.properties.width),(K=M.properties)!=null&&K.length&&R.length>M.properties.length&&(R.length=M.properties.length)}),$())};let C=!1;const $=()=>{C=!0,y.value=null,w.value=null,l.value.configuratorParams.calculationId="",l.value.quantity=0},E=async()=>{var z;if(!u.value||l.value.configuratorParams.items.length===0||v.value){$();return}(z=s.value)==null||z.validate(M=>{if(M){$();return}if(_.value=!0,!u.value||!d.value){$(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:l.value.configuratorParams.items},callback:R=>{R?(y.value=R,l.value.configuratorParams.calculationId=R.id,l.value.quantity=R.quantity,n.nextTick(()=>{Z("quantity",R.quantity)})):(l.value.configuratorParams.calculationId="",l.value.quantity=0,$()),Z("configuratorParams",l.value.configuratorParams),V(),_.value=!1}})}).catch(()=>{$(),_.value=!1})},V=()=>{var M;if(!((M=u.value)!=null&&M.costRub)||!y.value){w.value=null;return}const z=y.value.quantity*u.value.costRub;w.value=Math.round(z*100)/100},P=z=>{var R,W;const M=l.value.configuratorParams.items[z];u.value&&((R=u.value.properties)!=null&&R.width&&M.width>u.value.properties.width&&(M.width=u.value.properties.width),(W=u.value.properties)!=null&&W.length&&M.length>u.value.properties.length&&(M.length=u.value.properties.length)),Z("configuratorParams",l.value.configuratorParams),$()},I=()=>{l.value.configuratorParams.calculationId="",l.value.configuratorParams.items.push({width:0,length:0,count:1}),Z("configuratorParams",l.value.configuratorParams),$(),o("add-item",l.value.configuratorParams.items.length)},U=z=>{l.value.configuratorParams.items.splice(z,1),Z("configuratorParams",l.value.configuratorParams),$(),o("remove-item",z)},J=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!y.value){E();return}o("submit",l.value)}},Z=(z,M)=>{const R=new H.OrderItemBase(r.value);R[z]=M,o("update:value",R)};n.watch(()=>r.value,z=>{const M=A.cloneDeep(n.toRaw(z));(!M.configuratorParams.items||M.configuratorParams.items.length===0)&&(M.configuratorParams.items=[{width:0,length:0,count:1}]),l.value=M,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,f.value=null),C?C=!1:L()},{deep:!0});const L=()=>{const{calculationId:z}=l.value.configuratorParams,M=l.value.quantity??0;z&&M>0&&l.value.product&&!l.value.product.isNewRec()&&(y.value={id:z,quantity:M,sheets:[]},V())};return n.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),L()}),e({validate:(O=s.value)==null?void 0:O.validate,formReference:s}),(z,M)=>{const R=uo,W=Vu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:l.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var K;return[n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:f.value,"onUpdate:value":[M[0]||(M[0]=G=>f.value=G),T],options:m.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((K=u.value)==null?void 0:K.costRub)!=null?(n.openBlock(),n.createElementBlock("div",Fb,[n.createElementVNode("span",Vb,n.toDisplayString(u.value.code),1),n.createTextVNode(" — "+n.toDisplayString(u.value.costRub.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Mb,[u.value?(n.openBlock(),n.createElementBlock("div",Ib,[M[7]||(M[7]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",Ab,[g.value?(n.openBlock(),n.createElementBlock("div",Ob,"Ширина "+n.toDisplayString(g.value)+".",1)):n.createCommentVNode("",!0),b.value?(n.openBlock(),n.createElementBlock("div",zb,"Длина "+n.toDisplayString(b.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",Db,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.configuratorParams.items,(G,X)=>(n.openBlock(),n.createElementBlock("div",{key:X,class:"flex grow gap-2"},[n.createElementVNode("div",Lb,[n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.items.${X}.width`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:l.value.configuratorParams.items[X].width,"onUpdate:value":[j=>l.value.configuratorParams.items[X].width=j,j=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:M[1]||(M[1]=j=>n.unref(lt)(j)),onInput:j=>c(`items.${X}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.items.${X}.length`,label:"Длина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:l.value.configuratorParams.items[X].length,"onUpdate:value":[j=>l.value.configuratorParams.items[X].length=j,j=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:M[2]||(M[2]=j=>n.unref(lt)(j)),onInput:j=>c(`items.${X}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`configuratorParams.items.${X}.count`,label:"Количество, шт"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:l.value.configuratorParams.items[X].count,"onUpdate:value":[j=>l.value.configuratorParams.items[X].count=j,j=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:M[3]||(M[3]=j=>n.unref(lt)(j,!1)),onInput:j=>c(`items.${X}.count`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(F.NButton),{disabled:!u.value||l.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:j=>U(X)},{default:n.withCtx(()=>[n.createVNode(R)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:1,disabled:v.value,type:"default",class:"self-center",onClick:I},{default:n.withCtx(()=>[n.createVNode(W),M[8]||(M[8]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0)]),n.createVNode(n.unref(F.NFormItem),{path:"marker",label:"Маркировка распила"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:l.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:M[4]||(M[4]=G=>c("marker")),"onUpdate:value":M[5]||(M[5]=G=>Z("marker",G??null)),onFocus:n.unref(He)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(n.openBlock(),n.createBlock(n.unref(F.NCheckbox),{key:1,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":M[6]||(M[6]=G=>{l.value.isAdditionalSale=G??!1,Z("isAdditionalSale",G??!1)})},{default:n.withCtx(()=>[...M[9]||(M[9]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(n.unref(F.NSpin),{show:_.value,size:"small",class:"grow"},{default:n.withCtx(()=>{var G;return[y.value&&u.value&&w.value?(n.openBlock(),n.createElementBlock("div",Hb,[n.createElementVNode("div",null,[M[10]||(M[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",Wb,n.toDisplayString(w.value.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(n.openBlock(),n.createElementBlock("div",jb,[n.createElementVNode("span",qb,"("+n.toDisplayString(y.value.quantity)+" шт.",1),M[11]||(M[11]=n.createTextVNode(" x ",-1)),n.createElementVNode("span",Xb,n.toDisplayString((G=u.value.costRub)==null?void 0:G.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]}),_:1},8,["show"]),n.createElementVNode("div",Yb,[y.value&&!_.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,loading:t.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:J},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:E},{default:n.withCtx(()=>[...M[12]||(M[12]=[n.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[n.unref(ti),J]])}}}),Ub={class:"flex flex-col gap-2"},Gb={class:"w-104 flex grow flex-col px-5"},Zb={},Iu=n.defineComponent({...Zb,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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 i=t,r=e,o=n.useTemplateRef("sandwich-configurator-form"),s=n.ref(i.cartItem),l=n.ref({width:{},length:{},quantity:{},marker:{},product:{}}),a=n.ref(!1),c=async()=>{var f,h;(h=(f=o.value)==null?void 0:f.formReference)==null||h.validate(m=>{if(!m){a.value=!0;const p=A.cloneDeep(s.value);"items"in p.configuratorParams&&delete p.configuratorParams.items,r("submit",p,l.value,()=>{a.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})})}}).catch(A.noop)},d=f=>{l.value[`items.${f}.width`]={},l.value[`items.${f}.length`]={},l.value[`items.${f}.count`]={}},u=f=>{delete l.value[`items.${f}.width`],delete l.value[`items.${f}.length`],delete l.value[`items.${f}.count`]};return n.onMounted(()=>{i.cartItem.configuratorParams.items.forEach((f,h)=>{l.value[`items.${h}.width`]={},l.value[`items.${h}.length`]={},l.value[`items.${h}.count`]={}})}),n.watch(()=>i.cartItem,f=>{s.value=new H.OrderItemBase(f)},{deep:!0}),(f,h)=>{const m=F.NButton;return n.openBlock(),n.createElementBlock("div",Ub,[t.settings.allowShowTable&&s.value.isNewRec()?(n.openBlock(),n.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:h[0]||(h[0]=p=>r("click:view-switch"))},{default:n.withCtx(()=>[...h[2]||(h[2]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Gb,[n.createVNode(Mu,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":h[1]||(h[1]=p=>s.value=p),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":a.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),Qb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jb(t,e){return n.openBlock(),n.createElementBlock("svg",Qb,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const e_=n.markRaw({name:"ion-checkmark",render:Jb}),t_={key:0,class:"-mt-1 text-sm text-gray-500"},n_={class:"font-bold"},i_={class:"flex flex-col gap-3"},r_={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},o_={class:"flex flex-col gap-1 text-sm text-gray-700"},s_={key:0},l_={key:1},a_={"form-array-name":"items",class:"flex flex-col gap-3"},c_={class:"min-w-0 flex-1"},d_={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},u_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},f_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},h_={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},m_={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},p_={key:0,class:"lg:!flex-[2]"},g_={class:"font-bold"},y_={key:1,class:"lg:!flex-[3]"},b_={class:"font-bold"},__={key:1,class:"min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2"},w_={key:0},x_={class:"font-bold"},k_={key:1},C_={class:"font-bold"},v_={class:"flex flex-wrap items-center gap-3"},S_={},Au=n.defineComponent({...S_,__name:"sandwich-m2-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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},itemStates:{default:()=>[]}},emits:["submit","update:value","add-item","remove-item","item-reset"],setup(t,{expose:e,emit:i}){var G;const r=t,o=i,s=n.useTemplateRef("form-reference"),l=n.useTemplateRef("widthInputs"),a=r.value==null?[]:A.cloneDeep(n.toRaw(r.value)),c=n.ref(a.map(X=>new H.OrderItemBase(X))),d=n.computed(()=>({items:c.value})),u=n.ref({...r.validation}),f=X=>{var j;delete u.value[X],(j=s.value)==null||j.restoreValidation()},h=n.ref(null),m=n.ref(null),p=n.computed(()=>{var X,j;return((j=(X=c.value[0])==null?void 0:X.category)==null?void 0:j.products)??[]}),g=n.computed(()=>p.value.map(X=>({label:X.name,value:X.id}))),b=(X,j,q)=>{const le=X!=null&&X>0,de=j!=null&&j>0;return!le&&!de?null:le&&de?`от ${X} ${q} до ${j} ${q}`:le?`от ${X} ${q}`:`до ${j} ${q}`},y=n.computed(()=>{var X,j;return b(r.settings.minWidth,(j=(X=h.value)==null?void 0:X.properties)==null?void 0:j.width,"мм")}),_=n.computed(()=>{var X,j;return b(r.settings.minLength,(j=(X=h.value)==null?void 0:X.properties)==null?void 0:j.length,"мм")}),k=n.computed(()=>{const X={};return c.value.forEach((j,q)=>{var le,de,ve,st,_e,we,xt,Ee;X[`items.${q}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(de=(le=h.value)==null?void 0:le.properties)!=null&&de.width?[ae.max(h.value.properties.width)]:[],ae.step(1),We.serverValidation((ve=u.value[`items.${q}.width`])==null?void 0:ve.feedback)],X[`items.${q}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(_e=(st=h.value)==null?void 0:st.properties)!=null&&_e.length?[ae.max(h.value.properties.length)]:[],ae.step(1),We.serverValidation((we=u.value[`items.${q}.length`])==null?void 0:we.feedback)],X[`items.${q}.quantity`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((xt=u.value[`items.${q}.quantity`])==null?void 0:xt.feedback)],X[`items.${q}.marker`]=[We.serverValidation((Ee=u.value[`items.${q}.marker`])==null?void 0:Ee.feedback)]}),X});n.watch(()=>r.validation,X=>{u.value={...X},Object.values(X).some(q=>q==null?void 0:q.feedback)&&n.nextTick(()=>{var q;return(q=s.value)==null?void 0:q.validate(A.noop).catch(A.noop)})},{deep:!0});const x=n.ref(r.settings.canSetDopProdaga??!1),v=n.computed(()=>{const X=h.value;return X?c.value.some(j=>{var ve,st;const q=j.configuratorParams,le=(ve=X.properties)==null?void 0:ve.width,de=(st=X.properties)==null?void 0:st.length;return q.width===0||q.width<r.settings.minWidth||le!=null&&q.width>le||q.length===0||q.length<r.settings.minLength||de!=null&&q.length>de||j.quantity===0||j.quantity<1}):!0}),N=n.computed(()=>!h.value||v.value||c.value.length===0),w=n.computed(()=>{const X=c.value[0];return X!=null&&!X.isNewRec()}),T=X=>r.itemStates[X]??"idle",C=X=>T(X)==="success",$=X=>T(X)==="loading",E=n.computed(()=>c.value.length===0?!0:c.value.every((X,j)=>{const q=T(j);return q==="success"||q==="loading"})),V=X=>X.width===0||X.length===0?0:X.width*X.length/1e6,P=X=>V(X).toLocaleString(void 0,{maximumFractionDigits:4}),I=X=>{var ve;const j=X.configuratorParams,q=V(j),le=((ve=h.value)==null?void 0:ve.costRub)??0,de=X.quantity??0;return!q||!de?0:Math.round(q*le*de*100)/100},U=n.computed(()=>A.sum(c.value.map(X=>{const j=X.configuratorParams;return!j.width||j.length===0||!X.quantity?0:j.width*j.length*X.quantity/1e6}))),J=n.computed(()=>Math.round(A.sum(c.value.map(X=>I(X)))*100)/100),Z=()=>{var X,j,q;return new H.OrderItemBase({category:(X=c.value[0])==null?void 0:X.category,configurator:(j=c.value[0])==null?void 0:j.configurator,product:h.value??new H.ClientProduct,quantity:1,isAdditionalSale:(q=c.value[0])==null?void 0:q.isAdditionalSale,configuratorParams:{width:0,length:0}})},L=X=>{if(!X){h.value=null,m.value=null,c.value.forEach(q=>{q.product=new H.ClientProduct}),o("update:value",c.value);return}const j=p.value.find(q=>q.id===X);j&&(h.value=j,m.value=X,c.value.forEach((q,le)=>{var de,ve;q.product=j,(de=j.properties)!=null&&de.width&&q.configuratorParams.width>j.properties.width&&(q.configuratorParams.width=j.properties.width),(ve=j.properties)!=null&&ve.length&&q.configuratorParams.length>j.properties.length&&(q.configuratorParams.length=j.properties.length),o("item-reset",le)}),o("update:value",c.value))},O=X=>{var le,de;const j=c.value[X],q=h.value;q&&((le=q.properties)!=null&&le.width&&j.configuratorParams.width>q.properties.width&&(j.configuratorParams.width=q.properties.width),(de=q.properties)!=null&&de.length&&j.configuratorParams.length>q.properties.length&&(j.configuratorParams.length=q.properties.length)),o("item-reset",X),o("update:value",c.value)},z=(X,j)=>{c.value[X].marker=j===null||j===""?void 0:j,o("item-reset",X),o("update:value",c.value)},M=X=>{c.value.forEach(j=>{j.isAdditionalSale=X}),o("update:value",c.value)},R=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),n.nextTick(()=>{var j,q,le,de;const X=c.value.length-1;(q=(j=l.value)==null?void 0:j[X])==null||q.focus(),(de=(le=l.value)==null?void 0:le[X])==null||de.select()})},W=X=>{c.value.splice(X,1),o("update:value",c.value),o("remove-item",X)};n.watch(()=>r.value,X=>{var de;const q=(X==null?[]:A.cloneDeep(n.toRaw(X))).map(ve=>new H.OrderItemBase(ve));c.value=q.length>0?q:[Z()];const le=(de=c.value[0])==null?void 0:de.product;le&&!le.isNewRec()?(h.value=le,m.value=le.id):(h.value=null,m.value=null)},{deep:!0});const K=()=>{var j;if(h.value!==null)return;const X=(j=p.value[0])==null?void 0:j.id;X!=null&&L(X)};return n.watch(p,()=>{K()}),n.onMounted(()=>{var j;c.value.length===0&&(c.value=[Z()]);const X=(j=c.value[0])==null?void 0:j.product;X&&!X.isNewRec()&&(h.value=X,m.value=X.id),K()}),e({validate:(G=s.value)==null?void 0:G.validate,formReference:s}),(X,j)=>{const q=e_,le=uo,de=Vu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{ref:"form-reference",model:d.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var ve,st;return[n.createVNode(n.unref(F.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NSelect),{value:m.value,"onUpdate:value":[j[0]||(j[0]=_e=>m.value=_e),L],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=h.value)==null?void 0:ve.costRub)!=null?(n.openBlock(),n.createElementBlock("div",t_,[n.createElementVNode("span",n_,n.toDisplayString(h.value.code),1),n.createTextVNode(" — "+n.toDisplayString(h.value.costRub.toLocaleString())+" "+n.toDisplayString(h.value.currency.symbol)+"/м² ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",i_,[h.value?(n.openBlock(),n.createElementBlock("div",r_,[j[6]||(j[6]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",o_,[y.value?(n.openBlock(),n.createElementBlock("div",s_,"Ширина "+n.toDisplayString(y.value)+".",1)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock("div",l_,"Длина "+n.toDisplayString(_.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",a_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value.items,(_e,we)=>{var xt;return n.openBlock(),n.createElementBlock("div",{key:we,class:n.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",C(we)?"opacity-70":""])},[n.createElementVNode("div",c_,[n.createElementVNode("div",d_,[n.createElementVNode("div",u_,[n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[we].configuratorParams.width,"onUpdate:value":[Ee=>d.value.items[we].configuratorParams.width=Ee,Ee=>O(we)],parse:n.unref(ct),"show-button":!1,disabled:!h.value||C(we)||$(we),placeholder:"Ширина",class:"w-full",onKeydown:j[1]||(j[1]=Ee=>n.unref(lt)(Ee)),onInput:Ee=>f(`items.${we}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:d.value.items[we].configuratorParams.length,"onUpdate:value":[Ee=>d.value.items[we].configuratorParams.length=Ee,Ee=>O(we)],parse:n.unref(ct),"show-button":!1,disabled:!h.value||C(we)||$(we),placeholder:"Длина",class:"w-full",onKeydown:j[2]||(j[2]=Ee=>n.unref(lt)(Ee)),onInput:Ee=>f(`items.${we}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createElementVNode("div",f_,[n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:d.value.items[we].quantity,"onUpdate:value":[Ee=>d.value.items[we].quantity=Ee,Ee=>O(we)],parse:n.unref(ct),"show-button":!1,disabled:!h.value||C(we)||$(we),placeholder:"Кол-во",class:"w-full",onKeydown:j[3]||(j[3]=Ee=>n.unref(lt)(Ee,!1)),onInput:Ee=>f(`items.${we}.quantity`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(F.NFormItem),{path:`items.${we}.marker`,label:"Маркировка",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:d.value.items[we].marker??null,disabled:!h.value||C(we)||$(we),placeholder:"Маркировка",class:"w-full",onInput:Ee=>f(`items.${we}.marker`),"onUpdate:value":Ee=>z(we,Ee??null),onFocus:n.unref(He)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),$(we)||C(we)?(n.openBlock(),n.createElementBlock("div",h_,[$(we)?(n.openBlock(),n.createBlock(n.unref(F.NSpin),{key:0,size:14})):C(we)?(n.openBlock(),n.createBlock(q,{key:1,class:"text-green-600 text-xl"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),n.createElementVNode("div",m_,[_e.configuratorParams.width>0&&_e.configuratorParams.length>0?(n.openBlock(),n.createElementBlock("div",p_,[j[7]||(j[7]=n.createTextVNode(" Площадь (S) = ",-1)),n.createElementVNode("span",g_,n.toDisplayString(P(_e.configuratorParams))+" м²",1)])):n.createCommentVNode("",!0),I(_e)>0?(n.openBlock(),n.createElementBlock("div",y_,[j[8]||(j[8]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",b_,n.toDisplayString(I(_e).toLocaleString())+" "+n.toDisplayString((xt=h.value)==null?void 0:xt.currency.symbol),1)])):n.createCommentVNode("",!0)])]),w.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,disabled:$(we)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:Ee=>W(we)},{default:n.withCtx(()=>[n.createVNode(le)]),_:1},8,["disabled","onClick"]))],2)}),128))]),h.value?(n.openBlock(),n.createElementBlock("div",__,[U.value>0?(n.openBlock(),n.createElementBlock("div",w_,[j[9]||(j[9]=n.createTextVNode(" Общая площадь: ",-1)),n.createElementVNode("span",x_,n.toDisplayString(U.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):n.createCommentVNode("",!0),J.value>0?(n.openBlock(),n.createElementBlock("div",k_,[j[10]||(j[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",C_,n.toDisplayString(J.value.toLocaleString())+" "+n.toDisplayString(h.value.currency.symbol),1)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),x.value?(n.openBlock(),n.createBlock(n.unref(F.NCheckbox),{key:1,checked:((st=c.value[0])==null?void 0:st.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":j[4]||(j[4]=_e=>M(_e??!1))},{default:n.withCtx(()=>[...j[11]||(j[11]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createElementVNode("div",v_,[h.value&&!w.value?(n.openBlock(),n.createBlock(n.unref(F.NButton),{key:0,disabled:v.value,type:"default",onClick:R},{default:n.withCtx(()=>[n.createVNode(de),j[12]||(j[12]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),n.createVNode(n.unref(F.NButton),{loading:t.isSubmitProcessing,disabled:N.value||E.value,type:"primary",class:"ml-auto",onClick:j[5]||(j[5]=_e=>o("submit",c.value))},{default:n.withCtx(()=>{var _e;return[n.createTextVNode(n.toDisplayString((_e=c.value[0])!=null&&_e.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",c.value)]])}}}),B_={class:"flex flex-col gap-2"},N_={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},T_={},Ou=n.defineComponent({...T_,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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:["click:view-switch","submit"],setup(t,{emit:e}){const i=t,r=e,o=n.useTemplateRef("sandwich-m2-configurator-form"),s=n.ref((i.cartItems??[]).map(k=>new H.OrderItemBase(k))),l=n.ref([]),a=n.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=k=>{c.forEach(x=>{a.value[`items.${k}.${x}`]={}})},u=k=>{c.forEach(x=>{delete a.value[`items.${k}.${x}`]})},f=n.computed(()=>l.value.includes("loading")),h=()=>({width:{},length:{},quantity:{},marker:{}}),m=(k,x)=>{let v=!1;return c.forEach(N=>{var V,P;const w=`items.0.${N}`,T=(V=k[N])==null?void 0:V.feedback,$=((P=k[w])==null?void 0:P.feedback)??T,E=`items.${x}.${N}`;$?(a.value[E]=k[w]??k[N],v=!0):a.value[E]={}}),v},p=(k,x,v)=>new Promise(N=>{const w=h();let T=!1;const C=$=>{if(T)return;T=!0;const E=m(w,x),V=($===void 0?!E:$)&&!E;l.value[x]=V?"success":"error",n.nextTick(()=>{var P,I;(I=(P=o.value)==null?void 0:P.formReference)==null||I.restoreValidation()}),N(V)};l.value[x]="loading",r("submit",[A.cloneDeep(k)],w,C,{isFinalSuccessfulCompletion:v})}),g=async()=>{var v,N;try{await((N=(v=o.value)==null?void 0:v.formReference)==null?void 0:N.validate())}catch{return}const k=s.value.map((w,T)=>T).filter(w=>{const T=l.value[w]??"idle";return T!=="success"&&T!=="loading"});let x=!0;for(let w=0;w<k.length;w+=1){const T=k[w],C=s.value[T];if(!C)break;const E=w===k.length-1&&x;await p(C,T,E)||(x=!1)}},b=k=>{const x=k-1;l.value[x]="idle",d(x)},y=k=>{l.value.splice(k,1),u(k);for(let x=k;x<s.value.length;x+=1)d(x)},_=k=>{const x=l.value[k];(x==="success"||x==="error")&&(l.value[k]="idle")};return n.onMounted(()=>{(i.cartItems??[]).forEach((k,x)=>{l.value[x]="idle",d(x)})}),n.watch(()=>i.cartItems,k=>{const x=(k??[]).map(v=>new H.OrderItemBase(v));s.value=x,l.value=x.map(()=>"idle"),x.forEach((v,N)=>{d(N)})},{deep:!0}),(k,x)=>{var N;const v=F.NButton;return n.openBlock(),n.createElementBlock("div",B_,[t.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(n.openBlock(),n.createBlock(v,{key:0,type:"tertiary",class:"self-center",onClick:x[0]||(x[0]=w=>r("click:view-switch"))},{default:n.withCtx(()=>[...x[2]||(x[2]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",N_,[n.createVNode(Au,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":x[1]||(x[1]=w=>s.value=w),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":f.value,"item-states":l.value,onSubmit:g,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),$_={key:0,class:"flex justify-center p-4"},E_={key:1,class:"p-4 text-center text-red-500"},R_={key:2,class:"flex justify-center"},P_={class:"!bg-white p-4 m-2 rounded-md w-max"},F_={key:3,class:"p-4 text-center text-gray-500"},V_={},zu=n.defineComponent({...V_,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(t){const e=t,i=n.ref(!1),r=n.ref(null),o=n.ref(e.cartItem??null),s=n.ref(e.cartItems??null),l=h=>{const m=h.configuratorParams;return[new H.OrderItemBase({...h,quantity:h.quantity??1,marker:h.marker,configuratorParams:{width:(m==null?void 0:m.width)??h.width??0,length:(m==null?void 0:m.length)??h.length??0}})]},a=n.ref(e.editor===H.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?l(e.cartItem):null),c=()=>{var m,p,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const h={category:((m=e.cartItem)==null?void 0:m.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const b=e.settings;o.value=new H.OrderItemBase({...h,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:A.some(b.startTailConfigs,y=>y.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(y=>y.isDefault):void 0,endTailType:A.some(b.endTailConfigs,y=>y.isDefault)?(g=b.endTailConfigs)==null?void 0:g.findIndex(y=>y.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=e.settings;o.value=new H.OrderItemBase({...h,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{const b=e.settings;s.value=[new H.OrderItemBase({...h,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new H.OrderItemBase({...h,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new H.OrderItemBase({...h,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{a.value=[new H.OrderItemBase({...h,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(h,m,p)=>{const g=b=>{p==null||p(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:h,callback:g,validation:m})},u=(h,m,p,g)=>{const b=h[0];if(!b){p==null||p();return}const y=(g==null?void 0:g.isFinalSuccessfulCompletion)===!0,_=k=>{p==null||p(k),y&&k&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:b,callback:_,validation:m,additionalParams:g})},f=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return n.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(h,m)=>{const p=F.NSpin;return n.openBlock(),n.createElementBlock(n.Fragment,null,[i.value?(n.openBlock(),n.createElementBlock("div",$_,[n.createVNode(p,{size:"large"})])):r.value?(n.openBlock(),n.createElementBlock("div",E_,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0),t.settings!==null&&(o.value!==null||s.value!==null||a.value!==null)?(n.openBlock(),n.createElementBlock("div",R_,[n.createElementVNode("div",P_,[t.editor==="kozyrek"?(n.openBlock(),n.createBlock(vu,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(n.openBlock(),n.createBlock(Nu,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(n.openBlock(),n.createBlock(Ru,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":s.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(n.openBlock(),n.createBlock(Fu,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(n.openBlock(),n.createBlock(Iu,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(n.openBlock(),n.createBlock(Ou,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":a.value,"onClick:viewSwitch":f,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):n.createCommentVNode("",!0)])])):(n.openBlock(),n.createElementBlock("div",F_,' Конфигуратор "'+n.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function Du(t){return Object.values(H.ConfiguratorsEnum).includes(t)}function Lu(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==H.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&A.isArray(t.products)&&t.products.length>0}const M_={key:0,class:"pt-0.5"},I_={key:0},A_={class:"line-through"},O_={key:0},z_={key:1},D_={class:"flex flex-row gap-1"},L_={key:0},H_={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},W_={class:"flex flex-col gap-2.5 sm:flex-row"},j_={key:0,class:"header-extra"},q_={class:"mt-2"},X_={key:1,class:"flex flex-col"},Y_={},K_=n.defineComponent({...Y_,__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},showProductInfoButton:{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,i=n.inject(Sr,"medium"),r=n.computed(()=>{var K;return(K=e==null?void 0:e.filteredItems)==null?void 0:K[e.categoryItem.id]}),o=n.computed(()=>{var K,G;return A.isArray((K=e.categoryItem)==null?void 0:K.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),s=n.computed(()=>{var K;return A.isArray((K=e.categoryItem)==null?void 0:K.products)?e.categoryItem.products:[]}),l=n.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([K,G])=>`${G} руб./${E(K)}`).join(", ")),a=n.computed(()=>A.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(K=>{var X;const G=(X=r.value)==null?void 0:X.products;return A.isArray(G)&&G.includes(K.id)})),c=n.computed(()=>a.value.length>0),d=n.computed(()=>A.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=n.computed(()=>A.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),f=n.computed(()=>A.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),h=n.computed(()=>A.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=n.computed(()=>{var K,G,X;return((K=e.categoryItem.properties)==null?void 0:K.configurator)!==void 0&&Du((G=e.categoryItem.properties)==null?void 0:G.configurator)&&Lu(e.categoryItem)&&((X=e.categoryItem.properties)==null?void 0:X.configuratorSettings)!==void 0&&(A.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),p=n.computed(()=>m.value&&(A.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),g=n.computed(()=>A.isNil(e.categoryContextButtonsConfig)?[]:A.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=n.computed(()=>new H.ClientCategory(e.categoryItem)),y=n.ref(!1),_=n.ref(!1),k=n.computed(()=>!A.isUndefined(e.isCategoryItemSelected)),x=n.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),v=n.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),N=n.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=n.computed(()=>M.value&&Ye.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),T=n.useTemplateRef("collapse-item-reference"),C=n.computed(()=>{var K,G;return(G=(K=e.categoryItem.properties)==null?void 0:K.templateCost)==null?void 0:G.priceCoefficient}),$=n.computed(()=>{var K,G;return(G=(K=e.categoryItem.properties)==null?void 0:K.templateCost)==null?void 0:G.increasePercent}),E=(K,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:K,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),V=K=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:K,target:T.value})},P=(K,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:y,target:T.value})},I=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:T.value})},U=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:T.value})},J=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:T.value})},Z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:T.value})},L=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:T.value})},O=K=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:K,target:T.value})},z=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},M=n.ref(0),R=n.computed(()=>M.value&&s.value.length>0?Dg(s.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,showProductInfoButton:e.showProductInfoButton,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),W=A.debounce(()=>{M.value=window.innerWidth},20);return n.onUnmounted(()=>{window.removeEventListener("resize",W)}),window.addEventListener("resize",W),W(),(K,G)=>{const X=F.NCheckbox,j=ep,q=F.NTooltip,le=Zm,de=F.NTag,ve=Km,st=qm,_e=F.NButton,we=Hm,xt=Xa,Ee=qa,Zt=ja,yn=Bs,Rt=F.NDropdown,Jn=F.NDataTable,bn=F.NAlert,ln=F.NSpin;return n.openBlock(),n.createBlock(Ya,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":n.withCtx(()=>{var Me,te;return[k.value?(n.openBlock(),n.createElementBlock("div",M_,[n.createVNode(X,{checked:x.value,indeterminate:N.value,disabled:v.value,"onUpdate:checked":V},null,8,["checked","indeterminate","disabled"])])):n.createCommentVNode("",!0),!d.value&&((Me=b.value)!=null&&Me.isDisabled)?(n.openBlock(),n.createBlock(q,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(j,{class:"pt-1.5"})]),default:n.withCtx(()=>[G[1]||(G[1]=n.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):n.createCommentVNode("",!0),((te=b.value)==null?void 0:te.isFavorite)??!1?(n.openBlock(),n.createBlock(q,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(le,{class:"pt-1.5"})]),default:n.withCtx(()=>[G[2]||(G[2]=n.createTextVNode(" Избранная категория ",-1))]),_:1})):n.createCommentVNode("",!0)]}),header:n.withCtx(()=>{var Me,te,ce,Ie,mi;return[n.createElementVNode("div",{class:n.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Me=b.value)==null?void 0:Me.isDisabled})},[n.createVNode(q,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createElementVNode("span",null,n.toDisplayString(t.categoryItem.name),1)]),default:n.withCtx(()=>[G[3]||(G[3]=n.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),n.createElementVNode("div",{class:"w-fit",onClick:G[0]||(G[0]=n.withModifiers((...at)=>n.unref(A.noop)&&n.unref(A.noop)(...at),["prevent","stop"]))},[(te=t.categoryItem.properties)!=null&&te.m2Price?(n.openBlock(),n.createBlock(de,{key:0,size:n.unref(i),class:n.normalizeClass({"!pr-0":((ce=t.categoryItem.properties)==null?void 0:ce.templateCost)&&t.categoryItem.properties.m2PriceRetail&&$.value}),round:""},{default:n.withCtx(()=>{var at;return[n.createTextVNode(" Установленная стоимость: "+n.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(at=t.categoryItem.properties)!=null&&at.templateCost&&t.categoryItem.properties.m2PriceRetail&&$.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[$.value?(n.openBlock(),n.createBlock(de,{key:0,type:"success",bordered:!1,size:n.unref(i),class:"ml-2 !pr-0",round:""},{default:n.withCtx(()=>[$.value?(n.openBlock(),n.createElementBlock("span",I_,n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0),n.createVNode(de,{size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createElementVNode("span",A_,n.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Ie=t.categoryItem.properties)!=null&&Ie.templateCost?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[C.value||$.value?(n.openBlock(),n.createBlock(de,{key:0,size:n.unref(i),round:""},{default:n.withCtx(()=>{var at;return[C.value?(n.openBlock(),n.createElementBlock("span",O_,n.toDisplayString((at=C.value)==null?void 0:at.name),1)):n.createCommentVNode("",!0),$.value?(n.openBlock(),n.createElementBlock("span",z_,n.toDisplayString($.value>0?"+":"")+n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0)]}),_:1},8,["size"])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),l.value?(n.openBlock(),n.createBlock(de,{key:2,size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createTextVNode(" Фиксированный курс: "+n.toDisplayString(l.value),1)]),_:1},8,["size"])):n.createCommentVNode("",!0),u.value&&((mi=b.value)!=null&&mi.manager)?(n.openBlock(),n.createBlock(de,{key:3,size:n.unref(i),closable:!0,round:"",class:"align-bottom",onClose:Z},{default:n.withCtx(()=>[n.createVNode(q,{placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>{var at,Qt;return[n.createElementVNode("span",D_,[n.createVNode(ve),n.createTextVNode(" "+n.toDisplayString((Qt=(at=b.value)==null?void 0:at.manager)==null?void 0:Qt.name),1)])]}),default:n.withCtx(()=>{var at,Qt;return[n.createTextVNode(' Категория закреплена за "'+n.toDisplayString((Qt=(at=b.value)==null?void 0:at.manager)==null?void 0:Qt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):n.createCommentVNode("",!0)])]}),"sub-header":n.withCtx(()=>[t.showSlugs||t.showProperties?(n.openBlock(),n.createElementBlock("div",L_,[n.createElementVNode("ul",H_,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Me,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Me),1))),128)):n.createCommentVNode("",!0),t.showProperties?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(t.categoryItem.properties,(Me,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Me),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),"header-extra":n.withCtx(()=>{var Me;return[n.createElementVNode("div",W_,[K.$slots["header-extra"]?(n.openBlock(),n.createElementBlock("div",j_,[n.renderSlot(K.$slots,"header-extra",{categoryItem:t.categoryItem},void 0,!0)])):n.createCommentVNode("",!0),d.value?(n.openBlock(),n.createBlock(q,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),onClick:I},{default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isDisabled?(n.openBlock(),n.createBlock(j,{key:1})):(n.openBlock(),n.createBlock(st,{key:0}))]}),_:1},8,["size"])]),default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isDisabled?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode(" Скрыто для клиента"+n.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode("Видимо клиенту")],64))]}),_:1})):n.createCommentVNode("",!0),u.value&&!((Me=b.value)!=null&&Me.manager)?(n.openBlock(),n.createBlock(q,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),onClick:J},{default:n.withCtx(()=>[n.createVNode(we)]),_:1},8,["size"])]),default:n.withCtx(()=>{var te,ce,Ie;return[(te=b.value)!=null&&te.manager?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode('Категория закреплена за "'+n.toDisplayString(((Ie=(ce=b.value)==null?void 0:ce.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Закрепить")],64))]}),_:1})):n.createCommentVNode("",!0),f.value?(n.openBlock(),n.createBlock(q,{key:3,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,disabled:f.value==="disabled",size:n.unref(i),onClick:U},{default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isRequired?(n.openBlock(),n.createBlock(Ee,{key:1})):(n.openBlock(),n.createBlock(xt,{key:0}))]}),_:1},8,["disabled","size"])]),default:n.withCtx(()=>[G[4]||(G[4]=n.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):n.createCommentVNode("",!0),h.value?(n.openBlock(),n.createBlock(q,{key:4,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),type:"primary",onClick:L},{default:n.withCtx(()=>[n.createVNode(Zt)]),_:1},8,["size"])]),default:n.withCtx(()=>[G[5]||(G[5]=n.createTextVNode(" Редактировать ",-1))]),_:1})):n.createCommentVNode("",!0),g.value.length>0?(n.openBlock(),n.createBlock(Rt,{key:5,options:g.value,size:n.unref(i),trigger:"click",onSelect:O},{default:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(yn)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)])]}),default:n.withCtx(()=>[n.renderSlot(K.$slots,"default",{},()=>{var Me,te,ce;return[n.createElementVNode("div",q_,[o.value?(n.openBlock(),n.createBlock(Wu,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Me=r.value)==null?void 0:Me.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-product-info-button":t.showProductInfoButton,"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},n.createSlots({_:2},[K.$slots["header-extra"]?{name:"header-extra",fn:n.withCtx(({categoryItem:Ie})=>[n.renderSlot(K.$slots,"header-extra",{categoryItem:Ie},void 0,!0)]),key:"0"}:void 0]),1032,["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-product-info-button","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"])):n.createCommentVNode("",!0)]),m.value&&p.value?(n.openBlock(),n.createBlock(zu,{key:0,"event-emitter":t.eventEmitter,settings:(te=t.categoryItem.properties)==null?void 0:te.configuratorSettings,editor:(ce=t.categoryItem.properties)==null?void 0:ce.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(n.openBlock(),n.createElementBlock("div",X_,[m.value?(n.openBlock(),n.createBlock(_e,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:z},{default:n.withCtx(()=>[...G[6]||(G[6]=[n.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Jn,{columns:R.value,data:a.value,bordered:!0,loading:y.value,remote:!0,"row-key":Ie=>Ie.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):n.createCommentVNode("",!0),!y.value&&!_.value&&!o.value&&!c.value?(n.openBlock(),n.createBlock(bn,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createBlock(bn,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):n.createCommentVNode("",!0),y.value?(n.openBlock(),n.createBlock(ln,{key:4,size:n.unref(i),class:"w-full"},{description:n.withCtx(()=>[...G[7]||(G[7]=[n.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):n.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),U_=cn(K_,[["__scopeId","data-v-fac0d674"]]),G_={class:"sc-collapse flex w-full flex-col"},Z_={},Hu=n.defineComponent({...Z_,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const i=t,r=e,o=(s,l)=>{r("on-item-header-click",s,l)};return n.provide("itemHeaderClickHandler",o),n.provide("defaultExpandedNames",i.defaultExpandedNames),n.provide("expandedNames",i.expandedNames),(s,l)=>(n.openBlock(),n.createElementBlock("div",G_,[n.renderSlot(s.$slots,"default")]))}}),Q_={},Wu=n.defineComponent({...Q_,__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},showProductInfoButton:{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,i=n.inject(Sr,"medium"),r=n.computed(()=>A.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var l;return!!((l=e.filteredItems)!=null&&l[s.id])})),o=(s,l)=>{if(A.isUndefined(l))return;const a=l[s.id];if(a==="*")return;const c={};return c[s.id]=structuredClone(n.toRaw(a)),c};return(s,l)=>{const a=F.NSpin,c=F.NAlert;return n.openBlock(),n.createElementBlock(n.Fragment,null,[r.value.length>0?(n.openBlock(),n.createBlock(Hu,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,d=>(n.openBlock(),n.createBlock(U_,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":o(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-product-info-button":t.showProductInfoButton,"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},n.createSlots({_:2},[s.$slots["header-extra"]?{name:"header-extra",fn:n.withCtx(({categoryItem:u})=>[n.renderSlot(s.$slots,"header-extra",{categoryItem:u})]),key:"0"}:void 0]),1032,["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-product-info-button","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))]),_:3})):t.loading?(n.openBlock(),n.createBlock(a,{key:1,size:n.unref(i),class:"w-full"},{description:n.withCtx(()=>[...l[0]||(l[0]=[n.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):n.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(n.openBlock(),n.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):n.createCommentVNode("",!0)],64)}}}),J_={},ju=n.defineComponent({...J_,__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,default:!1},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0},disabledItem:{type:Function,default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=new H.Reference,a=n.computed(()=>A.isNil(r.value)?s.value?[]:null:A.isArray(r.value)?r.value.filter(p=>!A.isNil(p)).map(p=>p.id):r.value.id),c=n.computed(()=>bt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=n.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=p=>{var g;if(A.isArray(p)){const b=p.length>0?p.map(y=>{var _;return(_=c.value.find(k=>k.value===y))==null?void 0:_.item}).filter(y=>!A.isNil(y)):[];o("update:value",b)}else{const b=p===l.id||A.isNil(p)||(g=c.value.find(y=>y.value===p))==null?void 0:g.item;o("update:value",b)}},f=n.useTemplateRef("select-component");return e({focus:()=>{var p;return(p=f.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=f.value)==null?void 0:p.blur()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:a.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:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":u},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),ew={},tw=n.defineComponent({...ew,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:["update:value"],setup(t,{emit:e}){var x,v;const i=t,r=e,o=()=>{const N=H.PriceCoefficient.getRetailPriceCoefficient();return A.unset(N,"isNewRec"),N},s=N=>!N||N.id===o().id,l=n.computed(()=>{var N;return((N=i.catalogItem)==null?void 0:N.type)==="product"}),a=n.computed(()=>l.value?i.catalogItem:void 0),c=N=>{var w,T,C,$;return N.id===o().id?(w=a.value)==null?void 0:w.getRetailCost():($=(C=(T=a.value)==null?void 0:T.priceCoefficients)==null?void 0:C.find(E=>E.coefficient.id===N.id))==null?void 0:$.cost},d=n.computed(()=>{var T;const w=[...((T=H.useReferencesStore().priceCoefficientsReference)==null?void 0:T.map(C=>structuredClone(n.toRaw(C))))??[],o()].filter(C=>{var $;return(($=i.visibleCoefficient)==null?void 0:$.call(i,C))??!0});return l.value&&w.forEach(C=>{var E;const $=c(C);$?C.name+=` (${$} ${(E=a.value)==null?void 0:E.currency.symbol})`:C.name=""}),w.filter(C=>C.name!=="")}),u=n.ref(i.value.coefficient),f=n.ref(((v=(x=i.value)==null?void 0:x.value)==null?void 0:v.toString())??null),h=n.ref(null),m=n.computed(()=>{var N,w;return(w=(N=a.value)==null?void 0:N.priceCoefficients)==null?void 0:w.find(T=>T.coefficient.slug===H.PriceCoefficientEnum.K0)}),p=n.ref(void 0),g=N=>Number.parseFloat((N??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),b=()=>{var w,T;p.value=void 0;let N=g(f.value);if(N=Number.isNaN(N)?void 0:N,l.value)if(u.value||f.value){const C=o(),$=c(u.value??C)??0,E=$+$*((N??0)/100);h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(E),E>(((w=a.value)==null?void 0:w.getRetailCost())??E)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&E<(((T=m.value)==null?void 0:T.cost)??0)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else h.value=null;r("update:value",{value:Number.isNaN(N)?void 0:N,coefficient:s(u.value)?void 0:structuredClone(n.toRaw(u.value))})},y=N=>{A.isArray(N)||A.isNull(N)||(u.value=N,f.value=null,!u.value&&f.value&&(u.value=o()),b())},_=()=>{u.value||(u.value=o()),b()},k=N=>{var T,C,$,E,V;const w=g(N);if(l.value){if(Number.isNaN(w)){u.value=void 0,f.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let P=0;if(w<=0)u.value=void 0,f.value=null;else if(m.value&&w<(((T=m.value)==null?void 0:T.cost)??0))u.value=(C=m.value)==null?void 0:C.coefficient,P=(w-m.value.cost)*100/m.value.cost,p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>((($=a.value)==null?void 0:$.getRetailCost())??w)){u.value=o();const I=((E=a.value)==null?void 0:E.getRetailCost())??0;P=(w-I)*100/I,p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const I=((V=a.value)==null?void 0:V.priceCoefficients)??[],U=A.sortBy(I,[L=>L.cost]),Z=U.filter(L=>L.cost<=w).at(-1)??U.at(0);Z&&(u.value=Z.coefficient,P=(w-Z.cost)*100/Z.cost),p.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(P),r("update:value",{value:Number.isNaN(P)?void 0:P,coefficient:s(u.value)?void 0:structuredClone(n.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:void 0})};return n.onMounted(()=>{var N,w,T,C;i.calculationType===H.CalculationTypeEnum.m2Cost?h.value=((w=(N=i.value)==null?void 0:N.value)==null?void 0:w.toString())??null:!((T=i.value)!=null&&T.coefficient)&&((C=i.value)!=null&&C.value)&&(u.value=o()),b()}),(N,w)=>{var $,E,V;const T=F.NInput,C=F.NInputGroup;return n.openBlock(),n.createBlock(n.unref(F.NFormItem),{"show-label":!n.unref(A.isNil)(t.label),label:t.label,"show-feedback":!n.unref(A.isNil)((($=p.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=p.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((V=p.value)==null?void 0:V.validationStatus)??t.validationStatus},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass([{"sm:grid-cols-3":l.value&&t.calculationType!==n.unref(H.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==n.unref(H.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(C,{key:0,class:n.normalizeClass(["w-full flex-row",{"sm:col-span-2":l.value}])},{default:n.withCtx(()=>[n.createVNode(ju,{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,"disabled-item":t.disabledCoefficient,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled","disabled-item"]),n.createVNode(T,{value:f.value,"onUpdate:value":[w[0]||(w[0]=P=>f.value=P),_],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},n.createSlots({suffix:n.withCtx(()=>[w[3]||(w[3]=n.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:n.withCtx(()=>[w[2]||(w[2]=n.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):n.createCommentVNode("",!0),l.value||t.calculationType===n.unref(H.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(T,{key:1,value:h.value,"onUpdate:value":[w[1]||(w[1]=P=>h.value=P),k],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},n.createSlots({_:2},[l.value?{name:"suffix",fn:n.withCtx(()=>{var P;return[n.createTextVNode(n.toDisplayString((P=a.value)==null?void 0:P.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):n.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),nw={class:"text-sm"},iw={class:"text-sm"},rw={},ow=n.defineComponent({...rw,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:i}){const r=n.useTemplateRef("form-reference"),o=n.useTemplateRef("base-dialog-reference"),s=n.ref(!1),l=n.ref(null),a=n.computed(()=>{var P,I,U;return((P=l.value)==null?void 0:P.unit.isLinear)&&((U=(I=l.value)==null?void 0:I.properties)==null?void 0:U.isLengthConfigurator)}),c=n.computed(()=>l.value?H.UnitsHelper.productIsMeasurable(l.value)||a.value?"шт.":l.value.unit.name:"шт."),d=n.ref(void 0),u=n.ref(void 0),f=n.ref(!0),h=n.ref(null),m=n.computed({get:()=>{var P;return((P=h.value)==null?void 0:P.quantity)??null},set:P=>{h.value&&(h.value.quantity=P??0)}}),p=n.computed({get:()=>{var P;return((P=h.value)==null?void 0:P.length)??null},set:P=>{h.value&&(h.value.length=P??void 0)}}),g=P=>{h.value&&(h.value.marker=P??void 0)},b=i,y=()=>({length:{},quantity:{},marker:{}}),_=n.ref(y()),k=n.ref(!1),x=n.computed(()=>{var Z,L,O,z;if(!l.value)return{};const P=H.UnitsHelper.getProductLengthMultiplicity(l.value),I=H.UnitsHelper.getProductMultiplicity(l.value),U=((L=(Z=l.value)==null?void 0:Z.properties)==null?void 0:L.minLength)||P,J=(z=(O=l.value)==null?void 0:O.properties)==null?void 0:z.maxLength;return{length:[ae.required,ae.min(U??.1),ae.max(J),ae.step(P),We.serverValidation(_.value.length.feedback)],quantity:[ae.required,ae.min(I),ae.step(I),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),v=n.computed(()=>{var P,I,U;return l.value?((P=l.value.properties)==null?void 0:P.lengthStep)??((I=l.value.properties)!=null&&I.ignoreMinCountCheck?0:((U=l.value.properties)==null?void 0:U.minCount)??0):0}),N=n.computed(()=>{var U,J,Z,L,O,z,M,R,W;if(!l.value)return"";const P=((J=(U=l.value)==null?void 0:U.properties)==null?void 0:J.minLength)??((L=(Z=l.value)==null?void 0:Z.properties)!=null&&L.ignoreMinCountCheck?0:(z=(O=l.value)==null?void 0:O.properties)==null?void 0:z.minCount),I=(R=(M=l.value)==null?void 0:M.properties)==null?void 0:R.maxLength;return P||I?`(${P?`от ${P}`:""}${P&&I?" ":""}${I?`до ${I}`:""} ${(W=l.value)==null?void 0:W.unit.name})`:""}),w=P=>{var L,O;if(!((O=(L=l.value)==null?void 0:L.properties)!=null&&O.isLengthConfigurator)||!h.value||A.isNil(P)||v.value===0)return;const I=P/v.value,U=Math.round(I),J=H.UnitsHelper.getProductMultiplicity(l.value),Z=Math.max(U,J);h.value.quantity=Z},T=P=>{var Z,L,O,z;if(!((L=(Z=l.value)==null?void 0:Z.properties)!=null&&L.isLengthConfigurator)||!h.value||A.isNil(P)||v.value===0)return;const I=P*v.value,U=((O=l.value.properties)==null?void 0:O.minLength)||H.UnitsHelper.getProductLengthMultiplicity(l.value),J=(z=l.value.properties)==null?void 0:z.maxLength;U!==void 0&&I<U?h.value.length=U:J!==void 0&&I>J?h.value.length=J:h.value.length=I},C=async P=>{var U;const I=A.cloneDeep(h.value);try{await((U=r.value)==null?void 0:U.validate(J=>{if(!J){if(!l.value||!I)return;H.UnitsHelper.productIsMeasurable(l.value)||delete I.length,a.value&&v.value&&(I.length=v.value),k.value=!0,b("submit",I,_.value,()=>{k.value=!1,P(!1),n.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(A.noop).catch(A.noop)})})}}))}catch{}},$=()=>{l.value=null,d.value=void 0,h.value=null,_.value=y()},E=()=>{s.value=!1};return e({show:(P,I)=>{var U,J,Z,L,O;if($(),s.value=!0,l.value=P,d.value=I==null?void 0:I.cartItemData,u.value=I==null?void 0:I.orderId,f.value=(I==null?void 0:I.canSetDopProdaga)??!1,h.value=new H.OrderItemBase((I==null?void 0:I.cartItemData)??new H.OrderItemBase({product:P,quantity:H.UnitsHelper.productIsMeasurable(l.value)?1:((U=P==null?void 0:P.properties)==null?void 0:U.minCount)??1,length:((J=P==null?void 0:P.properties)==null?void 0:J.minLength)||((Z=P==null?void 0:P.properties)!=null&&Z.ignoreMinCountCheck?0:(L=P==null?void 0:P.properties)==null?void 0:L.minCount)||0})),(O=P==null?void 0:P.properties)!=null&&O.isLengthConfigurator&&h.value&&v.value>0){const z=v.value,M=h.value.quantity||1;h.value.length=M*z}},closeDialog:E}),(P,I)=>{var O;const U=F.NFormItem,J=F.NInputGroupLabel,Z=F.NInputGroup,L=F.NCheckbox;return n.openBlock(),n.createBlock($s,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(O=l.value)==null?void 0:O.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:k.value,"modal-width":500,onAccept:C,onClosing:E},{default:n.withCtx(()=>[l.value&&h.value?n.withDirectives((n.openBlock(),n.createBlock(n.unref(F.NForm),{key:0,ref:"form-reference",model:h.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>[n.unref(H.UnitsHelper).productIsMeasurable(l.value)?(n.openBlock(),n.createBlock(U,{key:0,path:"length",label:`Метраж, ${N.value+l.value.unit.name}`},n.createSlots({default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:p.value,"onUpdate:value":[I[0]||(I[0]=z=>p.value=z),w],parse:n.unref(ct),step:n.unref(H.UnitsHelper).getProductLengthMultiplicity(l.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:I[1]||(I[1]=z=>n.unref(so)(z,".",!1)),onInput:I[2]||(I[2]=z=>n.unref(rt)(_.value,"length")),onFocus:n.unref(He)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&n.unref(H.UnitsHelper).getProductLengthMultiplicity(l.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",nw,"Метраж должно быть кратно "+n.toDisplayString(n.unref(H.UnitsHelper).getProductLengthMultiplicity(l.value)),1)]),key:"0"}:void 0]),1032,["label"])):n.createCommentVNode("",!0),n.createVNode(U,{path:"quantity",label:`Количество, ${c.value}`},{default:n.withCtx(()=>[n.createVNode(Z,null,n.createSlots({default:n.withCtx(()=>[n.createVNode(n.unref(F.NInputNumber),{value:m.value,"onUpdate:value":[I[3]||(I[3]=z=>m.value=z),T],parse:n.unref(ct),step:n.unref(H.UnitsHelper).getProductMultiplicity(l.value),"show-button":n.unref(H.UnitsHelper).getProductMultiplicity(l.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:I[4]||(I[4]=z=>n.unref(so)(z,".",!1)),onInput:I[5]||(I[5]=z=>n.unref(rt)(_.value,"quantity")),onFocus:n.unref(He)},null,8,["value","parse","step","show-button","onFocus"]),a.value?(n.openBlock(),n.createBlock(J,{key:0,class:"bg-orange-100 font-bold"},{default:n.withCtx(()=>[n.createTextVNode(" x "+n.toDisplayString(v.value)+" "+n.toDisplayString(l.value.unit.name),1)]),_:1})):n.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&n.unref(H.UnitsHelper).getProductMultiplicity(l.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",iw,"Количество должно быть кратно "+n.toDisplayString(n.unref(H.UnitsHelper).getProductMultiplicity(l.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),n.unref(H.UnitsHelper).productIsMeasurable(l.value)?(n.openBlock(),n.createBlock(U,{key:1,path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:I[6]||(I[6]=z=>n.unref(rt)(_.value,"marker")),"onUpdate:value":I[7]||(I[7]=z=>g(z)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1})):n.createCommentVNode("",!0),f.value?(n.openBlock(),n.createBlock(L,{key:2,checked:h.value.isAdditionalSale,"onUpdate:checked":I[8]||(I[8]=z=>h.value.isAdditionalSale=z),"true-value":!0,"false-value":!1},{default:n.withCtx(()=>[...I[9]||(I[9]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0)]),_:1},8,["model","rules"])),[[n.unref(ti),()=>{var z,M;return(M=(z=o.value)==null?void 0:z.acceptHandler)==null?void 0:M.call(z)}]]):n.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),sw={class:"flex flex-row gap-1"},lw={class:"sc-client-name flex flex-col gap-1 text-base"},aw=["href"],cw={key:1,class:"text-sc-grey"},dw={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},uw={key:0},fw={key:1,class:"text-sm"},hw={},Mr=n.defineComponent({...hw,__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 i=t,r=e,o=n.computed(()=>i.client.lastLoginAt?ke.format(i.client.lastLoginAt,H.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=l=>{A.isNil(i.nameLink)&&(l.preventDefault(),l.stopPropagation()),r("click:client-name",i.client,l)};return(l,a)=>{const c=lo,d=F.NButton,u=F.NPopover;return n.openBlock(),n.createElementBlock("div",sw,[t.showClientInfoIcon?(n.openBlock(),n.createBlock(d,{key:0,quaternary:"",size:"small",onClick:a[0]||(a[0]=f=>l.$emit("click:client-info",t.client))},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})):n.createCommentVNode("",!0),n.createVNode(u,{disabled:n.unref(A.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:n.withCtx(()=>[n.createElementVNode("div",lw,[n.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:a[1]||(a[1]=f=>s(f))},[n.createElementVNode("span",{class:n.normalizeClass({"line-through":!t.client.isActive})},n.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass({"line-through":!t.client.isActive})}," ("+n.toDisplayString(t.client.salesDirection.name)+") ",3)):n.createCommentVNode("",!0),t.client.isActive?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",cw," [ Деактивирован ] "))],8,aw),t.showCityAndRegion&&t.client.city?(n.openBlock(),n.createElementBlock("span",dw," г. "+n.toDisplayString(t.client.city.name)+", "+n.toDisplayString(t.client.city.region.name),1)):n.createCommentVNode("",!0)])]),default:n.withCtx(()=>[t.client.alternativeName?(n.openBlock(),n.createElementBlock("div",uw,n.toDisplayString(t.client.alternativeName),1)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("span",fw," Последний вход: "+n.toDisplayString(o.value),1)):n.createCommentVNode("",!0),n.renderSlot(l.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),mw={class:"text-base"},pw={},qu=n.defineComponent({...pw,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){const e=t,i=n.computed(()=>ni.getFormatEntityName(e.contragent));return(r,o)=>(n.openBlock(),n.createElementBlock("span",mw,n.toDisplayString(i.value),1))}}),gw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yw(t,e){return n.openBlock(),n.createElementBlock("svg",gw,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.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"}),n.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const bw=n.markRaw({name:"tabler-mail",render:yw}),_w=["href"],ww={},xw=n.defineComponent({...ww,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,i)=>{const r=bw;return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(n.openBlock(),n.createBlock(r,{key:0})):n.createCommentVNode("",!0),n.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},n.toDisplayString(t.email),9,_w)],2)}}}),kw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cw(t,e){return n.openBlock(),n.createElementBlock("svg",kw,[...e[0]||(e[0]=[n.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 Xu=n.markRaw({name:"fa6-brands-viber",render:Cw}),vw={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Sw=["id"],Bw=["id"],Nw=["fill"],Tw=["fill"];function $w(t,e){return n.openBlock(),n.createElementBlock("svg",vw,[n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[n.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),n.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,Sw),n.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[n.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),n.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,Bw)]),n.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,Nw),n.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,Tw),e[2]||(e[2]=n.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 Yu=n.markRaw({name:"logos-whatsapp-icon",render:$w,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Ew={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},Rw=["id"],Pw=["fill"];function Fw(t,e){return n.openBlock(),n.createElementBlock("svg",Ew,[n.createElementVNode("defs",null,[n.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[n.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),n.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,Rw)]),n.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,Pw),e[1]||(e[1]=n.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 Ku=n.markRaw({name:"logos-telegram",render:Fw,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Vw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Mw(t,e){return n.openBlock(),n.createElementBlock("svg",Vw,[...e[0]||(e[0]=[n.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 Uu=n.markRaw({name:"ion-call",render:Mw}),Iw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Aw(t,e){return n.openBlock(),n.createElementBlock("svg",Iw,[...e[0]||(e[0]=[n.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 Ow=n.markRaw({name:"tabler-phone-call",render:Aw}),zw={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Dw=["href"],Lw=["href"],Hw=["href"],Ww=["href"],jw={},qw=n.defineComponent({...jw,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,i=n.computed(()=>{try{return e.phone?xr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=n.computed(()=>{var a;return A.isString(i.value)?!1:((a=i.value)==null?void 0:a.isValid())??!1}),o=n.computed(()=>{var a;return A.isString(i.value)?i.value:((a=i.value)==null?void 0:a.format("INTERNATIONAL"))??""}),s=n.computed(()=>{var a;return A.isString(i.value)?i.value:((a=i.value)==null?void 0:a.format("E.164"))??""}),l=n.ref(!1);return(a,c)=>{const d=Ow,u=Uu,f=Ku,h=Yu,m=Xu;return n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",{class:n.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&l.value,"min-w-10":!0}),onClick:c[0]||(c[0]=p=>l.value=!l.value),onFocusout:c[1]||(c[1]=p=>l.value=!1),onMouseleave:c[2]||(c[2]=p=>l.value=!1)},[n.createElementVNode("div",{class:n.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(n.openBlock(),n.createBlock(d,{key:0})):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)],2),r.value&&l.value?(n.openBlock(),n.createElementBlock("div",zw,[r.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[n.createVNode(u)],8,Dw)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[n.createVNode(f)],8,Lw)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[n.createVNode(h)],8,Hw)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[n.createVNode(m)],8,Ww)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],34)])}}}),Xw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yw(t,e){return n.openBlock(),n.createElementBlock("svg",Xw,[...e[0]||(e[0]=[n.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 Kw=n.markRaw({name:"mdi-envelope",render:Yw}),Uw={class:"flex flex-col gap-1"},Gw={key:0,class:"mb-2 flex flex-col text-base"},Zw={key:0,class:"text-sc-dark-grey text-sm"},Qw={key:1,class:"whitespace-nowrap text-sm"},Jw={key:2,class:"whitespace-nowrap text-sm"},ex={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},tx=["href"],nx=["href"],ix=["href"],rx=["href"],ox=["href"],sx={key:0,class:"flex flex-col text-base"},lx={key:0,class:"text-sc-dark-grey text-sm"},ax={key:1,class:"mt-2 text-sm"},cx={key:0,class:"-mt-1"},dx={},ux=n.defineComponent({...dx,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,i=n.computed(()=>ni.getFormatEntityName(e.contact)),r=n.computed(()=>{try{return e.contact.phone?xr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=n.computed(()=>{var d;return A.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=n.computed(()=>{var d;return A.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),l=n.computed(()=>{var d;return A.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),a=n.computed(()=>o.value||e.contact.email),c=n.ref(!1);return(d,u)=>{var y,_;const f=Uu,h=Ku,m=Yu,p=Xu,g=Kw,b=F.NPopover;return n.openBlock(),n.createElementBlock("div",Uw,[n.createVNode(b,{disabled:t.fullView,placement:"bottom"},{trigger:n.withCtx(()=>{var k,x,v,N;return[n.createElementVNode("div",{class:n.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(k=t.contact)!=null&&k.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:n.normalizeStyle(t.styles),onMouseenter:u[0]||(u[0]=w=>c.value=!0),onFocusin:u[1]||(u[1]=w=>c.value=!0),onMouseleave:u[2]||(u[2]=w=>c.value=!1),onFocusout:u[3]||(u[3]=w=>c.value=!1)},[n.createElementVNode("div",null,[t.fullView&&(t.contact.name||(x=t.contact)!=null&&x.position)?(n.openBlock(),n.createElementBlock("div",Gw,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(v=t.contact)!=null&&v.position?(n.openBlock(),n.createElementBlock("span",Zw,n.toDisplayString((N=t.contact)==null?void 0:N.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),t.contact.phone?(n.openBlock(),n.createElementBlock("div",Qw,n.toDisplayString(s.value),1)):n.createCommentVNode("",!0),t.contact.email?(n.openBlock(),n.createElementBlock("div",Jw,n.toDisplayString(t.contact.email),1)):n.createCommentVNode("",!0),a.value&&c.value?(n.openBlock(),n.createElementBlock("div",ex,[o.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:`tel:${l.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[n.createVNode(f)],8,tx)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:1,href:`https://t.me/${l.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(h)],8,nx)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:2,href:`https://wa.me/${l.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(m)],8,ix)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:3,href:`viber://chat?number=${l.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[n.createVNode(p)],8,rx)):n.createCommentVNode("",!0),t.contact.email?(n.openBlock(),n.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[n.createVNode(g)],8,ox)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])],38)]}),default:n.withCtx(()=>{var k,x,v,N;return[t.contact.name?(n.openBlock(),n.createElementBlock("div",sx,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(k=t.contact)!=null&&k.position?(n.openBlock(),n.createElementBlock("span",lx,n.toDisplayString((x=t.contact)==null?void 0:x.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),(v=t.contact)!=null&&v.comment?(n.openBlock(),n.createElementBlock("div",ax,[u[4]||(u[4]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((N=t.contact)==null?void 0:N.comment),1)])):n.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(n.openBlock(),n.createElementBlock("div",cx,[u[5]||(u[5]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((_=t.contact)==null?void 0:_.comment),1)])):n.createCommentVNode("",!0)])}}});class fx{constructor(e){B(this,"minHeight");B(this,"maxHeights");B(this,"minWidth");B(this,"maxWidths");B(this,"netType");B(this,"color");B(this,"mountType");B(this,"descriptions");B(this,"crossbarCount");B(this,"heightOverlaps");B(this,"widthOverlaps");B(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=ws.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=ws.objectToSnake(e.heightOverlaps),this.widthOverlaps=ws.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function hx(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==H.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&A.isArray(t.products)&&t.products.length>0}const mx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function px(t,e){return n.openBlock(),n.createElementBlock("svg",mx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2"},null,-1)])])}const gx=n.markRaw({name:"mdi-dots-horizontal",render:px}),yx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bx(t,e){return n.openBlock(),n.createElementBlock("svg",yx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 0 0 9.5 3A6.5 6.5 0 0 0 3 9.5A6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5l1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5S14 7 14 9.5S12 14 9.5 14M7 9h5v1H7z"},null,-1)])])}const _x=n.markRaw({name:"mdi-magnify-minus-outline",render:bx}),wx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xx(t,e){return n.openBlock(),n.createElementBlock("svg",wx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"m15.5 14l5 5l-1.5 1.5l-5-5v-.79l-.27-.28A6.47 6.47 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5S5 7 5 9.5S7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z"},null,-1)])])}const kx=n.markRaw({name:"mdi-magnify-plus-outline",render:xx}),Cx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vx(t,e){return n.openBlock(),n.createElementBlock("svg",Cx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"},null,-1)])])}const Gu=n.markRaw({name:"mdi-chevron-right",render:vx}),Sx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bx(t,e){return n.openBlock(),n.createElementBlock("svg",Sx,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"},null,-1)])])}const Zu=n.markRaw({name:"mdi-chevron-left",render:Bx}),Nx={heightMedium:"40px",paddingMedium:"0 16px",borderRadiusMedium:"10px",fontSizeMedium:"14px",iconSizeMedium:"18px",iconMarginMedium:"8px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},Ir={heightSmall:"36px",paddingSmall:"0 10px",borderRadiusSmall:"8px",iconSizeSmall:"18px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},Qu="date-range.dialog.mode",Ju="date-range.dialog.scale",ef="date-range.quick-periods",tf=["thisMonth","lastMonth","thisQuarter","lastQuarter","thisYear","lastYear","fromBeginningOfThisYear"],nf=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Tx=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],$x=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],rf=new Date(2e3,0,1),Bi=t=>ke.differenceInCalendarDays(t,rf),of=t=>ke.addDays(rf,t),sf=(t,e,i)=>{let r=t??void 0,o=e??void 0;return r&&o&&r>o&&(i!=null&&i.from?o=r:i!=null&&i.to?r=o:[r,o]=[o,r]),{from:r?ke.startOfDay(r):void 0,to:o?ke.endOfDay(o):void 0}},Tl=t=>Object.entries(t).map(([e,i])=>({value:e,label:i.label,item:i})),lf=(t,e)=>{const i=Object.entries(t).filter(([,r])=>r.group===e);return e!=="other"?[{type:"group",key:e,children:Tl(Object.fromEntries(i))}]:H.STANDARD_PERIOD_SECTIONS.map(r=>{const o=i.filter(([,s])=>s.section===r.key);return{type:"group",key:r.key,label:r.label,children:Tl(Object.fromEntries(o))}}).filter(r=>r.children.length>0)},af=(t,e)=>{const i=n.ref(null),r=n.ref(null),o=n.ref(!1),s=n.ref(null),l=(g,b)=>g<=b?[g,b]:[b,g],a=n.computed(()=>o.value&&r.value!==null&&s.value!==null?l(r.value,s.value):i.value!==null?s.value===null?[i.value,i.value]:l(i.value,s.value):t.value),c=(g,b)=>{i.value=null,e(...l(g,b))},d=g=>{i.value===null?(i.value=g,e(g,g)):c(i.value,g)},u=()=>{globalThis.removeEventListener("pointerup",u);const g=r.value;if(g!==null){if(r.value=null,o.value){o.value=!1,s.value!==null&&c(g,s.value);return}d(g)}},f=g=>{r.value=g,o.value=!1,globalThis.addEventListener("pointerup",u)},h=g=>{s.value=g,r.value!==null&&g!==r.value&&(o.value=!0)},m=()=>{s.value=null},p=g=>{const b=a.value;return!b||g<b[0]||g>b[1]?null:g===b[0]||g===b[1]?"bound":"in-range"};return n.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",u)}),{activeRange:a,cellPosition:p,pointerDownHandler:f,pointerEnterHandler:h,pointerLeaveHandler:m,selectHandler:d}},Ex={class:"flex items-center justify-between gap-2"},Rx={class:"flex items-center gap-2"},Px={class:"text-center font-semibold"},Fx={class:"grid grid-cols-7 gap-0.5 text-center text-xs text-gray-500"},Vx={class:"grid grid-cols-7 gap-0.5"},Mx=["disabled","onPointerdown","onPointerenter","onKeydown"],Ix={},Ax=n.defineComponent({...Ix,__name:"day-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const i=t,r=e,o=42,s=F.useThemeVars(),l=n.computed(()=>({"--sc-primary-color":s.value.primaryColor,"--sc-primary-color-hover":s.value.primaryColorHover,"--sc-primary-color-suppl":s.value.primaryColorSuppl,"--sc-hover-color":s.value.hoverColor})),a=Ye.initRefDependingOnDeviceResolution(1,2,3),c=n.computed(()=>["grid-cols-1","grid-cols-2","grid-cols-3"][a.value-1]),d=y=>ke.subMonths(ke.startOfMonth(y),a.value===3?1:0),u=y=>y&&ke.isValid(y)?y:new Date,f=n.ref(d(u(i.from??i.to))),h=n.computed(()=>{const{from:y,to:_}=i;return!y||!_||!ke.isValid(y)||!ke.isValid(_)?null:[Bi(y),Bi(_)]}),m=af(h,(y,_)=>{r("select",{from:ke.startOfDay(of(y)),to:ke.endOfDay(of(_))})}),p=y=>{const _=ke.subDays(y,(ke.getDay(y)+6)%7);return A.times(o,k=>{const x=ke.addDays(_,k);return{index:Bi(x),day:x.getDate(),isCurrentMonth:ke.isSameMonth(x,y),isToday:ke.isToday(x)}})},g=n.computed(()=>A.times(a.value,y=>{const _=ke.addMonths(f.value,y);return{key:`${_.getFullYear()}-${_.getMonth()}`,title:`${Tx[_.getMonth()]} ${_.getFullYear()}`,cells:p(_)}})),b=y=>{if(!y.isCurrentMonth)return["sc-day--outside"];const _=y.isToday?["sc-day--today"]:[],k=m.cellPosition(y.index);return k&&_.push(`sc-day--${k}`),_};return n.watch(()=>[i.from,i.to],()=>{const y=i.from??i.to;if(!y||!ke.isValid(y))return;const _=`${y.getFullYear()}-${y.getMonth()}`;A.some(g.value,["key",_])||(f.value=d(y))}),(y,_)=>{const k=Zu,x=F.NButton,v=Gu;return n.openBlock(),n.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:n.normalizeStyle(l.value),onPointerleave:_[2]||(_[2]=(...N)=>n.unref(m).pointerLeaveHandler&&n.unref(m).pointerLeaveHandler(...N))},[n.createElementVNode("div",Ex,[n.createVNode(x,{size:"small","aria-label":"Предыдущий месяц","theme-overrides":n.unref(Ir),onClick:_[0]||(_[0]=N=>f.value=n.unref(ke.subMonths)(f.value,1))},{icon:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["theme-overrides"]),_[3]||(_[3]=n.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон на календаре",-1)),n.createElementVNode("div",Rx,[n.renderSlot(y.$slots,"actions",{},void 0,!0),n.createVNode(x,{size:"small","aria-label":"Следующий месяц","theme-overrides":n.unref(Ir),onClick:_[1]||(_[1]=N=>f.value=n.unref(ke.addMonths)(f.value,1))},{icon:n.withCtx(()=>[n.createVNode(v)]),_:1},8,["theme-overrides"])])]),n.createElementVNode("div",{class:n.normalizeClass(["grid gap-3",c.value])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,N=>(n.openBlock(),n.createElementBlock("div",{key:N.key,class:"flex flex-col gap-1"},[n.createElementVNode("div",Px,n.toDisplayString(N.title),1),n.createElementVNode("div",Fx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref($x),w=>(n.openBlock(),n.createElementBlock("span",{key:w},n.toDisplayString(w),1))),128))]),n.createElementVNode("div",Vx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.cells,w=>(n.openBlock(),n.createElementBlock("button",{key:w.index,type:"button",class:n.normalizeClass(["sc-day h-7 rounded border-0 p-0 text-xs",b(w)]),disabled:!w.isCurrentMonth,onPointerdown:n.withModifiers(T=>n.unref(m).pointerDownHandler(w.index),["prevent"]),onPointerenter:T=>n.unref(m).pointerEnterHandler(w.index),onKeydown:[n.withKeys(n.withModifiers(T=>n.unref(m).selectHandler(w.index),["prevent"]),["enter"]),n.withKeys(n.withModifiers(T=>n.unref(m).selectHandler(w.index),["prevent"]),["space"])]},n.toDisplayString(w.day),43,Mx))),128))])]))),128))],2),_[4]||(_[4]=n.createStaticVNode('<div class="flex flex-wrap items-center gap-x-6 gap-y-1 text-xs text-gray-700" data-v-a41e813d><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата начала</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--in-range" data-v-a41e813d></i>Выбранный период</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата окончания</span></div>',1))],36)}}}),Ox=cn(Ax,[["__scopeId","data-v-a41e813d"]]),zx={class:"flex items-center justify-between gap-2"},Dx={class:"flex items-center gap-2"},Lx={class:"text-center font-semibold"},Hx={class:"grid grid-cols-3 gap-2"},Wx=["onPointerdown","onPointerenter","onKeydown"],jx={},qx=n.defineComponent({...jx,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const i=t,r=e,o=F.useThemeVars(),s=n.computed(()=>({"--sc-primary-color":o.value.primaryColor,"--sc-primary-color-hover":o.value.primaryColorHover,"--sc-primary-color-suppl":o.value.primaryColorSuppl,"--sc-hover-color":o.value.hoverColor})),l=m=>{const p=new Date().getFullYear();return m&&ke.isValid(m)?m.getFullYear():p},a=n.ref(l(i.from??i.to)),c=Ye.initRefDependingOnDeviceResolution(1,3,3),d=n.computed(()=>c.value===1?[a.value]:[a.value-1,a.value,a.value+1]),u=n.computed(()=>{const{from:m,to:p}=i;return!m||!p||!ke.isValid(m)||!ke.isValid(p)?null:[m.getFullYear()*12+m.getMonth(),p.getFullYear()*12+p.getMonth()]}),f=af(u,(m,p)=>{r("select",{from:new Date(Math.floor(m/12),m%12,1),to:ke.endOfMonth(new Date(Math.floor(p/12),p%12,1))})}),h=(m,p)=>{const g=f.cellPosition(m*12+p);return g?[`sc-month--${g}`]:[]};return n.watch(()=>[i.from,i.to],()=>{const m=i.from??i.to;if(!m||!ke.isValid(m))return;const p=m.getFullYear();(p<a.value-1||p>a.value+1)&&(a.value=p)}),(m,p)=>{const g=Zu,b=F.NButton,y=Gu;return n.openBlock(),n.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:n.normalizeStyle(s.value),onPointerleave:p[2]||(p[2]=(..._)=>n.unref(f).pointerLeaveHandler&&n.unref(f).pointerLeaveHandler(..._))},[n.createElementVNode("div",zx,[n.createVNode(b,{size:"small","aria-label":"Предыдущий год","theme-overrides":n.unref(Ir),onClick:p[0]||(p[0]=_=>a.value-=1)},{icon:n.withCtx(()=>[n.createVNode(g)]),_:1},8,["theme-overrides"]),p[3]||(p[3]=n.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон месяцев",-1)),n.createElementVNode("div",Dx,[n.renderSlot(m.$slots,"actions",{},void 0,!0),n.createVNode(b,{size:"small","aria-label":"Следующий год","theme-overrides":n.unref(Ir),onClick:p[1]||(p[1]=_=>a.value+=1)},{icon:n.withCtx(()=>[n.createVNode(y)]),_:1},8,["theme-overrides"])])]),n.createElementVNode("div",{class:n.normalizeClass(["grid gap-4 sm:gap-6",d.value.length===1?"grid-cols-1":"grid-cols-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,_=>(n.openBlock(),n.createElementBlock("div",{key:_,class:"flex flex-col gap-2"},[n.createElementVNode("div",Lx,n.toDisplayString(_),1),n.createElementVNode("div",Hx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(nf),(k,x)=>(n.openBlock(),n.createElementBlock("button",{key:k,type:"button",class:n.normalizeClass(["sc-month cursor-pointer rounded-lg px-1 py-2.5 text-sm",h(_,x)]),onPointerdown:n.withModifiers(v=>n.unref(f).pointerDownHandler(_*12+x),["prevent"]),onPointerenter:v=>n.unref(f).pointerEnterHandler(_*12+x),onKeydown:[n.withKeys(n.withModifiers(v=>n.unref(f).selectHandler(_*12+x),["prevent"]),["enter"]),n.withKeys(n.withModifiers(v=>n.unref(f).selectHandler(_*12+x),["prevent"]),["space"])]},n.toDisplayString(k),43,Wx))),128))])]))),128))],2)],36)}}}),Xx=cn(qx,[["__scopeId","data-v-dd09a19d"]]),Yx={class:"sc-date-range-sidebar flex flex-col gap-1"},Kx={class:"flex items-center justify-center gap-1"},Ux={class:"min-w-12 text-center font-semibold"},Gx={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},Zx={},Qx=n.defineComponent({...Zx,__name:"month-year-sidebar",props:{year:{},month:{}},emits:["update:year","select-month","today"],setup(t,{emit:e}){const i=e;return(r,o)=>{const s=F.NButton;return n.openBlock(),n.createElementBlock("div",Yx,[n.createElementVNode("div",Kx,[n.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=l=>i("update:year",t.year-1))},{default:n.withCtx(()=>[...o[3]||(o[3]=[n.createTextVNode(" ‹ ",-1)])]),_:1}),n.createElementVNode("span",Ux,n.toDisplayString(t.year),1),n.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=l=>i("update:year",t.year+1))},{default:n.withCtx(()=>[...o[4]||(o[4]=[n.createTextVNode(" › ",-1)])]),_:1})]),n.createElementVNode("div",Gx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(nf),(l,a)=>(n.openBlock(),n.createBlock(s,{key:l,size:"small",quaternary:"",type:a===t.month?"primary":"default",onClick:c=>i("select-month",a)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l),1)]),_:2},1032,["type","onClick"]))),128))]),n.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=l=>i("today"))},{default:n.withCtx(()=>[...o[5]||(o[5]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),Jx={},cf=n.defineComponent({...Jx,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>H.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=Ye.initRefDependingOnDeviceResolution(!0,!1,!1),s=n.ref(null),l=n.ref(!1),a=n.ref(0),c=n.ref(i.value&&ke.isValid(i.value)?i.value:new Date),d=n.computed(()=>{const k=i.value&&ke.isValid(i.value)?i.value:c.value;return k.getFullYear()===c.value.getFullYear()?k.getMonth():null});let u=0;const f=k=>{var x,v;(v=(x=k.target)==null?void 0:x.closest)!=null&&v.call(x,".n-base-clear")&&(u=performance.now())},h=k=>{k&&performance.now()-u<300||(l.value=k,k&&(c.value=i.value&&ke.isValid(i.value)?i.value:new Date))},m=k=>{r("update:value",k===null?null:new Date(k))},p=(k,x)=>{const v=new Date(k,x,1);if(c.value=v,i.value&&ke.isValid(i.value)){const N=Math.min(ke.getDate(i.value),ke.getDaysInMonth(v));r("update:value",new Date(k,x,N));return}a.value+=1,n.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(k,x)=>{c.value=ke.addYears(ke.addMonths(c.value,k),x)},b=k=>{p(k,c.value.getMonth())},y=k=>{p(c.value.getFullYear(),k)},_=()=>{l.value=!1,r("update:value",new Date)};return(k,x)=>{const v=F.NButton,N=F.NDatePicker;return n.openBlock(),n.createBlock(N,{ref_key:"pickerReference",ref:s,key:a.value,value:i.value?i.value.getTime():null,show:l.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,format:t.dateFormat,actions:[],"default-calendar-start-time":c.value.getTime(),type:"date",class:"w-full min-w-0",onMousedownCapture:f,"onUpdate:show":h,"onUpdate:value":m,onNextMonth:x[0]||(x[0]=w=>g(1,0)),onPrevMonth:x[1]||(x[1]=w=>g(-1,0)),onNextYear:x[2]||(x[2]=w=>g(0,1)),onPrevYear:x[3]||(x[3]=w=>g(0,-1))},{footer:n.withCtx(()=>[n.unref(o)?(n.openBlock(),n.createBlock(v,{key:1,size:"small",text:"",type:"info",onClick:_},{default:n.withCtx(()=>[...x[4]||(x[4]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})):(n.openBlock(),n.createBlock(Qx,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":b,onSelectMonth:y,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),ek={key:0,class:"text-gray-400"},tk={},df=n.defineComponent({...tk,__name:"date-range-fields",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},from:{default:null},to:{default:null},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:from","update:to"],setup(t,{emit:e}){const i=Ye.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var l,a;return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex w-full min-w-0 gap-1",n.unref(i)?"flex-col":"flex-row items-center"])},[n.createVNode(cf,{value:t.from,clearable:t.clearable,disabled:(l=t.disabled)==null?void 0:l.from,placeholder:t.placeholderFrom,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:value":s[0]||(s[0]=c=>r("update:from",c))},null,8,["value","clearable","disabled","placeholder","date-format"]),n.unref(i)?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("span",ek," – ")),n.createVNode(cf,{value:t.to,clearable:t.clearable,disabled:(a=t.disabled)==null?void 0:a.to,placeholder:t.placeholderTo,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:value":s[1]||(s[1]=c=>r("update:to",c))},null,8,["value","clearable","disabled","placeholder","date-format"])],2)}}}),nk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ik(t,e){return n.openBlock(),n.createElementBlock("svg",nk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M7 11h2v2H7zm14-6v14c0 1.11-.89 2-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2M5 7h14V5H5zm14 12V9H5v10zm-4-6v-2h2v2zm-4 0v-2h2v2zm-4 2h2v2H7zm8 2v-2h2v2zm-4 0v-2h2v2z"},null,-1)])])}const rk=n.markRaw({name:"mdi-calendar-month-outline",render:ik}),ok={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sk(t,e){return n.openBlock(),n.createElementBlock("svg",ok,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"m16 11.78l4.24-7.33l1.73 1l-5.23 9.05l-6.51-3.75L5.46 19H22v2H2V3h2v14.54L9.5 8z"},null,-1)])])}const lk=n.markRaw({name:"mdi-chart-line",render:sk}),ak={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ck(t,e){return n.openBlock(),n.createElementBlock("svg",ak,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M22 21H2V3h2v16h2v-9h4v9h2V6h4v13h2v-5h4z"},null,-1)])])}const dk=n.markRaw({name:"mdi-chart-bar",render:ck}),uk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fk(t,e){return n.openBlock(),n.createElementBlock("svg",uk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M5 3h1V1h2v2h8V1h2v2h1c1.11 0 2 .89 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 16h14V9H5zM5 7h14V5H5zm12 4v2H7v-2z"},null,-1)])])}const hk=n.markRaw({name:"mdi-calendar-week-outline",render:fk}),mk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pk(t,e){return n.openBlock(),n.createElementBlock("svg",mk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2m0 16H5V9h14zm0-12H5V5h14M7 11h5v5H7"},null,-1)])])}const gk=n.markRaw({name:"mdi-calendar-today-outline",render:pk}),yk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bk(t,e){return n.openBlock(),n.createElementBlock("svg",yk,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"currentColor",d:"M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z"},null,-1)])])}const _k=n.markRaw({name:"mdi-cog-outline",render:bk}),wk={class:"grid gap-x-6 gap-y-4 pr-3 sm:grid-cols-2"},xk={class:"font-medium"},kk={key:0,class:"pt-1 text-xs text-gray-500"},Ck={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},vk={class:"flex items-center gap-3"},Sk={class:"text-sm text-gray-600"},Bk={class:"flex gap-2"},Nk={},Tk=n.defineComponent({...Nk,__name:"quick-periods-settings",props:{show:{type:Boolean},selectedKeys:{}},emits:["update:show","save"],setup(t,{emit:e}){const i=t,r=e,o=Ye.initRefDependingOnDeviceResolution("100%","90%","40rem"),s=H.DateTimeProvider.standardPeriods(),l=H.STANDARD_PERIOD_GROUPS.map(u=>({key:u.key,label:u.label,sections:lf(s,u.key)})),a=n.ref([]),c=n.computed(()=>{const u=a.value.length;return`Выбрано: ${u} ${H.pluralize(u,["период","периода","периодов"])}`}),d=()=>{r("save",[...a.value]),r("update:show",!1)};return n.watch(()=>i.show,u=>{u&&(a.value=[...i.selectedKeys])}),(u,f)=>{const h=F.NCheckbox,m=F.NCheckboxGroup,p=F.NScrollbar,g=F.NButton,b=F.NModal;return n.openBlock(),n.createBlock(b,{show:t.show,preset:"card",title:"Настройка быстрого выбора",closable:"",style:n.normalizeStyle({width:n.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":f[4]||(f[4]=y=>r("update:show",y))},{footer:n.withCtx(()=>[n.createElementVNode("div",Ck,[n.createElementVNode("div",vk,[n.createElementVNode("span",Sk,n.toDisplayString(c.value),1),n.createVNode(g,{text:"",type:"info",onClick:f[1]||(f[1]=y=>a.value=[...n.unref(tf)])},{default:n.withCtx(()=>[...f[5]||(f[5]=[n.createTextVNode(" По умолчанию ",-1)])]),_:1}),n.createVNode(g,{text:"",type:"info",disabled:a.value.length===0,onClick:f[2]||(f[2]=y=>a.value=[])},{default:n.withCtx(()=>[...f[6]||(f[6]=[n.createTextVNode(" Снять все ",-1)])]),_:1},8,["disabled"])]),n.createElementVNode("div",Bk,[n.createVNode(g,{type:"primary",onClick:d},{default:n.withCtx(()=>[...f[7]||(f[7]=[n.createTextVNode(" Сохранить ",-1)])]),_:1}),n.createVNode(g,{onClick:f[3]||(f[3]=y=>r("update:show",!1))},{default:n.withCtx(()=>[...f[8]||(f[8]=[n.createTextVNode("Отмена",-1)])]),_:1})])])]),default:n.withCtx(()=>[n.createVNode(p,{class:"max-h-[60vh]"},{default:n.withCtx(()=>[n.createVNode(m,{value:a.value,"onUpdate:value":f[0]||(f[0]=y=>a.value=y)},{default:n.withCtx(()=>[n.createElementVNode("div",wk,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(l),y=>(n.openBlock(),n.createElementBlock("div",{key:y.key,class:"flex flex-col gap-1.5"},[n.createElementVNode("div",xk,n.toDisplayString(y.label),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.sections,_=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:_.key},[_.label?(n.openBlock(),n.createElementBlock("div",kk,n.toDisplayString(_.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.children,k=>(n.openBlock(),n.createBlock(h,{key:k.value,value:k.value,label:k.label},null,8,["value","label"]))),128))],64))),128))]))),128))])]),_:1},8,["value"])]),_:1})]),_:1},8,["show","style"])}}}),$k={class:"flex flex-col gap-2"},Ek={class:"flex items-center gap-2"},Rk={class:"flex gap-2 px-px pb-4 pt-px"},Pk={key:0,class:"text-sm text-gray-500"},Fk={},Vk=n.defineComponent({...Fk,__name:"quick-periods",props:{from:{},to:{}},emits:["apply","preview"],setup(t,{emit:e}){const i=t,r=e,o=H.DateTimeProvider.standardPeriods(),s=()=>{const f=ef,h=H.PreferencesStorageProvider.getActualDataFromStorage(f);return(A.isArray(h)?h:tf).filter(p=>A.isString(p)&&p in o)},l=n.ref(s()),a=n.ref(!1),c=n.computed(()=>Object.entries(o).filter(([f])=>l.value.includes(f)).map(([f,h])=>({value:f,label:h.label,item:h,group:h.group}))),d=n.computed(()=>{const f=i.from?Bi(i.from):null,h=i.to?Bi(i.to):null;if(f===null||h===null)return null;const m=c.value.find(p=>{const{from:g,to:b}=p.item;return!g||!b?!1:Bi(g)===f&&Bi(b)===h});return m?String(m.value):null}),u=f=>{l.value=f;const h=ef;H.PreferencesStorageProvider.saveActualDataToStorage(h,f,ke.addYears(ke.startOfToday(),1))};return(f,h)=>{const m=_k,p=F.NButton,g=gk,b=hk,y=dk,_=lk,k=rk,x=F.NScrollbar;return n.openBlock(),n.createElementBlock("div",$k,[n.createElementVNode("div",Ek,[h[3]||(h[3]=n.createElementVNode("span",{class:"text-sm font-medium text-gray-700"},"Быстрый выбор",-1)),n.createVNode(p,{size:"tiny",quaternary:"",circle:"","aria-label":"Настроить быстрый выбор",onClick:h[0]||(h[0]=v=>a.value=!0)},{icon:n.withCtx(()=>[n.createVNode(m)]),_:1})]),n.createVNode(x,{"x-scrollable":""},{default:n.withCtx(()=>[n.createElementVNode("div",Rk,[c.value.length===0?(n.openBlock(),n.createElementBlock("span",Pk," Периоды не выбраны ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,v=>(n.openBlock(),n.createBlock(p,{key:v.value,type:v.value===d.value?"primary":"default",ghost:v.value===d.value,"theme-overrides":n.unref(Nx),class:"shrink-0",onClick:N=>r("apply",v),onMouseenter:N=>r("preview",v),onMouseleave:h[1]||(h[1]=N=>r("preview"))},{icon:n.withCtx(()=>[v.group==="day"?(n.openBlock(),n.createBlock(g,{key:0})):v.group==="week"||v.group==="decade"?(n.openBlock(),n.createBlock(b,{key:1})):v.group==="quarter"||v.group==="halfYear"?(n.openBlock(),n.createBlock(y,{key:2})):v.group==="other"?(n.openBlock(),n.createBlock(_,{key:3})):(n.openBlock(),n.createBlock(k,{key:4}))]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(v.label),1)]),_:2},1032,["type","ghost","theme-overrides","onClick","onMouseenter"]))),128))])]),_:1}),n.createVNode(Tk,{show:a.value,"onUpdate:show":h[2]||(h[2]=v=>a.value=v),"selected-keys":l.value,onSave:u},null,8,["show","selected-keys"])])}}}),Mk={class:"flex flex-col items-stretch gap-3 sm:flex-row"},Ik={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},Ak={class:"flex flex-col items-stretch pr-3"},Ok={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},zk={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},Dk={},Lk=n.defineComponent({...Dk,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const i=t,r=e,o="custom",s=Ye.initRefDependingOnDeviceResolution(!0,!1,!1),l=H.DateTimeProvider.standardPeriods(),a=n.ref(H.STANDARD_PERIOD_GROUPS[0].key),c=n.computed(()=>{const u=H.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return A.isEmpty(i.customPeriods)||u.push({key:o,value:o,label:"Пользовательские"}),u}),d=n.computed(()=>a.value===o?[{type:"group",key:o,children:Tl(i.customPeriods??{})}]:lf(l,a.value));return(u,f)=>{const h=F.NButton,m=F.NScrollbar,p=F.NSelect,g=F.NMenu;return n.openBlock(),n.createElementBlock("div",Mk,[n.createElementVNode("div",Ik,[n.createVNode(m,{class:"max-h-96"},{default:n.withCtx(()=>[n.createElementVNode("div",Ak,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,b=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:b.key},[b.label?(n.openBlock(),n.createElementBlock("div",Ok,n.toDisplayString(b.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.children,y=>(n.openBlock(),n.createBlock(h,{key:y.value,size:"small",quaternary:"",type:y.value===t.activeKey?"primary":"default",class:"justify-start",onClick:_=>r("apply",y),onMouseenter:_=>r("preview",y),onMouseleave:f[0]||(f[0]=_=>r("preview"))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),n.unref(s)?(n.openBlock(),n.createBlock(p,{key:0,value:a.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=b=>a.value=b)},null,8,["value","options"])):(n.openBlock(),n.createElementBlock("div",zk,[n.createVNode(g,{value:a.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=b=>a.value=b)},null,8,["value","options"])]))])}}}),Hk={class:"flex flex-col gap-3"},Wk={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},jk={key:1,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},qk={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},Xk={class:"flex gap-2"},Yk={},Kk=n.defineComponent({...Yk,__name:"date-range-dialog",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},show:{type:Boolean},dateRange:{default:void 0},customPeriods:{default:void 0},dateFormat:{default:void 0}},emits:["update:show","select"],setup(t,{emit:e}){const i=t,r=e,o=Ye.initRefDependingOnDeviceResolution("100%","90%","48rem"),s=n.ref("custom"),l=n.ref("months"),a=n.computed(()=>l.value==="months"?"Показать по дням":"Показать по месяцам"),c=()=>H.PreferencesStorageProvider.getActualDataFromStorage(Qu)==="standard"?"standard":"custom",d=()=>H.PreferencesStorageProvider.getActualDataFromStorage(Ju)==="days"?"days":"months",u=(C,$)=>{H.PreferencesStorageProvider.saveActualDataToStorage(C,$,ke.addYears(ke.startOfToday(),1))},f=n.ref({}),h=n.ref(null),m=n.ref(null),p=n.computed(()=>h.value??f.value),g=(C,$)=>{var P,I;const E=(P=i.disabled)!=null&&P.from?f.value.from:C,V=(I=i.disabled)!=null&&I.to?f.value.to:$;h.value=null,f.value=sf(E,V,i.disabled)},b=C=>{m.value=null,g(C,f.value.to)},y=C=>{m.value=null,g(f.value.from,C)},_=()=>{m.value=null,g(null,null)},k=C=>{m.value=null,g(C.from,C.to)},x=C=>{const $=C.item;g($.from,$.to),m.value=String(C.value)},v=C=>{const $=C==null?void 0:C.item;h.value=$?{from:$.from,to:$.to}:null},N=()=>{h.value=null,s.value=s.value==="custom"?"standard":"custom",u(Qu,s.value)},w=()=>{l.value=l.value==="months"?"days":"months",u(Ju,l.value)},T=()=>{r("select",f.value),r("update:show",!1)};return n.watch(()=>i.show,C=>{C&&(s.value=c(),l.value=d(),m.value=null,h.value=null,f.value={...i.dateRange})}),(C,$)=>{const E=F.NButton,V=kx,P=_x,I=F.NTooltip,U=F.NModal;return n.openBlock(),n.createBlock(U,{show:t.show,preset:"card",title:"Выберите период",closable:"",style:n.normalizeStyle({width:n.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":$[1]||($[1]=J=>r("update:show",J))},{footer:n.withCtx(()=>[n.createElementVNode("div",qk,[n.createVNode(E,{text:"",type:"info",onClick:N},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),n.createElementVNode("div",Xk,[n.createVNode(E,{type:"primary",onClick:T},{default:n.withCtx(()=>[...$[3]||($[3]=[n.createTextVNode(" Выбрать ",-1)])]),_:1}),n.createVNode(E,{onClick:$[0]||($[0]=J=>r("update:show",!1))},{default:n.withCtx(()=>[...$[4]||($[4]=[n.createTextVNode("Отмена",-1)])]),_:1})])])]),default:n.withCtx(()=>[n.createElementVNode("div",Hk,[s.value==="custom"?(n.openBlock(),n.createBlock(Vk,{key:0,from:f.value.from,to:f.value.to,onApply:x,onPreview:v},null,8,["from","to"])):n.createCommentVNode("",!0),n.createElementVNode("div",Wk,[n.createVNode(df,{from:p.value.from,to:p.value.to,clearable:t.clearable,disabled:t.disabled,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":b,"onUpdate:to":y},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(n.openBlock(),n.createBlock(E,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:_},{default:n.withCtx(()=>[...$[2]||($[2]=[n.createTextVNode(" Очистить период ",-1)])]),_:1})):n.createCommentVNode("",!0)]),s.value==="custom"?(n.openBlock(),n.createElementBlock("div",jk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value==="months"?Xx:Ox),{from:f.value.from,to:f.value.to,onSelect:k},{actions:n.withCtx(()=>[n.createVNode(I,{placement:"top",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(E,{size:"small","aria-label":a.value,"theme-overrides":n.unref(Ir),onClick:w},{icon:n.withCtx(()=>[l.value==="months"?(n.openBlock(),n.createBlock(V,{key:0})):(n.openBlock(),n.createBlock(P,{key:1}))]),_:1},8,["aria-label","theme-overrides"])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(a.value),1)]),_:1})]),_:1},40,["from","to"]))])):(n.openBlock(),n.createBlock(Lk,{key:2,"active-key":m.value,"custom-periods":t.customPeriods,onApply:x,onPreview:v},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),Uk={class:"flex w-full min-w-0 items-center gap-1"},Gk={},Zk=n.defineComponent({...Gk,__name:"date-range",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},dateRange:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:date-range"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(!1),s=n.computed(()=>{const u={...i.useDefaultPredefinedDateRanges?H.DateTimeProvider.defaultDateRanges():{},...i.predefinedDateRanges};return A.isEmpty(u)?void 0:u}),l=(u,f)=>{r("update:date-range",sf(u,f,i.disabled))},a=u=>{var f;l(u,(f=i.dateRange)==null?void 0:f.to)},c=u=>{var f;l((f=i.dateRange)==null?void 0:f.from,u)},d=u=>{l(u.from,u.to)};return(u,f)=>{var p,g,b,y;const h=gx,m=F.NButton;return n.openBlock(),n.createElementBlock("div",Uk,[n.createVNode(df,{from:(p=t.dateRange)==null?void 0:p.from,to:(g=t.dateRange)==null?void 0:g.to,clearable:t.clearable,disabled:t.disabled,"placeholder-from":t.placeholderFrom,"placeholder-to":t.placeholderTo,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:from":a,"onUpdate:to":c},null,8,["from","to","clearable","disabled","placeholder-from","placeholder-to","date-format"]),n.createVNode(m,{disabled:!!((b=t.disabled)!=null&&b.from&&((y=t.disabled)!=null&&y.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:f[0]||(f[0]=_=>o.value=!0)},{default:n.withCtx(()=>[n.createVNode(h)]),_:1},8,["disabled"]),n.createVNode(Kk,{show:o.value,"onUpdate:show":f[1]||(f[1]=_=>o.value=_),"date-range":t.dateRange,clearable:t.clearable,disabled:t.disabled,"custom-periods":s.value,"date-format":t.dateFormat,onSelect:d},null,8,["show","date-range","clearable","disabled","custom-periods","date-format"])])}}}),Qk={class:"sc-lbl-date text-nowrap"},Jk={},Ko=n.defineComponent({...Jk,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,i=n.computed(()=>ke.format(e.date,H.useBaseConfigStateStore().config.dateFormats.uiDate)),r=n.computed(()=>ke.format(e.date,"HH:mm"));return(o,s)=>(n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[n.createElementVNode("span",Qk,n.toDisplayString(i.value),1),t.isShowTime?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},n.toDisplayString(r.value),3)):n.createCommentVNode("",!0)],2))}}),e2={},t2=n.defineComponent({...e2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,i=n.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass({"text-sm":t.wrapAsSmall})},[n.createTextVNode(n.toDisplayString(i.value)+" ",1),n.createElementVNode("span",{class:n.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},n.toDisplayString(t.debt)+" ₽ ",3)],2)):n.createCommentVNode("",!0)}}),n2={class:"flex flex-row gap-2.5"},i2={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},r2={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},o2={class:"mb-0.5 sm:mb-0 sm:ml-3"},s2={},l2=n.defineComponent({...s2,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,i)=>{const r=Yo,o=F.NButton,s=F.NPopover;return n.openBlock(),n.createElementBlock("div",n2,[n.createElementVNode("div",i2,[n.renderSlot(e.$slots,"main")]),n.createElementVNode("div",null,[n.createElementVNode("div",r2,[n.renderSlot(e.$slots,"extra-buttons"),n.createElementVNode("div",o2,[t.showCloseButton?(n.openBlock(),n.createBlock(s,{key:0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(o,{size:"small",type:"error",onClick:i[0]||(i[0]=l=>e.$emit("close"))},{default:n.withCtx(()=>[n.createVNode(r)]),_:1})]),default:n.withCtx(()=>[i[1]||(i[1]=n.createTextVNode(" Закрыть ",-1))]),_:1})):n.createCommentVNode("",!0)])])])])}}}),a2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function c2(t,e){return n.openBlock(),n.createElementBlock("svg",a2,[...e[0]||(e[0]=[n.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 d2=n.markRaw({name:"ion-checkmark-done-sharp",render:c2}),u2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function f2(t,e){return n.openBlock(),n.createElementBlock("svg",u2,[...e[0]||(e[0]=[n.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),n.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),n.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const h2=n.markRaw({name:"ion-options-outline",render:f2}),m2={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},p2={class:"flex-auto"},g2={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"},y2={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"},b2={},$l=n.defineComponent({...b2,__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 i=e,r=n.ref(!1),o=()=>{i("edit")},s=()=>{r.value=!1},l=()=>{r.value=!0,i("apply",s)},a=()=>{i("cancel",s)};return(c,d)=>{const u=h2,f=F.NButton,h=F.NPopover,m=d2,p=Yo;return n.openBlock(),n.createElementBlock("div",m2,[n.createElementVNode("div",p2,[n.renderSlot(c.$slots,"default")]),n.createElementVNode("div",null,[n.createElementVNode("div",g2,[n.createElementVNode("div",y2,[t.showEditButton?(n.openBlock(),n.createBlock(h,{key:0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(f,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:o},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["disabled"])]),default:n.withCtx(()=>[d[0]||(d[0]=n.createTextVNode(" Редактировать данные ",-1))]),_:1})):n.createCommentVNode("",!0),t.showApplyButton?(n.openBlock(),n.createBlock(h,{key:1,disabled:r.value,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(f,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:l},{default:n.withCtx(()=>[n.createVNode(m)]),_:1},8,["disabled"])]),default:n.withCtx(()=>[d[1]||(d[1]=n.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),t.showCancelButton?(n.openBlock(),n.createBlock(h,{key:2,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(f,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:a},{default:n.withCtx(()=>[n.createVNode(p)]),_:1},8,["disabled"])]),default:n.withCtx(()=>[d[2]||(d[2]=n.createTextVNode(" Отменить изменения ",-1))]),_:1})):n.createCommentVNode("",!0)]),n.renderSlot(c.$slots,"extra-buttons")])])])}}}),_2={},uf=n.defineComponent({..._2,__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 i=t,r=e,o=n.ref(i.showEditor),s=a=>{r("editor:apply",d=>{o.value=!d,a()})},l=a=>{o.value=!1,a(),r("editor:cancel")};return n.onMounted(()=>{n.watch(()=>i.showEditor,a=>{o.value=a})}),(a,c)=>(n.openBlock(),n.createElementBlock("div",null,[o.value?(n.openBlock(),n.createBlock($l,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,onCancel:l},{"extra-buttons":n.withCtx(()=>[n.renderSlot(a.$slots,"extra-editor-buttons")]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"editor")]),_:3},8,["disabled"])):(n.openBlock(),n.createBlock($l,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>o.value=!0)},{"extra-buttons":n.withCtx(()=>[n.renderSlot(a.$slots,"extra-viewer-buttons")]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),w2={key:0,class:"whitespace-pre-line"},x2={key:1,class:"text-sc-dark-grey"},k2={},C2=n.defineComponent({...k2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(i.comment);n.watch(()=>o.value,a=>{o.value=a});const s=a=>{r("update:comment",o.value,a)},l=()=>{o.value=i.comment};return(a,c)=>{const d=F.NInput;return n.openBlock(),n.createBlock(uf,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":l},{viewer:n.withCtx(()=>[n.createElementVNode("div",null,[t.comment?(n.openBlock(),n.createElementBlock("span",w2,n.toDisplayString(t.comment),1)):(n.openBlock(),n.createElementBlock("span",x2," - Комментарий отсутствует - "))])]),editor:n.withCtx(()=>[n.createVNode(d,{value:o.value,"onUpdate:value":c[0]||(c[0]=u=>o.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),v2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function S2(t,e){return n.openBlock(),n.createElementBlock("svg",v2,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const B2=n.markRaw({name:"ion-download-outline",render:S2}),N2={},T2=n.defineComponent({...N2,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const i=t,r=e,o=n.ref([]),s=n.computed(()=>o.value.map(a=>(a.status=i.isError?"error":"finished",a))),l=a=>{o.value=a;const c={name:"",content:""};if(a.length===0){r("update:file",null);return}const d=a[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(a,c)=>{const d=B2;return n.openBlock(),n.createBlock(n.unref(F.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":l},{default:n.withCtx(()=>[n.createVNode(n.unref(F.NUploadDragger),null,{default:n.withCtx(()=>[n.renderSlot(a.$slots,"dragged-area",{},()=>[n.createElementVNode("div",null,[n.createVNode(d,{class:"text-2xl"}),n.createElementVNode("div",null,n.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),$2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function E2(t,e){return n.openBlock(),n.createElementBlock("svg",$2,[...e[0]||(e[0]=[n.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 R2=n.markRaw({name:"ion-warning",render:E2}),P2={},F2=n.defineComponent({...P2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,i)=>{const r=R2,o=F.NPopover;return n.openBlock(),n.createBlock(o,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(r,{class:n.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),V2={},M2=n.defineComponent({...V2,__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 i=t,r=e,o=n.ref(i.value),s=n.computed(()=>n.inject("debounce-input-time",i.debounceTime)),l=A.debounce(()=>r("update:value",o.value),s.value),a=c=>{o.value=c,l()};return n.watch(()=>i.value,c=>{o.value=c}),(c,d)=>(n.openBlock(),n.createBlock(n.unref(F.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),a],clearable:t.clearable,placeholder:t.placeholder},{prefix:n.withCtx(()=>[n.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),I2={},A2=n.defineComponent({...I2,__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:i}){const r=t,o=i,s=n.ref(r.value),l=n.computed(()=>n.inject("debounce-input-time",r.debounceTime)),a=A.debounce(()=>o("update:value",s.value),l.value),c=m=>{s.value=m,a()};n.watch(()=>r.value,m=>{s.value=m});const d=n.ref(null);return e({focus:()=>{var m;return(m=d.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=d.value)==null?void 0:m.blur()},select:()=>{var m;return(m=d.value)==null?void 0:m.select()}}),(m,p)=>(n.openBlock(),n.createBlock(n.unref(F.NInputNumber),{ref_key:"inputReference",ref:d,value:s.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:p[0]||(p[0]=g=>o("keydown",g)),onInput:p[1]||(p[1]=g=>o("input",g)),onFocus:p[2]||(p[2]=g=>o("focus",g))},{prefix:n.withCtx(()=>[n.renderSlot(m.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),O2={},z2=n.defineComponent({...O2,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=n.ref((i.value??"").replaceAll(/\D*/g,"")),s=A.debounce(c=>r("update:value",c),i.debounceTime??0),l=c=>{let d="";if(A.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(A.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof xr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}i.debounceTime?s(d):r("update:value",d)},a=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=xr.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof xr.ParseError)o.value=d;else throw u}};return n.watch(()=>i.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=o.value)==null?void 0:d.replaceAll(/\D*/g,""))&&a(c)},{immediate:!0}),n.onBeforeMount(()=>a(o.value??"")),(c,d)=>(n.openBlock(),n.createBlock(n.unref(wm.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),l],"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"]))}}),D2=cn(z2,[["__scopeId","data-v-751dbb0e"]]),L2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H2(t,e){return n.openBlock(),n.createElementBlock("svg",L2,[...e[0]||(e[0]=[n.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 W2=n.markRaw({name:"tabler-external-link",render:H2}),j2={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},q2=["href"],X2={},Y2=n.defineComponent({...X2,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,i)=>{const r=W2,o=F.NTooltip;return n.openBlock(),n.createBlock(o,{disabled:n.unref(A.isUndefined)(t.description),placement:"top-start"},{trigger:n.withCtx(()=>[n.createElementVNode("span",j2,[n.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},n.toDisplayString(t.text),9,q2),n.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),K2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function U2(t,e){return n.openBlock(),n.createElementBlock("svg",K2,[...e[0]||(e[0]=[n.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),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const G2=n.markRaw({name:"ion-remove-circle-outline",render:U2});let Uo=[];const ff=new WeakMap;function Z2(){Uo.forEach(t=>t(...ff.get(t))),Uo=[]}function hf(t,...e){ff.set(t,e),!Uo.includes(t)&&Uo.push(t)===1&&requestAnimationFrame(Z2)}function Ar(t,e){let{target:i}=t;for(;i;){if(i.dataset&&i.dataset[e]!==void 0)return!0;i=i.parentElement}return!1}function Or(t){return t.composedPath()[0]||null}function zr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Dr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function mn(t,e){const i=t.trim().split(/\s+/g),r={top:i[0]};switch(i.length){case 1:r.right=i[0],r.bottom=i[0],r.left=i[0];break;case 2:r.right=i[1],r.left=i[1],r.bottom=i[0];break;case 3:r.right=i[1],r.bottom=i[2],r.left=i[1];break;case 4:r.right=i[1],r.bottom=i[2],r.left=i[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const mf={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 Q2(t,e,i){e/=100,i/=100;let r=(o,s=(o+t/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function J2(t,e,i){e/=100,i/=100;let r=e*Math.min(i,1-i),o=(s,l=(s+t/30)%12)=>i-r*Math.max(Math.min(l-3,9-l,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const En="^\\s*",Rn="\\s*$",ai="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Gt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Ni="([0-9A-Fa-f])",Ti="([0-9A-Fa-f]{2})",pf=new RegExp(`${En}hsl\\s*\\(${Gt},${ai},${ai}\\)${Rn}`),gf=new RegExp(`${En}hsv\\s*\\(${Gt},${ai},${ai}\\)${Rn}`),yf=new RegExp(`${En}hsla\\s*\\(${Gt},${ai},${ai},${Gt}\\)${Rn}`),bf=new RegExp(`${En}hsva\\s*\\(${Gt},${ai},${ai},${Gt}\\)${Rn}`),eC=new RegExp(`${En}rgb\\s*\\(${Gt},${Gt},${Gt}\\)${Rn}`),tC=new RegExp(`${En}rgba\\s*\\(${Gt},${Gt},${Gt},${Gt}\\)${Rn}`),nC=new RegExp(`${En}#${Ni}${Ni}${Ni}${Rn}`),iC=new RegExp(`${En}#${Ti}${Ti}${Ti}${Rn}`),rC=new RegExp(`${En}#${Ni}${Ni}${Ni}${Ni}${Rn}`),oC=new RegExp(`${En}#${Ti}${Ti}${Ti}${Ti}${Rn}`);function Xt(t){return parseInt(t,16)}function sC(t){try{let e;if(e=yf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),Ei(e[13])];if(e=pf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function lC(t){try{let e;if(e=bf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),Ei(e[13])];if(e=gf.exec(t))return[Zo(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function $i(t){try{let e;if(e=iC.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),1];if(e=eC.exec(t))return[St(e[1]),St(e[5]),St(e[9]),1];if(e=tC.exec(t))return[St(e[1]),St(e[5]),St(e[9]),Ei(e[13])];if(e=nC.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),1];if(e=oC.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),Ei(Xt(e[4])/255)];if(e=rC.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),Ei(Xt(e[4]+e[4])/255)];if(t in mf)return $i(mf[t]);if(pf.test(t)||yf.test(t)){const[i,r,o,s]=sC(t);return[...J2(i,r,o),s]}else if(gf.test(t)||bf.test(t)){const[i,r,o,s]=lC(t);return[...Q2(i,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function aC(t){return t>1?1:t<0?0:t}function El(t,e,i,r){return`rgba(${St(t)}, ${St(e)}, ${St(i)}, ${aC(r)})`}function Rl(t,e,i,r,o){return St((t*e*(1-r)+i*r)/o)}function cC(t,e){Array.isArray(t)||(t=$i(t)),Array.isArray(e)||(e=$i(e));const i=t[3],r=e[3],o=Ei(i+r-i*r);return El(Rl(t[0],i,e[0],r,o),Rl(t[1],i,e[1],r,o),Rl(t[2],i,e[2],r,o),o)}function Le(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:$i(t);return typeof e.alpha=="number"?El(i,r,o,e.alpha):El(i,r,o,s)}function Go(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:$i(t),{lightness:l=1,alpha:a=1}=e;return dC([i*l,r*l,o*l,s*a])}function Ei(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function Zo(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function St(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function ci(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function dC(t){const[e,i,r]=t;return 3 in t?`rgba(${St(e)}, ${St(i)}, ${St(r)}, ${Ei(t[3])})`:`rgba(${St(e)}, ${St(i)}, ${St(r)}, 1)`}function uC(t=8){return Math.random().toString(16).slice(2,2+t)}function _f(t){return Array.isArray(t)?t:[t]}const Pl={STOP:"STOP"};function wf(t,e){const i=e(t);t.children!==void 0&&i!==Pl.STOP&&t.children.forEach(r=>wf(r,e))}function fC(t,e={}){const{preserveGroup:i=!1}=e,r=[],o=i?l=>{l.isLeaf||(r.push(l.key),s(l.children))}:l=>{l.isLeaf||(l.isGroup||r.push(l.key),s(l.children))};function s(l){l.forEach(o)}return s(t),r}function hC(t,e){const{isLeaf:i}=t;return i!==void 0?i:!e(t)}function mC(t){return t.children}function pC(t){return t.key}function gC(){return!1}function yC(t,e){const{isLeaf:i}=t;return!(i===!1&&!Array.isArray(e(t)))}function bC(t){return t.disabled===!0}function _C(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function wC(t,e){if(t.isLeaf===!0){const i=e(t);if(Array.isArray(i)&&i.length>0)return!0}return!1}function Fl(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Vl(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function xC(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)||i.add(r)}),Array.from(i)}function kC(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)&&i.delete(r)}),Array.from(i)}function CC(t){return(t==null?void 0:t.type)==="group"}function vC(t){const e=new Map;return t.forEach((i,r)=>{e.set(i.key,r)}),i=>{var r;return(r=e.get(i))!==null&&r!==void 0?r:null}}class SC extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function BC(t,e,i,r){return Qo(e.concat(t),i,r,!1)}function NC(t,e){const i=new Set;return t.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let s=o.parent;for(;s!==null&&!(s.disabled||i.has(s.key));)i.add(s.key),s=s.parent}}),i}function TC(t,e,i,r){const o=Qo(e,i,r,!1),s=Qo(t,i,r,!0),l=NC(t,i),a=[];return o.forEach(c=>{(s.has(c)||l.has(c))&&a.push(c)}),a.forEach(c=>o.delete(c)),o}function Ml(t,e){const{checkedKeys:i,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:l,leafOnly:a,checkStrategy:c,allowNotLoaded:d}=t;if(!l)return r!==void 0?{checkedKeys:xC(i,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:kC(i,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(i),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let f;o!==void 0?f=TC(o,i,e,d):r!==void 0?f=BC(r,i,e,d):f=Qo(i,e,d,!1);const h=c==="parent",m=c==="child"||a,p=f,g=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,k=u.get(y);for(const x of k){if(x.isLeaf)continue;const{key:v,shallowLoaded:N}=x;if(m&&N&&x.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&p.has($.key)&&p.delete($.key)}),x.disabled||!N)continue;let w=!0,T=!1,C=!0;for(const $ of x.children){const E=$.key;if(!$.disabled){if(C&&(C=!1),p.has(E))T=!0;else if(g.has(E)){T=!0,w=!1;break}else if(w=!1,T)break}}w&&!C?(h&&x.children.forEach($=>{!$.disabled&&p.has($.key)&&p.delete($.key)}),p.add(v)):T&&g.add(v),_&&m&&p.has(v)&&p.delete(v)}}return{checkedKeys:Array.from(p),indeterminateKeys:Array.from(g)}}function Qo(t,e,i,r){const{treeNodeMap:o,getChildren:s}=e,l=new Set,a=new Set(t);return t.forEach(c=>{const d=o.get(c);d!==void 0&&wf(d,u=>{if(u.disabled)return Pl.STOP;const{key:f}=u;if(!l.has(f)&&(l.add(f),a.add(f),_C(u.rawNode,s))){if(r)return Pl.STOP;if(!i)throw new SC}})}),a}function $C(t,{includeGroup:e=!1,includeSelf:i=!0},r){var o;const s=r.treeNodeMap;let l=t==null?null:(o=s.get(t))!==null&&o!==void 0?o:null;const a={keyPath:[],treeNodePath:[],treeNode:l};if(l!=null&&l.ignored)return a.treeNode=null,a;for(;l;)!l.ignored&&(e||!l.isGroup)&&a.treeNodePath.push(l),l=l.parent;return a.treeNodePath.reverse(),i||a.treeNodePath.pop(),a.keyPath=a.treeNodePath.map(c=>c.key),a}function EC(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function RC(t,e){const i=t.siblings,r=i.length,{index:o}=t;return e?i[(o+1)%r]:o===i.length-1?null:i[o+1]}function xf(t,e,{loop:i=!1,includeDisabled:r=!1}={}){const o=e==="prev"?PC:RC,s={reverse:e==="prev"};let l=!1,a=null;function c(d){if(d!==null){if(d===t){if(!l)l=!0;else if(!t.disabled&&!t.isGroup){a=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){a=d;return}if(d.isGroup){const u=Il(d,s);u!==null?a=u:c(o(d,i))}else{const u=o(d,!1);if(u!==null)c(u);else{const f=FC(d);f!=null&&f.isGroup?c(o(f,i)):i&&c(o(d,!0))}}}}return c(t),a}function PC(t,e){const i=t.siblings,r=i.length,{index:o}=t;return e?i[(o-1+r)%r]:o===0?null:i[o-1]}function FC(t){return t.parent}function Il(t,e={}){const{reverse:i=!1}=e,{children:r}=t;if(r){const{length:o}=r,s=i?o-1:0,l=i?-1:o,a=i?-1:1;for(let c=s;c!==l;c+=a){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Il(d,e);if(u!==null)return u}else return d}}return null}const VC={getChild(){return this.ignored?null:Il(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return xf(this,"next",t)},getPrev(t={}){return xf(this,"prev",t)}};function MC(t,e){const i=e?new Set(e):void 0,r=[];function o(s){s.forEach(l=>{r.push(l),!(l.isLeaf||!l.children||l.ignored)&&(l.isGroup||i===void 0||i.has(l.key))&&o(l.children)})}return o(t),r}function IC(t,e){const i=t.key;for(;e;){if(e.key===i)return!0;e=e.parent}return!1}var AC={};function kf(t,e,i,r,o,s=null,l=0){const a=[];return t.forEach((c,d)=>{var u;AC.NODE_ENV!=="production"&&wC(c,o)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=a,f.level=l,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===t.length,f.parent=s,!f.ignored){const h=o(c);Array.isArray(h)&&(f.children=kf(h,e,i,r,o,f,l+1))}a.push(f),e.set(f.key,f),i.has(l)||i.set(l,[]),(u=i.get(l))===null||u===void 0||u.push(f)}),a}function OC(t,e={}){var i;const r=new Map,o=new Map,{getDisabled:s=bC,getIgnored:l=gC,getIsGroup:a=CC,getKey:c=pC}=e,d=(i=e.getChildren)!==null&&i!==void 0?i:mC,u=e.ignoreEmptyChildren?x=>{const v=d(x);return Array.isArray(v)?v.length?v:null:v}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return a(this.rawNode)},get isLeaf(){return hC(this.rawNode,u)},get shallowLoaded(){return yC(this.rawNode,u)},get ignored(){return l(this.rawNode)},contains(x){return IC(this,x)}},VC),h=kf(t,r,o,f,u);function m(x){if(x==null)return null;const v=r.get(x);return v&&!v.isGroup&&!v.ignored?v:null}function p(x){if(x==null)return null;const v=r.get(x);return v&&!v.ignored?v:null}function g(x,v){const N=p(x);return N?N.getPrev(v):null}function b(x,v){const N=p(x);return N?N.getNext(v):null}function y(x){const v=p(x);return v?v.getParent():null}function _(x){const v=p(x);return v?v.getChild():null}const k={treeNodes:h,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return MC(h,x)},getNode:m,getPrev:g,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return EC(h)},getPath(x,v={}){return $C(x,v,k)},getCheckedKeys(x,v={}){const{cascade:N=!0,leafOnly:w=!1,checkStrategy:T="all",allowNotLoaded:C=!1}=v;return Ml({checkedKeys:Fl(x),indeterminateKeys:Vl(x),cascade:N,leafOnly:w,checkStrategy:T,allowNotLoaded:C},k)},check(x,v,N={}){const{cascade:w=!0,leafOnly:T=!1,checkStrategy:C="all",allowNotLoaded:$=!1}=N;return Ml({checkedKeys:Fl(v),indeterminateKeys:Vl(v),keysToCheck:x==null?[]:_f(x),cascade:w,leafOnly:T,checkStrategy:C,allowNotLoaded:$},k)},uncheck(x,v,N={}){const{cascade:w=!0,leafOnly:T=!1,checkStrategy:C="all",allowNotLoaded:$=!1}=N;return Ml({checkedKeys:Fl(v),indeterminateKeys:Vl(v),keysToUncheck:x==null?[]:_f(x),cascade:w,leafOnly:T,checkStrategy:C,allowNotLoaded:$},k)},getNonLeafKeys(x={}){return fC(h,x)}};return k}function Jo(t){return t.composedPath()[0]}const zC={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function DC(t,e,i){if(t==="mousemoveoutside"){const r=o=>{e.contains(Jo(o))||i(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=l=>{r=!e.contains(Jo(l))},s=l=>{r&&(e.contains(Jo(l))||i(l))};return{mousedown:o,mouseup:s,touchstart:o,touchend:s}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Cf(t,e,i){const r=zC[t];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let s=o.get(i);return s===void 0&&o.set(i,s=DC(t,e,i)),s}function LC(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=Cf(t,e,i);return Object.keys(o).forEach(s=>{It(s,document,o[s],r)}),!0}return!1}function HC(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=Cf(t,e,i);return Object.keys(o).forEach(s=>{ht(s,document,o[s],r)}),!0}return!1}function WC(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function i(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function o(w,T,C){const $=w[T];return w[T]=function(){return C.apply(w,arguments),$.apply(w,arguments)},w}function s(w,T){w[T]=Event.prototype[T]}const l=new WeakMap,a=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=l.get(this))!==null&&w!==void 0?w:null}function d(w,T){a!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:T??a.get})}const u={bubble:{},capture:{}},f={};function h(){const w=function(T){const{type:C,eventPhase:$,bubbles:E}=T,V=Jo(T);if($===2)return;const P=$===1?"capture":"bubble";let I=V;const U=[];for(;I===null&&(I=window),U.push(I),I!==window;)I=I.parentNode||null;const J=u.capture[C],Z=u.bubble[C];if(o(T,"stopPropagation",i),o(T,"stopImmediatePropagation",r),d(T,c),P==="capture"){if(J===void 0)return;for(let L=U.length-1;L>=0&&!t.has(T);--L){const O=U[L],z=J.get(O);if(z!==void 0){l.set(T,O);for(const M of z){if(e.has(T))break;M(T)}}if(L===0&&!E&&Z!==void 0){const M=Z.get(O);if(M!==void 0)for(const R of M){if(e.has(T))break;R(T)}}}}else if(P==="bubble"){if(Z===void 0)return;for(let L=0;L<U.length&&!t.has(T);++L){const O=U[L],z=Z.get(O);if(z!==void 0){l.set(T,O);for(const M of z){if(e.has(T))break;M(T)}}}}s(T,"stopPropagation"),s(T,"stopImmediatePropagation"),d(T)};return w.displayName="evtdUnifiedHandler",w}function m(){const w=function(T){const{type:C,eventPhase:$}=T;if($!==2)return;const E=f[C];E!==void 0&&E.forEach(V=>V(T))};return w.displayName="evtdUnifiedWindowEventHandler",w}const p=h(),g=m();function b(w,T){const C=u[w];return C[T]===void 0&&(C[T]=new Map,window.addEventListener(T,p,w==="capture")),C[T]}function y(w){return f[w]===void 0&&(f[w]=new Set,window.addEventListener(w,g)),f[w]}function _(w,T){let C=w.get(T);return C===void 0&&w.set(T,C=new Set),C}function k(w,T,C,$){const E=u[T][C];if(E!==void 0){const V=E.get(w);if(V!==void 0&&V.has($))return!0}return!1}function x(w,T){const C=f[w];return!!(C!==void 0&&C.has(T))}function v(w,T,C,$){let E;if(typeof $=="object"&&$.once===!0?E=J=>{N(w,T,E,$),C(J)}:E=C,LC(w,T,E,$))return;const P=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",I=b(P,w),U=_(I,T);if(U.has(E)||U.add(E),T===window){const J=y(w);J.has(E)||J.add(E)}}function N(w,T,C,$){if(HC(w,T,C,$))return;const V=$===!0||typeof $=="object"&&$.capture===!0,P=V?"capture":"bubble",I=b(P,w),U=_(I,T);if(T===window&&!k(T,V?"bubble":"capture",w,C)&&x(w,C)){const Z=f[w];Z.delete(C),Z.size===0&&(window.removeEventListener(w,g),f[w]=void 0)}U.has(C)&&U.delete(C),U.size===0&&I.delete(T),I.size===0&&(window.removeEventListener(w,p,P==="capture"),u[P][w]=void 0)}return{on:v,off:N}}const{on:It,off:ht}=WC(),ur="@@mmoContext",jC={mounted(t,{value:e}){t[ur]={handler:void 0},typeof e=="function"&&(t[ur].handler=e,It("mousemoveoutside",t,e))},updated(t,{value:e}){const i=t[ur];typeof e=="function"?i.handler?i.handler!==e&&(ht("mousemoveoutside",t,i.handler),i.handler=e,It("mousemoveoutside",t,e)):(t[ur].handler=e,It("mousemoveoutside",t,e)):i.handler&&(ht("mousemoveoutside",t,i.handler),i.handler=void 0)},unmounted(t){const{handler:e}=t[ur];e&&ht("mousemoveoutside",t,e),t[ur].handler=void 0}},fr="@@coContext",es={mounted(t,{value:e,modifiers:i}){t[fr]={handler:void 0},typeof e=="function"&&(t[fr].handler=e,It("clickoutside",t,e,{capture:i.capture}))},updated(t,{value:e,modifiers:i}){const r=t[fr];typeof e=="function"?r.handler?r.handler!==e&&(ht("clickoutside",t,r.handler,{capture:i.capture}),r.handler=e,It("clickoutside",t,e,{capture:i.capture})):(t[fr].handler=e,It("clickoutside",t,e,{capture:i.capture})):r.handler&&(ht("clickoutside",t,r.handler,{capture:i.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:i}=t[fr];i&&ht("clickoutside",t,i,{capture:e.capture}),t[fr].handler=void 0}};function qC(t,e){console.error(`[vdirs/${t}]: ${e}`)}class XC{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,i){const{elementZIndex:r}=this;if(i!==void 0){e.style.zIndex=`${i}`,r.delete(e);return}const{nextZIndex:o}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${o}`,r.set(e,o),this.nextZIndex=o+1,this.squashState())}unregister(e,i){const{elementZIndex:r}=this;r.has(e)?r.delete(e):i===void 0&&qC("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((i,r)=>i[1]-r[1]),this.nextZIndex=2e3,e.forEach(i=>{const r=i[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Al=new XC,hr="@@ziContext",vf={mounted(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i;t[hr]={enabled:!!o,initialized:!1},o&&(Al.ensureZIndex(t,r),t[hr].initialized=!0)},updated(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i,s=t[hr].enabled;o&&!s&&(Al.ensureZIndex(t,r),t[hr].initialized=!0),t[hr].enabled=!!o},unmounted(t,e){if(!t[hr].initialized)return;const{value:i={}}=e,{zIndex:r}=i;Al.unregister(t,r)}};function YC(t){const e=n.ref(!!t.value);if(e.value)return n.readonly(e);const i=n.watch(t,r=>{r&&(e.value=!0,i())});return n.readonly(e)}function on(t){const e=n.computed(t),i=n.ref(e.value);return n.watch(e,r=>{i.value=r}),typeof t=="function"?i:{__v_isRef:!0,get value(){return i.value},set value(r){t.set(r)}}}const KC=typeof window<"u";let mr,Lr;(()=>{var t,e;mr=KC?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,Lr=!1,mr!==void 0?mr.then(()=>{Lr=!0}):Lr=!0})();function UC(t){if(Lr)return;let e=!1;n.onMounted(()=>{Lr||mr==null||mr.then(()=>{e||t()})}),n.onBeforeUnmount(()=>{e=!0})}function Ol(t,e){return n.watch(t,i=>{i!==void 0&&(e.value=i)}),n.computed(()=>t.value===void 0?e.value:t.value)}function ts(){const t=n.ref(!1);return n.onMounted(()=>{t.value=!0}),n.readonly(t)}function Sf(t,e){return n.computed(()=>{for(const i of e)if(t[i]!==void 0)return t[i];return t[e[e.length-1]]})}const GC=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function ZC(){return GC}function zl(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);return r()}function Dl(t,e=!0,i=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(n.createTextVNode(String(r)));return}if(Array.isArray(r)){Dl(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Dl(r.children,e,i)}else r.type!==n.Comment&&i.push(r)}}),i}function Bf(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);const o=Dl(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${i}] should have exactly one child.`)}let di=null;function Nf(){if(di===null&&(di=document.getElementById("v-binder-view-measurer"),di===null)){di=document.createElement("div"),di.id="v-binder-view-measurer";const{style:t}=di;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(di)}return di.getBoundingClientRect()}function QC(t,e){const i=Nf();return{top:e,left:t,height:0,width:0,right:i.width-t,bottom:i.height-e}}function Ll(t){const e=t.getBoundingClientRect(),i=Nf();return{left:e.left-i.left,top:e.top-i.top,bottom:i.height+i.top-e.bottom,right:i.width+i.left-e.right,width:e.width,height:e.height}}function JC(t){return t.nodeType===9?null:t.parentNode}function Tf(t){if(t===null)return null;const e=JC(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:i,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(i+o+r))return e}return Tf(e)}const $f=n.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;n.provide("VBinder",(e=n.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const i=n.inject("VBinder",null),r=n.ref(null),o=y=>{r.value=y,i&&t.syncTargetWithParent&&i.setTargetRef(y)};let s=[];const l=()=>{let y=r.value;for(;y=Tf(y),y!==null;)s.push(y);for(const _ of s)It("scroll",_,f,!0)},a=()=>{for(const y of s)ht("scroll",y,f,!0);s=[]},c=new Set,d=y=>{c.size===0&&l(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&a()},f=()=>{hf(h)},h=()=>{c.forEach(y=>y())},m=new Set,p=y=>{m.size===0&&It("resize",window,b),m.has(y)||m.add(y)},g=y=>{m.has(y)&&m.delete(y),m.size===0&&ht("resize",window,b)},b=()=>{m.forEach(y=>y())};return n.onBeforeUnmount(()=>{ht("resize",window,b),a()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:p,removeResizeListener:g}},render(){return zl("binder",this.$slots)}}),Ef=n.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=n.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?n.withDirectives(Bf("follower",this.$slots),[[e]]):Bf("follower",this.$slots)}}),ev="@css-render/vue3-ssr";function tv(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
105
|
</style>`}function nv(t,e,i){const{styles:r,ids:o}=i;o.has(t)||r!==null&&(o.add(t),r.push(tv(t,e)))}const iv=typeof document<"u";function Ri(){if(iv)return;const t=n.inject(ev,null);if(t!==null)return{adapter:(e,i)=>nv(e,i,t),context:t}}function Rf(t,e){console.error(`[vueuc/${t}]: ${e}`)}function rv(t){let e=0;for(let i=0;i<t.length;++i)t[i]==="&"&&++e;return e}const Pf=/\s*,(?![^(]*\))\s*/g,ov=/\s+/g;function sv(t,e){const i=[];return e.split(Pf).forEach(r=>{let o=rv(r);if(o){if(o===1){t.forEach(l=>{i.push(r.replace("&",l))});return}}else{t.forEach(l=>{i.push((l&&l+" ")+r)});return}let s=[r];for(;o--;){const l=[];s.forEach(a=>{t.forEach(c=>{l.push(a.replace("&",c))})}),s=l}s.forEach(l=>i.push(l))}),i}function lv(t,e){const i=[];return e.split(Pf).forEach(r=>{t.forEach(o=>{i.push((o&&o+" ")+r)})}),i}function av(t){let e=[""];return t.forEach(i=>{i=i&&i.trim(),i&&(i.includes("&")?e=sv(e,i):e=lv(e,i))}),e.join(", ").replace(ov," ")}function Ff(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function ns(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function cv(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function is(t){return t?/^\s*@(s|m)/.test(t):!1}const dv=/[A-Z]/g;function Vf(t){return t.replace(dv,e=>"-"+e.toLowerCase())}function uv(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(i=>e+` ${Vf(i[0])}: ${i[1]};`).join(`
|
|
@@ -113,7 +113,7 @@ ${o}
|
|
|
113
113
|
`);return}a=Vf(a),c!=null&&l.push(` ${a}${uv(c)}`)}),t&&l.push("}"),l.join(`
|
|
114
114
|
`)}function Hl(t,e,i){t&&t.forEach(r=>{if(Array.isArray(r))Hl(r,e,i);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?Hl(o,e,i):o&&i(o)}else r&&i(r)})}function If(t,e,i,r,o){const s=t.$;let l="";if(!s||typeof s=="string")is(s)?l=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});is(d)?l=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")is(s.$)?l=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});is(d)?l=d:e.push(d)}const a=av(e),c=Mf(a,t.props,r,o);l?i.push(`${l} {`):c.length&&i.push(c),t.children&&Hl(t.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=Mf(a,{raw:d},r,o);i.push(u)}else If(d,e,i,r,o)}),e.pop(),l&&i.push("}"),s&&s.after&&s.after(r.context)}function hv(t,e,i){const r=[];return If(t,[],r,e,i),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function Wl(t){for(var e=0,i,r=0,o=t.length;o>=4;++r,o-=4)i=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,e=(i&65535)*1540483477+((i>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function mv(t,e,i,r){const{els:o}=e;if(i===void 0)o.forEach(Ff),e.els=[];else{const s=ns(i,r);s&&o.includes(s)&&(Ff(s),e.els=o.filter(l=>l!==s))}}function Af(t,e){t.push(e)}function pv(t,e,i,r,o,s,l,a,c){let d;if(i===void 0&&(d=e.render(r),i=Wl(d)),c){c.adapter(i,d??e.render(r));return}a===void 0&&(a=document.head);const u=ns(i,a);if(u!==null&&!s)return u;const f=u??cv(i);if(d===void 0&&(d=e.render(r)),f.textContent=d,u!==null)return u;if(l){const h=a.querySelector(`meta[name="${l}"]`);if(h)return a.insertBefore(f,h),Af(e.els,f),f}return o?a.insertBefore(f,a.querySelector("style, link")):a.appendChild(f),Af(e.els,f),f}function gv(t){return hv(this,this.instance,t)}function yv(t={}){const{id:e,ssr:i,props:r,head:o=!1,force:s=!1,anchorMetaName:l,parent:a}=t;return pv(this.instance,this,e,r,o,s,l,a,i)}function bv(t={}){const{id:e,parent:i}=t;mv(this.instance,this,e,i)}const rs=function(t,e,i,r){return{instance:t,$:e,props:i,children:r,els:[],render:gv,mount:yv,unmount:bv}},_v=function(t,e,i,r){return Array.isArray(e)?rs(t,{$:null},null,e):Array.isArray(i)?rs(t,e,null,i):Array.isArray(r)?rs(t,e,i,r):rs(t,e,i,null)};function Of(t={}){const e={c:((...i)=>_v(e,...i)),use:(i,...r)=>i.install(e,...r),find:ns,context:{},config:t};return e}function wv(t,e){if(t===void 0)return!1;if(e){const{context:{ids:i}}=e;return i.has(t)}return ns(t)!==null}const{c:ui}=Of(),jl="vueuc-style";function zf(t){return t&-t}class Df{constructor(e,i){this.l=e,this.min=i;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,i){if(i===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=i,e+=zf(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:i,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=i[e],e-=zf(e);return s}getBound(e){let i=0,r=this.l;for(;r>i;){const o=Math.floor((i+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(i===o)return this.sum(i+1)<=e?i+1:o;i=o}else return o}return i}}function Lf(t){return typeof t=="string"?document.querySelector(t):t()||null}const xv=n.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:YC(n.toRef(t,"show")),mergedTo:n.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?zl("lazy-teleport",this.$slots):n.h(n.Teleport,{disabled:this.disabled,to:this.mergedTo},zl("lazy-teleport",this.$slots)):null}}),os={top:"bottom",bottom:"top",left:"right",right:"left"},Hf={start:"end",center:"center",end:"start"},ql={top:"height",bottom:"height",left:"width",right:"width"},kv={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},Cv={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},vv={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Wf={top:!0,bottom:!1,left:!0,right:!1},jf={top:"end",bottom:"start",left:"end",right:"start"};function Sv(t,e,i,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[l,a]=t.split("-");let c=a??"center",d={top:0,left:0};const u=(m,p,g)=>{let b=0,y=0;const _=i[m]-e[p]-e[m];return _>0&&r&&(g?y=Wf[p]?_:-_:b=Wf[p]?_:-_),{left:b,top:y}},f=l==="left"||l==="right";if(c!=="center"){const m=vv[t],p=os[m],g=ql[m];if(i[g]>e[g]){if(e[m]+e[g]<i[g]){const b=(i[g]-e[g])/2;e[m]<b||e[p]<b?e[m]<e[p]?(c=Hf[a],d=u(g,p,f)):d=u(g,m,f):c="center"}}else i[g]<e[g]&&e[p]<0&&e[m]>e[p]&&(c=Hf[a])}else{const m=l==="bottom"||l==="top"?"left":"top",p=os[m],g=ql[m],b=(i[g]-e[g])/2;(e[m]<b||e[p]<b)&&(e[m]>e[p]?(c=jf[m],d=u(g,m,f)):(c=jf[p],d=u(g,p,f)))}let h=l;return e[l]<i[ql[l]]&&e[l]<e[os[l]]&&(h=os[l]),{placement:c!=="center"?`${h}-${c}`:h,left:d.left,top:d.top}}function Bv(t,e){return e?Cv[t]:kv[t]}function Nv(t,e,i,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateX(-50%)"}}}const Tv=ui([ui(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),ui(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[ui("> *",{pointerEvents:"all"})])]),qf=n.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=n.inject("VBinder"),i=on(()=>t.enabled!==void 0?t.enabled:t.show),r=n.ref(null),o=n.ref(null),s=()=>{const{syncTrigger:h}=t;h.includes("scroll")&&e.addScrollListener(c),h.includes("resize")&&e.addResizeListener(c)},l=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};n.onMounted(()=>{i.value&&(c(),s())});const a=Ri();Tv.mount({id:"vueuc/binder",head:!0,anchorMetaName:jl,ssr:a}),n.onBeforeUnmount(()=>{l()}),KC(()=>{i.value&&c()});const c=()=>{if(!i.value)return;const h=r.value;if(h===null)return;const m=e.targetRef,{x:p,y:g,overlap:b}=t,y=p!==void 0&&g!==void 0?QC(p,g):Ll(m);h.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),h.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:k,placement:x,internalShift:v,flip:N}=t;h.setAttribute("v-placement",x),b?h.setAttribute("v-overlap",""):h.removeAttribute("v-overlap");const{style:w}=h;_==="target"?w.width=`${y.width}px`:_!==void 0?w.width=_:w.width="",k==="target"?w.minWidth=`${y.width}px`:k!==void 0?w.minWidth=k:w.minWidth="";const T=Ll(h),C=Ll(o.value),{left:$,top:E,placement:V}=Sv(x,y,T,v,N,b),P=Bv(V,b),{left:I,top:K,transform:J}=Nv(V,C,y,E,$,b);h.setAttribute("v-placement",V),h.style.setProperty("--v-offset-left",`${Math.round($)}px`),h.style.setProperty("--v-offset-top",`${Math.round(E)}px`),h.style.transform=`translateX(${I}) translateY(${K}) ${J}`,h.style.setProperty("--v-transform-origin",P),h.style.transformOrigin=P};n.watch(i,h=>{h?(s(),d()):l()});const d=()=>{n.nextTick().then(c).catch(h=>console.error(h))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(h=>{n.watch(n.toRef(t,h),c)}),["teleportDisabled"].forEach(h=>{n.watch(n.toRef(t,h),d)}),n.watch(n.toRef(t,"syncTrigger"),h=>{h.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),h.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=ts(),f=on(()=>{const{to:h}=t;if(h!==void 0)return h;u.value});return{VBinder:e,mergedEnabled:i,offsetContainerRef:o,followerRef:r,mergedTo:f,syncPosition:c}},render(){return n.h(xv,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const i=n.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[n.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?n.withDirectives(i,[[vf,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):i}})}});var Pi=[],$v=function(){return Pi.some(function(t){return t.activeTargets.length>0})},Ev=function(){return Pi.some(function(t){return t.skippedTargets.length>0})},Xf="ResizeObserver loop completed with undelivered notifications.",Rv=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Xf}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Xf),window.dispatchEvent(t)},Hr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Hr||(Hr={}));var Fi=function(t){return Object.freeze(t)},Pv=(function(){function t(e,i){this.inlineSize=e,this.blockSize=i,Fi(this)}return t})(),Yf=(function(){function t(e,i,r,o){return this.x=e,this.y=i,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Fi(this)}return t.prototype.toJSON=function(){var e=this,i=e.x,r=e.y,o=e.top,s=e.right,l=e.bottom,a=e.left,c=e.width,d=e.height;return{x:i,y:r,top:o,right:s,bottom:l,left:a,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),Xl=function(t){return t instanceof SVGElement&&"getBBox"in t},Uf=function(t){if(Xl(t)){var e=t.getBBox(),i=e.width,r=e.height;return!i&&!r}var o=t,s=o.offsetWidth,l=o.offsetHeight;return!(s||l||t.getClientRects().length)},Kf=function(t){var e;if(t instanceof Element)return!0;var i=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(i&&t instanceof i.Element)},Fv=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Wr=typeof window<"u"?window:{},ss=new WeakMap,Gf=/auto|scroll/,Vv=/^tb|vertical/,Mv=/msie|trident/i.test(Wr.navigator&&Wr.navigator.userAgent),Pn=function(t){return parseFloat(t||"0")},pr=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=!1),new Pv((i?e:t)||0,(i?t:e)||0)},Zf=Fi({devicePixelContentBoxSize:pr(),borderBoxSize:pr(),contentBoxSize:pr(),contentRect:new Yf(0,0,0,0)}),Qf=function(t,e){if(e===void 0&&(e=!1),ss.has(t)&&!e)return ss.get(t);if(Uf(t))return ss.set(t,Zf),Zf;var i=getComputedStyle(t),r=Xl(t)&&t.ownerSVGElement&&t.getBBox(),o=!Mv&&i.boxSizing==="border-box",s=Vv.test(i.writingMode||""),l=!r&&Gf.test(i.overflowY||""),a=!r&&Gf.test(i.overflowX||""),c=r?0:Pn(i.paddingTop),d=r?0:Pn(i.paddingRight),u=r?0:Pn(i.paddingBottom),f=r?0:Pn(i.paddingLeft),h=r?0:Pn(i.borderTopWidth),m=r?0:Pn(i.borderRightWidth),p=r?0:Pn(i.borderBottomWidth),g=r?0:Pn(i.borderLeftWidth),b=f+d,y=c+u,_=g+m,k=h+p,x=a?t.offsetHeight-k-t.clientHeight:0,v=l?t.offsetWidth-_-t.clientWidth:0,N=o?b+_:0,w=o?y+k:0,T=r?r.width:Pn(i.width)-N-v,C=r?r.height:Pn(i.height)-w-x,$=T+b+v+_,E=C+y+x+k,V=Fi({devicePixelContentBoxSize:pr(Math.round(T*devicePixelRatio),Math.round(C*devicePixelRatio),s),borderBoxSize:pr($,E,s),contentBoxSize:pr(T,C,s),contentRect:new Yf(f,c,T,C)});return ss.set(t,V),V},Jf=function(t,e,i){var r=Qf(t,i),o=r.borderBoxSize,s=r.contentBoxSize,l=r.devicePixelContentBoxSize;switch(e){case Hr.DEVICE_PIXEL_CONTENT_BOX:return l;case Hr.BORDER_BOX:return o;default:return s}},Iv=(function(){function t(e){var i=Qf(e);this.target=e,this.contentRect=i.contentRect,this.borderBoxSize=Fi([i.borderBoxSize]),this.contentBoxSize=Fi([i.contentBoxSize]),this.devicePixelContentBoxSize=Fi([i.devicePixelContentBoxSize])}return t})(),eh=function(t){if(Uf(t))return 1/0;for(var e=0,i=t.parentNode;i;)e+=1,i=i.parentNode;return e},Av=function(){var t=1/0,e=[];Pi.forEach(function(l){if(l.activeTargets.length!==0){var a=[];l.activeTargets.forEach(function(d){var u=new Iv(d.target),f=eh(d.target);a.push(u),d.lastReportedSize=Jf(d.target,d.observedBox),f<t&&(t=f)}),e.push(function(){l.callback.call(l.observer,a,l.observer)}),l.activeTargets.splice(0,l.activeTargets.length)}});for(var i=0,r=e;i<r.length;i++){var o=r[i];o()}return t},th=function(t){Pi.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(o){o.isActive()&&(eh(o.target)>t?i.activeTargets.push(o):i.skippedTargets.push(o))})})},Ov=function(){var t=0;for(th(t);$v();)t=Av(),th(t);return Ev()&&Rv(),t>0},Yl,nh=[],zv=function(){return nh.splice(0).forEach(function(t){return t()})},Dv=function(t){if(!Yl){var e=0,i=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return zv()}).observe(i,r),Yl=function(){i.textContent="".concat(e?e--:e++)}}nh.push(t),Yl()},Lv=function(t){Dv(function(){requestAnimationFrame(t)})},ls=0,Hv=function(){return!!ls},Wv=250,jv={attributes:!0,characterData:!0,childList:!0,subtree:!0},ih=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rh=function(t){return t===void 0&&(t=0),Date.now()+t},Ul=!1,qv=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var i=this;if(e===void 0&&(e=Wv),!Ul){Ul=!0;var r=rh(e);Lv(function(){var o=!1;try{o=Ov()}finally{if(Ul=!1,e=r-rh(),!Hv())return;o?i.run(1e3):e>0?i.run(e):i.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,i=function(){return e.observer&&e.observer.observe(document.body,jv)};document.body?i():Wr.addEventListener("DOMContentLoaded",i)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ih.forEach(function(i){return Wr.addEventListener(i,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),ih.forEach(function(i){return Wr.removeEventListener(i,e.listener,!0)}),this.stopped=!0)},t})(),Kl=new qv,oh=function(t){!ls&&t>0&&Kl.start(),ls+=t,!ls&&Kl.stop()},Xv=function(t){return!Xl(t)&&!Fv(t)&&getComputedStyle(t).display==="inline"},Yv=(function(){function t(e,i){this.target=e,this.observedBox=i||Hr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Jf(this.target,this.observedBox,!0);return Xv(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Uv=(function(){function t(e,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=i}return t})(),as=new WeakMap,sh=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].target===e)return i;return-1},cs=(function(){function t(){}return t.connect=function(e,i){var r=new Uv(e,i);as.set(e,r)},t.observe=function(e,i,r){var o=as.get(e),s=o.observationTargets.length===0;sh(o.observationTargets,i)<0&&(s&&Pi.push(o),o.observationTargets.push(new Yv(i,r&&r.box)),oh(1),Kl.schedule())},t.unobserve=function(e,i){var r=as.get(e),o=sh(r.observationTargets,i),s=r.observationTargets.length===1;o>=0&&(s&&Pi.splice(Pi.indexOf(r),1),r.observationTargets.splice(o,1),oh(-1))},t.disconnect=function(e){var i=this,r=as.get(e);r.observationTargets.slice().forEach(function(o){return i.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Kv=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cs.connect(this,e)}return t.prototype.observe=function(e,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Kf(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cs.observe(this,e,i)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Kf(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cs.unobserve(this,e)},t.prototype.disconnect=function(){cs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Gv{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Kv)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const i of e){const r=this.elHandlersMap.get(i.target);r!==void 0&&r(i)}}registerHandler(e,i){this.elHandlersMap.set(e,i),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const jr=new Gv,ds=n.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const i=n.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}n.onMounted(()=>{const o=i.$el;if(o===void 0){Rf("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){Rf("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(jr.registerHandler(o.nextElementSibling,r),e=!0)}),n.onBeforeUnmount(()=>{e&&jr.unregisterHandler(i.$el.nextElementSibling)})},render(){return n.renderSlot(this.$slots,"default")}});let us;function Zv(){return typeof document>"u"?!1:(us===void 0&&("matchMedia"in window?us=window.matchMedia("(pointer:coarse)").matches:us=!1),us)}let Gl;function lh(){return typeof document>"u"?1:(Gl===void 0&&(Gl="chrome"in window?window.devicePixelRatio:1),Gl)}const ah="VVirtualListXScroll";function Qv({columnsRef:t,renderColRef:e,renderItemWithColsRef:i}){const r=n.ref(0),o=n.ref(0),s=n.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new Df(d.length,0);return d.forEach((f,h)=>{u.add(h,f.width)}),u}),l=on(()=>{const d=s.value;return d!==null?Math.max(d.getBound(o.value)-1,0):0}),a=d=>{const u=s.value;return u!==null?u.sum(d):0},c=on(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return n.provide(ah,{startIndexRef:l,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:i,getLeft:a}),{listWidthRef:r,scrollLeftRef:o}}const ch=n.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:i,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=n.inject(ah);return{startIndex:t,endIndex:e,columns:i,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:i,renderCol:r,renderItemWithCols:o,getLeft:s,item:l}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:i,item:l,getLeft:s});if(r!=null){const a=[];for(let c=t;c<=e;++c){const d=i[c];a.push(r({column:d,left:s(c),item:l}))}return a}return null}}),Jv=ui(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[ui("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[ui("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),eS=n.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=Ri();Jv.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:jl,ssr:e}),n.onMounted(()=>{const{defaultScrollIndex:P,defaultScrollKey:I}=t;P!=null?b({index:P}):I!=null&&b({key:I})});let i=!1,r=!1;n.onActivated(()=>{if(i=!1,!r){r=!0;return}b({top:m.value,left:l.value})}),n.onDeactivated(()=>{i=!0,r||(r=!0)});const o=on(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let P=0;return t.columns.forEach(I=>{P+=I.width}),P}),s=n.computed(()=>{const P=new Map,{keyField:I}=t;return t.items.forEach((K,J)=>{P.set(K[I],J)}),P}),{scrollLeftRef:l,listWidthRef:a}=Qv({columnsRef:n.toRef(t,"columns"),renderColRef:n.toRef(t,"renderCol"),renderItemWithColsRef:n.toRef(t,"renderItemWithCols")}),c=n.ref(null),d=n.ref(void 0),u=new Map,f=n.computed(()=>{const{items:P,itemSize:I,keyField:K}=t,J=new Df(P.length,I);return P.forEach((Z,L)=>{const O=Z[K],z=u.get(O);z!==void 0&&J.add(L,z)}),J}),h=n.ref(0),m=n.ref(0),p=on(()=>Math.max(f.value.getBound(m.value-zr(t.paddingTop))-1,0)),g=n.computed(()=>{const{value:P}=d;if(P===void 0)return[];const{items:I,itemSize:K}=t,J=p.value,Z=Math.min(J+Math.ceil(P/K+1),I.length-1),L=[];for(let O=J;O<=Z;++O)L.push(I[O]);return L}),b=(P,I)=>{if(typeof P=="number"){x(P,I,"auto");return}const{left:K,top:J,index:Z,key:L,position:O,behavior:z,debounce:M=!0}=P;if(K!==void 0||J!==void 0)x(K,J,z);else if(Z!==void 0)k(Z,z,M);else if(L!==void 0){const R=s.value.get(L);R!==void 0&&k(R,z,M)}else O==="bottom"?x(0,Number.MAX_SAFE_INTEGER,z):O==="top"&&x(0,0,z)};let y,_=null;function k(P,I,K){const{value:J}=f,Z=J.sum(P)+zr(t.paddingTop);if(!K)c.value.scrollTo({left:0,top:Z,behavior:I});else{y=P,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:L,offsetHeight:O}=c.value;if(Z>L){const z=J.get(P);Z+z<=L+O||c.value.scrollTo({left:0,top:Z+z-O,behavior:I})}else c.value.scrollTo({left:0,top:Z,behavior:I})}}function x(P,I,K){c.value.scrollTo({left:P,top:I,behavior:K})}function v(P,I){var K,J,Z;if(i||t.ignoreItemResize||V(I.target))return;const{value:L}=f,O=s.value.get(P),z=L.get(O),M=(Z=(J=(K=I.borderBoxSize)===null||K===void 0?void 0:K[0])===null||J===void 0?void 0:J.blockSize)!==null&&Z!==void 0?Z:I.contentRect.height;if(M===z)return;M-t.itemSize===0?u.delete(P):u.set(P,M-t.itemSize);const W=M-z;if(W===0)return;L.add(O,W);const U=c.value;if(U!=null){if(y===void 0){const G=L.sum(O);U.scrollTop>G&&U.scrollBy(0,W)}else if(O<y)U.scrollBy(0,W);else if(O===y){const G=L.sum(O);M+G>U.scrollTop+U.offsetHeight&&U.scrollBy(0,W)}E()}h.value++}const N=!Zv();let w=!1;function T(P){var I;(I=t.onScroll)===null||I===void 0||I.call(t,P),(!N||!w)&&E()}function C(P){var I;if((I=t.onWheel)===null||I===void 0||I.call(t,P),N){const K=c.value;if(K!=null){if(P.deltaX===0&&(K.scrollTop===0&&P.deltaY<=0||K.scrollTop+K.offsetHeight>=K.scrollHeight&&P.deltaY>=0))return;P.preventDefault(),K.scrollTop+=P.deltaY/lh(),K.scrollLeft+=P.deltaX/lh(),E(),w=!0,hf(()=>{w=!1})}}}function $(P){if(i||V(P.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(P.contentRect.height===d.value)return}else if(P.contentRect.height===d.value&&P.contentRect.width===a.value)return;d.value=P.contentRect.height,a.value=P.contentRect.width;const{onResize:I}=t;I!==void 0&&I(P)}function E(){const{value:P}=c;P!=null&&(m.value=P.scrollTop,l.value=P.scrollLeft)}function V(P){let I=P;for(;I!==null;){if(I.style.display==="none")return!0;I=I.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:n.computed(()=>{const{itemResizable:P}=t,I=Dr(f.value.sum());return h.value,[t.itemsStyle,{boxSizing:"content-box",width:Dr(o.value),height:P?"":I,minHeight:P?I:"",paddingTop:Dr(t.paddingTop),paddingBottom:Dr(t.paddingBottom)}]}),visibleItemsStyle:n.computed(()=>(h.value,{transform:`translateY(${Dr(f.value.sum(p.value))})`})),viewportItems:g,listElRef:c,itemsElRef:n.ref(null),scrollTo:b,handleListResize:$,handleListScroll:T,handleListWheel:C,handleItemResize:v}},render(){const{itemResizable:t,keyField:e,keyToIndex:i,visibleItemsTag:r}=this;return n.h(ds,{onResize:this.handleListResize},{default:()=>{var o,s;return n.h("div",n.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?n.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[n.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:l,renderItemWithCols:a}=this;return this.viewportItems.map(c=>{const d=c[e],u=i.get(d),f=l!=null?n.h(ch,{index:u,item:c}):void 0,h=a!=null?n.h(ch,{index:u,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:h,index:u})[0];return t?n.h(ds,{key:d,onResize:p=>this.handleItemResize(d,p)},{default:()=>m}):(m.key=d,m)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Wn="v-hidden",tS=ui("[v-hidden]",{display:"none!important"}),dh=n.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const i=n.ref(null),r=n.ref(null);function o(l){const{value:a}=i,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!a||!u)return;u.hasAttribute(Wn)&&u.removeAttribute(Wn);const{children:f}=a;if(l.showAllItemsBeforeCalculate)for(const k of f)k.hasAttribute(Wn)&&k.removeAttribute(Wn);const h=a.offsetWidth,m=[],p=e.tail?d==null?void 0:d():null;let g=p?p.offsetWidth:0,b=!1;const y=a.children.length-(e.tail?1:0);for(let k=0;k<y-1;++k){if(k<0)continue;const x=f[k];if(b){x.hasAttribute(Wn)||x.setAttribute(Wn,"");continue}else x.hasAttribute(Wn)&&x.removeAttribute(Wn);const v=x.offsetWidth;if(g+=v,m[k]=v,g>h){const{updateCounter:N}=t;for(let w=k;w>=0;--w){const T=y-1-w;N!==void 0?N(T):u.textContent=`${T}`;const C=u.offsetWidth;if(g-=m[w],g+C<=h||w===0){b=!0,k=w-1,p&&(k===-1?(p.style.maxWidth=`${h-C}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(T);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Wn,""))}const s=Ri();return tS.mount({id:"vueuc/overflow",head:!0,anchorMetaName:jl,ssr:s}),n.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:i,counterRef:r,sync:o}},render(){const{$slots:t}=this;return n.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),n.h("div",{class:"v-overflow",ref:"selfRef"},[n.renderSlot(t,"default"),t.counter?t.counter():n.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function uh(t){return t instanceof HTMLElement}function fh(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];if(uh(i)&&(mh(i)||fh(i)))return!0}return!1}function hh(t){for(let e=t.childNodes.length-1;e>=0;e--){const i=t.childNodes[e];if(uh(i)&&(mh(i)||hh(i)))return!0}return!1}function mh(t){if(!nS(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function nS(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let qr=[];const iS=n.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=uC(),i=n.ref(null),r=n.ref(null);let o=!1,s=!1;const l=typeof document>"u"?null:document.activeElement;function a(){return qr[qr.length-1]===e}function c(b){var y;b.code==="Escape"&&a()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}n.onMounted(()=>{n.watch(()=>t.active,b=>{b?(f(),It("keydown",document,c)):(ht("keydown",document,c),o&&h())},{immediate:!0})}),n.onBeforeUnmount(()=>{ht("keydown",document,c),o&&h()});function d(b){if(!s&&a()){const y=u();if(y===null||y.contains(Or(b)))return;m("first")}}function u(){const b=i.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!t.disabled){if(qr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?m("first"):(b=Lf(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function h(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),qr=qr.filter(_=>_!==e),a()))return;const{finalFocusTo:y}=t;y!==void 0?(b=Lf(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&l instanceof HTMLElement&&(s=!0,l.focus({preventScroll:!0}),s=!1)}function m(b){if(a()&&t.active){const y=i.value,_=r.value;if(y!==null&&_!==null){const k=u();if(k==null||k===_){s=!0,y.focus({preventScroll:!0}),s=!1;return}s=!0;const x=b==="first"?fh(k):hh(k);s=!1,x||(s=!0,y.focus({preventScroll:!0}),s=!1)}}}function p(b){if(s)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?m("last"):m("first"))}function g(b){s||(b.relatedTarget!==null&&b.relatedTarget===i.value?m("last"):m("first"))}return{focusableStartRef:i,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:p,handleEndFocus:g}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:i}=this;return n.h(n.Fragment,null,[n.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:i,onFocus:this.handleStartFocus}),t(),n.h("div",{"aria-hidden":"true",style:i,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function nT(t){return t}const Zl="n-internal-select-menu",ph="n-internal-select-menu-body",gh="n-drawer-body",yh="n-modal-body",bh="n-popover-body",_h="__disabled__";function jn(t){const e=n.inject(yh,null),i=n.inject(gh,null),r=n.inject(bh,null),o=n.inject(ph,null),s=n.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const l=()=>{s.value=document.fullscreenElement};n.onMounted(()=>{It("fullscreenchange",document,l)}),n.onBeforeUnmount(()=>{ht("fullscreenchange",document,l)})}return on(()=>{var l;const{to:a}=t;return a!==void 0?a===!1?_h:a===!0?s.value||"body":a:e!=null&&e.value?(l=e.value.$el)!==null&&l!==void 0?l:e.value:i!=null&&i.value?i.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:a??(s.value||"body")})}jn.tdkey=_h,jn.propTo={type:[String,Object,Boolean],default:void 0};function rS(t){const e={isDeactivated:!1};let i=!1;return n.onActivated(()=>{if(e.isDeactivated=!1,!i){i=!0;return}t()}),n.onDeactivated(()=>{e.isDeactivated=!0,i||(i=!0)}),e}function wh(t,e){e&&(n.onMounted(()=>{const{value:i}=t;i&&jr.registerHandler(i,e)}),n.watch(t,(i,r)=>{r&&jr.unregisterHandler(r)},{deep:!1}),n.onBeforeUnmount(()=>{const{value:i}=t;i&&jr.unregisterHandler(i)}))}function xh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const oS=/^(\d|\.)+$/,kh=/(\d|\.)+/;function Ql(t,{c:e=1,offset:i=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+i)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(oS.test(t)){const o=(Number(t)+i)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=kh.exec(t);return o?t.replace(kh,String((Number(o[0])+i)*e)):t}return t}function Ch(t){const{left:e,right:i,top:r,bottom:o}=hn(t);return`${r} ${e} ${o} ${i}`}var vh={};function sS(t){let e=".",i="__",r="--",o;if(t){let p=t.blockPrefix;p&&(e=p),p=t.elementPrefix,p&&(i=p),p=t.modifierPrefix,p&&(r=p)}const s={install(p){o=p.c;const g=p.context;g.bem={},g.bem.b=null,g.bem.els=null}};function l(p){let g,b;return{before(y){g=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=g,y.bem.els=b},$({context:y,props:_}){return p=typeof p=="string"?p:p({context:y,props:_}),y.bem.b=p,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function a(p){let g;return{before(b){g=b.bem.els},after(b){b.bem.els=g},$({context:b,props:y}){return p=typeof p=="string"?p:p({context:b,props:y}),b.bem.els=p.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${i}${_}`).join(", ")}}}function c(p){return{$({context:g,props:b}){p=typeof p=="string"?p:p({context:g,props:b});const y=p.split(",").map(x=>x.trim());function _(x){return y.map(v=>`&${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${x!==void 0?`${i}${x}`:""}${r}${v}`).join(", ")}const k=g.bem.els;if(k!==null){if(vh.NODE_ENV!=="production"&&k.length>=2)throw Error(`[css-render/plugin-bem]: m(${p}) is invalid, using modifier inside multiple elements is not allowed`);return _(k[0])}else return _()}}}function d(p){return{$({context:g,props:b}){p=typeof p=="string"?p:p({context:g,props:b});const y=g.bem.els;if(vh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${p}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${y!==null&&y.length>0?`${i}${y[0]}`:""}${r}${p})`}}}return Object.assign(s,{cB:((...p)=>o(l(p[0]),p[1],p[2])),cE:((...p)=>o(a(p[0]),p[1],p[2])),cM:((...p)=>o(c(p[0]),p[1],p[2])),cNotM:((...p)=>o(d(p[0]),p[1],p[2]))}),s}const lS=".n-",aS="__",cS="--",Sh=Of(),Bh=sS({blockPrefix:lS,elementPrefix:aS,modifierPrefix:cS});Sh.use(Bh);const{c:he,find:rT}=Sh,{cB:be,cE:Ce,cM:Pe,cNotM:mn}=Bh,dS=(...t)=>he(">",[be(...t)]);function nt(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,i=>i.toUpperCase()))}let Jl;function uS(){return Jl===void 0&&(Jl=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Jl}const fS=new WeakSet;function hS(t){fS.add(t)}function Nh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Th=new Set;function fi(t,e){const i=`[naive/${t}]: ${e}`;Th.has(i)||(Th.add(i),console.error(i))}function $h(t,e){console.error(`[naive/${t}]: ${e}`)}function Eh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function Bt(t,...e){if(Array.isArray(t))t.forEach(i=>Bt(i,...e));else return t(...e)}function ea(t,e=!0,i=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(n.createTextVNode(String(r)));return}if(Array.isArray(r)){ea(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ea(r.children,e,i)}else{if(r.type===n.Comment&&e)return;i.push(r)}}}),i}function mS(t,e="default",i=void 0){const r=t[e];if(!r)return $h("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=ea(r(i));return o.length===1?o[0]:($h("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function pS(t,e=[],i){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,i)}function ta(t){const e=t.filter(i=>i!==void 0);if(e.length!==0)return e.length===1?e[0]:i=>{t.forEach(r=>{r&&r(i)})}}function gr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?n.createTextVNode(t):typeof t=="number"?n.createTextVNode(String(t)):null}function fs(t){return t.some(e=>n.isVNode(e)?!(e.type===n.Comment||e.type===n.Fragment&&!fs(e.children)):!0)?t:null}function na(t,e){return t&&fs(t())||e()}function Vi(t,e){const i=t&&fs(t());return e(i||null)}function Rh(t){return!(t&&fs(t()))}const ia=n.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Mi="n-config-provider",gS="n";function Ii(t={},e={defaultBordered:!0}){const i=n.inject(Mi,null);return{inlineThemeDisabled:i==null?void 0:i.inlineThemeDisabled,mergedRtlRef:i==null?void 0:i.mergedRtlRef,mergedComponentPropsRef:i==null?void 0:i.mergedComponentPropsRef,mergedBreakpointsRef:i==null?void 0:i.mergedBreakpointsRef,mergedBorderedRef:n.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=i==null?void 0:i.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:i?i.mergedClsPrefixRef:n.shallowRef(gS),namespaceRef:n.computed(()=>i==null?void 0:i.mergedNamespaceRef.value)}}function Ai(t,e,i,r){i||Eh("useThemeClass","cssVarsRef is not passed");const o=n.inject(Mi,null),s=o==null?void 0:o.mergedThemeHashRef,l=o==null?void 0:o.styleMountTarget,a=n.ref(""),c=Ri();let d;const u=`__${t}`,f=()=>{let h=u;const m=e?e.value:void 0,p=s==null?void 0:s.value;p&&(h+=`-${p}`),m&&(h+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:b}=r;g&&(h+=`-${Wl(JSON.stringify(g))}`),b&&(h+=`-${Wl(JSON.stringify(b))}`),a.value=h,d=()=>{const y=i.value;let _="";for(const k in y)_+=`${k}: ${y[k]};`;he(`.${h}`,_).mount({id:h,ssr:c,parent:l}),d=void 0}};return n.watchEffect(()=>{f()}),{themeClass:a,onRender:()=>{d==null||d()}}}const Ph="n-form-item";function yS(t,{defaultSize:e="medium",mergedSize:i,mergedDisabled:r}={}){const o=n.inject(Ph,null);n.provide(Ph,null);const s=n.computed(i?()=>i(o):()=>{const{size:c}=t;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),l=n.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),a=n.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return n.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:l,mergedStatusRef:a,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const bS={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ra(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}function Xr(t){return(e,i)=>{const r=i!=null&&i.context?String(i.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,a=i!=null&&i.width?String(i.width):l;o=t.formattingValues[a]||t.formattingValues[l]}else{const l=t.defaultWidth,a=i!=null&&i.width?String(i.width):t.defaultWidth;o=t.values[a]||t.values[l]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function Yr(t){return(e,i={})=>{const r=i.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(o);if(!s)return null;const l=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?wS(a,f=>f.test(l)):_S(a,f=>f.test(l));let d;d=t.valueCallback?t.valueCallback(c):c,d=i.valueCallback?i.valueCallback(d):d;const u=e.slice(l.length);return{value:d,rest:u}}}function _S(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i}function wS(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i}function xS(t){return(e,i={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0],s=e.match(t.parsePattern);if(!s)return null;let l=t.valueCallback?t.valueCallback(s[0]):s[0];l=i.valueCallback?i.valueCallback(l):l;const a=e.slice(o.length);return{value:l,rest:a}}}const kS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},CS=(t,e,i)=>{let r;const o=kS[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r},vS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SS=(t,e,i,r)=>vS[t],BS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},NS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$S={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ES={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},RS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},PS={ordinalNumber:(t,e)=>{const i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Xr({values:BS,defaultWidth:"wide"}),quarter:Xr({values:NS,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Xr({values:TS,defaultWidth:"wide"}),day:Xr({values:$S,defaultWidth:"wide"}),dayPeriod:Xr({values:ES,defaultWidth:"wide",formattingValues:RS,defaultFormattingWidth:"wide"})},FS=/^(\d+)(th|st|nd|rd)?/i,VS=/\d+/i,MS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},IS={any:[/^b/i,/^(a|c)/i]},AS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},OS={any:[/1/i,/2/i,/3/i,/4/i]},zS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},DS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},LS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},WS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},qS={ordinalNumber:xS({matchPattern:FS,parsePattern:VS,valueCallback:t=>parseInt(t,10)}),era:Yr({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:IS,defaultParseWidth:"any"}),quarter:Yr({matchPatterns:AS,defaultMatchWidth:"wide",parsePatterns:OS,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Yr({matchPatterns:zS,defaultMatchWidth:"wide",parsePatterns:DS,defaultParseWidth:"any"}),day:Yr({matchPatterns:LS,defaultMatchWidth:"wide",parsePatterns:HS,defaultParseWidth:"any"}),dayPeriod:Yr({matchPatterns:WS,defaultMatchWidth:"any",parsePatterns:jS,defaultParseWidth:"any"})},XS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},YS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},US={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},KS={date:ra({formats:XS,defaultWidth:"full"}),time:ra({formats:YS,defaultWidth:"full"}),dateTime:ra({formats:US,defaultWidth:"full"})},GS={name:"en-US",locale:{code:"en-US",formatDistance:CS,formatLong:KS,formatRelative:SS,localize:PS,match:qS,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Fh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:i}=n.inject(Mi,null)||{},r=n.computed(()=>{var s,l;return(l=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&l!==void 0?l:bS[t]});return{dateLocaleRef:n.computed(()=>{var s;return(s=i==null?void 0:i.value)!==null&&s!==void 0?s:GS}),localeRef:r}}const Ur="naive-ui-style";function Kr(t,e,i){if(!e)return;const r=Ri(),o=n.computed(()=>{const{value:a}=e;if(!a)return;const c=a[t];if(c)return c}),s=n.inject(Mi,null),l=()=>{n.watchEffect(()=>{const{value:a}=i,c=`${a}${t}Rtl`;if(wv(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Ur,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?l():n.onBeforeMount(l),o}const Gr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:ZS,fontFamily:QS,lineHeight:JS}=Gr,Vh=he("body",`
|
|
116
|
+
`)}function Wl(t){for(var e=0,i,r=0,o=t.length;o>=4;++r,o-=4)i=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,e=(i&65535)*1540483477+((i>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function mv(t,e,i,r){const{els:o}=e;if(i===void 0)o.forEach(Ff),e.els=[];else{const s=ns(i,r);s&&o.includes(s)&&(Ff(s),e.els=o.filter(l=>l!==s))}}function Af(t,e){t.push(e)}function pv(t,e,i,r,o,s,l,a,c){let d;if(i===void 0&&(d=e.render(r),i=Wl(d)),c){c.adapter(i,d??e.render(r));return}a===void 0&&(a=document.head);const u=ns(i,a);if(u!==null&&!s)return u;const f=u??cv(i);if(d===void 0&&(d=e.render(r)),f.textContent=d,u!==null)return u;if(l){const h=a.querySelector(`meta[name="${l}"]`);if(h)return a.insertBefore(f,h),Af(e.els,f),f}return o?a.insertBefore(f,a.querySelector("style, link")):a.appendChild(f),Af(e.els,f),f}function gv(t){return hv(this,this.instance,t)}function yv(t={}){const{id:e,ssr:i,props:r,head:o=!1,force:s=!1,anchorMetaName:l,parent:a}=t;return pv(this.instance,this,e,r,o,s,l,a,i)}function bv(t={}){const{id:e,parent:i}=t;mv(this.instance,this,e,i)}const rs=function(t,e,i,r){return{instance:t,$:e,props:i,children:r,els:[],render:gv,mount:yv,unmount:bv}},_v=function(t,e,i,r){return Array.isArray(e)?rs(t,{$:null},null,e):Array.isArray(i)?rs(t,e,null,i):Array.isArray(r)?rs(t,e,i,r):rs(t,e,i,null)};function Of(t={}){const e={c:((...i)=>_v(e,...i)),use:(i,...r)=>i.install(e,...r),find:ns,context:{},config:t};return e}function wv(t,e){if(t===void 0)return!1;if(e){const{context:{ids:i}}=e;return i.has(t)}return ns(t)!==null}const{c:ui}=Of(),jl="vueuc-style";function zf(t){return t&-t}class Df{constructor(e,i){this.l=e,this.min=i;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,i){if(i===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=i,e+=zf(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:i,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=i[e],e-=zf(e);return s}getBound(e){let i=0,r=this.l;for(;r>i;){const o=Math.floor((i+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(i===o)return this.sum(i+1)<=e?i+1:o;i=o}else return o}return i}}function Lf(t){return typeof t=="string"?document.querySelector(t):t()||null}const xv=n.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:YC(n.toRef(t,"show")),mergedTo:n.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?zl("lazy-teleport",this.$slots):n.h(n.Teleport,{disabled:this.disabled,to:this.mergedTo},zl("lazy-teleport",this.$slots)):null}}),os={top:"bottom",bottom:"top",left:"right",right:"left"},Hf={start:"end",center:"center",end:"start"},ql={top:"height",bottom:"height",left:"width",right:"width"},kv={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},Cv={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},vv={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Wf={top:!0,bottom:!1,left:!0,right:!1},jf={top:"end",bottom:"start",left:"end",right:"start"};function Sv(t,e,i,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[l,a]=t.split("-");let c=a??"center",d={top:0,left:0};const u=(m,p,g)=>{let b=0,y=0;const _=i[m]-e[p]-e[m];return _>0&&r&&(g?y=Wf[p]?_:-_:b=Wf[p]?_:-_),{left:b,top:y}},f=l==="left"||l==="right";if(c!=="center"){const m=vv[t],p=os[m],g=ql[m];if(i[g]>e[g]){if(e[m]+e[g]<i[g]){const b=(i[g]-e[g])/2;e[m]<b||e[p]<b?e[m]<e[p]?(c=Hf[a],d=u(g,p,f)):d=u(g,m,f):c="center"}}else i[g]<e[g]&&e[p]<0&&e[m]>e[p]&&(c=Hf[a])}else{const m=l==="bottom"||l==="top"?"left":"top",p=os[m],g=ql[m],b=(i[g]-e[g])/2;(e[m]<b||e[p]<b)&&(e[m]>e[p]?(c=jf[m],d=u(g,m,f)):(c=jf[p],d=u(g,p,f)))}let h=l;return e[l]<i[ql[l]]&&e[l]<e[os[l]]&&(h=os[l]),{placement:c!=="center"?`${h}-${c}`:h,left:d.left,top:d.top}}function Bv(t,e){return e?Cv[t]:kv[t]}function Nv(t,e,i,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateX(-50%)"}}}const Tv=ui([ui(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),ui(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[ui("> *",{pointerEvents:"all"})])]),qf=n.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=n.inject("VBinder"),i=on(()=>t.enabled!==void 0?t.enabled:t.show),r=n.ref(null),o=n.ref(null),s=()=>{const{syncTrigger:h}=t;h.includes("scroll")&&e.addScrollListener(c),h.includes("resize")&&e.addResizeListener(c)},l=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};n.onMounted(()=>{i.value&&(c(),s())});const a=Ri();Tv.mount({id:"vueuc/binder",head:!0,anchorMetaName:jl,ssr:a}),n.onBeforeUnmount(()=>{l()}),UC(()=>{i.value&&c()});const c=()=>{if(!i.value)return;const h=r.value;if(h===null)return;const m=e.targetRef,{x:p,y:g,overlap:b}=t,y=p!==void 0&&g!==void 0?QC(p,g):Ll(m);h.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),h.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:k,placement:x,internalShift:v,flip:N}=t;h.setAttribute("v-placement",x),b?h.setAttribute("v-overlap",""):h.removeAttribute("v-overlap");const{style:w}=h;_==="target"?w.width=`${y.width}px`:_!==void 0?w.width=_:w.width="",k==="target"?w.minWidth=`${y.width}px`:k!==void 0?w.minWidth=k:w.minWidth="";const T=Ll(h),C=Ll(o.value),{left:$,top:E,placement:V}=Sv(x,y,T,v,N,b),P=Bv(V,b),{left:I,top:U,transform:J}=Nv(V,C,y,E,$,b);h.setAttribute("v-placement",V),h.style.setProperty("--v-offset-left",`${Math.round($)}px`),h.style.setProperty("--v-offset-top",`${Math.round(E)}px`),h.style.transform=`translateX(${I}) translateY(${U}) ${J}`,h.style.setProperty("--v-transform-origin",P),h.style.transformOrigin=P};n.watch(i,h=>{h?(s(),d()):l()});const d=()=>{n.nextTick().then(c).catch(h=>console.error(h))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(h=>{n.watch(n.toRef(t,h),c)}),["teleportDisabled"].forEach(h=>{n.watch(n.toRef(t,h),d)}),n.watch(n.toRef(t,"syncTrigger"),h=>{h.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),h.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=ts(),f=on(()=>{const{to:h}=t;if(h!==void 0)return h;u.value});return{VBinder:e,mergedEnabled:i,offsetContainerRef:o,followerRef:r,mergedTo:f,syncPosition:c}},render(){return n.h(xv,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const i=n.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[n.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?n.withDirectives(i,[[vf,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):i}})}});var Pi=[],$v=function(){return Pi.some(function(t){return t.activeTargets.length>0})},Ev=function(){return Pi.some(function(t){return t.skippedTargets.length>0})},Xf="ResizeObserver loop completed with undelivered notifications.",Rv=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Xf}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Xf),window.dispatchEvent(t)},Hr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Hr||(Hr={}));var Fi=function(t){return Object.freeze(t)},Pv=(function(){function t(e,i){this.inlineSize=e,this.blockSize=i,Fi(this)}return t})(),Yf=(function(){function t(e,i,r,o){return this.x=e,this.y=i,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Fi(this)}return t.prototype.toJSON=function(){var e=this,i=e.x,r=e.y,o=e.top,s=e.right,l=e.bottom,a=e.left,c=e.width,d=e.height;return{x:i,y:r,top:o,right:s,bottom:l,left:a,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),Xl=function(t){return t instanceof SVGElement&&"getBBox"in t},Kf=function(t){if(Xl(t)){var e=t.getBBox(),i=e.width,r=e.height;return!i&&!r}var o=t,s=o.offsetWidth,l=o.offsetHeight;return!(s||l||t.getClientRects().length)},Uf=function(t){var e;if(t instanceof Element)return!0;var i=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(i&&t instanceof i.Element)},Fv=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Wr=typeof window<"u"?window:{},ss=new WeakMap,Gf=/auto|scroll/,Vv=/^tb|vertical/,Mv=/msie|trident/i.test(Wr.navigator&&Wr.navigator.userAgent),Pn=function(t){return parseFloat(t||"0")},pr=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=!1),new Pv((i?e:t)||0,(i?t:e)||0)},Zf=Fi({devicePixelContentBoxSize:pr(),borderBoxSize:pr(),contentBoxSize:pr(),contentRect:new Yf(0,0,0,0)}),Qf=function(t,e){if(e===void 0&&(e=!1),ss.has(t)&&!e)return ss.get(t);if(Kf(t))return ss.set(t,Zf),Zf;var i=getComputedStyle(t),r=Xl(t)&&t.ownerSVGElement&&t.getBBox(),o=!Mv&&i.boxSizing==="border-box",s=Vv.test(i.writingMode||""),l=!r&&Gf.test(i.overflowY||""),a=!r&&Gf.test(i.overflowX||""),c=r?0:Pn(i.paddingTop),d=r?0:Pn(i.paddingRight),u=r?0:Pn(i.paddingBottom),f=r?0:Pn(i.paddingLeft),h=r?0:Pn(i.borderTopWidth),m=r?0:Pn(i.borderRightWidth),p=r?0:Pn(i.borderBottomWidth),g=r?0:Pn(i.borderLeftWidth),b=f+d,y=c+u,_=g+m,k=h+p,x=a?t.offsetHeight-k-t.clientHeight:0,v=l?t.offsetWidth-_-t.clientWidth:0,N=o?b+_:0,w=o?y+k:0,T=r?r.width:Pn(i.width)-N-v,C=r?r.height:Pn(i.height)-w-x,$=T+b+v+_,E=C+y+x+k,V=Fi({devicePixelContentBoxSize:pr(Math.round(T*devicePixelRatio),Math.round(C*devicePixelRatio),s),borderBoxSize:pr($,E,s),contentBoxSize:pr(T,C,s),contentRect:new Yf(f,c,T,C)});return ss.set(t,V),V},Jf=function(t,e,i){var r=Qf(t,i),o=r.borderBoxSize,s=r.contentBoxSize,l=r.devicePixelContentBoxSize;switch(e){case Hr.DEVICE_PIXEL_CONTENT_BOX:return l;case Hr.BORDER_BOX:return o;default:return s}},Iv=(function(){function t(e){var i=Qf(e);this.target=e,this.contentRect=i.contentRect,this.borderBoxSize=Fi([i.borderBoxSize]),this.contentBoxSize=Fi([i.contentBoxSize]),this.devicePixelContentBoxSize=Fi([i.devicePixelContentBoxSize])}return t})(),eh=function(t){if(Kf(t))return 1/0;for(var e=0,i=t.parentNode;i;)e+=1,i=i.parentNode;return e},Av=function(){var t=1/0,e=[];Pi.forEach(function(l){if(l.activeTargets.length!==0){var a=[];l.activeTargets.forEach(function(d){var u=new Iv(d.target),f=eh(d.target);a.push(u),d.lastReportedSize=Jf(d.target,d.observedBox),f<t&&(t=f)}),e.push(function(){l.callback.call(l.observer,a,l.observer)}),l.activeTargets.splice(0,l.activeTargets.length)}});for(var i=0,r=e;i<r.length;i++){var o=r[i];o()}return t},th=function(t){Pi.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(o){o.isActive()&&(eh(o.target)>t?i.activeTargets.push(o):i.skippedTargets.push(o))})})},Ov=function(){var t=0;for(th(t);$v();)t=Av(),th(t);return Ev()&&Rv(),t>0},Yl,nh=[],zv=function(){return nh.splice(0).forEach(function(t){return t()})},Dv=function(t){if(!Yl){var e=0,i=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return zv()}).observe(i,r),Yl=function(){i.textContent="".concat(e?e--:e++)}}nh.push(t),Yl()},Lv=function(t){Dv(function(){requestAnimationFrame(t)})},ls=0,Hv=function(){return!!ls},Wv=250,jv={attributes:!0,characterData:!0,childList:!0,subtree:!0},ih=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rh=function(t){return t===void 0&&(t=0),Date.now()+t},Kl=!1,qv=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var i=this;if(e===void 0&&(e=Wv),!Kl){Kl=!0;var r=rh(e);Lv(function(){var o=!1;try{o=Ov()}finally{if(Kl=!1,e=r-rh(),!Hv())return;o?i.run(1e3):e>0?i.run(e):i.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,i=function(){return e.observer&&e.observer.observe(document.body,jv)};document.body?i():Wr.addEventListener("DOMContentLoaded",i)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ih.forEach(function(i){return Wr.addEventListener(i,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),ih.forEach(function(i){return Wr.removeEventListener(i,e.listener,!0)}),this.stopped=!0)},t})(),Ul=new qv,oh=function(t){!ls&&t>0&&Ul.start(),ls+=t,!ls&&Ul.stop()},Xv=function(t){return!Xl(t)&&!Fv(t)&&getComputedStyle(t).display==="inline"},Yv=(function(){function t(e,i){this.target=e,this.observedBox=i||Hr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Jf(this.target,this.observedBox,!0);return Xv(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Kv=(function(){function t(e,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=i}return t})(),as=new WeakMap,sh=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].target===e)return i;return-1},cs=(function(){function t(){}return t.connect=function(e,i){var r=new Kv(e,i);as.set(e,r)},t.observe=function(e,i,r){var o=as.get(e),s=o.observationTargets.length===0;sh(o.observationTargets,i)<0&&(s&&Pi.push(o),o.observationTargets.push(new Yv(i,r&&r.box)),oh(1),Ul.schedule())},t.unobserve=function(e,i){var r=as.get(e),o=sh(r.observationTargets,i),s=r.observationTargets.length===1;o>=0&&(s&&Pi.splice(Pi.indexOf(r),1),r.observationTargets.splice(o,1),oh(-1))},t.disconnect=function(e){var i=this,r=as.get(e);r.observationTargets.slice().forEach(function(o){return i.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Uv=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");cs.connect(this,e)}return t.prototype.observe=function(e,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Uf(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");cs.observe(this,e,i)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Uf(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");cs.unobserve(this,e)},t.prototype.disconnect=function(){cs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Gv{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Uv)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const i of e){const r=this.elHandlersMap.get(i.target);r!==void 0&&r(i)}}registerHandler(e,i){this.elHandlersMap.set(e,i),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const jr=new Gv,ds=n.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const i=n.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}n.onMounted(()=>{const o=i.$el;if(o===void 0){Rf("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){Rf("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(jr.registerHandler(o.nextElementSibling,r),e=!0)}),n.onBeforeUnmount(()=>{e&&jr.unregisterHandler(i.$el.nextElementSibling)})},render(){return n.renderSlot(this.$slots,"default")}});let us;function Zv(){return typeof document>"u"?!1:(us===void 0&&("matchMedia"in window?us=window.matchMedia("(pointer:coarse)").matches:us=!1),us)}let Gl;function lh(){return typeof document>"u"?1:(Gl===void 0&&(Gl="chrome"in window?window.devicePixelRatio:1),Gl)}const ah="VVirtualListXScroll";function Qv({columnsRef:t,renderColRef:e,renderItemWithColsRef:i}){const r=n.ref(0),o=n.ref(0),s=n.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new Df(d.length,0);return d.forEach((f,h)=>{u.add(h,f.width)}),u}),l=on(()=>{const d=s.value;return d!==null?Math.max(d.getBound(o.value)-1,0):0}),a=d=>{const u=s.value;return u!==null?u.sum(d):0},c=on(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return n.provide(ah,{startIndexRef:l,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:i,getLeft:a}),{listWidthRef:r,scrollLeftRef:o}}const ch=n.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:i,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=n.inject(ah);return{startIndex:t,endIndex:e,columns:i,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:i,renderCol:r,renderItemWithCols:o,getLeft:s,item:l}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:i,item:l,getLeft:s});if(r!=null){const a=[];for(let c=t;c<=e;++c){const d=i[c];a.push(r({column:d,left:s(c),item:l}))}return a}return null}}),Jv=ui(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[ui("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[ui("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),eS=n.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=Ri();Jv.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:jl,ssr:e}),n.onMounted(()=>{const{defaultScrollIndex:P,defaultScrollKey:I}=t;P!=null?b({index:P}):I!=null&&b({key:I})});let i=!1,r=!1;n.onActivated(()=>{if(i=!1,!r){r=!0;return}b({top:m.value,left:l.value})}),n.onDeactivated(()=>{i=!0,r||(r=!0)});const o=on(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let P=0;return t.columns.forEach(I=>{P+=I.width}),P}),s=n.computed(()=>{const P=new Map,{keyField:I}=t;return t.items.forEach((U,J)=>{P.set(U[I],J)}),P}),{scrollLeftRef:l,listWidthRef:a}=Qv({columnsRef:n.toRef(t,"columns"),renderColRef:n.toRef(t,"renderCol"),renderItemWithColsRef:n.toRef(t,"renderItemWithCols")}),c=n.ref(null),d=n.ref(void 0),u=new Map,f=n.computed(()=>{const{items:P,itemSize:I,keyField:U}=t,J=new Df(P.length,I);return P.forEach((Z,L)=>{const O=Z[U],z=u.get(O);z!==void 0&&J.add(L,z)}),J}),h=n.ref(0),m=n.ref(0),p=on(()=>Math.max(f.value.getBound(m.value-zr(t.paddingTop))-1,0)),g=n.computed(()=>{const{value:P}=d;if(P===void 0)return[];const{items:I,itemSize:U}=t,J=p.value,Z=Math.min(J+Math.ceil(P/U+1),I.length-1),L=[];for(let O=J;O<=Z;++O)L.push(I[O]);return L}),b=(P,I)=>{if(typeof P=="number"){x(P,I,"auto");return}const{left:U,top:J,index:Z,key:L,position:O,behavior:z,debounce:M=!0}=P;if(U!==void 0||J!==void 0)x(U,J,z);else if(Z!==void 0)k(Z,z,M);else if(L!==void 0){const R=s.value.get(L);R!==void 0&&k(R,z,M)}else O==="bottom"?x(0,Number.MAX_SAFE_INTEGER,z):O==="top"&&x(0,0,z)};let y,_=null;function k(P,I,U){const{value:J}=f,Z=J.sum(P)+zr(t.paddingTop);if(!U)c.value.scrollTo({left:0,top:Z,behavior:I});else{y=P,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:L,offsetHeight:O}=c.value;if(Z>L){const z=J.get(P);Z+z<=L+O||c.value.scrollTo({left:0,top:Z+z-O,behavior:I})}else c.value.scrollTo({left:0,top:Z,behavior:I})}}function x(P,I,U){c.value.scrollTo({left:P,top:I,behavior:U})}function v(P,I){var U,J,Z;if(i||t.ignoreItemResize||V(I.target))return;const{value:L}=f,O=s.value.get(P),z=L.get(O),M=(Z=(J=(U=I.borderBoxSize)===null||U===void 0?void 0:U[0])===null||J===void 0?void 0:J.blockSize)!==null&&Z!==void 0?Z:I.contentRect.height;if(M===z)return;M-t.itemSize===0?u.delete(P):u.set(P,M-t.itemSize);const W=M-z;if(W===0)return;L.add(O,W);const K=c.value;if(K!=null){if(y===void 0){const G=L.sum(O);K.scrollTop>G&&K.scrollBy(0,W)}else if(O<y)K.scrollBy(0,W);else if(O===y){const G=L.sum(O);M+G>K.scrollTop+K.offsetHeight&&K.scrollBy(0,W)}E()}h.value++}const N=!Zv();let w=!1;function T(P){var I;(I=t.onScroll)===null||I===void 0||I.call(t,P),(!N||!w)&&E()}function C(P){var I;if((I=t.onWheel)===null||I===void 0||I.call(t,P),N){const U=c.value;if(U!=null){if(P.deltaX===0&&(U.scrollTop===0&&P.deltaY<=0||U.scrollTop+U.offsetHeight>=U.scrollHeight&&P.deltaY>=0))return;P.preventDefault(),U.scrollTop+=P.deltaY/lh(),U.scrollLeft+=P.deltaX/lh(),E(),w=!0,hf(()=>{w=!1})}}}function $(P){if(i||V(P.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(P.contentRect.height===d.value)return}else if(P.contentRect.height===d.value&&P.contentRect.width===a.value)return;d.value=P.contentRect.height,a.value=P.contentRect.width;const{onResize:I}=t;I!==void 0&&I(P)}function E(){const{value:P}=c;P!=null&&(m.value=P.scrollTop,l.value=P.scrollLeft)}function V(P){let I=P;for(;I!==null;){if(I.style.display==="none")return!0;I=I.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:n.computed(()=>{const{itemResizable:P}=t,I=Dr(f.value.sum());return h.value,[t.itemsStyle,{boxSizing:"content-box",width:Dr(o.value),height:P?"":I,minHeight:P?I:"",paddingTop:Dr(t.paddingTop),paddingBottom:Dr(t.paddingBottom)}]}),visibleItemsStyle:n.computed(()=>(h.value,{transform:`translateY(${Dr(f.value.sum(p.value))})`})),viewportItems:g,listElRef:c,itemsElRef:n.ref(null),scrollTo:b,handleListResize:$,handleListScroll:T,handleListWheel:C,handleItemResize:v}},render(){const{itemResizable:t,keyField:e,keyToIndex:i,visibleItemsTag:r}=this;return n.h(ds,{onResize:this.handleListResize},{default:()=>{var o,s;return n.h("div",n.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?n.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[n.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:l,renderItemWithCols:a}=this;return this.viewportItems.map(c=>{const d=c[e],u=i.get(d),f=l!=null?n.h(ch,{index:u,item:c}):void 0,h=a!=null?n.h(ch,{index:u,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:h,index:u})[0];return t?n.h(ds,{key:d,onResize:p=>this.handleItemResize(d,p)},{default:()=>m}):(m.key=d,m)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Wn="v-hidden",tS=ui("[v-hidden]",{display:"none!important"}),dh=n.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const i=n.ref(null),r=n.ref(null);function o(l){const{value:a}=i,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!a||!u)return;u.hasAttribute(Wn)&&u.removeAttribute(Wn);const{children:f}=a;if(l.showAllItemsBeforeCalculate)for(const k of f)k.hasAttribute(Wn)&&k.removeAttribute(Wn);const h=a.offsetWidth,m=[],p=e.tail?d==null?void 0:d():null;let g=p?p.offsetWidth:0,b=!1;const y=a.children.length-(e.tail?1:0);for(let k=0;k<y-1;++k){if(k<0)continue;const x=f[k];if(b){x.hasAttribute(Wn)||x.setAttribute(Wn,"");continue}else x.hasAttribute(Wn)&&x.removeAttribute(Wn);const v=x.offsetWidth;if(g+=v,m[k]=v,g>h){const{updateCounter:N}=t;for(let w=k;w>=0;--w){const T=y-1-w;N!==void 0?N(T):u.textContent=`${T}`;const C=u.offsetWidth;if(g-=m[w],g+C<=h||w===0){b=!0,k=w-1,p&&(k===-1?(p.style.maxWidth=`${h-C}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(T);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Wn,""))}const s=Ri();return tS.mount({id:"vueuc/overflow",head:!0,anchorMetaName:jl,ssr:s}),n.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:i,counterRef:r,sync:o}},render(){const{$slots:t}=this;return n.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),n.h("div",{class:"v-overflow",ref:"selfRef"},[n.renderSlot(t,"default"),t.counter?t.counter():n.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function uh(t){return t instanceof HTMLElement}function fh(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];if(uh(i)&&(mh(i)||fh(i)))return!0}return!1}function hh(t){for(let e=t.childNodes.length-1;e>=0;e--){const i=t.childNodes[e];if(uh(i)&&(mh(i)||hh(i)))return!0}return!1}function mh(t){if(!nS(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function nS(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let qr=[];const iS=n.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=uC(),i=n.ref(null),r=n.ref(null);let o=!1,s=!1;const l=typeof document>"u"?null:document.activeElement;function a(){return qr[qr.length-1]===e}function c(b){var y;b.code==="Escape"&&a()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}n.onMounted(()=>{n.watch(()=>t.active,b=>{b?(f(),It("keydown",document,c)):(ht("keydown",document,c),o&&h())},{immediate:!0})}),n.onBeforeUnmount(()=>{ht("keydown",document,c),o&&h()});function d(b){if(!s&&a()){const y=u();if(y===null||y.contains(Or(b)))return;m("first")}}function u(){const b=i.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!t.disabled){if(qr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?m("first"):(b=Lf(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function h(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),qr=qr.filter(_=>_!==e),a()))return;const{finalFocusTo:y}=t;y!==void 0?(b=Lf(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&l instanceof HTMLElement&&(s=!0,l.focus({preventScroll:!0}),s=!1)}function m(b){if(a()&&t.active){const y=i.value,_=r.value;if(y!==null&&_!==null){const k=u();if(k==null||k===_){s=!0,y.focus({preventScroll:!0}),s=!1;return}s=!0;const x=b==="first"?fh(k):hh(k);s=!1,x||(s=!0,y.focus({preventScroll:!0}),s=!1)}}}function p(b){if(s)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?m("last"):m("first"))}function g(b){s||(b.relatedTarget!==null&&b.relatedTarget===i.value?m("last"):m("first"))}return{focusableStartRef:i,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:p,handleEndFocus:g}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:i}=this;return n.h(n.Fragment,null,[n.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:i,onFocus:this.handleStartFocus}),t(),n.h("div",{"aria-hidden":"true",style:i,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function JN(t){return t}const Zl="n-internal-select-menu",ph="n-internal-select-menu-body",gh="n-drawer-body",yh="n-modal-body",bh="n-popover-body",_h="__disabled__";function jn(t){const e=n.inject(yh,null),i=n.inject(gh,null),r=n.inject(bh,null),o=n.inject(ph,null),s=n.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const l=()=>{s.value=document.fullscreenElement};n.onMounted(()=>{It("fullscreenchange",document,l)}),n.onBeforeUnmount(()=>{ht("fullscreenchange",document,l)})}return on(()=>{var l;const{to:a}=t;return a!==void 0?a===!1?_h:a===!0?s.value||"body":a:e!=null&&e.value?(l=e.value.$el)!==null&&l!==void 0?l:e.value:i!=null&&i.value?i.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:a??(s.value||"body")})}jn.tdkey=_h,jn.propTo={type:[String,Object,Boolean],default:void 0};function rS(t){const e={isDeactivated:!1};let i=!1;return n.onActivated(()=>{if(e.isDeactivated=!1,!i){i=!0;return}t()}),n.onDeactivated(()=>{e.isDeactivated=!0,i||(i=!0)}),e}function wh(t,e){e&&(n.onMounted(()=>{const{value:i}=t;i&&jr.registerHandler(i,e)}),n.watch(t,(i,r)=>{r&&jr.unregisterHandler(r)},{deep:!1}),n.onBeforeUnmount(()=>{const{value:i}=t;i&&jr.unregisterHandler(i)}))}function xh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const oS=/^(\d|\.)+$/,kh=/(\d|\.)+/;function Ql(t,{c:e=1,offset:i=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+i)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(oS.test(t)){const o=(Number(t)+i)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=kh.exec(t);return o?t.replace(kh,String((Number(o[0])+i)*e)):t}return t}function Ch(t){const{left:e,right:i,top:r,bottom:o}=mn(t);return`${r} ${e} ${o} ${i}`}var vh={};function sS(t){let e=".",i="__",r="--",o;if(t){let p=t.blockPrefix;p&&(e=p),p=t.elementPrefix,p&&(i=p),p=t.modifierPrefix,p&&(r=p)}const s={install(p){o=p.c;const g=p.context;g.bem={},g.bem.b=null,g.bem.els=null}};function l(p){let g,b;return{before(y){g=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=g,y.bem.els=b},$({context:y,props:_}){return p=typeof p=="string"?p:p({context:y,props:_}),y.bem.b=p,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function a(p){let g;return{before(b){g=b.bem.els},after(b){b.bem.els=g},$({context:b,props:y}){return p=typeof p=="string"?p:p({context:b,props:y}),b.bem.els=p.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${i}${_}`).join(", ")}}}function c(p){return{$({context:g,props:b}){p=typeof p=="string"?p:p({context:g,props:b});const y=p.split(",").map(x=>x.trim());function _(x){return y.map(v=>`&${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${x!==void 0?`${i}${x}`:""}${r}${v}`).join(", ")}const k=g.bem.els;if(k!==null){if(vh.NODE_ENV!=="production"&&k.length>=2)throw Error(`[css-render/plugin-bem]: m(${p}) is invalid, using modifier inside multiple elements is not allowed`);return _(k[0])}else return _()}}}function d(p){return{$({context:g,props:b}){p=typeof p=="string"?p:p({context:g,props:b});const y=g.bem.els;if(vh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${p}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${y!==null&&y.length>0?`${i}${y[0]}`:""}${r}${p})`}}}return Object.assign(s,{cB:((...p)=>o(l(p[0]),p[1],p[2])),cE:((...p)=>o(a(p[0]),p[1],p[2])),cM:((...p)=>o(c(p[0]),p[1],p[2])),cNotM:((...p)=>o(d(p[0]),p[1],p[2]))}),s}const lS=".n-",aS="__",cS="--",Sh=Of(),Bh=sS({blockPrefix:lS,elementPrefix:aS,modifierPrefix:cS});Sh.use(Bh);const{c:he,find:tT}=Sh,{cB:be,cE:Ce,cM:Pe,cNotM:pn}=Bh,dS=(...t)=>he(">",[be(...t)]);function nt(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,i=>i.toUpperCase()))}let Jl;function uS(){return Jl===void 0&&(Jl=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Jl}const fS=new WeakSet;function hS(t){fS.add(t)}function Nh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Th=new Set;function fi(t,e){const i=`[naive/${t}]: ${e}`;Th.has(i)||(Th.add(i),console.error(i))}function $h(t,e){console.error(`[naive/${t}]: ${e}`)}function Eh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function Bt(t,...e){if(Array.isArray(t))t.forEach(i=>Bt(i,...e));else return t(...e)}function ea(t,e=!0,i=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(n.createTextVNode(String(r)));return}if(Array.isArray(r)){ea(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ea(r.children,e,i)}else{if(r.type===n.Comment&&e)return;i.push(r)}}}),i}function mS(t,e="default",i=void 0){const r=t[e];if(!r)return $h("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=ea(r(i));return o.length===1?o[0]:($h("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function pS(t,e=[],i){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,i)}function ta(t){const e=t.filter(i=>i!==void 0);if(e.length!==0)return e.length===1?e[0]:i=>{t.forEach(r=>{r&&r(i)})}}function gr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?n.createTextVNode(t):typeof t=="number"?n.createTextVNode(String(t)):null}function fs(t){return t.some(e=>n.isVNode(e)?!(e.type===n.Comment||e.type===n.Fragment&&!fs(e.children)):!0)?t:null}function na(t,e){return t&&fs(t())||e()}function Vi(t,e){const i=t&&fs(t());return e(i||null)}function Rh(t){return!(t&&fs(t()))}const ia=n.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Mi="n-config-provider",gS="n";function Ii(t={},e={defaultBordered:!0}){const i=n.inject(Mi,null);return{inlineThemeDisabled:i==null?void 0:i.inlineThemeDisabled,mergedRtlRef:i==null?void 0:i.mergedRtlRef,mergedComponentPropsRef:i==null?void 0:i.mergedComponentPropsRef,mergedBreakpointsRef:i==null?void 0:i.mergedBreakpointsRef,mergedBorderedRef:n.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=i==null?void 0:i.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:i?i.mergedClsPrefixRef:n.shallowRef(gS),namespaceRef:n.computed(()=>i==null?void 0:i.mergedNamespaceRef.value)}}function Ai(t,e,i,r){i||Eh("useThemeClass","cssVarsRef is not passed");const o=n.inject(Mi,null),s=o==null?void 0:o.mergedThemeHashRef,l=o==null?void 0:o.styleMountTarget,a=n.ref(""),c=Ri();let d;const u=`__${t}`,f=()=>{let h=u;const m=e?e.value:void 0,p=s==null?void 0:s.value;p&&(h+=`-${p}`),m&&(h+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:b}=r;g&&(h+=`-${Wl(JSON.stringify(g))}`),b&&(h+=`-${Wl(JSON.stringify(b))}`),a.value=h,d=()=>{const y=i.value;let _="";for(const k in y)_+=`${k}: ${y[k]};`;he(`.${h}`,_).mount({id:h,ssr:c,parent:l}),d=void 0}};return n.watchEffect(()=>{f()}),{themeClass:a,onRender:()=>{d==null||d()}}}const Ph="n-form-item";function yS(t,{defaultSize:e="medium",mergedSize:i,mergedDisabled:r}={}){const o=n.inject(Ph,null);n.provide(Ph,null);const s=n.computed(i?()=>i(o):()=>{const{size:c}=t;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),l=n.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),a=n.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return n.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:l,mergedStatusRef:a,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const bS={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ra(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}function Xr(t){return(e,i)=>{const r=i!=null&&i.context?String(i.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,a=i!=null&&i.width?String(i.width):l;o=t.formattingValues[a]||t.formattingValues[l]}else{const l=t.defaultWidth,a=i!=null&&i.width?String(i.width):t.defaultWidth;o=t.values[a]||t.values[l]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function Yr(t){return(e,i={})=>{const r=i.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(o);if(!s)return null;const l=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?wS(a,f=>f.test(l)):_S(a,f=>f.test(l));let d;d=t.valueCallback?t.valueCallback(c):c,d=i.valueCallback?i.valueCallback(d):d;const u=e.slice(l.length);return{value:d,rest:u}}}function _S(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i}function wS(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i}function xS(t){return(e,i={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0],s=e.match(t.parsePattern);if(!s)return null;let l=t.valueCallback?t.valueCallback(s[0]):s[0];l=i.valueCallback?i.valueCallback(l):l;const a=e.slice(o.length);return{value:l,rest:a}}}const kS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},CS=(t,e,i)=>{let r;const o=kS[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r},vS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SS=(t,e,i,r)=>vS[t],BS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},NS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$S={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ES={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},RS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},PS={ordinalNumber:(t,e)=>{const i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Xr({values:BS,defaultWidth:"wide"}),quarter:Xr({values:NS,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Xr({values:TS,defaultWidth:"wide"}),day:Xr({values:$S,defaultWidth:"wide"}),dayPeriod:Xr({values:ES,defaultWidth:"wide",formattingValues:RS,defaultFormattingWidth:"wide"})},FS=/^(\d+)(th|st|nd|rd)?/i,VS=/\d+/i,MS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},IS={any:[/^b/i,/^(a|c)/i]},AS={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},OS={any:[/1/i,/2/i,/3/i,/4/i]},zS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},DS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},LS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},WS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},qS={ordinalNumber:xS({matchPattern:FS,parsePattern:VS,valueCallback:t=>parseInt(t,10)}),era:Yr({matchPatterns:MS,defaultMatchWidth:"wide",parsePatterns:IS,defaultParseWidth:"any"}),quarter:Yr({matchPatterns:AS,defaultMatchWidth:"wide",parsePatterns:OS,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Yr({matchPatterns:zS,defaultMatchWidth:"wide",parsePatterns:DS,defaultParseWidth:"any"}),day:Yr({matchPatterns:LS,defaultMatchWidth:"wide",parsePatterns:HS,defaultParseWidth:"any"}),dayPeriod:Yr({matchPatterns:WS,defaultMatchWidth:"any",parsePatterns:jS,defaultParseWidth:"any"})},XS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},YS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},KS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},US={date:ra({formats:XS,defaultWidth:"full"}),time:ra({formats:YS,defaultWidth:"full"}),dateTime:ra({formats:KS,defaultWidth:"full"})},GS={name:"en-US",locale:{code:"en-US",formatDistance:CS,formatLong:US,formatRelative:SS,localize:PS,match:qS,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Fh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:i}=n.inject(Mi,null)||{},r=n.computed(()=>{var s,l;return(l=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&l!==void 0?l:bS[t]});return{dateLocaleRef:n.computed(()=>{var s;return(s=i==null?void 0:i.value)!==null&&s!==void 0?s:GS}),localeRef:r}}const Kr="naive-ui-style";function Ur(t,e,i){if(!e)return;const r=Ri(),o=n.computed(()=>{const{value:a}=e;if(!a)return;const c=a[t];if(c)return c}),s=n.inject(Mi,null),l=()=>{n.watchEffect(()=>{const{value:a}=i,c=`${a}${t}Rtl`;if(wv(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Kr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?l():n.onBeforeMount(l),o}const Gr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:ZS,fontFamily:QS,lineHeight:JS}=Gr,Vh=he("body",`
|
|
117
117
|
margin: 0;
|
|
118
118
|
font-size: ${ZS};
|
|
119
119
|
font-family: ${QS};
|
|
@@ -123,7 +123,7 @@ ${o}
|
|
|
123
123
|
`,[he("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var eB={};function hs(t,e,i){if(!e){eB.NODE_ENV!=="production"&&Eh("use-style","No style is specified.");return}const r=Ri(),o=n.inject(Mi,null),s=()=>{const l=i.value;e.mount({id:l===void 0?t:l+t,head:!0,anchorMetaName:
|
|
126
|
+
`)]);var eB={};function hs(t,e,i){if(!e){eB.NODE_ENV!=="production"&&Eh("use-style","No style is specified.");return}const r=Ri(),o=n.inject(Mi,null),s=()=>{const l=i.value;e.mount({id:l===void 0?t:l+t,head:!0,anchorMetaName:Kr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||Vh.mount({id:"n-global",head:!0,anchorMetaName:Kr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():n.onBeforeMount(s)}function rT(t){return t}function Nt(t,e,i,r,o,s){const l=Ri(),a=n.inject(Mi,null);if(i){const d=()=>{const u=s==null?void 0:s.value;i.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Kr,ssr:l,parent:a==null?void 0:a.styleMountTarget}),a!=null&&a.preflightStyleDisabled||Vh.mount({id:"n-global",head:!0,anchorMetaName:Kr,ssr:l,parent:a==null?void 0:a.styleMountTarget})};l?d():n.onBeforeMount(d)}return n.computed(()=>{var d;const{theme:{common:u,self:f,peers:h={}}={},themeOverrides:m={},builtinThemeOverrides:p={}}=o,{common:g,peers:b}=m,{common:y=void 0,[t]:{common:_=void 0,self:k=void 0,peers:x={}}={}}=(a==null?void 0:a.mergedThemeRef.value)||{},{common:v=void 0,[t]:N={}}=(a==null?void 0:a.mergedThemeOverridesRef.value)||{},{common:w,peers:T={}}=N,C=A.merge({},u||_||y||r.common,v,w,g),$=A.merge((d=f||k||r.self)===null||d===void 0?void 0:d(C),p,N,m);return{common:C,self:$,peers:A.merge({},r.peers,x,h),peerOverrides:A.merge({},p.peers,T,b)}})}Nt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const tB=be("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -186,7 +186,7 @@ ${o}
|
|
|
186
186
|
transform: translateY(-50%) translateX(-50%);
|
|
187
187
|
transition: inherit;
|
|
188
188
|
border-radius: inherit;
|
|
189
|
-
`),
|
|
189
|
+
`),pn("disabled",[he("&:hover",`
|
|
190
190
|
color: var(--n-close-icon-color-hover);
|
|
191
191
|
`),he("&:hover::before",`
|
|
192
192
|
background-color: var(--n-close-color-hover);
|
|
@@ -294,7 +294,7 @@ ${o}
|
|
|
294
294
|
pointer-events: all;
|
|
295
295
|
background-color: var(--n-scrollbar-color);
|
|
296
296
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
|
297
|
-
`,[pB(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),xB=Object.assign(Object.assign({},Nt.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"}}),Lh=n.defineComponent({name:"Scrollbar",props:xB,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedRtlRef:r}=Ii(t),o=Kr("Scrollbar",r,e),s=n.ref(null),l=n.ref(null),a=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),f=n.ref(null),h=n.ref(null),m=n.ref(null),p=n.ref(null),g=n.ref(null),b=n.ref(0),y=n.ref(0),_=n.ref(!1),k=n.ref(!1);let x=!1,v=!1,N,w,T=0,C=0,$=0,E=0;const V=ZC(),P=Nt("Scrollbar","-scrollbar",wB,la,t,e),I=n.computed(()=>{const{value:D}=h,{value:Q}=u,{value:se}=p;return D===null||Q===null||se===null?0:Math.min(D,se*D/Q+zr(P.value.self.width)*1.5)}),K=n.computed(()=>`${I.value}px`),J=n.computed(()=>{const{value:D}=m,{value:Q}=f,{value:se}=g;return D===null||Q===null||se===null?0:se*D/Q+zr(P.value.self.height)*1.5}),Z=n.computed(()=>`${J.value}px`),L=n.computed(()=>{const{value:D}=h,{value:Q}=b,{value:se}=u,{value:me}=p;if(D===null||se===null||me===null)return 0;{const ge=se-D;return ge?Q/ge*(me-I.value):0}}),O=n.computed(()=>`${L.value}px`),z=n.computed(()=>{const{value:D}=m,{value:Q}=y,{value:se}=f,{value:me}=g;if(D===null||se===null||me===null)return 0;{const ge=se-D;return ge?Q/ge*(me-J.value):0}}),M=n.computed(()=>`${z.value}px`),R=n.computed(()=>{const{value:D}=h,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),W=n.computed(()=>{const{value:D}=m,{value:Q}=f;return D!==null&&Q!==null&&Q>D}),U=n.computed(()=>{const{trigger:D}=t;return D==="none"||_.value}),G=n.computed(()=>{const{trigger:D}=t;return D==="none"||k.value}),X=n.computed(()=>{const{container:D}=t;return D?D():l.value}),j=n.computed(()=>{const{content:D}=t;return D?D():a.value}),q=(D,Q)=>{if(!t.scrollable)return;if(typeof D=="number"){_e(D,Q??0,0,!1,"auto");return}const{left:se,top:me,index:ge,elSize:xe,position:Be,behavior:Te,el:et,debounce:In=!0}=D;(se!==void 0||me!==void 0)&&_e(se??0,me??0,0,!1,Te),et!==void 0?_e(0,et.offsetTop,et.offsetHeight,In,Te):ge!==void 0&&xe!==void 0?_e(0,ge*xe,xe,In,Te):Be==="bottom"?_e(0,Number.MAX_SAFE_INTEGER,0,!1,Te):Be==="top"&&_e(0,0,0,!1,Te)},le=rS(()=>{t.container||q({top:b.value,left:y.value})}),de=()=>{le.isDeactivated||ce()},ve=D=>{if(le.isDeactivated)return;const{onResize:Q}=t;Q&&Q(D),ce()},st=(D,Q)=>{if(!t.scrollable)return;const{value:se}=X;se&&(typeof D=="object"?se.scrollBy(D):se.scrollBy(D,Q||0))};function _e(D,Q,se,me,ge){const{value:xe}=X;if(xe){if(me){const{scrollTop:Be,offsetHeight:Te}=xe;if(Q>Be){Q+se<=Be+Te||xe.scrollTo({left:D,top:Q+se-Te,behavior:ge});return}}xe.scrollTo({left:D,top:Q,behavior:ge})}}function we(){Rt(),Jn(),ce()}function xt(){Ee()}function Ee(){Zt(),gn()}function Zt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{k.value=!1},t.duration)}function gn(){N!==void 0&&window.clearTimeout(N),N=window.setTimeout(()=>{_.value=!1},t.duration)}function Rt(){N!==void 0&&window.clearTimeout(N),_.value=!0}function Jn(){w!==void 0&&window.clearTimeout(w),k.value=!0}function yn(D){const{onScroll:Q}=t;Q&&Q(D),ln()}function ln(){const{value:D}=X;D&&(b.value=D.scrollTop,y.value=D.scrollLeft*(o!=null&&o.value?-1:1))}function Me(){const{value:D}=j;D&&(u.value=D.offsetHeight,f.value=D.offsetWidth);const{value:Q}=X;Q&&(h.value=Q.offsetHeight,m.value=Q.offsetWidth);const{value:se}=d,{value:me}=c;se&&(g.value=se.offsetWidth),me&&(p.value=me.offsetHeight)}function te(){const{value:D}=X;D&&(b.value=D.scrollTop,y.value=D.scrollLeft*(o!=null&&o.value?-1:1),h.value=D.offsetHeight,m.value=D.offsetWidth,u.value=D.scrollHeight,f.value=D.scrollWidth);const{value:Q}=d,{value:se}=c;Q&&(g.value=Q.offsetWidth),se&&(p.value=se.offsetHeight)}function ce(){t.scrollable&&(t.useUnifiedContainer?te():(Me(),ln()))}function Ie(D){var Q;return!(!((Q=s.value)===null||Q===void 0)&&Q.contains(Or(D)))}function mi(D){D.preventDefault(),D.stopPropagation(),v=!0,It("mousemove",window,at,!0),It("mouseup",window,Qt,!0),C=y.value,$=o!=null&&o.value?window.innerWidth-D.clientX:D.clientX}function at(D){if(!v)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:Q}=m,{value:se}=f,{value:me}=J;if(Q===null||se===null)return;const xe=(o!=null&&o.value?window.innerWidth-D.clientX-$:D.clientX-$)*(se-Q)/(Q-me),Be=se-Q;let Te=C+xe;Te=Math.min(Be,Te),Te=Math.max(Te,0);const{value:et}=X;if(et){et.scrollLeft=Te*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:In}=t;In&&In(Te)}}function Qt(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,at,!0),ht("mouseup",window,Qt,!0),v=!1,ce(),Ie(D)&&Ee()}function yr(D){D.preventDefault(),D.stopPropagation(),x=!0,It("mousemove",window,pi,!0),It("mouseup",window,Hi,!0),T=b.value,E=D.clientY}function pi(D){if(!x)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:Q}=h,{value:se}=u,{value:me}=I;if(Q===null||se===null)return;const xe=(D.clientY-E)*(se-Q)/(Q-me),Be=se-Q;let Te=T+xe;Te=Math.min(Be,Te),Te=Math.max(Te,0);const{value:et}=X;et&&(et.scrollTop=Te)}function Hi(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,pi,!0),ht("mouseup",window,Hi,!0),x=!1,ce(),Ie(D)&&Ee()}n.watchEffect(()=>{const{value:D}=W,{value:Q}=R,{value:se}=e,{value:me}=d,{value:ge}=c;me&&(D?me.classList.remove(`${se}-scrollbar-rail--disabled`):me.classList.add(`${se}-scrollbar-rail--disabled`)),ge&&(Q?ge.classList.remove(`${se}-scrollbar-rail--disabled`):ge.classList.add(`${se}-scrollbar-rail--disabled`))}),n.onMounted(()=>{t.container||ce()}),n.onBeforeUnmount(()=>{N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w),ht("mousemove",window,pi,!0),ht("mouseup",window,Hi,!0)});const br=n.computed(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:se,height:me,width:ge,borderRadius:xe,railInsetHorizontalTop:Be,railInsetHorizontalBottom:Te,railInsetVerticalRight:et,railInsetVerticalLeft:In,railColor:pa}}=P.value,{top:ga,right:ya,bottom:ba,left:_a}=hn(Be),{top:wa,right:xa,bottom:ka,left:Ca}=hn(Te),{top:va,right:Sa,bottom:Ba,left:Na}=hn(o!=null&&o.value?Ch(et):et),{top:Ta,right:$a,bottom:Ea,left:Ra}=hn(o!=null&&o.value?Ch(In):In);return{"--n-scrollbar-bezier":D,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":xe,"--n-scrollbar-width":ge,"--n-scrollbar-height":me,"--n-scrollbar-rail-top-horizontal-top":ga,"--n-scrollbar-rail-right-horizontal-top":ya,"--n-scrollbar-rail-bottom-horizontal-top":ba,"--n-scrollbar-rail-left-horizontal-top":_a,"--n-scrollbar-rail-top-horizontal-bottom":wa,"--n-scrollbar-rail-right-horizontal-bottom":xa,"--n-scrollbar-rail-bottom-horizontal-bottom":ka,"--n-scrollbar-rail-left-horizontal-bottom":Ca,"--n-scrollbar-rail-top-vertical-right":va,"--n-scrollbar-rail-right-vertical-right":Sa,"--n-scrollbar-rail-bottom-vertical-right":Ba,"--n-scrollbar-rail-left-vertical-right":Na,"--n-scrollbar-rail-top-vertical-left":Ta,"--n-scrollbar-rail-right-vertical-left":$a,"--n-scrollbar-rail-bottom-vertical-left":Ea,"--n-scrollbar-rail-left-vertical-left":Ra,"--n-scrollbar-rail-color":pa}}),bn=i?Ai("scrollbar",void 0,br,t):void 0;return Object.assign(Object.assign({},{scrollTo:q,scrollBy:st,sync:ce,syncUnifiedContainer:te,handleMouseEnterWrapper:we,handleMouseLeaveWrapper:xt}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:l,contentRef:a,yRailRef:c,xRailRef:d,needYBar:R,needXBar:W,yBarSizePx:K,xBarSizePx:Z,yBarTopPx:O,xBarLeftPx:M,isShowXBar:U,isShowYBar:G,isIos:V,handleScroll:yn,handleContentResize:de,handleContainerResize:ve,handleYScrollMouseDown:yr,handleXScrollMouseDown:mi,cssVars:i?void 0:br,themeClass:bn==null?void 0:bn.themeClass,onRender:bn==null?void 0:bn.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:i,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:s,yPlacement:l,xPlacement:a,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=(m,p)=>n.h("div",{ref:"yRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--vertical`,`${i}-scrollbar-rail--vertical--${l}`,m],"data-scrollbar-rail":!0,style:[p||"",this.verticalRailStyle],"aria-hidden":!0},n.h(d?ia:n.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?n.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var m,p;return(m=this.onRender)===null||m===void 0||m.call(this),n.h("div",n.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${i}-scrollbar`,this.themeClass,o&&`${i}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(p=e.default)===null||p===void 0?void 0:p.call(e):n.h("div",{role:"none",ref:"containerRef",class:[`${i}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},n.h(ds,{onResize:this.handleContentResize},{default:()=>n.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${i}-scrollbar-content`,this.contentClass]},e)})),s?null:u(void 0,void 0),c&&n.h("div",{ref:"xRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--horizontal`,`${i}-scrollbar-rail--horizontal--${a}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},n.h(d?ia:n.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?n.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},h=this.container?f():n.h(ds,{onResize:this.handleContainerResize},{default:f});return s?n.h(n.Fragment,null,h,u(this.themeClass,this.cssVars)):h}}),kB=Lh,CB={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function vB(t){const{textColorDisabled:e,iconColor:i,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:c}=t;return Object.assign(Object.assign({},CB),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:c,textColor:e,iconColor:i,extraTextColor:r})}const Hh={name:"Empty",common:Oi,self:vB},SB=be("empty",`
|
|
297
|
+
`,[pB(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),xB=Object.assign(Object.assign({},Nt.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"}}),Lh=n.defineComponent({name:"Scrollbar",props:xB,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedRtlRef:r}=Ii(t),o=Ur("Scrollbar",r,e),s=n.ref(null),l=n.ref(null),a=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),f=n.ref(null),h=n.ref(null),m=n.ref(null),p=n.ref(null),g=n.ref(null),b=n.ref(0),y=n.ref(0),_=n.ref(!1),k=n.ref(!1);let x=!1,v=!1,N,w,T=0,C=0,$=0,E=0;const V=ZC(),P=Nt("Scrollbar","-scrollbar",wB,la,t,e),I=n.computed(()=>{const{value:D}=h,{value:Q}=u,{value:se}=p;return D===null||Q===null||se===null?0:Math.min(D,se*D/Q+zr(P.value.self.width)*1.5)}),U=n.computed(()=>`${I.value}px`),J=n.computed(()=>{const{value:D}=m,{value:Q}=f,{value:se}=g;return D===null||Q===null||se===null?0:se*D/Q+zr(P.value.self.height)*1.5}),Z=n.computed(()=>`${J.value}px`),L=n.computed(()=>{const{value:D}=h,{value:Q}=b,{value:se}=u,{value:me}=p;if(D===null||se===null||me===null)return 0;{const ge=se-D;return ge?Q/ge*(me-I.value):0}}),O=n.computed(()=>`${L.value}px`),z=n.computed(()=>{const{value:D}=m,{value:Q}=y,{value:se}=f,{value:me}=g;if(D===null||se===null||me===null)return 0;{const ge=se-D;return ge?Q/ge*(me-J.value):0}}),M=n.computed(()=>`${z.value}px`),R=n.computed(()=>{const{value:D}=h,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),W=n.computed(()=>{const{value:D}=m,{value:Q}=f;return D!==null&&Q!==null&&Q>D}),K=n.computed(()=>{const{trigger:D}=t;return D==="none"||_.value}),G=n.computed(()=>{const{trigger:D}=t;return D==="none"||k.value}),X=n.computed(()=>{const{container:D}=t;return D?D():l.value}),j=n.computed(()=>{const{content:D}=t;return D?D():a.value}),q=(D,Q)=>{if(!t.scrollable)return;if(typeof D=="number"){_e(D,Q??0,0,!1,"auto");return}const{left:se,top:me,index:ge,elSize:xe,position:Be,behavior:Te,el:et,debounce:In=!0}=D;(se!==void 0||me!==void 0)&&_e(se??0,me??0,0,!1,Te),et!==void 0?_e(0,et.offsetTop,et.offsetHeight,In,Te):ge!==void 0&&xe!==void 0?_e(0,ge*xe,xe,In,Te):Be==="bottom"?_e(0,Number.MAX_SAFE_INTEGER,0,!1,Te):Be==="top"&&_e(0,0,0,!1,Te)},le=rS(()=>{t.container||q({top:b.value,left:y.value})}),de=()=>{le.isDeactivated||ce()},ve=D=>{if(le.isDeactivated)return;const{onResize:Q}=t;Q&&Q(D),ce()},st=(D,Q)=>{if(!t.scrollable)return;const{value:se}=X;se&&(typeof D=="object"?se.scrollBy(D):se.scrollBy(D,Q||0))};function _e(D,Q,se,me,ge){const{value:xe}=X;if(xe){if(me){const{scrollTop:Be,offsetHeight:Te}=xe;if(Q>Be){Q+se<=Be+Te||xe.scrollTo({left:D,top:Q+se-Te,behavior:ge});return}}xe.scrollTo({left:D,top:Q,behavior:ge})}}function we(){Rt(),Jn(),ce()}function xt(){Ee()}function Ee(){Zt(),yn()}function Zt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{k.value=!1},t.duration)}function yn(){N!==void 0&&window.clearTimeout(N),N=window.setTimeout(()=>{_.value=!1},t.duration)}function Rt(){N!==void 0&&window.clearTimeout(N),_.value=!0}function Jn(){w!==void 0&&window.clearTimeout(w),k.value=!0}function bn(D){const{onScroll:Q}=t;Q&&Q(D),ln()}function ln(){const{value:D}=X;D&&(b.value=D.scrollTop,y.value=D.scrollLeft*(o!=null&&o.value?-1:1))}function Me(){const{value:D}=j;D&&(u.value=D.offsetHeight,f.value=D.offsetWidth);const{value:Q}=X;Q&&(h.value=Q.offsetHeight,m.value=Q.offsetWidth);const{value:se}=d,{value:me}=c;se&&(g.value=se.offsetWidth),me&&(p.value=me.offsetHeight)}function te(){const{value:D}=X;D&&(b.value=D.scrollTop,y.value=D.scrollLeft*(o!=null&&o.value?-1:1),h.value=D.offsetHeight,m.value=D.offsetWidth,u.value=D.scrollHeight,f.value=D.scrollWidth);const{value:Q}=d,{value:se}=c;Q&&(g.value=Q.offsetWidth),se&&(p.value=se.offsetHeight)}function ce(){t.scrollable&&(t.useUnifiedContainer?te():(Me(),ln()))}function Ie(D){var Q;return!(!((Q=s.value)===null||Q===void 0)&&Q.contains(Or(D)))}function mi(D){D.preventDefault(),D.stopPropagation(),v=!0,It("mousemove",window,at,!0),It("mouseup",window,Qt,!0),C=y.value,$=o!=null&&o.value?window.innerWidth-D.clientX:D.clientX}function at(D){if(!v)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:Q}=m,{value:se}=f,{value:me}=J;if(Q===null||se===null)return;const xe=(o!=null&&o.value?window.innerWidth-D.clientX-$:D.clientX-$)*(se-Q)/(Q-me),Be=se-Q;let Te=C+xe;Te=Math.min(Be,Te),Te=Math.max(Te,0);const{value:et}=X;if(et){et.scrollLeft=Te*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:In}=t;In&&In(Te)}}function Qt(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,at,!0),ht("mouseup",window,Qt,!0),v=!1,ce(),Ie(D)&&Ee()}function yr(D){D.preventDefault(),D.stopPropagation(),x=!0,It("mousemove",window,pi,!0),It("mouseup",window,Hi,!0),T=b.value,E=D.clientY}function pi(D){if(!x)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:Q}=h,{value:se}=u,{value:me}=I;if(Q===null||se===null)return;const xe=(D.clientY-E)*(se-Q)/(Q-me),Be=se-Q;let Te=T+xe;Te=Math.min(Be,Te),Te=Math.max(Te,0);const{value:et}=X;et&&(et.scrollTop=Te)}function Hi(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,pi,!0),ht("mouseup",window,Hi,!0),x=!1,ce(),Ie(D)&&Ee()}n.watchEffect(()=>{const{value:D}=W,{value:Q}=R,{value:se}=e,{value:me}=d,{value:ge}=c;me&&(D?me.classList.remove(`${se}-scrollbar-rail--disabled`):me.classList.add(`${se}-scrollbar-rail--disabled`)),ge&&(Q?ge.classList.remove(`${se}-scrollbar-rail--disabled`):ge.classList.add(`${se}-scrollbar-rail--disabled`))}),n.onMounted(()=>{t.container||ce()}),n.onBeforeUnmount(()=>{N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w),ht("mousemove",window,pi,!0),ht("mouseup",window,Hi,!0)});const br=n.computed(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:se,height:me,width:ge,borderRadius:xe,railInsetHorizontalTop:Be,railInsetHorizontalBottom:Te,railInsetVerticalRight:et,railInsetVerticalLeft:In,railColor:pa}}=P.value,{top:ga,right:ya,bottom:ba,left:_a}=mn(Be),{top:wa,right:xa,bottom:ka,left:Ca}=mn(Te),{top:va,right:Sa,bottom:Ba,left:Na}=mn(o!=null&&o.value?Ch(et):et),{top:Ta,right:$a,bottom:Ea,left:Ra}=mn(o!=null&&o.value?Ch(In):In);return{"--n-scrollbar-bezier":D,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":xe,"--n-scrollbar-width":ge,"--n-scrollbar-height":me,"--n-scrollbar-rail-top-horizontal-top":ga,"--n-scrollbar-rail-right-horizontal-top":ya,"--n-scrollbar-rail-bottom-horizontal-top":ba,"--n-scrollbar-rail-left-horizontal-top":_a,"--n-scrollbar-rail-top-horizontal-bottom":wa,"--n-scrollbar-rail-right-horizontal-bottom":xa,"--n-scrollbar-rail-bottom-horizontal-bottom":ka,"--n-scrollbar-rail-left-horizontal-bottom":Ca,"--n-scrollbar-rail-top-vertical-right":va,"--n-scrollbar-rail-right-vertical-right":Sa,"--n-scrollbar-rail-bottom-vertical-right":Ba,"--n-scrollbar-rail-left-vertical-right":Na,"--n-scrollbar-rail-top-vertical-left":Ta,"--n-scrollbar-rail-right-vertical-left":$a,"--n-scrollbar-rail-bottom-vertical-left":Ea,"--n-scrollbar-rail-left-vertical-left":Ra,"--n-scrollbar-rail-color":pa}}),_n=i?Ai("scrollbar",void 0,br,t):void 0;return Object.assign(Object.assign({},{scrollTo:q,scrollBy:st,sync:ce,syncUnifiedContainer:te,handleMouseEnterWrapper:we,handleMouseLeaveWrapper:xt}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:l,contentRef:a,yRailRef:c,xRailRef:d,needYBar:R,needXBar:W,yBarSizePx:U,xBarSizePx:Z,yBarTopPx:O,xBarLeftPx:M,isShowXBar:K,isShowYBar:G,isIos:V,handleScroll:bn,handleContentResize:de,handleContainerResize:ve,handleYScrollMouseDown:yr,handleXScrollMouseDown:mi,cssVars:i?void 0:br,themeClass:_n==null?void 0:_n.themeClass,onRender:_n==null?void 0:_n.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:i,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:s,yPlacement:l,xPlacement:a,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=(m,p)=>n.h("div",{ref:"yRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--vertical`,`${i}-scrollbar-rail--vertical--${l}`,m],"data-scrollbar-rail":!0,style:[p||"",this.verticalRailStyle],"aria-hidden":!0},n.h(d?ia:n.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?n.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var m,p;return(m=this.onRender)===null||m===void 0||m.call(this),n.h("div",n.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${i}-scrollbar`,this.themeClass,o&&`${i}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(p=e.default)===null||p===void 0?void 0:p.call(e):n.h("div",{role:"none",ref:"containerRef",class:[`${i}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},n.h(ds,{onResize:this.handleContentResize},{default:()=>n.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${i}-scrollbar-content`,this.contentClass]},e)})),s?null:u(void 0,void 0),c&&n.h("div",{ref:"xRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--horizontal`,`${i}-scrollbar-rail--horizontal--${a}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},n.h(d?ia:n.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?n.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},h=this.container?f():n.h(ds,{onResize:this.handleContainerResize},{default:f});return s?n.h(n.Fragment,null,h,u(this.themeClass,this.cssVars)):h}}),kB=Lh,CB={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function vB(t){const{textColorDisabled:e,iconColor:i,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:c}=t;return Object.assign(Object.assign({},CB),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:c,textColor:e,iconColor:i,extraTextColor:r})}const Hh={name:"Empty",common:Oi,self:vB},SB=be("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
@@ -317,7 +317,7 @@ ${o}
|
|
|
317
317
|
transition: color .3s var(--n-bezier);
|
|
318
318
|
margin-top: 12px;
|
|
319
319
|
color: var(--n-extra-text-color);
|
|
320
|
-
`)]),BB=Object.assign(Object.assign({},Nt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),NB=n.defineComponent({name:"Empty",props:BB,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedComponentPropsRef:r}=Ii(t),o=Nt("Empty","-empty",SB,Hh,t,e),{localeRef:s}=Fh("Empty"),l=n.computed(()=>{var u,f,h;return(u=t.description)!==null&&u!==void 0?u:(h=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||h===void 0?void 0:h.description}),a=n.computed(()=>{var u,f;return((f=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>n.h(sB,null))}),c=n.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:f},self:{[nt("iconSize",u)]:h,[nt("fontSize",u)]:m,textColor:p,iconColor:g,extraTextColor:b}}=o.value;return{"--n-icon-size":h,"--n-font-size":m,"--n-bezier":f,"--n-text-color":p,"--n-icon-color":g,"--n-extra-text-color":b}}),d=i?Ai("empty",n.computed(()=>{let u="";const{size:f}=t;return u+=f[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:a,localizedDescription:n.computed(()=>l.value||s.value.description),cssVars:i?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:i}=this;return i==null||i(),n.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?n.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():n.h(Zr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?n.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?n.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),TB={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function $B(t){const{borderRadius:e,popoverColor:i,textColor3:r,dividerColor:o,textColor2:s,primaryColorPressed:l,textColorDisabled:a,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:f,fontSizeSmall:h,fontSizeMedium:m,fontSizeLarge:p,fontSizeHuge:g,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:k,heightHuge:x}=t;return Object.assign(Object.assign({},TB),{optionFontSizeTiny:f,optionFontSizeSmall:h,optionFontSizeMedium:m,optionFontSizeLarge:p,optionFontSizeHuge:g,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:k,optionHeightHuge:x,borderRadius:e,color:i,groupHeaderTextColor:r,actionDividerColor:o,optionTextColor:s,optionTextColorPressed:l,optionTextColorDisabled:a,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:s,loadingColor:c})}const Wh={name:"InternalSelectMenu",common:Oi,peers:{Scrollbar:la,Empty:Hh},self:$B},jh=n.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:i,nodePropsRef:r}=n.inject(Zl);return{labelField:i,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:i,nodeProps:r,tmNode:{rawNode:o}}=this,s=r==null?void 0:r(o),l=e?e(o,!1):gr(o[this.labelField],o,!1),a=n.h("div",Object.assign({},s,{class:[`${t}-base-select-group-header`,s==null?void 0:s.class]}),l);return o.render?o.render({node:a,option:o}):i?i({node:a,option:o,selected:!1}):a}});function EB(t,e){return n.h(n.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?n.h(Zr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>n.h(nB)}):null})}const qh=n.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:i,multipleRef:r,valueSetRef:o,renderLabelRef:s,renderOptionRef:l,labelFieldRef:a,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:f,handleOptionMouseEnter:h}=n.inject(Zl),m=on(()=>{const{value:y}=i;return y?t.tmNode.key===y.key:!1});function p(y){const{tmNode:_}=t;_.disabled||f(y,_)}function g(y){const{tmNode:_}=t;_.disabled||h(y,_)}function b(y){const{tmNode:_}=t,{value:k}=m;_.disabled||k||h(y,_)}return{multiple:r,isGrouped:on(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:m,isSelected:on(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const k=t.tmNode.rawNode[c.value];if(_){const{value:x}=o;return x.has(k)}else return y===k}),labelField:a,renderLabel:s,renderOption:l,handleMouseMove:b,handleMouseEnter:g,handleClick:p}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:i,isPending:r,isGrouped:o,showCheckmark:s,nodeProps:l,renderOption:a,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:f}=this,h=EB(i,t),m=c?[c(e,i),s&&h]:[gr(e[this.labelField],e,i),s&&h],p=l==null?void 0:l(e),g=n.h("div",Object.assign({},p,{class:[`${t}-base-select-option`,e.class,p==null?void 0:p.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:i,[`${t}-base-select-option--grouped`]:o,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:s}],style:[(p==null?void 0:p.style)||"",e.style||""],onClick:ta([d,p==null?void 0:p.onClick]),onMouseenter:ta([u,p==null?void 0:p.onMouseenter]),onMousemove:ta([f,p==null?void 0:p.onMousemove])}),n.h("div",{class:`${t}-base-select-option__content`},m));return e.render?e.render({node:g,option:e,selected:i}):a?a({node:g,option:e,selected:i}):g}}),{cubicBezierEaseIn:Xh,cubicBezierEaseOut:Yh}=Gr;function
|
|
320
|
+
`)]),BB=Object.assign(Object.assign({},Nt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),NB=n.defineComponent({name:"Empty",props:BB,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedComponentPropsRef:r}=Ii(t),o=Nt("Empty","-empty",SB,Hh,t,e),{localeRef:s}=Fh("Empty"),l=n.computed(()=>{var u,f,h;return(u=t.description)!==null&&u!==void 0?u:(h=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||h===void 0?void 0:h.description}),a=n.computed(()=>{var u,f;return((f=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>n.h(sB,null))}),c=n.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:f},self:{[nt("iconSize",u)]:h,[nt("fontSize",u)]:m,textColor:p,iconColor:g,extraTextColor:b}}=o.value;return{"--n-icon-size":h,"--n-font-size":m,"--n-bezier":f,"--n-text-color":p,"--n-icon-color":g,"--n-extra-text-color":b}}),d=i?Ai("empty",n.computed(()=>{let u="";const{size:f}=t;return u+=f[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:a,localizedDescription:n.computed(()=>l.value||s.value.description),cssVars:i?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:i}=this;return i==null||i(),n.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?n.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():n.h(Zr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?n.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?n.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),TB={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function $B(t){const{borderRadius:e,popoverColor:i,textColor3:r,dividerColor:o,textColor2:s,primaryColorPressed:l,textColorDisabled:a,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:f,fontSizeSmall:h,fontSizeMedium:m,fontSizeLarge:p,fontSizeHuge:g,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:k,heightHuge:x}=t;return Object.assign(Object.assign({},TB),{optionFontSizeTiny:f,optionFontSizeSmall:h,optionFontSizeMedium:m,optionFontSizeLarge:p,optionFontSizeHuge:g,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:k,optionHeightHuge:x,borderRadius:e,color:i,groupHeaderTextColor:r,actionDividerColor:o,optionTextColor:s,optionTextColorPressed:l,optionTextColorDisabled:a,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:s,loadingColor:c})}const Wh={name:"InternalSelectMenu",common:Oi,peers:{Scrollbar:la,Empty:Hh},self:$B},jh=n.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:i,nodePropsRef:r}=n.inject(Zl);return{labelField:i,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:i,nodeProps:r,tmNode:{rawNode:o}}=this,s=r==null?void 0:r(o),l=e?e(o,!1):gr(o[this.labelField],o,!1),a=n.h("div",Object.assign({},s,{class:[`${t}-base-select-group-header`,s==null?void 0:s.class]}),l);return o.render?o.render({node:a,option:o}):i?i({node:a,option:o,selected:!1}):a}});function EB(t,e){return n.h(n.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?n.h(Zr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>n.h(nB)}):null})}const qh=n.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:i,multipleRef:r,valueSetRef:o,renderLabelRef:s,renderOptionRef:l,labelFieldRef:a,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:f,handleOptionMouseEnter:h}=n.inject(Zl),m=on(()=>{const{value:y}=i;return y?t.tmNode.key===y.key:!1});function p(y){const{tmNode:_}=t;_.disabled||f(y,_)}function g(y){const{tmNode:_}=t;_.disabled||h(y,_)}function b(y){const{tmNode:_}=t,{value:k}=m;_.disabled||k||h(y,_)}return{multiple:r,isGrouped:on(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:m,isSelected:on(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const k=t.tmNode.rawNode[c.value];if(_){const{value:x}=o;return x.has(k)}else return y===k}),labelField:a,renderLabel:s,renderOption:l,handleMouseMove:b,handleMouseEnter:g,handleClick:p}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:i,isPending:r,isGrouped:o,showCheckmark:s,nodeProps:l,renderOption:a,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:f}=this,h=EB(i,t),m=c?[c(e,i),s&&h]:[gr(e[this.labelField],e,i),s&&h],p=l==null?void 0:l(e),g=n.h("div",Object.assign({},p,{class:[`${t}-base-select-option`,e.class,p==null?void 0:p.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:i,[`${t}-base-select-option--grouped`]:o,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:s}],style:[(p==null?void 0:p.style)||"",e.style||""],onClick:ta([d,p==null?void 0:p.onClick]),onMouseenter:ta([u,p==null?void 0:p.onMouseenter]),onMousemove:ta([f,p==null?void 0:p.onMousemove])}),n.h("div",{class:`${t}-base-select-option__content`},m));return e.render?e.render({node:g,option:e,selected:i}):a?a({node:g,option:e,selected:i}):g}}),{cubicBezierEaseIn:Xh,cubicBezierEaseOut:Yh}=Gr;function Kh({transformOrigin:t="inherit",duration:e=".2s",enterScale:i=".9",originalTransform:r="",originalTransition:o=""}={}){return[he("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Xh}, transform ${e} ${Xh} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Yh}, transform ${e} ${Yh} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${i})`}),he("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const RB=be("base-select-menu",`
|
|
321
321
|
line-height: 1.5;
|
|
322
322
|
outline: none;
|
|
323
323
|
z-index: 0;
|
|
@@ -413,7 +413,7 @@ ${o}
|
|
|
413
413
|
background-color: var(--n-option-color-active-pending);
|
|
414
414
|
`)])]),Pe("disabled",`
|
|
415
415
|
cursor: not-allowed;
|
|
416
|
-
`,[
|
|
416
|
+
`,[pn("selected",`
|
|
417
417
|
color: var(--n-option-text-color-disabled);
|
|
418
418
|
`),Pe("selected",`
|
|
419
419
|
opacity: var(--n-option-opacity-disabled);
|
|
@@ -424,7 +424,7 @@ ${o}
|
|
|
424
424
|
top: calc(50% - 7px);
|
|
425
425
|
color: var(--n-option-check-color);
|
|
426
426
|
transition: color .3s var(--n-bezier);
|
|
427
|
-
`,[
|
|
427
|
+
`,[Kh({enterScale:"0.5"})])])]),PB=n.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Nt.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:i}=Ii(t),r=Ur("InternalSelectMenu",i,e),o=Nt("InternalSelectMenu","-internal-select-menu",RB,Wh,t,n.toRef(t,"clsPrefix")),s=n.ref(null),l=n.ref(null),a=n.ref(null),c=n.computed(()=>t.treeMate.getFlattenedNodes()),d=n.computed(()=>vC(c.value)),u=n.ref(null);function f(){const{treeMate:R}=t;let W=null;const{value:K}=t;K===null?W=R.getFirstAvailableNode():(t.multiple?W=R.getNode((K||[])[(K||[]).length-1]):W=R.getNode(K),(!W||W.disabled)&&(W=R.getFirstAvailableNode())),I(W||null)}function h(){const{value:R}=u;R&&!t.treeMate.getNode(R.key)&&(u.value=null)}let m;n.watch(()=>t.show,R=>{R?m=n.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?f():h(),n.nextTick(U)):h()},{immediate:!0}):m==null||m()},{immediate:!0}),n.onBeforeUnmount(()=>{m==null||m()});const p=n.computed(()=>zr(o.value.self[nt("optionHeight",t.size)])),g=n.computed(()=>mn(o.value.self[nt("padding",t.size)])),b=n.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=n.computed(()=>{const R=c.value;return R&&R.length===0});function _(R){const{onToggle:W}=t;W&&W(R)}function k(R){const{onScroll:W}=t;W&&W(R)}function x(R){var W;(W=a.value)===null||W===void 0||W.sync(),k(R)}function v(){var R;(R=a.value)===null||R===void 0||R.sync()}function N(){const{value:R}=u;return R||null}function w(R,W){W.disabled||I(W,!1)}function T(R,W){W.disabled||_(W)}function C(R){var W;Ar(R,"action")||(W=t.onKeyup)===null||W===void 0||W.call(t,R)}function $(R){var W;Ar(R,"action")||(W=t.onKeydown)===null||W===void 0||W.call(t,R)}function E(R){var W;(W=t.onMousedown)===null||W===void 0||W.call(t,R),!t.focusable&&R.preventDefault()}function V(){const{value:R}=u;R&&I(R.getNext({loop:!0}),!0)}function P(){const{value:R}=u;R&&I(R.getPrev({loop:!0}),!0)}function I(R,W=!1){u.value=R,W&&U()}function U(){var R,W;const K=u.value;if(!K)return;const G=d.value(K.key);G!==null&&(t.virtualScroll?(R=l.value)===null||R===void 0||R.scrollTo({index:G}):(W=a.value)===null||W===void 0||W.scrollTo({index:G,elSize:p.value}))}function J(R){var W,K;!((W=s.value)===null||W===void 0)&&W.contains(R.target)&&((K=t.onFocus)===null||K===void 0||K.call(t,R))}function Z(R){var W,K;!((W=s.value)===null||W===void 0)&&W.contains(R.relatedTarget)||(K=t.onBlur)===null||K===void 0||K.call(t,R)}n.provide(Zl,{handleOptionMouseEnter:w,handleOptionClick:T,valueSetRef:b,pendingTmNodeRef:u,nodePropsRef:n.toRef(t,"nodeProps"),showCheckmarkRef:n.toRef(t,"showCheckmark"),multipleRef:n.toRef(t,"multiple"),valueRef:n.toRef(t,"value"),renderLabelRef:n.toRef(t,"renderLabel"),renderOptionRef:n.toRef(t,"renderOption"),labelFieldRef:n.toRef(t,"labelField"),valueFieldRef:n.toRef(t,"valueField")}),n.provide(ph,s),n.onMounted(()=>{const{value:R}=a;R&&R.sync()});const L=n.computed(()=>{const{size:R}=t,{common:{cubicBezierEaseInOut:W},self:{height:K,borderRadius:G,color:X,groupHeaderTextColor:j,actionDividerColor:q,optionTextColorPressed:le,optionTextColor:de,optionTextColorDisabled:ve,optionTextColorActive:st,optionOpacityDisabled:_e,optionCheckColor:we,actionTextColor:xt,optionColorPending:Ee,optionColorActive:Zt,loadingColor:yn,loadingSize:Rt,optionColorActivePending:Jn,[nt("optionFontSize",R)]:bn,[nt("optionHeight",R)]:ln,[nt("optionPadding",R)]:Me}}=o.value;return{"--n-height":K,"--n-action-divider-color":q,"--n-action-text-color":xt,"--n-bezier":W,"--n-border-radius":G,"--n-color":X,"--n-option-font-size":bn,"--n-group-header-text-color":j,"--n-option-check-color":we,"--n-option-color-pending":Ee,"--n-option-color-active":Zt,"--n-option-color-active-pending":Jn,"--n-option-height":ln,"--n-option-opacity-disabled":_e,"--n-option-text-color":de,"--n-option-text-color-active":st,"--n-option-text-color-disabled":ve,"--n-option-text-color-pressed":le,"--n-option-padding":Me,"--n-option-padding-left":mn(Me,"left"),"--n-option-padding-right":mn(Me,"right"),"--n-loading-color":yn,"--n-loading-size":Rt}}),{inlineThemeDisabled:O}=t,z=O?Ai("internal-select-menu",n.computed(()=>t.size[0]),L,t):void 0,M={selfRef:s,next:V,prev:P,getPendingTmNode:N};return wh(s,t.onResize),Object.assign({mergedTheme:o,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:l,scrollbarRef:a,itemSize:p,padding:g,flattenedNodes:c,empty:y,virtualListContainer(){const{value:R}=l;return R==null?void 0:R.listElRef},virtualListContent(){const{value:R}=l;return R==null?void 0:R.itemsElRef},doScroll:k,handleFocusin:J,handleFocusout:Z,handleKeyUp:C,handleKeyDown:$,handleMouseDown:E,handleVirtualListResize:v,handleVirtualListScroll:x,cssVars:O?void 0:L,themeClass:z==null?void 0:z.themeClass,onRender:z==null?void 0:z.onRender},M)},render(){const{$slots:t,virtualScroll:e,clsPrefix:i,mergedTheme:r,themeClass:o,onRender:s}=this;return s==null||s(),n.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${i}-base-select-menu`,this.rtlEnabled&&`${i}-base-select-menu--rtl`,o,this.multiple&&`${i}-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},Vi(t.header,l=>l&&n.h("div",{class:`${i}-base-select-menu__header`,"data-header":!0,key:"header"},l)),this.loading?n.h("div",{class:`${i}-base-select-menu__loading`},n.h(Ah,{clsPrefix:i,strokeWidth:20})):this.empty?n.h("div",{class:`${i}-base-select-menu__empty`,"data-empty":!0},na(t.empty,()=>[n.h(NB,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):n.h(Lh,{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?n.h(eS,{ref:"virtualListRef",class:`${i}-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:l})=>l.isGroup?n.h(jh,{key:l.key,clsPrefix:i,tmNode:l}):l.ignored?null:n.h(qh,{clsPrefix:i,key:l.key,tmNode:l})}):n.h("div",{class:`${i}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(l=>l.isGroup?n.h(jh,{key:l.key,clsPrefix:i,tmNode:l}):n.h(qh,{clsPrefix:i,key:l.key,tmNode:l})))}),Vi(t.action,l=>l&&[n.h("div",{class:`${i}-base-select-menu__action`,"data-action":!0,key:"action"},l),n.h(fB,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),FB={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function VB(t){const{boxShadow2:e,popoverColor:i,textColor2:r,borderRadius:o,fontSize:s,dividerColor:l}=t;return Object.assign(Object.assign({},FB),{fontSize:s,borderRadius:o,color:i,dividerColor:l,textColor:r,boxShadow:e})}const Uh={name:"Popover",common:Oi,peers:{Scrollbar:la},self:VB},aa={top:"bottom",bottom:"top",left:"right",right:"left"},mt="var(--n-arrow-height) * 1.414",MB=he([be("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -437,10 +437,10 @@ ${o}
|
|
|
437
437
|
`,[he(">",[be("scrollbar",`
|
|
438
438
|
height: inherit;
|
|
439
439
|
max-height: inherit;
|
|
440
|
-
`)]),
|
|
440
|
+
`)]),pn("raw",`
|
|
441
441
|
background-color: var(--n-color);
|
|
442
442
|
border-radius: var(--n-border-radius);
|
|
443
|
-
`,[
|
|
443
|
+
`,[pn("scrollable",[pn("show-header-or-footer","padding: var(--n-padding);")])]),Ce("header",`
|
|
444
444
|
padding: var(--n-padding);
|
|
445
445
|
border-bottom: 1px solid var(--n-divider-color);
|
|
446
446
|
transition: border-color .3s var(--n-bezier);
|
|
@@ -540,7 +540,7 @@ ${o}
|
|
|
540
540
|
${i}: 100%;
|
|
541
541
|
${aa[i]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[be("popover-arrow",e)])])])}const Gh=Object.assign(Object.assign({},Nt.props),{to:jn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function IB({arrowClass:t,arrowStyle:e,arrowWrapperClass:i,arrowWrapperStyle:r,clsPrefix:o}){return n.h("div",{key:"__popover-arrow__",style:r,class:[`${o}-popover-arrow-wrapper`,i]},n.h("div",{class:[`${o}-popover-arrow`,t],style:e}))}const AB=n.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Gh,setup(t,{slots:e,attrs:i}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:l}=Ii(t),a=Nt("Popover","-popover",MB,Kh,t,o),c=Kr("Popover",l,o),d=n.ref(null),u=n.inject("NPopover"),f=n.ref(null),h=n.ref(t.show),m=n.ref(!1);n.watchEffect(()=>{const{show:C}=t;C&&!uS()&&!t.internalDeactivateImmediately&&(m.value=!0)});const p=n.computed(()=>{const{trigger:C,onClickoutside:$}=t,E=[],{positionManuallyRef:{value:V}}=u;return V||(C==="click"&&!$&&E.push([es,N,void 0,{capture:!0}]),C==="hover"&&E.push([jC,v])),$&&E.push([es,N,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&E.push([n.vShow,t.show]),E}),g=n.computed(()=>{const{common:{cubicBezierEaseInOut:C,cubicBezierEaseIn:$,cubicBezierEaseOut:E},self:{space:V,spaceArrow:P,padding:I,fontSize:K,textColor:J,dividerColor:Z,color:L,boxShadow:O,borderRadius:z,arrowHeight:M,arrowOffset:R,arrowOffsetVertical:W}}=a.value;return{"--n-box-shadow":O,"--n-bezier":C,"--n-bezier-ease-in":$,"--n-bezier-ease-out":E,"--n-font-size":K,"--n-text-color":J,"--n-color":L,"--n-divider-color":Z,"--n-border-radius":z,"--n-arrow-height":M,"--n-arrow-offset":R,"--n-arrow-offset-vertical":W,"--n-padding":I,"--n-space":V,"--n-space-arrow":P}}),b=n.computed(()=>{const C=t.width==="trigger"?void 0:Ql(t.width),$=[];C&&$.push({width:C});const{maxWidth:E,minWidth:V}=t;return E&&$.push({maxWidth:Ql(E)}),V&&$.push({maxWidth:Ql(V)}),s||$.push(g.value),$}),y=s?Ai("popover",void 0,g,t):void 0;u.setBodyInstance({syncPosition:_}),n.onBeforeUnmount(()=>{u.setBodyInstance(null)}),n.watch(n.toRef(t,"show"),C=>{t.animated||(C?h.value=!0:h.value=!1)});function _(){var C;(C=d.value)===null||C===void 0||C.syncPosition()}function k(C){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(C)}function x(C){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(C)}function v(C){t.trigger==="hover"&&!w().contains(Or(C))&&u.handleMouseMoveOutside(C)}function N(C){(t.trigger==="click"&&!w().contains(Or(C))||t.onClickoutside)&&u.handleClickOutside(C)}function w(){return u.getTriggerElement()}n.provide(bh,f),n.provide(gh,null),n.provide(yh,null);function T(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let $;const E=u.internalRenderBodyRef.value,{value:V}=o;if(E)$=E([`${V}-popover-shared`,(c==null?void 0:c.value)&&`${V}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${V}-popover-shared--overlap`,t.showArrow&&`${V}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${V}-popover-shared--center-arrow`],f,b.value,k,x);else{const{value:P}=u.extraClassRef,{internalTrapFocus:I}=t,K=!Rh(e.header)||!Rh(e.footer),J=()=>{var Z,L;const O=K?n.h(n.Fragment,null,Vi(e.header,R=>R?n.h("div",{class:[`${V}-popover__header`,t.headerClass],style:t.headerStyle},R):null),Vi(e.default,R=>R?n.h("div",{class:[`${V}-popover__content`,t.contentClass],style:t.contentStyle},e):null),Vi(e.footer,R=>R?n.h("div",{class:[`${V}-popover__footer`,t.footerClass],style:t.footerStyle},R):null)):t.scrollable?(Z=e.default)===null||Z===void 0?void 0:Z.call(e):n.h("div",{class:[`${V}-popover__content`,t.contentClass],style:t.contentStyle},e),z=t.scrollable?n.h(kB,{themeOverrides:a.value.peerOverrides.Scrollbar,theme:a.value.peers.Scrollbar,contentClass:K?void 0:`${V}-popover__content ${(L=t.contentClass)!==null&&L!==void 0?L:""}`,contentStyle:K?void 0:t.contentStyle},{default:()=>O}):O,M=t.showArrow?IB({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:V}):null;return[z,M]};$=n.h("div",n.mergeProps({class:[`${V}-popover`,`${V}-popover-shared`,(c==null?void 0:c.value)&&`${V}-popover--rtl`,y==null?void 0:y.themeClass.value,P.map(Z=>`${V}-${Z}`),{[`${V}-popover--scrollable`]:t.scrollable,[`${V}-popover--show-header-or-footer`]:K,[`${V}-popover--raw`]:t.raw,[`${V}-popover-shared--overlap`]:t.overlap,[`${V}-popover-shared--show-arrow`]:t.showArrow,[`${V}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:f,style:b.value,onKeydown:u.handleKeydown,onMouseenter:k,onMouseleave:x},i),I?n.h(iS,{active:t.show,autoFocus:!0},{default:J}):J())}return n.withDirectives($,p.value)}return{displayed:m,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:jn(t),followerEnabled:h,renderContentNode:T}},render(){return n.h(qf,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===jn.tdkey},{default:()=>this.animated?n.h(n.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var OB={};const zB=Object.keys(Gh),DB={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function LB(t,e,i){DB[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const o=t.props[r],s=i[r];o?t.props[r]=(...l)=>{o(...l),s(...l)}:t.props[r]=s})}const HB={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:jn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},WB=Object.assign(Object.assign(Object.assign({},Nt.props),HB),{internalOnAfterLeave:Function,internalRenderBody:Function}),jB=n.defineComponent({name:"Popover",inheritAttrs:!1,props:WB,slots:Object,__popover__:!0,setup(t){OB.NODE_ENV!=="production"&&n.watchEffect(()=>{t.maxWidth!==void 0&&fi("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&fi("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&fi("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&fi("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&fi("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=ts(),i=n.ref(null),r=n.computed(()=>t.show),o=n.ref(t.defaultShow),s=Ol(r,o),l=on(()=>t.disabled?!1:s.value),a=()=>{if(t.disabled)return!0;const{getDisabled:K}=t;return!!(K!=null&&K())},c=()=>a()?!1:s.value,d=Sf(t,["arrow","showArrow"]),u=n.computed(()=>t.overlap?!1:d.value);let f=null;const h=n.ref(null),m=n.ref(null),p=on(()=>t.x!==void 0&&t.y!==void 0);function g(K){const{"onUpdate:show":J,onUpdateShow:Z,onShow:L,onHide:O}=t;o.value=K,J&&Bt(J,K),Z&&Bt(Z,K),K&&L&&Bt(L,!0),K&&O&&Bt(O,!1)}function b(){f&&f.syncPosition()}function y(){const{value:K}=h;K&&(window.clearTimeout(K),h.value=null)}function _(){const{value:K}=m;K&&(window.clearTimeout(K),m.value=null)}function k(){const K=a();if(t.trigger==="focus"&&!K){if(c())return;g(!0)}}function x(){const K=a();if(t.trigger==="focus"&&!K){if(!c())return;g(!1)}}function v(){const K=a();if(t.trigger==="hover"&&!K){if(_(),h.value!==null||c())return;const J=()=>{g(!0),h.value=null},{delay:Z}=t;Z===0?J():h.value=window.setTimeout(J,Z)}}function N(){const K=a();if(t.trigger==="hover"&&!K){if(y(),m.value!==null||!c())return;const J=()=>{g(!1),m.value=null},{duration:Z}=t;Z===0?J():m.value=window.setTimeout(J,Z)}}function w(){N()}function T(K){var J;c()&&(t.trigger==="click"&&(y(),_(),g(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,K))}function C(){if(t.trigger==="click"&&!a()){y(),_();const K=!c();g(K)}}function $(K){t.internalTrapFocus&&K.key==="Escape"&&(y(),_(),g(!1))}function E(K){o.value=K}function V(){var K;return(K=i.value)===null||K===void 0?void 0:K.targetRef}function P(K){f=K}return n.provide("NPopover",{getTriggerElement:V,handleKeydown:$,handleMouseEnter:v,handleMouseLeave:N,handleClickOutside:T,handleMouseMoveOutside:w,setBodyInstance:P,positionManuallyRef:p,isMountedRef:e,zIndexRef:n.toRef(t,"zIndex"),extraClassRef:n.toRef(t,"internalExtraClass"),internalRenderBodyRef:n.toRef(t,"internalRenderBody")}),n.watchEffect(()=>{s.value&&a()&&g(!1)}),{binderInstRef:i,positionManually:p,mergedShowConsideringDisabledProp:l,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:E,handleClick:C,handleMouseEnter:v,handleMouseLeave:N,handleFocus:k,handleBlur:x,syncPosition:b}},render(){var t;const{positionManually:e,$slots:i}=this;let r,o=!1;if(!e&&(r=mS(i,"trigger"),r)){r=n.cloneVNode(r),r=r.type===n.Text?n.h("span",[r]):r;const s={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[s,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[s];else{const{internalInheritedEventHandlers:l}=this,a=[s,...l],c={onBlur:d=>{a.forEach(u=>{u.onBlur(d)})},onFocus:d=>{a.forEach(u=>{u.onFocus(d)})},onClick:d=>{a.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{a.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{a.forEach(u=>{u.onMouseleave(d)})}};LB(r,l?"nested":e?"manual":this.trigger,c)}}return n.h($f,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const s=this.getMergedShow();return[this.internalTrapFocus&&s?n.withDirectives(n.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[vf,{enabled:s,zIndex:this.zIndex}]]):null,e?null:n.h(Ef,null,{default:()=>r}),n.h(AB,pS(this.$props,zB,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:s})),{default:()=>{var l,a;return(a=(l=this.$slots).default)===null||a===void 0?void 0:a.call(l)},header:()=>{var l,a;return(a=(l=this.$slots).header)===null||a===void 0?void 0:a.call(l)},footer:()=>{var l,a;return(a=(l=this.$slots).footer)===null||a===void 0?void 0:a.call(l)}})]}})}}),qB={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function XB(t){const{textColor2:e,primaryColorHover:i,primaryColorPressed:r,primaryColor:o,infoColor:s,successColor:l,warningColor:a,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:f,tagColor:h,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:x,heightMini:v,heightTiny:N,heightSmall:w,heightMedium:T,closeColorHover:C,closeColorPressed:$,buttonColor2Hover:E,buttonColor2Pressed:V,fontWeightStrong:P}=t;return Object.assign(Object.assign({},qB),{closeBorderRadius:b,heightTiny:v,heightSmall:N,heightMedium:w,heightLarge:T,borderRadius:b,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:k,fontSizeLarge:x,fontWeightStrong:P,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:V,colorChecked:o,colorCheckedHover:i,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:h,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,closeColorHover:C,closeColorPressed:$,borderPrimary:`1px solid ${Le(o,{alpha:.3})}`,textColorPrimary:o,colorPrimary:Le(o,{alpha:.12}),colorBorderedPrimary:Le(o,{alpha:.1}),closeIconColorPrimary:o,closeIconColorHoverPrimary:o,closeIconColorPressedPrimary:o,closeColorHoverPrimary:Le(o,{alpha:.12}),closeColorPressedPrimary:Le(o,{alpha:.18}),borderInfo:`1px solid ${Le(s,{alpha:.3})}`,textColorInfo:s,colorInfo:Le(s,{alpha:.12}),colorBorderedInfo:Le(s,{alpha:.1}),closeIconColorInfo:s,closeIconColorHoverInfo:s,closeIconColorPressedInfo:s,closeColorHoverInfo:Le(s,{alpha:.12}),closeColorPressedInfo:Le(s,{alpha:.18}),borderSuccess:`1px solid ${Le(l,{alpha:.3})}`,textColorSuccess:l,colorSuccess:Le(l,{alpha:.12}),colorBorderedSuccess:Le(l,{alpha:.1}),closeIconColorSuccess:l,closeIconColorHoverSuccess:l,closeIconColorPressedSuccess:l,closeColorHoverSuccess:Le(l,{alpha:.12}),closeColorPressedSuccess:Le(l,{alpha:.18}),borderWarning:`1px solid ${Le(a,{alpha:.35})}`,textColorWarning:a,colorWarning:Le(a,{alpha:.15}),colorBorderedWarning:Le(a,{alpha:.12}),closeIconColorWarning:a,closeIconColorHoverWarning:a,closeIconColorPressedWarning:a,closeColorHoverWarning:Le(a,{alpha:.12}),closeColorPressedWarning:Le(a,{alpha:.18}),borderError:`1px solid ${Le(c,{alpha:.23})}`,textColorError:c,colorError:Le(c,{alpha:.1}),colorBorderedError:Le(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Le(c,{alpha:.12}),closeColorPressedError:Le(c,{alpha:.18})})}const YB={common:Oi,self:XB},UB={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},KB=be("tag",`
|
|
543
|
+
`,[be("popover-arrow",e)])])])}const Gh=Object.assign(Object.assign({},Nt.props),{to:jn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function IB({arrowClass:t,arrowStyle:e,arrowWrapperClass:i,arrowWrapperStyle:r,clsPrefix:o}){return n.h("div",{key:"__popover-arrow__",style:r,class:[`${o}-popover-arrow-wrapper`,i]},n.h("div",{class:[`${o}-popover-arrow`,t],style:e}))}const AB=n.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Gh,setup(t,{slots:e,attrs:i}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:l}=Ii(t),a=Nt("Popover","-popover",MB,Uh,t,o),c=Ur("Popover",l,o),d=n.ref(null),u=n.inject("NPopover"),f=n.ref(null),h=n.ref(t.show),m=n.ref(!1);n.watchEffect(()=>{const{show:C}=t;C&&!uS()&&!t.internalDeactivateImmediately&&(m.value=!0)});const p=n.computed(()=>{const{trigger:C,onClickoutside:$}=t,E=[],{positionManuallyRef:{value:V}}=u;return V||(C==="click"&&!$&&E.push([es,N,void 0,{capture:!0}]),C==="hover"&&E.push([jC,v])),$&&E.push([es,N,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&E.push([n.vShow,t.show]),E}),g=n.computed(()=>{const{common:{cubicBezierEaseInOut:C,cubicBezierEaseIn:$,cubicBezierEaseOut:E},self:{space:V,spaceArrow:P,padding:I,fontSize:U,textColor:J,dividerColor:Z,color:L,boxShadow:O,borderRadius:z,arrowHeight:M,arrowOffset:R,arrowOffsetVertical:W}}=a.value;return{"--n-box-shadow":O,"--n-bezier":C,"--n-bezier-ease-in":$,"--n-bezier-ease-out":E,"--n-font-size":U,"--n-text-color":J,"--n-color":L,"--n-divider-color":Z,"--n-border-radius":z,"--n-arrow-height":M,"--n-arrow-offset":R,"--n-arrow-offset-vertical":W,"--n-padding":I,"--n-space":V,"--n-space-arrow":P}}),b=n.computed(()=>{const C=t.width==="trigger"?void 0:Ql(t.width),$=[];C&&$.push({width:C});const{maxWidth:E,minWidth:V}=t;return E&&$.push({maxWidth:Ql(E)}),V&&$.push({maxWidth:Ql(V)}),s||$.push(g.value),$}),y=s?Ai("popover",void 0,g,t):void 0;u.setBodyInstance({syncPosition:_}),n.onBeforeUnmount(()=>{u.setBodyInstance(null)}),n.watch(n.toRef(t,"show"),C=>{t.animated||(C?h.value=!0:h.value=!1)});function _(){var C;(C=d.value)===null||C===void 0||C.syncPosition()}function k(C){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(C)}function x(C){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(C)}function v(C){t.trigger==="hover"&&!w().contains(Or(C))&&u.handleMouseMoveOutside(C)}function N(C){(t.trigger==="click"&&!w().contains(Or(C))||t.onClickoutside)&&u.handleClickOutside(C)}function w(){return u.getTriggerElement()}n.provide(bh,f),n.provide(gh,null),n.provide(yh,null);function T(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let $;const E=u.internalRenderBodyRef.value,{value:V}=o;if(E)$=E([`${V}-popover-shared`,(c==null?void 0:c.value)&&`${V}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${V}-popover-shared--overlap`,t.showArrow&&`${V}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${V}-popover-shared--center-arrow`],f,b.value,k,x);else{const{value:P}=u.extraClassRef,{internalTrapFocus:I}=t,U=!Rh(e.header)||!Rh(e.footer),J=()=>{var Z,L;const O=U?n.h(n.Fragment,null,Vi(e.header,R=>R?n.h("div",{class:[`${V}-popover__header`,t.headerClass],style:t.headerStyle},R):null),Vi(e.default,R=>R?n.h("div",{class:[`${V}-popover__content`,t.contentClass],style:t.contentStyle},e):null),Vi(e.footer,R=>R?n.h("div",{class:[`${V}-popover__footer`,t.footerClass],style:t.footerStyle},R):null)):t.scrollable?(Z=e.default)===null||Z===void 0?void 0:Z.call(e):n.h("div",{class:[`${V}-popover__content`,t.contentClass],style:t.contentStyle},e),z=t.scrollable?n.h(kB,{themeOverrides:a.value.peerOverrides.Scrollbar,theme:a.value.peers.Scrollbar,contentClass:U?void 0:`${V}-popover__content ${(L=t.contentClass)!==null&&L!==void 0?L:""}`,contentStyle:U?void 0:t.contentStyle},{default:()=>O}):O,M=t.showArrow?IB({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:V}):null;return[z,M]};$=n.h("div",n.mergeProps({class:[`${V}-popover`,`${V}-popover-shared`,(c==null?void 0:c.value)&&`${V}-popover--rtl`,y==null?void 0:y.themeClass.value,P.map(Z=>`${V}-${Z}`),{[`${V}-popover--scrollable`]:t.scrollable,[`${V}-popover--show-header-or-footer`]:U,[`${V}-popover--raw`]:t.raw,[`${V}-popover-shared--overlap`]:t.overlap,[`${V}-popover-shared--show-arrow`]:t.showArrow,[`${V}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:f,style:b.value,onKeydown:u.handleKeydown,onMouseenter:k,onMouseleave:x},i),I?n.h(iS,{active:t.show,autoFocus:!0},{default:J}):J())}return n.withDirectives($,p.value)}return{displayed:m,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:jn(t),followerEnabled:h,renderContentNode:T}},render(){return n.h(qf,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===jn.tdkey},{default:()=>this.animated?n.h(n.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var OB={};const zB=Object.keys(Gh),DB={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function LB(t,e,i){DB[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const o=t.props[r],s=i[r];o?t.props[r]=(...l)=>{o(...l),s(...l)}:t.props[r]=s})}const HB={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:jn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},WB=Object.assign(Object.assign(Object.assign({},Nt.props),HB),{internalOnAfterLeave:Function,internalRenderBody:Function}),jB=n.defineComponent({name:"Popover",inheritAttrs:!1,props:WB,slots:Object,__popover__:!0,setup(t){OB.NODE_ENV!=="production"&&n.watchEffect(()=>{t.maxWidth!==void 0&&fi("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&fi("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&fi("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&fi("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&fi("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=ts(),i=n.ref(null),r=n.computed(()=>t.show),o=n.ref(t.defaultShow),s=Ol(r,o),l=on(()=>t.disabled?!1:s.value),a=()=>{if(t.disabled)return!0;const{getDisabled:U}=t;return!!(U!=null&&U())},c=()=>a()?!1:s.value,d=Sf(t,["arrow","showArrow"]),u=n.computed(()=>t.overlap?!1:d.value);let f=null;const h=n.ref(null),m=n.ref(null),p=on(()=>t.x!==void 0&&t.y!==void 0);function g(U){const{"onUpdate:show":J,onUpdateShow:Z,onShow:L,onHide:O}=t;o.value=U,J&&Bt(J,U),Z&&Bt(Z,U),U&&L&&Bt(L,!0),U&&O&&Bt(O,!1)}function b(){f&&f.syncPosition()}function y(){const{value:U}=h;U&&(window.clearTimeout(U),h.value=null)}function _(){const{value:U}=m;U&&(window.clearTimeout(U),m.value=null)}function k(){const U=a();if(t.trigger==="focus"&&!U){if(c())return;g(!0)}}function x(){const U=a();if(t.trigger==="focus"&&!U){if(!c())return;g(!1)}}function v(){const U=a();if(t.trigger==="hover"&&!U){if(_(),h.value!==null||c())return;const J=()=>{g(!0),h.value=null},{delay:Z}=t;Z===0?J():h.value=window.setTimeout(J,Z)}}function N(){const U=a();if(t.trigger==="hover"&&!U){if(y(),m.value!==null||!c())return;const J=()=>{g(!1),m.value=null},{duration:Z}=t;Z===0?J():m.value=window.setTimeout(J,Z)}}function w(){N()}function T(U){var J;c()&&(t.trigger==="click"&&(y(),_(),g(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,U))}function C(){if(t.trigger==="click"&&!a()){y(),_();const U=!c();g(U)}}function $(U){t.internalTrapFocus&&U.key==="Escape"&&(y(),_(),g(!1))}function E(U){o.value=U}function V(){var U;return(U=i.value)===null||U===void 0?void 0:U.targetRef}function P(U){f=U}return n.provide("NPopover",{getTriggerElement:V,handleKeydown:$,handleMouseEnter:v,handleMouseLeave:N,handleClickOutside:T,handleMouseMoveOutside:w,setBodyInstance:P,positionManuallyRef:p,isMountedRef:e,zIndexRef:n.toRef(t,"zIndex"),extraClassRef:n.toRef(t,"internalExtraClass"),internalRenderBodyRef:n.toRef(t,"internalRenderBody")}),n.watchEffect(()=>{s.value&&a()&&g(!1)}),{binderInstRef:i,positionManually:p,mergedShowConsideringDisabledProp:l,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:E,handleClick:C,handleMouseEnter:v,handleMouseLeave:N,handleFocus:k,handleBlur:x,syncPosition:b}},render(){var t;const{positionManually:e,$slots:i}=this;let r,o=!1;if(!e&&(r=mS(i,"trigger"),r)){r=n.cloneVNode(r),r=r.type===n.Text?n.h("span",[r]):r;const s={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[s,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[s];else{const{internalInheritedEventHandlers:l}=this,a=[s,...l],c={onBlur:d=>{a.forEach(u=>{u.onBlur(d)})},onFocus:d=>{a.forEach(u=>{u.onFocus(d)})},onClick:d=>{a.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{a.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{a.forEach(u=>{u.onMouseleave(d)})}};LB(r,l?"nested":e?"manual":this.trigger,c)}}return n.h($f,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const s=this.getMergedShow();return[this.internalTrapFocus&&s?n.withDirectives(n.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[vf,{enabled:s,zIndex:this.zIndex}]]):null,e?null:n.h(Ef,null,{default:()=>r}),n.h(AB,pS(this.$props,zB,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:s})),{default:()=>{var l,a;return(a=(l=this.$slots).default)===null||a===void 0?void 0:a.call(l)},header:()=>{var l,a;return(a=(l=this.$slots).header)===null||a===void 0?void 0:a.call(l)},footer:()=>{var l,a;return(a=(l=this.$slots).footer)===null||a===void 0?void 0:a.call(l)}})]}})}}),qB={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function XB(t){const{textColor2:e,primaryColorHover:i,primaryColorPressed:r,primaryColor:o,infoColor:s,successColor:l,warningColor:a,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:f,tagColor:h,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:x,heightMini:v,heightTiny:N,heightSmall:w,heightMedium:T,closeColorHover:C,closeColorPressed:$,buttonColor2Hover:E,buttonColor2Pressed:V,fontWeightStrong:P}=t;return Object.assign(Object.assign({},qB),{closeBorderRadius:b,heightTiny:v,heightSmall:N,heightMedium:w,heightLarge:T,borderRadius:b,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:k,fontSizeLarge:x,fontWeightStrong:P,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:V,colorChecked:o,colorCheckedHover:i,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:h,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,closeColorHover:C,closeColorPressed:$,borderPrimary:`1px solid ${Le(o,{alpha:.3})}`,textColorPrimary:o,colorPrimary:Le(o,{alpha:.12}),colorBorderedPrimary:Le(o,{alpha:.1}),closeIconColorPrimary:o,closeIconColorHoverPrimary:o,closeIconColorPressedPrimary:o,closeColorHoverPrimary:Le(o,{alpha:.12}),closeColorPressedPrimary:Le(o,{alpha:.18}),borderInfo:`1px solid ${Le(s,{alpha:.3})}`,textColorInfo:s,colorInfo:Le(s,{alpha:.12}),colorBorderedInfo:Le(s,{alpha:.1}),closeIconColorInfo:s,closeIconColorHoverInfo:s,closeIconColorPressedInfo:s,closeColorHoverInfo:Le(s,{alpha:.12}),closeColorPressedInfo:Le(s,{alpha:.18}),borderSuccess:`1px solid ${Le(l,{alpha:.3})}`,textColorSuccess:l,colorSuccess:Le(l,{alpha:.12}),colorBorderedSuccess:Le(l,{alpha:.1}),closeIconColorSuccess:l,closeIconColorHoverSuccess:l,closeIconColorPressedSuccess:l,closeColorHoverSuccess:Le(l,{alpha:.12}),closeColorPressedSuccess:Le(l,{alpha:.18}),borderWarning:`1px solid ${Le(a,{alpha:.35})}`,textColorWarning:a,colorWarning:Le(a,{alpha:.15}),colorBorderedWarning:Le(a,{alpha:.12}),closeIconColorWarning:a,closeIconColorHoverWarning:a,closeIconColorPressedWarning:a,closeColorHoverWarning:Le(a,{alpha:.12}),closeColorPressedWarning:Le(a,{alpha:.18}),borderError:`1px solid ${Le(c,{alpha:.23})}`,textColorError:c,colorError:Le(c,{alpha:.1}),colorBorderedError:Le(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Le(c,{alpha:.12}),closeColorPressedError:Le(c,{alpha:.18})})}const YB={common:Oi,self:XB},KB={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},UB=be("tag",`
|
|
544
544
|
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
|
|
545
545
|
white-space: nowrap;
|
|
546
546
|
position: relative;
|
|
@@ -607,10 +607,10 @@ ${o}
|
|
|
607
607
|
box-shadow: none;
|
|
608
608
|
color: var(--n-text-color-checkable);
|
|
609
609
|
background-color: var(--n-color-checkable);
|
|
610
|
-
`,[
|
|
610
|
+
`,[pn("disabled",[he("&:hover","background-color: var(--n-color-hover-checkable);",[pn("checked","color: var(--n-text-color-hover-checkable);")]),he("&:active","background-color: var(--n-color-pressed-checkable);",[pn("checked","color: var(--n-text-color-pressed-checkable);")])]),Pe("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[
|
|
613
|
+
`,[pn("disabled",[he("&:hover","background-color: var(--n-color-checked-hover);"),he("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var GB={};const ZB=Object.assign(Object.assign(Object.assign({},Nt.props),KB),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),QB="n-tag",ca=n.defineComponent({name:"Tag",props:ZB,slots:Object,setup(t){GB.NODE_ENV!=="production"&&n.watchEffect(()=>{t.onCheckedChange!==void 0&&fi("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=n.ref(null),{mergedBorderedRef:i,mergedClsPrefixRef:r,inlineThemeDisabled:o,mergedRtlRef:s}=Ii(t),l=Nt("Tag","-tag",UB,YB,t,r);n.provide(QB,{roundRef:n.toRef(t,"round")});function a(){if(!t.disabled&&t.checkable){const{checked:m,onCheckedChange:p,onUpdateChecked:g,"onUpdate:checked":b}=t;g&&g(!m),b&&b(!m),p&&p(!m)}}function c(m){if(t.triggerClickOnClose||m.stopPropagation(),!t.disabled){const{onClose:p}=t;p&&Bt(p,m)}}const d={setTextContent(m){const{value:p}=e;p&&(p.textContent=m)}},u=Ur("Tag",s,r),f=n.computed(()=>{const{type:m,size:p,color:{color:g,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:k,borderRadius:x,opacityDisabled:v,textColorCheckable:N,textColorHoverCheckable:w,textColorPressedCheckable:T,textColorChecked:C,colorCheckable:$,colorHoverCheckable:E,colorPressedCheckable:V,colorChecked:P,colorCheckedHover:I,colorCheckedPressed:U,closeBorderRadius:J,fontWeightStrong:Z,[nt("colorBordered",m)]:L,[nt("closeSize",p)]:O,[nt("closeIconSize",p)]:z,[nt("fontSize",p)]:M,[nt("height",p)]:R,[nt("color",m)]:W,[nt("textColor",m)]:K,[nt("border",m)]:G,[nt("closeIconColor",m)]:X,[nt("closeIconColorHover",m)]:j,[nt("closeIconColorPressed",m)]:q,[nt("closeColorHover",m)]:le,[nt("closeColorPressed",m)]:de}}=l.value,ve=mn(k);return{"--n-font-weight-strong":Z,"--n-avatar-size-override":`calc(${R} - 8px)`,"--n-bezier":y,"--n-border-radius":x,"--n-border":G,"--n-close-icon-size":z,"--n-close-color-pressed":de,"--n-close-color-hover":le,"--n-close-border-radius":J,"--n-close-icon-color":X,"--n-close-icon-color-hover":j,"--n-close-icon-color-pressed":q,"--n-close-icon-color-disabled":X,"--n-close-margin-top":ve.top,"--n-close-margin-right":ve.right,"--n-close-margin-bottom":ve.bottom,"--n-close-margin-left":ve.left,"--n-close-size":O,"--n-color":g||(i.value?L:W),"--n-color-checkable":$,"--n-color-checked":P,"--n-color-checked-hover":I,"--n-color-checked-pressed":U,"--n-color-hover-checkable":E,"--n-color-pressed-checkable":V,"--n-font-size":M,"--n-height":R,"--n-opacity-disabled":v,"--n-padding":_,"--n-text-color":b||K,"--n-text-color-checkable":N,"--n-text-color-checked":C,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":T}}),h=o?Ai("tag",n.computed(()=>{let m="";const{type:p,size:g,color:{color:b,textColor:y}={}}=t;return m+=p[0],m+=g[0],b&&(m+=`a${xh(b)}`),y&&(m+=`b${xh(y)}`),i.value&&(m+="c"),m}),f,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:i,handleClick:a,handleCloseClick:c,cssVars:o?void 0:f,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender})},render(){var t,e;const{mergedClsPrefix:i,rtlEnabled:r,closable:o,color:{borderColor:s}={},round:l,onRender:a,$slots:c}=this;a==null||a();const d=Vi(c.avatar,f=>f&&n.h("div",{class:`${i}-tag__avatar`},f)),u=Vi(c.icon,f=>f&&n.h("div",{class:`${i}-tag__icon`},f));return n.h("div",{class:[`${i}-tag`,this.themeClass,{[`${i}-tag--rtl`]:r,[`${i}-tag--strong`]:this.strong,[`${i}-tag--disabled`]:this.disabled,[`${i}-tag--checkable`]:this.checkable,[`${i}-tag--checked`]:this.checkable&&this.checked,[`${i}-tag--round`]:l,[`${i}-tag--avatar`]:d,[`${i}-tag--icon`]:u,[`${i}-tag--closable`]:o}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||d,n.h("span",{class:`${i}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&o?n.h(uB,{clsPrefix:i,class:`${i}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:l,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?n.h("div",{class:`${i}-tag__border`,style:{borderColor:s}}):null)}}),JB=n.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:i}=t;return n.h(Ah,{clsPrefix:i,class:`${i}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?n.h(cB,{clsPrefix:i,show:t.showClear,onClear:t.onClear},{placeholder:()=>n.h(Zr,{clsPrefix:i,class:`${i}-base-suffix__arrow`},{default:()=>na(e.default,()=>[n.h(iB,null)])})}):null})}}}),e5={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function t5(t){const{borderRadius:e,textColor2:i,textColorDisabled:r,inputColor:o,inputColorDisabled:s,primaryColor:l,primaryColorHover:a,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:f,borderColor:h,iconColor:m,iconColorDisabled:p,clearColor:g,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:k,fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:N,fontSizeLarge:w,heightTiny:T,heightSmall:C,heightMedium:$,heightLarge:E,fontWeight:V}=t;return Object.assign(Object.assign({},e5),{fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:N,fontSizeLarge:w,heightTiny:T,heightSmall:C,heightMedium:$,heightLarge:E,borderRadius:e,fontWeight:V,textColor:i,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:k,color:o,colorDisabled:s,colorActive:o,border:`1px solid ${h}`,borderHover:`1px solid ${a}`,borderActive:`1px solid ${l}`,borderFocus:`1px solid ${a}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Le(l,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Le(l,{alpha:.2})}`,caretColor:l,arrowColor:m,arrowColorDisabled:p,loadingColor:l,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Le(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Le(c,{alpha:.2})}`,colorActiveWarning:o,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Le(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Le(u,{alpha:.2})}`,colorActiveError:o,caretColorError:u,clearColor:g,clearColorHover:b,clearColorPressed:y})}const Zh={name:"InternalSelection",common:Oi,peers:{Popover:Uh},self:t5},n5=he([be("base-selection",`
|
|
614
614
|
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
|
|
615
615
|
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
|
|
616
616
|
position: relative;
|
|
@@ -727,7 +727,7 @@ ${o}
|
|
|
727
727
|
white-space: nowrap;
|
|
728
728
|
`)]),Ce("render-label",`
|
|
729
729
|
color: var(--n-text-color);
|
|
730
|
-
`)]),
|
|
730
|
+
`)]),pn("disabled",[he("&:hover",[Ce("state-border",`
|
|
731
731
|
box-shadow: var(--n-box-shadow-hover);
|
|
732
732
|
border: var(--n-border-hover);
|
|
733
733
|
`)]),Pe("focus",[Ce("state-border",`
|
|
@@ -785,7 +785,7 @@ ${o}
|
|
|
785
785
|
user-select: none;
|
|
786
786
|
-webkit-user-select: none;
|
|
787
787
|
opacity: 0;
|
|
788
|
-
`)]),["warning","error"].map(t=>Pe(`${t}-status`,[Ce("state-border",`border: var(--n-border-${t});`),
|
|
788
|
+
`)]),["warning","error"].map(t=>Pe(`${t}-status`,[Ce("state-border",`border: var(--n-border-${t});`),pn("disabled",[he("&:hover",[Ce("state-border",`
|
|
789
789
|
box-shadow: var(--n-box-shadow-hover-${t});
|
|
790
790
|
border: var(--n-border-hover-${t});
|
|
791
791
|
`)]),Pe("active",[Ce("state-border",`
|
|
@@ -810,7 +810,7 @@ ${o}
|
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),i5=n.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Nt.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:i}=Ii(t),r=Kr("InternalSelection",i,e),o=n.ref(null),s=n.ref(null),l=n.ref(null),a=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),f=n.ref(null),h=n.ref(null),m=n.ref(null),p=n.ref(!1),g=n.ref(!1),b=n.ref(!1),y=Nt("InternalSelection","-internal-selection",n5,Zh,t,n.toRef(t,"clsPrefix")),_=n.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),k=n.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):gr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=n.computed(()=>{const te=t.selectedOption;if(te)return te[t.labelField]}),v=n.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function N(){var te;const{value:ce}=o;if(ce){const{value:Ie}=s;Ie&&(Ie.style.width=`${ce.offsetWidth}px`,t.maxTagCount!=="responsive"&&((te=h.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:te}=m;te&&(te.style.display="none")}function T(){const{value:te}=m;te&&(te.style.display="inline-block")}n.watch(n.toRef(t,"active"),te=>{te||w()}),n.watch(n.toRef(t,"pattern"),()=>{t.multiple&&n.nextTick(N)});function C(te){const{onFocus:ce}=t;ce&&ce(te)}function $(te){const{onBlur:ce}=t;ce&&ce(te)}function E(te){const{onDeleteOption:ce}=t;ce&&ce(te)}function V(te){const{onClear:ce}=t;ce&&ce(te)}function P(te){const{onPatternInput:ce}=t;ce&&ce(te)}function I(te){var ce;(!te.relatedTarget||!(!((ce=l.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)))&&C(te)}function K(te){var ce;!((ce=l.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)||$(te)}function J(te){V(te)}function Z(){b.value=!0}function L(){b.value=!1}function O(te){!t.active||!t.filterable||te.target!==s.value&&te.preventDefault()}function z(te){E(te)}const M=n.ref(!1);function R(te){if(te.key==="Backspace"&&!M.value&&!t.pattern.length){const{selectedOptions:ce}=t;ce!=null&&ce.length&&z(ce[ce.length-1])}}let W=null;function U(te){const{value:ce}=o;if(ce){const Ie=te.target.value;ce.textContent=Ie,N()}t.ignoreComposition&&M.value?W=te:P(te)}function G(){M.value=!0}function X(){M.value=!1,t.ignoreComposition&&P(W),W=null}function j(te){var ce;g.value=!0,(ce=t.onPatternFocus)===null||ce===void 0||ce.call(t,te)}function q(te){var ce;g.value=!1,(ce=t.onPatternBlur)===null||ce===void 0||ce.call(t,te)}function le(){var te,ce;if(t.filterable)g.value=!1,(te=d.value)===null||te===void 0||te.blur(),(ce=s.value)===null||ce===void 0||ce.blur();else if(t.multiple){const{value:Ie}=a;Ie==null||Ie.blur()}else{const{value:Ie}=c;Ie==null||Ie.blur()}}function de(){var te,ce,Ie;t.filterable?(g.value=!1,(te=d.value)===null||te===void 0||te.focus()):t.multiple?(ce=a.value)===null||ce===void 0||ce.focus():(Ie=c.value)===null||Ie===void 0||Ie.focus()}function ve(){const{value:te}=s;te&&(T(),te.focus())}function st(){const{value:te}=s;te&&te.blur()}function _e(te){const{value:ce}=u;ce&&ce.setTextContent(`+${te}`)}function we(){const{value:te}=f;return te}function xt(){return s.value}let Ee=null;function Zt(){Ee!==null&&window.clearTimeout(Ee)}function gn(){t.active||(Zt(),Ee=window.setTimeout(()=>{v.value&&(p.value=!0)},100))}function Rt(){Zt()}function Jn(te){te||(Zt(),p.value=!1)}n.watch(v,te=>{te||(p.value=!1)}),n.onMounted(()=>{n.watchEffect(()=>{const te=d.value;te&&(t.disabled?te.removeAttribute("tabindex"):te.tabIndex=g.value?-1:0)})}),wh(l,t.onResize);const{inlineThemeDisabled:yn}=t,ln=n.computed(()=>{const{size:te}=t,{common:{cubicBezierEaseInOut:ce},self:{fontWeight:Ie,borderRadius:mi,color:at,placeholderColor:Qt,textColor:yr,paddingSingle:pi,paddingMultiple:Hi,caretColor:br,colorDisabled:bn,textColorDisabled:ei,placeholderColorDisabled:D,colorActive:Q,boxShadowFocus:se,boxShadowActive:me,boxShadowHover:ge,border:xe,borderFocus:Be,borderHover:Te,borderActive:et,arrowColor:In,arrowColorDisabled:pa,loadingColor:ga,colorActiveWarning:ya,boxShadowFocusWarning:ba,boxShadowActiveWarning:_a,boxShadowHoverWarning:wa,borderWarning:xa,borderFocusWarning:ka,borderHoverWarning:Ca,borderActiveWarning:va,colorActiveError:Sa,boxShadowFocusError:Ba,boxShadowActiveError:Na,boxShadowHoverError:Ta,borderError:$a,borderFocusError:Ea,borderHoverError:Ra,borderActiveError:qN,clearColor:XN,clearColorHover:YN,clearColorPressed:UN,clearSize:KN,arrowSize:GN,[nt("height",te)]:ZN,[nt("fontSize",te)]:QN}}=y.value,ys=hn(pi),bs=hn(Hi);return{"--n-bezier":ce,"--n-border":xe,"--n-border-active":et,"--n-border-focus":Be,"--n-border-hover":Te,"--n-border-radius":mi,"--n-box-shadow-active":me,"--n-box-shadow-focus":se,"--n-box-shadow-hover":ge,"--n-caret-color":br,"--n-color":at,"--n-color-active":Q,"--n-color-disabled":bn,"--n-font-size":QN,"--n-height":ZN,"--n-padding-single-top":ys.top,"--n-padding-multiple-top":bs.top,"--n-padding-single-right":ys.right,"--n-padding-multiple-right":bs.right,"--n-padding-single-left":ys.left,"--n-padding-multiple-left":bs.left,"--n-padding-single-bottom":ys.bottom,"--n-padding-multiple-bottom":bs.bottom,"--n-placeholder-color":Qt,"--n-placeholder-color-disabled":D,"--n-text-color":yr,"--n-text-color-disabled":ei,"--n-arrow-color":In,"--n-arrow-color-disabled":pa,"--n-loading-color":ga,"--n-color-active-warning":ya,"--n-box-shadow-focus-warning":ba,"--n-box-shadow-active-warning":_a,"--n-box-shadow-hover-warning":wa,"--n-border-warning":xa,"--n-border-focus-warning":ka,"--n-border-hover-warning":Ca,"--n-border-active-warning":va,"--n-color-active-error":Sa,"--n-box-shadow-focus-error":Ba,"--n-box-shadow-active-error":Na,"--n-box-shadow-hover-error":Ta,"--n-border-error":$a,"--n-border-focus-error":Ea,"--n-border-hover-error":Ra,"--n-border-active-error":qN,"--n-clear-size":KN,"--n-clear-color":XN,"--n-clear-color-hover":YN,"--n-clear-color-pressed":UN,"--n-arrow-size":GN,"--n-font-weight":Ie}}),Me=yn?Ai("internal-selection",n.computed(()=>t.size[0]),ln,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:k,label:x,selected:v,showTagsPanel:p,isComposing:M,counterRef:u,counterWrapperRef:f,patternInputMirrorRef:o,patternInputRef:s,selfRef:l,multipleElRef:a,singleElRef:c,patternInputWrapperRef:d,overflowRef:h,inputTagElRef:m,handleMouseDown:O,handleFocusin:I,handleClear:J,handleMouseEnter:Z,handleMouseLeave:L,handleDeleteOption:z,handlePatternKeyDown:R,handlePatternInputInput:U,handlePatternInputBlur:q,handlePatternInputFocus:j,handleMouseEnterCounter:gn,handleMouseLeaveCounter:Rt,handleFocusout:K,handleCompositionEnd:X,handleCompositionStart:G,onPopoverUpdateShow:Jn,focus:de,focusInput:ve,blur:le,blurInput:st,updateCounter:_e,getCounter:we,getTail:xt,renderLabel:t.renderLabel,cssVars:yn?void 0:ln,themeClass:Me==null?void 0:Me.themeClass,onRender:Me==null?void 0:Me.onRender}},render(){const{status:t,multiple:e,size:i,disabled:r,filterable:o,maxTagCount:s,bordered:l,clsPrefix:a,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:f}=this;d==null||d();const h=s==="responsive",m=typeof s=="number",p=h||m,g=n.h(ia,null,{default:()=>n.h(JB,{clsPrefix:a,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,_=P=>n.h("div",{class:`${a}-base-selection-tag-wrapper`,key:P.value},u?u({option:P,handleClose:()=>{this.handleDeleteOption(P)}}):n.h(ca,{size:i,closable:!P.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(P)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(P,!0):gr(P[y],P,!0)})),k=()=>(m?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),x=o?n.h("div",{class:`${a}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},n.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${a}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),n.h("span",{ref:"patternInputMirrorRef",class:`${a}-base-selection-input-tag__mirror`},this.pattern)):null,v=h?()=>n.h("div",{class:`${a}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},n.h(ca,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let N;if(m){const P=this.selectedOptions.length-s;P>0&&(N=n.h("div",{class:`${a}-base-selection-tag-wrapper`,key:"__counter__"},n.h(ca,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${P}`})))}const w=h?o?n.h(dh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:v,tail:()=>x}):n.h(dh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:v}):m&&N?k().concat(N):k(),T=p?()=>n.h("div",{class:`${a}-base-selection-popover`},h?k():this.selectedOptions.map(_)):void 0,C=p?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,E=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?n.h("div",{class:`${a}-base-selection-placeholder ${a}-base-selection-overlay`},n.h("div",{class:`${a}-base-selection-placeholder__inner`},this.placeholder)):null,V=o?n.h("div",{ref:"patternInputWrapperRef",class:`${a}-base-selection-tags`},w,h?null:x,g):n.h("div",{ref:"multipleElRef",class:`${a}-base-selection-tags`,tabindex:r?void 0:0},w,g);b=n.h(n.Fragment,null,p?n.h(jB,Object.assign({},C,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>V,default:T}):V,E)}else if(o){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,k=this.active?!1:this.selected;b=n.h("div",{ref:"patternInputWrapperRef",class:`${a}-base-selection-label`,title:this.patternInputFocused?void 0:Nh(this.label)},n.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${a}-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})),k?n.h("div",{class:`${a}-base-selection-label__render-label ${a}-base-selection-overlay`,key:"input"},n.h("div",{class:`${a}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):gr(this.label,this.selectedOption,!0))):null,_?n.h("div",{class:`${a}-base-selection-placeholder ${a}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${a}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else b=n.h("div",{ref:"singleElRef",class:`${a}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?n.h("div",{class:`${a}-base-selection-input`,title:Nh(this.label),key:"input"},n.h("div",{class:`${a}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):gr(this.label,this.selectedOption,!0))):n.h("div",{class:`${a}-base-selection-placeholder ${a}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${a}-base-selection-placeholder__inner`},this.placeholder)),g);return n.h("div",{ref:"selfRef",class:[`${a}-base-selection`,this.rtlEnabled&&`${a}-base-selection--rtl`,this.themeClass,t&&`${a}-base-selection--${t}-status`,{[`${a}-base-selection--active`]:this.active,[`${a}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${a}-base-selection--disabled`]:this.disabled,[`${a}-base-selection--multiple`]:this.multiple,[`${a}-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,l?n.h("div",{class:`${a}-base-selection__border`}):null,l?n.h("div",{class:`${a}-base-selection__state-border`}):null)}});function r5(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const o5={name:"Select",common:Oi,peers:{InternalSelection:Zh,InternalSelectMenu:Wh},self:r5},s5=he([be("select",`
|
|
813
|
+
`)])])]),i5=n.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Nt.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:i}=Ii(t),r=Ur("InternalSelection",i,e),o=n.ref(null),s=n.ref(null),l=n.ref(null),a=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),f=n.ref(null),h=n.ref(null),m=n.ref(null),p=n.ref(!1),g=n.ref(!1),b=n.ref(!1),y=Nt("InternalSelection","-internal-selection",n5,Zh,t,n.toRef(t,"clsPrefix")),_=n.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),k=n.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):gr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=n.computed(()=>{const te=t.selectedOption;if(te)return te[t.labelField]}),v=n.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function N(){var te;const{value:ce}=o;if(ce){const{value:Ie}=s;Ie&&(Ie.style.width=`${ce.offsetWidth}px`,t.maxTagCount!=="responsive"&&((te=h.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:te}=m;te&&(te.style.display="none")}function T(){const{value:te}=m;te&&(te.style.display="inline-block")}n.watch(n.toRef(t,"active"),te=>{te||w()}),n.watch(n.toRef(t,"pattern"),()=>{t.multiple&&n.nextTick(N)});function C(te){const{onFocus:ce}=t;ce&&ce(te)}function $(te){const{onBlur:ce}=t;ce&&ce(te)}function E(te){const{onDeleteOption:ce}=t;ce&&ce(te)}function V(te){const{onClear:ce}=t;ce&&ce(te)}function P(te){const{onPatternInput:ce}=t;ce&&ce(te)}function I(te){var ce;(!te.relatedTarget||!(!((ce=l.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)))&&C(te)}function U(te){var ce;!((ce=l.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)||$(te)}function J(te){V(te)}function Z(){b.value=!0}function L(){b.value=!1}function O(te){!t.active||!t.filterable||te.target!==s.value&&te.preventDefault()}function z(te){E(te)}const M=n.ref(!1);function R(te){if(te.key==="Backspace"&&!M.value&&!t.pattern.length){const{selectedOptions:ce}=t;ce!=null&&ce.length&&z(ce[ce.length-1])}}let W=null;function K(te){const{value:ce}=o;if(ce){const Ie=te.target.value;ce.textContent=Ie,N()}t.ignoreComposition&&M.value?W=te:P(te)}function G(){M.value=!0}function X(){M.value=!1,t.ignoreComposition&&P(W),W=null}function j(te){var ce;g.value=!0,(ce=t.onPatternFocus)===null||ce===void 0||ce.call(t,te)}function q(te){var ce;g.value=!1,(ce=t.onPatternBlur)===null||ce===void 0||ce.call(t,te)}function le(){var te,ce;if(t.filterable)g.value=!1,(te=d.value)===null||te===void 0||te.blur(),(ce=s.value)===null||ce===void 0||ce.blur();else if(t.multiple){const{value:Ie}=a;Ie==null||Ie.blur()}else{const{value:Ie}=c;Ie==null||Ie.blur()}}function de(){var te,ce,Ie;t.filterable?(g.value=!1,(te=d.value)===null||te===void 0||te.focus()):t.multiple?(ce=a.value)===null||ce===void 0||ce.focus():(Ie=c.value)===null||Ie===void 0||Ie.focus()}function ve(){const{value:te}=s;te&&(T(),te.focus())}function st(){const{value:te}=s;te&&te.blur()}function _e(te){const{value:ce}=u;ce&&ce.setTextContent(`+${te}`)}function we(){const{value:te}=f;return te}function xt(){return s.value}let Ee=null;function Zt(){Ee!==null&&window.clearTimeout(Ee)}function yn(){t.active||(Zt(),Ee=window.setTimeout(()=>{v.value&&(p.value=!0)},100))}function Rt(){Zt()}function Jn(te){te||(Zt(),p.value=!1)}n.watch(v,te=>{te||(p.value=!1)}),n.onMounted(()=>{n.watchEffect(()=>{const te=d.value;te&&(t.disabled?te.removeAttribute("tabindex"):te.tabIndex=g.value?-1:0)})}),wh(l,t.onResize);const{inlineThemeDisabled:bn}=t,ln=n.computed(()=>{const{size:te}=t,{common:{cubicBezierEaseInOut:ce},self:{fontWeight:Ie,borderRadius:mi,color:at,placeholderColor:Qt,textColor:yr,paddingSingle:pi,paddingMultiple:Hi,caretColor:br,colorDisabled:_n,textColorDisabled:ei,placeholderColorDisabled:D,colorActive:Q,boxShadowFocus:se,boxShadowActive:me,boxShadowHover:ge,border:xe,borderFocus:Be,borderHover:Te,borderActive:et,arrowColor:In,arrowColorDisabled:pa,loadingColor:ga,colorActiveWarning:ya,boxShadowFocusWarning:ba,boxShadowActiveWarning:_a,boxShadowHoverWarning:wa,borderWarning:xa,borderFocusWarning:ka,borderHoverWarning:Ca,borderActiveWarning:va,colorActiveError:Sa,boxShadowFocusError:Ba,boxShadowActiveError:Na,boxShadowHoverError:Ta,borderError:$a,borderFocusError:Ea,borderHoverError:Ra,borderActiveError:HN,clearColor:WN,clearColorHover:jN,clearColorPressed:qN,clearSize:XN,arrowSize:YN,[nt("height",te)]:KN,[nt("fontSize",te)]:UN}}=y.value,ys=mn(pi),bs=mn(Hi);return{"--n-bezier":ce,"--n-border":xe,"--n-border-active":et,"--n-border-focus":Be,"--n-border-hover":Te,"--n-border-radius":mi,"--n-box-shadow-active":me,"--n-box-shadow-focus":se,"--n-box-shadow-hover":ge,"--n-caret-color":br,"--n-color":at,"--n-color-active":Q,"--n-color-disabled":_n,"--n-font-size":UN,"--n-height":KN,"--n-padding-single-top":ys.top,"--n-padding-multiple-top":bs.top,"--n-padding-single-right":ys.right,"--n-padding-multiple-right":bs.right,"--n-padding-single-left":ys.left,"--n-padding-multiple-left":bs.left,"--n-padding-single-bottom":ys.bottom,"--n-padding-multiple-bottom":bs.bottom,"--n-placeholder-color":Qt,"--n-placeholder-color-disabled":D,"--n-text-color":yr,"--n-text-color-disabled":ei,"--n-arrow-color":In,"--n-arrow-color-disabled":pa,"--n-loading-color":ga,"--n-color-active-warning":ya,"--n-box-shadow-focus-warning":ba,"--n-box-shadow-active-warning":_a,"--n-box-shadow-hover-warning":wa,"--n-border-warning":xa,"--n-border-focus-warning":ka,"--n-border-hover-warning":Ca,"--n-border-active-warning":va,"--n-color-active-error":Sa,"--n-box-shadow-focus-error":Ba,"--n-box-shadow-active-error":Na,"--n-box-shadow-hover-error":Ta,"--n-border-error":$a,"--n-border-focus-error":Ea,"--n-border-hover-error":Ra,"--n-border-active-error":HN,"--n-clear-size":XN,"--n-clear-color":WN,"--n-clear-color-hover":jN,"--n-clear-color-pressed":qN,"--n-arrow-size":YN,"--n-font-weight":Ie}}),Me=bn?Ai("internal-selection",n.computed(()=>t.size[0]),ln,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:k,label:x,selected:v,showTagsPanel:p,isComposing:M,counterRef:u,counterWrapperRef:f,patternInputMirrorRef:o,patternInputRef:s,selfRef:l,multipleElRef:a,singleElRef:c,patternInputWrapperRef:d,overflowRef:h,inputTagElRef:m,handleMouseDown:O,handleFocusin:I,handleClear:J,handleMouseEnter:Z,handleMouseLeave:L,handleDeleteOption:z,handlePatternKeyDown:R,handlePatternInputInput:K,handlePatternInputBlur:q,handlePatternInputFocus:j,handleMouseEnterCounter:yn,handleMouseLeaveCounter:Rt,handleFocusout:U,handleCompositionEnd:X,handleCompositionStart:G,onPopoverUpdateShow:Jn,focus:de,focusInput:ve,blur:le,blurInput:st,updateCounter:_e,getCounter:we,getTail:xt,renderLabel:t.renderLabel,cssVars:bn?void 0:ln,themeClass:Me==null?void 0:Me.themeClass,onRender:Me==null?void 0:Me.onRender}},render(){const{status:t,multiple:e,size:i,disabled:r,filterable:o,maxTagCount:s,bordered:l,clsPrefix:a,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:f}=this;d==null||d();const h=s==="responsive",m=typeof s=="number",p=h||m,g=n.h(ia,null,{default:()=>n.h(JB,{clsPrefix:a,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,_=P=>n.h("div",{class:`${a}-base-selection-tag-wrapper`,key:P.value},u?u({option:P,handleClose:()=>{this.handleDeleteOption(P)}}):n.h(ca,{size:i,closable:!P.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(P)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(P,!0):gr(P[y],P,!0)})),k=()=>(m?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),x=o?n.h("div",{class:`${a}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},n.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${a}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),n.h("span",{ref:"patternInputMirrorRef",class:`${a}-base-selection-input-tag__mirror`},this.pattern)):null,v=h?()=>n.h("div",{class:`${a}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},n.h(ca,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let N;if(m){const P=this.selectedOptions.length-s;P>0&&(N=n.h("div",{class:`${a}-base-selection-tag-wrapper`,key:"__counter__"},n.h(ca,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${P}`})))}const w=h?o?n.h(dh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:v,tail:()=>x}):n.h(dh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:v}):m&&N?k().concat(N):k(),T=p?()=>n.h("div",{class:`${a}-base-selection-popover`},h?k():this.selectedOptions.map(_)):void 0,C=p?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,E=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?n.h("div",{class:`${a}-base-selection-placeholder ${a}-base-selection-overlay`},n.h("div",{class:`${a}-base-selection-placeholder__inner`},this.placeholder)):null,V=o?n.h("div",{ref:"patternInputWrapperRef",class:`${a}-base-selection-tags`},w,h?null:x,g):n.h("div",{ref:"multipleElRef",class:`${a}-base-selection-tags`,tabindex:r?void 0:0},w,g);b=n.h(n.Fragment,null,p?n.h(jB,Object.assign({},C,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>V,default:T}):V,E)}else if(o){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,k=this.active?!1:this.selected;b=n.h("div",{ref:"patternInputWrapperRef",class:`${a}-base-selection-label`,title:this.patternInputFocused?void 0:Nh(this.label)},n.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${a}-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})),k?n.h("div",{class:`${a}-base-selection-label__render-label ${a}-base-selection-overlay`,key:"input"},n.h("div",{class:`${a}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):gr(this.label,this.selectedOption,!0))):null,_?n.h("div",{class:`${a}-base-selection-placeholder ${a}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${a}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else b=n.h("div",{ref:"singleElRef",class:`${a}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?n.h("div",{class:`${a}-base-selection-input`,title:Nh(this.label),key:"input"},n.h("div",{class:`${a}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):gr(this.label,this.selectedOption,!0))):n.h("div",{class:`${a}-base-selection-placeholder ${a}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${a}-base-selection-placeholder__inner`},this.placeholder)),g);return n.h("div",{ref:"selfRef",class:[`${a}-base-selection`,this.rtlEnabled&&`${a}-base-selection--rtl`,this.themeClass,t&&`${a}-base-selection--${t}-status`,{[`${a}-base-selection--active`]:this.active,[`${a}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${a}-base-selection--disabled`]:this.disabled,[`${a}-base-selection--multiple`]:this.multiple,[`${a}-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,l?n.h("div",{class:`${a}-base-selection__border`}):null,l?n.h("div",{class:`${a}-base-selection__state-border`}):null)}});function r5(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const o5={name:"Select",common:Oi,peers:{InternalSelection:Zh,InternalSelectMenu:Wh},self:r5},s5=he([be("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,4 +819,4 @@ ${o}
|
|
|
819
819
|
`),be("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[Uh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function ms(t){return t.type==="group"}function Qh(t){return t.type==="ignored"}function da(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function l5(t,e){return{getIsGroup:ms,getIgnored:Qh,getKey(r){return ms(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function a5(t,e,i,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const l=[];for(const a of s)if(ms(a)){const c=o(a[r]);c.length&&l.push(Object.assign({},a,{[r]:c}))}else{if(Qh(a))continue;e(i,a)&&l.push(a)}return l}return o(t)}function c5(t,e,i){const r=new Map;return t.forEach(o=>{ms(o)?o[i].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var d5={};const u5=Object.assign(Object.assign({},Nt.props),{to:jn.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}),f5=n.defineComponent({name:"Select",props:u5,slots:Object,setup(t){d5.NODE_ENV!=="production"&&n.watchEffect(()=>{t.items!==void 0&&fi("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&fi("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:i,namespaceRef:r,inlineThemeDisabled:o}=Ii(t),s=Nt("Select","-select",s5,o5,t,e),l=n.ref(t.defaultValue),a=n.toRef(t,"value"),c=Ol(a,l),d=n.ref(!1),u=n.ref(""),f=Sf(t,["items","options"]),h=n.ref([]),m=n.ref([]),p=n.computed(()=>m.value.concat(h.value).concat(f.value)),g=n.computed(()=>{const{filter:D}=t;if(D)return D;const{labelField:Q,valueField:se}=t;return(me,ge)=>{if(!ge)return!1;const xe=ge[Q];if(typeof xe=="string")return da(me,xe);const Be=ge[se];return typeof Be=="string"?da(me,Be):typeof Be=="number"?da(me,String(Be)):!1}}),b=n.computed(()=>{if(t.remote)return f.value;{const{value:D}=p,{value:Q}=u;return!Q.length||!t.filterable?D:a5(D,g.value,Q,t.childrenField)}}),y=n.computed(()=>{const{valueField:D,childrenField:Q}=t,se=l5(D,Q);return OC(b.value,se)}),_=n.computed(()=>c5(p.value,t.valueField,t.childrenField)),k=n.ref(!1),x=Ol(n.toRef(t,"show"),k),v=n.ref(null),N=n.ref(null),w=n.ref(null),{localeRef:T}=Fh("Select"),C=n.computed(()=>{var D;return(D=t.placeholder)!==null&&D!==void 0?D:T.value.placeholder}),$=[],E=n.ref(new Map),V=n.computed(()=>{const{fallbackOption:D}=t;if(D===void 0){const{labelField:Q,valueField:se}=t;return me=>({[Q]:String(me),[se]:me})}return D===!1?!1:Q=>Object.assign(D(Q),{value:Q})});function P(D){const Q=t.remote,{value:se}=E,{value:me}=_,{value:ge}=V,xe=[];return D.forEach(Be=>{if(me.has(Be))xe.push(me.get(Be));else if(Q&&se.has(Be))xe.push(se.get(Be));else if(ge){const Te=ge(Be);Te&&xe.push(Te)}}),xe}const I=n.computed(()=>{if(t.multiple){const{value:D}=c;return Array.isArray(D)?P(D):[]}return null}),K=n.computed(()=>{const{value:D}=c;return!t.multiple&&!Array.isArray(D)?D===null?null:P([D])[0]||null:null}),J=yS(t),{mergedSizeRef:Z,mergedDisabledRef:L,mergedStatusRef:O}=J;function z(D,Q){const{onChange:se,"onUpdate:value":me,onUpdateValue:ge}=t,{nTriggerFormChange:xe,nTriggerFormInput:Be}=J;se&&Bt(se,D,Q),ge&&Bt(ge,D,Q),me&&Bt(me,D,Q),l.value=D,xe(),Be()}function M(D){const{onBlur:Q}=t,{nTriggerFormBlur:se}=J;Q&&Bt(Q,D),se()}function R(){const{onClear:D}=t;D&&Bt(D)}function W(D){const{onFocus:Q,showOnFocus:se}=t,{nTriggerFormFocus:me}=J;Q&&Bt(Q,D),me(),se&&q()}function U(D){const{onSearch:Q}=t;Q&&Bt(Q,D)}function G(D){const{onScroll:Q}=t;Q&&Bt(Q,D)}function X(){var D;const{remote:Q,multiple:se}=t;if(Q){const{value:me}=E;if(se){const{valueField:ge}=t;(D=I.value)===null||D===void 0||D.forEach(xe=>{me.set(xe[ge],xe)})}else{const ge=K.value;ge&&me.set(ge[t.valueField],ge)}}}function j(D){const{onUpdateShow:Q,"onUpdate:show":se}=t;Q&&Bt(Q,D),se&&Bt(se,D),k.value=D}function q(){L.value||(j(!0),k.value=!0,t.filterable&&pi())}function le(){j(!1)}function de(){u.value="",m.value=$}const ve=n.ref(!1);function st(){t.filterable&&(ve.value=!0)}function _e(){t.filterable&&(ve.value=!1,x.value||de())}function we(){L.value||(x.value?t.filterable?pi():le():q())}function xt(D){var Q,se;!((se=(Q=w.value)===null||Q===void 0?void 0:Q.selfRef)===null||se===void 0)&&se.contains(D.relatedTarget)||(d.value=!1,M(D),le())}function Ee(D){W(D),d.value=!0}function Zt(){d.value=!0}function gn(D){var Q;!((Q=v.value)===null||Q===void 0)&&Q.$el.contains(D.relatedTarget)||(d.value=!1,M(D),le())}function Rt(){var D;(D=v.value)===null||D===void 0||D.focus(),le()}function Jn(D){var Q;x.value&&(!((Q=v.value)===null||Q===void 0)&&Q.$el.contains(Or(D))||le())}function yn(D){if(!Array.isArray(D))return[];if(V.value)return Array.from(D);{const{remote:Q}=t,{value:se}=_;if(Q){const{value:me}=E;return D.filter(ge=>se.has(ge)||me.has(ge))}else return D.filter(me=>se.has(me))}}function ln(D){Me(D.rawNode)}function Me(D){if(L.value)return;const{tag:Q,remote:se,clearFilterAfterSelect:me,valueField:ge}=t;if(Q&&!se){const{value:xe}=m,Be=xe[0]||null;if(Be){const Te=h.value;Te.length?Te.push(Be):h.value=[Be],m.value=$}}if(se&&E.value.set(D[ge],D),t.multiple){const xe=yn(c.value),Be=xe.findIndex(Te=>Te===D[ge]);if(~Be){if(xe.splice(Be,1),Q&&!se){const Te=te(D[ge]);~Te&&(h.value.splice(Te,1),me&&(u.value=""))}}else xe.push(D[ge]),me&&(u.value="");z(xe,P(xe))}else{if(Q&&!se){const xe=te(D[ge]);~xe?h.value=[h.value[xe]]:h.value=$}yr(),le(),z(D[ge],D)}}function te(D){return h.value.findIndex(se=>se[t.valueField]===D)}function ce(D){x.value||q();const{value:Q}=D.target;u.value=Q;const{tag:se,remote:me}=t;if(U(Q),se&&!me){if(!Q){m.value=$;return}const{onCreate:ge}=t,xe=ge?ge(Q):{[t.labelField]:Q,[t.valueField]:Q},{valueField:Be,labelField:Te}=t;f.value.some(et=>et[Be]===xe[Be]||et[Te]===xe[Te])||h.value.some(et=>et[Be]===xe[Be]||et[Te]===xe[Te])?m.value=$:m.value=[xe]}}function Ie(D){D.stopPropagation();const{multiple:Q}=t;!Q&&t.filterable&&le(),R(),Q?z([],[]):z(null,null)}function mi(D){!Ar(D,"action")&&!Ar(D,"empty")&&!Ar(D,"header")&&D.preventDefault()}function at(D){G(D)}function Qt(D){var Q,se,me,ge,xe;if(!t.keyboard){D.preventDefault();return}switch(D.key){case" ":if(t.filterable)break;D.preventDefault();case"Enter":if(!(!((Q=v.value)===null||Q===void 0)&&Q.isComposing)){if(x.value){const Be=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();Be?ln(Be):t.filterable||(le(),yr())}else if(q(),t.tag&&ve.value){const Be=m.value[0];if(Be){const Te=Be[t.valueField],{value:et}=c;t.multiple&&Array.isArray(et)&&et.includes(Te)||Me(Be)}}}D.preventDefault();break;case"ArrowUp":if(D.preventDefault(),t.loading)return;x.value&&((me=w.value)===null||me===void 0||me.prev());break;case"ArrowDown":if(D.preventDefault(),t.loading)return;x.value?(ge=w.value)===null||ge===void 0||ge.next():q();break;case"Escape":x.value&&(hS(D),le()),(xe=v.value)===null||xe===void 0||xe.focus();break}}function yr(){var D;(D=v.value)===null||D===void 0||D.focus()}function pi(){var D;(D=v.value)===null||D===void 0||D.focusInput()}function Hi(){var D;x.value&&((D=N.value)===null||D===void 0||D.syncPosition())}X(),n.watch(n.toRef(t,"options"),X);const br={focus:()=>{var D;(D=v.value)===null||D===void 0||D.focus()},focusInput:()=>{var D;(D=v.value)===null||D===void 0||D.focusInput()},blur:()=>{var D;(D=v.value)===null||D===void 0||D.blur()},blurInput:()=>{var D;(D=v.value)===null||D===void 0||D.blurInput()}},bn=n.computed(()=>{const{self:{menuBoxShadow:D}}=s.value;return{"--n-menu-box-shadow":D}}),ei=o?Ai("select",void 0,bn,t):void 0;return Object.assign(Object.assign({},br),{mergedStatus:O,mergedClsPrefix:e,mergedBordered:i,namespace:r,treeMate:y,isMounted:ts(),triggerRef:v,menuRef:w,pattern:u,uncontrolledShow:k,mergedShow:x,adjustedTo:jn(t),uncontrolledValue:l,mergedValue:c,followerRef:N,localizedPlaceholder:C,selectedOption:K,selectedOptions:I,mergedSize:Z,mergedDisabled:L,focused:d,activeWithoutMenuOpen:ve,inlineThemeDisabled:o,onTriggerInputFocus:st,onTriggerInputBlur:_e,handleTriggerOrMenuResize:Hi,handleMenuFocus:Zt,handleMenuBlur:gn,handleMenuTabOut:Rt,handleTriggerClick:we,handleToggle:ln,handleDeleteOption:Me,handlePatternInput:ce,handleClear:Ie,handleTriggerBlur:xt,handleTriggerFocus:Ee,handleKeydown:Qt,handleMenuAfterLeave:de,handleMenuClickOutside:Jn,handleMenuScroll:at,handleMenuKeydown:Qt,handleMenuMousedown:mi,mergedTheme:s,cssVars:o?void 0:bn,themeClass:ei==null?void 0:ei.themeClass,onRender:ei==null?void 0:ei.onRender})},render(){return n.h("div",{class:`${this.mergedClsPrefix}-select`},n.h($f,null,{default:()=>[n.h(Ef,null,{default:()=>n.h(i5,{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)]}})}),n.h(qf,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===jn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>n.h(n.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,i;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),n.withDirectives(n.h(PB,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:[(i=this.menuProps)===null||i===void 0?void 0:i.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,o;return[(o=(r=this.$slots).empty)===null||o===void 0?void 0:o.call(r)]},header:()=>{var r,o;return[(o=(r=this.$slots).header)===null||o===void 0?void 0:o.call(r)]},action:()=>{var r,o;return[(o=(r=this.$slots).action)===null||o===void 0?void 0:o.call(r)]}}),this.displayDirective==="show"?[[n.vShow,this.mergedShow],[es,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[es,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),h5={},Jh=n.defineComponent({...h5,__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=H.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:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),a=n.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=n.computed(()=>a.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=n.ref(!1),u=n.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(k=>{if(A.isEmpty(k))return;const x=s.value?r.value:r.value?[r.value]:[],v=k.filter(N=>!x.some(w=>w.id===N.id));a.value=r.optionsListConverter([...x,...v])}).finally(()=>{d.value=!1}))};let h="";const m=A.debounce(()=>f(h),800),p=_=>{h=_,m()},g=_=>{var k;if(A.isArray(_)){const x=_.length>0?_.map(v=>{var N;return n.toRaw((N=a.value.find(w=>w.value===v))==null?void 0:N.item)}):[];o("update:value",x)}else if(_>0){const x=n.toRaw((k=a.value.find(v=>v.value===_))==null?void 0:k.item);o("update:value",x)}else o("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,k)=>(n.openBlock(),n.createBlock(n.unref(f5),{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:s.value,options:c.value,placeholder:t.placeholder,remote:!0,value:l.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:p,"onUpdate:value":g},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),m5={},em=n.defineComponent({...m5,__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=H.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:i}){const r=t,o=i,s=n.useTemplateRef("select-component"),l=async f=>r.searchType==="categories"?H.HttpRequester.getInstance(H.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?H.HttpRequester.getInstance(H.ProductDataProvider).publicSimpleSearch(f):new Promise(h=>{h([])}),a=f=>r.searchType==="categories"?bt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":h.name):r.searchType==="products"?bt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":`[${h.code}] ${h.name}`):[],c=(f,h)=>{if(r.renderLabel)return r.renderLabel(f,h);if(r.searchType==="products"){const m=f.item;return n.h("div",{},[n.h("span",{class:"text-sc-grey mr-2.5"},m.code),n.h("span",{},[m.name])])}if(r.searchType==="categories"){const m=f.item;return n.h("div",{},[m.name])}};return e({focus:()=>{var f;return(f=s.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=s.value)==null?void 0:f.blur()}}),(f,h)=>(n.openBlock(),n.createBlock(Jh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":l,"options-list-converter":a,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":h[0]||(h[0]=m=>o("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),p5={class:"col-span-2 flex flex-row gap-2.5"},g5={class:"flex-1"},y5={class:"text-sc-grey"},b5={class:"ml-2.5"},_5={key:0,class:"flex-none"},w5={},x5=n.defineComponent({...w5,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(null),s=()=>structuredClone(n.toRaw(i.value)),l=n.ref(s()),a=()=>{r("update:value",l.value.map(f=>n.toRaw(f)))},c=f=>{f&&(l.value=[...l.value.map(h=>n.toRaw(h)),...(A.isArray(f)?f:[f]).filter(h=>!l.value.some(m=>m.id===h.id))],n.nextTick(()=>{o.value=null}),a())},d=f=>{f&&(l.value=l.value.map(h=>h.id===f.id?f:n.toRaw(h)),a())},u=f=>{l.value=l.value.filter(h=>h.id!==f.id),a()};return n.watch(()=>i.value,()=>{l.value=s()}),(f,h)=>{const m=F.NListItem,p=G2,g=F.NButton,b=F.NList;return n.openBlock(),n.createBlock(b,{"show-divider":!1,hoverable:!0},{header:n.withCtx(()=>[n.renderSlot(f.$slots,"header")]),footer:n.withCtx(()=>[n.createVNode(em,{value:o.value,"onUpdate:value":[h[0]||(h[0]=y=>o.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:n.withCtx(()=>[l.value.length===0?(n.openBlock(),n.createBlock(m,{key:0,class:"text-center text-sm text-gray-600"},{default:n.withCtx(()=>[...h[1]||(h[1]=[n.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,y=>(n.openBlock(),n.createBlock(m,{key:y.id},{suffix:n.withCtx(()=>[n.createVNode(g,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:n.withCtx(()=>[n.createVNode(p)]),_:1},8,["disabled","onClick"])]),default:n.withCtx(()=>[n.createElementVNode("div",p5,[n.createElementVNode("span",g5,[n.createElementVNode("span",y5,n.toDisplayString(y.code),1),n.createElementVNode("span",b5,n.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(n.openBlock(),n.createElementBlock("div",_5,[n.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):n.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),k5={class:"flex flex-col"},C5={class:"flex flex-col gap-1.5 text-base text-nowrap"},v5={class:"font-medium"},S5={class:"flex flex-col text-sc-dark-grey"},B5={key:0},N5={class:"font-medium"},T5={class:"font-medium"},$5={class:"font-medium"},E5={class:"font-medium"},R5={class:"font-medium"},P5={class:"font-medium"},F5={class:"font-medium"},V5={class:"font-medium"},M5={class:"font-medium"},I5={class:"font-medium"},A5={class:"flex flex-col gap-1.5 text-base text-nowrap"},O5={class:"font-medium"},z5={class:"flex flex-col text-sc-dark-grey"},D5={class:"font-medium"},L5={class:"font-medium"},H5={class:"flex flex-col gap-1.5 text-base text-nowrap"},W5={class:"font-medium"},j5={class:"text-sc-dark-grey"},q5={class:"font-medium"},X5={key:1,class:"text-base font-medium text-nowrap"},Y5={},tm=n.defineComponent({...Y5,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[H.ConfiguratorsEnum.Kozyrek,H.ConfiguratorsEnum.Mosquitto,H.ConfiguratorsEnum.Strip,H.ConfiguratorsEnum.MetalForDoors,H.ConfiguratorsEnum.Sandwich,H.ConfiguratorsEnum.SandwichM2],i=t,r=n.ref(!1),o=n.computed(()=>{var h,m;return((h=i.item.product.unit)==null?void 0:h.isLinear)&&((m=i.item.product.properties)==null?void 0:m.isLengthConfigurator)}),s=n.computed(()=>H.UnitsHelper.getProductLengthMultiplicity(i.item.product)),l=n.computed(()=>H.UnitsHelper.getProductMultiplicity(i.item.product)),a=n.computed(()=>l.value>1),c=n.ref({quantity:i.item.quantity});n.watch(()=>i.item,h=>{c.value={quantity:h.quantity}});const d=h=>{var m;h!==null&&(c.value.quantity=h,(m=i.eventEmitter)==null||m.emit("order-item:edit-quantity",{item:i.item,quantity:h,loaderRef:r}))},u=()=>{var h;(h=i.eventEmitter)==null||h.emit("order-item:open-configurator",{item:i.item})},f=()=>{var h;(h=i.eventEmitter)==null||h.emit("order-item:edit",{item:i.item})};return(h,m)=>{const p=F.NInputNumber;return n.openBlock(),n.createElementBlock("div",k5,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",C5,[n.createElementVNode("span",null,[m[1]||(m[1]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",v5,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",S5,[t.item.configurator===n.unref(H.ConfiguratorsEnum).Kozyrek?(n.openBlock(),n.createElementBlock("span",B5,[m[2]||(m[2]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",N5,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).Mosquitto?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("span",null,[m[3]||(m[3]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",T5,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[4]||(m[4]=n.createTextVNode(" Высота: ",-1)),n.createElementVNode("span",$5,n.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).Strip?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.item.configuratorParams.linesWidths,(g,b)=>(n.openBlock(),n.createElementBlock("span",{key:b},[n.createTextVNode(" Полоса №"+n.toDisplayString(Number(b)+1)+": ",1),n.createElementVNode("span",E5,n.toDisplayString(g)+" мм.",1)]))),128)),n.createElementVNode("span",null,[m[5]||(m[5]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",R5,n.toDisplayString(t.item.length)+" м.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).MetalForDoors?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("span",null,[m[6]||(m[6]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",P5,n.toDisplayString(t.item.width)+" мм.",1)]),n.createElementVNode("span",null,[m[7]||(m[7]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",F5,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).Sandwich?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:4},n.renderList(t.item.configuratorParams.items??[],(g,b)=>(n.openBlock(),n.createElementBlock("span",{key:b},[n.createTextVNode(" Изделие №"+n.toDisplayString(Number(b)+1)+": ",1),n.createElementVNode("span",V5,n.toDisplayString(g.width)+"×"+n.toDisplayString(g.length)+" мм, "+n.toDisplayString(g.count)+" шт.",1)]))),128)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).SandwichM2?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("span",null,[m[8]||(m[8]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",M5,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[9]||(m[9]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",I5,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0)])]),t.allowEdit?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:n.withModifiers(u,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):o.value&&s.value>0?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",A5,[n.createElementVNode("span",null,[m[10]||(m[10]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",O5,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",z5,[n.createElementVNode("span",null,[m[11]||(m[11]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",D5,n.toDisplayString(s.value)+" "+n.toDisplayString(t.item.product.unit.name),1)]),n.createElementVNode("span",null,[m[12]||(m[12]=n.createTextVNode(" Всего: ",-1)),n.createElementVNode("span",L5,n.toDisplayString(t.item.quantity*s.value)+" "+n.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:n.withModifiers(f,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("div",H5,[n.createElementVNode("span",null,[m[13]||(m[13]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",W5,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("span",j5,[m[14]||(m[14]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",q5,n.toDisplayString(t.item.length??t.item.width)+" "+n.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:n.withModifiers(f,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[t.allowEdit?(n.openBlock(),n.createBlock(p,{key:0,value:c.value.quantity,parse:n.unref(ct),min:l.value,step:l.value,"show-button":a.value,"button-placement":"both",disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:m[0]||(m[0]=g=>n.unref(so)(g,".",!1)),onFocus:n.unref(He),"onUpdate:value":d},{suffix:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(n.openBlock(),n.createElementBlock("span",X5,n.toDisplayString(t.item.quantity)+" "+n.toDisplayString(t.item.product.unit.name),1))],64))])}}}),U5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K5(t,e){return n.openBlock(),n.createElementBlock("svg",U5,[...e[0]||(e[0]=[n.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 G5=n.markRaw({name:"tabler-truck-filled",render:K5}),Z5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q5(t,e){return n.openBlock(),n.createElementBlock("svg",Z5,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.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"}),n.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const J5=n.markRaw({name:"tabler-truck-delivery",render:Q5}),e3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t3(t,e){return n.openBlock(),n.createElementBlock("svg",e3,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),n.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 n3=n.markRaw({name:"tabler-truck-loading",render:t3}),i3={class:"flex flex-col gap-1"},r3={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},o3={key:1,class:"text-base"},s3={class:"text-sc-dark-grey mr-1.5"},l3={key:0},a3={key:1},c3={},ps=n.defineComponent({...c3,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=n.computed(()=>{var s;return(s=H.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(l=>l.id===o.delivery.type)}),i=n.computed(()=>ke.format(o.delivery.date,"dd.MM.yyyy")),r=n.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?ni.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=t;return(s,l)=>{var u,f,h,m,p,g,b,y;const a=n3,c=J5,d=G5;return n.openBlock(),n.createElementBlock("div",i3,[t.showType?(n.openBlock(),n.createElementBlock("span",r3,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(n.openBlock(),n.createBlock(a,{key:0})):n.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="delivery"?(n.openBlock(),n.createBlock(c,{key:1})):n.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(n.openBlock(),n.createBlock(d,{key:2})):n.createCommentVNode("",!0),n.createElementVNode("span",null,n.toDisplayString((m=e.value)==null?void 0:m.name),1)])):n.createCommentVNode("",!0),t.showDetails?(n.openBlock(),n.createElementBlock("span",o3,[n.createElementVNode("span",s3,n.toDisplayString(i.value),1),(g=(p=t.delivery)==null?void 0:p.address)!=null&&g.address?(n.openBlock(),n.createElementBlock("span",l3,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0),(y=(b=t.delivery)==null?void 0:b.warehouse)!=null&&y.address?(n.openBlock(),n.createElementBlock("span",a3," со склада "+n.toDisplayString(t.delivery.warehouse.address),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])}}}),d3={class:"flex flex-col gap-2.5"},u3={class:"text-base"},f3=["href"],h3={key:1,class:"text-sc-grey"},m3={},nm=n.defineComponent({...m3,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{},highlightSettings:{}},setup(t){const e=t,i=n.computed(()=>e.fields.includes(Ve.Id)?e.order.id:void 0),r=n.computed(()=>{var f,h;return e.fields.includes(Ve.Status)?(h=(f=H.useReferencesStore().orderStatusReference)==null?void 0:f.find(m=>{var p;return m.id===(((p=e.order.status)==null?void 0:p.id)??-1)}))==null?void 0:h.name:void 0}),o=n.computed(()=>{var f;return bi((f=e.order.status)==null?void 0:f.slug)}),s=n.computed(()=>{var h,m;const f=(h=e.order.status)==null?void 0:h.slug;return!!f&&(((m=e.highlightSettings)==null?void 0:m.statuses.includes(f))??!1)}),l=n.computed(()=>vs(e.order).filter(f=>[it.OnOrder,it.NotInStock].includes(f))),a=f=>{var h;return((h=e.highlightSettings)==null?void 0:h.markers.includes(f))??!1},c=n.computed(()=>e.fields.includes(Ve.CreatedAt)),d=n.computed(()=>e.fields.includes(Ve.ClientInfo)||e.fields.includes(Ve.ClientInfoShort)?e.order.client:void 0),u=n.computed(()=>e.fields.includes(Ve.DeliveryInfo)?e.order.delivery:void 0);return(f,h)=>(n.openBlock(),n.createElementBlock("div",d3,[n.createElementVNode("span",u3,[i.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+n.toDisplayString(i.value),9,f3)):n.createCommentVNode("",!0),c.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[h[0]||(h[0]=n.createTextVNode(" от ",-1)),n.createVNode(Uo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[h[1]||(h[1]=n.createTextVNode(" - ",-1)),s.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"font-medium",style:n.normalizeStyle({color:o.value.color})},n.toDisplayString(r.value),5)):(n.openBlock(),n.createElementBlock("span",h3,n.toDisplayString(r.value),1))],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m},[h[2]||(h[2]=n.createTextVNode(" - ",-1)),n.createElementVNode("span",{class:n.normalizeClass({"font-medium":a(m),"text-sc-dark-grey":!a(m)}),style:n.normalizeStyle(a(m)?{color:n.unref(vr)(m).color}:void 0)},n.toDisplayString(n.unref(Cs)(m)),7)],64))),128))]),d.value?(n.openBlock(),n.createBlock(Mr,{key:0,client:d.value,class:"ml-3"},null,8,["client"])):n.createCommentVNode("",!0),u.value?(n.openBlock(),n.createBlock(ps,{key:1,delivery:u.value,class:"ml-3"},null,8,["delivery"])):n.createCommentVNode("",!0)]))}}),p3={},ua=n.defineComponent({...p3,__name:"order-payment",props:{payment:{}},setup(t){const e=t,i=n.computed(()=>{var r;return(r=H.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return n.openBlock(),n.createElementBlock("span",null,n.toDisplayString(((s=i.value)==null?void 0:s.name)??"-"),1)}}}),g3={},Qr=n.defineComponent({...g3,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,i={quantity:"количество",length:"длина"},r=n.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=n.computed(()=>{const s={[H.UserTypeEnum.Manager]:"менеджером",[H.UserTypeEnum.Operator]:"оператором",[H.UserTypeEnum.Client]:"клиентом",[H.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const a=e.changedFields.map(d=>i[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${a}`}const l=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${l}`.trim()});return(s,l)=>(n.openBlock(),n.createElementBlock("small",{class:n.normalizeClass(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${r.value}`)},n.toDisplayString(o.value),3))}}),y3={class:"flex flex-row gap-1.5"},b3={class:"flex-none text-nowrap"},_3={class:"flex flex-1 flex-col gap-2.5"},w3={key:0,class:"text-sm"},x3={class:"text-gray-600"},k3={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},C3={key:0},v3={key:1},S3={},im=n.defineComponent({...S3,__name:"order-product-info",props:{product:{},index:{}},setup(t){const e=n.inject(H.currentOrderInjectionKey,null),i=n.computed(()=>{if(e!=null)return n.toValue(e)??void 0});return(r,o)=>{var s;return n.openBlock(),n.createElementBlock("div",y3,[n.createElementVNode("span",b3,n.toDisplayString(t.index+1)+".",1),n.createElementVNode("div",_3,[n.createVNode(Nr,{product:t.product.product},null,8,["product"]),t.product.marker?(n.openBlock(),n.createElementBlock("span",w3,[o[0]||(o[0]=n.createTextVNode(" Маркировка: ",-1)),n.createElementVNode("span",x3,n.toDisplayString(t.product.marker),1)])):n.createCommentVNode("",!0),t.product.creator&&(!i.value||((s=i.value)==null?void 0:s.creator.guid)!==t.product.creator.guid)&&t.product.creator.type?(n.openBlock(),n.createBlock(Qr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):n.createCommentVNode("",!0),n.createElementVNode("div",k3,[o[1]||(o[1]=n.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock("span",C3,n.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(n.openBlock(),n.createElementBlock("span",v3,n.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),o[2]||(o[2]=n.createElementVNode("span",null,"Цена за ед.",-1)),n.createVNode(ii,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),o[3]||(o[3]=n.createElementVNode("span",null,"Сумма",-1)),n.createVNode(ii,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),B3={class:"flex items-center gap-1.5"},N3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},T3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},$3={},rm=n.defineComponent({...$3,__name:"order-status-tag",props:{status:{},statusDetail:{default:null},variant:{default:"filled"},size:{default:"medium"},showDot:{type:Boolean,default:!0}},setup(t){const e=t,i=n.computed(()=>bi(e.status.slug)),r=n.computed(()=>za(e.status.slug)),o=n.computed(()=>e.statusDetail?`${e.status.name} (${e.statusDetail.name})`:e.status.name);return(s,l)=>{const a=F.NTag;return t.variant==="filled"?(n.openBlock(),n.createBlock(a,{key:0,color:r.value,bordered:!1,size:t.size,round:""},{default:n.withCtx(()=>[n.createElementVNode("span",B3,[t.showDot?(n.openBlock(),n.createElementBlock("span",N3)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)])]),_:1},8,["color","size"])):(n.openBlock(),n.createElementBlock("span",{key:1,class:"inline-flex items-center gap-1.5 font-medium",style:n.normalizeStyle({color:i.value.color})},[t.showDot?(n.openBlock(),n.createElementBlock("span",T3)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)],4))}}}),E3={},fa=n.defineComponent({...E3,__name:"order-color-swatch",props:{colors:{}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("span",{class:"inline-flex h-5 min-w-8 shrink-0 items-center justify-center rounded px-1.5 text-xs font-semibold leading-none",style:n.normalizeStyle({backgroundColor:t.colors.backgroundColor,color:t.colors.textOnBackgroundColor,border:`1px solid ${t.colors.color}`})}," Аа ",4))}}),R3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P3(t,e){return n.openBlock(),n.createElementBlock("svg",R3,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"},null,-1),n.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40m-64 64v224m-72-224l8 224m136-224l-8 224"},null,-1)])])}const F3=n.markRaw({name:"ion-trash-outline",render:P3}),V3={},M3=n.defineComponent({...V3,__name:"order-item-specification",props:{src:{}},setup(t){const e=n.useTemplateRef("image-reference");return(i,r)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("a",{class:"text-blue-500 hover:underline text-sm mt-1 block cursor-pointer",onClick:r[0]||(r[0]=o=>{var s;return(s=e.value)==null?void 0:s.showPreview()})}," Спецификация "),n.withDirectives(n.createVNode(n.unref(F.NImage),{ref:"image-reference",src:t.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[n.vShow,!1]])],64))}}),I3={class:"flex flex-col gap-0.5"},A3={class:"text-gray-600"},O3={},z3=n.defineComponent({...O3,__name:"order-item-name",props:{item:{}},setup(t){const e=t,i=n.inject(H.currentOrderInjectionKey,null),r=n.computed(()=>{if(i!=null)return n.toValue(i)??void 0}),o=n.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),s=n.computed(()=>{var d;return"creator"in e.item&&!!((d=e.item.creator)!=null&&d.type)&&(!r.value||r.value.creator.guid!==e.item.creator.guid)}),l=n.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),a=n.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),c=n.computed(()=>{var d,u;return"replacement"in e.item?(u=(d=e.item.replacement)==null?void 0:d.creator)==null?void 0:u.type:void 0});return(d,u)=>(n.openBlock(),n.createElementBlock("div",I3,[n.createElementVNode("div",{class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(Nr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(o.value?"line-through opacity-50":"")},[u[0]||(u[0]=n.createTextVNode(" Маркировка: ",-1)),n.createElementVNode("span",A3,n.toDisplayString(t.item.marker),1)],2)):n.createCommentVNode("",!0),l.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(M3,{src:l.value},null,8,["src"])],2)):n.createCommentVNode("",!0),s.value&&!o.value?(n.openBlock(),n.createBlock(Qr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):n.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&a.value.length===0?(n.openBlock(),n.createBlock(Qr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):n.createCommentVNode("",!0),t.item.replacementId&&a.value.length>0?(n.openBlock(),n.createBlock(Qr,{key:4,"user-type":c.value,"changed-fields":a.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):n.createCommentVNode("",!0)]))}}),D3={},L3=n.defineComponent({...D3,__name:"order-items-list",props:n.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(t){const e=t,i=n.useModel(t,"selectedRowKeys"),r=n.computed(()=>A.sortBy(e.products,"ord")),o=m=>!!m.isRemoved||!!m.replacementId,s=(m,p)=>{p?i.value.includes(m)||(i.value=[...i.value,m]):i.value=i.value.filter(g=>g!==m)},l=m=>e.selectable?{class:i.value.includes(m.id)?void 0:"opacity-60"}:{},a=(m,p)=>{const g=r.value,b=m.logicGroupId;if(!b)return 1;const y=g.at(p-1);if(p&&y&&y.logicGroupId===b)return 0;const _=g.slice(p),k=_.findIndex(x=>x.logicGroupId!==b);return k===-1?_.length:k},c=n.ref(Ye.getDeviceTypeByResolution()),d=n.ref(window.innerWidth),u=()=>{const m=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(g,b)=>n.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[b+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:d.value>=1536?156:120,render:g=>n.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[g.product.code])},{title:"Наименование",key:"name",resizable:!0,render:g=>n.h(z3,{item:g})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:a,render:g=>n.h(tm,{class:o(g)?"line-through opacity-50":"",item:g,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!o(g)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:g=>n.h("div",{class:o(g)?"line-through opacity-50":""},[n.h(ii,{product:g,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:g=>n.h("div",{class:o(g)?"line-through opacity-50":""},[n.h(ii,{product:g,costFieldName:"cost",showCurrency:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:a,render:g=>o(g)?null:n.h(F.NButton,{quaternary:!0,type:"error",onClick:()=>{var b;(b=e.eventEmitter)==null||b.emit("order-item:delete",{item:g})}},()=>n.h(F3))}]:[]],p=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:g=>({class:o(g)?void 0:"cursor-pointer",onClick:()=>{o(g)||s(g.id,!i.value.includes(g.id))}}),render:g=>n.h(F.NCheckbox,{checked:i.value.includes(g.id),disabled:o(g)})}]:[];switch(c.value){case Xe.phone:case Xe.tablet:return[...p,{title:"",key:"items",resizable:!0,render:(g,b)=>n.h(im,{product:g,index:b})}];case Xe.laptop:return[...p,...m];default:return[...p,...m]}},f=n.computed(()=>u()),h=()=>{c.value=Ye.getDeviceTypeByResolution(),d.value=window.innerWidth};return n.onMounted(()=>{h(),window.addEventListener("resize",h)}),n.onUnmounted(()=>{window.removeEventListener("resize",h)}),(m,p)=>{const g=F.NDataTable;return n.openBlock(),n.createElementBlock(n.Fragment,null,[p[0]||(p[0]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Список позиций",-1)),n.createVNode(g,{columns:f.value,data:r.value,"row-key":b=>b.id,"row-props":l,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),om=wn(L3,[["__scopeId","data-v-e1fad754"]]),H3={key:0,class:"text-sc-dark-grey my-2 text-center"},W3={key:1,class:"text-sc-dark-grey my-2"},j3={},sm=n.defineComponent({...j3,__name:"order-status-history",props:{order:{}},setup(t){const e=t,i=n.ref(!1),r=n.ref([]),o=l=>{const{uiDateWithTime:a}=H.useBaseConfigStateStore().config.dateFormats;return ke.format(l,a)},s=(l=!0)=>{l&&(i.value=!0),H.HttpRequester.getInstance(H.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(a=>{r.value=a}).finally(()=>{l&&(i.value=!1)})};return n.watch(()=>e.order,()=>{s(!1)}),n.onMounted(()=>{s()}),(l,a)=>{const c=F.NSpin,d=F.NTimelineItem,u=F.NTimeline;return n.openBlock(),n.createElementBlock("div",null,[a[1]||(a[1]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),i.value?(n.openBlock(),n.createElementBlock("div",H3,[n.createVNode(c,{size:"small",class:"mb-1 align-middle"}),a[0]||(a[0]=n.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(n.openBlock(),n.createElementBlock("div",W3," История статусов отсутствует. ")):(n.openBlock(),n.createBlock(u,{key:2},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(f,h)=>(n.openBlock(),n.createBlock(d,{key:h,color:n.unref(bi)(f.status.slug).color,time:o(f.createdAt),content:f.user.name},{header:n.withCtx(()=>[n.createVNode(rm,{status:f.status,"status-detail":f.statusDetail,variant:h===0?"filled":"text","show-dot":!1,size:"small"},null,8,["status","status-detail","variant"])]),_:2},1032,["color","time","content"]))),128))]),_:1}))])}}}),q3={class:"text-base"},X3={},ha=n.defineComponent({...X3,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[n.createElementVNode("span",q3,n.toDisplayString(t.user.name),1),t.showUserType?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+n.toDisplayString(t.user.type)+"] ",3)):n.createCommentVNode("",!0)],2))}}),Y3={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},U3={class:"col-span-2"},K3={class:"col-span-2"},G3={},lm=n.defineComponent({...G3,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const i=e;return(r,o)=>(n.openBlock(),n.createElementBlock("div",null,[o[11]||(o[11]=n.createElementVNode("h3",null,"Детали заказа",-1)),n.createElementVNode("div",Y3,[t.order.creator.id!==t.order.client.id?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[o[1]||(o[1]=n.createElementVNode("span",null,"Создал",-1)),n.createVNode(ha,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):n.createCommentVNode("",!0),o[10]||(o[10]=n.createElementVNode("span",null,"Клиент",-1)),n.createVNode(Mr,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>i("click:client-name",t.order.client,s))},null,8,["client"]),t.order.contragent?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[o[2]||(o[2]=n.createElementVNode("span",null,"Контрагент",-1)),n.createVNode(qu,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):n.createCommentVNode("",!0),t.order.image?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[o[3]||(o[3]=n.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=n.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):n.createCommentVNode("",!0),t.order.barcode?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[o[5]||(o[5]=n.createElementVNode("span",null,"Штрих-код",-1)),n.createElementVNode("span",U3,n.toDisplayString(t.order.barcode),1)],64)):n.createCommentVNode("",!0),t.order.payment?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[o[6]||(o[6]=n.createElementVNode("span",null,"Оплата",-1)),n.createVNode(ua,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):n.createCommentVNode("",!0),t.order.delivery?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[o[7]||(o[7]=n.createElementVNode("span",null,"Доставка",-1)),n.createVNode(ps,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):n.createCommentVNode("",!0),t.order.comment?(n.openBlock(),n.createElementBlock(n.Fragment,{key:6},[o[8]||(o[8]=n.createElementVNode("span",null,"Комментарий",-1)),n.createElementVNode("span",K3,n.toDisplayString(t.order.comment),1)],64)):n.createCommentVNode("",!0),t.order.attachedUser?(n.openBlock(),n.createElementBlock(n.Fragment,{key:7},[o[9]||(o[9]=n.createElementVNode("span",null,"Закреплен за",-1)),n.createVNode(ha,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):n.createCommentVNode("",!0)])]))}}),Z3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Q3(t,e){return n.openBlock(),n.createElementBlock("svg",Z3,[...e[0]||(e[0]=[n.createElementVNode("rect",{width:"336",height:"336",x:"128",y:"128",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32",rx:"57",ry:"57"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24"},null,-1)])])}const J3=n.markRaw({name:"ion-copy-outline",render:Q3}),e4={class:"flex flex-col items-start gap-1.5 text-base"},t4=["href"],n4=["href"],i4={key:1,class:"flex items-center gap-2"},r4=["href"],o4={},am=n.defineComponent({...o4,__name:"order-external-links",props:{order:{}},setup(t){const e=n.computed(()=>{var r,o;const i=(((r=t.order.invoices)==null?void 0:r.length)??0)>0;return!!t.order.erpOrderUrl||i||!!((o=t.order.payment)!=null&&o.onlinePaymentLink)});return(i,r)=>{var l;const o=J3,s=F.NButton;return e.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[r[0]||(r[0]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),n.createElementVNode("div",e4,[t.order.erpOrderUrl?(n.openBlock(),n.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,t4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.order.invoices??[],(a,c)=>(n.openBlock(),n.createElementBlock("a",{key:c,class:"btn btn-primary",href:a}," Скачать счет №"+n.toDisplayString(c+1),9,n4))),128)),(l=t.order.payment)!=null&&l.onlinePaymentLink?(n.openBlock(),n.createElementBlock("div",i4,[n.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,r4),n.withDirectives((n.openBlock(),n.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:n.withCtx(()=>[n.createVNode(o)]),_:1})),[[n.unref(Ma),t.order.payment.onlinePaymentLink]])])):n.createCommentVNode("",!0)])],64)):n.createCommentVNode("",!0)}}}),s4={key:0},l4={class:"text-sc-dark-grey my-2 text-center"},a4={key:1,class:"text-sc-dark-grey my-2 text-center"},c4={key:2},d4={class:"text-sc-dark-grey mt-4 text-right font-bold"},u4={class:"text-sc-primary"},f4={},cm=n.defineComponent({...f4,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(!1),s=n.ref();n.provide(H.currentOrderInjectionKey,n.computed(()=>s.value??null));const l=(d=!0)=>{if("products"in i.order){s.value=new H.Order(i.order);return}d&&(o.value=!0),H.HttpRequester.getInstance(H.OrdersDataProvider).getOrder(i.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},a=n.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=n.computed(()=>a.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return n.watch(()=>i.order,()=>{l(!1)}),n.onMounted(()=>{l()}),(d,u)=>{const f=F.NSpin;return o.value?(n.openBlock(),n.createElementBlock("div",s4,[n.createElementVNode("div",l4,[n.createVNode(f,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=n.createElementVNode("div",null,[n.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(n.openBlock(),n.createElementBlock("div",a4," --- Не удалось загрузить данные о заказе --- ")):(n.openBlock(),n.createElementBlock("div",c4,[n.createVNode(om,{products:a.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),n.createElementVNode("div",d4,[u[2]||(u[2]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",u4,n.toDisplayString(c.value)+" ₽",1)]),n.createVNode(lm,{order:s.value,"onClick:clientName":u[0]||(u[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"]),n.createVNode(am,{order:s.value},null,8,["order"]),n.createVNode(sm,{order:s.value},null,8,["order"])]))}}}),h4={},m4=n.defineComponent({...h4,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,i=n.inject(Sr,"small"),r=n.computed(()=>A.isNil(e.orderContextButtonsConfig)?[]:A.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),o=s=>{var l;(l=e.onOrderContextSelect)==null||l.call(e,e.order,s)};return(s,l)=>{var u;const a=Bs,c=F.NButton,d=F.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(n.openBlock(),n.createBlock(d,{key:0,options:r.value,size:n.unref(i),trigger:"click",onSelect:o},{default:n.withCtx(()=>[n.createVNode(c,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(a)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)}}}),p4={},g4=n.defineComponent({...p4,__name:"orders-list",props:n.mergeModels({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},highlightSettings:{default:void 0},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:n.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.useModel(t,"checkedRowKeys"),l=(R,W)=>{W?s.value.includes(R)||(s.value=[...s.value,R]):s.value=s.value.filter(U=>U!==R)},a=()=>A.cloneDeep(r.sort??[{field:"id",direction:"desc"}]),c=n.ref(a()),d=n.ref([]),u=n.ref(!1),f=n.ref(700),h=()=>{const R=Ye.getDeviceTypeByResolution(),W=R===Xe.phone||R===Xe.tablet;if(!(!r.stickyHeaderOnMobile&&W))return f.value*(H.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},m=n.ref(h()),p=n.computed(()=>r.highlightSettings?r.highlightSettings:{statuses:[],markers:r.useCellIndication?[...oo]:[]}),g=R=>{const W={onDblclick:()=>o("dblclick:row",R)},U=[];r.selectable&&s.value.length>0&&!s.value.includes(R.id)&&U.push("opacity-60");const G=p.value,X=new Set(vs(R).filter(de=>G.markers.includes(de))),j={},le=[it.NotInStock,it.OnOrder,it.LargeOrder].find(de=>X.has(de));if(le){const de=vr(le);U.push("order-id-marked",le),j["--sc-order-id-bg"]=de.backgroundColor,j["--sc-order-id-text"]=de.textOnBackgroundColor}if(X.has(it.NextDayDelivery)){const de=vr(it.NextDayDelivery);U.push("delivery-date-marked"),j["--sc-delivery-date-bg"]=de.backgroundColor,j["--sc-delivery-date-text"]=de.textOnBackgroundColor}return R.status.slug&&G.statuses.includes(R.status.slug)&&(U.push("order-status-highlighted",R.status.slug),A.assign(j,Da(R.status.slug))),A.isEmpty(j)||(W.style=j),U.length>0&&(W.class=U.join(" ")),W},b=()=>{const R=[Ve.CreatedAt,Ve.Id,Ve.ClientInfo,Ve.ClientCity,Ve.DeliveryDate,Ve.PaymentType,Ve.SalesDirections,Ve.Status,...r.showAttachedUserColumn?[Ve.AttachedUser]:[],Ve.actions],W=r.fields.length>0?r.fields:R,U={title:"???",key:"undefined",render:()=>n.h("span",{},["--- unknown ---"])},G={type:"expand",expandable:A.constant(!0),renderExpand:q=>n.h(cm,{order:q,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{o("click:client-name",q.client,null)}}),width:"30"};let X=[{title:"Дата заказа",key:Ve.CreatedAt,resizable:!0,width:100,render:q=>n.h(Uo,{date:q.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ve.Id,resizable:!0,width:75,className:"order-id",render:q=>n.h("a",{href:r.orderUrl.replace(":id",q.id.toString()),class:"text-base"},q.id)},{title:"Дата доставки / самовывоза",key:Ve.DeliveryDate,resizable:!0,width:120,className:"delivery-date",render:q=>n.h(Uo,{date:q.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ve.ClientInfo,resizable:!0,minWidth:320,render:q=>n.h(Mr,{client:q.client,"onClick:client-name":()=>{o("click:client-name",q.client,null)}})},{title:"Тип доставки",key:Ve.DeliveryInfo,resizable:!0,minWidth:320,render:q=>n.h(ps,{delivery:q.delivery})},{title:"Клиент",key:Ve.ClientInfoShort,resizable:!0,minWidth:320,render:q=>n.h(Mr,{client:q.client,showCityAndRegion:!1,"onClick:client-name":()=>{o("click:client-name",q.client,null)}})},{title:"Город клиента",key:Ve.ClientCity,resizable:!0,minWidth:90,width:120,render:q=>{var le;return n.h("span",{class:"text-base"},((le=q.client)==null?void 0:le.city.name)??"—")}},{title:"Статус",key:Ve.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:q=>n.h("span",{class:"text-base"},[q.status.name])},{title:"Тип оплаты",key:Ve.PaymentType,resizable:!0,width:115,minWidth:95,render:q=>q.payment?n.h(ua,{payment:q.payment}):n.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ve.SalesDirections,resizable:!0,width:80,render:q=>{var le;return n.h("span",{class:"text-base"},[((le=q.salesDirection)==null?void 0:le.name)??""])}},...r.showAttachedUserColumn?[{title:"Закреплено за",key:Ve.AttachedUser,resizable:!0,minWidth:120,render:q=>{var le;return n.h("span",{class:"text-base"},[((le=q==null?void 0:q.attachedUser)==null?void 0:le.name)??""])}}]:[]];r.orderContextButtonsConfig&&X.push({key:"actions",title:"",className:"align-top",width:50,render:q=>n.h(m4,{order:q,orderContextButtonsConfig:r.orderContextButtonsConfig,onOrderContextSelect:r.onOrderContextSelect})}),r.enableSorting&&(X=X.map(q=>[Ve.Id,Ve.CreatedAt,Ve.DeliveryDate].includes(q.key)?{...q,sorter:!0,sortOrder:!1,...q.width===void 0?{}:{width:q.width+16}}:q));const j=r.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:q=>{var de;const le=((de=r.isRowSelectable)==null?void 0:de.call(r,q))??!0;return{class:le?"cursor-pointer":void 0,onClick:()=>{le&&l(q.id,!s.value.includes(q.id))}}},render:q=>{var le;return((le=r.isRowSelectable)==null?void 0:le.call(r,q))??!0?n.h(F.NCheckbox,{checked:s.value.includes(q.id)}):null}}]:[];switch(Ye.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...j,G,{key:"order",title:"Заказ",resizable:!0,render:q=>n.h(nm,{order:q,fields:W,orderUrl:r.orderUrl,highlightSettings:p.value})}];case Xe.laptop:{const q=r.showAttachedUserColumn?W:W.filter(le=>le!==Ve.AttachedUser);return[...j,G,...q.map(le=>X.find(de=>de.key===le)??U)]}default:return[U]}},y=n.ref(b()),_=n.ref(new H.TableDataPagination(r.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),k=n.computed(()=>({..._.value,prefix({itemCount:R}){return`Всего заказов: ${R}`}})),x=n.ref(null),v=n.ref(null),N=n.ref(null),w=n.ref(null),T=n.ref(null),C=()=>{T.value!==null&&(clearInterval(T.value),T.value=null)},$=()=>{C(),r.refreshInterval&&(T.value=setInterval(()=>{P()},r.refreshInterval))},E=R=>{_.value.itemCount!==R.meta.total&&(_.value.itemCount=R.meta.total),_.value.page!==R.meta.currentPage&&(_.value.page=R.meta.currentPage),_.value.pageCount!==R.meta.lastPage&&(_.value.pageCount=R.meta.lastPage),_.value.pageSize!==R.meta.perPage&&(_.value.pageSize=R.meta.perPage),d.value=R.data},V=()=>{var R,W,U;r.filters&&((R=v.value)==null||R.abort(),v.value=null,(W=N.value)==null||W.abort(),N.value=null,w.value=null,(U=x.value)==null||U.abort(),x.value=new AbortController,u.value=!0,H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},x.value.signal).then(G=>{E(G),u.value=!1}).catch(G=>{if((G==null?void 0:G.name)!=="CanceledError")throw u.value=!1,G}))},P=()=>{var R;!r.filters||u.value||((R=v.value)==null||R.abort(),v.value=new AbortController,H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},v.value.signal).then(W=>{d.value=d.value.map(U=>W.data.find(X=>X.id===U.id)??U),_.value.itemCount!==W.meta.total&&(_.value.itemCount=W.meta.total),_.value.pageCount!==W.meta.lastPage&&(_.value.pageCount=W.meta.lastPage)}).catch(W=>{if((W==null?void 0:W.name)!=="CanceledError")throw W}))},I=R=>R.meta.total===_.value.itemCount&&A.isEqual(A.map(R.data,"id"),A.map(d.value,"id")),K=async()=>{var W,U;if(!r.filters||u.value)return!1;(W=v.value)==null||W.abort(),v.value=null,(U=N.value)==null||U.abort(),N.value=new AbortController;let R;try{R=await H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},N.value.signal)}catch(G){if((G==null?void 0:G.name)==="CanceledError")return!1;throw G}return I(R)?(d.value=d.value.map(G=>R.data.find(X=>X.id===G.id)??G),w.value=null,!1):(w.value=R,!0)},J=()=>w.value?(E(w.value),w.value=null,!0):!1,Z=()=>{w.value=null},L=R=>{_.value.page=R,V(),o("update:pagination",_.value)},O=R=>{_.value.pageSize=R,_.value.page=1,V(),o("update:pagination",_.value)},z=R=>{if(A.isNull(R))c.value=a();else{const[W]=c.value;W.field=R.columnKey.toString(),W.direction=R.order==="ascend"?"asc":"desc",c.value=[W]}y.value.forEach(W=>{if(Object.hasOwn(W,"sortOrder")){const U=W;U.sortOrder=U.key===(R==null?void 0:R.columnKey)&&(R!=null&&R.sorter)&&R.order!==!1?R.order:!1}}),V(),o("update:sort",c.value)},M=()=>{y.value=b(),f.value=window.innerHeight,m.value=h()};return n.watch(()=>r.filters,()=>{_.value.page=1,V(),$()}),n.watch(()=>r.sort,()=>{c.value=a(),_.value.page=1,V(),$()}),n.onMounted(()=>{M(),window.addEventListener("resize",M),n.nextTick(()=>{V(),$()})}),n.onUnmounted(()=>{var R,W,U;window.removeEventListener("resize",M),(R=x.value)==null||R.abort(),(W=v.value)==null||W.abort(),(U=N.value)==null||U.abort(),C()}),e({reload:V,checkForUpdates:K,applyPendingUpdate:J,discardPendingUpdate:Z}),(R,W)=>{const U=F.NDataTable;return n.openBlock(),n.createBlock(U,{columns:y.value,data:d.value,"row-key":G=>G.id,"row-props":g,"scroll-x":t.tableMinWidth,pagination:k.value,loading:u.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":m.value,"pagination-behavior-on-filter":"first","onUpdate:page":L,"onUpdate:pageSize":O,"onUpdate:sorter":z},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),y4=wn(g4,[["__scopeId","data-v-aff76adb"]]),b4=n.computed(()=>H.useReferencesStore().deliveryTypeReference??[]),_4=n.computed(()=>H.useReferencesStore().managersList??[]),w4=n.computed(()=>H.useReferencesStore().opfReference??[]),x4=n.computed(()=>H.useReferencesStore().partnerGroupsReference??[]),k4=n.computed(()=>H.useReferencesStore().priceCoefficientsReference??[]),C4=n.computed(()=>H.useReferencesStore().productFilesTypesReference??[]),v4=n.computed(()=>H.useReferencesStore().resourceTypesReference),S4=n.computed(()=>H.useReferencesStore().salesDirectionsReference??[]),B4=n.computed(()=>H.useReferencesStore().warehousesReference??[]),N4=n.computed(()=>H.useReferencesStore().paymentTypeReference??[]),dm=n.computed(()=>H.useReferencesStore().orderStatusReference??[]),T4=n.computed(()=>H.useReferencesStore().orderStatusDetailReference??[]),$4=n.computed(()=>H.useReferencesStore().operatorReference??[]),E4=n.computed(()=>bt.convertReferencesToSelectOptionsList(H.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),R4=n.computed(()=>bt.convertReferencesToSelectOptionsList(H.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),P4=t=>H.HttpRequester.getInstance(H.ReferenceDataProvider).searchCity(t),F4=t=>bt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var i,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(i=e==null?void 0:e.region)==null?void 0:i.name}, ${(o=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:o.name}`},e=>e==null?void 0:e.isNewRec()),V4=t=>H.HttpRequester.getInstance(H.ClientDataProvider).searchClient(t),M4=t=>bt.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()),I4={class:"flex flex-col gap-4"},A4={class:"flex flex-wrap gap-2"},O4={class:"flex flex-col gap-1.5"},z4={class:"inline-flex items-center gap-2"},D4={class:"flex flex-col gap-1.5"},L4={class:"inline-flex items-center gap-2"},H4={},W4=n.defineComponent({...H4,__name:"order-highlight-settings",props:{settings:{},statuses:{default:void 0}},emits:["update:settings"],setup(t,{emit:e}){const i=t,r=e,o=n.computed(()=>i.statuses??dm.value),s=d=>!!d&&i.settings.statuses.includes(d),l=(d,u)=>{if(!d)return;const f=i.settings.statuses.filter(h=>h!==d);r("update:settings",{...i.settings,statuses:u?[...f,d]:f})},a=(d,u)=>{const f=i.settings.markers.filter(h=>h!==d);r("update:settings",{...i.settings,markers:u?[...f,d]:f})},c=d=>{r("update:settings",{statuses:d?o.value.flatMap(u=>u.slug?[u.slug]:[]):[],markers:d?[...oo]:[]})};return(d,u)=>{const f=F.NButton,h=F.NCheckbox;return n.openBlock(),n.createElementBlock("div",I4,[n.createElementVNode("div",A4,[n.createVNode(f,{size:"small",onClick:u[0]||(u[0]=m=>c(!0))},{default:n.withCtx(()=>[...u[2]||(u[2]=[n.createTextVNode(" Выделять всё ",-1)])]),_:1}),n.createVNode(f,{size:"small",onClick:u[1]||(u[1]=m=>c(!1))},{default:n.withCtx(()=>[...u[3]||(u[3]=[n.createTextVNode(" Снять всё ",-1)])]),_:1})]),n.createElementVNode("div",O4,[u[4]||(u[4]=n.createElementVNode("div",{class:"text-sm font-semibold"},"Статусы",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,m=>(n.openBlock(),n.createBlock(h,{key:m.id,checked:s(m.slug),"onUpdate:checked":p=>l(m.slug,p)},{default:n.withCtx(()=>[n.createElementVNode("span",z4,[n.createVNode(fa,{colors:n.unref(bi)(m.slug)},null,8,["colors"]),n.createTextVNode(" "+n.toDisplayString(m.name),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))]),n.createElementVNode("div",D4,[u[5]||(u[5]=n.createElementVNode("div",{class:"text-sm font-semibold"},"Маркеры",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(oo),m=>(n.openBlock(),n.createBlock(h,{key:m,checked:t.settings.markers.includes(m),"onUpdate:checked":p=>a(m,p)},{default:n.withCtx(()=>[n.createElementVNode("span",L4,[n.createVNode(fa,{colors:n.unref(vr)(m)},null,8,["colors"]),n.createTextVNode(" "+n.toDisplayString(n.unref(Cs)(m)),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))])])}}}),j4=["href"],q4={class:"text-sc-dark-grey"},X4={},Y4=n.defineComponent({...X4,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const i=t,r=e,o=n.computed(()=>ke.format(i.order.createdAt,H.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=l=>{A.isNil(i.orderLink)&&(l.preventDefault(),l.stopPropagation()),r("click:order-id",i.order,l)};return(l,a)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("span",null,[a[1]||(a[1]=n.createTextVNode(" #",-1)),n.createElementVNode("a",{href:t.orderLink??"#",onClick:a[0]||(a[0]=c=>s(c))},n.toDisplayString(t.order.id),9,j4),n.createTextVNode(" от "+n.toDisplayString(o.value),1)]),a[2]||(a[2]=n.createTextVNode(", ",-1)),n.createElementVNode("span",q4,"автор: "+n.toDisplayString(t.order.creator.name)+" ["+n.toDisplayString(t.order.creator.type)+"]",1)],64))}}),U4={class:"sc-page flex flex-col bg-inherit"},K4={class:"my-2 flex flex-row items-end"},G4={class:"sc-title grow"},Z4={key:0,class:"sc-title-buttons flex-1 grow-0"},Q4={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},J4={key:0,class:"sc-title-extra mt-2 sm:mt-4"},eN={},um=n.defineComponent({...eN,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t){const e=t,i=n.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=F.NH1;return n.openBlock(),n.createElementBlock("div",U4,[n.createElementVNode("div",{class:n.normalizeClass(t.stickyHeader?i.value:void 0),style:n.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[n.createElementVNode("div",K4,[n.createElementVNode("div",G4,[n.renderSlot(r.$slots,"title",{},()=>[n.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(n.openBlock(),n.createElementBlock("div",Z4,[n.createElementVNode("div",Q4,[n.renderSlot(r.$slots,"title-buttons")])])):n.createCommentVNode("",!0)]),r.$slots["title-extra"]?(n.openBlock(),n.createElementBlock("div",J4,[n.renderSlot(r.$slots,"title-extra")])):n.createCommentVNode("",!0),n.renderSlot(r.$slots,"sticky-extra")],6),n.renderSlot(r.$slots,"default")])}}}),tN={class:"overflow-hidden transition-all duration-300"},nN={class:"text-lg font-medium leading-none"},iN={},fm=n.defineComponent({...iN,__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 i=t,r=e,o=n.ref(0),s=n.ref(i.showDrawer),l=()=>{switch(Ye.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},a=()=>{s.value?A.isUndefined(i.drawerWidth)?o.value=l():o.value=A.isFunction(i.drawerWidth)?i.drawerWidth():i.drawerWidth:o.value=0};return n.watch(()=>i.drawerWidth,()=>{a()}),n.watch(()=>s.value,()=>{a(),r("update:show-drawer",s.value)}),n.watch(()=>i.showDrawer,c=>{s.value=c}),n.onUnmounted(()=>{window.removeEventListener("resize",a)}),a(),window.addEventListener("resize",a),(c,d)=>{const u=F.NDrawerContent,f=F.NDrawer;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",tN,[n.createElementVNode("div",{style:n.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[n.renderSlot(c.$slots,"default")],4)]),n.createVNode(f,{show:s.value,"onUpdate:show":d[0]||(d[0]=h=>s.value=h),resizable:!0,width:o.value,placement:"left"},{default:n.withCtx(()=>[n.createVNode(u,{closable:""},{header:n.withCtx(()=>[n.renderSlot(c.$slots,"drawer-header",{},()=>[n.createElementVNode("div",nN,n.toDisplayString(t.title),1)])]),default:n.withCtx(()=>[n.renderSlot(c.$slots,"drawer-content")]),footer:n.withCtx(()=>[n.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),rN={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},oN={key:0},sN={class:"sc-page-preview-panel grow"},lN={key:1,class:"sc-page-preview-panel-extra flex-none"},aN={},cN=n.defineComponent({...aN,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t,{expose:e}){const i=n.ref(!1),r=()=>{i.value=!0},o=()=>{i.value=!1},s=n.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:a=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),a&&n.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=s.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r,closePanel:o}),(a,c)=>{const d=F.NButton;return n.openBlock(),n.createBlock(um,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset,"sticky-header-on-mobile":t.stickyHeaderOnMobile},n.createSlots({default:n.withCtx(()=>[n.createVNode(fm,{"show-drawer":i.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>i.value=u),title:t.panelTitle},n.createSlots({"drawer-content":n.withCtx(()=>[n.renderSlot(a.$slots,"panel-content")]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0,a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:n.withCtx(()=>[n.createElementVNode("div",rN,[t.isShowPanelButtonVisible?(n.openBlock(),n.createElementBlock("div",oN,[n.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{i.value=!0}},()=>[n.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>i.value=!0)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):n.createCommentVNode("",!0),n.createElementVNode("div",sN,[n.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(n.openBlock(),n.createElementBlock("div",lN,[n.renderSlot(a.$slots,"preview-panel-extra")])):n.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),dN={},uN=n.defineComponent({...dN,__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:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>{var p;return A.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),a=n.computed(()=>{const p=new H.Curator({id:-1,name:"",contacts:{},curatedDirection:new H.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),g=r.showEmptyValue?[p]:[];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=>{g.push(new H.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),g}),c=n.computed(()=>bt.convertReferencesToSelectOptionsList(a.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,p=>{const g=A.some(s.value?r.value:[r.value],["id",p.id])?` (${p.curatedDirection.name}) `:"";return p.curatedDirection.isNewRec()?p.name:`${p.name}${g}`})),d=n.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=n.useTemplateRef("select-component"),f=p=>{if(A.isArray(p)){const g=p.length>0?p.map(b=>a.value.find(y=>y.id===b)).filter(b=>!A.isNil(b)):[];o("update:value",g)}else{const g=p>0?a.value.find(b=>b.id===p):null;o("update:value",g??null)}};return n.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:l.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),fN={},hN=n.defineComponent({...fN,__name:"manager-operator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},groupByEmployeeType:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>{var y;return A.isArray(r.value)?r.value.filter(_=>!A.isNil(_)).map(_=>_.id):((y=r.value)==null?void 0:y.id)??null}),a=n.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=n.computed(()=>{var x;const y=[];r.operatorReferenceList.length>0&&y.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(v=>({label:v.name,value:v.id,item:v}))});let _=r.managerReferenceList;if(r.showActualOnly){const v=A.isArray(r.value)?r.value.map(N=>N.id):[(x=r.value)==null?void 0:x.id];_=_.filter(N=>N.isActive||v.includes(N.id))}const k=bt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,v=>`${v.name}${v.isActive?"":" [Не активен]"}`);return y.length>0&&k.length>0&&y.push({key:"manager-operator-divider",disabled:!0,render:()=>n.h("div",{class:"sc-manager-operator-select__divider"})}),y.push(...k),y}),d=y=>`${y.name}${"isActive"in y&&!y.isActive?" [Не активен]":""}`,u=n.computed(()=>{var N;const y=A.isArray(r.value)?r.value.map(w=>w.id):[(N=r.value)==null?void 0:N.id],_=w=>r.showActualOnly?w.filter(T=>!("isActive"in T)||T.isActive||y.includes(T.id)):w,k=[],x=_(r.managerReferenceList);x.length>0&&k.push({type:"group",label:"Менеджеры",key:"managers",children:bt.convertReferencesToSelectOptionsList(x,!0,!1,!1,d)});const v=_(r.operatorReferenceList);return v.length>0&&k.push({type:"group",label:"Операторы",key:"operators",children:bt.convertReferencesToSelectOptionsList(v,!0,!1,!1,d)}),k}),f=n.computed(()=>r.groupByEmployeeType?u.value:c.value),h=n.computed(()=>f.value.map(y=>({...y,class:r.wrapContent?`${y.class??""} consistent-menu-width`:y.class}))),m=n.useTemplateRef("select-component"),p=y=>{if(A.isArray(y)){const _=y.map(k=>a.value.find(x=>x.id===k)).filter(k=>!A.isNil(k));o("update:value",_)}else{const _=A.isNil(y)?null:a.value.find(k=>k.id===y)??null;o("update:value",_)}};return n.watch(()=>r.value,()=>{var y,_;(_=(y=m.value)==null?void 0:y.$forceUpdate)==null||_.call(y)},{deep:!0}),e({focus:()=>{var y;return(y=m.value)==null?void 0:y.focusInput()},blur:()=>{var y;return(y=m.value)==null?void 0:y.blurInput()}}),(y,_)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:l.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||f.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:h.value,placeholder:"",class:"w-full","onUpdate:value":p},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),mN={},pN=n.defineComponent({...mN,__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:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>{var p;return A.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),a=n.computed(()=>r.showEmptyValue?[H.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=n.computed(()=>{var b;let p=a.value,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=A.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];g=A.union(g,a.value.filter(_=>!_.isActive).map(_=>_.id)),p=p.filter(_=>(r.showEmptyValue?H.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return bt.convertReferencesToSelectOptionsList(p,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(s.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>g.includes(y.id)&&y.isActive)}),d=n.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=n.useTemplateRef("select-component"),f=p=>{if(A.isArray(p)){const g=p.length>0?p.filter(b=>!A.some(r.disabledManagerReferenceList,["id",b])).map(b=>a.value.find(y=>y.id===b)).filter(b=>!A.isNil(b)):[];o("update:value",g)}else{const g=p>0&&!A.some(r.disabledManagerReferenceList,["id",p])?a.value.find(b=>b.id===p):new H.Manager;o("update:value",g??new H.Manager)}};return n.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),n.watch(()=>r.disabledManagerReferenceList,p=>{if(p.length>0&&r.value)if(s.value){const g=r.value;A.some(g,b=>A.some(p,["id",b.id]))&&o("update:value",g.filter(b=>!A.some(p,["id",b.id])))}else{const g=r.value;A.some(p,["id",g.id])&&o("update:value",new H.Manager)}}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:l.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),gN={class:"m-0.5 flex flex-col p-0.5"},yN={class:"flex flex-row gap-1"},bN={key:0},_N={key:1},wN={key:2},xN={key:3},kN={class:"flex flex-row gap-1"},CN={key:0},vN={key:1},SN={key:2},BN={key:3},NN={},hm=n.defineComponent({...NN,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",gN,[n.createElementVNode("span",yN,[t.addr.postIndex?(n.openBlock(),n.createElementBlock("span",bN,n.toDisplayString(t.addr.postIndex)+", ",1)):n.createCommentVNode("",!0),t.addr.city?(n.openBlock(),n.createElementBlock("span",_N,n.toDisplayString(t.addr.city)+", ",1)):n.createCommentVNode("",!0),t.addr.locality?(n.openBlock(),n.createElementBlock("span",wN,n.toDisplayString(t.addr.locality)+", ",1)):n.createCommentVNode("",!0),t.addr.region?(n.openBlock(),n.createElementBlock("span",xN,n.toDisplayString(t.addr.region)+", ",1)):n.createCommentVNode("",!0)]),n.createElementVNode("span",kN,[t.addr.street?(n.openBlock(),n.createElementBlock("span",CN,n.toDisplayString(t.addr.street)+", ",1)):n.createCommentVNode("",!0),t.addr.building?(n.openBlock(),n.createElementBlock("span",vN,n.toDisplayString(t.addr.building)+", ",1)):n.createCommentVNode("",!0),t.addr.buildingPart?(n.openBlock(),n.createElementBlock("span",SN,n.toDisplayString(t.addr.buildingPart)+", ",1)):n.createCommentVNode("",!0),t.addr.apartments?(n.openBlock(),n.createElementBlock("span",BN,n.toDisplayString(t.addr.apartments)+", ",1)):n.createCommentVNode("",!0)])]))}}),ma={clearable:!1,value:"",field:void 0,disabled:!1},TN={},$N=n.defineComponent({...TN,__name:"address-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...ma,minTermLength:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0,wrapContent:!0}),emits:["select","update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.ref(r.value),l=n.ref(!1),a=n.ref([]),c=n.computed(()=>a.value.map(g=>({label:g[r.field??"addressString"]??"-",value:g.id})));n.watch(()=>r.value,g=>{s.value=g}),n.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(l.value=!0,a.value=await(r.searchDataHandler?r.searchDataHandler(s.value,l):H.HttpRequester.getInstance(H.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{l.value=!1}))},f=(g,b)=>{const y=a.value.find(_=>_.id===g.value)||{};return n.h(hm,{addr:y,selected:b},{default:A.constant("-")})},h=g=>{d.cancel();const b=a.value.find(y=>y.id===g)||{};o("select",b)},m=n.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,b)=>{const y=F.NAutoComplete;return n.openBlock(),n.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),n.unref(d)],class:n.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:t.clearable,disabled:t.disabled,loading:l.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),EN={class:"m-0.5 flex flex-col p-0.5"},RN={class:"font-medium"},PN={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},FN={key:0},VN={key:1},MN={},mm=n.defineComponent({...MN,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",EN,[n.createElementVNode("span",RN,n.toDisplayString(t.bank.name),1),n.createElementVNode("span",PN,[t.bank.bic?(n.openBlock(),n.createElementBlock("span",FN," БИК: "+n.toDisplayString(t.bank.bic),1)):n.createCommentVNode("",!0),t.bank.inn?(n.openBlock(),n.createElementBlock("span",VN," ИНН: "+n.toDisplayString(t.bank.inn),1)):n.createCommentVNode("",!0)])]))}}),IN={},AN=n.defineComponent({...IN,__name:"bank-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...ma,minTermLength:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.ref(r.value),l=n.ref(!1),a=n.ref([]),c=n.computed(()=>a.value.map(g=>({label:g[r.field??"_"]??"-",value:g.id})));n.watch(()=>r.value,g=>{s.value=g}),n.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){l.value=!0;try{a.value=await H.HttpRequester.getInstance(H.DataSuggestionProvider).searchBank(s.value)}finally{l.value=!1}}},f=(g,b)=>{const y=a.value.find(_=>_.id===g.value)||{};return n.h(mm,{bank:y,selected:b},{default:A.constant("-")})},h=g=>{d.cancel();const b=a.value.find(y=>y.id===g)||{};o("select",b)},m=n.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,b)=>{const y=F.NAutoComplete;return n.openBlock(),n.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),n.unref(d)],class:n.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:t.clearable,disabled:t.disabled,loading:l.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),ON={class:"font-medium"},zN={key:0,class:"flex flex-row gap-2"},DN={key:0,class:"text-xs font-light text-blue-800"},LN={key:1,class:"text-sc-dark-grey text-xs font-light"},HN={},pm=n.defineComponent({...HN,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,i=n.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=n.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(`m-0.5 flex flex-col p-0.5 ${i.value?"line-through":""}`)},[n.createElementVNode("span",ON,n.toDisplayString(t.org.name),1),t.org.inn||r.value?(n.openBlock(),n.createElementBlock("div",zN,[t.org.inn?(n.openBlock(),n.createElementBlock("span",DN,n.toDisplayString(t.org.inn),1)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("span",LN,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),WN={},jN=n.defineComponent({...WN,__name:"org-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...ma,minTermLength:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.ref(r.value),l=n.ref(!1),a=n.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=n.computed(()=>bt.convertReferencesToSelectOptionsList(a.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));n.watch(()=>r.value,b=>{s.value=b}),n.watch(s,()=>{o("update:value",s.value)});const u=A.debounce(()=>f(),800),f=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){l.value=!0;try{a.value=await H.HttpRequester.getInstance(H.DataSuggestionProvider).searchOrganization(s.value)}finally{l.value=!1}}},h=(b,y)=>{const _=a.value.find(k=>k.id===b.value)||{};return n.h(pm,{org:_,selected:y},{default:A.constant("-")})},m=b=>{u.cancel();const y=a.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&o("select",y)},p=n.ref(null);function g(){p.value.focus()}return e({focus:g}),(b,y)=>{const _=F.NAutoComplete;return n.openBlock(),n.createBlock(_,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[y[0]||(y[0]=k=>s.value=k),n.unref(u)],class:n.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:t.clearable,disabled:t.disabled,loading:l.value,options:d.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:m},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}});Y.ALL_ORDER_MARKERS=oo,Y.CommonValidators=Tm,Y.ConfiguratorSettingsKozyrek=Cu,Y.ConfiguratorSettingsMosquito=fx,Y.ContentHelper=_i,Y.DEFAULT_ORDER_STATUS_COLORS=xs,Y.DateValidators=$m,Y.EntityNameHelper=ni,Y.FileHelper=Nm,Y.KozyrekLine=$n,Y.KozyrekTailTemplate=Bl,Y.KozyrekTemplate=dr,Y.NumericValidators=ae,Y.ORDER_MARKER_COLORS=ks,Y.ORDER_MARKER_NAMES=La,Y.ORDER_STATUS_COLORS=Oa,Y.OrderMarkerEnum=it,Y.OrdersTableFields=Ve,Y.Point=Sl,Y.ScAddProductToCartDialog=ow,Y.ScAddressSuggestion=$N,Y.ScAddressSuggestionLabel=hm,Y.ScBankSuggestion=AN,Y.ScBankSuggestionLabel=mm,Y.ScBaseDialog=$s,Y.ScButtonWithConfirmAction=Rm,Y.ScCategoryCollapse=Wu,Y.ScClientNameWithShortInfo=Mr,Y.ScCollapse=Hu,Y.ScCollapseItem=Ya,Y.ScCommentEditor=C2,Y.ScConfiguratorsProductInfo=Tr,Y.ScContragentWithShortInfo=qu,Y.ScCreatorUserTypeTag=Qr,Y.ScCuratorSelect=uN,Y.ScDateRange=Zk,Y.ScDateTimeLabel=Uo,Y.ScDebouncedInput=M2,Y.ScDebouncedInputNumber=A2,Y.ScDebt=t2,Y.ScDialogHeader=l2,Y.ScDynamicConfigurator=zu,Y.ScEmail=xw,Y.ScExternalLink=Y2,Y.ScImageGallery=Qa,Y.ScInlineEditableItem=uf,Y.ScInlineView=$l,Y.ScKozyrekConfigurator=vu,Y.ScKozyrekConfiguratorParamsForm=nc,Y.ScKozyrekConfiguratorPreview=ku,Y.ScKozyrekConfiguratorTemplates=xu,Y.ScLightGallery=Za,Y.ScManagerOperatorSelect=hN,Y.ScManagerSelect=pN,Y.ScMetalForDoorsConfigurator=Fu,Y.ScMetalForDoorsConfiguratorForm=Pu,Y.ScMosquitoConfigurator=Nu,Y.ScMosquitoConfiguratorForm=Su,Y.ScMosquitoConfiguratorMeasurementInstructions=Bu,Y.ScMosquitoConfiguratorPreview=Nl,Y.ScOrderColorSwatch=fa,Y.ScOrderCommonInfo=nm,Y.ScOrderDeliveryLabel=ps,Y.ScOrderDetails=lm,Y.ScOrderExternalLinks=am,Y.ScOrderHighlightSettings=W4,Y.ScOrderInfo=cm,Y.ScOrderItemParams=tm,Y.ScOrderItemsList=om,Y.ScOrderPayment=ua,Y.ScOrderProductInfo=im,Y.ScOrderStatusHistory=sm,Y.ScOrderStatusTag=rm,Y.ScOrdersList=y4,Y.ScOrgSuggestion=jN,Y.ScOrgSuggestionLabel=pm,Y.ScPage=um,Y.ScPageWithSlidingPanel=cN,Y.ScPersonContactsBlock=ux,Y.ScPhone=qw,Y.ScPhoneInput=D2,Y.ScProductInfoContent=Ts,Y.ScProductInfoDialog=Ja,Y.ScProductInfoPopover=ec,Y.ScProductName=Nr,Y.ScProductsList=x5,Y.ScReferenceSelect=ju,Y.ScSandwichConfigurator=Iu,Y.ScSandwichConfiguratorForm=Mu,Y.ScSandwichM2Configurator=Ou,Y.ScSandwichM2ConfiguratorForm=Au,Y.ScSearchableProductSelect=em,Y.ScSearchableReferenceSelect=Jh,Y.ScSetClientPriceFormItem=tw,Y.ScShortTextOrderInfo=Y4,Y.ScSingleFileUploadSelector=T2,Y.ScSlidingContentWithDrawer=fm,Y.ScStripConfigurator=Ru,Y.ScStripConfiguratorForm=$u,Y.ScStripConfiguratorLineItem=Tu,Y.ScStripConfiguratorPreview=Eu,Y.ScUserShortInfo=ha,Y.ScWarningIcon=F2,Y.SelectOptionHelper=bt,Y.UiNotificationProvider=kr,Y.Validators=We,Y.WindowResolutionEnum=Xe,Y.WindowResolutionProvider=Ye,Y.channelPrimaryInterestOptionsList=E4,Y.componentSizeInjectionKey=Sr,Y.copyToClipboard=Va,Y.deliveryTypeReferenceList=b4,Y.getOrderMarkerColors=vr,Y.getOrderMarkerName=Cs,Y.getOrderMarkers=vs,Y.getOrderStatusColors=bi,Y.getOrderStatusCssVariables=Da,Y.getOrderStatusTagColor=za,Y.getProductInfoFiles=Ss,Y.handleFloatInput=so,Y.handleIntegerInput=lt,Y.hasProductInfo=Wa,Y.isCanSandwichM2Show=hx,Y.isCanSandwichShow=Lu,Y.isConfiguratorType=Du,Y.managersReferenceList=_4,Y.naiveUiTheme=yp,Y.operatorReferenceList=$4,Y.opfReferenceList=w4,Y.orderStatusDetailReferenceList=T4,Y.orderStatusReferenceList=dm,Y.parse=ct,Y.partnerGroupReferenceList=x4,Y.paymentTypeReferenceList=N4,Y.priceCoefficientsReferenceList=k4,Y.productFilesTypesReferenceList=C4,Y.renderConfig=qe,Y.resetInputValidation=rt,Y.resourceReferencesList=v4,Y.salesDirectionsReferenceList=S4,Y.searchCityReferenceDataHandler=P4,Y.searchCityReferenceLabelRenderer=F4,Y.searchClientReferenceDataHandler=V4,Y.searchClientReferenceLabelRenderer=M4,Y.selectAllTextOnFocus=He,Y.sourcePrimaryInterestOptionsList=R4,Y.useHoverSupport=Ha,Y.vCopy=Ma,Y.vFocusNext=ti,Y.warehousesReferenceList=B4,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[Kh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function ms(t){return t.type==="group"}function Qh(t){return t.type==="ignored"}function da(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function l5(t,e){return{getIsGroup:ms,getIgnored:Qh,getKey(r){return ms(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function a5(t,e,i,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const l=[];for(const a of s)if(ms(a)){const c=o(a[r]);c.length&&l.push(Object.assign({},a,{[r]:c}))}else{if(Qh(a))continue;e(i,a)&&l.push(a)}return l}return o(t)}function c5(t,e,i){const r=new Map;return t.forEach(o=>{ms(o)?o[i].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var d5={};const u5=Object.assign(Object.assign({},Nt.props),{to:jn.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}),f5=n.defineComponent({name:"Select",props:u5,slots:Object,setup(t){d5.NODE_ENV!=="production"&&n.watchEffect(()=>{t.items!==void 0&&fi("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&fi("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:i,namespaceRef:r,inlineThemeDisabled:o}=Ii(t),s=Nt("Select","-select",s5,o5,t,e),l=n.ref(t.defaultValue),a=n.toRef(t,"value"),c=Ol(a,l),d=n.ref(!1),u=n.ref(""),f=Sf(t,["items","options"]),h=n.ref([]),m=n.ref([]),p=n.computed(()=>m.value.concat(h.value).concat(f.value)),g=n.computed(()=>{const{filter:D}=t;if(D)return D;const{labelField:Q,valueField:se}=t;return(me,ge)=>{if(!ge)return!1;const xe=ge[Q];if(typeof xe=="string")return da(me,xe);const Be=ge[se];return typeof Be=="string"?da(me,Be):typeof Be=="number"?da(me,String(Be)):!1}}),b=n.computed(()=>{if(t.remote)return f.value;{const{value:D}=p,{value:Q}=u;return!Q.length||!t.filterable?D:a5(D,g.value,Q,t.childrenField)}}),y=n.computed(()=>{const{valueField:D,childrenField:Q}=t,se=l5(D,Q);return OC(b.value,se)}),_=n.computed(()=>c5(p.value,t.valueField,t.childrenField)),k=n.ref(!1),x=Ol(n.toRef(t,"show"),k),v=n.ref(null),N=n.ref(null),w=n.ref(null),{localeRef:T}=Fh("Select"),C=n.computed(()=>{var D;return(D=t.placeholder)!==null&&D!==void 0?D:T.value.placeholder}),$=[],E=n.ref(new Map),V=n.computed(()=>{const{fallbackOption:D}=t;if(D===void 0){const{labelField:Q,valueField:se}=t;return me=>({[Q]:String(me),[se]:me})}return D===!1?!1:Q=>Object.assign(D(Q),{value:Q})});function P(D){const Q=t.remote,{value:se}=E,{value:me}=_,{value:ge}=V,xe=[];return D.forEach(Be=>{if(me.has(Be))xe.push(me.get(Be));else if(Q&&se.has(Be))xe.push(se.get(Be));else if(ge){const Te=ge(Be);Te&&xe.push(Te)}}),xe}const I=n.computed(()=>{if(t.multiple){const{value:D}=c;return Array.isArray(D)?P(D):[]}return null}),U=n.computed(()=>{const{value:D}=c;return!t.multiple&&!Array.isArray(D)?D===null?null:P([D])[0]||null:null}),J=yS(t),{mergedSizeRef:Z,mergedDisabledRef:L,mergedStatusRef:O}=J;function z(D,Q){const{onChange:se,"onUpdate:value":me,onUpdateValue:ge}=t,{nTriggerFormChange:xe,nTriggerFormInput:Be}=J;se&&Bt(se,D,Q),ge&&Bt(ge,D,Q),me&&Bt(me,D,Q),l.value=D,xe(),Be()}function M(D){const{onBlur:Q}=t,{nTriggerFormBlur:se}=J;Q&&Bt(Q,D),se()}function R(){const{onClear:D}=t;D&&Bt(D)}function W(D){const{onFocus:Q,showOnFocus:se}=t,{nTriggerFormFocus:me}=J;Q&&Bt(Q,D),me(),se&&q()}function K(D){const{onSearch:Q}=t;Q&&Bt(Q,D)}function G(D){const{onScroll:Q}=t;Q&&Bt(Q,D)}function X(){var D;const{remote:Q,multiple:se}=t;if(Q){const{value:me}=E;if(se){const{valueField:ge}=t;(D=I.value)===null||D===void 0||D.forEach(xe=>{me.set(xe[ge],xe)})}else{const ge=U.value;ge&&me.set(ge[t.valueField],ge)}}}function j(D){const{onUpdateShow:Q,"onUpdate:show":se}=t;Q&&Bt(Q,D),se&&Bt(se,D),k.value=D}function q(){L.value||(j(!0),k.value=!0,t.filterable&&pi())}function le(){j(!1)}function de(){u.value="",m.value=$}const ve=n.ref(!1);function st(){t.filterable&&(ve.value=!0)}function _e(){t.filterable&&(ve.value=!1,x.value||de())}function we(){L.value||(x.value?t.filterable?pi():le():q())}function xt(D){var Q,se;!((se=(Q=w.value)===null||Q===void 0?void 0:Q.selfRef)===null||se===void 0)&&se.contains(D.relatedTarget)||(d.value=!1,M(D),le())}function Ee(D){W(D),d.value=!0}function Zt(){d.value=!0}function yn(D){var Q;!((Q=v.value)===null||Q===void 0)&&Q.$el.contains(D.relatedTarget)||(d.value=!1,M(D),le())}function Rt(){var D;(D=v.value)===null||D===void 0||D.focus(),le()}function Jn(D){var Q;x.value&&(!((Q=v.value)===null||Q===void 0)&&Q.$el.contains(Or(D))||le())}function bn(D){if(!Array.isArray(D))return[];if(V.value)return Array.from(D);{const{remote:Q}=t,{value:se}=_;if(Q){const{value:me}=E;return D.filter(ge=>se.has(ge)||me.has(ge))}else return D.filter(me=>se.has(me))}}function ln(D){Me(D.rawNode)}function Me(D){if(L.value)return;const{tag:Q,remote:se,clearFilterAfterSelect:me,valueField:ge}=t;if(Q&&!se){const{value:xe}=m,Be=xe[0]||null;if(Be){const Te=h.value;Te.length?Te.push(Be):h.value=[Be],m.value=$}}if(se&&E.value.set(D[ge],D),t.multiple){const xe=bn(c.value),Be=xe.findIndex(Te=>Te===D[ge]);if(~Be){if(xe.splice(Be,1),Q&&!se){const Te=te(D[ge]);~Te&&(h.value.splice(Te,1),me&&(u.value=""))}}else xe.push(D[ge]),me&&(u.value="");z(xe,P(xe))}else{if(Q&&!se){const xe=te(D[ge]);~xe?h.value=[h.value[xe]]:h.value=$}yr(),le(),z(D[ge],D)}}function te(D){return h.value.findIndex(se=>se[t.valueField]===D)}function ce(D){x.value||q();const{value:Q}=D.target;u.value=Q;const{tag:se,remote:me}=t;if(K(Q),se&&!me){if(!Q){m.value=$;return}const{onCreate:ge}=t,xe=ge?ge(Q):{[t.labelField]:Q,[t.valueField]:Q},{valueField:Be,labelField:Te}=t;f.value.some(et=>et[Be]===xe[Be]||et[Te]===xe[Te])||h.value.some(et=>et[Be]===xe[Be]||et[Te]===xe[Te])?m.value=$:m.value=[xe]}}function Ie(D){D.stopPropagation();const{multiple:Q}=t;!Q&&t.filterable&&le(),R(),Q?z([],[]):z(null,null)}function mi(D){!Ar(D,"action")&&!Ar(D,"empty")&&!Ar(D,"header")&&D.preventDefault()}function at(D){G(D)}function Qt(D){var Q,se,me,ge,xe;if(!t.keyboard){D.preventDefault();return}switch(D.key){case" ":if(t.filterable)break;D.preventDefault();case"Enter":if(!(!((Q=v.value)===null||Q===void 0)&&Q.isComposing)){if(x.value){const Be=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();Be?ln(Be):t.filterable||(le(),yr())}else if(q(),t.tag&&ve.value){const Be=m.value[0];if(Be){const Te=Be[t.valueField],{value:et}=c;t.multiple&&Array.isArray(et)&&et.includes(Te)||Me(Be)}}}D.preventDefault();break;case"ArrowUp":if(D.preventDefault(),t.loading)return;x.value&&((me=w.value)===null||me===void 0||me.prev());break;case"ArrowDown":if(D.preventDefault(),t.loading)return;x.value?(ge=w.value)===null||ge===void 0||ge.next():q();break;case"Escape":x.value&&(hS(D),le()),(xe=v.value)===null||xe===void 0||xe.focus();break}}function yr(){var D;(D=v.value)===null||D===void 0||D.focus()}function pi(){var D;(D=v.value)===null||D===void 0||D.focusInput()}function Hi(){var D;x.value&&((D=N.value)===null||D===void 0||D.syncPosition())}X(),n.watch(n.toRef(t,"options"),X);const br={focus:()=>{var D;(D=v.value)===null||D===void 0||D.focus()},focusInput:()=>{var D;(D=v.value)===null||D===void 0||D.focusInput()},blur:()=>{var D;(D=v.value)===null||D===void 0||D.blur()},blurInput:()=>{var D;(D=v.value)===null||D===void 0||D.blurInput()}},_n=n.computed(()=>{const{self:{menuBoxShadow:D}}=s.value;return{"--n-menu-box-shadow":D}}),ei=o?Ai("select",void 0,_n,t):void 0;return Object.assign(Object.assign({},br),{mergedStatus:O,mergedClsPrefix:e,mergedBordered:i,namespace:r,treeMate:y,isMounted:ts(),triggerRef:v,menuRef:w,pattern:u,uncontrolledShow:k,mergedShow:x,adjustedTo:jn(t),uncontrolledValue:l,mergedValue:c,followerRef:N,localizedPlaceholder:C,selectedOption:U,selectedOptions:I,mergedSize:Z,mergedDisabled:L,focused:d,activeWithoutMenuOpen:ve,inlineThemeDisabled:o,onTriggerInputFocus:st,onTriggerInputBlur:_e,handleTriggerOrMenuResize:Hi,handleMenuFocus:Zt,handleMenuBlur:yn,handleMenuTabOut:Rt,handleTriggerClick:we,handleToggle:ln,handleDeleteOption:Me,handlePatternInput:ce,handleClear:Ie,handleTriggerBlur:xt,handleTriggerFocus:Ee,handleKeydown:Qt,handleMenuAfterLeave:de,handleMenuClickOutside:Jn,handleMenuScroll:at,handleMenuKeydown:Qt,handleMenuMousedown:mi,mergedTheme:s,cssVars:o?void 0:_n,themeClass:ei==null?void 0:ei.themeClass,onRender:ei==null?void 0:ei.onRender})},render(){return n.h("div",{class:`${this.mergedClsPrefix}-select`},n.h($f,null,{default:()=>[n.h(Ef,null,{default:()=>n.h(i5,{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)]}})}),n.h(qf,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===jn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>n.h(n.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,i;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),n.withDirectives(n.h(PB,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:[(i=this.menuProps)===null||i===void 0?void 0:i.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,o;return[(o=(r=this.$slots).empty)===null||o===void 0?void 0:o.call(r)]},header:()=>{var r,o;return[(o=(r=this.$slots).header)===null||o===void 0?void 0:o.call(r)]},action:()=>{var r,o;return[(o=(r=this.$slots).action)===null||o===void 0?void 0:o.call(r)]}}),this.displayDirective==="show"?[[n.vShow,this.mergedShow],[es,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[es,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),h5={},Jh=n.defineComponent({...h5,__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=H.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:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),a=n.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=n.computed(()=>a.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=n.ref(!1),u=n.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(k=>{if(A.isEmpty(k))return;const x=s.value?r.value:r.value?[r.value]:[],v=k.filter(N=>!x.some(w=>w.id===N.id));a.value=r.optionsListConverter([...x,...v])}).finally(()=>{d.value=!1}))};let h="";const m=A.debounce(()=>f(h),800),p=_=>{h=_,m()},g=_=>{var k;if(A.isArray(_)){const x=_.length>0?_.map(v=>{var N;return n.toRaw((N=a.value.find(w=>w.value===v))==null?void 0:N.item)}):[];o("update:value",x)}else if(_>0){const x=n.toRaw((k=a.value.find(v=>v.value===_))==null?void 0:k.item);o("update:value",x)}else o("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,k)=>(n.openBlock(),n.createBlock(n.unref(f5),{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:s.value,options:c.value,placeholder:t.placeholder,remote:!0,value:l.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:p,"onUpdate:value":g},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),m5={},em=n.defineComponent({...m5,__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=H.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:i}){const r=t,o=i,s=n.useTemplateRef("select-component"),l=async f=>r.searchType==="categories"?H.HttpRequester.getInstance(H.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?H.HttpRequester.getInstance(H.ProductDataProvider).publicSimpleSearch(f):new Promise(h=>{h([])}),a=f=>r.searchType==="categories"?bt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":h.name):r.searchType==="products"?bt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":`[${h.code}] ${h.name}`):[],c=(f,h)=>{if(r.renderLabel)return r.renderLabel(f,h);if(r.searchType==="products"){const m=f.item;return n.h("div",{},[n.h("span",{class:"text-sc-grey mr-2.5"},m.code),n.h("span",{},[m.name])])}if(r.searchType==="categories"){const m=f.item;return n.h("div",{},[m.name])}};return e({focus:()=>{var f;return(f=s.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=s.value)==null?void 0:f.blur()}}),(f,h)=>(n.openBlock(),n.createBlock(Jh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":l,"options-list-converter":a,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":h[0]||(h[0]=m=>o("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),p5={class:"col-span-2 flex flex-row gap-2.5"},g5={class:"flex-1"},y5={class:"text-sc-grey"},b5={class:"ml-2.5"},_5={key:0,class:"flex-none"},w5={},x5=n.defineComponent({...w5,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(null),s=()=>structuredClone(n.toRaw(i.value)),l=n.ref(s()),a=()=>{r("update:value",l.value.map(f=>n.toRaw(f)))},c=f=>{f&&(l.value=[...l.value.map(h=>n.toRaw(h)),...(A.isArray(f)?f:[f]).filter(h=>!l.value.some(m=>m.id===h.id))],n.nextTick(()=>{o.value=null}),a())},d=f=>{f&&(l.value=l.value.map(h=>h.id===f.id?f:n.toRaw(h)),a())},u=f=>{l.value=l.value.filter(h=>h.id!==f.id),a()};return n.watch(()=>i.value,()=>{l.value=s()}),(f,h)=>{const m=F.NListItem,p=G2,g=F.NButton,b=F.NList;return n.openBlock(),n.createBlock(b,{"show-divider":!1,hoverable:!0},{header:n.withCtx(()=>[n.renderSlot(f.$slots,"header")]),footer:n.withCtx(()=>[n.createVNode(em,{value:o.value,"onUpdate:value":[h[0]||(h[0]=y=>o.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:n.withCtx(()=>[l.value.length===0?(n.openBlock(),n.createBlock(m,{key:0,class:"text-center text-sm text-gray-600"},{default:n.withCtx(()=>[...h[1]||(h[1]=[n.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,y=>(n.openBlock(),n.createBlock(m,{key:y.id},{suffix:n.withCtx(()=>[n.createVNode(g,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:n.withCtx(()=>[n.createVNode(p)]),_:1},8,["disabled","onClick"])]),default:n.withCtx(()=>[n.createElementVNode("div",p5,[n.createElementVNode("span",g5,[n.createElementVNode("span",y5,n.toDisplayString(y.code),1),n.createElementVNode("span",b5,n.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(n.openBlock(),n.createElementBlock("div",_5,[n.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):n.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),k5={class:"flex flex-col"},C5={class:"flex flex-col gap-1.5 text-base text-nowrap"},v5={class:"font-medium"},S5={class:"flex flex-col text-sc-dark-grey"},B5={key:0},N5={class:"font-medium"},T5={class:"font-medium"},$5={class:"font-medium"},E5={class:"font-medium"},R5={class:"font-medium"},P5={class:"font-medium"},F5={class:"font-medium"},V5={class:"font-medium"},M5={class:"font-medium"},I5={class:"font-medium"},A5={class:"flex flex-col gap-1.5 text-base text-nowrap"},O5={class:"font-medium"},z5={class:"flex flex-col text-sc-dark-grey"},D5={class:"font-medium"},L5={class:"font-medium"},H5={class:"flex flex-col gap-1.5 text-base text-nowrap"},W5={class:"font-medium"},j5={class:"text-sc-dark-grey"},q5={class:"font-medium"},X5={key:1,class:"text-base font-medium text-nowrap"},Y5={},tm=n.defineComponent({...Y5,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[H.ConfiguratorsEnum.Kozyrek,H.ConfiguratorsEnum.Mosquitto,H.ConfiguratorsEnum.Strip,H.ConfiguratorsEnum.MetalForDoors,H.ConfiguratorsEnum.Sandwich,H.ConfiguratorsEnum.SandwichM2],i=t,r=n.ref(!1),o=n.computed(()=>{var h,m;return((h=i.item.product.unit)==null?void 0:h.isLinear)&&((m=i.item.product.properties)==null?void 0:m.isLengthConfigurator)}),s=n.computed(()=>H.UnitsHelper.getProductLengthMultiplicity(i.item.product)),l=n.computed(()=>H.UnitsHelper.getProductMultiplicity(i.item.product)),a=n.computed(()=>l.value>1),c=n.ref({quantity:i.item.quantity});n.watch(()=>i.item,h=>{c.value={quantity:h.quantity}});const d=h=>{var m;h!==null&&(c.value.quantity=h,(m=i.eventEmitter)==null||m.emit("order-item:edit-quantity",{item:i.item,quantity:h,loaderRef:r}))},u=()=>{var h;(h=i.eventEmitter)==null||h.emit("order-item:open-configurator",{item:i.item})},f=()=>{var h;(h=i.eventEmitter)==null||h.emit("order-item:edit",{item:i.item})};return(h,m)=>{const p=F.NInputNumber;return n.openBlock(),n.createElementBlock("div",k5,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",C5,[n.createElementVNode("span",null,[m[1]||(m[1]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",v5,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",S5,[t.item.configurator===n.unref(H.ConfiguratorsEnum).Kozyrek?(n.openBlock(),n.createElementBlock("span",B5,[m[2]||(m[2]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",N5,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).Mosquitto?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("span",null,[m[3]||(m[3]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",T5,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[4]||(m[4]=n.createTextVNode(" Высота: ",-1)),n.createElementVNode("span",$5,n.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).Strip?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.item.configuratorParams.linesWidths,(g,b)=>(n.openBlock(),n.createElementBlock("span",{key:b},[n.createTextVNode(" Полоса №"+n.toDisplayString(Number(b)+1)+": ",1),n.createElementVNode("span",E5,n.toDisplayString(g)+" мм.",1)]))),128)),n.createElementVNode("span",null,[m[5]||(m[5]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",R5,n.toDisplayString(t.item.length)+" м.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).MetalForDoors?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("span",null,[m[6]||(m[6]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",P5,n.toDisplayString(t.item.width)+" мм.",1)]),n.createElementVNode("span",null,[m[7]||(m[7]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",F5,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).Sandwich?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:4},n.renderList(t.item.configuratorParams.items??[],(g,b)=>(n.openBlock(),n.createElementBlock("span",{key:b},[n.createTextVNode(" Изделие №"+n.toDisplayString(Number(b)+1)+": ",1),n.createElementVNode("span",V5,n.toDisplayString(g.width)+"×"+n.toDisplayString(g.length)+" мм, "+n.toDisplayString(g.count)+" шт.",1)]))),128)):n.createCommentVNode("",!0),t.item.configurator===n.unref(H.ConfiguratorsEnum).SandwichM2?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("span",null,[m[8]||(m[8]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",M5,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[9]||(m[9]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",I5,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0)])]),t.allowEdit?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:n.withModifiers(u,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):o.value&&s.value>0?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",A5,[n.createElementVNode("span",null,[m[10]||(m[10]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",O5,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",z5,[n.createElementVNode("span",null,[m[11]||(m[11]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",D5,n.toDisplayString(s.value)+" "+n.toDisplayString(t.item.product.unit.name),1)]),n.createElementVNode("span",null,[m[12]||(m[12]=n.createTextVNode(" Всего: ",-1)),n.createElementVNode("span",L5,n.toDisplayString(t.item.quantity*s.value)+" "+n.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:n.withModifiers(f,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("div",H5,[n.createElementVNode("span",null,[m[13]||(m[13]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",W5,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("span",j5,[m[14]||(m[14]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",q5,n.toDisplayString(t.item.length??t.item.width)+" "+n.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:n.withModifiers(f,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[t.allowEdit?(n.openBlock(),n.createBlock(p,{key:0,value:c.value.quantity,parse:n.unref(ct),min:l.value,step:l.value,"show-button":a.value,"button-placement":"both",disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:m[0]||(m[0]=g=>n.unref(so)(g,".",!1)),onFocus:n.unref(He),"onUpdate:value":d},{suffix:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(n.openBlock(),n.createElementBlock("span",X5,n.toDisplayString(t.item.quantity)+" "+n.toDisplayString(t.item.product.unit.name),1))],64))])}}}),K5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U5(t,e){return n.openBlock(),n.createElementBlock("svg",K5,[...e[0]||(e[0]=[n.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 G5=n.markRaw({name:"tabler-truck-filled",render:U5}),Z5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q5(t,e){return n.openBlock(),n.createElementBlock("svg",Z5,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.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"}),n.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const J5=n.markRaw({name:"tabler-truck-delivery",render:Q5}),e3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t3(t,e){return n.openBlock(),n.createElementBlock("svg",e3,[...e[0]||(e[0]=[n.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[n.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),n.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 n3=n.markRaw({name:"tabler-truck-loading",render:t3}),i3={class:"flex flex-col gap-1"},r3={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},o3={key:1,class:"text-base"},s3={class:"text-sc-dark-grey mr-1.5"},l3={key:0},a3={key:1},c3={},ps=n.defineComponent({...c3,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=n.computed(()=>{var s;return(s=H.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(l=>l.id===o.delivery.type)}),i=n.computed(()=>ke.format(o.delivery.date,"dd.MM.yyyy")),r=n.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?ni.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=t;return(s,l)=>{var u,f,h,m,p,g,b,y;const a=n3,c=J5,d=G5;return n.openBlock(),n.createElementBlock("div",i3,[t.showType?(n.openBlock(),n.createElementBlock("span",r3,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(n.openBlock(),n.createBlock(a,{key:0})):n.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="delivery"?(n.openBlock(),n.createBlock(c,{key:1})):n.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(n.openBlock(),n.createBlock(d,{key:2})):n.createCommentVNode("",!0),n.createElementVNode("span",null,n.toDisplayString((m=e.value)==null?void 0:m.name),1)])):n.createCommentVNode("",!0),t.showDetails?(n.openBlock(),n.createElementBlock("span",o3,[n.createElementVNode("span",s3,n.toDisplayString(i.value),1),(g=(p=t.delivery)==null?void 0:p.address)!=null&&g.address?(n.openBlock(),n.createElementBlock("span",l3,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0),(y=(b=t.delivery)==null?void 0:b.warehouse)!=null&&y.address?(n.openBlock(),n.createElementBlock("span",a3," со склада "+n.toDisplayString(t.delivery.warehouse.address),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])}}}),d3={class:"flex flex-col gap-2.5"},u3={class:"text-base"},f3=["href"],h3={key:1,class:"text-sc-grey"},m3={},nm=n.defineComponent({...m3,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{},highlightSettings:{}},setup(t){const e=t,i=n.computed(()=>e.fields.includes(Ve.Id)?e.order.id:void 0),r=n.computed(()=>{var f,h;return e.fields.includes(Ve.Status)?(h=(f=H.useReferencesStore().orderStatusReference)==null?void 0:f.find(m=>{var p;return m.id===(((p=e.order.status)==null?void 0:p.id)??-1)}))==null?void 0:h.name:void 0}),o=n.computed(()=>{var f;return bi((f=e.order.status)==null?void 0:f.slug)}),s=n.computed(()=>{var h,m;const f=(h=e.order.status)==null?void 0:h.slug;return!!f&&(((m=e.highlightSettings)==null?void 0:m.statuses.includes(f))??!1)}),l=n.computed(()=>vs(e.order).filter(f=>[it.OnOrder,it.NotInStock].includes(f))),a=f=>{var h;return((h=e.highlightSettings)==null?void 0:h.markers.includes(f))??!1},c=n.computed(()=>e.fields.includes(Ve.CreatedAt)),d=n.computed(()=>e.fields.includes(Ve.ClientInfo)||e.fields.includes(Ve.ClientInfoShort)?e.order.client:void 0),u=n.computed(()=>e.fields.includes(Ve.DeliveryInfo)?e.order.delivery:void 0);return(f,h)=>(n.openBlock(),n.createElementBlock("div",d3,[n.createElementVNode("span",u3,[i.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+n.toDisplayString(i.value),9,f3)):n.createCommentVNode("",!0),c.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[h[0]||(h[0]=n.createTextVNode(" от ",-1)),n.createVNode(Ko,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[h[1]||(h[1]=n.createTextVNode(" - ",-1)),s.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"font-medium",style:n.normalizeStyle({color:o.value.color})},n.toDisplayString(r.value),5)):(n.openBlock(),n.createElementBlock("span",h3,n.toDisplayString(r.value),1))],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m},[h[2]||(h[2]=n.createTextVNode(" - ",-1)),n.createElementVNode("span",{class:n.normalizeClass({"font-medium":a(m),"text-sc-dark-grey":!a(m)}),style:n.normalizeStyle(a(m)?{color:n.unref(vr)(m).color}:void 0)},n.toDisplayString(n.unref(Cs)(m)),7)],64))),128))]),d.value?(n.openBlock(),n.createBlock(Mr,{key:0,client:d.value,class:"ml-3"},null,8,["client"])):n.createCommentVNode("",!0),u.value?(n.openBlock(),n.createBlock(ps,{key:1,delivery:u.value,class:"ml-3"},null,8,["delivery"])):n.createCommentVNode("",!0)]))}}),p3={},ua=n.defineComponent({...p3,__name:"order-payment",props:{payment:{}},setup(t){const e=t,i=n.computed(()=>{var r;return(r=H.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return n.openBlock(),n.createElementBlock("span",null,n.toDisplayString(((s=i.value)==null?void 0:s.name)??"-"),1)}}}),g3={},Qr=n.defineComponent({...g3,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,i={quantity:"количество",length:"длина"},r=n.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=n.computed(()=>{const s={[H.UserTypeEnum.Manager]:"менеджером",[H.UserTypeEnum.Operator]:"оператором",[H.UserTypeEnum.Client]:"клиентом",[H.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const a=e.changedFields.map(d=>i[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${a}`}const l=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${l}`.trim()});return(s,l)=>(n.openBlock(),n.createElementBlock("small",{class:n.normalizeClass(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${r.value}`)},n.toDisplayString(o.value),3))}}),y3={class:"flex flex-row gap-1.5"},b3={class:"flex-none text-nowrap"},_3={class:"flex flex-1 flex-col gap-2.5"},w3={key:0,class:"text-sm"},x3={class:"text-gray-600"},k3={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},C3={key:0},v3={key:1},S3={},im=n.defineComponent({...S3,__name:"order-product-info",props:{product:{},index:{}},setup(t){const e=n.inject(H.currentOrderInjectionKey,null),i=n.computed(()=>{if(e!=null)return n.toValue(e)??void 0});return(r,o)=>{var s;return n.openBlock(),n.createElementBlock("div",y3,[n.createElementVNode("span",b3,n.toDisplayString(t.index+1)+".",1),n.createElementVNode("div",_3,[n.createVNode(Nr,{product:t.product.product},null,8,["product"]),t.product.marker?(n.openBlock(),n.createElementBlock("span",w3,[o[0]||(o[0]=n.createTextVNode(" Маркировка: ",-1)),n.createElementVNode("span",x3,n.toDisplayString(t.product.marker),1)])):n.createCommentVNode("",!0),t.product.creator&&(!i.value||((s=i.value)==null?void 0:s.creator.guid)!==t.product.creator.guid)&&t.product.creator.type?(n.openBlock(),n.createBlock(Qr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):n.createCommentVNode("",!0),n.createElementVNode("div",k3,[o[1]||(o[1]=n.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock("span",C3,n.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(n.openBlock(),n.createElementBlock("span",v3,n.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),o[2]||(o[2]=n.createElementVNode("span",null,"Цена за ед.",-1)),n.createVNode(ii,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),o[3]||(o[3]=n.createElementVNode("span",null,"Сумма",-1)),n.createVNode(ii,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),B3={class:"flex items-center gap-1.5"},N3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},T3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},$3={},rm=n.defineComponent({...$3,__name:"order-status-tag",props:{status:{},statusDetail:{default:null},variant:{default:"filled"},size:{default:"medium"},showDot:{type:Boolean,default:!0}},setup(t){const e=t,i=n.computed(()=>bi(e.status.slug)),r=n.computed(()=>za(e.status.slug)),o=n.computed(()=>e.statusDetail?`${e.status.name} (${e.statusDetail.name})`:e.status.name);return(s,l)=>{const a=F.NTag;return t.variant==="filled"?(n.openBlock(),n.createBlock(a,{key:0,color:r.value,bordered:!1,size:t.size,round:""},{default:n.withCtx(()=>[n.createElementVNode("span",B3,[t.showDot?(n.openBlock(),n.createElementBlock("span",N3)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)])]),_:1},8,["color","size"])):(n.openBlock(),n.createElementBlock("span",{key:1,class:"inline-flex items-center gap-1.5 font-medium",style:n.normalizeStyle({color:i.value.color})},[t.showDot?(n.openBlock(),n.createElementBlock("span",T3)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)],4))}}}),E3={},fa=n.defineComponent({...E3,__name:"order-color-swatch",props:{colors:{}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("span",{class:"inline-flex h-5 min-w-8 shrink-0 items-center justify-center rounded px-1.5 text-xs font-semibold leading-none",style:n.normalizeStyle({backgroundColor:t.colors.backgroundColor,color:t.colors.textOnBackgroundColor,border:`1px solid ${t.colors.color}`})}," Аа ",4))}}),R3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P3(t,e){return n.openBlock(),n.createElementBlock("svg",R3,[...e[0]||(e[0]=[n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"},null,-1),n.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40m-64 64v224m-72-224l8 224m136-224l-8 224"},null,-1)])])}const F3=n.markRaw({name:"ion-trash-outline",render:P3}),V3={},M3=n.defineComponent({...V3,__name:"order-item-specification",props:{src:{}},setup(t){const e=n.useTemplateRef("image-reference");return(i,r)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("a",{class:"text-blue-500 hover:underline text-sm mt-1 block cursor-pointer",onClick:r[0]||(r[0]=o=>{var s;return(s=e.value)==null?void 0:s.showPreview()})}," Спецификация "),n.withDirectives(n.createVNode(n.unref(F.NImage),{ref:"image-reference",src:t.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[n.vShow,!1]])],64))}}),I3={class:"flex flex-col gap-0.5"},A3={class:"text-gray-600"},O3={},z3=n.defineComponent({...O3,__name:"order-item-name",props:{item:{}},setup(t){const e=t,i=n.inject(H.currentOrderInjectionKey,null),r=n.computed(()=>{if(i!=null)return n.toValue(i)??void 0}),o=n.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),s=n.computed(()=>{var d;return"creator"in e.item&&!!((d=e.item.creator)!=null&&d.type)&&(!r.value||r.value.creator.guid!==e.item.creator.guid)}),l=n.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),a=n.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),c=n.computed(()=>{var d,u;return"replacement"in e.item?(u=(d=e.item.replacement)==null?void 0:d.creator)==null?void 0:u.type:void 0});return(d,u)=>(n.openBlock(),n.createElementBlock("div",I3,[n.createElementVNode("div",{class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(Nr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(o.value?"line-through opacity-50":"")},[u[0]||(u[0]=n.createTextVNode(" Маркировка: ",-1)),n.createElementVNode("span",A3,n.toDisplayString(t.item.marker),1)],2)):n.createCommentVNode("",!0),l.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(M3,{src:l.value},null,8,["src"])],2)):n.createCommentVNode("",!0),s.value&&!o.value?(n.openBlock(),n.createBlock(Qr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):n.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&a.value.length===0?(n.openBlock(),n.createBlock(Qr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):n.createCommentVNode("",!0),t.item.replacementId&&a.value.length>0?(n.openBlock(),n.createBlock(Qr,{key:4,"user-type":c.value,"changed-fields":a.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):n.createCommentVNode("",!0)]))}}),D3={},L3=n.defineComponent({...D3,__name:"order-items-list",props:n.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(t){const e=t,i=n.useModel(t,"selectedRowKeys"),r=n.computed(()=>A.sortBy(e.products,"ord")),o=m=>!!m.isRemoved||!!m.replacementId,s=(m,p)=>{p?i.value.includes(m)||(i.value=[...i.value,m]):i.value=i.value.filter(g=>g!==m)},l=m=>e.selectable?{class:i.value.includes(m.id)?void 0:"opacity-60"}:{},a=(m,p)=>{const g=r.value,b=m.logicGroupId;if(!b)return 1;const y=g.at(p-1);if(p&&y&&y.logicGroupId===b)return 0;const _=g.slice(p),k=_.findIndex(x=>x.logicGroupId!==b);return k===-1?_.length:k},c=n.ref(Ye.getDeviceTypeByResolution()),d=n.ref(window.innerWidth),u=()=>{const m=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(g,b)=>n.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[b+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:d.value>=1536?156:120,render:g=>n.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[g.product.code])},{title:"Наименование",key:"name",resizable:!0,render:g=>n.h(z3,{item:g})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:a,render:g=>n.h(tm,{class:o(g)?"line-through opacity-50":"",item:g,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!o(g)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:g=>n.h("div",{class:o(g)?"line-through opacity-50":""},[n.h(ii,{product:g,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:g=>n.h("div",{class:o(g)?"line-through opacity-50":""},[n.h(ii,{product:g,costFieldName:"cost",showCurrency:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:a,render:g=>o(g)?null:n.h(F.NButton,{quaternary:!0,type:"error",onClick:()=>{var b;(b=e.eventEmitter)==null||b.emit("order-item:delete",{item:g})}},()=>n.h(F3))}]:[]],p=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:g=>({class:o(g)?void 0:"cursor-pointer",onClick:()=>{o(g)||s(g.id,!i.value.includes(g.id))}}),render:g=>n.h(F.NCheckbox,{checked:i.value.includes(g.id),disabled:o(g)})}]:[];switch(c.value){case Xe.phone:case Xe.tablet:return[...p,{title:"",key:"items",resizable:!0,render:(g,b)=>n.h(im,{product:g,index:b})}];case Xe.laptop:return[...p,...m];default:return[...p,...m]}},f=n.computed(()=>u()),h=()=>{c.value=Ye.getDeviceTypeByResolution(),d.value=window.innerWidth};return n.onMounted(()=>{h(),window.addEventListener("resize",h)}),n.onUnmounted(()=>{window.removeEventListener("resize",h)}),(m,p)=>{const g=F.NDataTable;return n.openBlock(),n.createElementBlock(n.Fragment,null,[p[0]||(p[0]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Список позиций",-1)),n.createVNode(g,{columns:f.value,data:r.value,"row-key":b=>b.id,"row-props":l,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),om=cn(L3,[["__scopeId","data-v-e1fad754"]]),H3={key:0,class:"text-sc-dark-grey my-2 text-center"},W3={key:1,class:"text-sc-dark-grey my-2"},j3={},sm=n.defineComponent({...j3,__name:"order-status-history",props:{order:{}},setup(t){const e=t,i=n.ref(!1),r=n.ref([]),o=l=>{const{uiDateWithTime:a}=H.useBaseConfigStateStore().config.dateFormats;return ke.format(l,a)},s=(l=!0)=>{l&&(i.value=!0),H.HttpRequester.getInstance(H.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(a=>{r.value=a}).finally(()=>{l&&(i.value=!1)})};return n.watch(()=>e.order,()=>{s(!1)}),n.onMounted(()=>{s()}),(l,a)=>{const c=F.NSpin,d=F.NTimelineItem,u=F.NTimeline;return n.openBlock(),n.createElementBlock("div",null,[a[1]||(a[1]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),i.value?(n.openBlock(),n.createElementBlock("div",H3,[n.createVNode(c,{size:"small",class:"mb-1 align-middle"}),a[0]||(a[0]=n.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(n.openBlock(),n.createElementBlock("div",W3," История статусов отсутствует. ")):(n.openBlock(),n.createBlock(u,{key:2},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(f,h)=>(n.openBlock(),n.createBlock(d,{key:h,color:n.unref(bi)(f.status.slug).color,time:o(f.createdAt),content:f.user.name},{header:n.withCtx(()=>[n.createVNode(rm,{status:f.status,"status-detail":f.statusDetail,variant:h===0?"filled":"text","show-dot":!1,size:"small"},null,8,["status","status-detail","variant"])]),_:2},1032,["color","time","content"]))),128))]),_:1}))])}}}),q3={class:"text-base"},X3={},ha=n.defineComponent({...X3,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[n.createElementVNode("span",q3,n.toDisplayString(t.user.name),1),t.showUserType?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+n.toDisplayString(t.user.type)+"] ",3)):n.createCommentVNode("",!0)],2))}}),Y3={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},K3={class:"col-span-2"},U3={class:"col-span-2"},G3={},lm=n.defineComponent({...G3,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const i=e;return(r,o)=>(n.openBlock(),n.createElementBlock("div",null,[o[11]||(o[11]=n.createElementVNode("h3",null,"Детали заказа",-1)),n.createElementVNode("div",Y3,[t.order.creator.id!==t.order.client.id?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[o[1]||(o[1]=n.createElementVNode("span",null,"Создал",-1)),n.createVNode(ha,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):n.createCommentVNode("",!0),o[10]||(o[10]=n.createElementVNode("span",null,"Клиент",-1)),n.createVNode(Mr,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>i("click:client-name",t.order.client,s))},null,8,["client"]),t.order.contragent?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[o[2]||(o[2]=n.createElementVNode("span",null,"Контрагент",-1)),n.createVNode(qu,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):n.createCommentVNode("",!0),t.order.image?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[o[3]||(o[3]=n.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=n.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):n.createCommentVNode("",!0),t.order.barcode?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[o[5]||(o[5]=n.createElementVNode("span",null,"Штрих-код",-1)),n.createElementVNode("span",K3,n.toDisplayString(t.order.barcode),1)],64)):n.createCommentVNode("",!0),t.order.payment?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[o[6]||(o[6]=n.createElementVNode("span",null,"Оплата",-1)),n.createVNode(ua,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):n.createCommentVNode("",!0),t.order.delivery?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[o[7]||(o[7]=n.createElementVNode("span",null,"Доставка",-1)),n.createVNode(ps,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):n.createCommentVNode("",!0),t.order.comment?(n.openBlock(),n.createElementBlock(n.Fragment,{key:6},[o[8]||(o[8]=n.createElementVNode("span",null,"Комментарий",-1)),n.createElementVNode("span",U3,n.toDisplayString(t.order.comment),1)],64)):n.createCommentVNode("",!0),t.order.attachedUser?(n.openBlock(),n.createElementBlock(n.Fragment,{key:7},[o[9]||(o[9]=n.createElementVNode("span",null,"Закреплен за",-1)),n.createVNode(ha,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):n.createCommentVNode("",!0)])]))}}),Z3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Q3(t,e){return n.openBlock(),n.createElementBlock("svg",Z3,[...e[0]||(e[0]=[n.createElementVNode("rect",{width:"336",height:"336",x:"128",y:"128",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32",rx:"57",ry:"57"},null,-1),n.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24"},null,-1)])])}const J3=n.markRaw({name:"ion-copy-outline",render:Q3}),e4={class:"flex flex-col items-stretch gap-1.5 text-base"},t4={},n4=n.defineComponent({...t4,__name:"order-external-links",props:{order:{}},setup(t){const e=n.computed(()=>{var r,o;return(((r=t.order.invoices)==null?void 0:r.length)??0)>0||!!((o=t.order.payment)!=null&&o.onlinePaymentLink)});return(i,r)=>{var l;const o=F.NButton,s=J3;return e.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[r[1]||(r[1]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),n.createElementVNode("div",e4,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.order.invoices??[],(a,c)=>(n.openBlock(),n.createBlock(o,{key:c,tag:"a",href:a,block:"",class:"sc-external-link-button"},{default:n.withCtx(()=>[n.createTextVNode(" Скачать счет №"+n.toDisplayString(c+1),1)]),_:2},1032,["href"]))),128)),(l=t.order.payment)!=null&&l.onlinePaymentLink?n.withDirectives((n.openBlock(),n.createBlock(o,{key:0,block:"",class:"sc-external-link-button",title:"Ссылка на оплату копируется в буфер обмена"},{default:n.withCtx(()=>[n.createVNode(s,{class:"mr-1.5"}),r[0]||(r[0]=n.createTextVNode(" Скопировать ссылку на оплату ",-1))]),_:1})),[[n.unref(Ma),t.order.payment.onlinePaymentLink]]):n.createCommentVNode("",!0)])],64)):n.createCommentVNode("",!0)}}}),am=cn(n4,[["__scopeId","data-v-88d2e256"]]),i4={key:0},r4={class:"text-sc-dark-grey my-2 text-center"},o4={key:1,class:"text-sc-dark-grey my-2 text-center"},s4={key:2},l4={class:"text-sc-dark-grey mt-4 text-right font-bold"},a4={class:"text-sc-primary"},c4={},cm=n.defineComponent({...c4,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const i=t,r=e,o=n.ref(!1),s=n.ref();n.provide(H.currentOrderInjectionKey,n.computed(()=>s.value??null));const l=(d=!0)=>{if("products"in i.order){s.value=new H.Order(i.order);return}d&&(o.value=!0),H.HttpRequester.getInstance(H.OrdersDataProvider).getOrder(i.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},a=n.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=n.computed(()=>a.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return n.watch(()=>i.order,()=>{l(!1)}),n.onMounted(()=>{l()}),(d,u)=>{const f=F.NSpin;return o.value?(n.openBlock(),n.createElementBlock("div",i4,[n.createElementVNode("div",r4,[n.createVNode(f,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=n.createElementVNode("div",null,[n.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(n.openBlock(),n.createElementBlock("div",o4," --- Не удалось загрузить данные о заказе --- ")):(n.openBlock(),n.createElementBlock("div",s4,[n.createVNode(om,{products:a.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),n.createElementVNode("div",l4,[u[2]||(u[2]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",a4,n.toDisplayString(c.value)+" ₽",1)]),n.createVNode(lm,{order:s.value,"onClick:clientName":u[0]||(u[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"]),n.createVNode(am,{order:s.value},null,8,["order"]),n.createVNode(sm,{order:s.value},null,8,["order"])]))}}}),d4={},u4=n.defineComponent({...d4,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,i=n.inject(Sr,"small"),r=n.computed(()=>A.isNil(e.orderContextButtonsConfig)?[]:A.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),o=s=>{var l;(l=e.onOrderContextSelect)==null||l.call(e,e.order,s)};return(s,l)=>{var u;const a=Bs,c=F.NButton,d=F.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(n.openBlock(),n.createBlock(d,{key:0,options:r.value,size:n.unref(i),trigger:"click",onSelect:o},{default:n.withCtx(()=>[n.createVNode(c,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(a)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)}}}),f4={},h4=n.defineComponent({...f4,__name:"orders-list",props:n.mergeModels({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},highlightSettings:{default:void 0},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:n.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.useModel(t,"checkedRowKeys"),l=(R,W)=>{W?s.value.includes(R)||(s.value=[...s.value,R]):s.value=s.value.filter(K=>K!==R)},a=()=>A.cloneDeep(r.sort??[{field:"id",direction:"desc"}]),c=n.ref(a()),d=n.ref([]),u=n.ref(!1),f=n.ref(700),h=()=>{const R=Ye.getDeviceTypeByResolution(),W=R===Xe.phone||R===Xe.tablet;if(!(!r.stickyHeaderOnMobile&&W))return f.value*(H.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},m=n.ref(h()),p=n.computed(()=>r.highlightSettings?r.highlightSettings:{statuses:[],markers:r.useCellIndication?[...oo]:[]}),g=R=>{const W={onDblclick:()=>o("dblclick:row",R)},K=[];r.selectable&&s.value.length>0&&!s.value.includes(R.id)&&K.push("opacity-60");const G=p.value,X=new Set(vs(R).filter(de=>G.markers.includes(de))),j={},le=[it.NotInStock,it.OnOrder,it.LargeOrder].find(de=>X.has(de));if(le){const de=vr(le);K.push("order-id-marked",le),j["--sc-order-id-bg"]=de.backgroundColor,j["--sc-order-id-text"]=de.textOnBackgroundColor}if(X.has(it.NextDayDelivery)){const de=vr(it.NextDayDelivery);K.push("delivery-date-marked"),j["--sc-delivery-date-bg"]=de.backgroundColor,j["--sc-delivery-date-text"]=de.textOnBackgroundColor}return R.status.slug&&G.statuses.includes(R.status.slug)&&(K.push("order-status-highlighted",R.status.slug),A.assign(j,Da(R.status.slug))),A.isEmpty(j)||(W.style=j),K.length>0&&(W.class=K.join(" ")),W},b=()=>{const R=[Ve.CreatedAt,Ve.Id,Ve.ClientInfo,Ve.ClientCity,Ve.DeliveryDate,Ve.PaymentType,Ve.SalesDirections,Ve.Status,...r.showAttachedUserColumn?[Ve.AttachedUser]:[],Ve.actions],W=r.fields.length>0?r.fields:R,K={title:"???",key:"undefined",render:()=>n.h("span",{},["--- unknown ---"])},G={type:"expand",expandable:A.constant(!0),renderExpand:q=>n.h(cm,{order:q,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{o("click:client-name",q.client,null)}}),width:"30"};let X=[{title:"Дата заказа",key:Ve.CreatedAt,resizable:!0,width:100,render:q=>n.h(Ko,{date:q.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ve.Id,resizable:!0,width:75,className:"order-id",render:q=>n.h("a",{href:r.orderUrl.replace(":id",q.id.toString()),class:"text-base"},q.id)},{title:"Дата доставки / самовывоза",key:Ve.DeliveryDate,resizable:!0,width:120,className:"delivery-date",render:q=>n.h(Ko,{date:q.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ve.ClientInfo,resizable:!0,minWidth:320,render:q=>n.h(Mr,{client:q.client,"onClick:client-name":()=>{o("click:client-name",q.client,null)}})},{title:"Тип доставки",key:Ve.DeliveryInfo,resizable:!0,minWidth:320,render:q=>n.h(ps,{delivery:q.delivery})},{title:"Клиент",key:Ve.ClientInfoShort,resizable:!0,minWidth:320,render:q=>n.h(Mr,{client:q.client,showCityAndRegion:!1,"onClick:client-name":()=>{o("click:client-name",q.client,null)}})},{title:"Город клиента",key:Ve.ClientCity,resizable:!0,minWidth:90,width:120,render:q=>{var le;return n.h("span",{class:"text-base"},((le=q.client)==null?void 0:le.city.name)??"—")}},{title:"Статус",key:Ve.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:q=>n.h("span",{class:"text-base"},[q.status.name])},{title:"Тип оплаты",key:Ve.PaymentType,resizable:!0,width:115,minWidth:95,render:q=>q.payment?n.h(ua,{payment:q.payment}):n.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ve.SalesDirections,resizable:!0,width:80,render:q=>{var le;return n.h("span",{class:"text-base"},[((le=q.salesDirection)==null?void 0:le.name)??""])}},...r.showAttachedUserColumn?[{title:"Закреплено за",key:Ve.AttachedUser,resizable:!0,minWidth:120,render:q=>{var le;return n.h("span",{class:"text-base"},[((le=q==null?void 0:q.attachedUser)==null?void 0:le.name)??""])}}]:[]];r.orderContextButtonsConfig&&X.push({key:"actions",title:"",className:"align-top",width:50,render:q=>n.h(u4,{order:q,orderContextButtonsConfig:r.orderContextButtonsConfig,onOrderContextSelect:r.onOrderContextSelect})}),r.enableSorting&&(X=X.map(q=>[Ve.Id,Ve.CreatedAt,Ve.DeliveryDate].includes(q.key)?{...q,sorter:!0,sortOrder:!1,...q.width===void 0?{}:{width:q.width+16}}:q));const j=r.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:q=>{var de;const le=((de=r.isRowSelectable)==null?void 0:de.call(r,q))??!0;return{class:le?"cursor-pointer":void 0,onClick:()=>{le&&l(q.id,!s.value.includes(q.id))}}},render:q=>{var le;return((le=r.isRowSelectable)==null?void 0:le.call(r,q))??!0?n.h(F.NCheckbox,{checked:s.value.includes(q.id)}):null}}]:[];switch(Ye.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...j,G,{key:"order",title:"Заказ",resizable:!0,render:q=>n.h(nm,{order:q,fields:W,orderUrl:r.orderUrl,highlightSettings:p.value})}];case Xe.laptop:{const q=r.showAttachedUserColumn?W:W.filter(le=>le!==Ve.AttachedUser);return[...j,G,...q.map(le=>X.find(de=>de.key===le)??K)]}default:return[K]}},y=n.ref(b()),_=n.ref(new H.TableDataPagination(r.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),k=n.computed(()=>({..._.value,prefix({itemCount:R}){return`Всего заказов: ${R}`}})),x=n.ref(null),v=n.ref(null),N=n.ref(null),w=n.ref(null),T=n.ref(null),C=()=>{T.value!==null&&(clearInterval(T.value),T.value=null)},$=()=>{C(),r.refreshInterval&&(T.value=setInterval(()=>{P()},r.refreshInterval))},E=R=>{_.value.itemCount!==R.meta.total&&(_.value.itemCount=R.meta.total),_.value.page!==R.meta.currentPage&&(_.value.page=R.meta.currentPage),_.value.pageCount!==R.meta.lastPage&&(_.value.pageCount=R.meta.lastPage),_.value.pageSize!==R.meta.perPage&&(_.value.pageSize=R.meta.perPage),d.value=R.data},V=()=>{var R,W,K;r.filters&&((R=v.value)==null||R.abort(),v.value=null,(W=N.value)==null||W.abort(),N.value=null,w.value=null,(K=x.value)==null||K.abort(),x.value=new AbortController,u.value=!0,H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},x.value.signal).then(G=>{E(G),u.value=!1}).catch(G=>{if((G==null?void 0:G.name)!=="CanceledError")throw u.value=!1,G}))},P=()=>{var R;!r.filters||u.value||((R=v.value)==null||R.abort(),v.value=new AbortController,H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},v.value.signal).then(W=>{d.value=d.value.map(K=>W.data.find(X=>X.id===K.id)??K),_.value.itemCount!==W.meta.total&&(_.value.itemCount=W.meta.total),_.value.pageCount!==W.meta.lastPage&&(_.value.pageCount=W.meta.lastPage)}).catch(W=>{if((W==null?void 0:W.name)!=="CanceledError")throw W}))},I=R=>R.meta.total===_.value.itemCount&&A.isEqual(A.map(R.data,"id"),A.map(d.value,"id")),U=async()=>{var W,K;if(!r.filters||u.value)return!1;(W=v.value)==null||W.abort(),v.value=null,(K=N.value)==null||K.abort(),N.value=new AbortController;let R;try{R=await H.HttpRequester.getInstance(H.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},N.value.signal)}catch(G){if((G==null?void 0:G.name)==="CanceledError")return!1;throw G}return I(R)?(d.value=d.value.map(G=>R.data.find(X=>X.id===G.id)??G),w.value=null,!1):(w.value=R,!0)},J=()=>w.value?(E(w.value),w.value=null,!0):!1,Z=()=>{w.value=null},L=R=>{_.value.page=R,V(),o("update:pagination",_.value)},O=R=>{_.value.pageSize=R,_.value.page=1,V(),o("update:pagination",_.value)},z=R=>{if(A.isNull(R))c.value=a();else{const[W]=c.value;W.field=R.columnKey.toString(),W.direction=R.order==="ascend"?"asc":"desc",c.value=[W]}y.value.forEach(W=>{if(Object.hasOwn(W,"sortOrder")){const K=W;K.sortOrder=K.key===(R==null?void 0:R.columnKey)&&(R!=null&&R.sorter)&&R.order!==!1?R.order:!1}}),V(),o("update:sort",c.value)},M=()=>{y.value=b(),f.value=window.innerHeight,m.value=h()};return n.watch(()=>r.filters,()=>{_.value.page=1,V(),$()}),n.watch(()=>r.sort,()=>{c.value=a(),_.value.page=1,V(),$()}),n.onMounted(()=>{M(),window.addEventListener("resize",M),n.nextTick(()=>{V(),$()})}),n.onUnmounted(()=>{var R,W,K;window.removeEventListener("resize",M),(R=x.value)==null||R.abort(),(W=v.value)==null||W.abort(),(K=N.value)==null||K.abort(),C()}),e({reload:V,checkForUpdates:U,applyPendingUpdate:J,discardPendingUpdate:Z}),(R,W)=>{const K=F.NDataTable;return n.openBlock(),n.createBlock(K,{columns:y.value,data:d.value,"row-key":G=>G.id,"row-props":g,"scroll-x":t.tableMinWidth,pagination:k.value,loading:u.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":m.value,"pagination-behavior-on-filter":"first","onUpdate:page":L,"onUpdate:pageSize":O,"onUpdate:sorter":z},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),m4=cn(h4,[["__scopeId","data-v-aff76adb"]]),p4=n.computed(()=>H.useReferencesStore().deliveryTypeReference??[]),g4=n.computed(()=>H.useReferencesStore().managersList??[]),y4=n.computed(()=>H.useReferencesStore().opfReference??[]),b4=n.computed(()=>H.useReferencesStore().partnerGroupsReference??[]),_4=n.computed(()=>H.useReferencesStore().priceCoefficientsReference??[]),w4=n.computed(()=>H.useReferencesStore().productFilesTypesReference??[]),x4=n.computed(()=>H.useReferencesStore().resourceTypesReference),k4=n.computed(()=>H.useReferencesStore().salesDirectionsReference??[]),C4=n.computed(()=>H.useReferencesStore().warehousesReference??[]),v4=n.computed(()=>H.useReferencesStore().paymentTypeReference??[]),dm=n.computed(()=>H.useReferencesStore().orderStatusReference??[]),S4=n.computed(()=>H.useReferencesStore().orderStatusDetailReference??[]),B4=n.computed(()=>H.useReferencesStore().operatorReference??[]),N4=n.computed(()=>bt.convertReferencesToSelectOptionsList(H.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),T4=n.computed(()=>bt.convertReferencesToSelectOptionsList(H.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),$4=t=>H.HttpRequester.getInstance(H.ReferenceDataProvider).searchCity(t),E4=t=>bt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var i,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(i=e==null?void 0:e.region)==null?void 0:i.name}, ${(o=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:o.name}`},e=>e==null?void 0:e.isNewRec()),R4=t=>H.HttpRequester.getInstance(H.ClientDataProvider).searchClient(t),P4=t=>bt.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()),F4={class:"flex flex-col gap-4"},V4={class:"flex flex-wrap gap-2"},M4={class:"flex flex-col gap-1.5"},I4={class:"inline-flex items-center gap-2"},A4={class:"flex flex-col gap-1.5"},O4={class:"inline-flex items-center gap-2"},z4={},D4=n.defineComponent({...z4,__name:"order-highlight-settings",props:{settings:{},statuses:{default:void 0}},emits:["update:settings"],setup(t,{emit:e}){const i=t,r=e,o=n.computed(()=>i.statuses??dm.value),s=d=>!!d&&i.settings.statuses.includes(d),l=(d,u)=>{if(!d)return;const f=i.settings.statuses.filter(h=>h!==d);r("update:settings",{...i.settings,statuses:u?[...f,d]:f})},a=(d,u)=>{const f=i.settings.markers.filter(h=>h!==d);r("update:settings",{...i.settings,markers:u?[...f,d]:f})},c=d=>{r("update:settings",{statuses:d?o.value.flatMap(u=>u.slug?[u.slug]:[]):[],markers:d?[...oo]:[]})};return(d,u)=>{const f=F.NButton,h=F.NCheckbox;return n.openBlock(),n.createElementBlock("div",F4,[n.createElementVNode("div",V4,[n.createVNode(f,{size:"small",onClick:u[0]||(u[0]=m=>c(!0))},{default:n.withCtx(()=>[...u[2]||(u[2]=[n.createTextVNode(" Выделять всё ",-1)])]),_:1}),n.createVNode(f,{size:"small",onClick:u[1]||(u[1]=m=>c(!1))},{default:n.withCtx(()=>[...u[3]||(u[3]=[n.createTextVNode(" Снять всё ",-1)])]),_:1})]),n.createElementVNode("div",M4,[u[4]||(u[4]=n.createElementVNode("div",{class:"text-sm font-semibold"},"Статусы",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.value,m=>(n.openBlock(),n.createBlock(h,{key:m.id,checked:s(m.slug),"onUpdate:checked":p=>l(m.slug,p)},{default:n.withCtx(()=>[n.createElementVNode("span",I4,[n.createVNode(fa,{colors:n.unref(bi)(m.slug)},null,8,["colors"]),n.createTextVNode(" "+n.toDisplayString(m.name),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))]),n.createElementVNode("div",A4,[u[5]||(u[5]=n.createElementVNode("div",{class:"text-sm font-semibold"},"Маркеры",-1)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(oo),m=>(n.openBlock(),n.createBlock(h,{key:m,checked:t.settings.markers.includes(m),"onUpdate:checked":p=>a(m,p)},{default:n.withCtx(()=>[n.createElementVNode("span",O4,[n.createVNode(fa,{colors:n.unref(vr)(m)},null,8,["colors"]),n.createTextVNode(" "+n.toDisplayString(n.unref(Cs)(m)),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))])])}}}),L4=["href"],H4={class:"text-sc-dark-grey"},W4={},j4=n.defineComponent({...W4,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const i=t,r=e,o=n.computed(()=>ke.format(i.order.createdAt,H.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=l=>{A.isNil(i.orderLink)&&(l.preventDefault(),l.stopPropagation()),r("click:order-id",i.order,l)};return(l,a)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("span",null,[a[1]||(a[1]=n.createTextVNode(" #",-1)),n.createElementVNode("a",{href:t.orderLink??"#",onClick:a[0]||(a[0]=c=>s(c))},n.toDisplayString(t.order.id),9,L4),n.createTextVNode(" от "+n.toDisplayString(o.value),1)]),a[2]||(a[2]=n.createTextVNode(", ",-1)),n.createElementVNode("span",H4,"автор: "+n.toDisplayString(t.order.creator.name)+" ["+n.toDisplayString(t.order.creator.type)+"]",1)],64))}}),q4={class:"sc-page flex flex-col bg-inherit"},X4={class:"my-2 flex flex-row items-end"},Y4={class:"sc-title grow"},K4={key:0,class:"sc-title-buttons flex-1 grow-0"},U4={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},G4={key:0,class:"sc-title-extra mt-2 sm:mt-4"},Z4={},um=n.defineComponent({...Z4,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t){const e=t,i=n.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=F.NH1;return n.openBlock(),n.createElementBlock("div",q4,[n.createElementVNode("div",{class:n.normalizeClass(t.stickyHeader?i.value:void 0),style:n.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[n.createElementVNode("div",X4,[n.createElementVNode("div",Y4,[n.renderSlot(r.$slots,"title",{},()=>[n.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(n.openBlock(),n.createElementBlock("div",K4,[n.createElementVNode("div",U4,[n.renderSlot(r.$slots,"title-buttons")])])):n.createCommentVNode("",!0)]),r.$slots["title-extra"]?(n.openBlock(),n.createElementBlock("div",G4,[n.renderSlot(r.$slots,"title-extra")])):n.createCommentVNode("",!0),n.renderSlot(r.$slots,"sticky-extra")],6),n.renderSlot(r.$slots,"default")])}}}),Q4={class:"overflow-hidden transition-all duration-300"},J4={class:"text-lg font-medium leading-none"},eN={},fm=n.defineComponent({...eN,__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 i=t,r=e,o=n.ref(0),s=n.ref(i.showDrawer),l=()=>{switch(Ye.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},a=()=>{s.value?A.isUndefined(i.drawerWidth)?o.value=l():o.value=A.isFunction(i.drawerWidth)?i.drawerWidth():i.drawerWidth:o.value=0};return n.watch(()=>i.drawerWidth,()=>{a()}),n.watch(()=>s.value,()=>{a(),r("update:show-drawer",s.value)}),n.watch(()=>i.showDrawer,c=>{s.value=c}),n.onUnmounted(()=>{window.removeEventListener("resize",a)}),a(),window.addEventListener("resize",a),(c,d)=>{const u=F.NDrawerContent,f=F.NDrawer;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",Q4,[n.createElementVNode("div",{style:n.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[n.renderSlot(c.$slots,"default")],4)]),n.createVNode(f,{show:s.value,"onUpdate:show":d[0]||(d[0]=h=>s.value=h),resizable:!0,width:o.value,placement:"left"},{default:n.withCtx(()=>[n.createVNode(u,{closable:""},{header:n.withCtx(()=>[n.renderSlot(c.$slots,"drawer-header",{},()=>[n.createElementVNode("div",J4,n.toDisplayString(t.title),1)])]),default:n.withCtx(()=>[n.renderSlot(c.$slots,"drawer-content")]),footer:n.withCtx(()=>[n.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),tN={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},nN={key:0},iN={class:"sc-page-preview-panel grow"},rN={key:1,class:"sc-page-preview-panel-extra flex-none"},oN={},sN=n.defineComponent({...oN,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t,{expose:e}){const i=n.ref(!1),r=()=>{i.value=!0},o=()=>{i.value=!1},s=n.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:a=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),a&&n.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=s.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r,closePanel:o}),(a,c)=>{const d=F.NButton;return n.openBlock(),n.createBlock(um,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset,"sticky-header-on-mobile":t.stickyHeaderOnMobile},n.createSlots({default:n.withCtx(()=>[n.createVNode(fm,{"show-drawer":i.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>i.value=u),title:t.panelTitle},n.createSlots({"drawer-content":n.withCtx(()=>[n.renderSlot(a.$slots,"panel-content")]),default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:n.withCtx(()=>[n.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0,a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:n.withCtx(()=>[n.createElementVNode("div",tN,[t.isShowPanelButtonVisible?(n.openBlock(),n.createElementBlock("div",nN,[n.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{i.value=!0}},()=>[n.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>i.value=!0)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):n.createCommentVNode("",!0),n.createElementVNode("div",iN,[n.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(n.openBlock(),n.createElementBlock("div",rN,[n.renderSlot(a.$slots,"preview-panel-extra")])):n.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),lN={},aN=n.defineComponent({...lN,__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:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>{var p;return A.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),a=n.computed(()=>{const p=new H.Curator({id:-1,name:"",contacts:{},curatedDirection:new H.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),g=r.showEmptyValue?[p]:[];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=>{g.push(new H.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),g}),c=n.computed(()=>bt.convertReferencesToSelectOptionsList(a.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,p=>{const g=A.some(s.value?r.value:[r.value],["id",p.id])?` (${p.curatedDirection.name}) `:"";return p.curatedDirection.isNewRec()?p.name:`${p.name}${g}`})),d=n.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=n.useTemplateRef("select-component"),f=p=>{if(A.isArray(p)){const g=p.length>0?p.map(b=>a.value.find(y=>y.id===b)).filter(b=>!A.isNil(b)):[];o("update:value",g)}else{const g=p>0?a.value.find(b=>b.id===p):null;o("update:value",g??null)}};return n.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:l.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),cN={},dN=n.defineComponent({...cN,__name:"manager-operator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},groupByEmployeeType:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>{var y;return A.isArray(r.value)?r.value.filter(_=>!A.isNil(_)).map(_=>_.id):((y=r.value)==null?void 0:y.id)??null}),a=n.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=n.computed(()=>{var x;const y=[];r.operatorReferenceList.length>0&&y.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(v=>({label:v.name,value:v.id,item:v}))});let _=r.managerReferenceList;if(r.showActualOnly){const v=A.isArray(r.value)?r.value.map(N=>N.id):[(x=r.value)==null?void 0:x.id];_=_.filter(N=>N.isActive||v.includes(N.id))}const k=bt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,v=>`${v.name}${v.isActive?"":" [Не активен]"}`);return y.length>0&&k.length>0&&y.push({key:"manager-operator-divider",disabled:!0,render:()=>n.h("div",{class:"sc-manager-operator-select__divider"})}),y.push(...k),y}),d=y=>`${y.name}${"isActive"in y&&!y.isActive?" [Не активен]":""}`,u=n.computed(()=>{var N;const y=A.isArray(r.value)?r.value.map(w=>w.id):[(N=r.value)==null?void 0:N.id],_=w=>r.showActualOnly?w.filter(T=>!("isActive"in T)||T.isActive||y.includes(T.id)):w,k=[],x=_(r.managerReferenceList);x.length>0&&k.push({type:"group",label:"Менеджеры",key:"managers",children:bt.convertReferencesToSelectOptionsList(x,!0,!1,!1,d)});const v=_(r.operatorReferenceList);return v.length>0&&k.push({type:"group",label:"Операторы",key:"operators",children:bt.convertReferencesToSelectOptionsList(v,!0,!1,!1,d)}),k}),f=n.computed(()=>r.groupByEmployeeType?u.value:c.value),h=n.computed(()=>f.value.map(y=>({...y,class:r.wrapContent?`${y.class??""} consistent-menu-width`:y.class}))),m=n.useTemplateRef("select-component"),p=y=>{if(A.isArray(y)){const _=y.map(k=>a.value.find(x=>x.id===k)).filter(k=>!A.isNil(k));o("update:value",_)}else{const _=A.isNil(y)?null:a.value.find(k=>k.id===y)??null;o("update:value",_)}};return n.watch(()=>r.value,()=>{var y,_;(_=(y=m.value)==null?void 0:y.$forceUpdate)==null||_.call(y)},{deep:!0}),e({focus:()=>{var y;return(y=m.value)==null?void 0:y.focusInput()},blur:()=>{var y;return(y=m.value)==null?void 0:y.blurInput()}}),(y,_)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:l.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||f.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:h.value,placeholder:"",class:"w-full","onUpdate:value":p},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),uN={},fN=n.defineComponent({...uN,__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:i}){const r=t,o=i,s=n.computed(()=>A.isArray(r.value)),l=n.computed(()=>{var p;return A.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),a=n.computed(()=>r.showEmptyValue?[H.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=n.computed(()=>{var b;let p=a.value,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=A.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];g=A.union(g,a.value.filter(_=>!_.isActive).map(_=>_.id)),p=p.filter(_=>(r.showEmptyValue?H.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return bt.convertReferencesToSelectOptionsList(p,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(s.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>g.includes(y.id)&&y.isActive)}),d=n.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=n.useTemplateRef("select-component"),f=p=>{if(A.isArray(p)){const g=p.length>0?p.filter(b=>!A.some(r.disabledManagerReferenceList,["id",b])).map(b=>a.value.find(y=>y.id===b)).filter(b=>!A.isNil(b)):[];o("update:value",g)}else{const g=p>0&&!A.some(r.disabledManagerReferenceList,["id",p])?a.value.find(b=>b.id===p):new H.Manager;o("update:value",g??new H.Manager)}};return n.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),n.watch(()=>r.disabledManagerReferenceList,p=>{if(p.length>0&&r.value)if(s.value){const g=r.value;A.some(g,b=>A.some(p,["id",b.id]))&&o("update:value",g.filter(b=>!A.some(p,["id",b.id])))}else{const g=r.value;A.some(p,["id",g.id])&&o("update:value",new H.Manager)}}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(F.NSelect),{ref:"select-component",value:l.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),hN={class:"m-0.5 flex flex-col p-0.5"},mN={class:"flex flex-row gap-1"},pN={key:0},gN={key:1},yN={key:2},bN={key:3},_N={class:"flex flex-row gap-1"},wN={key:0},xN={key:1},kN={key:2},CN={key:3},vN={},hm=n.defineComponent({...vN,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",hN,[n.createElementVNode("span",mN,[t.addr.postIndex?(n.openBlock(),n.createElementBlock("span",pN,n.toDisplayString(t.addr.postIndex)+", ",1)):n.createCommentVNode("",!0),t.addr.city?(n.openBlock(),n.createElementBlock("span",gN,n.toDisplayString(t.addr.city)+", ",1)):n.createCommentVNode("",!0),t.addr.locality?(n.openBlock(),n.createElementBlock("span",yN,n.toDisplayString(t.addr.locality)+", ",1)):n.createCommentVNode("",!0),t.addr.region?(n.openBlock(),n.createElementBlock("span",bN,n.toDisplayString(t.addr.region)+", ",1)):n.createCommentVNode("",!0)]),n.createElementVNode("span",_N,[t.addr.street?(n.openBlock(),n.createElementBlock("span",wN,n.toDisplayString(t.addr.street)+", ",1)):n.createCommentVNode("",!0),t.addr.building?(n.openBlock(),n.createElementBlock("span",xN,n.toDisplayString(t.addr.building)+", ",1)):n.createCommentVNode("",!0),t.addr.buildingPart?(n.openBlock(),n.createElementBlock("span",kN,n.toDisplayString(t.addr.buildingPart)+", ",1)):n.createCommentVNode("",!0),t.addr.apartments?(n.openBlock(),n.createElementBlock("span",CN,n.toDisplayString(t.addr.apartments)+", ",1)):n.createCommentVNode("",!0)])]))}}),ma={clearable:!1,value:"",field:void 0,disabled:!1},SN={},BN=n.defineComponent({...SN,__name:"address-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...ma,minTermLength:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0,wrapContent:!0}),emits:["select","update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.ref(r.value),l=n.ref(!1),a=n.ref([]),c=n.computed(()=>a.value.map(g=>({label:g[r.field??"addressString"]??"-",value:g.id})));n.watch(()=>r.value,g=>{s.value=g}),n.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(l.value=!0,a.value=await(r.searchDataHandler?r.searchDataHandler(s.value,l):H.HttpRequester.getInstance(H.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{l.value=!1}))},f=(g,b)=>{const y=a.value.find(_=>_.id===g.value)||{};return n.h(hm,{addr:y,selected:b},{default:A.constant("-")})},h=g=>{d.cancel();const b=a.value.find(y=>y.id===g)||{};o("select",b)},m=n.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,b)=>{const y=F.NAutoComplete;return n.openBlock(),n.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),n.unref(d)],class:n.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:t.clearable,disabled:t.disabled,loading:l.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),NN={class:"m-0.5 flex flex-col p-0.5"},TN={class:"font-medium"},$N={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},EN={key:0},RN={key:1},PN={},mm=n.defineComponent({...PN,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",NN,[n.createElementVNode("span",TN,n.toDisplayString(t.bank.name),1),n.createElementVNode("span",$N,[t.bank.bic?(n.openBlock(),n.createElementBlock("span",EN," БИК: "+n.toDisplayString(t.bank.bic),1)):n.createCommentVNode("",!0),t.bank.inn?(n.openBlock(),n.createElementBlock("span",RN," ИНН: "+n.toDisplayString(t.bank.inn),1)):n.createCommentVNode("",!0)])]))}}),FN={},VN=n.defineComponent({...FN,__name:"bank-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...ma,minTermLength:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.ref(r.value),l=n.ref(!1),a=n.ref([]),c=n.computed(()=>a.value.map(g=>({label:g[r.field??"_"]??"-",value:g.id})));n.watch(()=>r.value,g=>{s.value=g}),n.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){l.value=!0;try{a.value=await H.HttpRequester.getInstance(H.DataSuggestionProvider).searchBank(s.value)}finally{l.value=!1}}},f=(g,b)=>{const y=a.value.find(_=>_.id===g.value)||{};return n.h(mm,{bank:y,selected:b},{default:A.constant("-")})},h=g=>{d.cancel();const b=a.value.find(y=>y.id===g)||{};o("select",b)},m=n.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,b)=>{const y=F.NAutoComplete;return n.openBlock(),n.createBlock(y,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),n.unref(d)],class:n.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:t.clearable,disabled:t.disabled,loading:l.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),MN={class:"font-medium"},IN={key:0,class:"flex flex-row gap-2"},AN={key:0,class:"text-xs font-light text-blue-800"},ON={key:1,class:"text-sc-dark-grey text-xs font-light"},zN={},pm=n.defineComponent({...zN,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,i=n.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=n.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(`m-0.5 flex flex-col p-0.5 ${i.value?"line-through":""}`)},[n.createElementVNode("span",MN,n.toDisplayString(t.org.name),1),t.org.inn||r.value?(n.openBlock(),n.createElementBlock("div",IN,[t.org.inn?(n.openBlock(),n.createElementBlock("span",AN,n.toDisplayString(t.org.inn),1)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("span",ON,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),DN={},LN=n.defineComponent({...DN,__name:"org-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...ma,minTermLength:()=>{var t,e;return((e=(t=H.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(t,{expose:e,emit:i}){const r=t,o=i,s=n.ref(r.value),l=n.ref(!1),a=n.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=n.computed(()=>bt.convertReferencesToSelectOptionsList(a.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));n.watch(()=>r.value,b=>{s.value=b}),n.watch(s,()=>{o("update:value",s.value)});const u=A.debounce(()=>f(),800),f=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){l.value=!0;try{a.value=await H.HttpRequester.getInstance(H.DataSuggestionProvider).searchOrganization(s.value)}finally{l.value=!1}}},h=(b,y)=>{const _=a.value.find(k=>k.id===b.value)||{};return n.h(pm,{org:_,selected:y},{default:A.constant("-")})},m=b=>{u.cancel();const y=a.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&o("select",y)},p=n.ref(null);function g(){p.value.focus()}return e({focus:g}),(b,y)=>{const _=F.NAutoComplete;return n.openBlock(),n.createBlock(_,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[y[0]||(y[0]=k=>s.value=k),n.unref(u)],class:n.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:t.clearable,disabled:t.disabled,loading:l.value,options:d.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:m},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}});Y.ALL_ORDER_MARKERS=oo,Y.CommonValidators=Tm,Y.ConfiguratorSettingsKozyrek=Cu,Y.ConfiguratorSettingsMosquito=fx,Y.ContentHelper=_i,Y.DEFAULT_ORDER_STATUS_COLORS=xs,Y.DateValidators=$m,Y.EntityNameHelper=ni,Y.FileHelper=Nm,Y.KozyrekLine=$n,Y.KozyrekTailTemplate=Bl,Y.KozyrekTemplate=dr,Y.NumericValidators=ae,Y.ORDER_MARKER_COLORS=ks,Y.ORDER_MARKER_NAMES=La,Y.ORDER_STATUS_COLORS=Oa,Y.OrderMarkerEnum=it,Y.OrdersTableFields=Ve,Y.Point=Sl,Y.ScAddProductToCartDialog=ow,Y.ScAddressSuggestion=BN,Y.ScAddressSuggestionLabel=hm,Y.ScBankSuggestion=VN,Y.ScBankSuggestionLabel=mm,Y.ScBaseDialog=$s,Y.ScButtonWithConfirmAction=Rm,Y.ScCategoryCollapse=Wu,Y.ScClientNameWithShortInfo=Mr,Y.ScCollapse=Hu,Y.ScCollapseItem=Ya,Y.ScCommentEditor=C2,Y.ScConfiguratorsProductInfo=Tr,Y.ScContragentWithShortInfo=qu,Y.ScCreatorUserTypeTag=Qr,Y.ScCuratorSelect=aN,Y.ScDateRange=Zk,Y.ScDateTimeLabel=Ko,Y.ScDebouncedInput=M2,Y.ScDebouncedInputNumber=A2,Y.ScDebt=t2,Y.ScDialogHeader=l2,Y.ScDynamicConfigurator=zu,Y.ScEmail=xw,Y.ScExternalLink=Y2,Y.ScImageGallery=Qa,Y.ScInlineEditableItem=uf,Y.ScInlineView=$l,Y.ScKozyrekConfigurator=vu,Y.ScKozyrekConfiguratorParamsForm=nc,Y.ScKozyrekConfiguratorPreview=ku,Y.ScKozyrekConfiguratorTemplates=xu,Y.ScLightGallery=Za,Y.ScManagerOperatorSelect=dN,Y.ScManagerSelect=fN,Y.ScMetalForDoorsConfigurator=Fu,Y.ScMetalForDoorsConfiguratorForm=Pu,Y.ScMosquitoConfigurator=Nu,Y.ScMosquitoConfiguratorForm=Su,Y.ScMosquitoConfiguratorMeasurementInstructions=Bu,Y.ScMosquitoConfiguratorPreview=Nl,Y.ScOrderColorSwatch=fa,Y.ScOrderCommonInfo=nm,Y.ScOrderDeliveryLabel=ps,Y.ScOrderDetails=lm,Y.ScOrderExternalLinks=am,Y.ScOrderHighlightSettings=D4,Y.ScOrderInfo=cm,Y.ScOrderItemParams=tm,Y.ScOrderItemsList=om,Y.ScOrderPayment=ua,Y.ScOrderProductInfo=im,Y.ScOrderStatusHistory=sm,Y.ScOrderStatusTag=rm,Y.ScOrdersList=m4,Y.ScOrgSuggestion=LN,Y.ScOrgSuggestionLabel=pm,Y.ScPage=um,Y.ScPageWithSlidingPanel=sN,Y.ScPersonContactsBlock=ux,Y.ScPhone=qw,Y.ScPhoneInput=D2,Y.ScProductInfoContent=Ts,Y.ScProductInfoDialog=Ja,Y.ScProductInfoPopover=ec,Y.ScProductName=Nr,Y.ScProductsList=x5,Y.ScReferenceSelect=ju,Y.ScSandwichConfigurator=Iu,Y.ScSandwichConfiguratorForm=Mu,Y.ScSandwichM2Configurator=Ou,Y.ScSandwichM2ConfiguratorForm=Au,Y.ScSearchableProductSelect=em,Y.ScSearchableReferenceSelect=Jh,Y.ScSetClientPriceFormItem=tw,Y.ScShortTextOrderInfo=j4,Y.ScSingleFileUploadSelector=T2,Y.ScSlidingContentWithDrawer=fm,Y.ScStripConfigurator=Ru,Y.ScStripConfiguratorForm=$u,Y.ScStripConfiguratorLineItem=Tu,Y.ScStripConfiguratorPreview=Eu,Y.ScUserShortInfo=ha,Y.ScWarningIcon=F2,Y.SelectOptionHelper=bt,Y.UiNotificationProvider=kr,Y.Validators=We,Y.WindowResolutionEnum=Xe,Y.WindowResolutionProvider=Ye,Y.channelPrimaryInterestOptionsList=N4,Y.componentSizeInjectionKey=Sr,Y.copyToClipboard=Va,Y.deliveryTypeReferenceList=p4,Y.getOrderMarkerColors=vr,Y.getOrderMarkerName=Cs,Y.getOrderMarkers=vs,Y.getOrderStatusColors=bi,Y.getOrderStatusCssVariables=Da,Y.getOrderStatusTagColor=za,Y.getProductInfoFiles=Ss,Y.handleFloatInput=so,Y.handleIntegerInput=lt,Y.hasProductInfo=Wa,Y.isCanSandwichM2Show=hx,Y.isCanSandwichShow=Lu,Y.isConfiguratorType=Du,Y.managersReferenceList=g4,Y.naiveUiTheme=yp,Y.operatorReferenceList=B4,Y.opfReferenceList=y4,Y.orderStatusDetailReferenceList=S4,Y.orderStatusReferenceList=dm,Y.parse=ct,Y.partnerGroupReferenceList=b4,Y.paymentTypeReferenceList=v4,Y.priceCoefficientsReferenceList=_4,Y.productFilesTypesReferenceList=w4,Y.renderConfig=qe,Y.resetInputValidation=rt,Y.resourceReferencesList=x4,Y.salesDirectionsReferenceList=k4,Y.searchCityReferenceDataHandler=$4,Y.searchCityReferenceLabelRenderer=E4,Y.searchClientReferenceDataHandler=R4,Y.searchClientReferenceLabelRenderer=P4,Y.selectAllTextOnFocus=He,Y.sourcePrimaryInterestOptionsList=T4,Y.useHoverSupport=Ha,Y.vCopy=Ma,Y.vFocusNext=ti,Y.warehousesReferenceList=C4,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
|