@snabcentr/vue-ui-lib 4.22.0 → 4.22.1
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 +4 -3
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +1570 -1548
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +25 -25
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/components/catalog/category-collapse-item.vue.d.ts +50 -17
- package/dist/src/components/catalog/category-collapse.vue.d.ts +27 -2
- package/dist/src/components/collapse/collapse-item.vue.d.ts +50 -7
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Y,q){typeof exports=="object"&&typeof module<"u"?q(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"],q):(Y=typeof globalThis<"u"?globalThis:Y||self,q(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,q,z,Me,n,M,wr,bs,am){"use strict";var MT=Object.defineProperty;var im=Y=>{throw TypeError(Y)};var IT=(Y,q,z)=>q in Y?MT(Y,q,{enumerable:!0,configurable:!0,writable:!0,value:z}):Y[q]=z;var T=(Y,q,z)=>IT(Y,typeof q!="symbol"?q+"":q,z),rm=(Y,q,z)=>q.has(Y)||im("Cannot "+z);var zt=(Y,q,z)=>(rm(Y,q,"read from private field"),z?z.call(Y):q.get(Y)),$l=(Y,q,z)=>q.has(Y)?im("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(Y):q.set(Y,z),om=(Y,q,z,Me)=>(rm(Y,q,"write to private field"),Me?Me.call(Y,z):q.set(Y,z),z);var Oi,wt,ms;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(z.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";$t.notificationsService?$t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(i,s)?i[s]=new q.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])}};T($t,"messagesService"),T($t,"notificationsService");let xr=$t;const kr=new WeakMap,lm=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.")},Rl=async t=>{const e=z.isNil(t)?"":String(t);if(e)try{await lm(e),xr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{xr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},cm=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),dm=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":cm(t)?"click":"dblclick",Pl={mounted(t,e){t.style.setProperty("cursor","pointer");const i=dm(t,e),r=o=>{var a;i==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=kr.get(t);Rl(s==null?void 0:s.value).catch(z.noop)};kr.set(t,{value:e.value,eventName:i,handler:r}),t.addEventListener(i,r)},updated(t,e){const i=kr.get(t);i&&(i.value=e.value)},beforeUnmount(t){const e=kr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),kr.delete(t))}},um=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),fm=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",no=new WeakMap,Fl=t=>!um.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(fm)===null&&t.getClientRects().length>0,Vl=t=>{var a;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!Fl(e))return;t.preventDefault();const i=t.currentTarget,r=[...i.querySelectorAll("input")].filter(l=>Fl(l)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(a=no.get(i))==null||a()},ti={mounted(t,e){no.set(t,e.value),t.addEventListener("keydown",Vl)},updated(t,e){no.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",Vl),no.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 _s={color:"#4b5563",backgroundColor:"#e5e7eb",textOnBackgroundColor:"#1f2937"},Ml=new Map([[q.OrderStatusEnum.New,{color:"#15803d",backgroundColor:"#bbf7d0",textOnBackgroundColor:"#166534"}],[q.OrderStatusEnum.Processing,{color:"#ea580c",backgroundColor:"#fed7aa",textOnBackgroundColor:"#9a3412"}],[q.OrderStatusEnum.AwaitingSupplyProducts,{color:"#ca8a04",backgroundColor:"#fef08a",textOnBackgroundColor:"#854d0e"}],[q.OrderStatusEnum.InvoiceIssued,{color:"#1d4ed8",backgroundColor:"#bfdbfe",textOnBackgroundColor:"#1e40af"}],[q.OrderStatusEnum.ProcessingOnStock,{color:"#0e7490",backgroundColor:"#a5f3fc",textOnBackgroundColor:"#155e75"}],[q.OrderStatusEnum.OrderUpdated,{color:"#6d28d9",backgroundColor:"#ddd6fe",textOnBackgroundColor:"#5b21b6"}],[q.OrderStatusEnum.Finished,{color:"#475569",backgroundColor:"#e2e8f0",textOnBackgroundColor:"#1e293b"}],[q.OrderStatusEnum.Canceled,{color:"#b91c1c",backgroundColor:"#fecaca",textOnBackgroundColor:"#991b1b"}],[q.OrderStatusEnum.Error,{color:"#991b1b",backgroundColor:"#fca5a5",textOnBackgroundColor:"#7f1d1d"}]]),bi=t=>Ml.get(t)??_s,Il=t=>{const e=bi(t);return{color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}},Al=t=>{const e=bi(t);return{"--sc-order-status-color":e.color,"--sc-order-status-bg":e.backgroundColor,"--sc-order-status-text":e.textOnBackgroundColor}},ws=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"}]]),Ol=new Map([[it.NotInStock,"Нет в наличии"],[it.OnOrder,"Под заказ"],[it.LargeOrder,"Крупный заказ"],[it.NextDayDelivery,"Доставка на завтра"]]),io=[...ws.keys()],vr=t=>ws.get(t)??_s,xs=t=>Ol.get(t)??t,ks=t=>{const e=[];return t.isNotInStock&&e.push(it.NotInStock),t.isOnOrder&&e.push(it.OnOrder),t.isLargeOrder&&e.push(it.LargeOrder),!z.isNil(t.delivery.date)&&Me.isTomorrow(new Date(t.delivery.date))&&e.push(it.NextDayDelivery),e};var Fe=(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))(Fe||{}),Xe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Xe||{});class _i{static isVnodeEmpty(e){return e.every(i=>i.type===n.Comment||i.type===n.Text&&z.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 hm={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&&!Me.isFuture(e.deletedAt))}static getFormatEntityName(e){return ni.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const at=(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()}},ro=(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,a=void 0){let l=e.map(c=>({label:s?s(c):ni.getFormatEntityName(c),value:c.id,item:c,disabled:a?a(c):!1}));return i&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(z.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=z.isString(r.key)?z.get(d,r.key):r.key(c),h=z.isString(r.label)?z.get(d,r.label):r.label(c);return{type:"group",label:z.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,a)}}const mm={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},le={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}`)}}},pm={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(t){return{validator:(e,i)=>i===null?!0:t?new Error(t):!0}}},vs=t=>{var e;return((e=t.properties)==null?void 0:e.files)??[]},zl=t=>{var e,i;return!!((e=t.properties)!=null&&e.description)||!!((i=t.properties)!=null&&i.specification)||vs(t).length>0},gm={},ym=n.defineComponent({...gm,__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})},a=()=>{i.disableConfirm?s():o.value=!0};return(l,c)=>{const d=M.NButton,u=M.NPopover,h=M.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:a},{default:n.withCtx(()=>[n.renderSlot(l.$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(h,{show:o.value,"onUpdate:show":c[1]||(c[1]=f=>o.value=f),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]=f=>o.value=!1)},{default:n.withCtx(()=>[...c[3]||(c[3]=[n.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),bm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _m(t,e){return n.openBlock(),n.createElementBlock("svg",bm,[...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 Cs=n.markRaw({name:"ion-ellipsis-vertical-sharp",render:_m}),wm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xm(t,e){return n.openBlock(),n.createElementBlock("svg",wm,[...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 Dl=n.markRaw({name:"tabler-edit",render:xm}),km={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vm(t,e){return n.openBlock(),n.createElementBlock("svg",km,[...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 Ll=n.markRaw({name:"ion-checkmark-done-circle",render:vm}),Cm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sm(t,e){return n.openBlock(),n.createElementBlock("svg",Cm,[...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 Hl=n.markRaw({name:"ion-checkmark-done-circle-outline",render:Sm}),Bm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Tm(t,e){return n.openBlock(),n.createElementBlock("svg",Bm,[...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 Nm=n.markRaw({name:"fluent-pin32-regular",render:Tm}),$m={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Em(t,e){return n.openBlock(),n.createElementBlock("svg",$m,[...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 Rm=n.markRaw({name:"ion-eye-outline",render:Em}),Pm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Fm(t,e){return n.openBlock(),n.createElementBlock("svg",Pm,[...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 Vm=n.markRaw({name:"fluent-pin32-filled",render:Fm}),Mm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Im(t,e){return n.openBlock(),n.createElementBlock("svg",Mm,[...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 Am=n.markRaw({name:"ion-bookmark-outline",render:Im}),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:"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 Dm=n.markRaw({name:"ion-eye-off-sharp",render:zm}),Lm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hm(t,e){return n.openBlock(),n.createElementBlock("svg",Lm,[...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 Wm=n.markRaw({name:"ion-chevron-forward-outline",render:Hm}),jm=["data-name"],qm={class:"sc-collapse-item-header flex flex-row gap-2.5"},Xm={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Ym={key:0},Um={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Km={class:"flex flex-1 flex-col"},Gm={key:0,class:"sc-collapse-item-sub-title flex-1"},Zm={key:1,class:"sc-collapse-item-title-extra flex-none"},Qm={key:0,class:"sc-collapse-item-content"},Jm={},ep=n.defineComponent({...Jm,__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",z.noop),a=n.inject("defaultExpandedNames",[]),l=n.inject("expandedNames",[]),c=z.some(a,g=>g===r.name),d=n.computed(()=>z.some(l,g=>g===r.name)),u=n.ref(c),h=()=>{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||h()},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=Wm;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",qm,[n.createElementVNode("div",Xm,[n.createElementVNode("div",{class:n.normalizeClass({"rotate-90":u.value}),onClick:h},[n.renderSlot(g.$slots,"arrow",{},()=>[n.createVNode(y)],!0)],2)]),n.unref(_i).hasSlotContent(g.$slots["pre-arrow"])?(n.openBlock(),n.createElementBlock("div",Ym,[n.createElementVNode("div",Um,[n.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",Km,[n.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[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",Gm,[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",Zm,[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",Qm,[n.renderSlot(g.$slots,"default",{},void 0,!0)])):n.createCommentVNode("",!0)]),_:3})],10,jm)}}}),An=(t,e)=>{const i=t.__vccOpts||t;for(const[r,o]of e)i[r]=o;return i},Wl=An(ep,[["__scopeId","data-v-f1311d1c"]]),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("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 jl=n.markRaw({name:"ion-cart-outline",render:np}),Cr=Symbol(),ip={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"}},rp={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},op={},ql=n.defineComponent({...op,__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(Cr,"medium"),r=n.computed(()=>z.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=n.computed(()=>z.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=n.computed(()=>z.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=n.computed(()=>z.isNil(e.productContextButtonsConfig)?[]:z.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,f)=>{var C;const m=Hl,p=Ll,g=M.NButton,b=M.NTooltip,y=Dl,_=jl,k=Cs,x=M.NDropdown;return n.openBlock(),n.createElementBlock("div",rp,[s.value?(n.openBlock(),n.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:n.withCtx(()=>[t.product.isRequired?(n.openBlock(),n.createBlock(p,{key:1})):(n.openBlock(),n.createBlock(m,{key:0}))]),_:1},8,["size","disabled","type"])]),default:n.withCtx(()=>[f[0]||(f[0]=n.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),type:"primary",disabled:o.value==="disabled",onClick:c},{default:n.withCtx(()=>[n.createVNode(y)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[f[1]||(f[1]=n.createTextVNode(" Редактировать ",-1))]),_:1})):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),disabled:r.value==="disabled",type:"primary",onClick:l},{default:n.withCtx(()=>[n.createVNode(_)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[f[2]||(f[2]=n.createTextVNode(" Добавить в корзину ",-1))]),_:1})):n.createCommentVNode("",!0),((C=a.value)==null?void 0:C.length)>0?(n.openBlock(),n.createBlock(x,{key:3,options:a.value,size:n.unref(i),trigger:"click",onSelect:u},{default:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)])}}}),sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ap(t,e){return n.openBlock(),n.createElementBlock("svg",sp,[...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 lp=n.markRaw({name:"tabler-history",render:ap}),cp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dp(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 up=n.markRaw({name:"mdi-percent-outline",render:dp}),fp={class:"flex flex-row gap-1"},hp={key:0,class:"flex gap-1"},mp={key:0,class:"flex text-nowrap text-sm line-through"},pp={key:1,class:"flex flex-row text-nowrap text-sm"},gp={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},yp={},ii=n.defineComponent({...yp,__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:""),a=n.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),l=n.computed(()=>z.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=n.computed(()=>{const x=z.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return l.value||!x||z.isNil(u.value)||z.isNil(x.cost)?!1:u.value<x.cost}),d=((k=q.useBaseConfigStateStore().getConfig())==null?void 0:k.defaultCurrency)??"RUB",u=n.computed(()=>l.value?l.value.cost:z.get(e.product,e.costFieldName)),h=n.computed(()=>e.additionalThroughFieldName?z.get(e.product,e.additionalThroughFieldName):void 0),f=n.computed(()=>o.value.costDate?Me.format(o.value.costDate,q.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(()=>(z.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!z.isNil(u.value)),g=n.computed(()=>z.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(()=>z.isNil(h.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(h.value)),_=n.computed(()=>{if(!h.value||!u.value||h.value===u.value||u.value===0)return null;const x=(u.value-h.value)/h.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(x)});return(x,C)=>{var $;const N=M.NTag,w=M.NTooltip,S=up,v=lp;return n.openBlock(),n.createElementBlock("div",fp,[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":!l.value}])},{default:n.withCtx(()=>{var E;return[n.createTextVNode(n.toDisplayString(((E=l.value)==null?void 0:E.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:n.withCtx(()=>{var E;return[n.createTextVNode(" "+n.toDisplayString(((E=l.value)==null?void 0:E.coefficient.name)??"Розничная цена"),1)]}),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass({"!text-red-600":c.value})},[h.value&&h.value!==u.value||_.value?(n.openBlock(),n.createElementBlock("div",hp,[h.value&&h.value!==u.value?(n.openBlock(),n.createElementBlock("span",mp,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":($=l.value)==null?void 0:$.readOnly,"font-bold":!l.value&&!i.value}])},[n.createElementVNode("span",{class:n.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":p.value&&t.eventEmitter}),onClick:C[0]||(C[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&&!l.value&&"discount"in t.product&&t.product.discount?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(S,{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",pp," ~ "+n.toDisplayString(b.value)+" "+n.toDisplayString(a.value),1)):n.createCommentVNode("",!0),t.showCostDate&&!n.unref(z.isNil)(f.value)?(n.openBlock(),n.createElementBlock("span",gp,[n.createTextVNode(n.toDisplayString(f.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(n.openBlock(),n.createBlock(w,{key:0,placement:"top-end"},{trigger:n.withCtx(()=>[n.createVNode(v,{class:"cursor-pointer",onClick:C[1]||(C[1]=E=>{var F;return(F=t.eventEmitter)==null?void 0:F.emit("cost:show-price-history",{product:o.value})})})]),default:n.withCtx(()=>[C[2]||(C[2]=n.createTextVNode(" История цен ",-1))]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2)])}}}),bp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _p(t,e){return n.openBlock(),n.createElementBlock("svg",bp,[...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 oo=n.markRaw({name:"ion-information-circle-outline",render:_p}),wp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xp(t,e){return n.openBlock(),n.createElementBlock("svg",wp,[...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 Xl=n.markRaw({name:"ion-images",render:xp}),kp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vp(t,e){return n.openBlock(),n.createElementBlock("svg",kp,[...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 Cp=n.markRaw({name:"ion-information-circle",render:vp}),Sp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Bp(t,e){return n.openBlock(),n.createElementBlock("svg",Sp,[...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 Tp=n.markRaw({name:"ion-bookmark",render:Bp});/*!
|
|
1
|
+
(function(U,q){typeof exports=="object"&&typeof module<"u"?q(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"],q):(U=typeof globalThis<"u"?globalThis:U||self,q(U.SC_VueUiLib={},U["@snabcentr/common-lib"],U["lodash-es"],U["date-fns"],U.Vue,U["naive-ui"],U["libphonenumber-js"],U["ts-case-convert"],U["vue-tel-input"]))})(this,(function(U,q,z,Ie,n,M,wr,bs,am){"use strict";var IN=Object.defineProperty;var im=U=>{throw TypeError(U)};var AN=(U,q,z)=>q in U?IN(U,q,{enumerable:!0,configurable:!0,writable:!0,value:z}):U[q]=z;var N=(U,q,z)=>AN(U,typeof q!="symbol"?q+"":q,z),rm=(U,q,z)=>q.has(U)||im("Cannot "+z);var zt=(U,q,z)=>(rm(U,q,"read from private field"),z?z.call(U):q.get(U)),$l=(U,q,z)=>q.has(U)?im("Cannot add the same private member more than once"):q instanceof WeakSet?q.add(U):q.set(U,z),om=(U,q,z,Ie)=>(rm(U,q,"write to private field"),Ie?Ie.call(U,z):q.set(U,z),z);var Oi,wt,ms;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(z.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";$t.notificationsService?$t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(i,s)?i[s]=new q.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])}};N($t,"messagesService"),N($t,"notificationsService");let xr=$t;const kr=new WeakMap,lm=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.")},Rl=async t=>{const e=z.isNil(t)?"":String(t);if(e)try{await lm(e),xr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{xr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},cm=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),dm=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":cm(t)?"click":"dblclick",Pl={mounted(t,e){t.style.setProperty("cursor","pointer");const i=dm(t,e),r=o=>{var a;i==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=kr.get(t);Rl(s==null?void 0:s.value).catch(z.noop)};kr.set(t,{value:e.value,eventName:i,handler:r}),t.addEventListener(i,r)},updated(t,e){const i=kr.get(t);i&&(i.value=e.value)},beforeUnmount(t){const e=kr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),kr.delete(t))}},um=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),fm=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",no=new WeakMap,Fl=t=>!um.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(fm)===null&&t.getClientRects().length>0,Vl=t=>{var a;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!Fl(e))return;t.preventDefault();const i=t.currentTarget,r=[...i.querySelectorAll("input")].filter(l=>Fl(l)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(a=no.get(i))==null||a()},ti={mounted(t,e){no.set(t,e.value),t.addEventListener("keydown",Vl)},updated(t,e){no.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",Vl),no.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 _s={color:"#4b5563",backgroundColor:"#e5e7eb",textOnBackgroundColor:"#1f2937"},Ml=new Map([[q.OrderStatusEnum.New,{color:"#15803d",backgroundColor:"#bbf7d0",textOnBackgroundColor:"#166534"}],[q.OrderStatusEnum.Processing,{color:"#ea580c",backgroundColor:"#fed7aa",textOnBackgroundColor:"#9a3412"}],[q.OrderStatusEnum.AwaitingSupplyProducts,{color:"#ca8a04",backgroundColor:"#fef08a",textOnBackgroundColor:"#854d0e"}],[q.OrderStatusEnum.InvoiceIssued,{color:"#1d4ed8",backgroundColor:"#bfdbfe",textOnBackgroundColor:"#1e40af"}],[q.OrderStatusEnum.ProcessingOnStock,{color:"#0e7490",backgroundColor:"#a5f3fc",textOnBackgroundColor:"#155e75"}],[q.OrderStatusEnum.OrderUpdated,{color:"#6d28d9",backgroundColor:"#ddd6fe",textOnBackgroundColor:"#5b21b6"}],[q.OrderStatusEnum.Finished,{color:"#475569",backgroundColor:"#e2e8f0",textOnBackgroundColor:"#1e293b"}],[q.OrderStatusEnum.Canceled,{color:"#b91c1c",backgroundColor:"#fecaca",textOnBackgroundColor:"#991b1b"}],[q.OrderStatusEnum.Error,{color:"#991b1b",backgroundColor:"#fca5a5",textOnBackgroundColor:"#7f1d1d"}]]),bi=t=>Ml.get(t)??_s,Il=t=>{const e=bi(t);return{color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}},Al=t=>{const e=bi(t);return{"--sc-order-status-color":e.color,"--sc-order-status-bg":e.backgroundColor,"--sc-order-status-text":e.textOnBackgroundColor}},ws=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"}]]),Ol=new Map([[it.NotInStock,"Нет в наличии"],[it.OnOrder,"Под заказ"],[it.LargeOrder,"Крупный заказ"],[it.NextDayDelivery,"Доставка на завтра"]]),io=[...ws.keys()],vr=t=>ws.get(t)??_s,xs=t=>Ol.get(t)??t,ks=t=>{const e=[];return t.isNotInStock&&e.push(it.NotInStock),t.isOnOrder&&e.push(it.OnOrder),t.isLargeOrder&&e.push(it.LargeOrder),!z.isNil(t.delivery.date)&&Ie.isTomorrow(new Date(t.delivery.date))&&e.push(it.NextDayDelivery),e};var Fe=(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))(Fe||{}),Xe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Xe||{});class _i{static isVnodeEmpty(e){return e.every(i=>i.type===n.Comment||i.type===n.Text&&z.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 hm={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&&!Ie.isFuture(e.deletedAt))}static getFormatEntityName(e){return ni.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const at=(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()}},ro=(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,a=void 0){let l=e.map(c=>({label:s?s(c):ni.getFormatEntityName(c),value:c.id,item:c,disabled:a?a(c):!1}));return i&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(z.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=z.isString(r.key)?z.get(d,r.key):r.key(c),h=z.isString(r.label)?z.get(d,r.label):r.label(c);return{type:"group",label:z.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return bt.convertReferencesToOptionsList(e,i,r,o,s,a)}}const mm={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},le={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}`)}}},pm={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(t){return{validator:(e,i)=>i===null?!0:t?new Error(t):!0}}},vs=t=>{var e;return((e=t.properties)==null?void 0:e.files)??[]},zl=t=>{var e,i;return!!((e=t.properties)!=null&&e.description)||!!((i=t.properties)!=null&&i.specification)||vs(t).length>0},gm={},ym=n.defineComponent({...gm,__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})},a=()=>{i.disableConfirm?s():o.value=!0};return(l,c)=>{const d=M.NButton,u=M.NPopover,h=M.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:a},{default:n.withCtx(()=>[n.renderSlot(l.$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(h,{show:o.value,"onUpdate:show":c[1]||(c[1]=f=>o.value=f),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]=f=>o.value=!1)},{default:n.withCtx(()=>[...c[3]||(c[3]=[n.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),bm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _m(t,e){return n.openBlock(),n.createElementBlock("svg",bm,[...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 Cs=n.markRaw({name:"ion-ellipsis-vertical-sharp",render:_m}),wm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xm(t,e){return n.openBlock(),n.createElementBlock("svg",wm,[...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 Dl=n.markRaw({name:"tabler-edit",render:xm}),km={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vm(t,e){return n.openBlock(),n.createElementBlock("svg",km,[...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 Ll=n.markRaw({name:"ion-checkmark-done-circle",render:vm}),Cm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sm(t,e){return n.openBlock(),n.createElementBlock("svg",Cm,[...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 Hl=n.markRaw({name:"ion-checkmark-done-circle-outline",render:Sm}),Bm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Nm(t,e){return n.openBlock(),n.createElementBlock("svg",Bm,[...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 Tm=n.markRaw({name:"fluent-pin32-regular",render:Nm}),$m={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Em(t,e){return n.openBlock(),n.createElementBlock("svg",$m,[...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 Rm=n.markRaw({name:"ion-eye-outline",render:Em}),Pm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Fm(t,e){return n.openBlock(),n.createElementBlock("svg",Pm,[...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 Vm=n.markRaw({name:"fluent-pin32-filled",render:Fm}),Mm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Im(t,e){return n.openBlock(),n.createElementBlock("svg",Mm,[...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 Am=n.markRaw({name:"ion-bookmark-outline",render:Im}),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:"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 Dm=n.markRaw({name:"ion-eye-off-sharp",render:zm}),Lm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hm(t,e){return n.openBlock(),n.createElementBlock("svg",Lm,[...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 Wm=n.markRaw({name:"ion-chevron-forward-outline",render:Hm}),jm=["data-name"],qm={class:"sc-collapse-item-header flex flex-row gap-2.5"},Xm={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Ym={key:0},Um={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Km={class:"flex flex-1 flex-col"},Gm={key:0,class:"sc-collapse-item-sub-title flex-1"},Zm={key:1,class:"sc-collapse-item-title-extra flex-none"},Qm={key:0,class:"sc-collapse-item-content"},Jm={},ep=n.defineComponent({...Jm,__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",z.noop),a=n.inject("defaultExpandedNames",[]),l=n.inject("expandedNames",[]),c=z.some(a,g=>g===r.name),d=n.computed(()=>z.some(l,g=>g===r.name)),u=n.ref(c),h=()=>{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||h()},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=Wm;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",qm,[n.createElementVNode("div",Xm,[n.createElementVNode("div",{class:n.normalizeClass({"rotate-90":u.value}),onClick:h},[n.renderSlot(g.$slots,"arrow",{},()=>[n.createVNode(y)],!0)],2)]),n.unref(_i).hasSlotContent(g.$slots["pre-arrow"])?(n.openBlock(),n.createElementBlock("div",Ym,[n.createElementVNode("div",Um,[n.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",Km,[n.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[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",Gm,[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",Zm,[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",Qm,[n.renderSlot(g.$slots,"default",{},void 0,!0)])):n.createCommentVNode("",!0)]),_:3})],10,jm)}}}),An=(t,e)=>{const i=t.__vccOpts||t;for(const[r,o]of e)i[r]=o;return i},Wl=An(ep,[["__scopeId","data-v-9f4b93c4"]]),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("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 jl=n.markRaw({name:"ion-cart-outline",render:np}),Cr=Symbol(),ip={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"}},rp={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},op={},ql=n.defineComponent({...op,__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(Cr,"medium"),r=n.computed(()=>z.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=n.computed(()=>z.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=n.computed(()=>z.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=n.computed(()=>z.isNil(e.productContextButtonsConfig)?[]:z.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,f)=>{var C;const m=Hl,p=Ll,g=M.NButton,b=M.NTooltip,y=Dl,_=jl,k=Cs,x=M.NDropdown;return n.openBlock(),n.createElementBlock("div",rp,[s.value?(n.openBlock(),n.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:n.withCtx(()=>[t.product.isRequired?(n.openBlock(),n.createBlock(p,{key:1})):(n.openBlock(),n.createBlock(m,{key:0}))]),_:1},8,["size","disabled","type"])]),default:n.withCtx(()=>[f[0]||(f[0]=n.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),type:"primary",disabled:o.value==="disabled",onClick:c},{default:n.withCtx(()=>[n.createVNode(y)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[f[1]||(f[1]=n.createTextVNode(" Редактировать ",-1))]),_:1})):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),disabled:r.value==="disabled",type:"primary",onClick:l},{default:n.withCtx(()=>[n.createVNode(_)]),_:1},8,["size","disabled"])]),default:n.withCtx(()=>[f[2]||(f[2]=n.createTextVNode(" Добавить в корзину ",-1))]),_:1})):n.createCommentVNode("",!0),((C=a.value)==null?void 0:C.length)>0?(n.openBlock(),n.createBlock(x,{key:3,options:a.value,size:n.unref(i),trigger:"click",onSelect:u},{default:n.withCtx(()=>[n.createVNode(g,{ghost:!0,size:n.unref(i),type:"primary"},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)])}}}),sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ap(t,e){return n.openBlock(),n.createElementBlock("svg",sp,[...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 lp=n.markRaw({name:"tabler-history",render:ap}),cp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dp(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 up=n.markRaw({name:"mdi-percent-outline",render:dp}),fp={class:"flex flex-row gap-1"},hp={key:0,class:"flex gap-1"},mp={key:0,class:"flex text-nowrap text-sm line-through"},pp={key:1,class:"flex flex-row text-nowrap text-sm"},gp={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},yp={},ii=n.defineComponent({...yp,__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:""),a=n.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),l=n.computed(()=>z.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=n.computed(()=>{const x=z.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return l.value||!x||z.isNil(u.value)||z.isNil(x.cost)?!1:u.value<x.cost}),d=((k=q.useBaseConfigStateStore().getConfig())==null?void 0:k.defaultCurrency)??"RUB",u=n.computed(()=>l.value?l.value.cost:z.get(e.product,e.costFieldName)),h=n.computed(()=>e.additionalThroughFieldName?z.get(e.product,e.additionalThroughFieldName):void 0),f=n.computed(()=>o.value.costDate?Ie.format(o.value.costDate,q.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(()=>(z.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!z.isNil(u.value)),g=n.computed(()=>z.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(()=>z.isNil(h.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(h.value)),_=n.computed(()=>{if(!h.value||!u.value||h.value===u.value||u.value===0)return null;const x=(u.value-h.value)/h.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(x)});return(x,C)=>{var $;const T=M.NTag,w=M.NTooltip,S=up,v=lp;return n.openBlock(),n.createElementBlock("div",fp,[t.showTag?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(T,{round:"",bordered:!1,size:"small",class:n.normalizeClass(["text-slate-600",{"font-bold":!l.value}])},{default:n.withCtx(()=>{var E;return[n.createTextVNode(n.toDisplayString(((E=l.value)==null?void 0:E.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:n.withCtx(()=>{var E;return[n.createTextVNode(" "+n.toDisplayString(((E=l.value)==null?void 0:E.coefficient.name)??"Розничная цена"),1)]}),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass({"!text-red-600":c.value})},[h.value&&h.value!==u.value||_.value?(n.openBlock(),n.createElementBlock("div",hp,[h.value&&h.value!==u.value?(n.openBlock(),n.createElementBlock("span",mp,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":($=l.value)==null?void 0:$.readOnly,"font-bold":!l.value&&!i.value}])},[n.createElementVNode("span",{class:n.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":p.value&&t.eventEmitter}),onClick:C[0]||(C[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&&!l.value&&"discount"in t.product&&t.product.discount?(n.openBlock(),n.createBlock(w,{key:0},{trigger:n.withCtx(()=>[n.createVNode(S,{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",pp," ~ "+n.toDisplayString(b.value)+" "+n.toDisplayString(a.value),1)):n.createCommentVNode("",!0),t.showCostDate&&!n.unref(z.isNil)(f.value)?(n.openBlock(),n.createElementBlock("span",gp,[n.createTextVNode(n.toDisplayString(f.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(n.openBlock(),n.createBlock(w,{key:0,placement:"top-end"},{trigger:n.withCtx(()=>[n.createVNode(v,{class:"cursor-pointer",onClick:C[1]||(C[1]=E=>{var F;return(F=t.eventEmitter)==null?void 0:F.emit("cost:show-price-history",{product:o.value})})})]),default:n.withCtx(()=>[C[2]||(C[2]=n.createTextVNode(" История цен ",-1))]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2)])}}}),bp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _p(t,e){return n.openBlock(),n.createElementBlock("svg",bp,[...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 oo=n.markRaw({name:"ion-information-circle-outline",render:_p}),wp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xp(t,e){return n.openBlock(),n.createElementBlock("svg",wp,[...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 Xl=n.markRaw({name:"ion-images",render:xp}),kp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vp(t,e){return n.openBlock(),n.createElementBlock("svg",kp,[...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 Cp=n.markRaw({name:"ion-information-circle",render:vp}),Sp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Bp(t,e){return n.openBlock(),n.createElementBlock("svg",Sp,[...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 Np=n.markRaw({name:"ion-bookmark",render:Bp});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
17
17
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
18
|
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
-
***************************************************************************** */var so=function(){return so=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},so.apply(this,arguments)},
|
|
19
|
+
***************************************************************************** */var so=function(){return so=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},so.apply(this,arguments)},Tp={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},Sr={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},$p=(function(){function t(e,i){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=e,this.$LG=i,this}return t.prototype.init=function(){this.settings=so(so({},Tp),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},t.prototype.build=function(){var e=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(i){var r=e.$LG(i.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(e.thumbClickable&&!e.core.lgBusy){var o=parseInt(r.attr("data-lg-item-id"));e.core.slide(o,!1,!0,!1)}},50)}),this.core.LGel.on(Sr.beforeSlide+".thumb",function(i){var r=i.detail.index;e.animateThumb(r)}),this.core.LGel.on(Sr.beforeOpen+".thumb",function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth}),this.core.LGel.on(Sr.updateSlides+".thumb",function(){e.rebuildThumbnails()}),this.core.LGel.on(Sr.containerResize+".thumb",function(){e.core.lgOpened&&setTimeout(function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth,e.animateThumb(e.core.index),e.thumbOuterWidth=e.core.outer.get().offsetWidth},50)})},t.prototype.setThumbMarkup=function(){var e="lg-thumb-outer ";this.settings.alignThumbnails&&(e+="lg-thumb-align-"+this.settings.alignThumbnails);var i='<div class="'+e+`">
|
|
20
20
|
<div class="lg-thumb lg-group">
|
|
21
21
|
</div>
|
|
22
22
|
</div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(i):this.core.outer.append(i),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},t.prototype.enableThumbDrag=function(){var e=this,i={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(o){e.thumbTotalWidth>e.thumbOuterWidth&&(o.preventDefault(),i.cords.startX=o.pageX,i.startTime=new Date,e.thumbClickable=!1,r=!0,e.core.outer.get().scrollLeft+=1,e.core.outer.get().scrollLeft-=1,e.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(o){e.core.lgOpened&&r&&(i.cords.endX=o.pageX,i=e.onThumbTouchMove(i))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){e.core.lgOpened&&(i.isMoved?i=e.onThumbTouchEnd(i):e.thumbClickable=!0,r&&(r=!1,e.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},t.prototype.enableThumbSwipe=function(){var e=this,i={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),i.cords.startX=r.targetTouches[0].pageX,e.thumbClickable=!1,i.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),i.cords.endX=r.targetTouches[0].pageX,i=e.onThumbTouchMove(i))}),this.$lgThumb.on("touchend.lg",function(){i.isMoved?i=e.onThumbTouchEnd(i):e.thumbClickable=!0})},t.prototype.rebuildThumbnails=function(){var e=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){e.thumbTotalWidth=e.core.galleryItems.length*(e.settings.thumbWidth+e.settings.thumbMargin),e.$lgThumb.css("width",e.thumbTotalWidth+"px"),e.$lgThumb.empty(),e.setThumbItemHtml(e.core.galleryItems),e.animateThumb(e.core.index)},50),setTimeout(function(){e.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},t.prototype.setTranslate=function(e){this.$lgThumb.css("transform","translate3d(-"+e+"px, 0px, 0px)")},t.prototype.getPossibleTransformX=function(e){return e>this.thumbTotalWidth-this.thumbOuterWidth&&(e=this.thumbTotalWidth-this.thumbOuterWidth),e<0&&(e=0),e},t.prototype.animateThumb=function(e){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var i=0;switch(this.settings.currentPagerPosition){case"left":i=0;break;case"middle":i=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":i=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*e-1-i,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},t.prototype.onThumbTouchMove=function(e){return e.newTranslateX=this.translateX,e.isMoved=!0,e.touchMoveTime=new Date().valueOf(),e.newTranslateX-=e.cords.endX-e.cords.startX,e.newTranslateX=this.getPossibleTransformX(e.newTranslateX),this.setTranslate(e.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),e},t.prototype.onThumbTouchEnd=function(e){e.isMoved=!1,e.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var i=e.endTime.valueOf()-e.startTime.valueOf(),r=e.cords.endX-e.cords.startX,o=Math.abs(r)/i;return o>.15&&e.endTime.valueOf()-e.touchMoveTime<30?(o+=1,o>2&&(o+=1),o=o+o*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(o-1,2)+"settings"),r=r*o,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=e.newTranslateX,Math.abs(e.cords.endX-e.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),e},t.prototype.getThumbHtml=function(e,i,r){var o=this.core.galleryItems[i].__slideVideoInfo||{},s;o.youtube&&this.settings.loadYouTubeThumbnail?s="//img.youtube.com/vi/"+o.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":s=e;var a=document.createElement("div");a.setAttribute("data-lg-item-id",i+""),a.className="lg-thumb-item "+(i===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",i+""),l.src=s,a.appendChild(l),a},t.prototype.setThumbItemHtml=function(e){for(var i=0;i<e.length;i++){var r=this.getThumbHtml(e[i].thumb,i,e[i].alt);this.$lgThumb.append(r)}},t.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},t.prototype.manageActiveClassOnSlideChange=function(){var e=this;this.core.LGel.on(Sr.beforeSlide+".thumb",function(i){var r=e.core.outer.find(".lg-thumb-item"),o=i.detail.index;r.removeClass("active"),r.eq(o).addClass("active")})},t.prototype.toggleThumbBar=function(){var e=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.thumbnailPluginStrings.toggleThumbnails+'" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){e.core.outer.toggleClass("lg-components-open")}))},t.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(i){!e.core.lgOpened||!e.settings.toggleThumb||(i.keyCode===38?(i.preventDefault(),e.core.outer.addClass("lg-components-open")):i.keyCode===40&&(i.preventDefault(),e.core.outer.removeClass("lg-components-open")))})},t.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},t})();/*!
|
|
@@ -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 ao=function(){return ao=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},ao.apply(this,arguments)},Ep={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"},Ss=500,Rp=(function(){function t(e,i){return this.core=e,this.$LG=i,this.settings=ao(ao({},Ep),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,a=r.getBoundingClientRect();e?(o=r.offsetHeight*e,s=r.offsetWidth*e):i?(o=a.height+i*a.height,s=a.width+i*a.width):(o=a.height,s=a.width);var l=o>this.containerRect.height,c=s>this.containerRect.width;return{allowX:c,allowY:l}},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,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,i),u=d.allowY,h=d.allowX;this.positionChanged&&(l=this.left/(this.scale-i),c=this.top/(this.scale-i),this.pageX=s-l,this.pageY=a-c,this.positionChanged=!1);var f=this.getPossibleSwipeDragCords(i),m,p,g=s-this.pageX,b=a-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&&(h?this.isBeyondPossibleLeft(m,f.minX)?m=f.minX:this.isBeyondPossibleRight(m,f.maxX)&&(m=f.maxX):e>1&&(m<f.minX?m=f.minX:m>f.maxX&&(m=f.maxX)),u?this.isBeyondPossibleTop(p,f.minY)?p=f.minY:this.isBeyondPossibleBottom(p,f.maxY)&&(p=f.maxY):e>1&&(p<f.minY?p=f.minY:p>f.maxY&&(p=f.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)},Ss),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")}},Ss+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(),a=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-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ss+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,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;o=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",i=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=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 h=e.scale-s;e.zoomImage(e.scale,Math.round((h+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,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 a=i.x-e.x,l=i.y-e.y,c=Math.abs(a)/s+1,d=Math.abs(l)/s+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(o&&(this.isBeyondPossibleTop(h.y,f.minY)?h.y=f.minY:this.isBeyondPossibleBottom(h.y,f.maxY)&&(h.y=f.maxY)),r&&(this.isBeyondPossibleLeft(h.x,f.minX)?h.x=f.minX:this.isBeyondPossibleRight(h.x,f.maxX)&&(h.x=f.maxX)),o?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,i,r,o,s){var a={};if(o){if(a.y=this.top+(i.y-e.y),this.isBeyondPossibleTop(a.y,s.minY)){var l=s.minY-a.y;a.y=s.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var c=a.y-s.maxY;a.y=s.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(i.x-e.x),this.isBeyondPossibleLeft(a.x,s.minX)){var d=s.minX-a.x;a.x=s.minX-d/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var u=a.x-s.maxX;a.x=s.maxX+u/6}}else a.x=this.left;return a},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,a=o.width;e&&(s=s+e*s,a=a+e*a);var l=(s-this.containerRect.height)/2,c=(this.containerRect.height-s)/2+r,d=(a-this.containerRect.width)/2,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},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,a=!1,l=new Date,c=new Date,d,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))&&f.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);a=m.allowY,s=m.allowX,(s||a)&&(i=e.getSwipeCords(f)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){f.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(f);var m=e.getZoomSwipeCords(i,r,s,a,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(f){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){if(f.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!o)return;o=!1,c=new Date;var m=c.valueOf()-l.valueOf();e.touchendZoom(i,r,s,a,m)}})},t.prototype.zoomDrag=function(){var e=this,i={},r={},o=!1,s=!1,a=!1,l=!1,c,d,u,h;this.core.outer.on("mousedown.lg.zoom",function(f){if(e.isImageSlide(e.core.index)){var m=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||m.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var p=e.getDragAllowedAxises(0);l=p.allowY,a=p.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),i=e.getDragCords(f),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(f){if(o){s=!0,r=e.getDragCords(f);var m=e.getZoomSwipeCords(i,r,a,l,u);e.setZoomSwipeStyles(h,m)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){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(f);var m=d.valueOf()-c.valueOf();e.touchendZoom(i,r,a,l,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 Pp={ref:"gallery-container",class:"lightgallery-wrapper"},Fp={},Yl=n.defineComponent({...Fp,__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}),z.forOwn(i,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),n.onBeforeUnmount(()=>{var s;o.value&&((s=o.value)==null||s.destroy(),o.value=null)}),(s,a)=>(n.openBlock(),n.createElementBlock("div",Pp,[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=q.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(){z.forEach(yt.refsDependingOnDeviceResolution,e=>{yt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};T(yt,"isInitialized",!1),T(yt,"refsDependingOnDeviceResolution",[]);let et=yt;const Vp=["href"],Mp=["src","alt"],Ip={},Ul=n.defineComponent({...Ip,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const i=n.ref(!1),r=n.ref(!1),o=n.ref({plugins:[$p,Rp],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(et.getDeviceTypeByResolution()===Xe.phone?.7:.8),a=n.ref(s()),l=()=>{a.value=s()},c=()=>{i.value=!0};return n.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,u)=>{const h=Xl,f=M.NPopover;return n.openBlock(),n.createBlock(f,{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(h)])])]),default:n.withCtx(()=>[n.createVNode(Yl,{settings:o.value,style:n.normalizeStyle(`max-width: ${a.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,Mp)],8,Vp))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Ap={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},Op={class:"pr-3"},zp={class:"text-right"},Dp={},Lp=n.defineComponent({...Dp,__name:"product-stock-count",props:{product:{}},setup(t){return(e,i)=>{const r=oo,o=M.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",Ap,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.product.stockCount,(s,a)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:a},[n.createElementVNode("span",Op,n.toDisplayString(s.warehouse.name),1),n.createElementVNode("span",zp,[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})}}}),Hp=["innerHTML"],Wp=["innerHTML"],jp={class:"m-0 flex list-none flex-col gap-1 p-0 text-sm"},qp=["href"],Xp={key:1,class:"text-sm text-gray-500"},Yp={},Bs=n.defineComponent({...Yp,__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(()=>vs(e.product)),a=n.computed(()=>[r.value?"description":null,o.value?"specification":null,s.value.length>0?"files":null].filter(c=>c!==null)),l=n.ref(e.activeTab&&a.value.includes(e.activeTab)?e.activeTab:a.value[0]);return(c,d)=>{const u=M.NScrollbar,h=M.NTabPane,f=M.NTabs;return a.value.length>0?(n.openBlock(),n.createBlock(f,{key:0,value:l.value,"onUpdate:value":d[0]||(d[0]=m=>l.value=m),size:t.size,type:"line",class:"sc-product-info-content"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(h,{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,Hp)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(h,{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,Wp)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),s.value.length>0?(n.openBlock(),n.createBlock(h,{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",jp,[(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,qp)]))),128))])]),_:1},8,["style"])]),_:1},8,["tab"])):n.createCommentVNode("",!0)]),_:1},8,["value","size"])):(n.openBlock(),n.createElementBlock("span",Xp," Описание, характеристики и файлы не заданы. "))}}}),Up={key:0,class:"flex flex-row gap-2.5"},Kp={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},Gp={},Ts=n.defineComponent({...Gp,__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),a=n.ref(r.processing),l=et.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=et.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)},h=(m="other",p=!1)=>{if(a.value&&!p){o("processing:cancel",_=>{a.value=_});return}let g=!1;o("closing",m,()=>{g=!0}),g||(s.value=!1,o("update:show",s.value))},f=()=>{o("accept",p=>{a.value=p})};return n.watch(()=>r.show,m=>{m?u():h("other",!0)}),n.watch(()=>r.processing,m=>{a.value=m}),e({open:u,close:h,acceptHandler:f}),(m,p)=>{const g=M.NButton,b=M.NModal;return n.openBlock(),n.createBlock(b,{loading:a.value,show:s.value,"show-icon":!1,size:n.unref(l),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=>h("header")),onEsc:p[2]||(p[2]=y=>h("esc")),onMaskClick:p[3]||(p[3]=y=>h("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",Up,[n.renderSlot(m.$slots,"extra-action")])):n.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(n.openBlock(),n.createElementBlock("div",Kp,[n.renderSlot(m.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(n.openBlock(),n.createBlock(g,{key:0,disabled:a.value||!t.valid,loading:a.value,size:n.unref(l),type:"primary",onClick:f},{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:a.value,size:n.unref(l),type:"default",onClick:p[0]||(p[0]=y=>h("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"])}}}),Zp={class:"flex flex-col gap-3"},Qp={class:"text-xs text-gray-500"},Jp={},Kl=n.defineComponent({...Jp,__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(Ts,{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",Zp,[n.createElementVNode("span",Qp,"Артикул: "+n.toDisplayString(t.product.code),1),n.createVNode(Bs,{product:t.product,"active-tab":t.activeTab,"max-height":"60vh"},null,8,["product","active-tab"])])]),_:1},8,["show","title"]))}}),eg={class:"flex flex-col gap-2"},tg={class:"flex justify-end border-0 border-t border-solid border-gray-200 pt-2"},ng={},Gl=n.defineComponent({...ng,__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,a)=>{const l=oo,c=M.NButton,d=M.NPopover;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,{show:e.value,"onUpdate:show":a[0]||(a[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(l,{title:"Описание и характеристики",class:"cursor-pointer"})])]),default:n.withCtx(()=>[n.createElementVNode("div",eg,[n.createVNode(Bs,{product:t.product,size:"small","max-height":"16rem"},null,8,["product"]),n.createElementVNode("div",tg,[n.createVNode(c,{text:"",type:"info",size:"small",onClick:o},{default:n.withCtx(()=>[...a[2]||(a[2]=[n.createTextVNode(" Открыть полностью ",-1)])]),_:1})])])]),_:3},8,["show"]),i.value?(n.openBlock(),n.createBlock(Kl,{key:0,show:r.value,"onUpdate:show":a[1]||(a[1]=u=>r.value=u),product:t.product},null,8,["show","product"])):n.createCommentVNode("",!0)],64)}}}),ig={class:"flex flex-row justify-between"},rg={key:0,class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},og={key:1},sg={class:"ml-2 align-sub"},ag={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},lg={key:2,class:"ml-2 align-sub"},cg={class:"@container"},dg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ug={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},fg={class:"text-sc-dark-grey"},hg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},mg={class:"text-gray-600"},pg={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},gg={key:3,class:"underline decoration-dashed"},yg={key:4,class:"sc-product-pack whitespace-nowrap"},bg={class:"text-gray-600"},_g={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},wg={class:"text-gray-600"},xg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},kg={key:0},vg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Cg={},Br=n.defineComponent({...Cg,__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(()=>z.isFunction(i.showProductCosts)?i.showProductCosts(i.product):i.showProductCosts),o=n.computed(()=>z.sortBy(i.product.priceCoefficients,["coefficient.slug"])),s=n.computed(()=>{var f,m;return(m=(f=i.product)==null?void 0:f.properties)==null?void 0:m.planingIncomingDate}),a=n.useTemplateRef("image-gallery"),l=()=>{var f;(f=a.value)==null||f.show()},c=n.computed(()=>z.isFunction(i.allowNameClick)?i.allowNameClick(i.product):i.allowNameClick),d=n.computed(()=>(z.isFunction(i.showProductInfoButton)?i.showProductInfoButton(i.product):i.showProductInfoButton)&&zl(i.product)),u=n.computed(()=>{var f;return i.showProductAddToCartButton||i.showProductEditButton||i.showProductRequiredButton||(((f=i.productContextButtonsConfig)==null?void 0:f.length)??0)>0}),h=()=>{var f;c.value&&((f=i.eventEmitter)==null||f.emit("product:name-click",{product:i.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(f,m)=>{var w,S,v,$;const p=Tp,g=M.NTooltip,b=jl,y=Cp,_=Xl,k=M.NText,x=ql,C=oo,N=M.NScrollbar;return n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",ig,[n.createVNode(k,{type:"info",class:"sc-product-name text-balance text-base font-medium text-black"},{default:n.withCtx(()=>{var E,F,P,I;return[(E=t.product)!=null&&E.isFavorite||(F=t.product)!=null&&F.isPreviouslyOrdered||t.showAdditionalSaleIcon?(n.openBlock(),n.createElementBlock("div",rg,[((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:h},n.toDisplayString(t.product.name),3),t.product.onOrder?(n.openBlock(),n.createElementBlock("span",og," [Под заказ] ")):n.createCommentVNode("",!0),n.createElementVNode("span",sg,[t.product.images&&t.product.images.length>0?(n.openBlock(),n.createBlock(Ul,{key:0,ref:"image-gallery",images:t.product.images},{default:n.withCtx(()=>[n.createElementVNode("div",ag,[n.createVNode(_)])]),_:1},8,["images"])):n.createCommentVNode("",!0)]),d.value?(n.openBlock(),n.createElementBlock("span",lg,[n.createVNode(Gl,{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",dg,[t.product.supplierSku?(n.openBlock(),n.createElementBlock("div",ug,[m[3]||(m[3]=n.createTextVNode(" Артикул производителя/поставщика: ",-1)),n.createElementVNode("span",fg,n.toDisplayString(t.product.supplierSku),1)])):n.createCommentVNode("",!0),t.showCode?(n.openBlock(),n.createElementBlock("span",hg,[m[4]||(m[4]=n.createTextVNode(" Артикул: ",-1)),n.createElementVNode("span",mg,n.toDisplayString(t.product.code),1)])):n.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(n.openBlock(),n.createBlock(Lp,{key:2,product:t.product},{default:n.withCtx(()=>[n.createElementVNode("span",pg,[m[5]||(m[5]=n.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),n.createVNode(C,{class:"mt-0.5"})])]),_:1},8,["product"])):(n.openBlock(),n.createElementBlock("span",gg," Нет в наличии ")),t.product.pack??((S=(w=t.product)==null?void 0:w.properties)==null?void 0:S.pack)?(n.openBlock(),n.createElementBlock("span",yg,[m[6]||(m[6]=n.createTextVNode(" Норма упаковки: ",-1)),n.createElementVNode("span",bg,n.toDisplayString(t.product.pack??(($=(v=t.product)==null?void 0:v.properties)==null?void 0:$.pack)),1)])):n.createCommentVNode("",!0),t.showPlanningDates&&s.value?(n.openBlock(),n.createElementBlock("span",_g,[m[7]||(m[7]=n.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),n.createElementVNode("span",wg,n.toDisplayString(s.value),1)])):n.createCommentVNode("",!0)])]),n.createVNode(N,{"x-scrollable":""},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",xg,[(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",kg,[n.createElementVNode("ul",vg,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.product.id,slug:t.product.slug},(E,F)=>(n.openBlock(),n.createElementBlock("li",{key:F}," ("+n.toDisplayString(F)+"): "+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,F)=>(n.openBlock(),n.createElementBlock("li",{key:F}," ("+n.toDisplayString(F)+"): "+n.toDisplayString(E),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)])}}}),Sg=(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})}),Bg=(t,e)=>{if(t.length===0)return[];const i=[],r={};switch(z.isNil(e.isProductItemSelected)||i.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,a;return n.h(M.NCheckbox,{checked:!!((s=e.isProductItemSelected)!=null&&s.call(e,o)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,o))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:o,checked:l})}})}}),et.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:i.push({key:"name",title:"Наименование",className:"align-top",render:o=>n.h(Br,{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(Br,{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&&(z.forEach(t,o=>{z.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),z.forEach(z.sortBy(r,["slug"]),o=>{i.push(Sg(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||!z.isNil(e.productContextButtonsConfig))&&i.push({key:"actions",title:"",className:"align-top",width:"50",render:o=>n.h(ql,{product:o,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return i},Tg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ng(t,e){return n.openBlock(),n.createElementBlock("svg",Tg,[...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 lo=n.markRaw({name:"ion-trash",render:Ng}),$g={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Eg(t,e){return n.openBlock(),n.createElementBlock("svg",$g,[...e[0]||(e[0]=[n.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Zl=n.markRaw({name:"ion-plus",render:Eg}),Rg={key:0,class:"flex w-fit items-center gap-2"},Pg={key:1,class:"flex flex-wrap gap-1"},Fg={key:0},Vg={key:2},Mg={},Tr=n.defineComponent({...Mg,__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=M.NSpin,a=M.NText;return t.isProductSearching?(n.openBlock(),n.createElementBlock("div",Rg,[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",Pg,[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",Fg,"(Планируемая дата производства: "+n.toDisplayString(i.value)+")",1)):n.createCommentVNode("",!0)])):t.validation?(n.openBlock(),n.createElementBlock("div",Vg,[n.createVNode(a,{type:t.validation.validationStatus},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):n.createCommentVNode("",!0)}}}),Ig={class:"flex flex-col gap-4"},Ag={class:"flex flex-col gap-2"},Og={class:"mt-8 font-bold"},zg={class:"grid grow grid-cols-2 items-start gap-2"},Dg={key:2,class:"text-red-500 text-sm"},Lg={key:3,class:"text-red-500 text-sm mb-2"},Hg={class:"flex flex-col gap-4"},Wg={key:1},jg={class:"text-lg font-semibold"},qg={class:"flex gap-3"},Xg={},Yg=n.defineComponent({...Xg,__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"),a=n.ref(!1),l=n.ref(z.cloneDeep(r.value)),c=n.computed(()=>{var _,k,x;const y={"configuratorParams.length":[le.required,le.min(r.settings.stripMinLength),le.max(r.settings.stripMaxLength||Number.MAX_VALUE),le.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[le.required,le.min(1),le.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 z.forEach(l.value.configuratorParams.linesWidths,(C,N)=>{var v;const S=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${N}`]=[le.required,le.min(S),le.max(r.settings.maxLineWidth),le.step(r.settings.lineWidthStep),We.serverValidation((v=r.validation[`lines_widths[${N+1}]`])==null?void 0:v.feedback)]}),z.forEach(l.value.configuratorParams.linesAngles,(C,N)=>{var w;y[`configuratorParams.linesAngles.${N}`]=[le.required,le.min(r.settings.minLineAngle),le.max(r.settings.maxLineAngle),le.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 C;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,k=((C=l.value.product)==null?void 0:C.costRub)||0;if(!y||!_||k===0)return null;const x=y/1e3;return(k*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=n.computed(()=>z.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),f=n.computed(()=>{const y=h.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),m=n.computed(()=>{const{configuratorParams:y}=l.value,_=z.every(y.linesWidths,N=>!!(N&&N>0)),k=z.every(y.linesAngles,N=>!z.isNil(N)),x=!!(l.value.quantity&&l.value.quantity>0),C=y.length>0&&y.length>0;return _&&k&&x&&C&&f.value}),p=()=>{n.nextTick(()=>{var y;(y=s.value)==null||y.validate(_=>{_||(o("update:params",l.value.configuratorParams),g("configuratorParams",l.value.configuratorParams))}).catch(z.noop)})},g=(y,_)=>{const k=new q.OrderItemBase(l.value);k[y]=_,y==="configuratorParams"&&(k.product=new q.ClientProduct),o("update:value",k)};return n.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),n.watch(()=>r.value,y=>{l.value=z.cloneDeep(y)},{deep:!0}),e({validate:(b=s.value)==null?void 0:b.validate,formReference:s}),(y,_)=>{const k=Zl,x=lo,C=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var N;return[n.createElementVNode("div",Ig,[_[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(M.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),p],options:t.settings.startTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Ag,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.configuratorParams.linesAngles,(w,S)=>(n.openBlock(),n.createElementBlock("div",{key:S,class:"flex items-start gap-2"},[n.createElementVNode("div",Og,n.toDisplayString(S+1),1),n.createElementVNode("div",zg,[n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.linesWidths.${S}`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.linesWidths[S],"onUpdate:value":[v=>l.value.configuratorParams.linesWidths[S]=v,_[2]||(_[2]=v=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=v=>n.unref(at)(v)),onInput:v=>n.unref(rt)(t.validation,`lines_widths[${S+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.linesAngles.${S}`,label:"Угол сгиба, °"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.linesAngles[S],"onUpdate:value":[v=>l.value.configuratorParams.linesAngles[S]=v,_[4]||(_[4]=v=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=v=>n.unref(at)(v,!0)),onInput:v=>n.unref(rt)(t.validation,`lines_angles[${S+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(M.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(M.NButton),{key:0,size:"medium",onClick:v=>o("click:add-line",S)},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:v=>o("click:remove-line",S)},{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(M.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),p],options:t.settings.endTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Tr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),f.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Dg," Суммарная ширина участков гиба должна быть от "+n.toDisplayString(t.settings.stripMinWidth)+" до "+n.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+n.toDisplayString(h.value)+" мм. ",1)),m.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Lg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((N=t.settings.allTemplates)==null?void 0:N.length)-1?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.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",Hg,[n.createVNode(n.unref(M.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),p],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),n.createVNode(n.unref(M.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.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(at)(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(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>g("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>n.unref(at)(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(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,g("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(C,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.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",Wg,[_[23]||(_[23]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",jg,n.toDisplayString(u.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",qg,[n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>o("submit",l.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",l.value)]])}}}),Ql=An(Yg,[["__scopeId","data-v-ac7f1192"]]);var Jl=Object.defineProperty,Ug=Object.defineProperties,Kg=Object.getOwnPropertyDescriptors,ec=Object.getOwnPropertySymbols,Gg=Object.prototype.hasOwnProperty,Zg=Object.prototype.propertyIsEnumerable,tc=t=>{throw TypeError(t)},Ns=(t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Nr=(t,e)=>{for(var i in e||(e={}))Gg.call(e,i)&&Ns(t,i,e[i]);if(ec)for(var i of ec(e))Zg.call(e,i)&&Ns(t,i,e[i]);return t},$s=(t,e)=>Ug(t,Kg(e)),nc=(t,e)=>{for(var i in e)Jl(t,i,{get:e[i],enumerable:!0})},B=(t,e,i)=>Ns(t,typeof e!="symbol"?e+"":e,i),ic=(t,e,i)=>e.has(t)||tc("Cannot "+i),Dt=(t,e,i)=>(ic(t,e,"read from private field"),i?i.call(t):e.get(t)),rc=(t,e,i)=>e.has(t)?tc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Qg=(t,e,i,r)=>(ic(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}},oc={};nc(oc,{Curve:()=>Gi,getAnchorsFromArcData:()=>ty,getComponentOnCubicBezier:()=>$r,getControlPoints:()=>gc,getCurveBoundingBox:()=>hc,getCurveFromPoints:()=>pc,getCurveLength:()=>fc,getReflection:()=>Fs,integrate:()=>mc,subdivide:()=>Ps});var sc={};nc(sc,{HALF_PI:()=>dt,NumArray:()=>wn,TWO_PI:()=>tt,decomposeMatrix:()=>wi,getComputedMatrix:()=>Es,getEffectiveStrokeWidth:()=>xn,getPoT:()=>cc,lerp:()=>Ft,mod:()=>ot,setMatrix:()=>lc,toFixed:()=>Oe});var Ue;typeof window<"u"?Ue=window:typeof global<"u"?Ue=global:typeof self<"u"&&(Ue=self);var ac,tt=Math.PI*2,dt=Math.PI*.5;function wi(t,e,i,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function lc(t){ac=t}function Es(t,e){e=e&&e.identity()||new ac;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 a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Ft(t,e,i){return i*(e-t)+t}var Rs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function cc(t){let e=0;for(;Rs[e]&&Rs[e]<t;)e++;return Rs[e]}function ot(t,e){for(;t<0;)t+=e;return t%e}var wn=Ue.Float32Array||Array,Jg=Math.floor;function Oe(t){return Jg(t*1e6)/1e6}function xn(t,e){const i=t._linewidth;if(t.strokeAttenuation)return i;e||(e=t.worldMatrix||Es(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(){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 a=this._events[e];if(a){let l=[];if(i)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,i!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const 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(ee,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(ee,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var dc={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 br extends ee{constructor(e=0,i=0){super(),B(this,"_x",0),B(this,"_y",0);for(let r in dc)Object.defineProperty(this,r,dc[r]);this.x=e,this.y=i}static add(e,i){return new br(e.x+i.x,e.y+i.y)}static sub(e,i){return new br(e.x-i.x,e.y-i.y)}static subtract(e,i){return br.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],a=arguments[1]-arguments[3];return Math.atan2(a,s)}const r=e.x-i.x,o=e.y-i.y;return Math.atan2(o,r)}static distanceBetween(e,i){return Math.sqrt(br.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 br(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:Oe(this.x),y:Oe(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}};B(cn,"zero",new cn),B(cn,"left",new cn(-1,0)),B(cn,"right",new cn(1,0)),B(cn,"up",new cn(0,-1)),B(cn,"down",new cn(0,1));var re=cn,Ne=class ys extends re{constructor(e=0,i=0,r=0,o=0,s=0,a=0,l=ie.move){super(e,i),B(this,"controls",{left:new re,right:new re}),B(this,"_command",ie.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 d in uc)Object.defineProperty(this,d,uc[d]);this.command=l,this.relative=!0;const c=ys.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(ee.Types.change,c),this.controls.right.set(s,a).addEventListener(ee.Types.change,c)}static makeBroadcast(e){return i;function i(){e._bound&&e.dispatchEvent(ee.Types.change)}}static fromObject(e){return new ys().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 ys().copy(this)}toObject(){return{x:Oe(this.x),y:Oe(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Oe(this.rx),ry:Oe(this.ry),xAxisRotation:Oe(this.xAxisRotation),largeArcFlag:Oe(this.largeArcFlag),sweepFlag:Oe(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},uc={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))}}},ey=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 ey++}},Gi={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 $r(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 Ps(t,e,i,r,o,s,a,l,c){c=c||Gi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Ne(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=$r(f,t,i,o,a),p=$r(f,e,r,s,l);u.push(new Ne(m,p))}return u}function fc(t,e,i,r,o,s,a,l,c){if(t===i&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(a-t),u=6*(t+o)-12*i,h=3*(i-t),f=9*(r-s)+3*(l-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+h,_=(f*b+m)*b+p;return Math.sqrt(y*y+_*_)}return mc(g,0,1,c||Gi.RecursionLimit)}function hc(t,e,i,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,b,y;for(let C=0;C<2;++C){if(C===0?(h=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*a,f=3*i-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;m=-f/h,0<m&&m<1&&c.push(m);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(p=(-h+y)/(2*u),0<p&&p<1&&c.push(p),g=(-h-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*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,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 mc(t,e,i,r){let o=Gi.abscissas[r-2],s=Gi.weights[r-2],a=.5*(i-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function pc(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],a=e?ot(o-1,i):Math.max(o-1,0),l=e?ot(o+1,i):Math.min(o+1,r),c=t[a],d=s,u=t[l];gc(c,d,u),d.command=o===0?ie.move:ie.curve}}function gc(t,e,i){const r=re.angleBetween(t,e),o=re.angleBetween(i,e);let s=re.distanceBetween(t,e),a=re.distanceBetween(i,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=dt:l-=dt,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Fs(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 ty(t,e,i,r,o,s,a){const l=kt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*s+o,h=i*Math.cos(u),f=r*Math.sin(u),m=new Ne(h,f);m.command=ie.line}}var yc=Array.prototype.slice;function ny(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=yc.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=yc.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=!ny(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:Ue.performance&&Ue.performance.now?Ue.performance:Date},Ut={hasEventListeners:typeof Ue.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=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 a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Ue.setTimeout(d,l);e=a+l;function d(){o(a+l)}return c}return i}},Zi=Ue.document?Ue.document.createElement("div"):{};Zi.id="help-two-load",Object.defineProperty(Ut,"temp",{enumerable:!0,get:function(){return oe.isElement(Zi)&&!Ue.document.head.contains(Zi)&&(Zi.style.display="none",Ue.document.head.appendChild(Zi)),Zi}});var Lt=class extends Error{constructor(e){super(),B(this,"name","Two.js"),B(this,"message"),this.message=e}},iy=Ue.devicePixelRatio||1;function ry(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Vs(t){return iy/ry(t)}var co=class{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}},vt,ri=class extends Array{constructor(){super(),rc(this,vt,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,vt)}set _events(e){Qg(this,vt,e)}get _bound(){return Dt(this,vt)._bound}set _bound(e){Dt(this,vt)._bound=e}addEventListener(){var e;return(e=Dt(this,vt).addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=Dt(this,vt).on)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=Dt(this,vt).bind)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=Dt(this,vt).removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=Dt(this,vt).off)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=Dt(this,vt).unbind)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=Dt(this,vt).dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=Dt(this,vt).trigger)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=Dt(this,vt).listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=Dt(this,vt).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 a;i?a=e.call(i,s,o):a=e(s,o),r.push(a)}return r}};vt=new WeakMap;var bc=class sm extends ee{constructor(){super(),B(this,"_flagId",!1),B(this,"_flagClassName",!1),B(this,"_renderer",{}),B(this,"_id",kt.Identifier+kt.uniqueId()),B(this,"_className",""),B(this,"classList",[]);for(let e in _c)Object.defineProperty(this,e,_c[e])}static fromObject(e){const i=new sm().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}};B(bc,"Properties",["renderer","id","className"]);var Qi=bc,_c={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)}}},uo,wc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ue.document&&(uo=document.createElement("a"));var dn=class Jt extends Qi{constructor(e,i){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 r in xc)Object.defineProperty(this,r,xc[r]);if(this._renderer.type="texture",this._renderer.flagOffset=oy.bind(this),this._renderer.flagScale=sy.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 uo?(uo.href=e,uo.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?wc.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}};B(dn,"Properties",["src","loaded","repeat","scale","offset","image"]),B(dn,"RegularExpressions",wc),B(dn,"ImageRegistry",new co),B(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 ze=dn,xc={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=ze.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}ze.ImageRegistry.contains(i)?this._image=ze.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 oy(){this._flagOffset=!0}function sy(){this._flagScale=!0}var Ms=class _n extends Qi{constructor(e,i,r){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 o in kc)Object.defineProperty(this,o,kc[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}};B(Ms,"Index",0),B(Ms,"Properties",["offset","opacity","color"]);var oi=Ms,kc={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)}}},Is=class Hi extends Qi{constructor(e){super(),B(this,"_flagStops",!1),B(this,"_flagSpread",!1),B(this,"_flagUnits",!1),B(this,"_spread",""),B(this,"_units","");for(let i in vc)Object.defineProperty(this,i,vc[i]);this._renderer.type="gradient",this._renderer.flagStops=ay.bind(this),this._renderer.bindStops=ly.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 Hi(i).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const i=this.stops.map(o=>o.clone()),r=new Hi(i);return oe.each(Hi.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let i=0;i<Hi.Properties.length;i++){const r=Hi.Properties[i];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(i=>i.toObject())};return oe.each(Hi.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}};B(Is,"Stop",oi),B(Is,"Properties",["spread","stops","units"]);var ut=Is,vc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,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 ay(){this._flagStops=!0}function ly(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 As=class Qr extends ut{constructor(e,i,r,o,s){super(s),B(this,"_flagEndPoints",!1),B(this,"_left",null),B(this,"_right",null);for(let a in Cc)Object.defineProperty(this,a,Cc[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=dy.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 Qr().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Qr.Properties.length;i++){const r=Qr.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 Qr(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}};B(As,"Stop",oi),B(As,"Properties",["left","right"]);var Ke=As,Cc={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 dy(){this._flagEndPoints=!0}var Os=class Wi extends ut{constructor(e,i,r,o,s,a){super(o),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 l in Sc)Object.defineProperty(this,l,Sc[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=uy.bind(this),this._renderer.flagFocal=fy.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 a=="number"&&(this.focal.y=a)}static fromObject(e){const i=new Wi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Wi.Properties.length;i++){const r=Wi.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 Wi(this.center._x,this.center._y,this._radius,i,this.focal._x,this.focal._y);return oe.each(ut.Properties.concat(Wi.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return oe.each(Wi.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}};B(Os,"Stop",oi),B(Os,"Properties",["center","radius","focal"]);var Ge=Os,Sc={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 uy(){this._flagCenter=!0}function fy(){this._flagFocal=!0}function Bc(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 a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function fo(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 Tc(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),fc(r,l,o,c,s,d,a,u,i)}function zs(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Ps(r,l,o,c,s,d,a,u,i)}function xi(t){switch(t.renderer.type){case"texture":return ze.fromObject(t);case"gradient":return ut.fromObject(t);case"linear-gradient":return Ke.fromObject(t);case"radial-gradient":return Ge.fromObject(t)}return t}var hy=Math.cos,my=Math.sin,Nc=Math.tan,Ds=[],$c=class en extends ee{constructor(e,i,r,o,s,a){super(),B(this,"elements",new wn(9)),B(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,i,r){if(i.length<=3){const N=e;let w,S,v;const $=i[0]||0,E=i[1]||0,F=i[2]||0;return w=N[0]*$+N[1]*E+N[2]*F,S=N[3]*$+N[4]*E+N[5]*F,v=N[6]*$+N[7]*E+N[8]*F,[w,S,v]}const o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],f=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],C=i[8];return r=r||new wn(9),r[0]=o*m+s*b+a*k,r[1]=o*p+s*y+a*x,r[2]=o*g+s*_+a*C,r[3]=l*m+c*b+d*k,r[4]=l*p+c*y+d*x,r[5]=l*g+c*_+d*C,r[6]=u*m+h*b+f*k,r[7]=u*p+h*y+f*x,r[8]=u*g+h*_+f*C,r}static fromObject(e){return new en().copy(e)}set(e,i,r,o,s,a,l,c,d){if(typeof i>"u"){const u=e;e=u[0],i=u[1],r=u[2],o=u[3],s=u[4],a=u[5],l=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]=a,this.elements[6]=l,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,a,l,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,h=[e,i,r,o,s,a,l,c,d],f=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],C=h[0],N=h[1],w=h[2],S=h[3],v=h[4],$=h[5],E=h[6],F=h[7],P=h[8];return this.elements[0]=f*C+m*S+p*E,this.elements[1]=f*N+m*v+p*F,this.elements[2]=f*w+m*$+p*P,this.elements[3]=g*C+b*S+y*E,this.elements[4]=g*N+b*v+y*F,this.elements[5]=g*w+b*$+y*P,this.elements[6]=_*C+k*S+x*E,this.elements[7]=_*N+k*v+x*F,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],a=i[3],l=i[4],c=i[5],d=i[6],u=i[7],h=i[8],f=h*l-c*u,m=-h*a+c*d,p=u*a-l*d;let g=r*f+o*m+s*p;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*o+s*u)*g,e.elements[2]=(c*o-s*l)*g,e.elements[3]=m*g,e.elements[4]=(h*r-s*d)*g,e.elements[5]=(-c*r+s*a)*g,e.elements[6]=p*g,e.elements[7]=(-u*r+o*d)*g,e.elements[8]=(l*r-o*a)*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=hy(e),r=my(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=Nc(e);return this.multiply(1,i,0,0,1,0,0,0,1)}skewY(e){const i=Nc(e);return this.multiply(1,0,0,i,1,0,0,0,1)}toString(e){return Ds.length=0,this.toTransformArray(e,Ds),Ds.map(Oe).join(" ")}toTransformArray(e,i){const r=this.elements,o=!!i,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],m=r[8];if(o){i[0]=s,i[1]=c,i[2]=h,i[3]=a,i[4]=d,i[5]=f,i[6]=l,i[7]=u,i[8]=m;return}return[s,c,h,a,d,f,l,u,m]}if(o){i[0]=s,i[1]=c,i[2]=a,i[3]=d,i[4]=l,i[5]=u;return}return[s,c,a,d,l,u]}toArray(e,i){const r=this.elements,o=!!i,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],m=r[8];if(o){i[0]=s,i[1]=a,i[2]=l,i[3]=c,i[4]=d,i[5]=u,i[6]=h,i[7]=f,i[8]=m;return}return[s,a,l,c,d,u,h,f,m]}if(o){i[0]=s,i[1]=a,i[2]=l,i[3]=c,i[4]=d,i[5]=u;return}return[s,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new en().copy(this)}};B($c,"Identity",[1,0,0,0,1,0,0,0,1]);var ki=$c;lc(ki);var Ec=class El extends Qi{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 e in ho)Object.defineProperty(this,e,ho[e]);this._renderer.flagMatrix=Rc.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 El().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 ho.position.get.apply(this,arguments)}set translation(e){ho.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 a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();return l?e>=l.left-a&&e<=l.right+a&&i>=l.top-a&&i<=l.bottom+a:!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 El;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}};B(Ec,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var zn=Ec,ho={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),Rc.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 Es(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Rc(){this._flagMatrix=!0}var Pc=/^(?:none|transparent)$/i,py=8,Ls=Number.EPSILON;function Dn(t,e){return{x:t,y:e}}function mo(t,e,i=Ls){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function Fc(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 a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(a=-a),a}function gy(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,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let b=p*f+g*m,y=-g*f+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const A=Math.sqrt(x);r*=A,o*=A,_=r*r,k=o*o}const C=_*y*y+k*b*b,N=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,N));a===l&&(w=-w);const S=w*r*y/o,v=-w*o*b/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,F=Fc(1,0,(b-S)/r,(y-v)/o),P=Fc((b-S)/r,(y-v)/o,(-b-S)/r,(-y-v)/o)%tt,I=F+P,K=l===0,J=(()=>{const A=I-F,O=Math.abs(A)<Number.EPSILON;let V=ot(A,tt);return V<Number.EPSILON&&(V=O?0:tt),K&&!O&&(V=V===tt?-tt:V-tt),V})(),Z=Math.max(kt.Resolution,Math.max(i*2,1)),L=[];for(let A=1;A<=Z;A++){const O=A/Z,V=F+O*J;let R=$+r*Math.cos(V),H=E+o*Math.sin(V);if(s!==0){const U=R-$,G=H-E,X=Math.cos(s),W=Math.sin(s);R=U*X-G*W+$,H=U*W+G*X+E}L.push(Dn(R,H))}return L}function yy(t,e=py){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 a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!mo(l,c)){const m=Dn(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&mo(l,c)&&i.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}mo(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?ie.move:ie.line);if(p===ie.move){u(!1);const g=Dn(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===ie.line)h(Dn(m.x,m.y));else if(p===ie.curve){const g=zs(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];h(Dn(y.x,y.y))}h(Dn(m.x,m.y))}else if(p===ie.arc){const g=gy(d,m,s);for(let b=0;b<g.length;b++)h(g[b])}else if(p===ie.close){u(!0),d=m;continue}else h(Dn(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!mo(l,c);u(f)}return{polygons:i,segments:r}}function by(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 a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function _y(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<Ls&&Math.abs(s)<Ls){const f=t-i.x,m=e-i.y;return f*f+m*m}const a=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=i.x+l*o,d=i.y+l*s,u=t-c,h=e-d;return u*u+h*h}function wy(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],a=_y(e,i,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function xy(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Pc.test(i):!0}function ky(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"?!Pc.test(r):!0}function vy(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&i>=a&&i<=l}var po=Number.EPSILON;function go(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)<po&&Math.abs(r)<po){go(t)?o[e].clear():o[e].set(t.x,t.y);return}go(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 Cy(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:go(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function Ji(t,e){const i=Cy(t,e);return Math.abs(i.x)>po||Math.abs(i.y)>po}function yo(t){t.command===ie.move||t.command===ie.close||(t.command=Ji(t,"left")||Ji(t,"right")?ie.curve:ie.line)}function Vc(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function Sy(t,e){return Ji(e,"right")||Ji(t,"left")||Ji(t,"right")||Ji(e,"left")||t.command===ie.curve||e.command===ie.curve}function er(t,e,i){return{x:Ft(t.x,e.x,i),y:Ft(t.y,e.y,i)}}function Mc(t,e){const i=t.controls&&t.controls[e];return i?go(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function By(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?Mc(t,"right"):Nr({},s),l={x:e.x,y:e.y},c=o?Mc(e,"left"):Nr({},l),d=er(s,a,i),u=er(a,c,i),h=er(c,l,i),f=er(d,u,i),m=er(u,h,i),p=er(f,m,i),g=new Ne(p.x,p.y);return Vc(g,t),un(g,"left",f.x-p.x,f.y-p.y),un(g,"right",m.x-p.x,m.y-p.y),g.command=ie.curve,{anchor:g,startOut:d,endIn:h}}function Ty(t,e,i,r,o,s){const a=t.length,l=i-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-i-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=ot(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<b,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,F=S?2:s?0:1,P=v/g;g=k[w]=$-P,m=y[w]=E*f[w].x+F*f[w+1].x-P*m,p=_[w]=E*f[w].y+F*f[w+1].y-P*p}x[b]=y[b]/k[b],C[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[b])/2,C[c]=(3*f[c].y-C[b])/2;const N=c-h;for(let w=u,S=e;w<=N;w+=1,S+=1){const v=ot(S,a),$=t[v],E=x[w]-$.x,F=C[w]-$.y;o||w<N?un($,"right",E,F):Ht($,"right"),o||w>u?un($,"left",-E,-F):Ht($,"left"),yo($)}}function Ny(t,e,i,r,o,s){const a=e||t,l=t,c=i||t,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const b=2*g+3*m*f+p,y=3*m*(m+f);if(y!==0){const _=(g*a.x+b*l.x-p*c.x)/y-l.x,k=(g*a.y+b*l.y-p*c.y)/y-l.y;un(t,"left",_,k)}else Ht(t,"left")}else Ht(t,"left");if(!s&&i){const b=2*p+3*f*m+g,y=3*f*(f+m);if(y!==0){const _=(p*c.x+b*l.x-g*a.x)/y-l.x,k=(p*c.y+b*l.y-g*a.y)/y-l.y;un(t,"right",_,k)}else Ht(t,"right")}else Ht(t,"right");yo(t)}function $y(t,e,i,r,o,s){if(!(e&&i)){e||Ht(t,"left"),i||Ht(t,"right"),yo(t);return}const a=e,l=t,c=i,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;un(t,"left",m.x*p,m.y*p)}else Ht(t,"left");if(!s&&h!==0){const p=f*d/h-f;un(t,"right",m.x*p,m.y*p)}else Ht(t,"right");yo(t)}function Ey(t,e,i,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=ot(d,c),h=t[u];if(h.command===ie.move){Ht(h,"left"),Ht(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=f===null?null:t[ot(f,c)],g=m===null?null:t[ot(m,c)],b=f===null,y=m===null;a==="geometric"?$y(h,p,g,l,b,y):Ny(h,p,g,l,b,y)}}var tr=Math.min,nr=Math.max,Ry=Math.ceil,Py=Math.floor,Fy=new re,Vy=new ki,Hs=class gi extends zn{constructor(e,i,r,o){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 s in Ic)Object.defineProperty(this,s,Ic[s]);this._renderer.type="path",this._renderer.flagVertices=Ac.bind(this),this._renderer.bindVertices=Oc.bind(this),this._renderer.unbindVertices=zc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Lc.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($s(Nr({},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 Ne?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new Ne().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 a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=o,l.y-=s,l.x+=i,l.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,a,l,c=1/0,d=-1/0,u=1/0,h=-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:f,scaleY:m}=wi(i.elements[0],i.elements[3],i.elements[1],i.elements[4],i.elements[2],i.elements[5]);typeof f=="number"&&typeof m=="number"&&(r=Math.max(f,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++){l=this._renderer.vertices[s],a=this._renderer.vertices[(s+o-1)%o];const[f,m]=i.multiply(a.x,a.y),[p,g]=i.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,k]=i.multiply(b,y),x=l.controls.left.x,C=l.controls.left.y;l.relative&&(x+=l.x,C+=l.y);let[N,w]=i.multiply(x,C);const S=hc(f,m,_,k,N,w,p,g);u=tr(S.min.y-r,u),c=tr(S.min.x-r,c),d=nr(S.max.x+r,d),h=nr(S.max.y+r,h)}else s<=1&&(u=tr(m-r,u),c=tr(f-r,c),d=nr(f+r,d),h=nr(m+r,h)),u=tr(g-r,u),c=tr(p-r,c),d=nr(p+r,d),h=nr(g+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-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 a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();if(!l||e<l.left-a||e>l.right+a||i<l.top-a||i>l.bottom+a)return!1;const c=this.worldMatrix,d=c&&c.inverse(Vy);if(!d)return super.contains(e,i,o);const[u,h]=d.multiply(e,i,1),f=typeof o.precision=="number"&&!Number.isNaN(o.precision)?Math.max(1,Math.floor(o.precision)):8,m=xy(this,o.fill),p=ky(this,o.stroke),{polygons:g,segments:b}=yy(this,f);if(m&&g.length>0&&by(g,u,h))return!0;if(p&&b.length>0){const y=typeof this.linewidth=="number"?this.linewidth:0;if(y>0&&wy(b,u,h)<=y/2+a)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,a,l,c,d,u,h,f,m,p,g,b,y,_=this.length*Math.min(Math.max(e,0),1);const k=this.vertices.length,x=k-1;let C=null,N=null;for(let Z=0,L=this._lengths.length,A=0;Z<L;Z++){if(A+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)),C=this.vertices[r],N=this.vertices[o],_-=A,this._lengths[Z]!==0?e=_/this._lengths[Z]:e=0;break}A+=this._lengths[Z]}if(C===null||N===null)return null;if(C){if(!N)return C}else return N;y=N.controls&&N.controls.right,b=C.controls&&C.controls.left,l=N.x,f=N.y,c=(y||N).x,m=(y||N).y,d=(b||C).x,p=(b||C).y,u=C.x,g=C.y,y&&N.relative&&(c+=N.x,m+=N.y),b&&C.relative&&(d+=C.x,p+=C.y),a=$r(e,l,c,d,u),h=$r(e,f,m,p,g);const w=Ft(l,c,e),S=Ft(f,m,e),v=Ft(c,d,e),$=Ft(m,p,e),E=Ft(d,u,e),F=Ft(p,g,e),P=Ft(w,v,e),I=Ft(S,$,e),K=Ft(v,E,e),J=Ft($,F,e);return oe.isObject(i)?(i.x=a,i.y=h,i instanceof Ne&&(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-=a,i.controls.left.y-=h,i.controls.right.x-=a,i.controls.right.y-=h)),i.t=e,i):(s=new Ne(a,h,P-a,I-h,K-a,J-h,this._curved?ie.curve:ie.line),s.t=e,s)}plot(){if(this.curved)return pc(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 a=this._closed||s>0&&o[s-1]&&o[s-1].command===ie.close,l=(f,m)=>{if(f==null)return m;if(typeof f=="number"){if(a)return ot(f,s);let g=f;return g<0&&(g+=s),Math.min(Math.max(g,0),s-1)}const p=o.indexOf(f);return p!==-1?p:m},c=a&&i.from===void 0&&i.to===void 0;let d=l(i.from,0),u=l(i.to,s-1);if(d>u)if(a)d-=s;else{const f=d;d=u,u=f}const h=u-d+1;for(let f=0;f<h;f+=1){const m=ot(d+f,s),p=o[m],g=!a&&m===0;p.command===ie.move&&!g&&(p.command=ie.line)}if(r==="continuous"||r==="asymmetric")Ty(o,d,u,a,c,r==="asymmetric");else if(r==="catmull-rom"||r==="geometric"){const f={type:r,factor:i.factor};Ey(o,d,u,a,c,f)}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,a=null;for(let l=0;l<r;l+=1){const c=i[l];if(!s||c.command===ie.move){const u=c.clone();o.push(u),s=c,a=c;continue}if(Sy(c,s)){const h=zs(c,s,e).length,f=o[o.length-1];let m=f.clone(),p=c.clone(),g=f,b=0;if(h<=1){const y=c.clone();o.push(y)}else{for(let _=1;_<h;_+=1){const k=_/h,x=1-b,C=x<=Number.EPSILON?k:(k-b)/x,N=By(m,p,C);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=zs(c,s,e);for(let f=1;f<u.length;f+=1){const m=u[f];Vc(m,s),Ht(m,"left"),Ht(m,"right"),m.command=ie.line,o.push(m)}const h=c.clone();o.push(h)}s=c,c.command===ie.close&&(s=a)}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],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),oe.each(this.vertices,function(l,c){if(c<=0||l.command===ie.move){s=l,this._lengths[c]=0;return}this._lengths[c]=Tc(l,s,e),a+=this._lengths[c],s=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,i=this._closed,r=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),s=fo(this,r*this._length),a=fo(this,o*this._length),l=Ry(s),c=Py(a);let d,u,h,f,m,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Ne),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,h=this._collection[p-1],h&&h.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),h.relative?this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(re.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(h,1-m.t))):p>=l&&p<=c&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===c&&Bc(this,o)?(u=m,!i&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===l&&Bc(this,r)&&(d=m,d.command=ie.move,!i&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(p=l-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,m),m.command=ie.move,this._renderer.vertices.unshift(m),f=this._collection[p+1],f&&f.controls&&(m.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(re.zero,m.t):(Fy.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,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}};B(Hs,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(Hs,"Utils",{getCurveLength:Tc});var Ee=Hs,Ic={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 Ke||this._fill instanceof Ge||this._fill instanceof ze)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof ze)&&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 Ke||this._stroke instanceof Ge||this._stroke instanceof ze)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof ze)&&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 Ac(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Oc(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function zc(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dc(){this._flagFill=!0}function Lc(){this._flagStroke=!0}var Hc=class Jr extends Ee{constructor(e,i,r,o){const s=[new Ne,new Ne,new Ne,new Ne];super(s,!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 Wc)Object.defineProperty(this,a,Wc[a]);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 Jr().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Jr.Properties.length;i++){const r=Jr.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 Ne),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 Jr(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<Ee.Properties.length;r++){const o=Ee.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}};B(Hc,"Properties",["width","height","origin"]);var si=Hc,Wc={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()}}},jc=class eo extends si{constructor(e,i,r,o,s,a){super(i,r,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 l in qc)Object.defineProperty(this,l,qc[l]);this.noStroke(),this.noFill(),e instanceof ze?this.texture=e:typeof e=="string"&&(this.texture=new ze(e)),this.origin=new re,this._update(),typeof o=="number"&&(this.columns=o),typeof s=="number"&&(this.rows=s),typeof a=="number"&&(this.frameRate=a),this.index=0}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])}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 eo(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,a,l,c,d,u,h,f;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,h=e.image.height,o=u/i,s=h/r,l=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=l-1),a=oe.performance.now()-this._startTime,f=this._lastFrame+1,c=1e3*(f-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Ft(this._firstFrame,f,a/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+(h-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}};B(jc,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var bo=jc,qc={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}}},Ws,Xc=class extends ri{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),rc(this,Ws,{}),this.attach(e),this.on(ee.Types.insert,this.attach),this.on(ee.Types.remove,this.detach)}get ids(){return Dt(this,Ws)}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}};Ws=new WeakMap;var Yc=class ji extends Ee{constructor(e,i,r,o,s,a,l){const c=l||kt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Ne);super(d,!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",tt),B(this,"_innerRadius",0),B(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Uc)Object.defineProperty(this,u,Uc[u]);typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.startAngle=s),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}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&&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),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,m,p,g,b,y,_,k;for(s?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(m=h/f,p=l[u],g=m*(i-e)+e,b=(i-e)/c,y=o*Math.cos(g),_=o*Math.sin(g),h){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),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++}if(a){for(s?(l[u].command=ie.close,u++):(c--,f=c-1),h=0;h<c;h++)m=h/f,p=l[u],g=(1-m)*(i-e)+e,b=(i-e)/c,y=r*Math.cos(g),_=r*Math.sin(g),d=ie.curve,h<=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),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=ie.line}else s||(l[u].command=ie.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[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,a=this.vertices.length,l=new ji(0,0,i,r,o,s,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Ee.Properties.length;c++){const d=Ee.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let i=0;i<ji.Properties.length;i++){const r=ji.Properties[i];e[r]=this[r]}return e}};B(Yc,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var js=Yc,Uc={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}}},qs=Math.cos,Xs=Math.sin,Kc=class qi extends Ee{constructor(e,i,r,o){const s=o?Math.max(o,2):4,a=[];for(let l=0;l<s;l++)a.push(new Ne(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 l in Gc)Object.defineProperty(this,l,Gc[l]);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 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._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 l=s/e*tt,c=r*qs(l),d=r*Xs(l),u=o*qs(l-dt),h=o*Xs(l-dt),f=o*qs(l+dt),m=o*Xs(l+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const i=new qi(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<Ee.Properties.length;r++){const o=Ee.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<qi.Properties.length;i++){const r=qi.Properties[i];e[r]=this[r]}return e}};B(Kc,"Properties",["radius"]);var _o=Kc,Gc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Ys=Math.cos,Us=Math.sin,Zc=class Xi extends Ee{constructor(e,i,r,o,s){typeof o!="number"&&typeof r=="number"&&(o=r);const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ne);super(l,!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 c in Qc)Object.defineProperty(this,c,Qc[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 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._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 l=s/e*tt,c=r*Ys(l),d=o*Us(l),u=r*i*Ys(l-dt),h=o*i*Us(l-dt),f=r*i*Ys(l+dt),m=o*i*Us(l+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,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 Xi(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 a=0;a<Ee.Properties.length;a++){const l=Ee.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let i=0;i<Xi.Properties.length;i++){const r=Xi.Properties[i];e[r]=this[r]}return e}};B(Zc,"Properties",["width","height"]);var wo=Zc,Qc={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}}},My=Math.ceil,Iy=Math.floor,Jc=class yi extends zn{constructor(e){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",Ee.prototype.noFill),B(this,"noStroke",Ee.prototype.noStroke),B(this,"corner",Ee.prototype.corner),B(this,"center",Ee.prototype.center),B(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect),B(this,"_updateLength",Ee.prototype._updateLength);for(let i in ed)Object.defineProperty(this,i,ed[i]);this._renderer.type="points",this._renderer.flagVertices=Ac.bind(this),this._renderer.bindVertices=Oc.bind(this),this._renderer.unbindVertices=zc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Lc.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($s(Nr({},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 Ne?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new Ne().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 a=o.x,l=o.y,c=s.x,d=s.y,u=Ps(a,l,a,l,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=fo(this,e*this._length),o=fo(this,i*this._length),s=My(r),a=Iy(o);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=s&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};B(Jc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var Ks=Jc,ed={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 Ke||this._fill instanceof Ge||this._fill instanceof ze)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof ze)&&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 Ke||this._stroke instanceof Ge||this._stroke instanceof ze)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof ze)&&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}}},Ay=Math.cos,Oy=Math.sin,td=class Yi extends Ee{constructor(e,i,r,o){o=Math.max(o||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 s in nd)Object.defineProperty(this,s,nd[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 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||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,a=tt*s+Math.PI/2,l=this._width*Ay(a)/2,c=this._height*Oy(a)/2;o>=r?this.vertices.push(new Ne(l,c)):this.vertices[o].set(l,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 Yi(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<Ee.Properties.length;r++){const o=Ee.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<Yi.Properties.length;i++){const r=Yi.Properties[i];e[r]=this[r]}return e}};B(td,"Properties",["width","height","sides"]);var Gs=td,nd={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}}},id=class Ui extends Ee{constructor(e,i,r,o,s){typeof s>"u"&&typeof r=="number"&&typeof o=="number"&&(s=Math.floor(Math.min(r,o)/12));const a=[];for(let l=0;l<10;l++)a.push(new Ne(0,0,0,0,0,0,l===0?ie.move:ie.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 l in rd)Object.defineProperty(this,l,rd[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=zy.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,a=e/2,l=i/2;s=this.vertices[0],s.x=-(a-r),s.y=-l,s=this.vertices[1],s.x=a-r,s.y=-l,s.controls.left.clear(),s.controls.right.x=r,s.controls.right.y=0,s=this.vertices[2],s.x=a,s.y=-(l-o),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=a,s.y=l-o,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=o,s=this.vertices[4],s.x=a-r,s.y=l,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(a-r),s.y=l,s.controls.left.clear(),s.controls.right.x=-r,s.controls.right.y=0,s=this.vertices[6],s.x=-a,s.y=l-o,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-a,s.y=-(l-o),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-o,s=this.vertices[8],s.x=-(a-r),s.y=-l,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 a=0;a<Ee.Properties.length;a++){const l=Ee.Properties[a];s[l]=this[l]}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}};B(id,"Properties",["width","height","radius"]);var xo=id,rd={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 zy(){this._flagRadius=!0}var Dy=Math.cos,Ly=Math.sin,od=class Ki extends Ee{constructor(e,i,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=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 sd)Object.defineProperty(this,a,sd[a]);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 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._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,a=tt*s,l=(o%2?this._outerRadius:this._innerRadius)/2,c=l*Dy(a),d=l*Ly(a);o>=r?this.vertices.push(new Ne(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 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 a=0;a<Ee.Properties.length;a++){const l=Ee.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let i=0;i<Ki.Properties.length;i++){const r=Ki.Properties[i];e[r]=this[r]}return e}};B(od,"Properties",["innerRadius","outerRadius","sides"]);var Zs=od,sd={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}}},Qs,ad=Math.min,ld=Math.max;Ue.document&&(Qs=document.createElement("canvas"));var Js=class tn extends zn{constructor(e,i,r,o){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 s in cd)Object.defineProperty(this,s,cd[s]);if(this._renderer.type="text",this._renderer.flagFill=Hy.bind(this),this._renderer.flagStroke=Wy.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 a=tn.Properties[s];a in o&&(this[a]=o[a])}}static Measure(e){if(Qs){const i=Qs.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($s(Nr({},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,a;this._update(!0),i=e?this.matrix:this.worldMatrix;const{width:l,height:c}=tn.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,o=l+d;break;case"right":r=-(l+d),o=d;break;default:r=-(l/2+d),o=l/2+d}switch(this.baseline){case"middle":s=-(c/2+d),a=c/2+d;break;default:s=-(c+d),a=d}const[u,h]=i.multiply(r,s),[f,m]=i.multiply(r,a),[p,g]=i.multiply(o,s),[b,y]=i.multiply(o,a);return s=ad(h,m,g,y),r=ad(u,f,p,b),o=ld(u,f,p,b),a=ld(h,m,g,y),{top:s,left:r,right:o,bottom:a,width:o-r,height:a-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}};B(Js,"Ratio",.6),B(Js,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var kn=Js,cd={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 Ke||this._fill instanceof Ge||this._fill instanceof ze)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof ze)&&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 Ke||this._stroke instanceof Ge||this._stroke instanceof ze)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof ze)&&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 Hy(){this._flagFill=!0}function Wy(){this._flagStroke=!0}var ea=class _r extends si{constructor(e,i,r,o){super(i,r,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 s in dd)Object.defineProperty(this,s,dd[s]);this._renderer.flagTextures=jy.bind(this),this._renderer.bindTextures=qy.bind(this),this._renderer.unbindTextures=Xy.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(ud.bind(this)):typeof e=="string"&&(this.textures=[ud(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=_r.DefaultFrameRate,this.index=0}static fromObject(e){const i=new _r().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<_r.Properties.length;i++){const r=_r.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 _r(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,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,oe.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=oe.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?o=o%a:o=Math.min(o,a),c=Ft(this._firstFrame,d,o/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(i=l.image.width,r=l.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof ze))&&(l=e[this._index],l.loaded&&(i=l.image.width,r=l.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};B(ea,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(ea,"DefaultFrameRate",30);var ta=ea,dd={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 jy(){this._flagTextures=!0}function qy(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Xy(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ud(t){if(t instanceof ze)return t;if(typeof t=="string")return new ze(t)}var ko=Math.min,vo=Math.max,Yy={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},na=class ln extends zn{constructor(e){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 i in fd)Object.defineProperty(this,i,fd[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++)hd.call(this,e[i],this)}static RemoveChildren(e){for(let i=0;i<e.length;i++)hd.call(this,e[i])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const i=new ln;for(let o=0;o<ln.Properties.length;o++){const s=ln.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 js.fromObject(o);case"circle":return _o.fromObject(o);case"element":return Qi.fromObject(o);case"ellipse":return wo.fromObject(o);case"group":return ln.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return ta.fromObject(o);case"path":return Ee.fromObject(o);case"points":return Ks.fromObject(o);case"polygon":return Gs.fromObject(o);case"rectangle":return si.fromObject(o);case"rounded-rectangle":return xo.fromObject(o);case"shape":return zn.fromObject(o);case"sprite":return bo.fromObject(o);case"star":return Zs.fromObject(o);case"text":return kn.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,a,l){const c=e&&e.children;if(!c)return!1;const d=i.results;for(let u=c.length-1;u>=0;u--){const h=c[u];if(!h||!ln.IsVisible(h,i.visibleOnly))continue;const f=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(f&&!vy(f,i.x,i.y,a))){if(h instanceof ln){if(r&&(!o||o(h))&&typeof h.contains=="function"&&h.contains(i.x,i.y,s)&&(d.push(h),l)||ln.VisitForHitTest(h,i,r,o,s,a,l))return!0;continue}if(h instanceof zn&&!(o&&!o(h))&&typeof h.contains=="function"&&h.contains(i.x,i.y,s)&&(d.push(h),l))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<ln.Properties.length;i++){const r=ln.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new ln,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:a,context:l,single:c,empty:d}=Yy.getShapesAtPoint;s.length=0;const u=o.mode==="deepest"||o.deepest?"deepest":"all",h=o.visibleOnly!==!1,f=!!o.includeGroups,m=typeof o.filter=="function"?o.filter:null,p=typeof o.tolerance=="number"?o.tolerance:0;typeof o.precision=="number"?a.precision=o.precision:delete a.precision,typeof o.fill<"u"?a.fill=o.fill:delete a.fill,typeof o.stroke<"u"?a.stroke=o.stroke:delete a.stroke,a.tolerance=p,a.ignoreVisibility=!h;const g=u==="deepest";if(l.x=e,l.y=i,l.visibleOnly=h,l.results=s,ln.VisitForHitTest(this,l,f,m,a,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 a=o.children[s];r(a)}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 a=o.children[s];r(a)}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 a=this.children.indexOf(s);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let i,r,o,s,a,l;this._update(!0);let c=1/0,d=-1/0,u=1/0,h=-1/0;const f=/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||f.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),a=typeof i.right!="number"||oe.isNaN(i.right)||!isFinite(i.right),l=typeof i.bottom!="number"||oe.isNaN(i.bottom)||!isFinite(i.bottom),!(o||s||a||l)))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),[C,N]=r.multiply(i.right,i.bottom);u=ko(b,_,x,N,u),c=ko(g,y,k,C,c),d=vo(g,y,k,C,d),h=vo(b,_,x,N,h)}else u=ko(i.top,u),c=ko(i.left,c),d=vo(i.right,d),h=vo(i.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-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),a=this.length;let l=0;const c=o*a,d=s*a;for(e=0;e<this.children.length;e++)r=this.children[e],i=r.length,c>l+i?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+i?(r.beginning=(c-l)/i,r.ending=1):d>l&&d<l+i?(r.beginning=0,r.ending=(d-l)/i):(r.beginning=0,r.ending=1),l+=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}};B(na,"Children",Xc),B(na,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var pt=na,fd={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 Xc(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 hd(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 Co=class extends Ee{constructor(e,i,r,o){const s=[new Ne(e,i),new Ne(r,o)];super(s);for(let a in md)Object.defineProperty(this,a,md[a]);this.vertices[0].command=ie.move,this.vertices[1].command=ie.line,this.automatic=!1}};B(Co,"Properties",["left","right"]);var md={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},Uy={start:"left",middle:"center",end:"right"},pd=["id","class","transform","xmlns","viewBox"],Ky=["x","y","width","height","href","xlink:href"];function Gy(t){return Uy[t]}function Zy(t){const e=t.getAttribute("dominant-baseline"),i=t.getAttribute("alignment-baseline");return e||i}function Er(t){return t.replace(/svg:/gi,"").toLowerCase()}function gd(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 Qy(t,e){e||(e={});const i=t.split(";");for(let r=0;r<i.length;r++){const o=i[r].split(":"),s=o[0],a=o[1];if(typeof s>"u"||typeof a>"u")continue;const l=s.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Jy(t){const e={},i=e0(t),r=Math.max(i.length,t.style.length);for(let o=0;o<r;o++){const s=t.style[o],a=i[o];s&&(e[s]=t.style[s]),a&&(e[a]=t.getAttribute(a))}return e}function e0(t){const e=t.getAttributeNames();for(let i=0;i<pd.length;i++){const r=pd[i],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function t0(t,e){const i=e.split(/[\s,]/),r=-parseFloat(i[0]),o=-parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);if(r&&o)for(let h=0;h<t.children.length;h++){const f=t.children[h];"translation"in f?f.translation.add(r,o):"x"in f?f.x=r:"y"in f&&(f.y=o)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(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/a),t.mask=new si(0,0,s,a),t.mask.origin.set(-s/2,-a/2),t}function nn(t,e,i){const r={},o={},s={};let a,l,c,d,u,h,f,m,p,g,b,y,_,k,x,C,N;if(t===null)return r;if(Ue.getComputedStyle){const w=Ue.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?Qy(h.value,s):o[h.nodeName]=h.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)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(f=wi(l),e._renderer.type){case"linear-gradient":gd(f,e.left),gd(f,e.right);break;case"radial-gradient":e.center.x+=f.translateX,e.center.y+=f.translateY,e.focal.x+=f.translateX,e.focal.y+=f.translateY,e.radius*=Math.max(f.scaleX,f.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;f=wi(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.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"),Ye.defs.current&&Ye.defs.current.contains(g)&&(y=Ye.defs.current.get(g),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=Er(y.nodeName),e.mask=Ye[_].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"),Ye.defs.current&&Ye.defs.current.contains(g)?(y=Ye.defs.current.get(g),y.object||(_=Er(y.nodeName),y.object=Ye[_].call(this,y,{})),y=y.object):(b=i0(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 Ke,C=e instanceof Ge,k||x||C)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 kn&&(e.family=d);break;case"font-size":e instanceof kn&&(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 kn&&(e.weight=d);break;case"font-style":e instanceof kn&&(e.style=d);break;case"text-decoration":e instanceof kn&&(e.decoration=d);break;case"line-height":e instanceof kn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function n0(t,e){for(let i=0,r=t.childNodes.length;i<r;i++){const o=t.childNodes[i];!o.id||Er(t.nodeName)==="#text"||e.add(o.id,o)}}function i0(t){for(;t.parent;)t=t.parent;return t.scene}var Ye={svg:function(t){const e=Ye.defs.current=new co,i=t.getElementsByTagName("defs");for(let p=0;p<i.length;p++)n0(i[p],e);const r=Ye.g.call(this,t),o=t.getAttribute("viewBox"),s=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=o!==null,u=s!==null,h=a!==null,f=l!==null,m=c!==null;return u&&(r.x=parseFloat(s.replace(vn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(vn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(vn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(vn.unitSuffix,""))),d&&t0(r,o),delete Ye.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(!Ye.defs.current.contains(o))return i=new Lt("unable to find element for reference "+r+"."),console.warn(i.name,i.message),null;const a=Ye.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=Ky.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=Er(a.nodeName);return Ye[l].call(this,a,e)},g:function(t,e){const i=new pt;nn.call(this,t,i,e),this.add(i);const r=Jy.call(this,t);for(let o=0,s=t.childNodes.length;o<s;o++){const a=t.childNodes[o],l=a.nodeName;if(!l)return;const c=Er(l);if(c in Ye){const d=Ye[c].call(i,a,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,a,l){r.push(new Ne(parseFloat(a),parseFloat(l)))});const o=new Ee(r,!0);return o.stroke="none",o.fill="black",nn.call(this,t,o,e),o},polyline:function(t,e){const i=Ye.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 l=new Ne,c,d,u=i.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;oe.each(u.slice(0),function(f,m){const p=f.slice(1).trim().match(vn.path),g=f[0],b=g.toLowerCase();let y,_,k,x,C;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,C=0;_<k;_+=y){if(x=g,C>0)switch(g){case"m":x="l";break;case"M":x="L";break}N.push(x+p.slice(_,_+y).join(" ")),C++}u=Array.prototype.concat.apply(u,N)}else u.push(f)}),oe.each(u,function(f,m){let p,g,b;const y=f[0],_=y.toLowerCase();d=f.slice(1).trim().match(vn.path),s=y===_;let k,x,C,N,w,S,v,$,E,F,P,I,K,J,Z,L,A;switch(_){case"z":if(m>=h)o=!0;else{g=l.x,b=l.y,p=new Ne(g,b,void 0,void 0,void 0,void 0,ie.close);for(let O=r.length-1;O>=0;O--){const V=r[O];if(/m/i.test(V.command)){l=V;break}}}break;case"m":case"l":c=void 0,g=parseFloat(d[0]),b=parseFloat(d[1]),p=new Ne(g,b,void 0,void 0,void 0,void 0,/m/i.test(_)?ie.move:ie.line),s&&p.addSelf(l),l=p;break;case"h":case"v":F=/h/i.test(_)?"x":"y",P=/x/i.test(F)?"y":"x",p=new Ne(void 0,void 0,void 0,void 0,void 0,void 0,ie.line),p[F]=parseFloat(d[0]),p[P]=l[P],s&&(p[F]+=l[F]),l=p;break;case"c":case"s":k=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(C=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[2]),S=parseFloat(d[3]),v=parseFloat(d[4]),$=parseFloat(d[5])):(E=Fs(l,c,s),C=E.x,N=E.y,w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])),s&&(C+=k,N+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set(C-l.x,N-l.y),p=new Ne(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"t":case"q":k=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(C=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])):(E=Fs(l,c,s),C=E.x,N=E.y,w=E.x,S=E.y,v=parseFloat(d[0]),$=parseFloat(d[1])),s&&(C+=k,N+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set((C-l.x)*.33,(N-l.y)*.33),p=new Ne(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"a":k=l.x,x=l.y,K=parseFloat(d[0]),J=parseFloat(d[1]),Z=parseFloat(d[2]),L=parseFloat(d[3]),A=parseFloat(d[4]),v=parseFloat(d[5]),$=parseFloat(d[6]),s&&(v+=k,$+=x),I=new Ne(v,$),I.command=ie.arc,I.rx=K,I.ry=J,I.xAxisRotation=Z,I.largeArcFlag=L,I.sweepFlag=A,p=I,l=I,c=void 0;break}p&&(Array.isArray(p)?r=r.concat(p):r.push(p))})}i=new Ee(r,o,void 0,!0),i.stroke="none",i.fill="black";const a=i.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},oe.each(i.vertices,function(l){l.subSelf(a.centroid)}),nn.call(this,t,i,e),i.translation.addSelf(a.centroid),i},circle:function(t,e){const i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("r")),s=new _o(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")),a=new wo(0,0,o,s);return a.stroke="none",a.fill="black",nn.call(this,t,a,e),a.translation.x=i,a.translation.y=r,a},rect:function(t,e){const i=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!oe.isNaN(i)||!oe.isNaN(r))return Ye["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=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+=a,c.translation.y+=l,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")),a=o/2,l=s/2,c=new re(i,r),d=new xo(0,0,o,s,c);return d.stroke="none",d.fill="black",nn.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,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")),a=new Co(i,r,o,s).noFill();return nn.call(this,t,a,e),a},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),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+o)/2,d=(l+s)/2;/userSpaceOnUse/i.test(i)&&(o-=c,s-=d,a-=c,l-=d);const u=[];for(let f=0;f<t.children.length;f++){const m=t.children[f];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 h=new Ke(o,s,a,l,u);return h.spread=r,h.units=i,nn.call(this,t,h,e),h},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,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));oe.isNaN(l)&&(l=o),oe.isNaN(c)&&(c=s);const d=Math.abs(o+l)/2,u=Math.abs(s+c)/2;/userSpaceOnUse/i.test(i)&&(o-=d,s-=u,l-=d,c-=u);const h=[];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),h.push(new oi(g,b,y))}const f=new Ge(o,s,a,h,l,c);return f.spread=r,f.units=i,nn.call(this,t,f,e),f},text:function(t,e){const i=Gy(t.getAttribute("text-anchor"))||"left",r=Zy(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new kn(o);return nn.call(this,t,s,e),s.alignment=i,s.baseline=r,s},clippath:function(t,e){return Ye.defs.current&&!Ye.defs.current.contains(t.id)&&Ye.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,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new bo(r,o,s);return oe.isNaN(a)||(c.width=a),oe.isNaN(l)||(c.height=l),nn.call(this,t,c,e),c}};function yd(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 ia=class In extends si{constructor(e,i,r,o,s,a){super(i,r,o||1,s||1),B(this,"_flagTexture",!1),B(this,"_flagMode",!1),B(this,"_texture",null),B(this,"_mode","fill"),this._renderer.type="image";for(let l in _d)Object.defineProperty(this,l,_d[l]);this.noStroke(),this.noFill(),e instanceof ze?this.texture=e:typeof e=="string"&&(this.texture=new ze(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const i=new In().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<In.Properties.length;i++){const r=In.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new In(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,a=o/i,l=s/r;switch(this._mode){case In.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case In.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case In.Modes.crop:break;case In.Modes.tile:{e.offset.x=(i-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case In.Modes.stretch:default:e.scale=new re(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};B(ia,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),B(ia,"Properties",["texture","mode"]);var bd=ia,_d={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}}},ra=[],oa=Math.max,r0=Math.min,wd=Math.abs,So=Math.sin,Bo=Math.cos,o0=Math.acos,To=Math.sqrt,Pe={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 Pe?t:"path"},group:{renderChild:function(t){const e=Pe.getRendererType(t._renderer.type);Pe[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=No(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 a=Pe.getRendererType(r._renderer.type);Pe[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Pe.getRendererType(l._renderer.type);Pe[c].render.call(l,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,a,l,c,d,u,h,f,m,p,g,b,y,_,k,x,C,N,w,S,v,$,E,F,P,I,K,J,Z,L,A,O;if(O=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,K=this._mask,J=this._clip,l=this._opacity*(O||1),c=this._visible,!e&&(!c||J||l===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,d=this._cap,u=this._join,h=this._miter,f=this._closed,m=this._renderer.vertices,p=m.length,g=p-1,Z=No(r),A=this.dashes,Z||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),K){const j=Pe.getRendererType(K._renderer.type);Pe[j].render.call(K,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const j=Pe.getRendererType(a._renderer.type);Pe[j].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const j=Pe.getRendererType(o._renderer.type);Pe[j].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=xn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),A&&A.length>0&&(t.lineDashOffset=A.offset||0,t.setLineDash(A)),t.beginPath();let V,R,H,U,G,X,W;for(let j=0;j<p;j++)switch(_=m[j],P=_.x,I=_.y,_.command){case ie.close:t.closePath();break;case ie.arc:V=_.rx,R=_.ry,H=_.xAxisRotation,U=_.largeArcFlag,G=_.sweepFlag,b=f?ot(j-1,p):oa(j-1,0),y=m[b],X=y.x,W=y.y,Pe.renderSvgArcCommand(t,X,W,V,R,U,G,H,P,I);break;case ie.curve:b=f?ot(j-1,p):Math.max(j-1,0),y=m[b],v=y.controls&&y.controls.right||re.zero,$=_.controls&&_.controls.left||re.zero,y._relative?(w=v.x+y.x,S=v.y+y.y):(w=v.x,S=v.y),_._relative?(C=$.x+_.x,N=$.y+_.y):(C=$.x,N=$.y),t.bezierCurveTo(w,S,C,N,P,I),j>=g&&f&&(k=x,E=_.controls&&_.controls.right||re.zero,F=k.controls&&k.controls.left||re.zero,_._relative?(w=E.x+_.x,S=E.y+_.y):(w=E.x,S=E.y),k._relative?(C=F.x+k.x,N=F.y+k.y):(C=F.x,N=F.y),P=k.x,I=k.y,t.bezierCurveTo(w,S,C,N,P,I));break;case ie.line:t.lineTo(P,I);break;case ie.move:x=_,t.moveTo(P,I);break}return f&&t.closePath(),!J&&!i&&(Pe.isHidden.test(a)||(L=a._renderer&&a._renderer.offset,L&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),L&&t.restore()),Pe.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(),A&&A.length>0&&t.setLineDash(ra),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,i){let r,o,s,a,l,c,d,u,h,f,m,p,g,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,g=No(r),y=this.dashes,d=this._size,g||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const C=Pe.getRendererType(a._renderer.type);Pe[C].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const C=Pe.getRendererType(o._renderer.type);Pe[C].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=xn(this))}typeof l=="number"&&(t.globalAlpha=l),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 C=0;C<h;C++)f=u[C],m=f.x,p=f.y,t.moveTo(m+k,p),t.arc(m,p,k,0,tt);return i||(Pe.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Pe.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(ra),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,a=this._mask,l=this._clip;if(!e&&(!s||l||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,h=this._fill,f=this._decoration,m=this._direction,p=No(c),g=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Pe.alignments[this._alignment]||this._alignment,_=Pe.baselines[this._baseline]||this._baseline;let k,x,C,N,w,S,v,$,E,F,P;if(p||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const I=Pe.getRendererType(a._renderer.type);Pe[I].render.call(a,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,h)if(typeof h=="string")t.fillStyle=h;else{const I=Pe.getRendererType(h._renderer.type);Pe[I].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const I=Pe.getRendererType(d._renderer.type);Pe[I].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=xn(this))}if(typeof o=="number"&&(t.globalAlpha=o),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!i&&(Pe.isHidden.test(h)||(h._renderer&&h._renderer.offset?(S=h._renderer.scale.x,v=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(S,v),k=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),C=h._renderer.offset.x/h._renderer.scale.x,N=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,C,N),t.restore()):t.fillText(this.value,0,0)),Pe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(S=d._renderer.scale.x,v=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(S,v),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(" "),C=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,C,N),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const I=t.measureText(this.value);let K=1;switch(f){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,F=I.width;break;case"right":case"end":$=-I.width,F=0;break;default:$=-I.width/2,F=I.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,E),t.lineTo(F,P),t.stroke()}return p||t.restore(),l&&!i&&t.clip(),b&&b.length>0&&t.setLineDash(ra),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,a=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,a=(a-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];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,a=this.focal._y,l=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,a=(a-.5)*i.height*.5,l*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return 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,a,l,c,d){l=l*Math.PI/180,r=wd(r),o=wd(o);const u=(e-c)/2,h=(i-d)/2,f=Bo(l)*u+So(l)*h,m=-So(l)*u+Bo(l)*h,p=f*f,g=m*m;let b=r*r,y=o*o;const _=p/b+g/y;if(_>1){const I=To(_);r=I*r,o=I*o,b=r*r,y=o*o}const k=b*g+y*p,x=(b*y-k)/k;let C=To(oa(0,x));s===a&&(C=-C);const N=C*r*m/o,w=-C*o*f/r,S=Bo(l)*N-So(l)*w+(e+c)/2,v=So(l)*N+Bo(l)*w+(i+d)/2,$=xd(1,0,(f-N)/r,(m-w)/o),E=xd((f-N)/r,(m-w)/o,(-f-N)/r,(-m-w)/o)%tt,F=$+E;s0(t,S,v,r,o,$,F,a===0,l)}},Ct=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"?Vs(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),Pe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};B(Ct,"Utils",Pe);function s0(t,e,i,r,o,s,a,l,c){const d=a-s,u=Gi.Tolerance.epsilon,h=Math.abs(d)<u;let f=ot(d,tt);f<u&&(h?f=0:f=tt),l===!0&&!h&&(f===tt?f=-tt:f=f-tt);for(let m=0;m<kt.Resolution;m++){const p=m/(kt.Resolution-1),g=s+p*f;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,C=y-i;b=x*_-C*k+e,y=x*k+C*_+i}t.lineTo(b,y)}}function xd(t,e,i,r){const o=t*i+e*r,s=To(t*t+e*e)*To(i*i+r*r);let a=o0(oa(-1,r0(1,o/s)));return t*r-e*i<0&&(a=-a),a}function No(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 a=0;a<i;a++){const l=t[a],c=e?ot(a-1,i):Math.max(a-1,0),d=t[c];let u,h,f,m,p,g,b,y,_,k,x,C,N,w,S,v=Oe(l.x),$=Oe(l.y);switch(l.command){case ie.close:u=ie.close;break;case ie.arc:x=l.rx,C=l.ry,N=l.xAxisRotation,w=l.largeArcFlag,S=l.sweepFlag,u=ie.arc+" "+x+" "+C+" "+N+" "+w+" "+S+" "+v+" "+$;break;case ie.curve:b=d.controls&&d.controls.right||re.zero,y=l.controls&&l.controls.left||re.zero,d.relative?(f=Oe(b.x+d.x),m=Oe(b.y+d.y)):(f=Oe(b.x),m=Oe(b.y)),l.relative?(p=Oe(y.x+l.x),g=Oe(y.y+l.y)):(p=Oe(y.x),g=Oe(y.y)),u=(a===0?ie.move:ie.curve)+" "+f+" "+m+" "+p+" "+g+" "+v+" "+$;break;case ie.move:o=l,u=ie.move+" "+v+" "+$;break;default:u=l.command+" "+v+" "+$}a>=r&&e&&(l.command===ie.curve&&(h=o,_=l.controls&&l.controls.right||l,k=h.controls&&h.controls.left||h,l.relative?(f=Oe(_.x+l.x),m=Oe(_.y+l.y)):(f=Oe(_.x),m=Oe(_.y)),h.relative?(p=Oe(k.x+h.x),g=Oe(k.y+h.y)):(p=Oe(k.x),g=Oe(k.y)),v=Oe(h.x),$=Oe(h.y),u+=" C "+f+" "+m+" "+p+" "+g+" "+v+" "+$),l.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,a=t[o].y-r;i+=ie.move+" "+s+" "+a+" ",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,a=`[fill="url(#${s})"],[stroke="url(#${s})"],[clip-path="url(#${s})"]`;t.querySelector(a)||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"]=xn(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,a=wi(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(a.scaleX,a.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"]=xn(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"]=xn(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],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,a):s._renderer.elem=ue.createElement("stop",a),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],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,a):s._renderer.elem=ue.createElement("stop",a),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()}}},kd=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}};B(kd,"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 ao=function(){return ao=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},ao.apply(this,arguments)},Ep={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"},Ss=500,Rp=(function(){function t(e,i){return this.core=e,this.$LG=i,this.settings=ao(ao({},Ep),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,a=r.getBoundingClientRect();e?(o=r.offsetHeight*e,s=r.offsetWidth*e):i?(o=a.height+i*a.height,s=a.width+i*a.width):(o=a.height,s=a.width);var l=o>this.containerRect.height,c=s>this.containerRect.width;return{allowX:c,allowY:l}},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,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,i),u=d.allowY,h=d.allowX;this.positionChanged&&(l=this.left/(this.scale-i),c=this.top/(this.scale-i),this.pageX=s-l,this.pageY=a-c,this.positionChanged=!1);var f=this.getPossibleSwipeDragCords(i),m,p,g=s-this.pageX,b=a-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&&(h?this.isBeyondPossibleLeft(m,f.minX)?m=f.minX:this.isBeyondPossibleRight(m,f.maxX)&&(m=f.maxX):e>1&&(m<f.minX?m=f.minX:m>f.maxX&&(m=f.maxX)),u?this.isBeyondPossibleTop(p,f.minY)?p=f.minY:this.isBeyondPossibleBottom(p,f.maxY)&&(p=f.maxY):e>1&&(p<f.minY?p=f.minY:p>f.maxY&&(p=f.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)},Ss),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")}},Ss+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(),a=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-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ss+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,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;o=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",i=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=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 h=e.scale-s;e.zoomImage(e.scale,Math.round((h+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,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 a=i.x-e.x,l=i.y-e.y,c=Math.abs(a)/s+1,d=Math.abs(l)/s+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(o&&(this.isBeyondPossibleTop(h.y,f.minY)?h.y=f.minY:this.isBeyondPossibleBottom(h.y,f.maxY)&&(h.y=f.maxY)),r&&(this.isBeyondPossibleLeft(h.x,f.minX)?h.x=f.minX:this.isBeyondPossibleRight(h.x,f.maxX)&&(h.x=f.maxX)),o?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,i,r,o,s){var a={};if(o){if(a.y=this.top+(i.y-e.y),this.isBeyondPossibleTop(a.y,s.minY)){var l=s.minY-a.y;a.y=s.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var c=a.y-s.maxY;a.y=s.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(i.x-e.x),this.isBeyondPossibleLeft(a.x,s.minX)){var d=s.minX-a.x;a.x=s.minX-d/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var u=a.x-s.maxX;a.x=s.maxX+u/6}}else a.x=this.left;return a},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,a=o.width;e&&(s=s+e*s,a=a+e*a);var l=(s-this.containerRect.height)/2,c=(this.containerRect.height-s)/2+r,d=(a-this.containerRect.width)/2,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},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,a=!1,l=new Date,c=new Date,d,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))&&f.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);a=m.allowY,s=m.allowX,(s||a)&&(i=e.getSwipeCords(f)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){f.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(f);var m=e.getZoomSwipeCords(i,r,s,a,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(f){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){if(f.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!o)return;o=!1,c=new Date;var m=c.valueOf()-l.valueOf();e.touchendZoom(i,r,s,a,m)}})},t.prototype.zoomDrag=function(){var e=this,i={},r={},o=!1,s=!1,a=!1,l=!1,c,d,u,h;this.core.outer.on("mousedown.lg.zoom",function(f){if(e.isImageSlide(e.core.index)){var m=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||m.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var p=e.getDragAllowedAxises(0);l=p.allowY,a=p.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),i=e.getDragCords(f),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(f){if(o){s=!0,r=e.getDragCords(f);var m=e.getZoomSwipeCords(i,r,a,l,u);e.setZoomSwipeStyles(h,m)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){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(f);var m=d.valueOf()-c.valueOf();e.touchendZoom(i,r,a,l,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 Pp={ref:"gallery-container",class:"lightgallery-wrapper"},Fp={},Yl=n.defineComponent({...Fp,__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}),z.forOwn(i,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),n.onBeforeUnmount(()=>{var s;o.value&&((s=o.value)==null||s.destroy(),o.value=null)}),(s,a)=>(n.openBlock(),n.createElementBlock("div",Pp,[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=q.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(){z.forEach(yt.refsDependingOnDeviceResolution,e=>{yt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};N(yt,"isInitialized",!1),N(yt,"refsDependingOnDeviceResolution",[]);let et=yt;const Vp=["href"],Mp=["src","alt"],Ip={},Ul=n.defineComponent({...Ip,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const i=n.ref(!1),r=n.ref(!1),o=n.ref({plugins:[$p,Rp],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(et.getDeviceTypeByResolution()===Xe.phone?.7:.8),a=n.ref(s()),l=()=>{a.value=s()},c=()=>{i.value=!0};return n.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,u)=>{const h=Xl,f=M.NPopover;return n.openBlock(),n.createBlock(f,{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(h)])])]),default:n.withCtx(()=>[n.createVNode(Yl,{settings:o.value,style:n.normalizeStyle(`max-width: ${a.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,Mp)],8,Vp))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Ap={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},Op={class:"pr-3"},zp={class:"text-right"},Dp={},Lp=n.defineComponent({...Dp,__name:"product-stock-count",props:{product:{}},setup(t){return(e,i)=>{const r=oo,o=M.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",Ap,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.product.stockCount,(s,a)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:a},[n.createElementVNode("span",Op,n.toDisplayString(s.warehouse.name),1),n.createElementVNode("span",zp,[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})}}}),Hp=["innerHTML"],Wp=["innerHTML"],jp={class:"m-0 flex list-none flex-col gap-1 p-0 text-sm"},qp=["href"],Xp={key:1,class:"text-sm text-gray-500"},Yp={},Bs=n.defineComponent({...Yp,__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(()=>vs(e.product)),a=n.computed(()=>[r.value?"description":null,o.value?"specification":null,s.value.length>0?"files":null].filter(c=>c!==null)),l=n.ref(e.activeTab&&a.value.includes(e.activeTab)?e.activeTab:a.value[0]);return(c,d)=>{const u=M.NScrollbar,h=M.NTabPane,f=M.NTabs;return a.value.length>0?(n.openBlock(),n.createBlock(f,{key:0,value:l.value,"onUpdate:value":d[0]||(d[0]=m=>l.value=m),size:t.size,type:"line",class:"sc-product-info-content"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(h,{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,Hp)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(h,{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,Wp)]),_:1},8,["style"])]),_:1})):n.createCommentVNode("",!0),s.value.length>0?(n.openBlock(),n.createBlock(h,{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",jp,[(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,qp)]))),128))])]),_:1},8,["style"])]),_:1},8,["tab"])):n.createCommentVNode("",!0)]),_:1},8,["value","size"])):(n.openBlock(),n.createElementBlock("span",Xp," Описание, характеристики и файлы не заданы. "))}}}),Up={key:0,class:"flex flex-row gap-2.5"},Kp={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},Gp={},Ns=n.defineComponent({...Gp,__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),a=n.ref(r.processing),l=et.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=et.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)},h=(m="other",p=!1)=>{if(a.value&&!p){o("processing:cancel",_=>{a.value=_});return}let g=!1;o("closing",m,()=>{g=!0}),g||(s.value=!1,o("update:show",s.value))},f=()=>{o("accept",p=>{a.value=p})};return n.watch(()=>r.show,m=>{m?u():h("other",!0)}),n.watch(()=>r.processing,m=>{a.value=m}),e({open:u,close:h,acceptHandler:f}),(m,p)=>{const g=M.NButton,b=M.NModal;return n.openBlock(),n.createBlock(b,{loading:a.value,show:s.value,"show-icon":!1,size:n.unref(l),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=>h("header")),onEsc:p[2]||(p[2]=y=>h("esc")),onMaskClick:p[3]||(p[3]=y=>h("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",Up,[n.renderSlot(m.$slots,"extra-action")])):n.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(n.openBlock(),n.createElementBlock("div",Kp,[n.renderSlot(m.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(n.openBlock(),n.createBlock(g,{key:0,disabled:a.value||!t.valid,loading:a.value,size:n.unref(l),type:"primary",onClick:f},{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:a.value,size:n.unref(l),type:"default",onClick:p[0]||(p[0]=y=>h("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"])}}}),Zp={class:"flex flex-col gap-3"},Qp={class:"text-xs text-gray-500"},Jp={},Kl=n.defineComponent({...Jp,__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(Ns,{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",Zp,[n.createElementVNode("span",Qp,"Артикул: "+n.toDisplayString(t.product.code),1),n.createVNode(Bs,{product:t.product,"active-tab":t.activeTab,"max-height":"60vh"},null,8,["product","active-tab"])])]),_:1},8,["show","title"]))}}),eg={class:"flex flex-col gap-2"},tg={class:"flex justify-end border-0 border-t border-solid border-gray-200 pt-2"},ng={},Gl=n.defineComponent({...ng,__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,a)=>{const l=oo,c=M.NButton,d=M.NPopover;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(d,{show:e.value,"onUpdate:show":a[0]||(a[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(l,{title:"Описание и характеристики",class:"cursor-pointer"})])]),default:n.withCtx(()=>[n.createElementVNode("div",eg,[n.createVNode(Bs,{product:t.product,size:"small","max-height":"16rem"},null,8,["product"]),n.createElementVNode("div",tg,[n.createVNode(c,{text:"",type:"info",size:"small",onClick:o},{default:n.withCtx(()=>[...a[2]||(a[2]=[n.createTextVNode(" Открыть полностью ",-1)])]),_:1})])])]),_:3},8,["show"]),i.value?(n.openBlock(),n.createBlock(Kl,{key:0,show:r.value,"onUpdate:show":a[1]||(a[1]=u=>r.value=u),product:t.product},null,8,["show","product"])):n.createCommentVNode("",!0)],64)}}}),ig={class:"flex flex-row justify-between"},rg={key:0,class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},og={key:1},sg={class:"ml-2 align-sub"},ag={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},lg={key:2,class:"ml-2 align-sub"},cg={class:"@container"},dg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ug={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},fg={class:"text-sc-dark-grey"},hg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},mg={class:"text-gray-600"},pg={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},gg={key:3,class:"underline decoration-dashed"},yg={key:4,class:"sc-product-pack whitespace-nowrap"},bg={class:"text-gray-600"},_g={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},wg={class:"text-gray-600"},xg={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},kg={key:0},vg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Cg={},Br=n.defineComponent({...Cg,__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(()=>z.isFunction(i.showProductCosts)?i.showProductCosts(i.product):i.showProductCosts),o=n.computed(()=>z.sortBy(i.product.priceCoefficients,["coefficient.slug"])),s=n.computed(()=>{var f,m;return(m=(f=i.product)==null?void 0:f.properties)==null?void 0:m.planingIncomingDate}),a=n.useTemplateRef("image-gallery"),l=()=>{var f;(f=a.value)==null||f.show()},c=n.computed(()=>z.isFunction(i.allowNameClick)?i.allowNameClick(i.product):i.allowNameClick),d=n.computed(()=>(z.isFunction(i.showProductInfoButton)?i.showProductInfoButton(i.product):i.showProductInfoButton)&&zl(i.product)),u=n.computed(()=>{var f;return i.showProductAddToCartButton||i.showProductEditButton||i.showProductRequiredButton||(((f=i.productContextButtonsConfig)==null?void 0:f.length)??0)>0}),h=()=>{var f;c.value&&((f=i.eventEmitter)==null||f.emit("product:name-click",{product:i.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(f,m)=>{var w,S,v,$;const p=Np,g=M.NTooltip,b=jl,y=Cp,_=Xl,k=M.NText,x=ql,C=oo,T=M.NScrollbar;return n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",ig,[n.createVNode(k,{type:"info",class:"sc-product-name text-balance text-base font-medium text-black"},{default:n.withCtx(()=>{var E,F,P,I;return[(E=t.product)!=null&&E.isFavorite||(F=t.product)!=null&&F.isPreviouslyOrdered||t.showAdditionalSaleIcon?(n.openBlock(),n.createElementBlock("div",rg,[((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:h},n.toDisplayString(t.product.name),3),t.product.onOrder?(n.openBlock(),n.createElementBlock("span",og," [Под заказ] ")):n.createCommentVNode("",!0),n.createElementVNode("span",sg,[t.product.images&&t.product.images.length>0?(n.openBlock(),n.createBlock(Ul,{key:0,ref:"image-gallery",images:t.product.images},{default:n.withCtx(()=>[n.createElementVNode("div",ag,[n.createVNode(_)])]),_:1},8,["images"])):n.createCommentVNode("",!0)]),d.value?(n.openBlock(),n.createElementBlock("span",lg,[n.createVNode(Gl,{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",dg,[t.product.supplierSku?(n.openBlock(),n.createElementBlock("div",ug,[m[3]||(m[3]=n.createTextVNode(" Артикул производителя/поставщика: ",-1)),n.createElementVNode("span",fg,n.toDisplayString(t.product.supplierSku),1)])):n.createCommentVNode("",!0),t.showCode?(n.openBlock(),n.createElementBlock("span",hg,[m[4]||(m[4]=n.createTextVNode(" Артикул: ",-1)),n.createElementVNode("span",mg,n.toDisplayString(t.product.code),1)])):n.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(n.openBlock(),n.createBlock(Lp,{key:2,product:t.product},{default:n.withCtx(()=>[n.createElementVNode("span",pg,[m[5]||(m[5]=n.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),n.createVNode(C,{class:"mt-0.5"})])]),_:1},8,["product"])):(n.openBlock(),n.createElementBlock("span",gg," Нет в наличии ")),t.product.pack??((S=(w=t.product)==null?void 0:w.properties)==null?void 0:S.pack)?(n.openBlock(),n.createElementBlock("span",yg,[m[6]||(m[6]=n.createTextVNode(" Норма упаковки: ",-1)),n.createElementVNode("span",bg,n.toDisplayString(t.product.pack??(($=(v=t.product)==null?void 0:v.properties)==null?void 0:$.pack)),1)])):n.createCommentVNode("",!0),t.showPlanningDates&&s.value?(n.openBlock(),n.createElementBlock("span",_g,[m[7]||(m[7]=n.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),n.createElementVNode("span",wg,n.toDisplayString(s.value),1)])):n.createCommentVNode("",!0)])]),n.createVNode(T,{"x-scrollable":""},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",xg,[(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",kg,[n.createElementVNode("ul",vg,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.product.id,slug:t.product.slug},(E,F)=>(n.openBlock(),n.createElementBlock("li",{key:F}," ("+n.toDisplayString(F)+"): "+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,F)=>(n.openBlock(),n.createElementBlock("li",{key:F}," ("+n.toDisplayString(F)+"): "+n.toDisplayString(E),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)])}}}),Sg=(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})}),Bg=(t,e)=>{if(t.length===0)return[];const i=[],r={};switch(z.isNil(e.isProductItemSelected)||i.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,a;return n.h(M.NCheckbox,{checked:!!((s=e.isProductItemSelected)!=null&&s.call(e,o)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,o))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:o,checked:l})}})}}),et.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:i.push({key:"name",title:"Наименование",className:"align-top",render:o=>n.h(Br,{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(Br,{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&&(z.forEach(t,o=>{z.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),z.forEach(z.sortBy(r,["slug"]),o=>{i.push(Sg(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||!z.isNil(e.productContextButtonsConfig))&&i.push({key:"actions",title:"",className:"align-top",width:"50",render:o=>n.h(ql,{product:o,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return i},Ng={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Tg(t,e){return n.openBlock(),n.createElementBlock("svg",Ng,[...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 lo=n.markRaw({name:"ion-trash",render:Tg}),$g={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Eg(t,e){return n.openBlock(),n.createElementBlock("svg",$g,[...e[0]||(e[0]=[n.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Zl=n.markRaw({name:"ion-plus",render:Eg}),Rg={key:0,class:"flex w-fit items-center gap-2"},Pg={key:1,class:"flex flex-wrap gap-1"},Fg={key:0},Vg={key:2},Mg={},Nr=n.defineComponent({...Mg,__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=M.NSpin,a=M.NText;return t.isProductSearching?(n.openBlock(),n.createElementBlock("div",Rg,[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",Pg,[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",Fg,"(Планируемая дата производства: "+n.toDisplayString(i.value)+")",1)):n.createCommentVNode("",!0)])):t.validation?(n.openBlock(),n.createElementBlock("div",Vg,[n.createVNode(a,{type:t.validation.validationStatus},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):n.createCommentVNode("",!0)}}}),Ig={class:"flex flex-col gap-4"},Ag={class:"flex flex-col gap-2"},Og={class:"mt-8 font-bold"},zg={class:"grid grow grid-cols-2 items-start gap-2"},Dg={key:2,class:"text-red-500 text-sm"},Lg={key:3,class:"text-red-500 text-sm mb-2"},Hg={class:"flex flex-col gap-4"},Wg={key:1},jg={class:"text-lg font-semibold"},qg={class:"flex gap-3"},Xg={},Yg=n.defineComponent({...Xg,__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"),a=n.ref(!1),l=n.ref(z.cloneDeep(r.value)),c=n.computed(()=>{var _,k,x;const y={"configuratorParams.length":[le.required,le.min(r.settings.stripMinLength),le.max(r.settings.stripMaxLength||Number.MAX_VALUE),le.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[le.required,le.min(1),le.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 z.forEach(l.value.configuratorParams.linesWidths,(C,T)=>{var v;const S=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${T}`]=[le.required,le.min(S),le.max(r.settings.maxLineWidth),le.step(r.settings.lineWidthStep),We.serverValidation((v=r.validation[`lines_widths[${T+1}]`])==null?void 0:v.feedback)]}),z.forEach(l.value.configuratorParams.linesAngles,(C,T)=>{var w;y[`configuratorParams.linesAngles.${T}`]=[le.required,le.min(r.settings.minLineAngle),le.max(r.settings.maxLineAngle),le.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${T+1}]`])==null?void 0:w.feedback)]}),y}),d=n.ref(r.settings.canSetDopProdaga??!1),u=n.computed(()=>{var C;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,k=((C=l.value.product)==null?void 0:C.costRub)||0;if(!y||!_||k===0)return null;const x=y/1e3;return(k*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=n.computed(()=>z.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),f=n.computed(()=>{const y=h.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),m=n.computed(()=>{const{configuratorParams:y}=l.value,_=z.every(y.linesWidths,T=>!!(T&&T>0)),k=z.every(y.linesAngles,T=>!z.isNil(T)),x=!!(l.value.quantity&&l.value.quantity>0),C=y.length>0&&y.length>0;return _&&k&&x&&C&&f.value}),p=()=>{n.nextTick(()=>{var y;(y=s.value)==null||y.validate(_=>{_||(o("update:params",l.value.configuratorParams),g("configuratorParams",l.value.configuratorParams))}).catch(z.noop)})},g=(y,_)=>{const k=new q.OrderItemBase(l.value);k[y]=_,y==="configuratorParams"&&(k.product=new q.ClientProduct),o("update:value",k)};return n.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),n.watch(()=>r.value,y=>{l.value=z.cloneDeep(y)},{deep:!0}),e({validate:(b=s.value)==null?void 0:b.validate,formReference:s}),(y,_)=>{const k=Zl,x=lo,C=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var T;return[n.createElementVNode("div",Ig,[_[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(M.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),p],options:t.settings.startTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Ag,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value.configuratorParams.linesAngles,(w,S)=>(n.openBlock(),n.createElementBlock("div",{key:S,class:"flex items-start gap-2"},[n.createElementVNode("div",Og,n.toDisplayString(S+1),1),n.createElementVNode("div",zg,[n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.linesWidths.${S}`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.linesWidths[S],"onUpdate:value":[v=>l.value.configuratorParams.linesWidths[S]=v,_[2]||(_[2]=v=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=v=>n.unref(at)(v)),onInput:v=>n.unref(rt)(t.validation,`lines_widths[${S+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.linesAngles.${S}`,label:"Угол сгиба, °"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.linesAngles[S],"onUpdate:value":[v=>l.value.configuratorParams.linesAngles[S]=v,_[4]||(_[4]=v=>p())],parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=v=>n.unref(at)(v,!0)),onInput:v=>n.unref(rt)(t.validation,`lines_angles[${S+1}]`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(M.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(M.NButton),{key:0,size:"medium",onClick:v=>o("click:add-line",S)},{default:n.withCtx(()=>[n.createVNode(k)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:v=>o("click:remove-line",S)},{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(M.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),p],options:t.settings.endTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Nr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),f.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Dg," Суммарная ширина участков гиба должна быть от "+n.toDisplayString(t.settings.stripMinWidth)+" до "+n.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+n.toDisplayString(h.value)+" мм. ",1)),m.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Lg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((T=t.settings.allTemplates)==null?void 0:T.length)-1?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.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",Hg,[n.createVNode(n.unref(M.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),p],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),n.createVNode(n.unref(M.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.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(at)(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(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>g("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>n.unref(at)(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(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,g("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(C,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.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",Wg,[_[23]||(_[23]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",jg,n.toDisplayString(u.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",qg,[n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>o("submit",l.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",l.value)]])}}}),Ql=An(Yg,[["__scopeId","data-v-ac7f1192"]]);var Jl=Object.defineProperty,Ug=Object.defineProperties,Kg=Object.getOwnPropertyDescriptors,ec=Object.getOwnPropertySymbols,Gg=Object.prototype.hasOwnProperty,Zg=Object.prototype.propertyIsEnumerable,tc=t=>{throw TypeError(t)},Ts=(t,e,i)=>e in t?Jl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Tr=(t,e)=>{for(var i in e||(e={}))Gg.call(e,i)&&Ts(t,i,e[i]);if(ec)for(var i of ec(e))Zg.call(e,i)&&Ts(t,i,e[i]);return t},$s=(t,e)=>Ug(t,Kg(e)),nc=(t,e)=>{for(var i in e)Jl(t,i,{get:e[i],enumerable:!0})},B=(t,e,i)=>Ts(t,typeof e!="symbol"?e+"":e,i),ic=(t,e,i)=>e.has(t)||tc("Cannot "+i),Dt=(t,e,i)=>(ic(t,e,"read from private field"),i?i.call(t):e.get(t)),rc=(t,e,i)=>e.has(t)?tc("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Qg=(t,e,i,r)=>(ic(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}},oc={};nc(oc,{Curve:()=>Gi,getAnchorsFromArcData:()=>ty,getComponentOnCubicBezier:()=>$r,getControlPoints:()=>gc,getCurveBoundingBox:()=>hc,getCurveFromPoints:()=>pc,getCurveLength:()=>fc,getReflection:()=>Fs,integrate:()=>mc,subdivide:()=>Ps});var sc={};nc(sc,{HALF_PI:()=>dt,NumArray:()=>wn,TWO_PI:()=>tt,decomposeMatrix:()=>wi,getComputedMatrix:()=>Es,getEffectiveStrokeWidth:()=>xn,getPoT:()=>cc,lerp:()=>Ft,mod:()=>ot,setMatrix:()=>lc,toFixed:()=>ze});var Ue;typeof window<"u"?Ue=window:typeof global<"u"?Ue=global:typeof self<"u"&&(Ue=self);var ac,tt=Math.PI*2,dt=Math.PI*.5;function wi(t,e,i,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function lc(t){ac=t}function Es(t,e){e=e&&e.identity()||new ac;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 a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Ft(t,e,i){return i*(e-t)+t}var Rs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function cc(t){let e=0;for(;Rs[e]&&Rs[e]<t;)e++;return Rs[e]}function ot(t,e){for(;t<0;)t+=e;return t%e}var wn=Ue.Float32Array||Array,Jg=Math.floor;function ze(t){return Jg(t*1e6)/1e6}function xn(t,e){const i=t._linewidth;if(t.strokeAttenuation)return i;e||(e=t.worldMatrix||Es(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(){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 a=this._events[e];if(a){let l=[];if(i)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,i!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const 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(ee,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(ee,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var dc={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 br extends ee{constructor(e=0,i=0){super(),B(this,"_x",0),B(this,"_y",0);for(let r in dc)Object.defineProperty(this,r,dc[r]);this.x=e,this.y=i}static add(e,i){return new br(e.x+i.x,e.y+i.y)}static sub(e,i){return new br(e.x-i.x,e.y-i.y)}static subtract(e,i){return br.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],a=arguments[1]-arguments[3];return Math.atan2(a,s)}const r=e.x-i.x,o=e.y-i.y;return Math.atan2(o,r)}static distanceBetween(e,i){return Math.sqrt(br.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 br(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}};B(cn,"zero",new cn),B(cn,"left",new cn(-1,0)),B(cn,"right",new cn(1,0)),B(cn,"up",new cn(0,-1)),B(cn,"down",new cn(0,1));var re=cn,Te=class ys extends re{constructor(e=0,i=0,r=0,o=0,s=0,a=0,l=ie.move){super(e,i),B(this,"controls",{left:new re,right:new re}),B(this,"_command",ie.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 d in uc)Object.defineProperty(this,d,uc[d]);this.command=l,this.relative=!0;const c=ys.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(ee.Types.change,c),this.controls.right.set(s,a).addEventListener(ee.Types.change,c)}static makeBroadcast(e){return i;function i(){e._bound&&e.dispatchEvent(ee.Types.change)}}static fromObject(e){return new ys().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 ys().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())}},uc={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))}}},ey=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 ey++}},Gi={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 $r(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 Ps(t,e,i,r,o,s,a,l,c){c=c||Gi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Te(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=$r(f,t,i,o,a),p=$r(f,e,r,s,l);u.push(new Te(m,p))}return u}function fc(t,e,i,r,o,s,a,l,c){if(t===i&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(a-t),u=6*(t+o)-12*i,h=3*(i-t),f=9*(r-s)+3*(l-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+h,_=(f*b+m)*b+p;return Math.sqrt(y*y+_*_)}return mc(g,0,1,c||Gi.RecursionLimit)}function hc(t,e,i,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,b,y;for(let C=0;C<2;++C){if(C===0?(h=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*a,f=3*i-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;m=-f/h,0<m&&m<1&&c.push(m);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(p=(-h+y)/(2*u),0<p&&p<1&&c.push(p),g=(-h-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*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,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 mc(t,e,i,r){let o=Gi.abscissas[r-2],s=Gi.weights[r-2],a=.5*(i-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function pc(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],a=e?ot(o-1,i):Math.max(o-1,0),l=e?ot(o+1,i):Math.min(o+1,r),c=t[a],d=s,u=t[l];gc(c,d,u),d.command=o===0?ie.move:ie.curve}}function gc(t,e,i){const r=re.angleBetween(t,e),o=re.angleBetween(i,e);let s=re.distanceBetween(t,e),a=re.distanceBetween(i,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=dt:l-=dt,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Fs(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 ty(t,e,i,r,o,s,a){const l=kt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*s+o,h=i*Math.cos(u),f=r*Math.sin(u),m=new Te(h,f);m.command=ie.line}}var yc=Array.prototype.slice;function ny(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=yc.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=yc.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=!ny(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:Ue.performance&&Ue.performance.now?Ue.performance:Date},Ut={hasEventListeners:typeof Ue.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=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 a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Ue.setTimeout(d,l);e=a+l;function d(){o(a+l)}return c}return i}},Zi=Ue.document?Ue.document.createElement("div"):{};Zi.id="help-two-load",Object.defineProperty(Ut,"temp",{enumerable:!0,get:function(){return oe.isElement(Zi)&&!Ue.document.head.contains(Zi)&&(Zi.style.display="none",Ue.document.head.appendChild(Zi)),Zi}});var Lt=class extends Error{constructor(e){super(),B(this,"name","Two.js"),B(this,"message"),this.message=e}},iy=Ue.devicePixelRatio||1;function ry(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Vs(t){return iy/ry(t)}var co=class{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}},vt,ri=class extends Array{constructor(){super(),rc(this,vt,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,vt)}set _events(e){Qg(this,vt,e)}get _bound(){return Dt(this,vt)._bound}set _bound(e){Dt(this,vt)._bound=e}addEventListener(){var e;return(e=Dt(this,vt).addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=Dt(this,vt).on)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=Dt(this,vt).bind)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=Dt(this,vt).removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=Dt(this,vt).off)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=Dt(this,vt).unbind)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=Dt(this,vt).dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=Dt(this,vt).trigger)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=Dt(this,vt).listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=Dt(this,vt).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 a;i?a=e.call(i,s,o):a=e(s,o),r.push(a)}return r}};vt=new WeakMap;var bc=class sm extends ee{constructor(){super(),B(this,"_flagId",!1),B(this,"_flagClassName",!1),B(this,"_renderer",{}),B(this,"_id",kt.Identifier+kt.uniqueId()),B(this,"_className",""),B(this,"classList",[]);for(let e in _c)Object.defineProperty(this,e,_c[e])}static fromObject(e){const i=new sm().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}};B(bc,"Properties",["renderer","id","className"]);var Qi=bc,_c={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)}}},uo,wc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ue.document&&(uo=document.createElement("a"));var dn=class Jt extends Qi{constructor(e,i){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 r in xc)Object.defineProperty(this,r,xc[r]);if(this._renderer.type="texture",this._renderer.flagOffset=oy.bind(this),this._renderer.flagScale=sy.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 uo?(uo.href=e,uo.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?wc.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}};B(dn,"Properties",["src","loaded","repeat","scale","offset","image"]),B(dn,"RegularExpressions",wc),B(dn,"ImageRegistry",new co),B(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,xc={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 oy(){this._flagOffset=!0}function sy(){this._flagScale=!0}var Ms=class _n extends Qi{constructor(e,i,r){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 o in kc)Object.defineProperty(this,o,kc[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}};B(Ms,"Index",0),B(Ms,"Properties",["offset","opacity","color"]);var oi=Ms,kc={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)}}},Is=class Hi extends Qi{constructor(e){super(),B(this,"_flagStops",!1),B(this,"_flagSpread",!1),B(this,"_flagUnits",!1),B(this,"_spread",""),B(this,"_units","");for(let i in vc)Object.defineProperty(this,i,vc[i]);this._renderer.type="gradient",this._renderer.flagStops=ay.bind(this),this._renderer.bindStops=ly.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 Hi(i).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const i=this.stops.map(o=>o.clone()),r=new Hi(i);return oe.each(Hi.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let i=0;i<Hi.Properties.length;i++){const r=Hi.Properties[i];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(i=>i.toObject())};return oe.each(Hi.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}};B(Is,"Stop",oi),B(Is,"Properties",["spread","stops","units"]);var ut=Is,vc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,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 ay(){this._flagStops=!0}function ly(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 As=class Qr extends ut{constructor(e,i,r,o,s){super(s),B(this,"_flagEndPoints",!1),B(this,"_left",null),B(this,"_right",null);for(let a in Cc)Object.defineProperty(this,a,Cc[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=dy.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 Qr().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Qr.Properties.length;i++){const r=Qr.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 Qr(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}};B(As,"Stop",oi),B(As,"Properties",["left","right"]);var Ke=As,Cc={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 dy(){this._flagEndPoints=!0}var Os=class Wi extends ut{constructor(e,i,r,o,s,a){super(o),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 l in Sc)Object.defineProperty(this,l,Sc[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=uy.bind(this),this._renderer.flagFocal=fy.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 a=="number"&&(this.focal.y=a)}static fromObject(e){const i=new Wi().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Wi.Properties.length;i++){const r=Wi.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 Wi(this.center._x,this.center._y,this._radius,i,this.focal._x,this.focal._y);return oe.each(ut.Properties.concat(Wi.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return oe.each(Wi.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}};B(Os,"Stop",oi),B(Os,"Properties",["center","radius","focal"]);var Ge=Os,Sc={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 uy(){this._flagCenter=!0}function fy(){this._flagFocal=!0}function Bc(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 a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function fo(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 Nc(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),fc(r,l,o,c,s,d,a,u,i)}function zs(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Ps(r,l,o,c,s,d,a,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 Ke.fromObject(t);case"radial-gradient":return Ge.fromObject(t)}return t}var hy=Math.cos,my=Math.sin,Tc=Math.tan,Ds=[],$c=class en extends ee{constructor(e,i,r,o,s,a){super(),B(this,"elements",new wn(9)),B(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,i,r){if(i.length<=3){const T=e;let w,S,v;const $=i[0]||0,E=i[1]||0,F=i[2]||0;return w=T[0]*$+T[1]*E+T[2]*F,S=T[3]*$+T[4]*E+T[5]*F,v=T[6]*$+T[7]*E+T[8]*F,[w,S,v]}const o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],f=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],C=i[8];return r=r||new wn(9),r[0]=o*m+s*b+a*k,r[1]=o*p+s*y+a*x,r[2]=o*g+s*_+a*C,r[3]=l*m+c*b+d*k,r[4]=l*p+c*y+d*x,r[5]=l*g+c*_+d*C,r[6]=u*m+h*b+f*k,r[7]=u*p+h*y+f*x,r[8]=u*g+h*_+f*C,r}static fromObject(e){return new en().copy(e)}set(e,i,r,o,s,a,l,c,d){if(typeof i>"u"){const u=e;e=u[0],i=u[1],r=u[2],o=u[3],s=u[4],a=u[5],l=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]=a,this.elements[6]=l,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,a,l,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,h=[e,i,r,o,s,a,l,c,d],f=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],C=h[0],T=h[1],w=h[2],S=h[3],v=h[4],$=h[5],E=h[6],F=h[7],P=h[8];return this.elements[0]=f*C+m*S+p*E,this.elements[1]=f*T+m*v+p*F,this.elements[2]=f*w+m*$+p*P,this.elements[3]=g*C+b*S+y*E,this.elements[4]=g*T+b*v+y*F,this.elements[5]=g*w+b*$+y*P,this.elements[6]=_*C+k*S+x*E,this.elements[7]=_*T+k*v+x*F,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],a=i[3],l=i[4],c=i[5],d=i[6],u=i[7],h=i[8],f=h*l-c*u,m=-h*a+c*d,p=u*a-l*d;let g=r*f+o*m+s*p;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*o+s*u)*g,e.elements[2]=(c*o-s*l)*g,e.elements[3]=m*g,e.elements[4]=(h*r-s*d)*g,e.elements[5]=(-c*r+s*a)*g,e.elements[6]=p*g,e.elements[7]=(-u*r+o*d)*g,e.elements[8]=(l*r-o*a)*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=hy(e),r=my(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=Tc(e);return this.multiply(1,i,0,0,1,0,0,0,1)}skewY(e){const i=Tc(e);return this.multiply(1,0,0,i,1,0,0,0,1)}toString(e){return Ds.length=0,this.toTransformArray(e,Ds),Ds.map(ze).join(" ")}toTransformArray(e,i){const r=this.elements,o=!!i,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],m=r[8];if(o){i[0]=s,i[1]=c,i[2]=h,i[3]=a,i[4]=d,i[5]=f,i[6]=l,i[7]=u,i[8]=m;return}return[s,c,h,a,d,f,l,u,m]}if(o){i[0]=s,i[1]=c,i[2]=a,i[3]=d,i[4]=l,i[5]=u;return}return[s,c,a,d,l,u]}toArray(e,i){const r=this.elements,o=!!i,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],m=r[8];if(o){i[0]=s,i[1]=a,i[2]=l,i[3]=c,i[4]=d,i[5]=u,i[6]=h,i[7]=f,i[8]=m;return}return[s,a,l,c,d,u,h,f,m]}if(o){i[0]=s,i[1]=a,i[2]=l,i[3]=c,i[4]=d,i[5]=u;return}return[s,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new en().copy(this)}};B($c,"Identity",[1,0,0,0,1,0,0,0,1]);var ki=$c;lc(ki);var Ec=class El extends Qi{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 e in ho)Object.defineProperty(this,e,ho[e]);this._renderer.flagMatrix=Rc.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 El().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 ho.position.get.apply(this,arguments)}set translation(e){ho.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 a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();return l?e>=l.left-a&&e<=l.right+a&&i>=l.top-a&&i<=l.bottom+a:!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 El;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}};B(Ec,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var zn=Ec,ho={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),Rc.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 Es(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Rc(){this._flagMatrix=!0}var Pc=/^(?:none|transparent)$/i,py=8,Ls=Number.EPSILON;function Dn(t,e){return{x:t,y:e}}function mo(t,e,i=Ls){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function Fc(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 a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(a=-a),a}function gy(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,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let b=p*f+g*m,y=-g*f+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const A=Math.sqrt(x);r*=A,o*=A,_=r*r,k=o*o}const C=_*y*y+k*b*b,T=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,T));a===l&&(w=-w);const S=w*r*y/o,v=-w*o*b/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,F=Fc(1,0,(b-S)/r,(y-v)/o),P=Fc((b-S)/r,(y-v)/o,(-b-S)/r,(-y-v)/o)%tt,I=F+P,K=l===0,J=(()=>{const A=I-F,O=Math.abs(A)<Number.EPSILON;let V=ot(A,tt);return V<Number.EPSILON&&(V=O?0:tt),K&&!O&&(V=V===tt?-tt:V-tt),V})(),Z=Math.max(kt.Resolution,Math.max(i*2,1)),L=[];for(let A=1;A<=Z;A++){const O=A/Z,V=F+O*J;let R=$+r*Math.cos(V),H=E+o*Math.sin(V);if(s!==0){const Y=R-$,G=H-E,X=Math.cos(s),W=Math.sin(s);R=Y*X-G*W+$,H=Y*W+G*X+E}L.push(Dn(R,H))}return L}function yy(t,e=py){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 a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!mo(l,c)){const m=Dn(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&mo(l,c)&&i.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}mo(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?ie.move:ie.line);if(p===ie.move){u(!1);const g=Dn(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===ie.line)h(Dn(m.x,m.y));else if(p===ie.curve){const g=zs(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];h(Dn(y.x,y.y))}h(Dn(m.x,m.y))}else if(p===ie.arc){const g=gy(d,m,s);for(let b=0;b<g.length;b++)h(g[b])}else if(p===ie.close){u(!0),d=m;continue}else h(Dn(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!mo(l,c);u(f)}return{polygons:i,segments:r}}function by(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 a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function _y(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<Ls&&Math.abs(s)<Ls){const f=t-i.x,m=e-i.y;return f*f+m*m}const a=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=i.x+l*o,d=i.y+l*s,u=t-c,h=e-d;return u*u+h*h}function wy(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],a=_y(e,i,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function xy(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Pc.test(i):!0}function ky(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"?!Pc.test(r):!0}function vy(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&i>=a&&i<=l}var po=Number.EPSILON;function go(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)<po&&Math.abs(r)<po){go(t)?o[e].clear():o[e].set(t.x,t.y);return}go(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 Cy(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:go(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function Ji(t,e){const i=Cy(t,e);return Math.abs(i.x)>po||Math.abs(i.y)>po}function yo(t){t.command===ie.move||t.command===ie.close||(t.command=Ji(t,"left")||Ji(t,"right")?ie.curve:ie.line)}function Vc(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function Sy(t,e){return Ji(e,"right")||Ji(t,"left")||Ji(t,"right")||Ji(e,"left")||t.command===ie.curve||e.command===ie.curve}function er(t,e,i){return{x:Ft(t.x,e.x,i),y:Ft(t.y,e.y,i)}}function Mc(t,e){const i=t.controls&&t.controls[e];return i?go(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function By(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?Mc(t,"right"):Tr({},s),l={x:e.x,y:e.y},c=o?Mc(e,"left"):Tr({},l),d=er(s,a,i),u=er(a,c,i),h=er(c,l,i),f=er(d,u,i),m=er(u,h,i),p=er(f,m,i),g=new Te(p.x,p.y);return Vc(g,t),un(g,"left",f.x-p.x,f.y-p.y),un(g,"right",m.x-p.x,m.y-p.y),g.command=ie.curve,{anchor:g,startOut:d,endIn:h}}function Ny(t,e,i,r,o,s){const a=t.length,l=i-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-i-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=ot(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<b,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,F=S?2:s?0:1,P=v/g;g=k[w]=$-P,m=y[w]=E*f[w].x+F*f[w+1].x-P*m,p=_[w]=E*f[w].y+F*f[w+1].y-P*p}x[b]=y[b]/k[b],C[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[b])/2,C[c]=(3*f[c].y-C[b])/2;const T=c-h;for(let w=u,S=e;w<=T;w+=1,S+=1){const v=ot(S,a),$=t[v],E=x[w]-$.x,F=C[w]-$.y;o||w<T?un($,"right",E,F):Ht($,"right"),o||w>u?un($,"left",-E,-F):Ht($,"left"),yo($)}}function Ty(t,e,i,r,o,s){const a=e||t,l=t,c=i||t,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const b=2*g+3*m*f+p,y=3*m*(m+f);if(y!==0){const _=(g*a.x+b*l.x-p*c.x)/y-l.x,k=(g*a.y+b*l.y-p*c.y)/y-l.y;un(t,"left",_,k)}else Ht(t,"left")}else Ht(t,"left");if(!s&&i){const b=2*p+3*f*m+g,y=3*f*(f+m);if(y!==0){const _=(p*c.x+b*l.x-g*a.x)/y-l.x,k=(p*c.y+b*l.y-g*a.y)/y-l.y;un(t,"right",_,k)}else Ht(t,"right")}else Ht(t,"right");yo(t)}function $y(t,e,i,r,o,s){if(!(e&&i)){e||Ht(t,"left"),i||Ht(t,"right"),yo(t);return}const a=e,l=t,c=i,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;un(t,"left",m.x*p,m.y*p)}else Ht(t,"left");if(!s&&h!==0){const p=f*d/h-f;un(t,"right",m.x*p,m.y*p)}else Ht(t,"right");yo(t)}function Ey(t,e,i,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=ot(d,c),h=t[u];if(h.command===ie.move){Ht(h,"left"),Ht(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=f===null?null:t[ot(f,c)],g=m===null?null:t[ot(m,c)],b=f===null,y=m===null;a==="geometric"?$y(h,p,g,l,b,y):Ty(h,p,g,l,b,y)}}var tr=Math.min,nr=Math.max,Ry=Math.ceil,Py=Math.floor,Fy=new re,Vy=new ki,Hs=class gi extends zn{constructor(e,i,r,o){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 s in Ic)Object.defineProperty(this,s,Ic[s]);this._renderer.type="path",this._renderer.flagVertices=Ac.bind(this),this._renderer.bindVertices=Oc.bind(this),this._renderer.unbindVertices=zc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Lc.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($s(Tr({},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 Te?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new Te().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 a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=o,l.y-=s,l.x+=i,l.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,a,l,c=1/0,d=-1/0,u=1/0,h=-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:f,scaleY:m}=wi(i.elements[0],i.elements[3],i.elements[1],i.elements[4],i.elements[2],i.elements[5]);typeof f=="number"&&typeof m=="number"&&(r=Math.max(f,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++){l=this._renderer.vertices[s],a=this._renderer.vertices[(s+o-1)%o];const[f,m]=i.multiply(a.x,a.y),[p,g]=i.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,k]=i.multiply(b,y),x=l.controls.left.x,C=l.controls.left.y;l.relative&&(x+=l.x,C+=l.y);let[T,w]=i.multiply(x,C);const S=hc(f,m,_,k,T,w,p,g);u=tr(S.min.y-r,u),c=tr(S.min.x-r,c),d=nr(S.max.x+r,d),h=nr(S.max.y+r,h)}else s<=1&&(u=tr(m-r,u),c=tr(f-r,c),d=nr(f+r,d),h=nr(m+r,h)),u=tr(g-r,u),c=tr(p-r,c),d=nr(p+r,d),h=nr(g+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-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 a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();if(!l||e<l.left-a||e>l.right+a||i<l.top-a||i>l.bottom+a)return!1;const c=this.worldMatrix,d=c&&c.inverse(Vy);if(!d)return super.contains(e,i,o);const[u,h]=d.multiply(e,i,1),f=typeof o.precision=="number"&&!Number.isNaN(o.precision)?Math.max(1,Math.floor(o.precision)):8,m=xy(this,o.fill),p=ky(this,o.stroke),{polygons:g,segments:b}=yy(this,f);if(m&&g.length>0&&by(g,u,h))return!0;if(p&&b.length>0){const y=typeof this.linewidth=="number"?this.linewidth:0;if(y>0&&wy(b,u,h)<=y/2+a)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,a,l,c,d,u,h,f,m,p,g,b,y,_=this.length*Math.min(Math.max(e,0),1);const k=this.vertices.length,x=k-1;let C=null,T=null;for(let Z=0,L=this._lengths.length,A=0;Z<L;Z++){if(A+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)),C=this.vertices[r],T=this.vertices[o],_-=A,this._lengths[Z]!==0?e=_/this._lengths[Z]:e=0;break}A+=this._lengths[Z]}if(C===null||T===null)return null;if(C){if(!T)return C}else return T;y=T.controls&&T.controls.right,b=C.controls&&C.controls.left,l=T.x,f=T.y,c=(y||T).x,m=(y||T).y,d=(b||C).x,p=(b||C).y,u=C.x,g=C.y,y&&T.relative&&(c+=T.x,m+=T.y),b&&C.relative&&(d+=C.x,p+=C.y),a=$r(e,l,c,d,u),h=$r(e,f,m,p,g);const w=Ft(l,c,e),S=Ft(f,m,e),v=Ft(c,d,e),$=Ft(m,p,e),E=Ft(d,u,e),F=Ft(p,g,e),P=Ft(w,v,e),I=Ft(S,$,e),K=Ft(v,E,e),J=Ft($,F,e);return oe.isObject(i)?(i.x=a,i.y=h,i instanceof Te&&(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-=a,i.controls.left.y-=h,i.controls.right.x-=a,i.controls.right.y-=h)),i.t=e,i):(s=new Te(a,h,P-a,I-h,K-a,J-h,this._curved?ie.curve:ie.line),s.t=e,s)}plot(){if(this.curved)return pc(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 a=this._closed||s>0&&o[s-1]&&o[s-1].command===ie.close,l=(f,m)=>{if(f==null)return m;if(typeof f=="number"){if(a)return ot(f,s);let g=f;return g<0&&(g+=s),Math.min(Math.max(g,0),s-1)}const p=o.indexOf(f);return p!==-1?p:m},c=a&&i.from===void 0&&i.to===void 0;let d=l(i.from,0),u=l(i.to,s-1);if(d>u)if(a)d-=s;else{const f=d;d=u,u=f}const h=u-d+1;for(let f=0;f<h;f+=1){const m=ot(d+f,s),p=o[m],g=!a&&m===0;p.command===ie.move&&!g&&(p.command=ie.line)}if(r==="continuous"||r==="asymmetric")Ny(o,d,u,a,c,r==="asymmetric");else if(r==="catmull-rom"||r==="geometric"){const f={type:r,factor:i.factor};Ey(o,d,u,a,c,f)}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,a=null;for(let l=0;l<r;l+=1){const c=i[l];if(!s||c.command===ie.move){const u=c.clone();o.push(u),s=c,a=c;continue}if(Sy(c,s)){const h=zs(c,s,e).length,f=o[o.length-1];let m=f.clone(),p=c.clone(),g=f,b=0;if(h<=1){const y=c.clone();o.push(y)}else{for(let _=1;_<h;_+=1){const k=_/h,x=1-b,C=x<=Number.EPSILON?k:(k-b)/x,T=By(m,p,C);un(g,"right",T.startOut.x-g.x,T.startOut.y-g.y);const w=T.anchor;o.push(w),g=w,m=w.clone(),b=k,un(p,"left",T.endIn.x-p.x,T.endIn.y-p.y)}const y=c.clone();y.controls.left.copy(p.controls.left),o.push(y)}}else{const u=zs(c,s,e);for(let f=1;f<u.length;f+=1){const m=u[f];Vc(m,s),Ht(m,"left"),Ht(m,"right"),m.command=ie.line,o.push(m)}const h=c.clone();o.push(h)}s=c,c.command===ie.close&&(s=a)}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],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),oe.each(this.vertices,function(l,c){if(c<=0||l.command===ie.move){s=l,this._lengths[c]=0;return}this._lengths[c]=Nc(l,s,e),a+=this._lengths[c],s=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,i=this._closed,r=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),s=fo(this,r*this._length),a=fo(this,o*this._length),l=Ry(s),c=Py(a);let d,u,h,f,m,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Te),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,h=this._collection[p-1],h&&h.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),h.relative?this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(re.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(h,1-m.t))):p>=l&&p<=c&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===c&&Bc(this,o)?(u=m,!i&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===l&&Bc(this,r)&&(d=m,d.command=ie.move,!i&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(p=l-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,m),m.command=ie.move,this._renderer.vertices.unshift(m),f=this._collection[p+1],f&&f.controls&&(m.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(re.zero,m.t):(Fy.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,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}};B(Hs,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(Hs,"Utils",{getCurveLength:Nc});var Ee=Hs,Ic={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 Ke||this._fill instanceof Ge||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 Ke||this._fill instanceof Ge||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 Ke||this._stroke instanceof Ge||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 Ke||this._stroke instanceof Ge||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 Ac(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Oc(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function zc(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dc(){this._flagFill=!0}function Lc(){this._flagStroke=!0}var Hc=class Jr extends Ee{constructor(e,i,r,o){const s=[new Te,new Te,new Te,new Te];super(s,!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 Wc)Object.defineProperty(this,a,Wc[a]);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 Jr().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<Jr.Properties.length;i++){const r=Jr.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 Te),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 Jr(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<Ee.Properties.length;r++){const o=Ee.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}};B(Hc,"Properties",["width","height","origin"]);var si=Hc,Wc={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()}}},jc=class eo extends si{constructor(e,i,r,o,s,a){super(i,r,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 l in qc)Object.defineProperty(this,l,qc[l]);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 a=="number"&&(this.frameRate=a),this.index=0}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])}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 eo(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,a,l,c,d,u,h,f;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,h=e.image.height,o=u/i,s=h/r,l=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=l-1),a=oe.performance.now()-this._startTime,f=this._lastFrame+1,c=1e3*(f-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Ft(this._firstFrame,f,a/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+(h-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}};B(jc,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var bo=jc,qc={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}}},Ws,Xc=class extends ri{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),rc(this,Ws,{}),this.attach(e),this.on(ee.Types.insert,this.attach),this.on(ee.Types.remove,this.detach)}get ids(){return Dt(this,Ws)}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}};Ws=new WeakMap;var Yc=class ji extends Ee{constructor(e,i,r,o,s,a,l){const c=l||kt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Te);super(d,!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",tt),B(this,"_innerRadius",0),B(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Uc)Object.defineProperty(this,u,Uc[u]);typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.startAngle=s),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof i=="number"&&(this.translation.y=i)}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&&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),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,m,p,g,b,y,_,k;for(s?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(m=h/f,p=l[u],g=m*(i-e)+e,b=(i-e)/c,y=o*Math.cos(g),_=o*Math.sin(g),h){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),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++}if(a){for(s?(l[u].command=ie.close,u++):(c--,f=c-1),h=0;h<c;h++)m=h/f,p=l[u],g=(1-m)*(i-e)+e,b=(i-e)/c,y=r*Math.cos(g),_=r*Math.sin(g),d=ie.curve,h<=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),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=ie.line}else s||(l[u].command=ie.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[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,a=this.vertices.length,l=new ji(0,0,i,r,o,s,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Ee.Properties.length;c++){const d=Ee.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let i=0;i<ji.Properties.length;i++){const r=ji.Properties[i];e[r]=this[r]}return e}};B(Yc,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var js=Yc,Uc={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}}},qs=Math.cos,Xs=Math.sin,Kc=class qi extends Ee{constructor(e,i,r,o){const s=o?Math.max(o,2):4,a=[];for(let l=0;l<s;l++)a.push(new Te(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 l in Gc)Object.defineProperty(this,l,Gc[l]);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 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._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 l=s/e*tt,c=r*qs(l),d=r*Xs(l),u=o*qs(l-dt),h=o*Xs(l-dt),f=o*qs(l+dt),m=o*Xs(l+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const i=new qi(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<Ee.Properties.length;r++){const o=Ee.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<qi.Properties.length;i++){const r=qi.Properties[i];e[r]=this[r]}return e}};B(Kc,"Properties",["radius"]);var _o=Kc,Gc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Ys=Math.cos,Us=Math.sin,Zc=class Xi extends Ee{constructor(e,i,r,o,s){typeof o!="number"&&typeof r=="number"&&(o=r);const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Te);super(l,!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 c in Qc)Object.defineProperty(this,c,Qc[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 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._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 l=s/e*tt,c=r*Ys(l),d=o*Us(l),u=r*i*Ys(l-dt),h=o*i*Us(l-dt),f=r*i*Ys(l+dt),m=o*i*Us(l+dt),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,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 Xi(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 a=0;a<Ee.Properties.length;a++){const l=Ee.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let i=0;i<Xi.Properties.length;i++){const r=Xi.Properties[i];e[r]=this[r]}return e}};B(Zc,"Properties",["width","height"]);var wo=Zc,Qc={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}}},My=Math.ceil,Iy=Math.floor,Jc=class yi extends zn{constructor(e){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",Ee.prototype.noFill),B(this,"noStroke",Ee.prototype.noStroke),B(this,"corner",Ee.prototype.corner),B(this,"center",Ee.prototype.center),B(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect),B(this,"_updateLength",Ee.prototype._updateLength);for(let i in ed)Object.defineProperty(this,i,ed[i]);this._renderer.type="points",this._renderer.flagVertices=Ac.bind(this),this._renderer.bindVertices=Oc.bind(this),this._renderer.unbindVertices=zc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Lc.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($s(Tr({},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 Te?this.vertices.push(e.vertices[i].clone()):this.vertices.push(new Te().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 a=o.x,l=o.y,c=s.x,d=s.y,u=Ps(a,l,a,l,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=fo(this,e*this._length),o=fo(this,i*this._length),s=My(r),a=Iy(o);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=s&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};B(Jc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var Ks=Jc,ed={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 Ke||this._fill instanceof Ge||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 Ke||this._fill instanceof Ge||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 Ke||this._stroke instanceof Ge||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 Ke||this._stroke instanceof Ge||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}}},Ay=Math.cos,Oy=Math.sin,td=class Yi extends Ee{constructor(e,i,r,o){o=Math.max(o||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 s in nd)Object.defineProperty(this,s,nd[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 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||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,a=tt*s+Math.PI/2,l=this._width*Ay(a)/2,c=this._height*Oy(a)/2;o>=r?this.vertices.push(new Te(l,c)):this.vertices[o].set(l,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 Yi(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<Ee.Properties.length;r++){const o=Ee.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<Yi.Properties.length;i++){const r=Yi.Properties[i];e[r]=this[r]}return e}};B(td,"Properties",["width","height","sides"]);var Gs=td,nd={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}}},id=class Ui extends Ee{constructor(e,i,r,o,s){typeof s>"u"&&typeof r=="number"&&typeof o=="number"&&(s=Math.floor(Math.min(r,o)/12));const a=[];for(let l=0;l<10;l++)a.push(new Te(0,0,0,0,0,0,l===0?ie.move:ie.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 l in rd)Object.defineProperty(this,l,rd[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=zy.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,a=e/2,l=i/2;s=this.vertices[0],s.x=-(a-r),s.y=-l,s=this.vertices[1],s.x=a-r,s.y=-l,s.controls.left.clear(),s.controls.right.x=r,s.controls.right.y=0,s=this.vertices[2],s.x=a,s.y=-(l-o),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=a,s.y=l-o,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=o,s=this.vertices[4],s.x=a-r,s.y=l,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(a-r),s.y=l,s.controls.left.clear(),s.controls.right.x=-r,s.controls.right.y=0,s=this.vertices[6],s.x=-a,s.y=l-o,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-a,s.y=-(l-o),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-o,s=this.vertices[8],s.x=-(a-r),s.y=-l,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 a=0;a<Ee.Properties.length;a++){const l=Ee.Properties[a];s[l]=this[l]}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}};B(id,"Properties",["width","height","radius"]);var xo=id,rd={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 zy(){this._flagRadius=!0}var Dy=Math.cos,Ly=Math.sin,od=class Ki extends Ee{constructor(e,i,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=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 sd)Object.defineProperty(this,a,sd[a]);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 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._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,a=tt*s,l=(o%2?this._outerRadius:this._innerRadius)/2,c=l*Dy(a),d=l*Ly(a);o>=r?this.vertices.push(new Te(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 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 a=0;a<Ee.Properties.length;a++){const l=Ee.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let i=0;i<Ki.Properties.length;i++){const r=Ki.Properties[i];e[r]=this[r]}return e}};B(od,"Properties",["innerRadius","outerRadius","sides"]);var Zs=od,sd={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}}},Qs,ad=Math.min,ld=Math.max;Ue.document&&(Qs=document.createElement("canvas"));var Js=class tn extends zn{constructor(e,i,r,o){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 s in cd)Object.defineProperty(this,s,cd[s]);if(this._renderer.type="text",this._renderer.flagFill=Hy.bind(this),this._renderer.flagStroke=Wy.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 a=tn.Properties[s];a in o&&(this[a]=o[a])}}static Measure(e){if(Qs){const i=Qs.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($s(Tr({},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,a;this._update(!0),i=e?this.matrix:this.worldMatrix;const{width:l,height:c}=tn.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,o=l+d;break;case"right":r=-(l+d),o=d;break;default:r=-(l/2+d),o=l/2+d}switch(this.baseline){case"middle":s=-(c/2+d),a=c/2+d;break;default:s=-(c+d),a=d}const[u,h]=i.multiply(r,s),[f,m]=i.multiply(r,a),[p,g]=i.multiply(o,s),[b,y]=i.multiply(o,a);return s=ad(h,m,g,y),r=ad(u,f,p,b),o=ld(u,f,p,b),a=ld(h,m,g,y),{top:s,left:r,right:o,bottom:a,width:o-r,height:a-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}};B(Js,"Ratio",.6),B(Js,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var kn=Js,cd={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 Ke||this._fill instanceof Ge||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 Ke||this._fill instanceof Ge||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 Ke||this._stroke instanceof Ge||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 Ke||this._stroke instanceof Ge||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 Hy(){this._flagFill=!0}function Wy(){this._flagStroke=!0}var ea=class _r extends si{constructor(e,i,r,o){super(i,r,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 s in dd)Object.defineProperty(this,s,dd[s]);this._renderer.flagTextures=jy.bind(this),this._renderer.bindTextures=qy.bind(this),this._renderer.unbindTextures=Xy.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(ud.bind(this)):typeof e=="string"&&(this.textures=[ud(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=_r.DefaultFrameRate,this.index=0}static fromObject(e){const i=new _r().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<_r.Properties.length;i++){const r=_r.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 _r(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,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,oe.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=oe.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?o=o%a:o=Math.min(o,a),c=Ft(this._firstFrame,d,o/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(i=l.image.width,r=l.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof De))&&(l=e[this._index],l.loaded&&(i=l.image.width,r=l.image.height,this.width!==i&&(this.width=i),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};B(ea,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(ea,"DefaultFrameRate",30);var ta=ea,dd={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 jy(){this._flagTextures=!0}function qy(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Xy(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ud(t){if(t instanceof De)return t;if(typeof t=="string")return new De(t)}var ko=Math.min,vo=Math.max,Yy={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},na=class ln extends zn{constructor(e){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 i in fd)Object.defineProperty(this,i,fd[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++)hd.call(this,e[i],this)}static RemoveChildren(e){for(let i=0;i<e.length;i++)hd.call(this,e[i])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const i=new ln;for(let o=0;o<ln.Properties.length;o++){const s=ln.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 js.fromObject(o);case"circle":return _o.fromObject(o);case"element":return Qi.fromObject(o);case"ellipse":return wo.fromObject(o);case"group":return ln.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return ta.fromObject(o);case"path":return Ee.fromObject(o);case"points":return Ks.fromObject(o);case"polygon":return Gs.fromObject(o);case"rectangle":return si.fromObject(o);case"rounded-rectangle":return xo.fromObject(o);case"shape":return zn.fromObject(o);case"sprite":return bo.fromObject(o);case"star":return Zs.fromObject(o);case"text":return kn.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,a,l){const c=e&&e.children;if(!c)return!1;const d=i.results;for(let u=c.length-1;u>=0;u--){const h=c[u];if(!h||!ln.IsVisible(h,i.visibleOnly))continue;const f=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(f&&!vy(f,i.x,i.y,a))){if(h instanceof ln){if(r&&(!o||o(h))&&typeof h.contains=="function"&&h.contains(i.x,i.y,s)&&(d.push(h),l)||ln.VisitForHitTest(h,i,r,o,s,a,l))return!0;continue}if(h instanceof zn&&!(o&&!o(h))&&typeof h.contains=="function"&&h.contains(i.x,i.y,s)&&(d.push(h),l))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<ln.Properties.length;i++){const r=ln.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new ln,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:a,context:l,single:c,empty:d}=Yy.getShapesAtPoint;s.length=0;const u=o.mode==="deepest"||o.deepest?"deepest":"all",h=o.visibleOnly!==!1,f=!!o.includeGroups,m=typeof o.filter=="function"?o.filter:null,p=typeof o.tolerance=="number"?o.tolerance:0;typeof o.precision=="number"?a.precision=o.precision:delete a.precision,typeof o.fill<"u"?a.fill=o.fill:delete a.fill,typeof o.stroke<"u"?a.stroke=o.stroke:delete a.stroke,a.tolerance=p,a.ignoreVisibility=!h;const g=u==="deepest";if(l.x=e,l.y=i,l.visibleOnly=h,l.results=s,ln.VisitForHitTest(this,l,f,m,a,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 a=o.children[s];r(a)}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 a=o.children[s];r(a)}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 a=this.children.indexOf(s);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let i,r,o,s,a,l;this._update(!0);let c=1/0,d=-1/0,u=1/0,h=-1/0;const f=/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||f.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),a=typeof i.right!="number"||oe.isNaN(i.right)||!isFinite(i.right),l=typeof i.bottom!="number"||oe.isNaN(i.bottom)||!isFinite(i.bottom),!(o||s||a||l)))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),[C,T]=r.multiply(i.right,i.bottom);u=ko(b,_,x,T,u),c=ko(g,y,k,C,c),d=vo(g,y,k,C,d),h=vo(b,_,x,T,h)}else u=ko(i.top,u),c=ko(i.left,c),d=vo(i.right,d),h=vo(i.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-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),a=this.length;let l=0;const c=o*a,d=s*a;for(e=0;e<this.children.length;e++)r=this.children[e],i=r.length,c>l+i?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+i?(r.beginning=(c-l)/i,r.ending=1):d>l&&d<l+i?(r.beginning=0,r.ending=(d-l)/i):(r.beginning=0,r.ending=1),l+=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}};B(na,"Children",Xc),B(na,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var pt=na,fd={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 Xc(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 hd(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 Co=class extends Ee{constructor(e,i,r,o){const s=[new Te(e,i),new Te(r,o)];super(s);for(let a in md)Object.defineProperty(this,a,md[a]);this.vertices[0].command=ie.move,this.vertices[1].command=ie.line,this.automatic=!1}};B(Co,"Properties",["left","right"]);var md={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},Uy={start:"left",middle:"center",end:"right"},pd=["id","class","transform","xmlns","viewBox"],Ky=["x","y","width","height","href","xlink:href"];function Gy(t){return Uy[t]}function Zy(t){const e=t.getAttribute("dominant-baseline"),i=t.getAttribute("alignment-baseline");return e||i}function Er(t){return t.replace(/svg:/gi,"").toLowerCase()}function gd(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 Qy(t,e){e||(e={});const i=t.split(";");for(let r=0;r<i.length;r++){const o=i[r].split(":"),s=o[0],a=o[1];if(typeof s>"u"||typeof a>"u")continue;const l=s.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Jy(t){const e={},i=e0(t),r=Math.max(i.length,t.style.length);for(let o=0;o<r;o++){const s=t.style[o],a=i[o];s&&(e[s]=t.style[s]),a&&(e[a]=t.getAttribute(a))}return e}function e0(t){const e=t.getAttributeNames();for(let i=0;i<pd.length;i++){const r=pd[i],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function t0(t,e){const i=e.split(/[\s,]/),r=-parseFloat(i[0]),o=-parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);if(r&&o)for(let h=0;h<t.children.length;h++){const f=t.children[h];"translation"in f?f.translation.add(r,o):"x"in f?f.x=r:"y"in f&&(f.y=o)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(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/a),t.mask=new si(0,0,s,a),t.mask.origin.set(-s/2,-a/2),t}function nn(t,e,i){const r={},o={},s={};let a,l,c,d,u,h,f,m,p,g,b,y,_,k,x,C,T;if(t===null)return r;if(Ue.getComputedStyle){const w=Ue.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?Qy(h.value,s):o[h.nodeName]=h.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)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(f=wi(l),e._renderer.type){case"linear-gradient":gd(f,e.left),gd(f,e.right);break;case"radial-gradient":e.center.x+=f.translateX,e.center.y+=f.translateY,e.focal.x+=f.translateX,e.focal.y+=f.translateY,e.radius*=Math.max(f.scaleX,f.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;f=wi(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.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"),Ye.defs.current&&Ye.defs.current.contains(g)&&(y=Ye.defs.current.get(g),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=Er(y.nodeName),e.mask=Ye[_].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"),Ye.defs.current&&Ye.defs.current.contains(g)?(y=Ye.defs.current.get(g),y.object||(_=Er(y.nodeName),y.object=Ye[_].call(this,y,{})),y=y.object):(b=i0(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 Ke,C=e instanceof Ge,k||x||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(T=new Lt("only pixel values are supported with the "+c+" attribute."),console.warn(T.name,T.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof kn&&(e.family=d);break;case"font-size":e instanceof kn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(T=new Lt("only pixel values are supported with the "+c+" attribute."),console.warn(T.name,T.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof kn&&(e.weight=d);break;case"font-style":e instanceof kn&&(e.style=d);break;case"text-decoration":e instanceof kn&&(e.decoration=d);break;case"line-height":e instanceof kn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function n0(t,e){for(let i=0,r=t.childNodes.length;i<r;i++){const o=t.childNodes[i];!o.id||Er(t.nodeName)==="#text"||e.add(o.id,o)}}function i0(t){for(;t.parent;)t=t.parent;return t.scene}var Ye={svg:function(t){const e=Ye.defs.current=new co,i=t.getElementsByTagName("defs");for(let p=0;p<i.length;p++)n0(i[p],e);const r=Ye.g.call(this,t),o=t.getAttribute("viewBox"),s=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=o!==null,u=s!==null,h=a!==null,f=l!==null,m=c!==null;return u&&(r.x=parseFloat(s.replace(vn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(vn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(vn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(vn.unitSuffix,""))),d&&t0(r,o),delete Ye.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(!Ye.defs.current.contains(o))return i=new Lt("unable to find element for reference "+r+"."),console.warn(i.name,i.message),null;const a=Ye.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=Ky.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=Er(a.nodeName);return Ye[l].call(this,a,e)},g:function(t,e){const i=new pt;nn.call(this,t,i,e),this.add(i);const r=Jy.call(this,t);for(let o=0,s=t.childNodes.length;o<s;o++){const a=t.childNodes[o],l=a.nodeName;if(!l)return;const c=Er(l);if(c in Ye){const d=Ye[c].call(i,a,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,a,l){r.push(new Te(parseFloat(a),parseFloat(l)))});const o=new Ee(r,!0);return o.stroke="none",o.fill="black",nn.call(this,t,o,e),o},polyline:function(t,e){const i=Ye.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 l=new Te,c,d,u=i.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;oe.each(u.slice(0),function(f,m){const p=f.slice(1).trim().match(vn.path),g=f[0],b=g.toLowerCase();let y,_,k,x,C;const T=[];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,C=0;_<k;_+=y){if(x=g,C>0)switch(g){case"m":x="l";break;case"M":x="L";break}T.push(x+p.slice(_,_+y).join(" ")),C++}u=Array.prototype.concat.apply(u,T)}else u.push(f)}),oe.each(u,function(f,m){let p,g,b;const y=f[0],_=y.toLowerCase();d=f.slice(1).trim().match(vn.path),s=y===_;let k,x,C,T,w,S,v,$,E,F,P,I,K,J,Z,L,A;switch(_){case"z":if(m>=h)o=!0;else{g=l.x,b=l.y,p=new Te(g,b,void 0,void 0,void 0,void 0,ie.close);for(let O=r.length-1;O>=0;O--){const V=r[O];if(/m/i.test(V.command)){l=V;break}}}break;case"m":case"l":c=void 0,g=parseFloat(d[0]),b=parseFloat(d[1]),p=new Te(g,b,void 0,void 0,void 0,void 0,/m/i.test(_)?ie.move:ie.line),s&&p.addSelf(l),l=p;break;case"h":case"v":F=/h/i.test(_)?"x":"y",P=/x/i.test(F)?"y":"x",p=new Te(void 0,void 0,void 0,void 0,void 0,void 0,ie.line),p[F]=parseFloat(d[0]),p[P]=l[P],s&&(p[F]+=l[F]),l=p;break;case"c":case"s":k=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(C=parseFloat(d[0]),T=parseFloat(d[1]),w=parseFloat(d[2]),S=parseFloat(d[3]),v=parseFloat(d[4]),$=parseFloat(d[5])):(E=Fs(l,c,s),C=E.x,T=E.y,w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])),s&&(C+=k,T+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set(C-l.x,T-l.y),p=new Te(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"t":case"q":k=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(C=parseFloat(d[0]),T=parseFloat(d[1]),w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])):(E=Fs(l,c,s),C=E.x,T=E.y,w=E.x,S=E.y,v=parseFloat(d[0]),$=parseFloat(d[1])),s&&(C+=k,T+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set((C-l.x)*.33,(T-l.y)*.33),p=new Te(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"a":k=l.x,x=l.y,K=parseFloat(d[0]),J=parseFloat(d[1]),Z=parseFloat(d[2]),L=parseFloat(d[3]),A=parseFloat(d[4]),v=parseFloat(d[5]),$=parseFloat(d[6]),s&&(v+=k,$+=x),I=new Te(v,$),I.command=ie.arc,I.rx=K,I.ry=J,I.xAxisRotation=Z,I.largeArcFlag=L,I.sweepFlag=A,p=I,l=I,c=void 0;break}p&&(Array.isArray(p)?r=r.concat(p):r.push(p))})}i=new Ee(r,o,void 0,!0),i.stroke="none",i.fill="black";const a=i.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},oe.each(i.vertices,function(l){l.subSelf(a.centroid)}),nn.call(this,t,i,e),i.translation.addSelf(a.centroid),i},circle:function(t,e){const i=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("r")),s=new _o(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")),a=new wo(0,0,o,s);return a.stroke="none",a.fill="black",nn.call(this,t,a,e),a.translation.x=i,a.translation.y=r,a},rect:function(t,e){const i=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!oe.isNaN(i)||!oe.isNaN(r))return Ye["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=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+=a,c.translation.y+=l,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")),a=o/2,l=s/2,c=new re(i,r),d=new xo(0,0,o,s,c);return d.stroke="none",d.fill="black",nn.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,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")),a=new Co(i,r,o,s).noFill();return nn.call(this,t,a,e),a},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),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+o)/2,d=(l+s)/2;/userSpaceOnUse/i.test(i)&&(o-=c,s-=d,a-=c,l-=d);const u=[];for(let f=0;f<t.children.length;f++){const m=t.children[f];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 h=new Ke(o,s,a,l,u);return h.spread=r,h.units=i,nn.call(this,t,h,e),h},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,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));oe.isNaN(l)&&(l=o),oe.isNaN(c)&&(c=s);const d=Math.abs(o+l)/2,u=Math.abs(s+c)/2;/userSpaceOnUse/i.test(i)&&(o-=d,s-=u,l-=d,c-=u);const h=[];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),h.push(new oi(g,b,y))}const f=new Ge(o,s,a,h,l,c);return f.spread=r,f.units=i,nn.call(this,t,f,e),f},text:function(t,e){const i=Gy(t.getAttribute("text-anchor"))||"left",r=Zy(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new kn(o);return nn.call(this,t,s,e),s.alignment=i,s.baseline=r,s},clippath:function(t,e){return Ye.defs.current&&!Ye.defs.current.contains(t.id)&&Ye.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,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new bo(r,o,s);return oe.isNaN(a)||(c.width=a),oe.isNaN(l)||(c.height=l),nn.call(this,t,c,e),c}};function yd(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 ia=class In extends si{constructor(e,i,r,o,s,a){super(i,r,o||1,s||1),B(this,"_flagTexture",!1),B(this,"_flagMode",!1),B(this,"_texture",null),B(this,"_mode","fill"),this._renderer.type="image";for(let l in _d)Object.defineProperty(this,l,_d[l]);this.noStroke(),this.noFill(),e instanceof De?this.texture=e:typeof e=="string"&&(this.texture=new De(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const i=new In().copy(e);return"id"in e&&(i.id=e.id),i}copy(e){super.copy.call(this,e);for(let i=0;i<In.Properties.length;i++){const r=In.Properties[i];r in e&&(this[r]=e[r])}return this}clone(e){const i=new In(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,a=o/i,l=s/r;switch(this._mode){case In.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case In.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case In.Modes.crop:break;case In.Modes.tile:{e.offset.x=(i-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case In.Modes.stretch:default:e.scale=new re(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};B(ia,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),B(ia,"Properties",["texture","mode"]);var bd=ia,_d={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}}},ra=[],oa=Math.max,r0=Math.min,wd=Math.abs,So=Math.sin,Bo=Math.cos,o0=Math.acos,No=Math.sqrt,Pe={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 Pe?t:"path"},group:{renderChild:function(t){const e=Pe.getRendererType(t._renderer.type);Pe[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=To(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 a=Pe.getRendererType(r._renderer.type);Pe[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Pe.getRendererType(l._renderer.type);Pe[c].render.call(l,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,a,l,c,d,u,h,f,m,p,g,b,y,_,k,x,C,T,w,S,v,$,E,F,P,I,K,J,Z,L,A,O;if(O=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,K=this._mask,J=this._clip,l=this._opacity*(O||1),c=this._visible,!e&&(!c||J||l===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,d=this._cap,u=this._join,h=this._miter,f=this._closed,m=this._renderer.vertices,p=m.length,g=p-1,Z=To(r),A=this.dashes,Z||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),K){const j=Pe.getRendererType(K._renderer.type);Pe[j].render.call(K,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const j=Pe.getRendererType(a._renderer.type);Pe[j].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const j=Pe.getRendererType(o._renderer.type);Pe[j].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=xn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),A&&A.length>0&&(t.lineDashOffset=A.offset||0,t.setLineDash(A)),t.beginPath();let V,R,H,Y,G,X,W;for(let j=0;j<p;j++)switch(_=m[j],P=_.x,I=_.y,_.command){case ie.close:t.closePath();break;case ie.arc:V=_.rx,R=_.ry,H=_.xAxisRotation,Y=_.largeArcFlag,G=_.sweepFlag,b=f?ot(j-1,p):oa(j-1,0),y=m[b],X=y.x,W=y.y,Pe.renderSvgArcCommand(t,X,W,V,R,Y,G,H,P,I);break;case ie.curve:b=f?ot(j-1,p):Math.max(j-1,0),y=m[b],v=y.controls&&y.controls.right||re.zero,$=_.controls&&_.controls.left||re.zero,y._relative?(w=v.x+y.x,S=v.y+y.y):(w=v.x,S=v.y),_._relative?(C=$.x+_.x,T=$.y+_.y):(C=$.x,T=$.y),t.bezierCurveTo(w,S,C,T,P,I),j>=g&&f&&(k=x,E=_.controls&&_.controls.right||re.zero,F=k.controls&&k.controls.left||re.zero,_._relative?(w=E.x+_.x,S=E.y+_.y):(w=E.x,S=E.y),k._relative?(C=F.x+k.x,T=F.y+k.y):(C=F.x,T=F.y),P=k.x,I=k.y,t.bezierCurveTo(w,S,C,T,P,I));break;case ie.line:t.lineTo(P,I);break;case ie.move:x=_,t.moveTo(P,I);break}return f&&t.closePath(),!J&&!i&&(Pe.isHidden.test(a)||(L=a._renderer&&a._renderer.offset,L&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),L&&t.restore()),Pe.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(),A&&A.length>0&&t.setLineDash(ra),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,i){let r,o,s,a,l,c,d,u,h,f,m,p,g,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,g=To(r),y=this.dashes,d=this._size,g||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const C=Pe.getRendererType(a._renderer.type);Pe[C].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const C=Pe.getRendererType(o._renderer.type);Pe[C].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=xn(this))}typeof l=="number"&&(t.globalAlpha=l),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 C=0;C<h;C++)f=u[C],m=f.x,p=f.y,t.moveTo(m+k,p),t.arc(m,p,k,0,tt);return i||(Pe.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Pe.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(ra),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,a=this._mask,l=this._clip;if(!e&&(!s||l||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,h=this._fill,f=this._decoration,m=this._direction,p=To(c),g=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Pe.alignments[this._alignment]||this._alignment,_=Pe.baselines[this._baseline]||this._baseline;let k,x,C,T,w,S,v,$,E,F,P;if(p||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const I=Pe.getRendererType(a._renderer.type);Pe[I].render.call(a,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,h)if(typeof h=="string")t.fillStyle=h;else{const I=Pe.getRendererType(h._renderer.type);Pe[I].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const I=Pe.getRendererType(d._renderer.type);Pe[I].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=xn(this))}if(typeof o=="number"&&(t.globalAlpha=o),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!i&&(Pe.isHidden.test(h)||(h._renderer&&h._renderer.offset?(S=h._renderer.scale.x,v=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(S,v),k=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),C=h._renderer.offset.x/h._renderer.scale.x,T=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,C,T),t.restore()):t.fillText(this.value,0,0)),Pe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(S=d._renderer.scale.x,v=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(S,v),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(" "),C=d._renderer.offset.x/d._renderer.scale.x,T=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,C,T),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const I=t.measureText(this.value);let K=1;switch(f){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,F=I.width;break;case"right":case"end":$=-I.width,F=0;break;default:$=-I.width/2,F=I.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,E),t.lineTo(F,P),t.stroke()}return p||t.restore(),l&&!i&&t.clip(),b&&b.length>0&&t.setLineDash(ra),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,a=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,a=(a-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];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,a=this.focal._y,l=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,a=(a-.5)*i.height*.5,l*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return 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,a,l,c,d){l=l*Math.PI/180,r=wd(r),o=wd(o);const u=(e-c)/2,h=(i-d)/2,f=Bo(l)*u+So(l)*h,m=-So(l)*u+Bo(l)*h,p=f*f,g=m*m;let b=r*r,y=o*o;const _=p/b+g/y;if(_>1){const I=No(_);r=I*r,o=I*o,b=r*r,y=o*o}const k=b*g+y*p,x=(b*y-k)/k;let C=No(oa(0,x));s===a&&(C=-C);const T=C*r*m/o,w=-C*o*f/r,S=Bo(l)*T-So(l)*w+(e+c)/2,v=So(l)*T+Bo(l)*w+(i+d)/2,$=xd(1,0,(f-T)/r,(m-w)/o),E=xd((f-T)/r,(m-w)/o,(-f-T)/r,(-m-w)/o)%tt,F=$+E;s0(t,S,v,r,o,$,F,a===0,l)}},Ct=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"?Vs(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),Pe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};B(Ct,"Utils",Pe);function s0(t,e,i,r,o,s,a,l,c){const d=a-s,u=Gi.Tolerance.epsilon,h=Math.abs(d)<u;let f=ot(d,tt);f<u&&(h?f=0:f=tt),l===!0&&!h&&(f===tt?f=-tt:f=f-tt);for(let m=0;m<kt.Resolution;m++){const p=m/(kt.Resolution-1),g=s+p*f;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,C=y-i;b=x*_-C*k+e,y=x*k+C*_+i}t.lineTo(b,y)}}function xd(t,e,i,r){const o=t*i+e*r,s=No(t*t+e*e)*No(i*i+r*r);let a=o0(oa(-1,r0(1,o/s)));return t*r-e*i<0&&(a=-a),a}function To(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 a=0;a<i;a++){const l=t[a],c=e?ot(a-1,i):Math.max(a-1,0),d=t[c];let u,h,f,m,p,g,b,y,_,k,x,C,T,w,S,v=ze(l.x),$=ze(l.y);switch(l.command){case ie.close:u=ie.close;break;case ie.arc:x=l.rx,C=l.ry,T=l.xAxisRotation,w=l.largeArcFlag,S=l.sweepFlag,u=ie.arc+" "+x+" "+C+" "+T+" "+w+" "+S+" "+v+" "+$;break;case ie.curve:b=d.controls&&d.controls.right||re.zero,y=l.controls&&l.controls.left||re.zero,d.relative?(f=ze(b.x+d.x),m=ze(b.y+d.y)):(f=ze(b.x),m=ze(b.y)),l.relative?(p=ze(y.x+l.x),g=ze(y.y+l.y)):(p=ze(y.x),g=ze(y.y)),u=(a===0?ie.move:ie.curve)+" "+f+" "+m+" "+p+" "+g+" "+v+" "+$;break;case ie.move:o=l,u=ie.move+" "+v+" "+$;break;default:u=l.command+" "+v+" "+$}a>=r&&e&&(l.command===ie.curve&&(h=o,_=l.controls&&l.controls.right||l,k=h.controls&&h.controls.left||h,l.relative?(f=ze(_.x+l.x),m=ze(_.y+l.y)):(f=ze(_.x),m=ze(_.y)),h.relative?(p=ze(k.x+h.x),g=ze(k.y+h.y)):(p=ze(k.x),g=ze(k.y)),v=ze(h.x),$=ze(h.y),u+=" C "+f+" "+m+" "+p+" "+g+" "+v+" "+$),l.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,a=t[o].y-r;i+=ie.move+" "+s+" "+a+" ",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,a=`[fill="url(#${s})"],[stroke="url(#${s})"],[clip-path="url(#${s})"]`;t.querySelector(a)||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"]=xn(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,a=wi(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(a.scaleX,a.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"]=xn(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"]=xn(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],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,a):s._renderer.elem=ue.createElement("stop",a),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],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?ue.setAttributes(s._renderer.elem,a):s._renderer.elem=ue.createElement("stop",a),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()}}},kd=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}};B(kd,"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,30 +100,30 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},$o=ki.Multiply,a0=[1,0,0,0,1,0,0,0,1],ai=new wn(9),l0=Ct.Utils,vd=new re,sa=new wn([0,0,1,0,0,1,0,1,1,0,1,1]),Ce={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++)Ce.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 wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,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 a=Ct.Utils.getRendererType(this._mask._renderer.type);Ce[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=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++)Ce.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const a=this.children[s],l=Ct.Utils.getRendererType(a._renderer.type);Ce[l].render.call(a,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,a,l,c,d,u,h,f,m,p,g;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,k=t.renderer.ratio,x=vd.copy(e._renderer.scale).multiply(k),C=e._stroke,N=e._linewidth,w=e._fill,S=e._renderer.opacity||e._opacity,v=e._cap,$=e._join,E=e._miter,F=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 W=Ct.Utils.getRendererType(w._renderer.type);Ce[W].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const W=Ct.Utils.getRendererType(C._renderer.type);Ce[W].render.call(C,_,e),_.strokeStyle=C._renderer.effect}N&&(_.lineWidth=xn(e)),E&&(_.miterLimit=E),$&&(_.lineJoin=$),!F&&v&&(_.lineCap=v)}typeof S=="number"&&(_.globalAlpha=S),P&&P.length>0&&(_.lineDashOffset=P.offset||0,_.setLineDash(P));let A,O,V,R,H,U,G,X;_.save(),_.scale(x.x,x.y),_.translate(Z,L),_.beginPath();for(let W=0;W<b.length;W++){const j=b[W];switch(m=j.x,p=j.y,j.command){case ie.close:_.closePath();break;case ie.arc:O=j.rx,V=j.ry,R=j.xAxisRotation,H=j.largeArcFlag,U=j.sweepFlag,i=F?ot(W-1,I):Math.max(W-1,0),r=b[i],G=r.x,X=r.y,l0.renderSvgArcCommand(_,G,X,O,V,H,U,R,m,p);break;case ie.curve:i=F?ot(W-1,I):Math.max(W-1,0),r=b[i],d=r.controls&&r.controls.right||re.zero,u=j.controls&&j.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),j._relative?(s=u.x+j.x,a=u.y+j.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,m,p),W>=K&&F&&(o=A,h=j.controls&&j.controls.right||re.zero,f=o.controls&&o.controls.left||re.zero,j._relative?(l=h.x+j.x,c=h.y+j.y):(l=h.x,c=h.y),o._relative?(s=f.x+o.x,a=f.y+o.y):(s=f.x,a=f.y),m=o.x,p=o.y,_.bezierCurveTo(l,c,s,a,m,p));break;case ie.line:_.lineTo(m,p);break;case ie.move:A=j,_.moveTo(m,p);break}}F&&_.closePath(),Ce.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()),Ce.isHidden.test(C)||(g=C._renderer&&C._renderer.offset,g&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y),_.lineWidth=N/C._renderer.scale.x),_.stroke(),g&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,i){let r=1/0,o=-1/0,s=1/0,a=-1/0,l,c;t.forEach(function(d){const u=d.x,h=d.y,f=d.controls;let m,p,g,b,y,_;s=Math.min(h,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(h,a),d.controls&&(y=f.left,_=f.right,!(!y||!_)&&(m=d._relative?y.x+u:y.x,p=d._relative?y.y+h:y.y,g=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!m||!p||!g||!b)&&(s=Math.min(p,b,s),r=Math.min(m,g,r),o=Math.max(m,g,o),a=Math.max(p,b,a))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,a+=e),l=o-r,c=a-s,i.top=s,i.left=r,i.right=o,i.bottom=a,i.width=l,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=Ct.Utils.getRendererType(this._renderer.type),s=e[o],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof ze&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof ze&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let h,f;this._scale instanceof re?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=Ct.Utils.getRendererType(this._mask._renderer.type);Ce[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Ce.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Ce.updateTexture.call(Ce,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,sa,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,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._size*s;let f=h;Ce.isHidden.test(a)||(f+=l),r.width=cc(f),r.height=r.width;const m=f/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=Ct.Utils.getRendererType(c._renderer.type);Ce[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const b=Ct.Utils.getRendererType(a._renderer.type);Ce[b].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=xn(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(Ce.precision,Ce.precision),o.beginPath(),o.arc(0,0,h/m*.5,0,tt),o.restore(),closed&&o.closePath(),Ce.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()),Ce.isHidden.test(a)||(i=a._renderer&&a._renderer.offset,i&&(o.save(),o.translate(-a._renderer.offset.x,-a._renderer.offset.y),o.scale(a._renderer.scale.x,a._renderer.scale.y),o.lineWidth=l/a._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],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=o._matrix.manual||o._flagMatrix,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==o,f=this._renderer.vertices,m=this._renderer.collection.length,p=this._flagVertices,g=this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof ze&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof ze&&(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||h){this._renderer.matrix||(this._renderer.matrix=new wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,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,h&&(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,f,t.STATIC_DRAW)}return g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Ce.updateTexture.call(Ce,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:(Ce.isHidden.test(l)||(r+=c),r/=Ce.precision,a&&(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=vd.copy(e._renderer.scale).multiply(o),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,f=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,C,N,w,S,v,$;const E=c._renderer&&c._renderer.offset&&a._renderer&&a._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=f,c)if(typeof c=="string")r.fillStyle=c;else{const F=Ct.Utils.getRendererType(c._renderer.type);Ce[F].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const F=Ct.Utils.getRendererType(a._renderer.type);Ce[F].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=xn(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),Ce.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,N=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,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)),Ce.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,N=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,N),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,k=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,k),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const F=r.measureText(e.value);switch(h){case"underline":S=F.actualBoundingBoxDescent,$=F.actualBoundingBoxDescent;break;case"strikethrough":S=0,$=0;break}w=-F.width/2,v=F.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,S),r.lineTo(v,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const i=Ce.ctx;i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),i.textAlign="center",i.textBaseline=Ct.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&&!Ce.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(Ce.alignments[t._alignment]||t._alignment){case Ce.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Ce.alignments.right:t.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-a,e.right=a}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=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=o,e.height=s,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},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,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof ze&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof ze&&(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||a||l){this._renderer.matrix||(this._renderer.matrix=new wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,h;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=Ct.Utils.getRendererType(this._mask._renderer.type);Ce[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,Ce.text.getBoundingClientRect(this,this._renderer.rect),Ce.updateTexture.call(Ce,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,sa,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,a=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,a=(a-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];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,a=this.focal._y,l=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,a=(a-.5)*i.height*.5,l*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return 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=Ct.Utils.getRendererType(e._renderer.type);if(this[i].updateCanvas.call(Ce,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]=Ce.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new co};Ce.ctx=Ce.canvas.getContext("2d");var Cd=class extends ee{constructor(t){super();let e,i,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(Ce.canvas=t.offscreenElement,Ce.ctx=Ce.canvas.getContext("2d")),this.scene=new pt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new wn(a0),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=Ce.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Ce.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,sa,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=Ce.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"?Vs(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),Ce.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};B(Cd,"Utils",Ce);var c0=oe.extend({Error:Lt,getRatio:Vs,read:Ye,xhr:yd},oe,Pt,oc,sc),Be=class to{constructor(e){B(this,"_events",new ee),B(this,"type",""),B(this,"renderer",null),B(this,"scene",null),B(this,"width",0),B(this,"height",0),B(this,"frameCount",0),B(this,"timeDelta",0),B(this,"playing",!1);const i=oe.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:to.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=to.Types[r])}this.renderer=new to[this.type](this),this.setPlaying(i.autostart),this.frameCount=0,i.fullscreen?(this.fit=d0.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=u0.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,f0.bind(this)),this.scene=this.renderer.scene,to.Instances.push(this),i.autostart&&Rr.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,Rr.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 Co(e,i,r,o);return this.scene.add(s),s}makeArrow(e,i,r,o,s){const a=typeof s=="number"?s:10,l=Math.atan2(o-i,r-e),c=[new Ne(e,i,void 0,void 0,void 0,void 0,ie.move),new Ne(r,o,void 0,void 0,void 0,void 0,ie.line),new Ne(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ie.line),new Ne(r,o,void 0,void 0,void 0,void 0,ie.move),new Ne(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ie.line)],d=new Ee(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 a=new xo(e,i,r,o,s);return this.scene.add(a),a}makeCircle(e,i,r,o){const s=new _o(e,i,r,o);return this.scene.add(s),s}makeEllipse(e,i,r,o,s){const a=new wo(e,i,r,o,s);return this.scene.add(a),a}makeStar(e,i,r,o,s){const a=new Zs(e,i,r,o,s);return this.scene.add(a),a}makeCurve(e){const i=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<i;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new Ne(l,c))}}const r=arguments[i-1],o=new Ee(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 Gs(e,i,r,o);return this.scene.add(s),s}makeArcSegment(e,i,r,o,s,a,l){const c=new js(e,i,r,o,s,a,l);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 a=arguments[s];if(typeof a!="number")break;const l=arguments[s+1];r.push(new re(a,l))}}const o=new Ks(r);return this.scene.add(o),o}makePath(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<i;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new Ne(c,d))}}const o=arguments[i-1],s=new Ee(r,!(typeof o=="boolean"&&o)),a=s.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&s.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(s),s}makeText(e,i,r,o){const s=new kn(e,i,r,o);return this.add(s),s}makeLinearGradient(e,i,r,o){const s=Array.prototype.slice.call(arguments,4),a=new Ke(e,i,r,o,s);return this.add(a),a}makeRadialGradient(e,i,r){const o=Array.prototype.slice.call(arguments,3),s=new Ge(e,i,r,o);return this.add(s),s}makeSprite(e,i,r,o,s,a,l){const c=new bo(e,i,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,i,r,o,s,a){const l=new bd(e,i,r,o,s,a);return this.add(l),l}makeImageSequence(e,i,r,o,s){const a=new ta(e,i,r,o);return s&&a.play(),this.add(a),a}makeTexture(e,i){return new ze(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 Ye))return null;const s=Ye[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,a;const l=(function(c){for(Ut.temp.innerHTML=c,s=0;s<Ut.temp.children.length;s++)o=Ut.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);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)?(yd(e,l),r):(l(e),r)}};B(Be,"NextFrameId",kt.NextFrameId),B(Be,"Types",kt.Types),B(Be,"Version",kt.Version),B(Be,"PublishDate",kt.PublishDate),B(Be,"Identifier",kt.Identifier),B(Be,"Resolution",kt.Resolution),B(Be,"AutoCalculateImportedMatrices",kt.AutoCalculateImportedMatrices),B(Be,"Instances",kt.Instances),B(Be,"uniqueId",kt.uniqueId),B(Be,"Anchor",Ne),B(Be,"Collection",ri),B(Be,"Events",ee),B(Be,"Group",pt),B(Be,"Matrix",ki),B(Be,"Path",Ee),B(Be,"Registry",co),B(Be,"Element",Qi),B(Be,"Shape",zn),B(Be,"Text",kn),B(Be,"Vector",re),B(Be,"Gradient",ut),B(Be,"Image",bd),B(Be,"ImageSequence",ta),B(Be,"LinearGradient",Ke),B(Be,"RadialGradient",Ge),B(Be,"Sprite",bo),B(Be,"Stop",oi),B(Be,"Texture",ze),B(Be,"ArcSegment",js),B(Be,"Circle",_o),B(Be,"Ellipse",wo),B(Be,"Line",Co),B(Be,"Points",Ks),B(Be,"Polygon",Gs),B(Be,"Rectangle",si),B(Be,"RoundedRectangle",xo),B(Be,"Star",Zs),B(Be,"CanvasRenderer",Ct),B(Be,"SVGRenderer",kd),B(Be,"WebGLRenderer",Cd),B(Be,"Commands",ie),B(Be,"Utils",c0);var Cn=Be;function d0(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio)}function u0(){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 f0(t,e){this.width=t,this.height=e,this.trigger(ee.Types.resize,t,e)}var Rr=Ut.getRequestAnimationFrame();function Sd(){for(let t=0;t<Cn.Instances.length;t++){const e=Cn.Instances[t];e.playing&&e.update()}Cn.NextFrameId=Rr(Sd)}Rr.init=function(){Sd(),Rr.init=function(){}};let Sn;typeof window<"u"?Sn=window:typeof global<"u"?Sn=global:typeof self<"u"&&(Sn=self);let Bd;const Kt=Math.PI*2,gt=Math.PI*.5;function h0(t,e,i,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function m0(t){Bd=t}function p0(t,e){e=e&&e.identity()||new Bd;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 a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[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 Td=Sn.Float32Array||Array,g0=Math.floor;function Bn(t){return g0(t*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",arc:"A",close:"Z"};class ne{constructor(){T(this,"_events",{});T(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 a=this._events[e];if(a){let l=[];if(i)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,i!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const 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}}T(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),T(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Nd={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();T(this,"_x",0);T(this,"_y",0);for(let o in Nd)Object.defineProperty(this,o,Nd[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 a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}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:Bn(this.x),y:Bn(this.y)}}rotate(i){const r=this.x,o=this.y,s=Math.cos(i),a=Math.sin(i);return this.x=r*s-o*a,this.y=r*a+o*s,this}};T(_t,"zero",new _t),T(_t,"left",new _t(-1,0)),T(_t,"right",new _t(1,0)),T(_t,"up",new _t(0,-1)),T(_t,"down",new _t(0,1));let pe=_t;class Ie extends pe{constructor(i=0,r=0,o=0,s=0,a=0,l=0,c=fe.move){super(i,r);T(this,"controls",{left:new pe,right:new pe});T(this,"_command",fe.move);T(this,"_relative",!0);T(this,"_rx",0);T(this,"_ry",0);T(this,"_xAxisRotation",0);T(this,"_largeArcFlag",0);T(this,"_sweepFlag",1);for(let u in $d)Object.defineProperty(this,u,$d[u]);this.command=c,this.relative=!0;const d=Ie.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(ne.Types.change,d),this.controls.right.set(a,l).addEventListener(ne.Types.change,d)}static makeBroadcast(i){return r;function r(){i._bound&&i.dispatchEvent(ne.Types.change)}}static fromObject(i){return new Ie().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 Ie().copy(this)}toObject(){return{x:Bn(this.x),y:Bn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Bn(this.rx),ry:Bn(this.ry),xAxisRotation:Bn(this.xAxisRotation),largeArcFlag:Bn(this.largeArcFlag),sweepFlag:Bn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const $d={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 y0=0;const Eo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return y0++}},Ro={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 Po(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 Ed(t,e,i,r,o,s,a,l,c){c=c||Ro.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Ie(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=Po(f,t,i,o,a),p=Po(f,e,r,s,l);u.push(new Ie(m,p))}return u}function b0(t,e,i,r,o,s,a,l,c){if(t===i&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(a-t),u=6*(t+o)-12*i,h=3*(i-t),f=9*(r-s)+3*(l-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+h,_=(f*b+m)*b+p;return Math.sqrt(y*y+_*_)}return w0(g,0,1,c||Ro.RecursionLimit)}function _0(t,e,i,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,b,y;for(let C=0;C<2;++C){if(C===0?(h=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*a,f=3*i-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;m=-f/h,0<m&&m<1&&c.push(m);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(p=(-h+y)/(2*u),0<p&&p<1&&c.push(p),g=(-h-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*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,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 w0(t,e,i,r){let o=Ro.abscissas[r-2],s=Ro.weights[r-2],a=.5*(i-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function x0(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],a=e?jt(o-1,i):Math.max(o-1,0),l=e?jt(o+1,i):Math.min(o+1,r),c=t[a],d=s,u=t[l];k0(c,d,u),d.command=o===0?fe.move:fe.curve}}function k0(t,e,i){const r=pe.angleBetween(t,e),o=pe.angleBetween(i,e);let s=pe.distanceBetween(t,e),a=pe.distanceBetween(i,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=gt:l-=gt,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let Pr=(Oi=class extends ne{constructor(){super();T(this,"_flagId",!1);T(this,"_flagClassName",!1);T(this,"_renderer",{});T(this,"_id",Eo.Identifier+Eo.uniqueId());T(this,"_className","");T(this,"classList",[]);for(let i in Rd)Object.defineProperty(this,i,Rd[i])}static fromObject(i){const r=new Oi().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}},T(Oi,"Properties",["renderer","id","className"]),Oi);const Rd={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 Fo extends Error{constructor(i){super();T(this,"name","Two.js");T(this,"message");this.message=i}}class v0{constructor(){T(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 Vo;const Pd={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Sn.document&&(Vo=document.createElement("a"));const Qe=class Qe extends Pr{constructor(i,r){super();T(this,"_flagSrc",!1);T(this,"_flagImage",!1);T(this,"_flagVideo",!1);T(this,"_flagLoaded",!1);T(this,"_flagRepeat",!1);T(this,"_flagOffset",!1);T(this,"_flagScale",!1);T(this,"_src","");T(this,"_image",null);T(this,"_loaded",!1);T(this,"_repeat","no-repeat");T(this,"_scale",1);T(this,"_offset",null);for(let o in Fd)Object.defineProperty(this,o,Fd[o]);if(this._renderer.type="texture",this._renderer.flagOffset=C0.bind(this),this._renderer.flagScale=S0.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 Qe().copy(i);return"id"in i&&(r.id=i.id),r}static getAbsoluteURL(i){return Vo?(Vo.href=i,Vo.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=Qe.getAbsoluteURL(i);if(Qe.ImageRegistry.contains(r))return Qe.ImageRegistry.get(r);let o;return Sn.document?Pd.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=Qe.getTag(o);i._flagImage&&(/canvas/i.test(s)?Qe.Register.canvas(i,r):(i._src=o.getAttribute("two-src")||o.src,Qe.Register[s](i,r))),i._flagSrc&&(o||(o=Qe.getImage(i.src),i.image=o),s=Qe.getTag(o),Qe.Register[s](i,r))}clone(){const i=new Qe(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,Qe.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}};T(Qe,"Properties",["src","loaded","repeat","scale","offset","image"]),T(Qe,"RegularExpressions",Pd),T(Qe,"ImageRegistry",new v0),T(Qe,"Register",{canvas:function(i,r){i._src="#"+i.id,Qe.ImageRegistry.add(i.src,i.image),typeof r=="function"&&r()},img:function(i,r){const o=i.image,s=function(l){o.removeEventListener&&typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),new Fo("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",a,!1)),i._src=Qe.getAbsoluteURL(i._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",i.src),Qe.ImageRegistry.add(i.src,o),i.image.src=i.src)},video:function(i,r){const o=function(a){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(a){throw i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),new Fo("unable to load "+i.src)};i._src=Qe.getAbsoluteURL(i._src),i.image.getAttribute("two-src")||(i.image.setAttribute("two-src",i.src),Qe.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 Ze=Qe;const Fd={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=Ze.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}Ze.ImageRegistry.contains(i)?this._image=Ze.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 C0(){this._flagOffset=!0}function S0(){this._flagScale=!0}class vi extends Array{constructor(){super();$l(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){om(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 a=this[s];let l;r?l=i.call(r,a,s):l=i(a,s),o.push(l)}return o}}wt=new WeakMap;const Vd=Array.prototype.slice;function B0(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=Vd.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=Vd.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=!B0(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:Sn.performance&&Sn.performance.now?Sn.performance:Date},Yt=class Yt extends Pr{constructor(i,r,o){super();T(this,"_flagOffset",!0);T(this,"_flagOpacity",!0);T(this,"_flagColor",!0);T(this,"_offset",0);T(this,"_opacity",1);T(this,"_color","#fff");for(let s in Md)Object.defineProperty(this,s,Md[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}};T(Yt,"Index",0),T(Yt,"Properties",["offset","opacity","color"]);let Ci=Yt;const Md={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)}}},Pn=class Pn extends Pr{constructor(i){super();T(this,"_flagStops",!1);T(this,"_flagSpread",!1);T(this,"_flagUnits",!1);T(this,"_spread","");T(this,"_units","");for(let r in Id)Object.defineProperty(this,r,Id[r]);this._renderer.type="gradient",this._renderer.flagStops=T0.bind(this),this._renderer.bindStops=N0.bind(this),this._renderer.unbindStops=$0.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 Ci?s:new Ci().copy(s)));const o=new Pn(r).copy(i);return"id"in i&&(o.id=i.id),o}clone(i){const r=this.stops.map(s=>s.clone()),o=new Pn(r);return je.each(Pn.Properties,s=>{o[s]=this[s]},this),i&&i.add(o),o}copy(i){super.copy.call(this,i);for(let r=0;r<Pn.Properties.length;r++){const o=Pn.Properties[r];o in i&&(this[o]=i[o])}return this}toObject(){const i={stops:this.stops.map(r=>r.toObject())};return je.each(Pn.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}};T(Pn,"Stop",Ci),T(Pn,"Properties",["spread","stops","units"]);let ft=Pn;const Id={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 vi((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,i),e(this._stops)}}};function T0(){this._flagStops=!0}function N0(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function $0(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,a){super(a);T(this,"_flagEndPoints",!1);T(this,"_left",null);T(this,"_right",null);for(let l in Ad)Object.defineProperty(this,l,Ad[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=E0.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}};T(hi,"Stop",Ci),T(hi,"Properties",["left","right"]);let Vt=hi;const Ad={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 E0(){this._flagEndPoints=!0}const Fn=class Fn extends ft{constructor(i,r,o,s,a,l){super(s);T(this,"_flagRadius",!1);T(this,"_flagCenter",!1);T(this,"_flagFocal",!1);T(this,"_radius",0);T(this,"_center",null);T(this,"_focal",null);for(let c in Od)Object.defineProperty(this,c,Od[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=R0.bind(this),this._renderer.flagFocal=P0.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 a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(i){const r=new Fn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Fn.Properties.length;r++){const o=Fn.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 Fn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(ft.Properties.concat(Fn.Properties),function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return je.each(Fn.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}};T(Fn,"Stop",Ci),T(Fn,"Properties",["center","radius","focal"]);let Mt=Fn;const Od={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 R0(){this._flagCenter=!0}function P0(){this._flagFocal=!0}function zd(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 a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}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 Dd(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),b0(r,l,o,c,s,d,a,u,i)}function aa(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Ed(r,l,o,c,s,d,a,u,i)}function Si(t){switch(t.renderer.type){case"texture":return Ze.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 F0=Math.cos,V0=Math.sin,Ld=Math.tan,la=[],At=class At extends ne{constructor(i,r,o,s,a,l){super();T(this,"elements",new Td(9));T(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 S,v,$;const E=r[0]||0,F=r[1]||0,P=r[2]||0;return S=w[0]*E+w[1]*F+w[2]*P,v=w[3]*E+w[4]*F+w[5]*P,$=w[6]*E+w[7]*F+w[8]*P,[S,v,$]}const s=i[0],a=i[1],l=i[2],c=i[3],d=i[4],u=i[5],h=i[6],f=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],C=r[7],N=r[8];return o=o||new Td(9),o[0]=s*p+a*y+l*x,o[1]=s*g+a*_+l*C,o[2]=s*b+a*k+l*N,o[3]=c*p+d*y+u*x,o[4]=c*g+d*_+u*C,o[5]=c*b+d*k+u*N,o[6]=h*p+f*y+m*x,o[7]=h*g+f*_+m*C,o[8]=h*b+f*k+m*N,o}static fromObject(i){return new At().copy(i)}set(i,r,o,s,a,l,c,d,u){if(typeof r>"u"){const h=i;i=h[0],r=h[1],o=h[2],s=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[8]}return this.elements[0]=i,this.elements[1]=r,this.elements[2]=o,this.elements[3]=s,this.elements[4]=a,this.elements[5]=l,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,a,l,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,a=this.elements;const K=a[0]*i+a[1]*r+a[2]*o,J=a[3]*i+a[4]*r+a[5]*o,Z=a[6]*i+a[7]*r+a[8]*o;return[K,J,Z]}const h=this.elements,f=[i,r,o,s,a,l,c,d,u],m=h[0],p=h[1],g=h[2],b=h[3],y=h[4],_=h[5],k=h[6],x=h[7],C=h[8],N=f[0],w=f[1],S=f[2],v=f[3],$=f[4],E=f[5],F=f[6],P=f[7],I=f[8];return this.elements[0]=m*N+p*v+g*F,this.elements[1]=m*w+p*$+g*P,this.elements[2]=m*S+p*E+g*I,this.elements[3]=b*N+y*v+_*F,this.elements[4]=b*w+y*$+_*P,this.elements[5]=b*S+y*E+_*I,this.elements[6]=k*N+x*v+C*F,this.elements[7]=k*w+x*$+C*P,this.elements[8]=k*S+x*E+C*I,this.trigger(ne.Types.change)}inverse(i){const r=this.elements;i=i||new At;const o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=f*c-d*h,p=-f*l+d*u,g=h*l-c*u;let b=o*m+s*p+a*g;return b?(b=1/b,i.elements[0]=m*b,i.elements[1]=(-f*s+a*h)*b,i.elements[2]=(d*s-a*c)*b,i.elements[3]=p*b,i.elements[4]=(f*o-a*u)*b,i.elements[5]=(-d*o+a*l)*b,i.elements[6]=g*b,i.elements[7]=(-h*o+s*u)*b,i.elements[8]=(c*o-s*l)*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=F0(i),o=V0(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=Ld(i);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(i){const r=Ld(i);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(i){return la.length=0,this.toTransformArray(i,la),la.map(Bn).join(" ")}toTransformArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(i){const f=o[6],m=o[7],p=o[8];if(s){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=m,r[6]=c,r[7]=h,r[8]=p;return}return[a,d,f,l,u,m,c,h,p]}if(s){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(i){const f=o[6],m=o[7],p=o[8];if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=f,r[7]=m,r[8]=p;return}return[a,l,c,d,u,h,f,m,p]}if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new At().copy(this)}};T(At,"Identity",[1,0,0,0,1,0,0,0,1]);let ir=At;m0(ir);const Zr=class Zr extends Pr{constructor(){super();T(this,"_flagMatrix",!0);T(this,"_flagScale",!1);T(this,"_matrix",null);T(this,"_worldMatrix",null);T(this,"_position",null);T(this,"_rotation",0);T(this,"_scale",1);T(this,"_skewX",0);T(this,"_skewY",0);for(let i in Io)Object.defineProperty(this,i,Io[i]);this._renderer.flagMatrix=Hd.bind(this),this.isShape=!0,this.matrix=new ir,this.worldMatrix=new ir,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(i){const r=new Zr().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 Io.position.get.apply(this,arguments)}set translation(i){Io.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||{},a=s.ignoreVisibility===!0;if(!a&&"visible"in this&&this.visible===!1||!a&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();return c?i>=c.left-l&&i<=c.right+l&&r>=c.top-l&&r<=c.bottom+l:!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 Zr;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}};T(Zr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Tn=Zr;const Io={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),Hd.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 p0(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Hd(){this._flagMatrix=!0}const Wd=/^(?:none|transparent)$/i,M0=8,ca=Number.EPSILON;function Ln(t,e){return{x:t,y:e}}function Ao(t,e,i=ca){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function jd(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 a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(a=-a),a}function I0(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,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let b=p*f+g*m,y=-g*f+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const A=Math.sqrt(x);r*=A,o*=A,_=r*r,k=o*o}const C=_*y*y+k*b*b,N=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,N));a===l&&(w=-w);const S=w*r*y/o,v=-w*o*b/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,F=jd(1,0,(b-S)/r,(y-v)/o),P=jd((b-S)/r,(y-v)/o,(-b-S)/r,(-y-v)/o)%Kt,I=F+P,K=l===0,J=(()=>{const A=I-F,O=Math.abs(A)<Number.EPSILON;let V=jt(A,Kt);return V<Number.EPSILON&&(V=O?0:Kt),K&&!O&&(V=V===Kt?-Kt:V-Kt),V})(),Z=Math.max(Eo.Resolution,Math.max(i*2,1)),L=[];for(let A=1;A<=Z;A++){const O=A/Z,V=F+O*J;let R=$+r*Math.cos(V),H=E+o*Math.sin(V);if(s!==0){const U=R-$,G=H-E,X=Math.cos(s),W=Math.sin(s);R=U*X-G*W+$,H=U*W+G*X+E}L.push(Ln(R,H))}return L}function A0(t,e=M0){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 a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!Ao(l,c)){const m=Ln(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&Ao(l,c)&&i.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}Ao(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?fe.move:fe.line);if(p===fe.move){u(!1);const g=Ln(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===fe.line)h(Ln(m.x,m.y));else if(p===fe.curve){const g=aa(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];h(Ln(y.x,y.y))}h(Ln(m.x,m.y))}else if(p===fe.arc){const g=I0(d,m,s);for(let b=0;b<g.length;b++)h(g[b])}else if(p===fe.close){u(!0),d=m;continue}else h(Ln(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!Ao(l,c);u(f)}return{polygons:i,segments:r}}function O0(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 a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function z0(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<ca&&Math.abs(s)<ca){const f=t-i.x,m=e-i.y;return f*f+m*m}const a=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=i.x+l*o,d=i.y+l*s,u=t-c,h=e-d;return u*u+h*h}function D0(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],a=z0(e,i,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function L0(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Wd.test(i):!0}function H0(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"?!Wd.test(r):!0}function W0(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&i>=a&&i<=l}const Oo=Number.EPSILON;function zo(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)<Oo&&Math.abs(r)<Oo){zo(t)?o[e].clear():o[e].set(t.x,t.y);return}zo(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 j0(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:zo(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function rr(t,e){const i=j0(t,e);return Math.abs(i.x)>Oo||Math.abs(i.y)>Oo}function Do(t){t.command===fe.move||t.command===fe.close||(t.command=rr(t,"left")||rr(t,"right")?fe.curve:fe.line)}function qd(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function q0(t,e){return rr(e,"right")||rr(t,"left")||rr(t,"right")||rr(e,"left")||t.command===fe.curve||e.command===fe.curve}function or(t,e,i){return{x:Wt(t.x,e.x,i),y:Wt(t.y,e.y,i)}}function Xd(t,e){const i=t.controls&&t.controls[e];return i?zo(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function X0(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?Xd(t,"right"):{...s},l={x:e.x,y:e.y},c=o?Xd(e,"left"):{...l},d=or(s,a,i),u=or(a,c,i),h=or(c,l,i),f=or(d,u,i),m=or(u,h,i),p=or(f,m,i),g=new Ie(p.x,p.y);return qd(g,t),fn(g,"left",f.x-p.x,f.y-p.y),fn(g,"right",m.x-p.x,m.y-p.y),g.command=fe.curve,{anchor:g,startOut:d,endIn:h}}function Y0(t,e,i,r,o,s){const a=t.length,l=i-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-i-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=jt(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<b,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,F=S?2:s?0:1,P=v/g;g=k[w]=$-P,m=y[w]=E*f[w].x+F*f[w+1].x-P*m,p=_[w]=E*f[w].y+F*f[w+1].y-P*p}x[b]=y[b]/k[b],C[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[b])/2,C[c]=(3*f[c].y-C[b])/2;const N=c-h;for(let w=u,S=e;w<=N;w+=1,S+=1){const v=jt(S,a),$=t[v],E=x[w]-$.x,F=C[w]-$.y;o||w<N?fn($,"right",E,F):qt($,"right"),o||w>u?fn($,"left",-E,-F):qt($,"left"),Do($)}}function U0(t,e,i,r,o,s){const a=e||t,l=t,c=i||t,d=pe.distanceBetween(a,l),u=pe.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const b=2*g+3*m*f+p,y=3*m*(m+f);if(y!==0){const _=(g*a.x+b*l.x-p*c.x)/y-l.x,k=(g*a.y+b*l.y-p*c.y)/y-l.y;fn(t,"left",_,k)}else qt(t,"left")}else qt(t,"left");if(!s&&i){const b=2*p+3*f*m+g,y=3*f*(f+m);if(y!==0){const _=(p*c.x+b*l.x-g*a.x)/y-l.x,k=(p*c.y+b*l.y-g*a.y)/y-l.y;fn(t,"right",_,k)}else qt(t,"right")}else qt(t,"right");Do(t)}function K0(t,e,i,r,o,s){if(!(e&&i)){e||qt(t,"left"),i||qt(t,"right"),Do(t);return}const a=e,l=t,c=i,d=pe.distanceBetween(a,l),u=pe.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;fn(t,"left",m.x*p,m.y*p)}else qt(t,"left");if(!s&&h!==0){const p=f*d/h-f;fn(t,"right",m.x*p,m.y*p)}else qt(t,"right");Do(t)}function G0(t,e,i,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=jt(d,c),h=t[u];if(h.command===fe.move){qt(h,"left"),qt(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=f===null?null:t[jt(f,c)],g=m===null?null:t[jt(m,c)],b=f===null,y=m===null;a==="geometric"?K0(h,p,g,l,b,y):U0(h,p,g,l,b,y)}}const sr=Math.min,ar=Math.max,Z0=Math.ceil,Q0=Math.floor,J0=new pe,eb=new ir,pn=class pn extends Tn{constructor(i,r,o,s){super();T(this,"_flagVertices",!0);T(this,"_flagLength",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagCap",!0);T(this,"_flagJoin",!0);T(this,"_flagMiter",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_flagMask",!1);T(this,"_flagClip",!1);T(this,"_length",0);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_cap","round");T(this,"_join","round");T(this,"_miter",4);T(this,"_closed",!0);T(this,"_curved",!1);T(this,"_automatic",!0);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_mask",null);T(this,"_clip",!1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);for(let a in Yd)Object.defineProperty(this,a,Yd[a]);this._renderer.type="path",this._renderer.flagVertices=Ud.bind(this),this._renderer.bindVertices=Kd.bind(this),this._renderer.unbindVertices=Gd.bind(this),this._renderer.flagFill=Zd.bind(this),this._renderer.flagStroke=Qd.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 Ie?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ie().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,a=i.top+i.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=s,c.y-=a,c.x+=r,c.y+=o}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=r,this.mask.translation.y-=a,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 a=this.vertices[s];a.x-=r,a.y-=o}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getBoundingClientRect(i){let r,o,s,a,l,c,d=1/0,u=-1/0,h=1/0,f=-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}=h0(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(a=0;a<s;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+s-1)%s];const[m,p]=r.multiply(l.x,l.y),[g,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[k,x]=r.multiply(y,_),C=c.controls.left.x,N=c.controls.left.y;c.relative&&(C+=c.x,N+=c.y);let[w,S]=r.multiply(C,N);const v=_0(m,p,k,x,w,S,g,b);h=sr(v.min.y-o,h),d=sr(v.min.x-o,d),u=ar(v.max.x+o,u),f=ar(v.max.y+o,f)}else a<=1&&(h=sr(p-o,h),d=sr(m-o,d),u=ar(m+o,u),f=ar(p+o,f)),h=sr(b-o,h),d=sr(g-o,d),u=ar(g+o,u),f=ar(b+o,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}contains(i,r,o){const s=o||{},a=s.ignoreVisibility===!0;if(!a&&this.visible===!1||!a&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();if(!c||i<c.left-l||i>c.right+l||r<c.top-l||r>c.bottom+l)return!1;const d=this.worldMatrix,u=d&&d.inverse(eb);if(!u)return super.contains(i,r,s);const[h,f]=u.multiply(i,r,1),m=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,p=L0(this,s.fill),g=H0(this,s.stroke),{polygons:b,segments:y}=A0(this,m);if(p&&b.length>0&&O0(b,h,f))return!0;if(g&&y.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&D0(y,h,f)<=_/2+l)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,a,l,c,d,u,h,f,m,p,g,b,y,_,k=this.length*Math.min(Math.max(i,0),1);const x=this.vertices.length,C=x-1;let N=null,w=null;for(let L=0,A=this._lengths.length,O=0;L<A;L++){if(O+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),C)),N=this.vertices[o],w=this.vertices[s],k-=O,this._lengths[L]!==0?i=k/this._lengths[L]:i=0;break}O+=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,h=N.x,b=N.y,_&&w.relative&&(d+=w.x,p+=w.y),y&&N.relative&&(u+=N.x,g+=N.y),l=Po(i,c,d,u,h),f=Po(i,m,p,g,b);const S=Wt(c,d,i),v=Wt(m,p,i),$=Wt(d,u,i),E=Wt(p,g,i),F=Wt(u,h,i),P=Wt(g,b,i),I=Wt(S,$,i),K=Wt(v,E,i),J=Wt($,F,i),Z=Wt(E,P,i);return je.isObject(r)?(r.x=l,r.y=f,r instanceof Ie&&(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-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=i,r):(a=new Ie(l,f,I-l,K-f,J-l,Z-f,this._curved?fe.curve:fe.line),a.t=i,a)}plot(){if(this.curved)return x0(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,a=s.length;if(a<2)return this;const l=this._closed||a>0&&s[a-1]&&s[a-1].command===fe.close,c=(m,p)=>{if(m==null)return p;if(typeof m=="number"){if(l)return jt(m,a);let b=m;return b<0&&(b+=a),Math.min(Math.max(b,0),a-1)}const g=s.indexOf(m);return g!==-1?g:p},d=l&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),h=c(r.to,a-1);if(u>h)if(l)u-=a;else{const m=u;u=h,h=m}const f=h-u+1;for(let m=0;m<f;m+=1){const p=jt(u+m,a),g=s[p],b=!l&&p===0;g.command===fe.move&&!b&&(g.command=fe.line)}if(o==="continuous"||o==="asymmetric")Y0(s,u,h,l,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const m={type:o,factor:r.factor};G0(s,u,h,l,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 a=null,l=null;for(let c=0;c<o;c+=1){const d=r[c];if(!a||d.command===fe.move){const h=d.clone();s.push(h),a=d,l=d;continue}if(q0(d,a)){const f=aa(d,a,i).length,m=s[s.length-1];let p=m.clone(),g=d.clone(),b=m,y=0;if(f<=1){const _=d.clone();s.push(_)}else{for(let k=1;k<f;k+=1){const x=k/f,C=1-y,N=C<=Number.EPSILON?x:(x-y)/C,w=X0(p,g,N);fn(b,"right",w.startOut.x-b.x,w.startOut.y-b.y);const S=w.anchor;s.push(S),b=S,p=S.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 h=aa(d,a,i);for(let m=1;m<h.length;m+=1){const p=h[m];qd(p,a),qt(p,"left"),qt(p,"right"),p.command=fe.line,s.push(p)}const f=d.clone();s.push(f)}a=d,d.command===fe.close&&(a=l)}return this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(i,r){r||this._update();const s=this.vertices.length-1;let a=this.vertices[s],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),je.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Dd(c,a,i),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const i=this._collection.length,r=this._closed,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=Mo(this,o*this._length),l=Mo(this,s*this._length),c=Z0(a),d=Q0(l);let u,h,f,m,p,g;for(this._renderer.vertices.length=0,g=0;g<i;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Ie),g>d&&!h?(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),h=p,f=this._collection[g-1],f&&f.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),f.relative?this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(pe.zero,1-p.t):this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(f,1-p.t))):g>=c&&g<=d&&(p=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(p),g===d&&zd(this,s)?(h=p,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===c&&zd(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):(J0.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}};T(pn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),T(pn,"Utils",{getCurveLength:Dd});let Ae=pn;const Yd={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 Ze)&&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 Ze)&&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 Ze)&&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 Ze)&&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 vi?this._collection=t:this._collection=new vi(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 Ud(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Kd(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Gd(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Zd(){this._flagFill=!0}function Qd(){this._flagStroke=!0}const tb=Math.ceil,nb=Math.floor,Vn=class Vn extends Tn{constructor(i){super();T(this,"_flagVertices",!0);T(this,"_flagLength",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagSize",!0);T(this,"_flagSizeAttenuation",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_length",0);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_size",1);T(this,"_sizeAttenuation",!1);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);T(this,"noFill",Ae.prototype.noFill);T(this,"noStroke",Ae.prototype.noStroke);T(this,"corner",Ae.prototype.corner);T(this,"center",Ae.prototype.center);T(this,"getBoundingClientRect",Ae.prototype.getBoundingClientRect);T(this,"_updateLength",Ae.prototype._updateLength);for(let r in Jd)Object.defineProperty(this,r,Jd[r]);this._renderer.type="points",this._renderer.flagVertices=Ud.bind(this),this._renderer.bindVertices=Kd.bind(this),this._renderer.unbindVertices=Gd.bind(this),this._renderer.flagFill=Zd.bind(this),this._renderer.flagStroke=Qd.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 Vn().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 Ie?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ie().copy(o))}for(let r=0;r<Vn.Properties.length;r++){const o=Vn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Vn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Vn.Properties.length;o++){const s=Vn.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(Vn.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],a=this.vertices[o-1];if(!a)continue;const l=s.x,c=s.y,d=a.x,u=a.y,h=Ed(l,c,l,c,d,u,d,u,i);r=r.concat(h)}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=Mo(this,i*this._length),s=Mo(this,r*this._length),a=tb(o),l=nb(s);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};T(Vn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Lo=Vn;const Jd={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 Ze)&&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 Ze)&&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 Ze)&&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 Ze)&&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 vi?this._collection=t:this._collection=new vi(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 eu extends vi{constructor(i){i=Array.isArray(i)?i:Array.prototype.slice.call(arguments);super(i);$l(this,ms,{});this.attach(i),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return zt(this,ms)}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}}ms=new WeakMap;const Xn=class Xn extends Ae{constructor(i,r,o,s,a,l,c){const d=c||Eo.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Ie);super(u,!0,!1,!0);T(this,"_flagStartAngle",!1);T(this,"_flagEndAngle",!1);T(this,"_flagInnerRadius",!1);T(this,"_flagOuterRadius",!1);T(this,"_startAngle",0);T(this,"_endAngle",Kt);T(this,"_innerRadius",0);T(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in tu)Object.defineProperty(this,h,tu[h]);typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),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,a=jt(i,Kt)===jt(r,Kt),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,m,p,g,b,y,_,k,x;for(a?d--:l||(d-=2),f=0,m=d-1;f<d;f++){switch(p=f/m,g=c[h],b=p*(r-i)+i,y=(r-i)/d,_=s*Math.cos(b),k=s*Math.sin(b),f){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),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=fe.close,h++):(d--,m=d-1),f=0;f<d;f++)p=f/m,g=c[h],b=(1-p)*(r-i)+i,y=(r-i)/d,_=o*Math.cos(b),k=o*Math.sin(b),u=fe.curve,f<=0&&(u=a?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),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=fe.line}else a||(c[h].command=fe.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].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,a=this.endAngle,l=this.vertices.length,c=new Xn(0,0,r,o,s,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ae.Properties.length;d++){const u=Ae.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}};T(Xn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let da=Xn;const tu={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}}},ua=Math.cos,fa=Math.sin,Yn=class Yn extends Ae{constructor(i,r,o,s){const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ie(0,0,0,0,0,0));super(l,!0,!0,!0);T(this,"_flagRadius",!1);T(this,"_radius",0);this._renderer.type="circle";for(let c in nu)Object.defineProperty(this,c,nu[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 a=0;a<this.vertices.length;a++){const c=a/i*Kt,d=o*ua(c),u=o*fa(c),h=s*ua(c-gt),f=s*fa(c-gt),m=s*ua(c+gt),p=s*fa(c+gt),g=this.vertices[a];g.command=a===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(h,f),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<Ae.Properties.length;o++){const s=Ae.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}};T(Yn,"Properties",["radius"]);let ha=Yn;const nu={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ma=Math.cos,pa=Math.sin,Un=class Un extends Ae{constructor(i,r,o,s,a){typeof s!="number"&&typeof o=="number"&&(s=o);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Ie);super(c,!0,!0,!0);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_width",0);T(this,"_height",0);this._renderer.type="ellipse";for(let d in iu)Object.defineProperty(this,d,iu[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 a=0;a<this.vertices.length;a++){const c=a/i*Kt,d=o*ma(c),u=s*pa(c),h=o*r*ma(c-gt),f=s*r*pa(c-gt),m=o*r*ma(c+gt),p=s*r*pa(c+gt),g=this.vertices[a];g.command=a===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(h,f),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,a=new Un(0,0,r,o,s);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ae.Properties.length;l++){const c=Ae.Properties[l];a[c]=this[c]}return i&&i.add(a),a}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}};T(Un,"Properties",["width","height"]);let ga=Un;const iu={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}}},ib=Math.cos,rb=Math.sin,Kn=class Kn extends Ae{constructor(i,r,o,s){s=Math.max(s||0,3);super();T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_flagSides",!1);T(this,"_radius",0);T(this,"_width",0);T(this,"_height",0);T(this,"_sides",0);this._renderer.type="polygon";for(let a in ru)Object.defineProperty(this,a,ru[a]);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 a=(s+.5)/i,l=Kt*a+Math.PI/2,c=this._width*ib(l)/2,d=this._height*rb(l)/2;s>=o?this.vertices.push(new Ie(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<Ae.Properties.length;o++){const s=Ae.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}};T(Kn,"Properties",["width","height","sides"]);let ya=Kn;const ru={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}}},zi=class zi extends Ae{constructor(i,r,o,s){const a=[new Ie,new Ie,new Ie,new Ie];super(a,!0,!1,!0);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_width",0);T(this,"_height",0);T(this,"_origin",null);this._renderer.type="rectangle";for(let l in ou)Object.defineProperty(this,l,ou[l]);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 zi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<zi.Properties.length;r++){const o=zi.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 Ie),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 zi(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<Ae.Properties.length;o++){const s=Ae.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}};T(zi,"Properties",["width","height","origin"]);let Fr=zi;const ou={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 Ae{constructor(i,r,o,s,a){typeof a>"u"&&typeof o=="number"&&typeof s=="number"&&(a=Math.floor(Math.min(o,s)/12));const l=[];for(let c=0;c<10;c++)l.push(new Ie(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_flagRadius",!1);T(this,"_width",0);T(this,"_height",0);T(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in su)Object.defineProperty(this,c,su[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=ob.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof pe)&&(this.radius=a),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 a,l=i/2,c=r/2;a=this.vertices[0],a.x=-(l-o),a.y=-c,a=this.vertices[1],a.x=l-o,a.y=-c,a.controls.left.clear(),a.controls.right.x=o,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-s),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-s,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=s,a=this.vertices[4],a.x=l-o,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-o),a.y=c,a.controls.left.clear(),a.controls.right.x=-o,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-s,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-s),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-s,a=this.vertices[8],a.x=-(l-o),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(i){const r=this.width,o=this.height,s=this.radius,a=new Gn(0,0,r,o,s);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ae.Properties.length;l++){const c=Ae.Properties[l];a[c]=this[c]}return i&&i.add(a),a}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}};T(Gn,"Properties",["width","height","radius"]);let ba=Gn;const su={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 ob(){this._flagRadius=!0}const sb=Math.cos,ab=Math.sin,Zn=class Zn extends Ae{constructor(i,r,o,s,a){arguments.length<=3&&(s=o,o=s/2),(typeof a!="number"||a<=0)&&(a=5);super();T(this,"_flagInnerRadius",!1);T(this,"_flagOuterRadius",!1);T(this,"_flagSides",!1);T(this,"_innerRadius",0);T(this,"_outerRadius",0);T(this,"_sides",0);this._renderer.type="star";for(let l in au)Object.defineProperty(this,l,au[l]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof a=="number"&&(this.sides=a),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 a=(s+.5)/i,l=Kt*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*sb(l),u=c*ab(l);s>=o?this.vertices.push(new Ie(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,a=new Zn(0,0,r,o,s);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ae.Properties.length;l++){const c=Ae.Properties[l];a[c]=this[c]}return i&&i.add(a),a}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}};T(Zn,"Properties",["innerRadius","outerRadius","sides"]);let _a=Zn;const au={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 wa;const lu=Math.min,cu=Math.max;Sn.document&&(wa=document.createElement("canvas"));const Et=class Et extends Tn{constructor(i,r,o,s){super();T(this,"_flagValue",!0);T(this,"_flagFamily",!0);T(this,"_flagSize",!0);T(this,"_flagLeading",!0);T(this,"_flagAlignment",!0);T(this,"_flagBaseline",!0);T(this,"_flagStyle",!0);T(this,"_flagWeight",!0);T(this,"_flagDecoration",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagMask",!1);T(this,"_flagClip",!1);T(this,"_flagDirection",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_value","");T(this,"_family","sans-serif");T(this,"_size",13);T(this,"_leading",17);T(this,"_alignment","center");T(this,"_baseline","middle");T(this,"_style","normal");T(this,"_weight",500);T(this,"_decoration","none");T(this,"_direction","ltr");T(this,"_fill","#000");T(this,"_stroke","none");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_mask",null);T(this,"_clip",!1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);for(let a in du)Object.defineProperty(this,a,du[a]);if(this._renderer.type="text",this._renderer.flagFill=lb.bind(this),this._renderer.flagStroke=cb.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 a=0;a<Et.Properties.length;a++){const l=Et.Properties[a];l in s&&(this[l]=s[l])}}static Measure(i){if(wa){const r=wa.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,a,l;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":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,f]=r.multiply(o,a),[m,p]=r.multiply(o,l),[g,b]=r.multiply(s,a),[y,_]=r.multiply(s,l);return a=lu(f,p,b,_),o=lu(h,m,g,y),s=cu(h,m,g,y),l=cu(f,p,b,_),{top:a,left:o,right:s,bottom:l,width:s-o,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};T(Et,"Ratio",.6),T(Et,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let lr=Et;const du={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 Ze)&&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 Ze)&&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 Ze)&&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 Ze)&&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 lb(){this._flagFill=!0}function cb(){this._flagStroke=!0}const Qn=class Qn extends Fr{constructor(i,r,o,s){super(r,o,0,0);T(this,"_flagTextures",!1);T(this,"_flagFrameRate",!1);T(this,"_flagIndex",!1);T(this,"_amount",1);T(this,"_duration",0);T(this,"_index",0);T(this,"_startTime",0);T(this,"_playing",!1);T(this,"_firstFrame",0);T(this,"_lastFrame",0);T(this,"_loop",!0);T(this,"_textures",null);T(this,"_frameRate",0);T(this,"_origin",null);this._renderer.type="image-sequence";for(let a in uu)Object.defineProperty(this,a,uu[a]);this._renderer.flagTextures=db.bind(this),this._renderer.bindTextures=ub.bind(this),this._renderer.unbindTextures=fb.bind(this),this.noStroke(),this.noFill(),Array.isArray(i)?this.textures=i.map(fu.bind(this)):typeof i=="string"&&(this.textures=[fu(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,a,l,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?(a=this._amount,je.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=je.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?s=s%l:s=Math.min(s,l),d=Wt(this._firstFrame,u,s/l),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 Ze))&&(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}};T(Qn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),T(Qn,"DefaultFrameRate",30);let xa=Qn;const uu={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 vi((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 db(){this._flagTextures=!0}function ub(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fb(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fu(t){if(t instanceof Ze)return t;if(typeof t=="string")return new Ze(t)}const Di=class Di extends Fr{constructor(i,r,o,s,a,l){super(r,o,0,0);T(this,"_flagTexture",!1);T(this,"_flagColumns",!1);T(this,"_flagRows",!1);T(this,"_flagFrameRate",!1);T(this,"_flagIndex",!1);T(this,"_amount",1);T(this,"_duration",0);T(this,"_startTime",0);T(this,"_playing",!1);T(this,"_firstFrame",0);T(this,"_lastFrame",0);T(this,"_loop",!0);T(this,"_texture",null);T(this,"_columns",1);T(this,"_rows",1);T(this,"_frameRate",0);T(this,"_index",0);T(this,"_origin",null);this._renderer.type="sprite";for(let c in hu)Object.defineProperty(this,c,hu[c]);this.noStroke(),this.noFill(),i instanceof Ze?this.texture=i:typeof i=="string"&&(this.texture=new Ze(i)),this.origin=new pe,this._update(),typeof s=="number"&&(this.columns=s),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}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&&(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 Di(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,a,l,c,d,u,h,f,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)){h=i.image.width,f=i.image.height,s=h/r,a=f/o,c=this._amount,this.width!==s&&(this.width=s),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(je.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=je.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Wt(this._firstFrame,m,l/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+(h-s)/2,y=-a*g+(f-a)/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}};T(Di,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let ka=Di;const hu={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}}},Ho=Math.min,Wo=Math.max,hb={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},Ot=class Ot extends Tn{constructor(i){super();T(this,"_flagAdditions",!1);T(this,"_flagSubtractions",!1);T(this,"_flagOrder",!1);T(this,"_flagOpacity",!0);T(this,"_flagBeginning",!1);T(this,"_flagEnding",!1);T(this,"_flagLength",!1);T(this,"_flagMask",!1);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_cap","round");T(this,"_join","round");T(this,"_miter",4);T(this,"_closed",!0);T(this,"_curved",!1);T(this,"_automatic",!0);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_length",0);T(this,"_mask",null);T(this,"_strokeAttenuation",!0);for(let r in mu)Object.defineProperty(this,r,mu[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++)pu.call(this,i[r],this)}static RemoveChildren(i){for(let r=0;r<i.length;r++)pu.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 a=Ot.Properties[s];a in i&&(/(fill|stroke)/i.test(a)?r[a]=typeof i[a]=="string"?i[a]:Si(i[a]):r[a]=i[a])}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 da.fromObject(s);case"circle":return ha.fromObject(s);case"element":return Pr.fromObject(s);case"ellipse":return ga.fromObject(s);case"group":return Ot.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return xa.fromObject(s);case"path":return Ae.fromObject(s);case"points":return Lo.fromObject(s);case"polygon":return ya.fromObject(s);case"rectangle":return Fr.fromObject(s);case"rounded-rectangle":return ba.fromObject(s);case"shape":return Tn.fromObject(s);case"sprite":return ka.fromObject(s);case"star":return _a.fromObject(s);case"text":return lr.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,a,l,c){const d=i&&i.children;if(!d)return!1;const u=r.results;for(let h=d.length-1;h>=0;h--){const f=d[h];if(!f||!Ot.IsVisible(f,r.visibleOnly))continue;const m=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null;if(!(m&&!W0(m,r.x,r.y,l))){if(f instanceof Ot){if(o&&(!s||s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),c)||Ot.VisitForHitTest(f,r,o,s,a,l,c))return!0;continue}if(f instanceof Tn&&!(s&&!s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),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:a,hitOptions:l,context:c,single:d,empty:u}=hb.getShapesAtPoint;a.length=0;const h=s.mode==="deepest"||s.deepest?"deepest":"all",f=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"?l.precision=s.precision:delete l.precision,typeof s.fill<"u"?l.fill=s.fill:delete l.fill,typeof s.stroke<"u"?l.stroke=s.stroke:delete l.stroke,l.tolerance=g,l.ignoreVisibility=!f;const b=h==="deepest";if(c.x=i,c.y=r,c.visibleOnly=f,c.results=a,Ot.VisitForHitTest(this,c,m,p,l,g,b),b){if(a.length>0){const _=a[0];return a.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const y=a.slice();return a.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 a=this.children[s];a.isShape&&(a.translation.x-=r,a.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 a=0;a<s.children.length;a++)if(r=o(s.children[a]),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 a=0;a<s.children.length;a++){const l=s.children[a];o(l)}return r}return o(this)}getByType(i){const r=[];function o(s){if(s instanceof i&&r.push(s),s.children)for(let a=0;a<s.children.length;a++){const l=s.children[a];o(l)}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 a=i[s];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(i){let r,o,s,a,l,c;this._update(!0);let d=1/0,u=-1/0,h=1/0,f=-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),a=typeof r.left!="number"||je.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||je.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||je.isNaN(r.bottom)||!isFinite(r.bottom),!(s||a||l||c)))if(i){const[b,y]=o.multiply(r.left,r.top),[_,k]=o.multiply(r.right,r.top),[x,C]=o.multiply(r.left,r.bottom),[N,w]=o.multiply(r.right,r.bottom);h=Ho(y,k,C,w,h),d=Ho(b,_,x,N,d),u=Wo(b,_,x,N,u),f=Wo(y,k,C,w,f)}else h=Ho(r.top,h),d=Ho(r.left,d),u=Wo(r.right,u),f=Wo(r.bottom,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}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),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=s*l,u=a*l;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}};T(Ot,"Children",eu),T(Ot,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Hn=Ot;const mu={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 eu(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 pu(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 jo extends Ae{constructor(e,i,r,o){const s=[new Ie(e,i),new Ie(r,o)];super(s);for(let a in gu)Object.defineProperty(this,a,gu[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}T(jo,"Properties",["left","right"]);const gu={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 Fo("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 Fo("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class va{constructor(e=0,i=0){this.x=e,this.y=i}}class Nn{constructor(e=10,i=0,r="A"){T(this,"start",new va);T(this,"end",new va);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"}},mb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pb(t,e){return n.openBlock(),n.createElementBlock("svg",mb,[...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 qo=n.markRaw({name:"ion-close",render:pb}),gb={class:"mr-3 flex flex-col gap-2"},yb=["onClick"],bb={class:"h-full p-2"},_b={},wb=n.defineComponent({..._b,__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"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return n.onMounted(()=>{var c,d;(c=i.settings.templates)==null||c.forEach((u,h)=>{var m;const f=(m=o.value)==null?void 0:m.at(h);f&&a("init-draw-template",f,u)}),(d=i.settings.customTemplates)==null||d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.at(h);f&&a("init-draw-template",f,u)})}),n.watch(()=>[...i.settings.customTemplates],(c,d)=>{n.nextTick(()=>{c.forEach((u,h)=>{var f;if(!(d!=null&&d.includes(u))){const m=(f=s.value)==null?void 0:f.at(h);m&&a("init-draw-template",m,u)}}),d.length>c.length&&d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=qo;return n.openBlock(),n.createBlock(n.unref(M.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:n.withCtx(()=>[n.createElementVNode("div",gb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.settings.allTemplates,(h,f)=>(n.openBlock(),n.createElementBlock("div",{key:`${h.id}-${f}`,class:"group relative"},[n.createVNode(n.unref(M.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":f===t.selectTemplateIndex}]),onClick:m=>a("template:select",f)},[n.createElementVNode("div",bb,[n.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,yb)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:m=>l(f)},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):n.createCommentVNode("",!0)]))),128))])]),_:1})}}}),yu=An(wb,[["__scopeId","data-v-afccb364"]]),xb={class:"flex gap-3 min-w-[20rem] relative"},kb={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},vb={ref:"drawing-container",class:"size-full"},Cb={},bu=n.defineComponent({...Cb,__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=[],a=[],l=[],c=null;const d=.75,u=n.computed(()=>i.value.configuratorParams.linesAngles.map((L,A)=>new Nn(i.value.configuratorParams.linesWidths[A],L,`A-${A+1}`))),h=n.computed(()=>i.value.configuratorParams.colorSide==="bottom"),f=n.computed(()=>{var L,A;return i.value.configuratorParams.startTailType&&((L=i.settings.startTailConfigs)!=null&&L[i.value.configuratorParams.startTailType])?(A=i.settings.startTailConfigs)==null?void 0:A[i.value.configuratorParams.startTailType].points:[]}),m=n.computed(()=>{var A;const L=i.value.configuratorParams.endTailType!==void 0&&((A=i.settings.endTailConfigs)==null?void 0:A[i.value.configuratorParams.endTailType]);return!L||!L.points?[]:L.points.map((O,V)=>Array.isArray(O)?new Nn(O[0],O[1],`A-${V+1}`):new Nn(O.width,O.angle,`A-${V+1}`))}),p=(L,A=!1)=>{L[0].start.x=0,L[0].start.y=0;let O=0;for(let V=0;V<L.length;V++){const R=L[V],H=L[V-1]??new Nn(0,O);O+=!A||V>1?H.angle:0;const U=(!A||V>0?R.angle:0)+O;if(L[V].end.x=R.width*Math.cos(U*Math.PI/180)+L[V].start.x,L[V].end.y=R.width*Math.sin(U*Math.PI/180)+L[V].start.y,V<L.length-1){const G=V+1;L[G].start.x=L[V].end.x,L[G].start.y=L[V].end.y}}return L},g=(L,A,O,V,R=!1)=>{let H=p([...O,...V]);A.length>0&&(H=[...p(A),...H]);let U=0,G=0,X=0,W=0;H.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),W=Math.max(W,ve.start.y,ve.end.y)});let j,ae;U===0&&G===0&&X===0&&W===0?(j=1,ae=1):(j=L.width/Math.abs(X-U),ae=(R?L.height:L.height-qe.colorSideLabel.size)/Math.abs(W-G));const de=Math.min(j,ae);return U=U<0?-U*de:0,G=G<0?-G*de:0,[de,U,G]},b=L=>{const A=new Lo([L]);return A._size=qe.anchorPoint.size,A.fill=qe.anchorPoint.color,A.stroke="transparent",A._linewidth=qe.anchorPoint.strokeSize,l.push(A),A},y=(L,A)=>{if(l=[],i.settings.allowChangeFirstPoint){const O=L[0],V=new pe(O.vertices[0].x,O.vertices[0].y);V.bind(ne.Types.change,()=>{O.vertices[0].copy(V)});const R=b(V);A.add(R)}L.forEach((O,V)=>{const R=L[V+1],H=new pe(O.vertices[1].x,O.vertices[1].y);H.bind(ne.Types.change,()=>{O.vertices[1].copy(H),R!==void 0&&R.vertices[0].copy(H)});const U=b(H);A.add(U)})},_=L=>L*(Math.PI/180),k=(L,A,O)=>{const V=A.vertices.length-1;L.position.x=A.vertices[V].x,L.position.y=A.vertices[V].y;const R=Math.atan2(A.vertices[V].y-A.vertices[0].y,A.vertices[V].x-A.vertices[0].x);L.rotation=_(O)+R},x=(L,A,O)=>{if(A.vertices[0]===void 0)return;L.position.x=A.vertices[0].x,L.position.y=A.vertices[0].y;const V=A.vertices.length-1,R=Math.atan2(A.vertices[V].y-A.vertices[0].y,A.vertices[V].x-A.vertices[0].x);L.rotation=_(O)+R},C=(L,A,O)=>{const V=new Hn;if(L.length===0)return V;const R=[];return[...L].reverse().forEach((H,U)=>{U!==0&&H.angle>0&&(H.angle*=-1),R.push(H)}),L=p(R,!0),x(V,A,L[0].angle),[A.vertices[0],A.vertices[1]].forEach(H=>{H.bind(ne.Types.change,()=>{x(V,A,L[0].angle)})}),L.forEach(H=>{const U=H.start.x*O,G=H.end.x*O,X=H.start.y*O,W=H.end.y*O,j=new jo(U,X,G,W);j.linewidth=qe.line.size,j.stroke=qe.line.color,V.add(j)}),V},N=(L,A,O)=>{const V=new Hn;return L.length===0||(L=p(L,!0),k(V,A,L[0].angle),[A.vertices[0],A.vertices[1]].forEach(R=>{R.bind(ne.Types.change,()=>{k(V,A,L[0].angle)})}),L.forEach(R=>{const H=R.start.x*O,U=R.end.x*O,G=R.start.y*O,X=R.end.y*O,W=new jo(H,G,U,X);W.linewidth=qe.line.size,W.stroke=qe.line.color,V.add(W)})),V},w=(L,A,O,V)=>{const R=A.vertices[0].x+(A.vertices[1].x-A.vertices[0].x)/2-8*Math.sin(L.angle*Math.PI/180),H=A.vertices[0].y+(A.vertices[1].y-A.vertices[0].y)/2-8*Math.cos(L.angle*Math.PI/180),U=new lr(L.label,R+10,H-10);let G;U.size=qe.lineLabel.size,U.weight=600,U.fill=qe.lineLabel.color,U.id+=1,U.rotation=qe.lineLabel.rotation,V>0&&(G=new lr(`${L.angle}°`,A.vertices[0].x+25,A.vertices[0].y-25),G.size=qe.angleLabel.size,G.weight=600,G.fill=qe.angleLabel.color,G.rotation=qe.angleLabel.rotation,G.id+=V,s.push(G),O.add(G)),O.add(U),v(U,A,0,G),v(U,A,1)},S=()=>{const{size:L}=qe.colorSideLabel,A=0,O=0,V=h.value?L/2:L/2-L,R=h.value?L/2-L:L/2,H=new Hn;if(!c)return H;const U=5,G=Math.atan2(R-V,O-A),X=[new Ie(A,V,0,0,0,0,Cn.Commands.move),new Ie(O,R,0,0,0,0,Cn.Commands.line),new Ie(O-U*Math.cos(G-Math.PI/4),R-U*Math.sin(G-Math.PI/4),0,0,0,0,Cn.Commands.line),new Ie(O,R,0,0,0,0,Cn.Commands.move),new Ie(O-U*Math.cos(G+Math.PI/4),R-U*Math.sin(G+Math.PI/4),0,0,0,0,Cn.Commands.line)],W=new Ae(X,!1,!1,!0);W.noFill(),W.cap="round",W.join="round",W.linewidth=L/7,W.stroke=qe.colorSideLabel.color,H.add(W);const j=new lr(h.value?"Цвет снизу":"Цвет сверху",10,0);j.size=L,j.weight=600,j.fill=qe.colorSideLabel.color,j.alignment="left",H.add(j);const ae=H.getBoundingClientRect();return H.position.x=(c.width-ae.width)*d+10,H.position.y=h.value?c.height+ae.height*2:ae.height/2,H},v=(L,A,O,V)=>{A.vertices[O].bind(ne.Types.change,()=>{const R=A.vertices.length-1,H=Math.atan2(A.vertices[0].y-A.vertices[R].y,A.vertices[0].x-A.vertices[R].x)*180/Math.PI,U=A.vertices[0].x+(A.vertices[R].x-A.vertices[0].x)/2-8*Math.sin(H*Math.PI/180),G=A.vertices[0].y+(A.vertices[R].y-A.vertices[0].y)/2-8*Math.cos(H*Math.PI/180);L.position.x=U+10,L.position.y=G-10,L.rotation=-.5,V&&(V.position.x=A.vertices[0].x+25,V.position.y=A.vertices[0].y-25)})},$=(L,A,O,V,R=!1)=>{var st;if(L.clear(),O.length===0){L.update();return}const H=p(O),[U,G,X]=g(L,A,H,V,R),W=new Hn,j=new Array,ae=new Array;R||(s=[],a=[]),H.forEach((_e,we)=>{const xt=_e.start.x*U+G,$e=_e.end.x*U+G,Zt=_e.start.y*U+X,gn=_e.end.y*U+X,Rt=new jo(xt,Zt,$e,gn);Rt.linewidth=R?qe.previewLine.size:qe.line.size,Rt.stroke=R?qe.previewLine.color:qe.line.color,a.push(Rt),j.push(Rt),W.add(Rt),!R&&_e.label!==""&&w(_e,Rt,W,we)});const de=j.at(-1);let ve=W.getBoundingClientRect();if(!R){const _e=S();ae.push(_e)}if(A.length>0){const _e=C(A,j[0],U);W.add(_e)}if(V.length>0&&de){const _e=N(V,de,U);W.add(_e)}if(ae.push(W),L.makeGroup(ae),ve=W.getBoundingClientRect(),W.position.x=0-ve.left+(L.width-ve.width)/(2*(R?1:d)),W.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";W.position.y=W.position.y+qe.colorSideLabel.size*Number(_e),y(j,W),L.update()}},E=(L,A)=>{if(L&&!A.isNewRec()){const O=new Cn({width:L.scrollWidth,height:L.scrollHeight});O.appendTo(L),$(O,[],A.points,[],!0)}},F=()=>{c&&$(c,f.value,u.value,m.value,!1)},P=L=>L*(180/Math.PI),I=(L,A)=>{const O=L[1].x-L[0].x,V=L[1].y-L[0].y,R=A[1].x-A[0].x,H=A[1].y-A[0].y;let U=Math.atan2(O*H-V*R,O*R+V*H);return U=P(U),Math.round(U)*-1},K=L=>{const A=a.map((O,V,R)=>{const H=R[V-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let U=Math.ceil(O._length/L/i.settings.lineWidthStep)*i.settings.lineWidthStep;const G=s[V-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(O.vertices,H.vertices);return G&&(G.value=`${X}°`),new Nn(U,X,`A-${V+1}`)});r("pointer:move",A)},J=L=>{let A=null,O;const V=G=>{A=l.find(X=>{const W=X.renderer;return(W==null?void 0:W.elem)===G.target}),[O]=g(L,f.value,u.value.map(X=>X),m.value)},R=G=>{if(A){const X=A.renderer,W=X==null?void 0:X.elem;if(!W)return;const j=W.getBoundingClientRect();A.vertices[0].x-=j.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+qe.anchorPoint.size/2,A.vertices[0].y-=j.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+qe.anchorPoint.size/2,K(O),L.update()}},H=()=>{A&&r("pointer:up",u.value),A=null},U=o.value;U&&(U.addEventListener("touchstart",V,{passive:!0}),U.addEventListener("touchend",H,{passive:!0}),U.addEventListener("mousedown",V),U.addEventListener("mouseup",H),U.addEventListener("mousemove",R),U.addEventListener("touchmove",R,{passive:!0}))},Z=(L,A)=>{r("remove-custom-template",L,A)};return n.onMounted(()=>{o.value&&(c=new Cn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),n.watch(()=>i.value,()=>{F()},{deep:!0,immediate:!0}),J(c))}),n.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(L,A)=>(n.openBlock(),n.createElementBlock("div",xb,[n.createVNode(yu,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":A[0]||(A[0]=O=>r("template:select",O)),onInitDrawTemplate:E,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),n.createElementVNode("div",kb,[n.createElementVNode("div",vb,null,512)])]))}});class cr extends q.Identity{constructor(i,r){super();T(this,"label","");T(this,"points",[]);T(this,"isCustom",!1);T(this,"id",-1);T(this,"guid","");i?(this.label=i.label,this.points=i.points.map((o,s)=>z.isArray(o)?new Nn(o[0],o[1],`A-${s+1}`):new Nn(o.width,o.angle,`A-${s+1}`)),this.isCustom=i.isCustom):(this.label="-- Новая конфигурация --",this.points=[new Nn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Ca extends cr{constructor(i){super(i);T(this,"isDefault");this.isDefault=i.isDefault??!1}}class _u{constructor(e){T(this,"minLineWidth");T(this,"maxLineWidth");T(this,"lineWidthStep");T(this,"minLineAngle");T(this,"maxLineAngle");T(this,"lineAngleStep");T(this,"stripMinWidth");T(this,"stripMaxWidth");T(this,"stripMinLength");T(this,"stripMaxLength");T(this,"allowShowTable");T(this,"showOnlyTemplates");T(this,"templates");T(this,"customTemplates",[]);T(this,"startTailConfigs");T(this,"endTailConfigs");T(this,"bendCountForExtended");T(this,"extendedProductCatalog");T(this,"allowChangeFirstPoint");T(this,"allowSaveTemplates");T(this,"userTemplatesPrefix");T(this,"lengthStep");T(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 cr(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((i=e.startTailConfigs)==null?void 0:i.map(o=>new Ca(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Ca(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 a=new cr(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new cr({label:"-- Новая конфигурация --",points:[new Nn(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 cr(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 Sb={class:"flex flex-col gap-3"},Bb={class:"grid gap-5 md:grid-cols-5"},Tb={},wu=n.defineComponent({...Tb,__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),a=n.ref(!1),l=n.ref(i.cartItem),c=n.ref(new _u(i.settings)),d=n.ref({linesWidths:[...i.cartItem.configuratorParams.linesWidths],linesAngles:[...i.cartItem.configuratorParams.linesAngles]}),u=n.ref({quantity:{},marker:{},length:{}}),h=n.ref(0),f=n.useTemplateRef("kozyrek-configurator-params-form"),m=(v=0)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(v);$!==void 0&&(h.value=v,l.value.configuratorParams.linesWidths=$.points.map(F=>z.isArray(F)?F[0]:F.width),l.value.configuratorParams.linesAngles=$.points.map(F=>z.isArray(F)?F[1]:F.angle),k()),y(l.value.configuratorParams)},p=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const $={label:v,points:l.value.configuratorParams.linesWidths.map((F,P)=>[F,l.value.configuratorParams.linesAngles[P]])},E=F=>{F&&(c.value.addCustomTemplate($),h.value=c.value.allTemplates.length-2),a.value=!1};i.eventEmitter.emit("configurator:create-template",{category:i.cartItem.category,template:$,callback:E})},g=async(v,$)=>{var P;const E=(P=c.value.allTemplates)==null?void 0:P.at(v);if(!E||!E.isCustom)return;const F=I=>{I&&(c.value.removeCustomTemplate(E.id),m()),$==null||$()};i.eventEmitter.emit("configurator:remove-template",{category:i.cartItem.category,templateId:E.id,callback:F})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async v=>{var $,E;l.value.product=new q.ClientProduct,(E=($=f.value)==null?void 0:$.formReference)==null||E.validate(F=>{F||(k(),o.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:v,validationFieldResultData:u.value,callback:P=>{P?l.value.product=P:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(z.noop)},_=async()=>{var v,$;($=(v=f.value)==null?void 0:v.formReference)==null||$.validate(E=>{var F,P;if(!E){s.value=!0;const I=new q.OrderItemBase(l.value);(F=c.value.startTailConfigs)!=null&&F.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=f.value)==null?void 0:K.formReference)==null||J.restoreValidation()})})}}).catch(z.noop)},k=()=>{const v={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach(($,E)=>{v[`lines_widths[${E+1}]`]={},v[`lines_angles[${E+1}]`]={}}),u.value=v},x=v=>{d.value.linesWidths=v.map($=>$.width),d.value.linesAngles=v.map($=>$.angle)},C=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,k(),b(),y(l.value.configuratorParams)},N=(v,$)=>{d.value.linesWidths=v,d.value.linesAngles=$},w=v=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,E=0;l.value.configuratorParams.linesWidths.splice(v+1,0,$),l.value.configuratorParams.linesAngles.splice(v+1,0,E),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),b(),y(l.value.configuratorParams)},S=v=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(v,1),l.value.configuratorParams.linesAngles.splice(v,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),b(),y(l.value.configuratorParams))};return n.onMounted(()=>{i.cartItem.isNewRec()?m():(k(),h.value=-1,y(l.value.configuratorParams))}),n.watch(()=>i.cartItem,v=>{l.value=new q.OrderItemBase(v),v.isNewRec()?m():(k(),h.value=-1,y(l.value.configuratorParams))}),(v,$)=>{const E=M.NButton;return n.openBlock(),n.createElementBlock("div",Sb,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(E,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=F=>r("click:view-switch"))},{default:n.withCtx(()=>[...$[3]||($[3]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Bb,[n.createVNode(bu,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":C,"onPointer:move":x,"onTemplate:select":m,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),n.createVNode(Ql,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=F=>l.value=F),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":$[2]||($[2]=F=>y(F)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":p,"onClick:addLine":w,"onClick:removeLine":S},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),Nb={class:"flex flex-col items-center justify-between rounded-xl"},$b={class:"img-preview relative flex justify-center"},Eb={},Rb=n.defineComponent({...Eb,__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 z.keys(i.settings.crossbarCount).reverse().find(a=>s>=i.settings.crossbarCount[Number(a)])}),o=e;return(s,a)=>{const l=M.NButton;return n.openBlock(),n.createElementBlock("div",Nb,[n.createElementVNode("div",$b,[a[1]||(a[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(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>o("open-instructions"))},{default:n.withCtx(()=>[...a[2]||(a[2]=[n.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Sa=An(Rb,[["__scopeId","data-v-2a790a20"]]),Pb={key:0,class:"flex items-baseline gap-1"},Fb={key:0,class:"flex items-baseline gap-1"},Vb={key:1},Mb={class:"text-lg font-semibold"},Ib={key:2,class:"text-red-500 text-sm mb-2"},Ab={class:"flex gap-3"},Ob={},xu=n.defineComponent({...Ob,__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(()=>et.isPhoneDevice()),a=n.useTemplateRef("form-reference"),l=n.useTemplateRef("width-form-item-reference"),c=n.useTemplateRef("height-form-item-reference"),d=n.useTemplateRef("width-input-reference"),u=n.ref(z.cloneDeep(r.value)),h=n.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),f=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+h.value:0),b=n.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),y=n.ref(r.settings.canSetDopProdaga??!1),_=n.computed(()=>({"configuratorParams.width":[le.required,le.min(r.settings.minWidth-h.value),le.max(m.value-h.value),le.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[le.required,le.min(r.settings.minHeight-f.value),le.max(p.value-f.value),le.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[le.required,le.min(1),le.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),k=n.computed(()=>{var P;const S=g.value,v=b.value,{quantity:$}=r.value,E=((P=r.value.product)==null?void 0:P.costRub)||0;if(!S||!v||!$||E===0)return null;const F=S*v/1e6;return(E*$*F).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=n.computed(()=>{const S=g.value,v=b.value,$=!!(S&&S>=r.settings.minWidth&&S<=r.settings.maxWidths[u.value.configuratorParams.netType]),E=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[u.value.configuratorParams.netType]),F=!!(r.value.quantity&&r.value.quantity>0);return $&&E&&F}),C=(S,v)=>{var F,P;const $=u.value.configuratorParams;S&&S in $&&($[S]=v);const E={...$,width:g.value??0,height:b.value??0};S==="width"&&((F=l.value)==null||F.validate().catch(z.noop)),S==="height"&&((P=c.value)==null||P.validate().catch(z.noop)),n.nextTick(()=>{var K,J;!((K=l.value)!=null&&K.validationErrored)&&!((J=c.value)!=null&&J.validationErrored)&&E.height&&E.width&&o("update:params",E),N("configuratorParams",E)})},N=(S,v)=>{const $=new q.OrderItemBase(r.value);$[S]=v,S==="configuratorParams"&&($.product=new q.ClientProduct),o("update:value",$)};return n.watch(()=>r.value,S=>{const v=z.cloneDeep(n.toRaw(S)),$=v.configuratorParams.mountType,E=r.settings.widthOverlaps[$]??0,F=r.settings.heightOverlaps[$]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=E),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=F),u.value=v},{deep:!0,immediate:!0}),n.onMounted(()=>{var S;(S=d.value)==null||S.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(S,v)=>{const $=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=E=>u.value.configuratorParams.netType=E),v[1]||(v[1]=E=>C("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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=E=>u.value.configuratorParams.color=E),v[3]||(v[3]=E=>C("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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=E=>u.value.configuratorParams.mountType=E),v[5]||(v[5]=E=>C("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(M.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${m.value?" до "+(m.value-h.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",Pb,[n.createVNode(n.unref(M.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Ширина готового изделия "+n.toDisplayString(g.value),1)]),_:1}),n.createVNode(n.unref(M.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...v[25]||(v[25]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=E=>u.value.configuratorParams.width=E),v[9]||(v[9]=E=>C("width",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=E=>n.unref(at)(E)),onInput:v[8]||(v[8]=E=>n.unref(rt)(t.validation,"width")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(M.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${p.value?" до "+(p.value-f.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",Fb,[n.createVNode(n.unref(M.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Высота готового изделия "+n.toDisplayString(b.value),1)]),_:1}),n.createVNode(n.unref(M.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...v[26]||(v[26]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=E=>u.value.configuratorParams.height=E),v[14]||(v[14]=E=>C("height",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=E=>n.unref(at)(E)),onInput:v[13]||(v[13]=E=>n.unref(rt)(t.validation,"height")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[16]||(v[16]=E=>u.value.quantity=E),v[19]||(v[19]=E=>N("quantity",E??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=E=>n.unref(at)(E,!1)),onInput:v[18]||(v[18]=E=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=E=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":v[21]||(v[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":v[22]||(v[22]=E=>{u.value.isAdditionalSale=E??!1,N("isAdditionalSale",E??!1)})},{default:n.withCtx(()=>[...v[27]||(v[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",Vb,[v[28]||(v[28]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",Mb,n.toDisplayString(k.value)+" ₽",1)])):n.createCommentVNode("",!0),x.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Ib," Пожалуйста, заполните все обязательные поля корректно. ")),n.createElementVNode("div",Ab,[n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[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(M.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=E=>o("click:show-preview-drawer"))},{default:n.withCtx(()=>[...v[29]||(v[29]=[n.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):n.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",u.value)]])}}}),zb="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Db="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Lb="/img/configurators/mosquitto/measurement-instructions/mount.png",Hb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Wb="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",jb={class:"flex flex-col gap-6"},qb={class:"flex gap-4"},Xb={class:"flex flex-col gap-2"},Yb={class:"flex gap-4"},Ub={class:"flex flex-col gap-2"},Kb={class:"flex gap-4"},Gb={class:"flex flex-col gap-2"},Zb={},ku=n.defineComponent({...Zb,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const i=et.initRefDependingOnDeviceResolution("small","small","medium"),r=et.initRefDependingOnDeviceResolution(.98,.95,.8),o=n.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=M.NText;return n.openBlock(),n.createBlock(n.unref(M.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:l[0]||(l[0]=d=>s("update:show",!1)),onEsc:l[1]||(l[1]=d=>s("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>s("update:show",!1))},{default:n.withCtx(()=>[n.createElementVNode("div",jb,[n.createVNode(c,{type:"error",class:"text-base font-medium"},{default:n.withCtx(()=>[...l[3]||(l[3]=[n.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[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:zb,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:Db,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",qb,[l[9]||(l[9]=n.createElementVNode("img",{src:Lb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",Xb,[l[8]||(l[8]=n.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),n.createElementVNode("span",null,[l[4]||(l[4]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=n.createElementVNode("br",null,null,-1)),l[7]||(l[7]=n.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),n.createElementVNode("div",Yb,[l[15]||(l[15]=n.createElementVNode("img",{src:Hb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",Ub,[l[14]||(l[14]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),n.createElementVNode("span",null,[l[10]||(l[10]=n.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=n.createElementVNode("br",null,null,-1)),l[13]||(l[13]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),n.createElementVNode("div",Kb,[l[21]||(l[21]=n.createElementVNode("img",{src:Wb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",Gb,[l[20]||(l[20]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),n.createElementVNode("span",null,[l[16]||(l[16]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=n.createElementVNode("br",null,null,-1)),l[19]||(l[19]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Qb={class:"grid md:grid-cols-2"},Jb={},vu=n.defineComponent({...Jb,__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(()=>et.isPhoneDevice()),s=n.ref(!1),a=n.ref(!1),l=n.ref(i.cartItem),c=n.useTemplateRef("mosquito-configurator-form"),d=n.ref({width:{},height:{},quantity:{},marker:{}}),u=n.ref(!1),h=n.ref(!1),f=n.computed(()=>n.inject("debounce-input-time",300)),m=z.debounce(async g=>{var b,y;l.value.product=new q.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?l.value.product=k:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(z.noop)},f.value),p=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return n.watch(()=>i.cartItem,g=>{l.value=g},{deep:!0}),(g,b)=>{const y=qo;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(ku,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),n.createElementVNode("div",Qb,[o.value?(n.openBlock(),n.createBlock(n.unref(M.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(M.NDrawerContent),null,{header:n.withCtx(()=>[n.createVNode(n.unref(M.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(Sa,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(n.openBlock(),n.createBlock(Sa,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),n.createVNode(xu,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>n.unref(m)(_)),onSubmit:b[7]||(b[7]=_=>p()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),e1={},Cu=n.defineComponent({...e1,__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"),a=n.ref(!1),l=n.ref(r.value),c=n.useTemplateRef("form-item-reference"),d=n.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{l.value=m,o("update:value",m,r.index,a)},h=m=>{at(m),(m.key==="Enter"||m.code==="Enter")&&!r.isLastLine&&(m.preventDefault(),m.stopPropagation())},f=()=>{var m;(m=s.value)==null||m.select()};return n.watch(()=>r.value,m=>{l.value=m}),n.onMounted(()=>{r.autoFocus&&n.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(m,p)=>{const g=Zl,b=lo;return n.openBlock(),n.createBlock(n.unref(M.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":a.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(M.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:n.unref(ct),placeholder:"Введите ширину",onKeydown:h,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(M.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(M.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"])}}}),t1={class:"my-2 flex w-full flex-col"},n1={key:1},i1={class:"text-lg font-semibold"},r1={class:"flex gap-3"},o1={},Su=n.defineComponent({...o1,__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"),a=n.useTemplateRef("line-items-reference"),l=n.ref(z.cloneDeep(r.value)),c=n.computed(()=>{const k={length:[le.required,le.min(r.settings.minLength),le.max(r.settings.maxLength),le.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[le.required,le.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return z.forEach(l.value,(x,C)=>{var N;k[`configuratorParams.linesWidths.${C}`]=[le.required,le.min(r.settings.minLineWidth),le.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${C}`])==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)),h=n.computed(()=>r.settings.width-u.value),f=n.computed(()=>!r.value.some(({product:k})=>!k||k.isNewRec())),m=n.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(k=>k.product.isNewRec())),p=n.computed(()=>k=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+k}]),g=n.computed(()=>{const{length:k}=r.value[0];return!k||u.value!==r.settings.width?null:(z.reduce(r.value,(C,N)=>{var S;const w=((S=N.product)==null?void 0:S.costRub)||0;return C+w},0)*r.value[0].quantity*k).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(k,x,C)=>{var w,S,v;l.value[x].product.id=-1;const{configuratorParams:N}=l.value[x];N.linesWidths[x]=k,y("configuratorParams",N),(v=(S=(w=a.value)==null?void 0:w.at(x))==null?void 0:S.formItemReference)==null||v.validate().catch(z.noop),n.nextTick(()=>{var $,E;(E=($=a.value)==null?void 0:$.at(x))!=null&&E.isValid&&o("update:params",N,x,C)})},y=(k,x)=>{l.value.forEach(C=>{C[k]=x}),o("update:value",l.value)};return n.watch(()=>r.value,k=>{l.value=z.cloneDeep(k)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(k,x)=>{const C=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:l.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(l.value,(w,S)=>{var v,$,E;return n.openBlock(),n.createBlock(Cu,{key:S,ref_for:!0,ref:"line-items-reference",value:((v=w.configuratorParams)==null?void 0:v.linesWidths.at(S))??null,"auto-focus":((($=w.configuratorParams)==null?void 0:$.linesWidths.at(S))??0)===0,index:S,path:`configuratorParams.linesWidths.${S}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":p.value(((E=w.configuratorParams)==null?void 0:E.linesWidths.at(S))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(F=>F.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"is-last-line":S===l.value.length-1&&h.value===0,"onUpdate:value":b,"onClick:addLine":x[0]||(x[0]=F=>o("click:add-line",F)),"onClick:removeLine":x[1]||(x[1]=F=>o("click:remove-line",F))},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",t1,[h.value<0?(n.openBlock(),n.createBlock(n.unref(M.NText),{key:0,type:"error"},{default:n.withCtx(()=>[n.createTextVNode(" Сумма ширин всех полос должна быть равна "+n.toDisplayString(t.settings.width),1)]),_:1})):n.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(n.openBlock(),n.createBlock(n.unref(M.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(M.NText),{type:h.value>=0?"Success":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value),1)]),_:1},8,["type"]),n.createTextVNode(" из "+n.toDisplayString(t.settings.width)+" мм ",1)])]),n.createVNode(n.unref(M.NButton),{disabled:m.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",l.value.length))},{default:n.withCtx(()=>[...x[17]||(x[17]=[n.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),n.createVNode(n.unref(M.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.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(at)(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(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.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(at)(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(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,y("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(C,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{l.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",n1,[x[19]||(x[19]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",i1,n.toDisplayString(g.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",r1,[n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((N=l.value[0])!=null&&N.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>o("submit",l.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",l.value)]])}}}),s1={class:"flex grow flex-col"},a1=["src"],l1={class:"w-full"},c1={},Bu=n.defineComponent({...c1,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",s1,[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,a1),n.createElementVNode("div",l1,[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)])]))}}),d1={class:"flex flex-col gap-2"},u1={class:"w-104 flex grow flex-col px-5"},f1={},Tu=n.defineComponent({...f1,__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),a=n.ref({width:{},length:{},quantity:{},marker:{}}),l=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 q.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)},h=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 a[`linesWidths.${p}`],delete a[`linesWidths.${p}`])},f=z.debounce(async(p,g,b)=>{const y={linesWidths:p.linesWidths.at(g)};b.value=!0,a.value[`linesWidths.${g}`]={},s.value[g].product=new q.ClientProduct,i.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:y,validationFieldResultData:a.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 q.ClientProduct,a.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){l.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,n.nextTick(()=>{var _,k;(k=(_=o.value)==null?void 0:_.formReference)==null||k.restoreValidation()})})}}).catch(z.noop)};return n.watch(()=>i.cartItems,p=>{s.value=p.map(g=>new q.OrderItemBase(g))}),(p,g)=>{const b=M.NButton;return n.openBlock(),n.createElementBlock("div",d1,[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",u1,[n.createVNode(Bu,{value:s.value,"onUpdate:value":g[1]||(g[1]=y=>s.value=y),settings:t.settings},null,8,["value","settings"]),n.createVNode(Su,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":n.unref(f),onSubmit:m,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),h1={class:"flex flex-col gap-3"},m1={},Nu=n.defineComponent({...m1,__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"),a=n.useTemplateRef("first-input-element"),l=n.ref(z.cloneDeep(r.value)),c=n.computed(()=>({"configuratorParams.width":[le.required,le.min(r.settings.minWidth),...r.settings.maxWidth?[le.max(r.settings.maxWidth)]:[],le.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[le.required,le.min(r.settings.minLength),le.max(r.settings.maxLength),le.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[le.required,le.min(1),le.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",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(p,g)=>{const b=new q.OrderItemBase(r.value);b[p]=g,p==="configuratorParams"&&(b.product=new q.ClientProduct),o("update:value",b)},f=()=>{var p;(p=a.value)==null||p.select()};return n.watch(()=>r.value,p=>{l.value=z.cloneDeep(p)},{deep:!0}),n.onMounted(()=>{r.value.isNewRec()&&n.nextTick(()=>{f()})}),e({validate:(m=s.value)==null?void 0:m.validate,formReference:s}),(p,g)=>{const b=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:l.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(M.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:n.unref(ct),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=y=>n.unref(at)(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(M.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=y=>n.unref(at)(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(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=y=>n.unref(at)(y,!1)),onInput:g[7]||(g[7]=y=>n.unref(rt)(t.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=y=>h("quantity",y??0)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.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=>h("marker",y??null)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=y=>{l.value.isAdditionalSale=y??!1,h("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",h1,[n.createVNode(n.unref(M.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",l.value)]])}}}),p1={class:"flex flex-col gap-2 w-72"},g1={},$u=n.defineComponent({...g1,__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),a=n.ref({width:{},length:{},quantity:{},marker:{}}),l=n.ref(!1),c=n.ref(!1),d=n.computed(()=>n.inject("debounce-input-time",300)),u=z.debounce(async f=>{var m,p;s.value.product=new q.ClientProduct,(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(g=>{g||(l.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:f,validationFieldResultData:a.value,callback:b=>{b?s.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(z.noop)},d.value),h=async()=>{var f,m;(m=(f=o.value)==null?void 0:f.formReference)==null||m.validate(p=>{p||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})}))}).catch(z.noop)};return n.watch(()=>i.cartItem,f=>{s.value=new q.OrderItemBase(f)},{deep:!0}),(f,m)=>{const p=M.NButton;return n.openBlock(),n.createElementBlock("div",p1,[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(Nu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":m[1]||(m[1]=g=>s.value=g),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":m[2]||(m[2]=g=>n.unref(u)(g)),onSubmit:m[3]||(m[3]=g=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),y1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b1(t,e){return n.openBlock(),n.createElementBlock("svg",y1,[...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 Eu=n.markRaw({name:"ion-add",render:b1}),_1={key:0,class:"-mt-1 text-sm text-gray-500"},w1={class:"font-bold"},x1={class:"flex flex-col gap-3"},k1={key:0,class:"mt-4 flex flex-col gap-1.5"},v1={class:"flex flex-col gap-1 text-sm text-gray-700"},C1={key:0},S1={key:1},B1={"form-array-name":"items",class:"flex flex-col gap-3"},T1={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},N1={key:0,class:"flex flex-wrap items-end gap-2"},$1={class:"whitespace-nowrap text-xl font-bold"},E1={key:0,class:"whitespace-nowrap text-lg text-gray-500"},R1={class:"font-bold"},P1={class:"font-bold"},F1={class:"flex gap-3"},V1={},Ru=n.defineComponent({...V1,__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 A;const r=t,o=i,s=n.useTemplateRef("form-reference"),a=n.ref(z.cloneDeep(r.value)),l=n.ref({...r.validation}),c=O=>{var V;delete l.value[O],(V=s.value)==null||V.restoreValidation()};n.watch(()=>r.validation,O=>{l.value={...O},Object.values(O).some(R=>R==null?void 0:R.feedback)&&n.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.validate(z.noop).catch(z.noop)})},{deep:!0});const d=n.computed(()=>r.value.category),u=n.ref(null),h=n.ref(null),f=n.computed(()=>d.value.products??[]),m=n.computed(()=>f.value.map(O=>({label:O.name,value:O.id}))),p=(O,V,R)=>{const H=O!=null&&O>0,U=V!=null&&V>0;return!H&&!U?null:H&&U?`от ${O} ${R} до ${V} ${R}`:H?`от ${O} ${R}`:`до ${V} ${R}`},g=n.computed(()=>{var O,V;return p(r.settings.minWidth,(V=(O=u.value)==null?void 0:O.properties)==null?void 0:V.width,"мм")}),b=n.computed(()=>{var O,V;return p(r.settings.minLength,(V=(O=u.value)==null?void 0:O.properties)==null?void 0:V.length,"мм")}),y=n.ref(null),_=n.ref(!1),k=n.computed(()=>{var V;const O={marker:[We.serverValidation((V=l.value.marker)==null?void 0:V.feedback)]};return a.value.configuratorParams.items.forEach((R,H)=>{var U,G,X,W,j,ae,de;O[`configuratorParams.items.${H}.width`]=[le.required,le.min(r.settings.minWidth),...(G=(U=u.value)==null?void 0:U.properties)!=null&&G.width?[le.max(u.value.properties.width)]:[],le.step(1),We.serverValidation((X=l.value[`items.${H}.width`])==null?void 0:X.feedback)],O[`configuratorParams.items.${H}.length`]=[le.required,le.min(r.settings.minLength),...(j=(W=u.value)==null?void 0:W.properties)!=null&&j.length?[le.max(u.value.properties.length)]:[],le.step(1),We.serverValidation((ae=l.value[`items.${H}.length`])==null?void 0:ae.feedback)],O[`configuratorParams.items.${H}.count`]=[le.required,le.min(1),le.step(1),We.serverValidation((de=l.value[`items.${H}.count`])==null?void 0:de.feedback)]}),O}),x=n.ref(r.settings.canSetDopProdaga??!1),C=n.computed(()=>a.value.configuratorParams.items.some(O=>{var V,R;return!u.value||!O.width||O.width<r.settings.minWidth||O.width>(((V=u.value.properties)==null?void 0:V.width)??0)||O.length===0||O.length<r.settings.minLength||O.length>(((R=u.value.properties)==null?void 0:R.length)??0)||!O.count||O.count<1})),N=n.computed(()=>!u.value||C.value||a.value.configuratorParams.items.length===0),w=n.ref(null),S=O=>{if(!O){u.value=null,h.value=null,a.value.product=new q.ClientProduct,y.value=null;return}const V=f.value.find(R=>R.id===O);V&&(u.value=V,h.value=O,a.value.product=V,Z("product",a.value.product),a.value.configuratorParams.items.forEach(R=>{var H,U;(H=V.properties)!=null&&H.width&&R.width>V.properties.width&&(R.width=V.properties.width),(U=V.properties)!=null&&U.length&&R.length>V.properties.length&&(R.length=V.properties.length)}),$())};let v=!1;const $=()=>{v=!0,y.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},E=async()=>{var O;if(!u.value||a.value.configuratorParams.items.length===0||C.value){$();return}(O=s.value)==null||O.validate(V=>{if(V){$();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:a.value.configuratorParams.items},callback:R=>{R?(y.value=R,a.value.configuratorParams.calculationId=R.id,a.value.quantity=R.quantity,n.nextTick(()=>{Z("quantity",R.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,$()),Z("configuratorParams",a.value.configuratorParams),F(),_.value=!1}})}).catch(()=>{$(),_.value=!1})},F=()=>{var V;if(!((V=u.value)!=null&&V.costRub)||!y.value){w.value=null;return}const O=y.value.quantity*u.value.costRub;w.value=Math.round(O*100)/100},P=O=>{var R,H;const V=a.value.configuratorParams.items[O];u.value&&((R=u.value.properties)!=null&&R.width&&V.width>u.value.properties.width&&(V.width=u.value.properties.width),(H=u.value.properties)!=null&&H.length&&V.length>u.value.properties.length&&(V.length=u.value.properties.length)),Z("configuratorParams",a.value.configuratorParams),$()},I=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),Z("configuratorParams",a.value.configuratorParams),$(),o("add-item",a.value.configuratorParams.items.length)},K=O=>{a.value.configuratorParams.items.splice(O,1),Z("configuratorParams",a.value.configuratorParams),$(),o("remove-item",O)},J=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!y.value){E();return}o("submit",a.value)}},Z=(O,V)=>{const R=new q.OrderItemBase(r.value);R[O]=V,o("update:value",R)};n.watch(()=>r.value,O=>{const V=z.cloneDeep(n.toRaw(O));(!V.configuratorParams.items||V.configuratorParams.items.length===0)&&(V.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=V,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,h.value=null),v?v=!1:L()},{deep:!0});const L=()=>{const{calculationId:O}=a.value.configuratorParams,V=a.value.quantity??0;O&&V>0&&a.value.product&&!a.value.product.isNewRec()&&(y.value={id:O,quantity:V,sheets:[]},F())};return n.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),L()}),e({validate:(A=s.value)==null?void 0:A.validate,formReference:s}),(O,V)=>{const R=lo,H=Eu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:a.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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:h.value,"onUpdate:value":[V[0]||(V[0]=G=>h.value=G),S],options:m.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((U=u.value)==null?void 0:U.costRub)!=null?(n.openBlock(),n.createElementBlock("div",_1,[n.createElementVNode("span",w1,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",x1,[u.value?(n.openBlock(),n.createElementBlock("div",k1,[V[7]||(V[7]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",v1,[g.value?(n.openBlock(),n.createElementBlock("div",C1,"Ширина "+n.toDisplayString(g.value)+".",1)):n.createCommentVNode("",!0),b.value?(n.openBlock(),n.createElementBlock("div",S1,"Длина "+n.toDisplayString(b.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",B1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.configuratorParams.items,(G,X)=>(n.openBlock(),n.createElementBlock("div",{key:X,class:"flex grow gap-2"},[n.createElementVNode("div",T1,[n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.items.${X}.width`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:a.value.configuratorParams.items[X].width,"onUpdate:value":[W=>a.value.configuratorParams.items[X].width=W,W=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:V[1]||(V[1]=W=>n.unref(at)(W)),onInput:W=>c(`items.${X}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.items.${X}.length`,label:"Длина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:a.value.configuratorParams.items[X].length,"onUpdate:value":[W=>a.value.configuratorParams.items[X].length=W,W=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:V[2]||(V[2]=W=>n.unref(at)(W)),onInput:W=>c(`items.${X}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.items.${X}.count`,label:"Количество, шт"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:a.value.configuratorParams.items[X].count,"onUpdate:value":[W=>a.value.configuratorParams.items[X].count=W,W=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:V[3]||(V[3]=W=>n.unref(at)(W,!1)),onInput:W=>c(`items.${X}.count`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(M.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:W=>K(X)},{default:n.withCtx(()=>[n.createVNode(R)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:1,disabled:C.value,type:"default",class:"self-center",onClick:I},{default:n.withCtx(()=>[n.createVNode(H),V[8]||(V[8]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0)]),n.createVNode(n.unref(M.NFormItem),{path:"marker",label:"Маркировка распила"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:V[4]||(V[4]=G=>c("marker")),"onUpdate:value":V[5]||(V[5]=G=>Z("marker",G??null)),onFocus:n.unref(He)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(n.openBlock(),n.createBlock(n.unref(M.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":V[6]||(V[6]=G=>{a.value.isAdditionalSale=G??!1,Z("isAdditionalSale",G??!1)})},{default:n.withCtx(()=>[...V[9]||(V[9]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(n.unref(M.NSpin),{show:_.value,size:"small",class:"grow"},{default:n.withCtx(()=>{var G;return[y.value&&u.value&&w.value?(n.openBlock(),n.createElementBlock("div",N1,[n.createElementVNode("div",null,[V[10]||(V[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",$1,n.toDisplayString(w.value.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(n.openBlock(),n.createElementBlock("div",E1,[n.createElementVNode("span",R1,"("+n.toDisplayString(y.value.quantity)+" шт.",1),V[11]||(V[11]=n.createTextVNode(" x ",-1)),n.createElementVNode("span",P1,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",F1,[y.value&&!_.value?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,loading:t.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:J},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:E},{default:n.withCtx(()=>[...V[12]||(V[12]=[n.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[n.unref(ti),J]])}}}),M1={class:"flex flex-col gap-2"},I1={class:"w-104 flex grow flex-col px-5"},A1={},Pu=n.defineComponent({...A1,__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),a=n.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=n.ref(!1),c=async()=>{var h,f;(f=(h=o.value)==null?void 0:h.formReference)==null||f.validate(m=>{if(!m){l.value=!0;const p=z.cloneDeep(s.value);"items"in p.configuratorParams&&delete p.configuratorParams.items,r("submit",p,a.value,()=>{l.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})})}}).catch(z.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return n.onMounted(()=>{i.cartItem.configuratorParams.items.forEach((h,f)=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}})}),n.watch(()=>i.cartItem,h=>{s.value=new q.OrderItemBase(h)},{deep:!0}),(h,f)=>{const m=M.NButton;return n.openBlock(),n.createElementBlock("div",M1,[t.settings.allowShowTable&&s.value.isNewRec()?(n.openBlock(),n.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=p=>r("click:view-switch"))},{default:n.withCtx(()=>[...f[2]||(f[2]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",I1,[n.createVNode(Ru,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":f[1]||(f[1]=p=>s.value=p),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),O1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function z1(t,e){return n.openBlock(),n.createElementBlock("svg",O1,[...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 D1=n.markRaw({name:"ion-checkmark",render:z1}),L1={key:0,class:"-mt-1 text-sm text-gray-500"},H1={class:"font-bold"},W1={class:"flex flex-col gap-3"},j1={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},q1={class:"flex flex-col gap-1 text-sm text-gray-700"},X1={key:0},Y1={key:1},U1={"form-array-name":"items",class:"flex flex-col gap-3"},K1={class:"min-w-0 flex-1"},G1={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},Z1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},Q1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},J1={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},e_={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},t_={key:0,class:"lg:!flex-[2]"},n_={class:"font-bold"},i_={key:1,class:"lg:!flex-[3]"},r_={class:"font-bold"},o_={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"},s_={key:0},a_={class:"font-bold"},l_={key:1},c_={class:"font-bold"},d_={class:"flex flex-wrap items-center gap-3"},u_={},Fu=n.defineComponent({...u_,__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"),a=n.useTemplateRef("widthInputs"),l=r.value==null?[]:z.cloneDeep(n.toRaw(r.value)),c=n.ref(l.map(X=>new q.OrderItemBase(X))),d=n.computed(()=>({items:c.value})),u=n.ref({...r.validation}),h=X=>{var W;delete u.value[X],(W=s.value)==null||W.restoreValidation()},f=n.ref(null),m=n.ref(null),p=n.computed(()=>{var X,W;return((W=(X=c.value[0])==null?void 0:X.category)==null?void 0:W.products)??[]}),g=n.computed(()=>p.value.map(X=>({label:X.name,value:X.id}))),b=(X,W,j)=>{const ae=X!=null&&X>0,de=W!=null&&W>0;return!ae&&!de?null:ae&&de?`от ${X} ${j} до ${W} ${j}`:ae?`от ${X} ${j}`:`до ${W} ${j}`},y=n.computed(()=>{var X,W;return b(r.settings.minWidth,(W=(X=f.value)==null?void 0:X.properties)==null?void 0:W.width,"мм")}),_=n.computed(()=>{var X,W;return b(r.settings.minLength,(W=(X=f.value)==null?void 0:X.properties)==null?void 0:W.length,"мм")}),k=n.computed(()=>{const X={};return c.value.forEach((W,j)=>{var ae,de,ve,st,_e,we,xt,$e;X[`items.${j}.configuratorParams.width`]=[le.required,le.min(r.settings.minWidth),...(de=(ae=f.value)==null?void 0:ae.properties)!=null&&de.width?[le.max(f.value.properties.width)]:[],le.step(1),We.serverValidation((ve=u.value[`items.${j}.width`])==null?void 0:ve.feedback)],X[`items.${j}.configuratorParams.length`]=[le.required,le.min(r.settings.minLength),...(_e=(st=f.value)==null?void 0:st.properties)!=null&&_e.length?[le.max(f.value.properties.length)]:[],le.step(1),We.serverValidation((we=u.value[`items.${j}.length`])==null?void 0:we.feedback)],X[`items.${j}.quantity`]=[le.required,le.min(1),le.step(1),We.serverValidation((xt=u.value[`items.${j}.quantity`])==null?void 0:xt.feedback)],X[`items.${j}.marker`]=[We.serverValidation(($e=u.value[`items.${j}.marker`])==null?void 0:$e.feedback)]}),X});n.watch(()=>r.validation,X=>{u.value={...X},Object.values(X).some(j=>j==null?void 0:j.feedback)&&n.nextTick(()=>{var j;return(j=s.value)==null?void 0:j.validate(z.noop).catch(z.noop)})},{deep:!0});const x=n.ref(r.settings.canSetDopProdaga??!1),C=n.computed(()=>{const X=f.value;return X?c.value.some(W=>{var ve,st;const j=W.configuratorParams,ae=(ve=X.properties)==null?void 0:ve.width,de=(st=X.properties)==null?void 0:st.length;return j.width===0||j.width<r.settings.minWidth||ae!=null&&j.width>ae||j.length===0||j.length<r.settings.minLength||de!=null&&j.length>de||W.quantity===0||W.quantity<1}):!0}),N=n.computed(()=>!f.value||C.value||c.value.length===0),w=n.computed(()=>{const X=c.value[0];return X!=null&&!X.isNewRec()}),S=X=>r.itemStates[X]??"idle",v=X=>S(X)==="success",$=X=>S(X)==="loading",E=n.computed(()=>c.value.length===0?!0:c.value.every((X,W)=>{const j=S(W);return j==="success"||j==="loading"})),F=X=>X.width===0||X.length===0?0:X.width*X.length/1e6,P=X=>F(X).toLocaleString(void 0,{maximumFractionDigits:4}),I=X=>{var ve;const W=X.configuratorParams,j=F(W),ae=((ve=f.value)==null?void 0:ve.costRub)??0,de=X.quantity??0;return!j||!de?0:Math.round(j*ae*de*100)/100},K=n.computed(()=>z.sum(c.value.map(X=>{const W=X.configuratorParams;return!W.width||W.length===0||!X.quantity?0:W.width*W.length*X.quantity/1e6}))),J=n.computed(()=>Math.round(z.sum(c.value.map(X=>I(X)))*100)/100),Z=()=>{var X,W,j;return new q.OrderItemBase({category:(X=c.value[0])==null?void 0:X.category,configurator:(W=c.value[0])==null?void 0:W.configurator,product:f.value??new q.ClientProduct,quantity:1,isAdditionalSale:(j=c.value[0])==null?void 0:j.isAdditionalSale,configuratorParams:{width:0,length:0}})},L=X=>{if(!X){f.value=null,m.value=null,c.value.forEach(j=>{j.product=new q.ClientProduct}),o("update:value",c.value);return}const W=p.value.find(j=>j.id===X);W&&(f.value=W,m.value=X,c.value.forEach((j,ae)=>{var de,ve;j.product=W,(de=W.properties)!=null&&de.width&&j.configuratorParams.width>W.properties.width&&(j.configuratorParams.width=W.properties.width),(ve=W.properties)!=null&&ve.length&&j.configuratorParams.length>W.properties.length&&(j.configuratorParams.length=W.properties.length),o("item-reset",ae)}),o("update:value",c.value))},A=X=>{var ae,de;const W=c.value[X],j=f.value;j&&((ae=j.properties)!=null&&ae.width&&W.configuratorParams.width>j.properties.width&&(W.configuratorParams.width=j.properties.width),(de=j.properties)!=null&&de.length&&W.configuratorParams.length>j.properties.length&&(W.configuratorParams.length=j.properties.length)),o("item-reset",X),o("update:value",c.value)},O=(X,W)=>{c.value[X].marker=W===null||W===""?void 0:W,o("item-reset",X),o("update:value",c.value)},V=X=>{c.value.forEach(W=>{W.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 W,j,ae,de;const X=c.value.length-1;(j=(W=a.value)==null?void 0:W[X])==null||j.focus(),(de=(ae=a.value)==null?void 0:ae[X])==null||de.select()})},H=X=>{c.value.splice(X,1),o("update:value",c.value),o("remove-item",X)};n.watch(()=>r.value,X=>{var de;const j=(X==null?[]:z.cloneDeep(n.toRaw(X))).map(ve=>new q.OrderItemBase(ve));c.value=j.length>0?j:[Z()];const ae=(de=c.value[0])==null?void 0:de.product;ae&&!ae.isNewRec()?(f.value=ae,m.value=ae.id):(f.value=null,m.value=null)},{deep:!0});const U=()=>{var W;if(f.value!==null)return;const X=(W=p.value[0])==null?void 0:W.id;X!=null&&L(X)};return n.watch(p,()=>{U()}),n.onMounted(()=>{var W;c.value.length===0&&(c.value=[Z()]);const X=(W=c.value[0])==null?void 0:W.product;X&&!X.isNewRec()&&(f.value=X,m.value=X.id),U()}),e({validate:(G=s.value)==null?void 0:G.validate,formReference:s}),(X,W)=>{const j=D1,ae=lo,de=Eu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:m.value,"onUpdate:value":[W[0]||(W[0]=_e=>m.value=_e),L],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(n.openBlock(),n.createElementBlock("div",L1,[n.createElementVNode("span",H1,n.toDisplayString(f.value.code),1),n.createTextVNode(" — "+n.toDisplayString(f.value.costRub.toLocaleString())+" "+n.toDisplayString(f.value.currency.symbol)+"/м² ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",W1,[f.value?(n.openBlock(),n.createElementBlock("div",j1,[W[6]||(W[6]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",q1,[y.value?(n.openBlock(),n.createElementBlock("div",X1,"Ширина "+n.toDisplayString(y.value)+".",1)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock("div",Y1,"Длина "+n.toDisplayString(_.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",U1,[(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",v(we)?"opacity-70":""])},[n.createElementVNode("div",K1,[n.createElementVNode("div",G1,[n.createElementVNode("div",Z1,[n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[we].configuratorParams.width,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.width=$e,$e=>A(we)],parse:n.unref(ct),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Ширина",class:"w-full",onKeydown:W[1]||(W[1]=$e=>n.unref(at)($e)),onInput:$e=>h(`items.${we}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:d.value.items[we].configuratorParams.length,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.length=$e,$e=>A(we)],parse:n.unref(ct),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Длина",class:"w-full",onKeydown:W[2]||(W[2]=$e=>n.unref(at)($e)),onInput:$e=>h(`items.${we}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createElementVNode("div",Q1,[n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:d.value.items[we].quantity,"onUpdate:value":[$e=>d.value.items[we].quantity=$e,$e=>A(we)],parse:n.unref(ct),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Кол-во",class:"w-full",onKeydown:W[3]||(W[3]=$e=>n.unref(at)($e,!1)),onInput:$e=>h(`items.${we}.quantity`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.marker`,label:"Маркировка",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:d.value.items[we].marker??null,disabled:!f.value||v(we)||$(we),placeholder:"Маркировка",class:"w-full",onInput:$e=>h(`items.${we}.marker`),"onUpdate:value":$e=>O(we,$e??null),onFocus:n.unref(He)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),$(we)||v(we)?(n.openBlock(),n.createElementBlock("div",J1,[$(we)?(n.openBlock(),n.createBlock(n.unref(M.NSpin),{key:0,size:14})):v(we)?(n.openBlock(),n.createBlock(j,{key:1,class:"text-green-600 text-xl"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),n.createElementVNode("div",e_,[_e.configuratorParams.width>0&&_e.configuratorParams.length>0?(n.openBlock(),n.createElementBlock("div",t_,[W[7]||(W[7]=n.createTextVNode(" Площадь (S) = ",-1)),n.createElementVNode("span",n_,n.toDisplayString(P(_e.configuratorParams))+" м²",1)])):n.createCommentVNode("",!0),I(_e)>0?(n.openBlock(),n.createElementBlock("div",i_,[W[8]||(W[8]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",r_,n.toDisplayString(I(_e).toLocaleString())+" "+n.toDisplayString((xt=f.value)==null?void 0:xt.currency.symbol),1)])):n.createCommentVNode("",!0)])]),w.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,disabled:$(we)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:$e=>H(we)},{default:n.withCtx(()=>[n.createVNode(ae)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(n.openBlock(),n.createElementBlock("div",o_,[K.value>0?(n.openBlock(),n.createElementBlock("div",s_,[W[9]||(W[9]=n.createTextVNode(" Общая площадь: ",-1)),n.createElementVNode("span",a_,n.toDisplayString(K.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):n.createCommentVNode("",!0),J.value>0?(n.openBlock(),n.createElementBlock("div",l_,[W[10]||(W[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",c_,n.toDisplayString(J.value.toLocaleString())+" "+n.toDisplayString(f.value.currency.symbol),1)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),x.value?(n.openBlock(),n.createBlock(n.unref(M.NCheckbox),{key:1,checked:((st=c.value[0])==null?void 0:st.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":W[4]||(W[4]=_e=>V(_e??!1))},{default:n.withCtx(()=>[...W[11]||(W[11]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createElementVNode("div",d_,[f.value&&!w.value?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,disabled:C.value,type:"default",onClick:R},{default:n.withCtx(()=>[n.createVNode(de),W[12]||(W[12]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:N.value||E.value,type:"primary",class:"ml-auto",onClick:W[5]||(W[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)]])}}}),f_={class:"flex flex-col gap-2"},h_={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},m_={},Vu=n.defineComponent({...m_,__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 q.OrderItemBase(k))),a=n.ref([]),l=n.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=k=>{c.forEach(x=>{l.value[`items.${k}.${x}`]={}})},u=k=>{c.forEach(x=>{delete l.value[`items.${k}.${x}`]})},h=n.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),m=(k,x)=>{let C=!1;return c.forEach(N=>{var F,P;const w=`items.0.${N}`,S=(F=k[N])==null?void 0:F.feedback,$=((P=k[w])==null?void 0:P.feedback)??S,E=`items.${x}.${N}`;$?(l.value[E]=k[w]??k[N],C=!0):l.value[E]={}}),C},p=(k,x,C)=>new Promise(N=>{const w=f();let S=!1;const v=$=>{if(S)return;S=!0;const E=m(w,x),F=($===void 0?!E:$)&&!E;a.value[x]=F?"success":"error",n.nextTick(()=>{var P,I;(I=(P=o.value)==null?void 0:P.formReference)==null||I.restoreValidation()}),N(F)};a.value[x]="loading",r("submit",[z.cloneDeep(k)],w,v,{isFinalSuccessfulCompletion:C})}),g=async()=>{var C,N;try{await((N=(C=o.value)==null?void 0:C.formReference)==null?void 0:N.validate())}catch{return}const k=s.value.map((w,S)=>S).filter(w=>{const S=a.value[w]??"idle";return S!=="success"&&S!=="loading"});let x=!0;for(let w=0;w<k.length;w+=1){const S=k[w],v=s.value[S];if(!v)break;const E=w===k.length-1&&x;await p(v,S,E)||(x=!1)}},b=k=>{const x=k-1;a.value[x]="idle",d(x)},y=k=>{a.value.splice(k,1),u(k);for(let x=k;x<s.value.length;x+=1)d(x)},_=k=>{const x=a.value[k];(x==="success"||x==="error")&&(a.value[k]="idle")};return n.onMounted(()=>{(i.cartItems??[]).forEach((k,x)=>{a.value[x]="idle",d(x)})}),n.watch(()=>i.cartItems,k=>{const x=(k??[]).map(C=>new q.OrderItemBase(C));s.value=x,a.value=x.map(()=>"idle"),x.forEach((C,N)=>{d(N)})},{deep:!0}),(k,x)=>{var N;const C=M.NButton;return n.openBlock(),n.createElementBlock("div",f_,[t.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(n.openBlock(),n.createBlock(C,{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",h_,[n.createVNode(Fu,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":x[1]||(x[1]=w=>s.value=w),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":h.value,"item-states":a.value,onSubmit:g,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),p_={key:0,class:"flex justify-center p-4"},g_={key:1,class:"p-4 text-center text-red-500"},y_={key:2,class:"flex justify-center"},b_={class:"!bg-white p-4 m-2 rounded-md w-max"},__={key:3,class:"p-4 text-center text-gray-500"},w_={},Mu=n.defineComponent({...w_,__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),a=f=>{const m=f.configuratorParams;return[new q.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(m==null?void 0:m.width)??f.width??0,length:(m==null?void 0:m.length)??f.length??0}})]},l=n.ref(e.editor===q.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var m,p,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={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 q.OrderItemBase({...f,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:z.some(b.startTailConfigs,y=>y.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(y=>y.isDefault):void 0,endTailType:z.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 q.OrderItemBase({...f,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 q.OrderItemBase({...f,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new q.OrderItemBase({...f,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new q.OrderItemBase({...f,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new q.OrderItemBase({...f,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(f,m,p)=>{const g=b=>{p==null||p(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:g,validation:m})},u=(f,m,p,g)=>{const b=f[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})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return n.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(f,m)=>{const p=M.NSpin;return n.openBlock(),n.createElementBlock(n.Fragment,null,[i.value?(n.openBlock(),n.createElementBlock("div",p_,[n.createVNode(p,{size:"large"})])):r.value?(n.openBlock(),n.createElementBlock("div",g_,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0),t.settings!==null&&(o.value!==null||s.value!==null||l.value!==null)?(n.openBlock(),n.createElementBlock("div",y_,[n.createElementVNode("div",b_,[t.editor==="kozyrek"?(n.openBlock(),n.createBlock(wu,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(n.openBlock(),n.createBlock(vu,{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(Tu,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(n.openBlock(),n.createBlock($u,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(n.openBlock(),n.createBlock(Pu,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(n.openBlock(),n.createBlock(Vu,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):n.createCommentVNode("",!0)])])):(n.openBlock(),n.createElementBlock("div",__,' Конфигуратор "'+n.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function Iu(t){return Object.values(q.ConfiguratorsEnum).includes(t)}function Au(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==q.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&z.isArray(t.products)&&t.products.length>0}const x_={key:0,class:"pt-0.5"},k_={key:0},v_={class:"line-through"},C_={key:0},S_={key:1},B_={class:"flex flex-row gap-1"},T_={key:0},N_={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},$_={class:"flex flex-col gap-2.5 sm:flex-row"},E_={class:"mt-2"},R_={key:1,class:"flex flex-col"},P_={},F_=n.defineComponent({...P_,__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(Cr,"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 z.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 z.isArray((U=e.categoryItem)==null?void 0:U.products)?e.categoryItem.products:[]}),a=n.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([U,G])=>`${G} руб./${E(U)}`).join(", ")),l=n.computed(()=>z.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(U=>{var X;const G=(X=r.value)==null?void 0:X.products;return z.isArray(G)&&G.includes(U.id)})),c=n.computed(()=>l.value.length>0),d=n.computed(()=>z.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=n.computed(()=>z.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=n.computed(()=>z.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=n.computed(()=>z.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&&Iu((G=e.categoryItem.properties)==null?void 0:G.configurator)&&Au(e.categoryItem)&&((X=e.categoryItem.properties)==null?void 0:X.configuratorSettings)!==void 0&&(z.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),p=n.computed(()=>m.value&&(z.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),g=n.computed(()=>z.isNil(e.categoryContextButtonsConfig)?[]:z.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=n.computed(()=>new q.ClientCategory(e.categoryItem)),y=n.ref(!1),_=n.ref(!1),k=n.computed(()=>!z.isUndefined(e.isCategoryItemSelected)),x=n.computed(()=>z.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),C=n.computed(()=>z.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),N=n.computed(()=>z.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=n.computed(()=>V.value&&et.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),S=n.useTemplateRef("collapse-item-reference"),v=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(),F=U=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:U,target:S.value})},P=(U,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:y,target:S.value})},I=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:S.value})},K=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:S.value})},J=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:S.value})},Z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:S.value})},L=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:S.value})},A=U=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:U,target:S.value})},O=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},V=n.ref(0),R=n.computed(()=>V.value&&s.value.length>0?Bg(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}):[]),H=z.debounce(()=>{V.value=window.innerWidth},20);return n.onUnmounted(()=>{window.removeEventListener("resize",H)}),window.addEventListener("resize",H),H(),(U,G)=>{const X=M.NCheckbox,W=Dm,j=M.NTooltip,ae=Am,de=M.NTag,ve=Vm,st=Rm,_e=M.NButton,we=Nm,xt=Hl,$e=Ll,Zt=Dl,gn=Cs,Rt=M.NDropdown,Jn=M.NDataTable,yn=M.NAlert,an=M.NSpin;return n.openBlock(),n.createBlock(Wl,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":n.withCtx(()=>{var Ve,te;return[k.value?(n.openBlock(),n.createElementBlock("div",x_,[n.createVNode(X,{checked:x.value,indeterminate:N.value,disabled:C.value,"onUpdate:checked":F},null,8,["checked","indeterminate","disabled"])])):n.createCommentVNode("",!0),!d.value&&((Ve=b.value)!=null&&Ve.isDisabled)?(n.openBlock(),n.createBlock(j,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(W,{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(j,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(ae,{class:"pt-1.5"})]),default:n.withCtx(()=>[G[2]||(G[2]=n.createTextVNode(" Избранная категория ",-1))]),_:1})):n.createCommentVNode("",!0)]}),header:n.withCtx(()=>{var Ve,te,ce,Le,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":(Ve=b.value)==null?void 0:Ve.isDisabled})},[n.createVNode(j,{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((...lt)=>n.unref(z.noop)&&n.unref(z.noop)(...lt),["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 lt;return[n.createTextVNode(" Установленная стоимость: "+n.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(lt=t.categoryItem.properties)!=null&<.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",k_,n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0),n.createVNode(de,{size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createElementVNode("span",v_,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"])):(Le=t.categoryItem.properties)!=null&&Le.templateCost?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[v.value||$.value?(n.openBlock(),n.createBlock(de,{key:0,size:n.unref(i),round:""},{default:n.withCtx(()=>{var lt;return[v.value?(n.openBlock(),n.createElementBlock("span",C_,n.toDisplayString((lt=v.value)==null?void 0:lt.name),1)):n.createCommentVNode("",!0),$.value?(n.openBlock(),n.createElementBlock("span",S_,n.toDisplayString($.value>0?"+":"")+n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0)]}),_:1},8,["size"])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),a.value?(n.openBlock(),n.createBlock(de,{key:2,size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createTextVNode(" Фиксированный курс: "+n.toDisplayString(a.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(j,{placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>{var lt,Qt;return[n.createElementVNode("span",B_,[n.createVNode(ve),n.createTextVNode(" "+n.toDisplayString((Qt=(lt=b.value)==null?void 0:lt.manager)==null?void 0:Qt.name),1)])]}),default:n.withCtx(()=>{var lt,Qt;return[n.createTextVNode(' Категория закреплена за "'+n.toDisplayString((Qt=(lt=b.value)==null?void 0:lt.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",T_,[n.createElementVNode("ul",N_,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Ve),1))),128)):n.createCommentVNode("",!0),t.showProperties?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(t.categoryItem.properties,(Ve,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Ve),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),"header-extra":n.withCtx(()=>{var Ve;return[n.createElementVNode("div",$_,[d.value?(n.openBlock(),n.createBlock(j,{key:0,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(W,{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&&!((Ve=b.value)!=null&&Ve.manager)?(n.openBlock(),n.createBlock(j,{key:1,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,Le;return[(te=b.value)!=null&&te.manager?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode('Категория закреплена за "'+n.toDisplayString(((Le=(ce=b.value)==null?void 0:ce.manager)==null?void 0:Le.name)??"-")+'"',1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Закрепить")],64))]}),_:1})):n.createCommentVNode("",!0),h.value?(n.openBlock(),n.createBlock(j,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,disabled:h.value==="disabled",size:n.unref(i),onClick:K},{default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isRequired?(n.openBlock(),n.createBlock($e,{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),f.value?(n.openBlock(),n.createBlock(j,{key:3,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:4,options:g.value,size:n.unref(i),trigger:"click",onSelect:A},{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 Ve,te,ce;return[n.createElementVNode("div",E_,[o.value?(n.openBlock(),n.createBlock(zu,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ve=r.value)==null?void 0:Ve.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},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-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(Mu,{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",R_,[m.value?(n.openBlock(),n.createBlock(_e,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:O},{default:n.withCtx(()=>[...G[6]||(G[6]=[n.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Jn,{columns:R.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Le=>Le.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(an,{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"])}}}),V_=An(F_,[["__scopeId","data-v-2d680549"]]),M_={class:"sc-collapse flex w-full flex-col"},I_={},Ou=n.defineComponent({...I_,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const i=t,r=e,o=(s,a)=>{r("on-item-header-click",s,a)};return n.provide("itemHeaderClickHandler",o),n.provide("defaultExpandedNames",i.defaultExpandedNames),n.provide("expandedNames",i.expandedNames),(s,a)=>(n.openBlock(),n.createElementBlock("div",M_,[n.renderSlot(s.$slots,"default")]))}}),A_={},zu=n.defineComponent({...A_,__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(Cr,"medium"),r=n.computed(()=>z.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(z.isUndefined(a))return;const l=a[s.id];if(l==="*")return;const c={};return c[s.id]=structuredClone(n.toRaw(l)),c};return(s,a)=>{const l=M.NSpin,c=M.NAlert;return n.openBlock(),n.createElementBlock(n.Fragment,null,[r.value.length>0?(n.openBlock(),n.createBlock(Ou,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,d=>(n.openBlock(),n.createBlock(V_,{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},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-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))]),_:1})):t.loading?(n.openBlock(),n.createBlock(l,{key:1,size:n.unref(i),class:"w-full"},{description:n.withCtx(()=>[...a[0]||(a[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)}}}),O_={},Du=n.defineComponent({...O_,__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(()=>z.isArray(r.value)),a=new q.Reference,l=n.computed(()=>z.isNil(r.value)?s.value?[]:null:z.isArray(r.value)?r.value.filter(p=>!z.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(z.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=>!z.isNil(y)):[];o("update:value",b)}else{const b=p===a.id||z.isNil(p)||(g=c.value.find(y=>y.value===p))==null?void 0:g.item;o("update:value",b)}},h=n.useTemplateRef("select-component");return e({focus:()=>{var p;return(p=h.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=h.value)==null?void 0:p.blur()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(M.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple: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"]))}}),z_={},D_=n.defineComponent({...z_,__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,C;const i=t,r=e,o=()=>{const N=q.PriceCoefficient.getRetailPriceCoefficient();return z.unset(N,"isNewRec"),N},s=N=>!N||N.id===o().id,a=n.computed(()=>{var N;return((N=i.catalogItem)==null?void 0:N.type)==="product"}),l=n.computed(()=>a.value?i.catalogItem:void 0),c=N=>{var w,S,v,$;return N.id===o().id?(w=l.value)==null?void 0:w.getRetailCost():($=(v=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:v.find(E=>E.coefficient.id===N.id))==null?void 0:$.cost},d=n.computed(()=>{var S;const w=[...((S=q.useReferencesStore().priceCoefficientsReference)==null?void 0:S.map(v=>structuredClone(n.toRaw(v))))??[],o()].filter(v=>{var $;return(($=i.visibleCoefficient)==null?void 0:$.call(i,v))??!0});return a.value&&w.forEach(v=>{var E;const $=c(v);$?v.name+=` (${$} ${(E=l.value)==null?void 0:E.currency.symbol})`:v.name=""}),w.filter(v=>v.name!=="")}),u=n.ref(i.value.coefficient),h=n.ref(((C=(x=i.value)==null?void 0:x.value)==null?void 0:C.toString())??null),f=n.ref(null),m=n.computed(()=>{var N,w;return(w=(N=l.value)==null?void 0:N.priceCoefficients)==null?void 0:w.find(S=>S.coefficient.slug===q.PriceCoefficientEnum.K0)}),p=n.ref(void 0),g=N=>Number.parseFloat((N??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),b=()=>{var w,S;p.value=void 0;let N=g(h.value);if(N=Number.isNaN(N)?void 0:N,a.value)if(u.value||h.value){const v=o(),$=c(u.value??v)??0,E=$+$*((N??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(E),E>(((w=l.value)==null?void 0:w.getRetailCost())??E)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&E<(((S=m.value)==null?void 0:S.cost)??0)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.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=>{z.isArray(N)||z.isNull(N)||(u.value=N,h.value=null,!u.value&&h.value&&(u.value=o()),b())},_=()=>{u.value||(u.value=o()),b()},k=N=>{var S,v,$,E,F;const w=g(N);if(a.value){if(Number.isNaN(w)){u.value=void 0,h.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let P=0;if(w<=0)u.value=void 0,h.value=null;else if(m.value&&w<(((S=m.value)==null?void 0:S.cost)??0))u.value=(v=m.value)==null?void 0:v.coefficient,P=(w-m.value.cost)*100/m.value.cost,p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>((($=l.value)==null?void 0:$.getRetailCost())??w)){u.value=o();const I=((E=l.value)==null?void 0:E.getRetailCost())??0;P=(w-I)*100/I,p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const I=((F=l.value)==null?void 0:F.priceCoefficients)??[],K=z.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}}h.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,S,v;i.calculationType===q.CalculationTypeEnum.m2Cost?f.value=((w=(N=i.value)==null?void 0:N.value)==null?void 0:w.toString())??null:!((S=i.value)!=null&&S.coefficient)&&((v=i.value)!=null&&v.value)&&(u.value=o()),b()}),(N,w)=>{var $,E,F;const S=M.NInput,v=M.NInputGroup;return n.openBlock(),n.createBlock(n.unref(M.NFormItem),{"show-label":!n.unref(z.isNil)(t.label),label:t.label,"show-feedback":!n.unref(z.isNil)((($=p.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=p.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((F=p.value)==null?void 0:F.validationStatus)??t.validationStatus},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==n.unref(q.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==n.unref(q.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(v,{key:0,class:n.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:n.withCtx(()=>[n.createVNode(Du,{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(S,{value:h.value,"onUpdate:value":[w[0]||(w[0]=P=>h.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},[h.value&&!h.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),a.value||t.calculationType===n.unref(q.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(S,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=P=>f.value=P),k],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},n.createSlots({_:2},[a.value?{name:"suffix",fn:n.withCtx(()=>{var P;return[n.createTextVNode(n.toDisplayString((P=l.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"])}}}),L_={class:"text-sm"},H_={class:"text-sm"},W_={},j_=n.defineComponent({...W_,__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),a=n.ref(null),l=n.computed(()=>{var P,I,K;return((P=a.value)==null?void 0:P.unit.isLinear)&&((K=(I=a.value)==null?void 0:I.properties)==null?void 0:K.isLengthConfigurator)}),c=n.computed(()=>a.value?q.UnitsHelper.productIsMeasurable(a.value)||l.value?"шт.":a.value.unit.name:"шт."),d=n.ref(void 0),u=n.ref(void 0),h=n.ref(!0),f=n.ref(null),m=n.computed({get:()=>{var P;return((P=f.value)==null?void 0:P.quantity)??null},set:P=>{f.value&&(f.value.quantity=P??0)}}),p=n.computed({get:()=>{var P;return((P=f.value)==null?void 0:P.length)??null},set:P=>{f.value&&(f.value.length=P??void 0)}}),g=P=>{f.value&&(f.value.marker=P??void 0)},b=i,y=()=>({length:{},quantity:{},marker:{}}),_=n.ref(y()),k=n.ref(!1),x=n.computed(()=>{var Z,L,A,O;if(!a.value)return{};const P=q.UnitsHelper.getProductLengthMultiplicity(a.value),I=q.UnitsHelper.getProductMultiplicity(a.value),K=((L=(Z=a.value)==null?void 0:Z.properties)==null?void 0:L.minLength)||P,J=(O=(A=a.value)==null?void 0:A.properties)==null?void 0:O.maxLength;return{length:[le.required,le.min(K??.1),le.max(J),le.step(P),We.serverValidation(_.value.length.feedback)],quantity:[le.required,le.min(I),le.step(I),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),C=n.computed(()=>{var P,I,K;return a.value?((P=a.value.properties)==null?void 0:P.lengthStep)??((I=a.value.properties)!=null&&I.ignoreMinCountCheck?0:((K=a.value.properties)==null?void 0:K.minCount)??0):0}),N=n.computed(()=>{var K,J,Z,L,A,O,V,R,H;if(!a.value)return"";const P=((J=(K=a.value)==null?void 0:K.properties)==null?void 0:J.minLength)??((L=(Z=a.value)==null?void 0:Z.properties)!=null&&L.ignoreMinCountCheck?0:(O=(A=a.value)==null?void 0:A.properties)==null?void 0:O.minCount),I=(R=(V=a.value)==null?void 0:V.properties)==null?void 0:R.maxLength;return P||I?`(${P?`от ${P}`:""}${P&&I?" ":""}${I?`до ${I}`:""} ${(H=a.value)==null?void 0:H.unit.name})`:""}),w=P=>{var L,A;if(!((A=(L=a.value)==null?void 0:L.properties)!=null&&A.isLengthConfigurator)||!f.value||z.isNil(P)||C.value===0)return;const I=P/C.value,K=Math.round(I),J=q.UnitsHelper.getProductMultiplicity(a.value),Z=Math.max(K,J);f.value.quantity=Z},S=P=>{var Z,L,A,O;if(!((L=(Z=a.value)==null?void 0:Z.properties)!=null&&L.isLengthConfigurator)||!f.value||z.isNil(P)||C.value===0)return;const I=P*C.value,K=((A=a.value.properties)==null?void 0:A.minLength)||q.UnitsHelper.getProductLengthMultiplicity(a.value),J=(O=a.value.properties)==null?void 0:O.maxLength;K!==void 0&&I<K?f.value.length=K:J!==void 0&&I>J?f.value.length=J:f.value.length=I},v=async P=>{var K;const I=z.cloneDeep(f.value);try{await((K=r.value)==null?void 0:K.validate(J=>{if(!J){if(!a.value||!I)return;q.UnitsHelper.productIsMeasurable(a.value)||delete I.length,l.value&&C.value&&(I.length=C.value),k.value=!0,b("submit",I,_.value,()=>{k.value=!1,P(!1),n.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(z.noop).catch(z.noop)})})}}))}catch{}},$=()=>{a.value=null,d.value=void 0,f.value=null,_.value=y()},E=()=>{s.value=!1};return e({show:(P,I)=>{var K,J,Z,L,A;if($(),s.value=!0,a.value=P,d.value=I==null?void 0:I.cartItemData,u.value=I==null?void 0:I.orderId,h.value=(I==null?void 0:I.canSetDopProdaga)??!1,f.value=new q.OrderItemBase((I==null?void 0:I.cartItemData)??new q.OrderItemBase({product:P,quantity:q.UnitsHelper.productIsMeasurable(a.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})),(A=P==null?void 0:P.properties)!=null&&A.isLengthConfigurator&&f.value&&C.value>0){const O=C.value,V=f.value.quantity||1;f.value.length=V*O}},closeDialog:E}),(P,I)=>{var A;const K=M.NFormItem,J=M.NInputGroupLabel,Z=M.NInputGroup,L=M.NCheckbox;return n.openBlock(),n.createBlock(Ts,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(A=a.value)==null?void 0:A.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:k.value,"modal-width":500,onAccept:v,onClosing:E},{default:n.withCtx(()=>[a.value&&f.value?n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{key:0,ref:"form-reference",model:f.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>[n.unref(q.UnitsHelper).productIsMeasurable(a.value)?(n.openBlock(),n.createBlock(K,{key:0,path:"length",label:`Метраж, ${N.value+a.value.unit.name}`},n.createSlots({default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:p.value,"onUpdate:value":[I[0]||(I[0]=O=>p.value=O),w],parse:n.unref(ct),step:n.unref(q.UnitsHelper).getProductLengthMultiplicity(a.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:I[1]||(I[1]=O=>n.unref(ro)(O,".",!1)),onInput:I[2]||(I[2]=O=>n.unref(rt)(_.value,"length")),onFocus:n.unref(He)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&n.unref(q.UnitsHelper).getProductLengthMultiplicity(a.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",L_,"Метраж должно быть кратно "+n.toDisplayString(n.unref(q.UnitsHelper).getProductLengthMultiplicity(a.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(M.NInputNumber),{value:m.value,"onUpdate:value":[I[3]||(I[3]=O=>m.value=O),S],parse:n.unref(ct),step:n.unref(q.UnitsHelper).getProductMultiplicity(a.value),"show-button":n.unref(q.UnitsHelper).getProductMultiplicity(a.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:I[4]||(I[4]=O=>n.unref(ro)(O,".",!1)),onInput:I[5]||(I[5]=O=>n.unref(rt)(_.value,"quantity")),onFocus:n.unref(He)},null,8,["value","parse","step","show-button","onFocus"]),l.value?(n.openBlock(),n.createBlock(J,{key:0,class:"bg-orange-100 font-bold"},{default:n.withCtx(()=>[n.createTextVNode(" x "+n.toDisplayString(C.value)+" "+n.toDisplayString(a.value.unit.name),1)]),_:1})):n.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&n.unref(q.UnitsHelper).getProductMultiplicity(a.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",H_,"Количество должно быть кратно "+n.toDisplayString(n.unref(q.UnitsHelper).getProductMultiplicity(a.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),n.unref(q.UnitsHelper).productIsMeasurable(a.value)?(n.openBlock(),n.createBlock(K,{key:1,path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:f.value.marker??null,placeholder:"Введите маркировку",onInput:I[6]||(I[6]=O=>n.unref(rt)(_.value,"marker")),"onUpdate:value":I[7]||(I[7]=O=>g(O)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1})):n.createCommentVNode("",!0),h.value?(n.openBlock(),n.createBlock(L,{key:2,checked:f.value.isAdditionalSale,"onUpdate:checked":I[8]||(I[8]=O=>f.value.isAdditionalSale=O),"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 O,V;return(V=(O=o.value)==null?void 0:O.acceptHandler)==null?void 0:V.call(O)}]]):n.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),q_={class:"flex flex-row gap-1"},X_={class:"sc-client-name flex flex-col gap-1 text-base"},Y_=["href"],U_={key:1,class:"text-sc-grey"},K_={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},G_={key:0},Z_={key:1,class:"text-sm"},Q_={},Vr=n.defineComponent({...Q_,__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?Me.format(i.client.lastLoginAt,q.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{z.isNil(i.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",i.client,a)};return(a,l)=>{const c=oo,d=M.NButton,u=M.NPopover;return n.openBlock(),n.createElementBlock("div",q_,[t.showClientInfoIcon?(n.openBlock(),n.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})):n.createCommentVNode("",!0),n.createVNode(u,{disabled:n.unref(z.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:n.withCtx(()=>[n.createElementVNode("div",X_,[n.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>s(h))},[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",U_," [ Деактивирован ] "))],8,Y_),t.showCityAndRegion&&t.client.city?(n.openBlock(),n.createElementBlock("span",K_," г. "+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",G_,n.toDisplayString(t.client.alternativeName),1)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("span",Z_," Последний вход: "+n.toDisplayString(o.value),1)):n.createCommentVNode("",!0),n.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),J_={class:"text-base"},ew={},Lu=n.defineComponent({...ew,__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",J_,n.toDisplayString(i.value),1))}}),tw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nw(t,e){return n.openBlock(),n.createElementBlock("svg",tw,[...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 iw=n.markRaw({name:"tabler-mail",render:nw}),rw=["href"],ow={},sw=n.defineComponent({...ow,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,i)=>{const r=iw;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,rw)],2)}}}),aw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lw(t,e){return n.openBlock(),n.createElementBlock("svg",aw,[...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 Hu=n.markRaw({name:"fa6-brands-viber",render:lw}),cw={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},dw=["id"],uw=["id"],fw=["fill"],hw=["fill"];function mw(t,e){return n.openBlock(),n.createElementBlock("svg",cw,[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,dw),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,uw)]),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,fw),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,hw),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 Wu=n.markRaw({name:"logos-whatsapp-icon",render:mw,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),pw={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},gw=["id"],yw=["fill"];function bw(t,e){return n.openBlock(),n.createElementBlock("svg",pw,[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,gw)]),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,yw),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 ju=n.markRaw({name:"logos-telegram",render:bw,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),_w={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ww(t,e){return n.openBlock(),n.createElementBlock("svg",_w,[...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 qu=n.markRaw({name:"ion-call",render:ww}),xw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kw(t,e){return n.openBlock(),n.createElementBlock("svg",xw,[...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 vw=n.markRaw({name:"tabler-phone-call",render:kw}),Cw={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Sw=["href"],Bw=["href"],Tw=["href"],Nw=["href"],$w={},Ew=n.defineComponent({...$w,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,i=n.computed(()=>{try{return e.phone?wr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=n.computed(()=>{var l;return z.isString(i.value)?!1:((l=i.value)==null?void 0:l.isValid())??!1}),o=n.computed(()=>{var l;return z.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=n.computed(()=>{var l;return z.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("E.164"))??""}),a=n.ref(!1);return(l,c)=>{const d=vw,u=qu,h=ju,f=Wu,m=Hu;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&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=p=>a.value=!a.value),onFocusout:c[1]||(c[1]=p=>a.value=!1),onMouseleave:c[2]||(c[2]=p=>a.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&&a.value?(n.openBlock(),n.createElementBlock("div",Cw,[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,Sw)):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(h)],8,Bw)):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(f)],8,Tw)):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,Nw)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],34)])}}}),Rw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Pw(t,e){return n.openBlock(),n.createElementBlock("svg",Rw,[...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 Fw=n.markRaw({name:"mdi-envelope",render:Pw}),Vw={class:"flex flex-col gap-1"},Mw={key:0,class:"mb-2 flex flex-col text-base"},Iw={key:0,class:"text-sc-dark-grey text-sm"},Aw={key:1,class:"whitespace-nowrap text-sm"},Ow={key:2,class:"whitespace-nowrap text-sm"},zw={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Dw=["href"],Lw=["href"],Hw=["href"],Ww=["href"],jw=["href"],qw={key:0,class:"flex flex-col text-base"},Xw={key:0,class:"text-sc-dark-grey text-sm"},Yw={key:1,class:"mt-2 text-sm"},Uw={key:0,class:"-mt-1"},Kw={},Gw=n.defineComponent({...Kw,__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?wr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=n.computed(()=>{var d;return z.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=n.computed(()=>{var d;return z.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),a=n.computed(()=>{var d;return z.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),l=n.computed(()=>o.value||e.contact.email),c=n.ref(!1);return(d,u)=>{var y,_;const h=qu,f=ju,m=Wu,p=Hu,g=Fw,b=M.NPopover;return n.openBlock(),n.createElementBlock("div",Vw,[n.createVNode(b,{disabled:t.fullView,placement:"bottom"},{trigger:n.withCtx(()=>{var k,x,C,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",Mw,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(C=t.contact)!=null&&C.position?(n.openBlock(),n.createElementBlock("span",Iw,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",Aw,n.toDisplayString(s.value),1)):n.createCommentVNode("",!0),t.contact.email?(n.openBlock(),n.createElementBlock("div",Ow,n.toDisplayString(t.contact.email),1)):n.createCommentVNode("",!0),l.value&&c.value?(n.openBlock(),n.createElementBlock("div",zw,[o.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:`tel:${a.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[n.createVNode(h)],8,Dw)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:1,href:`https://t.me/${a.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(f)],8,Lw)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:2,href:`https://wa.me/${a.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(m)],8,Hw)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:3,href:`viber://chat?number=${a.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[n.createVNode(p)],8,Ww)):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,jw)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])],38)]}),default:n.withCtx(()=>{var k,x,C,N;return[t.contact.name?(n.openBlock(),n.createElementBlock("div",qw,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(k=t.contact)!=null&&k.position?(n.openBlock(),n.createElementBlock("span",Xw,n.toDisplayString((x=t.contact)==null?void 0:x.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(n.openBlock(),n.createElementBlock("div",Yw,[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",Uw,[u[5]||(u[5]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((_=t.contact)==null?void 0:_.comment),1)])):n.createCommentVNode("",!0)])}}});class Zw{constructor(e){T(this,"minHeight");T(this,"maxHeights");T(this,"minWidth");T(this,"maxWidths");T(this,"netType");T(this,"color");T(this,"mountType");T(this,"descriptions");T(this,"crossbarCount");T(this,"heightOverlaps");T(this,"widthOverlaps");T(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=bs.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=bs.objectToSnake(e.heightOverlaps),this.widthOverlaps=bs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function Qw(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==q.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&z.isArray(t.products)&&t.products.length>0}const Jw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ex(t,e){return n.openBlock(),n.createElementBlock("svg",Jw,[...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 tx=n.markRaw({name:"mdi-dots-horizontal",render:ex}),Xu="date-range.dialog.mode",Yu=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Uu=(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?Me.startOfDay(r):void 0,to:o?Me.endOfDay(o):void 0}},nx={class:"text-center font-semibold"},ix={class:"grid grid-cols-3 gap-1"},rx=["onPointerdown","onPointerenter","onKeydown"],ox={},sx=n.defineComponent({...ox,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const i=t,r=e,o=M.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})),a=w=>{const S=new Date().getFullYear();return w&&Me.isValid(w)?w.getFullYear():S},l=n.ref(a(i.from??i.to)),c=et.initRefDependingOnDeviceResolution(1,3,3),d=n.computed(()=>c.value===1?[l.value]:[l.value-1,l.value,l.value+1]),u=n.ref(null),h=n.ref(null),f=n.ref(!1),m=n.ref(null),p=n.computed(()=>{const{from:w,to:S}=i;return!w||!S||!Me.isSameDay(w,Me.startOfMonth(w))||!Me.isSameDay(S,Me.endOfMonth(S))?null:[w.getFullYear()*12+w.getMonth(),S.getFullYear()*12+S.getMonth()]}),g=n.computed(()=>f.value&&h.value!==null&&m.value!==null?b(h.value,m.value):u.value!==null?m.value===null?[u.value,u.value]:b(u.value,m.value):p.value),b=(w,S)=>w<=S?[w,S]:[S,w],y=(w,S)=>{const v=w*12+S,$=g.value;return $&&v>=$[0]&&v<=$[1]?[v===$[0]||v===$[1]?"sc-month--bound":"sc-month--in-range"]:[]},_=(w,S)=>{const[v,$]=b(w,S);u.value=null,r("select",{from:new Date(Math.floor(v/12),v%12,1),to:Me.endOfMonth(new Date(Math.floor($/12),$%12,1))})},k=w=>{u.value===null?(u.value=w,r("select",{from:new Date(Math.floor(w/12),w%12,1),to:Me.endOfMonth(new Date(Math.floor(w/12),w%12,1))})):_(u.value,w)},x=()=>{globalThis.removeEventListener("pointerup",x);const w=h.value;if(w!==null){if(h.value=null,f.value){f.value=!1,m.value!==null&&_(w,m.value);return}k(w)}},C=(w,S)=>{h.value=w*12+S,f.value=!1,globalThis.addEventListener("pointerup",x)},N=(w,S)=>{const v=w*12+S;m.value=v,h.value!==null&&v!==h.value&&(f.value=!0)};return n.watch(()=>[i.from,i.to],()=>{const w=i.from??i.to;if(!w||!Me.isValid(w))return;const S=w.getFullYear();(S<l.value-1||S>l.value+1)&&(l.value=S)}),n.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",x)}),(w,S)=>{const v=M.NButton;return n.openBlock(),n.createElementBlock("div",{class:"flex select-none items-start gap-2",style:n.normalizeStyle(s.value),onPointerleave:S[2]||(S[2]=$=>m.value=null)},[n.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[0]||(S[0]=$=>l.value-=1)},{default:n.withCtx(()=>[...S[3]||(S[3]=[n.createTextVNode(" ‹ ",-1)])]),_:1}),n.createElementVNode("div",{class:n.normalizeClass(["grid flex-1 gap-4 sm:gap-8",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-1"},[n.createElementVNode("div",nx,n.toDisplayString($),1),n.createElementVNode("div",ix,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(Yu),(E,F)=>(n.openBlock(),n.createElementBlock("button",{key:E,type:"button",class:n.normalizeClass(["sc-month cursor-pointer rounded border-0 px-1 py-1 text-sm",y($,F)]),onPointerdown:n.withModifiers(P=>C($,F),["prevent"]),onPointerenter:P=>N($,F),onKeydown:[n.withKeys(n.withModifiers(P=>k($*12+F),["prevent"]),["enter"]),n.withKeys(n.withModifiers(P=>k($*12+F),["prevent"]),["space"])]},n.toDisplayString(E),43,rx))),128))])]))),128))],2),n.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[1]||(S[1]=$=>l.value+=1)},{default:n.withCtx(()=>[...S[4]||(S[4]=[n.createTextVNode(" › ",-1)])]),_:1})],36)}}}),ax=An(sx,[["__scopeId","data-v-7dd4941e"]]),lx={class:"sc-date-range-sidebar flex flex-col gap-1"},cx={class:"flex items-center justify-center gap-1"},dx={class:"min-w-12 text-center font-semibold"},ux={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},fx={},hx=n.defineComponent({...fx,__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=M.NButton;return n.openBlock(),n.createElementBlock("div",lx,[n.createElementVNode("div",cx,[n.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=a=>i("update:year",t.year-1))},{default:n.withCtx(()=>[...o[3]||(o[3]=[n.createTextVNode(" ‹ ",-1)])]),_:1}),n.createElementVNode("span",dx,n.toDisplayString(t.year),1),n.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=a=>i("update:year",t.year+1))},{default:n.withCtx(()=>[...o[4]||(o[4]=[n.createTextVNode(" › ",-1)])]),_:1})]),n.createElementVNode("div",ux,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(Yu),(a,l)=>(n.openBlock(),n.createBlock(s,{key:a,size:"small",quaternary:"",type:l===t.month?"primary":"default",onClick:c=>i("select-month",l)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a),1)]),_:2},1032,["type","onClick"]))),128))]),n.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=a=>i("today"))},{default:n.withCtx(()=>[...o[5]||(o[5]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),mx={},Ku=n.defineComponent({...mx,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>q.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=et.initRefDependingOnDeviceResolution(!0,!1,!1),s=n.ref(null),a=n.ref(!1),l=n.ref(0),c=n.ref(i.value&&Me.isValid(i.value)?i.value:new Date),d=n.computed(()=>{const k=i.value&&Me.isValid(i.value)?i.value:c.value;return k.getFullYear()===c.value.getFullYear()?k.getMonth():null});let u=0;const h=k=>{var x,C;(C=(x=k.target)==null?void 0:x.closest)!=null&&C.call(x,".n-base-clear")&&(u=performance.now())},f=k=>{k&&performance.now()-u<300||(a.value=k,k&&(c.value=i.value&&Me.isValid(i.value)?i.value:new Date))},m=k=>{r("update:value",k===null?null:new Date(k))},p=(k,x)=>{const C=new Date(k,x,1);if(c.value=C,i.value&&Me.isValid(i.value)){const N=Math.min(Me.getDate(i.value),Me.getDaysInMonth(C));r("update:value",new Date(k,x,N));return}l.value+=1,n.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(k,x)=>{c.value=Me.addYears(Me.addMonths(c.value,k),x)},b=k=>{p(k,c.value.getMonth())},y=k=>{p(c.value.getFullYear(),k)},_=()=>{a.value=!1,r("update:value",new Date)};return(k,x)=>{const C=M.NButton,N=M.NDatePicker;return n.openBlock(),n.createBlock(N,{ref_key:"pickerReference",ref:s,key:l.value,value:i.value?i.value.getTime():null,show:a.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:h,"onUpdate:show":f,"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(C,{key:1,size:"small",text:"",type:"info",onClick:_},{default:n.withCtx(()=>[...x[4]||(x[4]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})):(n.openBlock(),n.createBlock(hx,{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"])}}}),px={key:0,class:"text-gray-400"},gx={},Gu=n.defineComponent({...gx,__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=et.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var a,l;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(Ku,{value:t.from,clearable:t.clearable,disabled:(a=t.disabled)==null?void 0:a.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",px," – ")),n.createVNode(Ku,{value:t.to,clearable:t.clearable,disabled:(l=t.disabled)==null?void 0:l.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)}}}),yx={class:"flex flex-col items-stretch gap-3 sm:flex-row"},bx={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},_x={class:"flex flex-col items-stretch pr-3"},wx={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},xx={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},kx={},vx=n.defineComponent({...kx,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const i=t,r=e,o="custom",s=et.initRefDependingOnDeviceResolution(!0,!1,!1),a=q.DateTimeProvider.standardPeriods(),l=n.ref(q.STANDARD_PERIOD_GROUPS[0].key),c=n.computed(()=>{const h=q.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return z.isEmpty(i.customPeriods)||h.push({key:o,value:o,label:"Пользовательские"}),h}),d=h=>Object.entries(h).map(([f,m])=>({value:f,label:m.label,item:m})),u=n.computed(()=>{if(l.value===o)return[{type:"group",key:o,children:d(i.customPeriods??{})}];const h=Object.entries(a).filter(([,m])=>m.group===l.value),f=Object.fromEntries(h);return l.value!=="other"?[{type:"group",key:l.value,children:d(f)}]:q.STANDARD_PERIOD_SECTIONS.map(m=>{const p=h.filter(([,g])=>g.section===m.key);return{type:"group",key:m.key,label:m.label,children:d(Object.fromEntries(p))}}).filter(m=>{var p;return(((p=m.children)==null?void 0:p.length)??0)>0})});return(h,f)=>{const m=M.NButton,p=M.NScrollbar,g=M.NSelect,b=M.NMenu;return n.openBlock(),n.createElementBlock("div",yx,[n.createElementVNode("div",bx,[n.createVNode(p,{class:"max-h-96"},{default:n.withCtx(()=>[n.createElementVNode("div",_x,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,y=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:y.key},[y.label?(n.openBlock(),n.createElementBlock("div",wx,n.toDisplayString(y.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.children,_=>(n.openBlock(),n.createBlock(m,{key:_.value,size:"small",quaternary:"",type:_.value===t.activeKey?"primary":"default",class:"justify-start",onClick:k=>r("apply",_),onMouseenter:k=>r("preview",_),onMouseleave:f[0]||(f[0]=k=>r("preview"))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(_.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),n.unref(s)?(n.openBlock(),n.createBlock(g,{key:0,value:l.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=y=>l.value=y)},null,8,["value","options"])):(n.openBlock(),n.createElementBlock("div",xx,[n.createVNode(b,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=y=>l.value=y)},null,8,["value","options"])]))])}}}),Cx={class:"flex flex-col gap-3"},Sx={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},Bx={key:0,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},Tx={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},Nx={class:"flex gap-2"},$x={},Ex=n.defineComponent({...$x,__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=et.initRefDependingOnDeviceResolution("100%","90%","44rem"),s=n.ref("custom"),a=()=>q.PreferencesStorageProvider.getActualDataFromStorage(Xu)==="standard"?"standard":"custom",l=n.ref({}),c=n.ref(null),d=n.ref(null),u=n.computed(()=>c.value??l.value),h=(x,C)=>{var S,v;const N=(S=i.disabled)!=null&&S.from?l.value.from:x,w=(v=i.disabled)!=null&&v.to?l.value.to:C;c.value=null,l.value=Uu(N,w,i.disabled)},f=x=>{d.value=null,h(x,l.value.to)},m=x=>{d.value=null,h(l.value.from,x)},p=()=>{d.value=null,h(null,null)},g=x=>{d.value=null,h(x.from,x.to)},b=x=>{const C=x.item;h(C.from,C.to),d.value=String(x.value)},y=x=>{const C=x==null?void 0:x.item;c.value=C?{from:C.from,to:C.to}:null},_=()=>{c.value=null,s.value=s.value==="custom"?"standard":"custom";const x=Xu;q.PreferencesStorageProvider.saveActualDataToStorage(x,s.value,Me.addYears(Me.startOfToday(),1))},k=()=>{r("select",l.value),r("update:show",!1)};return n.watch(()=>i.show,x=>{x&&(s.value=a(),d.value=null,c.value=null,l.value={...i.dateRange})}),(x,C)=>{const N=M.NButton,w=M.NModal;return n.openBlock(),n.createBlock(w,{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":C[1]||(C[1]=S=>r("update:show",S))},{footer:n.withCtx(()=>[n.createElementVNode("div",Tx,[n.createVNode(N,{text:"",type:"info",onClick:_},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),n.createElementVNode("div",Nx,[n.createVNode(N,{type:"primary",onClick:k},{default:n.withCtx(()=>[...C[3]||(C[3]=[n.createTextVNode(" Выбрать ",-1)])]),_:1}),n.createVNode(N,{onClick:C[0]||(C[0]=S=>r("update:show",!1))},{default:n.withCtx(()=>[...C[4]||(C[4]=[n.createTextVNode("Отмена",-1)])]),_:1})])])]),default:n.withCtx(()=>[n.createElementVNode("div",Cx,[n.createElementVNode("div",Sx,[n.createVNode(Gu,{from:u.value.from,to:u.value.to,clearable:t.clearable,disabled:t.disabled,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":f,"onUpdate:to":m},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(n.openBlock(),n.createBlock(N,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:p},{default:n.withCtx(()=>[...C[2]||(C[2]=[n.createTextVNode(" Очистить период ",-1)])]),_:1})):n.createCommentVNode("",!0)]),s.value==="custom"?(n.openBlock(),n.createElementBlock("div",Bx,[n.createVNode(ax,{from:l.value.from,to:l.value.to,onSelect:g},null,8,["from","to"])])):(n.openBlock(),n.createBlock(vx,{key:1,"active-key":d.value,"custom-periods":t.customPeriods,onApply:b,onPreview:y},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),Rx={class:"flex w-full min-w-0 items-center gap-1"},Px={},Fx=n.defineComponent({...Px,__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?q.DateTimeProvider.defaultDateRanges():{},...i.predefinedDateRanges};return z.isEmpty(u)?void 0:u}),a=(u,h)=>{r("update:date-range",Uu(u,h,i.disabled))},l=u=>{var h;a(u,(h=i.dateRange)==null?void 0:h.to)},c=u=>{var h;a((h=i.dateRange)==null?void 0:h.from,u)},d=u=>{a(u.from,u.to)};return(u,h)=>{var p,g,b,y;const f=tx,m=M.NButton;return n.openBlock(),n.createElementBlock("div",Rx,[n.createVNode(Gu,{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":l,"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:h[0]||(h[0]=_=>o.value=!0)},{default:n.withCtx(()=>[n.createVNode(f)]),_:1},8,["disabled"]),n.createVNode(Ex,{show:o.value,"onUpdate:show":h[1]||(h[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"])])}}}),Vx={class:"sc-lbl-date text-nowrap"},Mx={},Xo=n.defineComponent({...Mx,__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(()=>Me.format(e.date,q.useBaseConfigStateStore().config.dateFormats.uiDate)),r=n.computed(()=>Me.format(e.date,"HH:mm"));return(o,s)=>(n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[n.createElementVNode("span",Vx,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))}}),Ix={},Ax=n.defineComponent({...Ix,__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)}}),Ox={class:"flex flex-row gap-2.5"},zx={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},Dx={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Lx={class:"mb-0.5 sm:mb-0 sm:ml-3"},Hx={},Wx=n.defineComponent({...Hx,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,i)=>{const r=qo,o=M.NButton,s=M.NPopover;return n.openBlock(),n.createElementBlock("div",Ox,[n.createElementVNode("div",zx,[n.renderSlot(e.$slots,"main")]),n.createElementVNode("div",null,[n.createElementVNode("div",Dx,[n.renderSlot(e.$slots,"extra-buttons"),n.createElementVNode("div",Lx,[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]=a=>e.$emit("close"))},{default:n.withCtx(()=>[n.createVNode(r)]),_:1})]),default:n.withCtx(()=>[i[1]||(i[1]=n.createTextVNode(" Закрыть ",-1))]),_:1})):n.createCommentVNode("",!0)])])])])}}}),jx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qx(t,e){return n.openBlock(),n.createElementBlock("svg",jx,[...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 Xx=n.markRaw({name:"ion-checkmark-done-sharp",render:qx}),Yx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ux(t,e){return n.openBlock(),n.createElementBlock("svg",Yx,[...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 Kx=n.markRaw({name:"ion-options-outline",render:Ux}),Gx={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Zx={class:"flex-auto"},Qx={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"},Jx={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"},ek={},Ba=n.defineComponent({...ek,__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},a=()=>{r.value=!0,i("apply",s)},l=()=>{i("cancel",s)};return(c,d)=>{const u=Kx,h=M.NButton,f=M.NPopover,m=Xx,p=qo;return n.openBlock(),n.createElementBlock("div",Gx,[n.createElementVNode("div",Zx,[n.renderSlot(c.$slots,"default")]),n.createElementVNode("div",null,[n.createElementVNode("div",Qx,[n.createElementVNode("div",Jx,[t.showEditButton?(n.openBlock(),n.createBlock(f,{key:0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(h,{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(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(h,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{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(f,{key:2,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{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")])])])}}}),tk={},Zu=n.defineComponent({...tk,__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=l=>{r("editor:apply",d=>{o.value=!d,l()})},a=l=>{o.value=!1,l(),r("editor:cancel")};return n.onMounted(()=>{n.watch(()=>i.showEditor,l=>{o.value=l})}),(l,c)=>(n.openBlock(),n.createElementBlock("div",null,[o.value?(n.openBlock(),n.createBlock(Ba,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,onCancel:a},{"extra-buttons":n.withCtx(()=>[n.renderSlot(l.$slots,"extra-editor-buttons")]),default:n.withCtx(()=>[n.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(n.openBlock(),n.createBlock(Ba,{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(l.$slots,"extra-viewer-buttons")]),default:n.withCtx(()=>[n.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),nk={key:0,class:"whitespace-pre-line"},ik={key:1,class:"text-sc-dark-grey"},rk={},ok=n.defineComponent({...rk,__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,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=i.comment};return(l,c)=>{const d=M.NInput;return n.openBlock(),n.createBlock(Zu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:n.withCtx(()=>[n.createElementVNode("div",null,[t.comment?(n.openBlock(),n.createElementBlock("span",nk,n.toDisplayString(t.comment),1)):(n.openBlock(),n.createElementBlock("span",ik," - Комментарий отсутствует - "))])]),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"])}}}),sk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ak(t,e){return n.openBlock(),n.createElementBlock("svg",sk,[...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 lk=n.markRaw({name:"ion-download-outline",render:ak}),ck={},dk=n.defineComponent({...ck,__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(l=>(l.status=i.isError?"error":"finished",l))),a=l=>{o.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=lk;return n.openBlock(),n.createBlock(n.unref(M.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":a},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NUploadDragger),null,{default:n.withCtx(()=>[n.renderSlot(l.$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"])}}}),uk={viewBox:"0 0 512 512",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:"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 hk=n.markRaw({name:"ion-warning",render:fk}),mk={},pk=n.defineComponent({...mk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,i)=>{const r=hk,o=M.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"])}}}),gk={},yk=n.defineComponent({...gk,__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)),a=z.debounce(()=>r("update:value",o.value),s.value),l=c=>{o.value=c,a()};return n.watch(()=>i.value,c=>{o.value=c}),(c,d)=>(n.openBlock(),n.createBlock(n.unref(M.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:n.withCtx(()=>[n.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),bk={},_k=n.defineComponent({...bk,__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),a=n.computed(()=>n.inject("debounce-input-time",r.debounceTime)),l=z.debounce(()=>o("update:value",s.value),a.value),c=m=>{s.value=m,l()};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(M.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"]))}}),wk={},xk=n.defineComponent({...wk,__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=z.debounce(c=>r("update:value",c),i.debounceTime??0),a=c=>{let d="";if(z.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(z.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof wr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}i.debounceTime?s(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=wr.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof wr.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,""))&&l(c)},{immediate:!0}),n.onBeforeMount(()=>l(o.value??"")),(c,d)=>(n.openBlock(),n.createBlock(n.unref(am.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),kk=An(xk,[["__scopeId","data-v-751dbb0e"]]),vk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ck(t,e){return n.openBlock(),n.createElementBlock("svg",vk,[...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 Sk=n.markRaw({name:"tabler-external-link",render:Ck}),Bk={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Tk=["href"],Nk={},$k=n.defineComponent({...Nk,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,i)=>{const r=Sk,o=M.NTooltip;return n.openBlock(),n.createBlock(o,{disabled:n.unref(z.isUndefined)(t.description),placement:"top-start"},{trigger:n.withCtx(()=>[n.createElementVNode("span",Bk,[n.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},n.toDisplayString(t.text),9,Tk),n.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Ek={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Rk(t,e){return n.openBlock(),n.createElementBlock("svg",Ek,[...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 Pk=n.markRaw({name:"ion-remove-circle-outline",render:Rk});let Yo=[];const Qu=new WeakMap;function Fk(){Yo.forEach(t=>t(...Qu.get(t))),Yo=[]}function Ju(t,...e){Qu.set(t,e),!Yo.includes(t)&&Yo.push(t)===1&&requestAnimationFrame(Fk)}function Mr(t,e){let{target:i}=t;for(;i;){if(i.dataset&&i.dataset[e]!==void 0)return!0;i=i.parentElement}return!1}function Ir(t){return t.composedPath()[0]||null}function Ar(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Or(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 ef={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 Vk(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 Mk(t,e,i){e/=100,i/=100;let r=e*Math.min(i,1-i),o=(s,a=(s+t/30)%12)=>i-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const $n="^\\s*",En="\\s*$",li="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Gt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Bi="([0-9A-Fa-f])",Ti="([0-9A-Fa-f]{2})",tf=new RegExp(`${$n}hsl\\s*\\(${Gt},${li},${li}\\)${En}`),nf=new RegExp(`${$n}hsv\\s*\\(${Gt},${li},${li}\\)${En}`),rf=new RegExp(`${$n}hsla\\s*\\(${Gt},${li},${li},${Gt}\\)${En}`),of=new RegExp(`${$n}hsva\\s*\\(${Gt},${li},${li},${Gt}\\)${En}`),Ik=new RegExp(`${$n}rgb\\s*\\(${Gt},${Gt},${Gt}\\)${En}`),Ak=new RegExp(`${$n}rgba\\s*\\(${Gt},${Gt},${Gt},${Gt}\\)${En}`),Ok=new RegExp(`${$n}#${Bi}${Bi}${Bi}${En}`),zk=new RegExp(`${$n}#${Ti}${Ti}${Ti}${En}`),Dk=new RegExp(`${$n}#${Bi}${Bi}${Bi}${Bi}${En}`),Lk=new RegExp(`${$n}#${Ti}${Ti}${Ti}${Ti}${En}`);function Xt(t){return parseInt(t,16)}function Hk(t){try{let e;if(e=rf.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),$i(e[13])];if(e=tf.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function Wk(t){try{let e;if(e=of.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),$i(e[13])];if(e=nf.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function Ni(t){try{let e;if(e=zk.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),1];if(e=Ik.exec(t))return[St(e[1]),St(e[5]),St(e[9]),1];if(e=Ak.exec(t))return[St(e[1]),St(e[5]),St(e[9]),$i(e[13])];if(e=Ok.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),1];if(e=Lk.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),$i(Xt(e[4])/255)];if(e=Dk.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),$i(Xt(e[4]+e[4])/255)];if(t in ef)return Ni(ef[t]);if(tf.test(t)||rf.test(t)){const[i,r,o,s]=Hk(t);return[...Mk(i,r,o),s]}else if(nf.test(t)||of.test(t)){const[i,r,o,s]=Wk(t);return[...Vk(i,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function jk(t){return t>1?1:t<0?0:t}function Ta(t,e,i,r){return`rgba(${St(t)}, ${St(e)}, ${St(i)}, ${jk(r)})`}function Na(t,e,i,r,o){return St((t*e*(1-r)+i*r)/o)}function qk(t,e){Array.isArray(t)||(t=Ni(t)),Array.isArray(e)||(e=Ni(e));const i=t[3],r=e[3],o=$i(i+r-i*r);return Ta(Na(t[0],i,e[0],r,o),Na(t[1],i,e[1],r,o),Na(t[2],i,e[2],r,o),o)}function De(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:Ni(t);return typeof e.alpha=="number"?Ta(i,r,o,e.alpha):Ta(i,r,o,s)}function Uo(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:Ni(t),{lightness:a=1,alpha:l=1}=e;return Xk([i*a,r*a,o*a,s*l])}function $i(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function Ko(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 Xk(t){const[e,i,r]=t;return 3 in t?`rgba(${St(e)}, ${St(i)}, ${St(r)}, ${$i(t[3])})`:`rgba(${St(e)}, ${St(i)}, ${St(r)}, 1)`}function Yk(t=8){return Math.random().toString(16).slice(2,2+t)}function sf(t){return Array.isArray(t)?t:[t]}const $a={STOP:"STOP"};function af(t,e){const i=e(t);t.children!==void 0&&i!==$a.STOP&&t.children.forEach(r=>af(r,e))}function Uk(t,e={}){const{preserveGroup:i=!1}=e,r=[],o=i?a=>{a.isLeaf||(r.push(a.key),s(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),s(a.children))};function s(a){a.forEach(o)}return s(t),r}function Kk(t,e){const{isLeaf:i}=t;return i!==void 0?i:!e(t)}function Gk(t){return t.children}function Zk(t){return t.key}function Qk(){return!1}function Jk(t,e){const{isLeaf:i}=t;return!(i===!1&&!Array.isArray(e(t)))}function ev(t){return t.disabled===!0}function tv(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function nv(t,e){if(t.isLeaf===!0){const i=e(t);if(Array.isArray(i)&&i.length>0)return!0}return!1}function Ea(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Ra(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function iv(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)||i.add(r)}),Array.from(i)}function rv(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)&&i.delete(r)}),Array.from(i)}function ov(t){return(t==null?void 0:t.type)==="group"}function sv(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 av extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function lv(t,e,i,r){return Go(e.concat(t),i,r,!1)}function cv(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 dv(t,e,i,r){const o=Go(e,i,r,!1),s=Go(t,i,r,!0),a=cv(t,i),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function Pa(t,e){const{checkedKeys:i,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:iv(i,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:rv(i,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(i),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let h;o!==void 0?h=dv(o,i,e,d):r!==void 0?h=lv(r,i,e,d):h=Go(i,e,d,!1);const f=c==="parent",m=c==="child"||l,p=h,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:C,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,S=!1,v=!0;for(const $ of x.children){const E=$.key;if(!$.disabled){if(v&&(v=!1),p.has(E))S=!0;else if(g.has(E)){S=!0,w=!1;break}else if(w=!1,S)break}}w&&!v?(f&&x.children.forEach($=>{!$.disabled&&p.has($.key)&&p.delete($.key)}),p.add(C)):S&&g.add(C),_&&m&&p.has(C)&&p.delete(C)}}return{checkedKeys:Array.from(p),indeterminateKeys:Array.from(g)}}function Go(t,e,i,r){const{treeNodeMap:o,getChildren:s}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=o.get(c);d!==void 0&&af(d,u=>{if(u.disabled)return $a.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),tv(u.rawNode,s))){if(r)return $a.STOP;if(!i)throw new av}})}),l}function uv(t,{includeGroup:e=!1,includeSelf:i=!0},r){var o;const s=r.treeNodeMap;let a=t==null?null:(o=s.get(t))!==null&&o!==void 0?o:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),i||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function fv(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function hv(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 lf(t,e,{loop:i=!1,includeDisabled:r=!1}={}){const o=e==="prev"?mv:hv,s={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=Fa(d,s);u!==null?l=u:c(o(d,i))}else{const u=o(d,!1);if(u!==null)c(u);else{const h=pv(d);h!=null&&h.isGroup?c(o(h,i)):i&&c(o(d,!0))}}}}return c(t),l}function mv(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 pv(t){return t.parent}function Fa(t,e={}){const{reverse:i=!1}=e,{children:r}=t;if(r){const{length:o}=r,s=i?o-1:0,a=i?-1:o,l=i?-1:1;for(let c=s;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Fa(d,e);if(u!==null)return u}else return d}}return null}const gv={getChild(){return this.ignored?null:Fa(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return lf(this,"next",t)},getPrev(t={}){return lf(this,"prev",t)}};function yv(t,e){const i=e?new Set(e):void 0,r=[];function o(s){s.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||i===void 0||i.has(a.key))&&o(a.children)})}return o(t),r}function bv(t,e){const i=t.key;for(;e;){if(e.key===i)return!0;e=e.parent}return!1}var _v={};function cf(t,e,i,r,o,s=null,a=0){const l=[];return t.forEach((c,d)=>{var u;_v.NODE_ENV!=="production"&&nv(c,o)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=s,!h.ignored){const f=o(c);Array.isArray(f)&&(h.children=cf(f,e,i,r,o,h,a+1))}l.push(h),e.set(h.key,h),i.has(a)||i.set(a,[]),(u=i.get(a))===null||u===void 0||u.push(h)}),l}function wv(t,e={}){var i;const r=new Map,o=new Map,{getDisabled:s=ev,getIgnored:a=Qk,getIsGroup:l=ov,getKey:c=Zk}=e,d=(i=e.getChildren)!==null&&i!==void 0?i:Gk,u=e.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return Kk(this.rawNode,u)},get shallowLoaded(){return Jk(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return bv(this,x)}},gv),f=cf(t,r,o,h,u);function m(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function g(x,C){const N=p(x);return N?N.getPrev(C):null}function b(x,C){const N=p(x);return N?N.getNext(C):null}function y(x){const C=p(x);return C?C.getParent():null}function _(x){const C=p(x);return C?C.getChild():null}const k={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return yv(f,x)},getNode:m,getPrev:g,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return fv(f)},getPath(x,C={}){return uv(x,C,k)},getCheckedKeys(x,C={}){const{cascade:N=!0,leafOnly:w=!1,checkStrategy:S="all",allowNotLoaded:v=!1}=C;return Pa({checkedKeys:Ea(x),indeterminateKeys:Ra(x),cascade:N,leafOnly:w,checkStrategy:S,allowNotLoaded:v},k)},check(x,C,N={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=N;return Pa({checkedKeys:Ea(C),indeterminateKeys:Ra(C),keysToCheck:x==null?[]:sf(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},uncheck(x,C,N={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=N;return Pa({checkedKeys:Ea(C),indeterminateKeys:Ra(C),keysToUncheck:x==null?[]:sf(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},getNonLeafKeys(x={}){return Uk(f,x)}};return k}function Zo(t){return t.composedPath()[0]}const xv={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function kv(t,e,i){if(t==="mousemoveoutside"){const r=o=>{e.contains(Zo(o))||i(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(Zo(a))},s=a=>{r&&(e.contains(Zo(a))||i(a))};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 df(t,e,i){const r=xv[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=kv(t,e,i)),s}function vv(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=df(t,e,i);return Object.keys(o).forEach(s=>{It(s,document,o[s],r)}),!0}return!1}function Cv(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=df(t,e,i);return Object.keys(o).forEach(s=>{ht(s,document,o[s],r)}),!0}return!1}function Sv(){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,S,v){const $=w[S];return w[S]=function(){return v.apply(w,arguments),$.apply(w,arguments)},w}function s(w,S){w[S]=Event.prototype[S]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,S){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:S??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(S){const{type:v,eventPhase:$,bubbles:E}=S,F=Zo(S);if($===2)return;const P=$===1?"capture":"bubble";let I=F;const K=[];for(;I===null&&(I=window),K.push(I),I!==window;)I=I.parentNode||null;const J=u.capture[v],Z=u.bubble[v];if(o(S,"stopPropagation",i),o(S,"stopImmediatePropagation",r),d(S,c),P==="capture"){if(J===void 0)return;for(let L=K.length-1;L>=0&&!t.has(S);--L){const A=K[L],O=J.get(A);if(O!==void 0){a.set(S,A);for(const V of O){if(e.has(S))break;V(S)}}if(L===0&&!E&&Z!==void 0){const V=Z.get(A);if(V!==void 0)for(const R of V){if(e.has(S))break;R(S)}}}}else if(P==="bubble"){if(Z===void 0)return;for(let L=0;L<K.length&&!t.has(S);++L){const A=K[L],O=Z.get(A);if(O!==void 0){a.set(S,A);for(const V of O){if(e.has(S))break;V(S)}}}}s(S,"stopPropagation"),s(S,"stopImmediatePropagation"),d(S)};return w.displayName="evtdUnifiedHandler",w}function m(){const w=function(S){const{type:v,eventPhase:$}=S;if($!==2)return;const E=h[v];E!==void 0&&E.forEach(F=>F(S))};return w.displayName="evtdUnifiedWindowEventHandler",w}const p=f(),g=m();function b(w,S){const v=u[w];return v[S]===void 0&&(v[S]=new Map,window.addEventListener(S,p,w==="capture")),v[S]}function y(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,g)),h[w]}function _(w,S){let v=w.get(S);return v===void 0&&w.set(S,v=new Set),v}function k(w,S,v,$){const E=u[S][v];if(E!==void 0){const F=E.get(w);if(F!==void 0&&F.has($))return!0}return!1}function x(w,S){const v=h[w];return!!(v!==void 0&&v.has(S))}function C(w,S,v,$){let E;if(typeof $=="object"&&$.once===!0?E=J=>{N(w,S,E,$),v(J)}:E=v,vv(w,S,E,$))return;const P=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",I=b(P,w),K=_(I,S);if(K.has(E)||K.add(E),S===window){const J=y(w);J.has(E)||J.add(E)}}function N(w,S,v,$){if(Cv(w,S,v,$))return;const F=$===!0||typeof $=="object"&&$.capture===!0,P=F?"capture":"bubble",I=b(P,w),K=_(I,S);if(S===window&&!k(S,F?"bubble":"capture",w,v)&&x(w,v)){const Z=h[w];Z.delete(v),Z.size===0&&(window.removeEventListener(w,g),h[w]=void 0)}K.has(v)&&K.delete(v),K.size===0&&I.delete(S),I.size===0&&(window.removeEventListener(w,p,P==="capture"),u[P][w]=void 0)}return{on:C,off:N}}const{on:It,off:ht}=Sv(),dr="@@mmoContext",Bv={mounted(t,{value:e}){t[dr]={handler:void 0},typeof e=="function"&&(t[dr].handler=e,It("mousemoveoutside",t,e))},updated(t,{value:e}){const i=t[dr];typeof e=="function"?i.handler?i.handler!==e&&(ht("mousemoveoutside",t,i.handler),i.handler=e,It("mousemoveoutside",t,e)):(t[dr].handler=e,It("mousemoveoutside",t,e)):i.handler&&(ht("mousemoveoutside",t,i.handler),i.handler=void 0)},unmounted(t){const{handler:e}=t[dr];e&&ht("mousemoveoutside",t,e),t[dr].handler=void 0}},ur="@@coContext",Qo={mounted(t,{value:e,modifiers:i}){t[ur]={handler:void 0},typeof e=="function"&&(t[ur].handler=e,It("clickoutside",t,e,{capture:i.capture}))},updated(t,{value:e,modifiers:i}){const r=t[ur];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[ur].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[ur];i&&ht("clickoutside",t,i,{capture:e.capture}),t[ur].handler=void 0}};function Tv(t,e){console.error(`[vdirs/${t}]: ${e}`)}class Nv{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&&Tv("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 Va=new Nv,fr="@@ziContext",uf={mounted(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i;t[fr]={enabled:!!o,initialized:!1},o&&(Va.ensureZIndex(t,r),t[fr].initialized=!0)},updated(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i,s=t[fr].enabled;o&&!s&&(Va.ensureZIndex(t,r),t[fr].initialized=!0),t[fr].enabled=!!o},unmounted(t,e){if(!t[fr].initialized)return;const{value:i={}}=e,{zIndex:r}=i;Va.unregister(t,r)}};function $v(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 Ev=typeof window<"u";let hr,zr;(()=>{var t,e;hr=Ev?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,zr=!1,hr!==void 0?hr.then(()=>{zr=!0}):zr=!0})();function Rv(t){if(zr)return;let e=!1;n.onMounted(()=>{zr||hr==null||hr.then(()=>{e||t()})}),n.onBeforeUnmount(()=>{e=!0})}function Ma(t,e){return n.watch(t,i=>{i!==void 0&&(e.value=i)}),n.computed(()=>t.value===void 0?e.value:t.value)}function Jo(){const t=n.ref(!1);return n.onMounted(()=>{t.value=!0}),n.readonly(t)}function ff(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 Pv=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Fv(){return Pv}function Ia(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);return r()}function Aa(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)){Aa(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Aa(r.children,e,i)}else r.type!==n.Comment&&i.push(r)}}),i}function hf(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);const o=Aa(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${i}] should have exactly one child.`)}let di=null;function mf(){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 Vv(t,e){const i=mf();return{top:e,left:t,height:0,width:0,right:i.width-t,bottom:i.height-e}}function Oa(t){const e=t.getBoundingClientRect(),i=mf();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 Mv(t){return t.nodeType===9?null:t.parentNode}function pf(t){if(t===null)return null;const e=Mv(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 pf(e)}const gf=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 a=()=>{let y=r.value;for(;y=pf(y),y!==null;)s.push(y);for(const _ of s)It("scroll",_,h,!0)},l=()=>{for(const y of s)ht("scroll",y,h,!0);s=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{Ju(f)},f=()=>{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),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:p,removeResizeListener:g}},render(){return Ia("binder",this.$slots)}}),yf=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(hf("follower",this.$slots),[[e]]):hf("follower",this.$slots)}}),Iv="@css-render/vue3-ssr";function Av(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},$o=ki.Multiply,a0=[1,0,0,0,1,0,0,0,1],ai=new wn(9),l0=Ct.Utils,vd=new re,sa=new wn([0,0,1,0,0,1,0,1,1,0,1,1]),Ce={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++)Ce.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 wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,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 a=Ct.Utils.getRendererType(this._mask._renderer.type);Ce[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=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++)Ce.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const a=this.children[s],l=Ct.Utils.getRendererType(a._renderer.type);Ce[l].render.call(a,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,a,l,c,d,u,h,f,m,p,g;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,k=t.renderer.ratio,x=vd.copy(e._renderer.scale).multiply(k),C=e._stroke,T=e._linewidth,w=e._fill,S=e._renderer.opacity||e._opacity,v=e._cap,$=e._join,E=e._miter,F=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 W=Ct.Utils.getRendererType(w._renderer.type);Ce[W].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const W=Ct.Utils.getRendererType(C._renderer.type);Ce[W].render.call(C,_,e),_.strokeStyle=C._renderer.effect}T&&(_.lineWidth=xn(e)),E&&(_.miterLimit=E),$&&(_.lineJoin=$),!F&&v&&(_.lineCap=v)}typeof S=="number"&&(_.globalAlpha=S),P&&P.length>0&&(_.lineDashOffset=P.offset||0,_.setLineDash(P));let A,O,V,R,H,Y,G,X;_.save(),_.scale(x.x,x.y),_.translate(Z,L),_.beginPath();for(let W=0;W<b.length;W++){const j=b[W];switch(m=j.x,p=j.y,j.command){case ie.close:_.closePath();break;case ie.arc:O=j.rx,V=j.ry,R=j.xAxisRotation,H=j.largeArcFlag,Y=j.sweepFlag,i=F?ot(W-1,I):Math.max(W-1,0),r=b[i],G=r.x,X=r.y,l0.renderSvgArcCommand(_,G,X,O,V,H,Y,R,m,p);break;case ie.curve:i=F?ot(W-1,I):Math.max(W-1,0),r=b[i],d=r.controls&&r.controls.right||re.zero,u=j.controls&&j.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),j._relative?(s=u.x+j.x,a=u.y+j.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,m,p),W>=K&&F&&(o=A,h=j.controls&&j.controls.right||re.zero,f=o.controls&&o.controls.left||re.zero,j._relative?(l=h.x+j.x,c=h.y+j.y):(l=h.x,c=h.y),o._relative?(s=f.x+o.x,a=f.y+o.y):(s=f.x,a=f.y),m=o.x,p=o.y,_.bezierCurveTo(l,c,s,a,m,p));break;case ie.line:_.lineTo(m,p);break;case ie.move:A=j,_.moveTo(m,p);break}}F&&_.closePath(),Ce.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()),Ce.isHidden.test(C)||(g=C._renderer&&C._renderer.offset,g&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y),_.lineWidth=T/C._renderer.scale.x),_.stroke(),g&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,i){let r=1/0,o=-1/0,s=1/0,a=-1/0,l,c;t.forEach(function(d){const u=d.x,h=d.y,f=d.controls;let m,p,g,b,y,_;s=Math.min(h,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(h,a),d.controls&&(y=f.left,_=f.right,!(!y||!_)&&(m=d._relative?y.x+u:y.x,p=d._relative?y.y+h:y.y,g=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!m||!p||!g||!b)&&(s=Math.min(p,b,s),r=Math.min(m,g,r),o=Math.max(m,g,o),a=Math.max(p,b,a))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,a+=e),l=o-r,c=a-s,i.top=s,i.left=r,i.right=o,i.bottom=a,i.width=l,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=Ct.Utils.getRendererType(this._renderer.type),s=e[o],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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(a||l||c){this._renderer.matrix||(this._renderer.matrix=new wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let h,f;this._scale instanceof re?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=Ct.Utils.getRendererType(this._mask._renderer.type);Ce[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Ce.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Ce.updateTexture.call(Ce,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,sa,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,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._size*s;let f=h;Ce.isHidden.test(a)||(f+=l),r.width=cc(f),r.height=r.width;const m=f/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=Ct.Utils.getRendererType(c._renderer.type);Ce[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const b=Ct.Utils.getRendererType(a._renderer.type);Ce[b].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=xn(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(Ce.precision,Ce.precision),o.beginPath(),o.arc(0,0,h/m*.5,0,tt),o.restore(),closed&&o.closePath(),Ce.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()),Ce.isHidden.test(a)||(i=a._renderer&&a._renderer.offset,i&&(o.save(),o.translate(-a._renderer.offset.x,-a._renderer.offset.y),o.scale(a._renderer.scale.x,a._renderer.scale.y),o.lineWidth=l/a._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],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=o._matrix.manual||o._flagMatrix,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==o,f=this._renderer.vertices,m=this._renderer.collection.length,p=this._flagVertices,g=this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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||h){this._renderer.matrix||(this._renderer.matrix=new wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,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,h&&(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,f,t.STATIC_DRAW)}return g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Ce.updateTexture.call(Ce,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:(Ce.isHidden.test(l)||(r+=c),r/=Ce.precision,a&&(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=vd.copy(e._renderer.scale).multiply(o),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,f=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,C,T,w,S,v,$;const E=c._renderer&&c._renderer.offset&&a._renderer&&a._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=f,c)if(typeof c=="string")r.fillStyle=c;else{const F=Ct.Utils.getRendererType(c._renderer.type);Ce[F].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const F=Ct.Utils.getRendererType(a._renderer.type);Ce[F].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=xn(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),Ce.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,T=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,T),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,k=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,k),r.restore()):r.fillText(e.value,0,0)),Ce.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,T=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,T),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,k=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,k),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const F=r.measureText(e.value);switch(h){case"underline":S=F.actualBoundingBoxDescent,$=F.actualBoundingBoxDescent;break;case"strikethrough":S=0,$=0;break}w=-F.width/2,v=F.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,S),r.lineTo(v,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const i=Ce.ctx;i.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),i.textAlign="center",i.textBaseline=Ct.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&&!Ce.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(Ce.alignments[t._alignment]||t._alignment){case Ce.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Ce.alignments.right:t.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-a,e.right=a}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=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=o,e.height=s,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},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,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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||a||l){this._renderer.matrix||(this._renderer.matrix=new wn(9)),this._matrix.toTransformArray(!0,ai),$o(ai,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,h;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=Ct.Utils.getRendererType(this._mask._renderer.type);Ce[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,Ce.text.getBoundingClientRect(this,this._renderer.rect),Ce.updateTexture.call(Ce,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,sa,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,a=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,a=(a-.5)*i.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];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,a=this.focal._y,l=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,a=(a-.5)*i.height*.5,l*=Math.min(i.width,i.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return 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=Ct.Utils.getRendererType(e._renderer.type);if(this[i].updateCanvas.call(Ce,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]=Ce.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new co};Ce.ctx=Ce.canvas.getContext("2d");var Cd=class extends ee{constructor(t){super();let e,i,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(Ce.canvas=t.offscreenElement,Ce.ctx=Ce.canvas.getContext("2d")),this.scene=new pt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new wn(a0),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=Ce.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Ce.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,sa,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=Ce.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"?Vs(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),Ce.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};B(Cd,"Utils",Ce);var c0=oe.extend({Error:Lt,getRatio:Vs,read:Ye,xhr:yd},oe,Pt,oc,sc),Be=class to{constructor(e){B(this,"_events",new ee),B(this,"type",""),B(this,"renderer",null),B(this,"scene",null),B(this,"width",0),B(this,"height",0),B(this,"frameCount",0),B(this,"timeDelta",0),B(this,"playing",!1);const i=oe.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:to.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=to.Types[r])}this.renderer=new to[this.type](this),this.setPlaying(i.autostart),this.frameCount=0,i.fullscreen?(this.fit=d0.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=u0.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,f0.bind(this)),this.scene=this.renderer.scene,to.Instances.push(this),i.autostart&&Rr.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,Rr.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 Co(e,i,r,o);return this.scene.add(s),s}makeArrow(e,i,r,o,s){const a=typeof s=="number"?s:10,l=Math.atan2(o-i,r-e),c=[new Te(e,i,void 0,void 0,void 0,void 0,ie.move),new Te(r,o,void 0,void 0,void 0,void 0,ie.line),new Te(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ie.line),new Te(r,o,void 0,void 0,void 0,void 0,ie.move),new Te(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ie.line)],d=new Ee(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 a=new xo(e,i,r,o,s);return this.scene.add(a),a}makeCircle(e,i,r,o){const s=new _o(e,i,r,o);return this.scene.add(s),s}makeEllipse(e,i,r,o,s){const a=new wo(e,i,r,o,s);return this.scene.add(a),a}makeStar(e,i,r,o,s){const a=new Zs(e,i,r,o,s);return this.scene.add(a),a}makeCurve(e){const i=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<i;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new Te(l,c))}}const r=arguments[i-1],o=new Ee(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 Gs(e,i,r,o);return this.scene.add(s),s}makeArcSegment(e,i,r,o,s,a,l){const c=new js(e,i,r,o,s,a,l);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 a=arguments[s];if(typeof a!="number")break;const l=arguments[s+1];r.push(new re(a,l))}}const o=new Ks(r);return this.scene.add(o),o}makePath(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<i;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new Te(c,d))}}const o=arguments[i-1],s=new Ee(r,!(typeof o=="boolean"&&o)),a=s.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&s.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(s),s}makeText(e,i,r,o){const s=new kn(e,i,r,o);return this.add(s),s}makeLinearGradient(e,i,r,o){const s=Array.prototype.slice.call(arguments,4),a=new Ke(e,i,r,o,s);return this.add(a),a}makeRadialGradient(e,i,r){const o=Array.prototype.slice.call(arguments,3),s=new Ge(e,i,r,o);return this.add(s),s}makeSprite(e,i,r,o,s,a,l){const c=new bo(e,i,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,i,r,o,s,a){const l=new bd(e,i,r,o,s,a);return this.add(l),l}makeImageSequence(e,i,r,o,s){const a=new ta(e,i,r,o);return s&&a.play(),this.add(a),a}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 Ye))return null;const s=Ye[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,a;const l=(function(c){for(Ut.temp.innerHTML=c,s=0;s<Ut.temp.children.length;s++)o=Ut.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);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)?(yd(e,l),r):(l(e),r)}};B(Be,"NextFrameId",kt.NextFrameId),B(Be,"Types",kt.Types),B(Be,"Version",kt.Version),B(Be,"PublishDate",kt.PublishDate),B(Be,"Identifier",kt.Identifier),B(Be,"Resolution",kt.Resolution),B(Be,"AutoCalculateImportedMatrices",kt.AutoCalculateImportedMatrices),B(Be,"Instances",kt.Instances),B(Be,"uniqueId",kt.uniqueId),B(Be,"Anchor",Te),B(Be,"Collection",ri),B(Be,"Events",ee),B(Be,"Group",pt),B(Be,"Matrix",ki),B(Be,"Path",Ee),B(Be,"Registry",co),B(Be,"Element",Qi),B(Be,"Shape",zn),B(Be,"Text",kn),B(Be,"Vector",re),B(Be,"Gradient",ut),B(Be,"Image",bd),B(Be,"ImageSequence",ta),B(Be,"LinearGradient",Ke),B(Be,"RadialGradient",Ge),B(Be,"Sprite",bo),B(Be,"Stop",oi),B(Be,"Texture",De),B(Be,"ArcSegment",js),B(Be,"Circle",_o),B(Be,"Ellipse",wo),B(Be,"Line",Co),B(Be,"Points",Ks),B(Be,"Polygon",Gs),B(Be,"Rectangle",si),B(Be,"RoundedRectangle",xo),B(Be,"Star",Zs),B(Be,"CanvasRenderer",Ct),B(Be,"SVGRenderer",kd),B(Be,"WebGLRenderer",Cd),B(Be,"Commands",ie),B(Be,"Utils",c0);var Cn=Be;function d0(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,i=this.height=t.height;this.renderer.setSize(e,i,this.ratio)}function u0(){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 f0(t,e){this.width=t,this.height=e,this.trigger(ee.Types.resize,t,e)}var Rr=Ut.getRequestAnimationFrame();function Sd(){for(let t=0;t<Cn.Instances.length;t++){const e=Cn.Instances[t];e.playing&&e.update()}Cn.NextFrameId=Rr(Sd)}Rr.init=function(){Sd(),Rr.init=function(){}};let Sn;typeof window<"u"?Sn=window:typeof global<"u"?Sn=global:typeof self<"u"&&(Sn=self);let Bd;const Kt=Math.PI*2,gt=Math.PI*.5;function h0(t,e,i,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,i=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function m0(t){Bd=t}function p0(t,e){e=e&&e.identity()||new Bd;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 a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[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 Nd=Sn.Float32Array||Array,g0=Math.floor;function Bn(t){return g0(t*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",arc:"A",close:"Z"};class ne{constructor(){N(this,"_events",{});N(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 a=this._events[e];if(a){let l=[];if(i)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,i!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const 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}}N(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),N(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Td={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();N(this,"_x",0);N(this,"_y",0);for(let o in Td)Object.defineProperty(this,o,Td[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 a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}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:Bn(this.x),y:Bn(this.y)}}rotate(i){const r=this.x,o=this.y,s=Math.cos(i),a=Math.sin(i);return this.x=r*s-o*a,this.y=r*a+o*s,this}};N(_t,"zero",new _t),N(_t,"left",new _t(-1,0)),N(_t,"right",new _t(1,0)),N(_t,"up",new _t(0,-1)),N(_t,"down",new _t(0,1));let pe=_t;class Ae extends pe{constructor(i=0,r=0,o=0,s=0,a=0,l=0,c=fe.move){super(i,r);N(this,"controls",{left:new pe,right:new pe});N(this,"_command",fe.move);N(this,"_relative",!0);N(this,"_rx",0);N(this,"_ry",0);N(this,"_xAxisRotation",0);N(this,"_largeArcFlag",0);N(this,"_sweepFlag",1);for(let u in $d)Object.defineProperty(this,u,$d[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(a,l).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:Bn(this.x),y:Bn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Bn(this.rx),ry:Bn(this.ry),xAxisRotation:Bn(this.xAxisRotation),largeArcFlag:Bn(this.largeArcFlag),sweepFlag:Bn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const $d={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 y0=0;const Eo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return y0++}},Ro={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 Po(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 Ed(t,e,i,r,o,s,a,l,c){c=c||Ro.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Ae(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=Po(f,t,i,o,a),p=Po(f,e,r,s,l);u.push(new Ae(m,p))}return u}function b0(t,e,i,r,o,s,a,l,c){if(t===i&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(a-t),u=6*(t+o)-12*i,h=3*(i-t),f=9*(r-s)+3*(l-e),m=6*(e+s)-12*r,p=3*(r-e);function g(b){const y=(d*b+u)*b+h,_=(f*b+m)*b+p;return Math.sqrt(y*y+_*_)}return w0(g,0,1,c||Ro.RecursionLimit)}function _0(t,e,i,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,b,y;for(let C=0;C<2;++C){if(C===0?(h=6*t-12*i+6*o,u=-3*t+9*i-9*o+3*a,f=3*i-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;m=-f/h,0<m&&m<1&&c.push(m);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(p=(-h+y)/(2*u),0<p&&p<1&&c.push(p),g=(-h-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*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,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 w0(t,e,i,r){let o=Ro.abscissas[r-2],s=Ro.weights[r-2],a=.5*(i-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function x0(t,e){const i=t.length,r=i-1;for(let o=0;o<i;o++){const s=t[o],a=e?jt(o-1,i):Math.max(o-1,0),l=e?jt(o+1,i):Math.min(o+1,r),c=t[a],d=s,u=t[l];k0(c,d,u),d.command=o===0?fe.move:fe.curve}}function k0(t,e,i){const r=pe.angleBetween(t,e),o=pe.angleBetween(i,e);let s=pe.distanceBetween(t,e),a=pe.distanceBetween(i,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=gt:l-=gt,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let Pr=(Oi=class extends ne{constructor(){super();N(this,"_flagId",!1);N(this,"_flagClassName",!1);N(this,"_renderer",{});N(this,"_id",Eo.Identifier+Eo.uniqueId());N(this,"_className","");N(this,"classList",[]);for(let i in Rd)Object.defineProperty(this,i,Rd[i])}static fromObject(i){const r=new Oi().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}},N(Oi,"Properties",["renderer","id","className"]),Oi);const Rd={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 Fo extends Error{constructor(i){super();N(this,"name","Two.js");N(this,"message");this.message=i}}class v0{constructor(){N(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 Vo;const Pd={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Sn.document&&(Vo=document.createElement("a"));const Qe=class Qe extends Pr{constructor(i,r){super();N(this,"_flagSrc",!1);N(this,"_flagImage",!1);N(this,"_flagVideo",!1);N(this,"_flagLoaded",!1);N(this,"_flagRepeat",!1);N(this,"_flagOffset",!1);N(this,"_flagScale",!1);N(this,"_src","");N(this,"_image",null);N(this,"_loaded",!1);N(this,"_repeat","no-repeat");N(this,"_scale",1);N(this,"_offset",null);for(let o in Fd)Object.defineProperty(this,o,Fd[o]);if(this._renderer.type="texture",this._renderer.flagOffset=C0.bind(this),this._renderer.flagScale=S0.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 Qe().copy(i);return"id"in i&&(r.id=i.id),r}static getAbsoluteURL(i){return Vo?(Vo.href=i,Vo.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=Qe.getAbsoluteURL(i);if(Qe.ImageRegistry.contains(r))return Qe.ImageRegistry.get(r);let o;return Sn.document?Pd.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=Qe.getTag(o);i._flagImage&&(/canvas/i.test(s)?Qe.Register.canvas(i,r):(i._src=o.getAttribute("two-src")||o.src,Qe.Register[s](i,r))),i._flagSrc&&(o||(o=Qe.getImage(i.src),i.image=o),s=Qe.getTag(o),Qe.Register[s](i,r))}clone(){const i=new Qe(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,Qe.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}};N(Qe,"Properties",["src","loaded","repeat","scale","offset","image"]),N(Qe,"RegularExpressions",Pd),N(Qe,"ImageRegistry",new v0),N(Qe,"Register",{canvas:function(i,r){i._src="#"+i.id,Qe.ImageRegistry.add(i.src,i.image),typeof r=="function"&&r()},img:function(i,r){const o=i.image,s=function(l){o.removeEventListener&&typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),new Fo("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",a,!1)),i._src=Qe.getAbsoluteURL(i._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",i.src),Qe.ImageRegistry.add(i.src,o),i.image.src=i.src)},video:function(i,r){const o=function(a){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(a){throw i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),new Fo("unable to load "+i.src)};i._src=Qe.getAbsoluteURL(i._src),i.image.getAttribute("two-src")||(i.image.setAttribute("two-src",i.src),Qe.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 Ze=Qe;const Fd={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=Ze.getTag(t);let i;switch(e){case"canvas":i="#"+t.id;break;default:i=t.src}Ze.ImageRegistry.contains(i)?this._image=Ze.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 C0(){this._flagOffset=!0}function S0(){this._flagScale=!0}class vi extends Array{constructor(){super();$l(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){om(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 a=this[s];let l;r?l=i.call(r,a,s):l=i(a,s),o.push(l)}return o}}wt=new WeakMap;const Vd=Array.prototype.slice;function B0(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=Vd.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=Vd.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=!B0(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:Sn.performance&&Sn.performance.now?Sn.performance:Date},Yt=class Yt extends Pr{constructor(i,r,o){super();N(this,"_flagOffset",!0);N(this,"_flagOpacity",!0);N(this,"_flagColor",!0);N(this,"_offset",0);N(this,"_opacity",1);N(this,"_color","#fff");for(let s in Md)Object.defineProperty(this,s,Md[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}};N(Yt,"Index",0),N(Yt,"Properties",["offset","opacity","color"]);let Ci=Yt;const Md={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)}}},Pn=class Pn extends Pr{constructor(i){super();N(this,"_flagStops",!1);N(this,"_flagSpread",!1);N(this,"_flagUnits",!1);N(this,"_spread","");N(this,"_units","");for(let r in Id)Object.defineProperty(this,r,Id[r]);this._renderer.type="gradient",this._renderer.flagStops=N0.bind(this),this._renderer.bindStops=T0.bind(this),this._renderer.unbindStops=$0.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 Ci?s:new Ci().copy(s)));const o=new Pn(r).copy(i);return"id"in i&&(o.id=i.id),o}clone(i){const r=this.stops.map(s=>s.clone()),o=new Pn(r);return je.each(Pn.Properties,s=>{o[s]=this[s]},this),i&&i.add(o),o}copy(i){super.copy.call(this,i);for(let r=0;r<Pn.Properties.length;r++){const o=Pn.Properties[r];o in i&&(this[o]=i[o])}return this}toObject(){const i={stops:this.stops.map(r=>r.toObject())};return je.each(Pn.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}};N(Pn,"Stop",Ci),N(Pn,"Properties",["spread","stops","units"]);let ft=Pn;const Id={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 vi((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,i),e(this._stops)}}};function N0(){this._flagStops=!0}function T0(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function $0(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,a){super(a);N(this,"_flagEndPoints",!1);N(this,"_left",null);N(this,"_right",null);for(let l in Ad)Object.defineProperty(this,l,Ad[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=E0.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}};N(hi,"Stop",Ci),N(hi,"Properties",["left","right"]);let Vt=hi;const Ad={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 E0(){this._flagEndPoints=!0}const Fn=class Fn extends ft{constructor(i,r,o,s,a,l){super(s);N(this,"_flagRadius",!1);N(this,"_flagCenter",!1);N(this,"_flagFocal",!1);N(this,"_radius",0);N(this,"_center",null);N(this,"_focal",null);for(let c in Od)Object.defineProperty(this,c,Od[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=R0.bind(this),this._renderer.flagFocal=P0.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 a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(i){const r=new Fn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Fn.Properties.length;r++){const o=Fn.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 Fn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(ft.Properties.concat(Fn.Properties),function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return je.each(Fn.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}};N(Fn,"Stop",Ci),N(Fn,"Properties",["center","radius","focal"]);let Mt=Fn;const Od={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 R0(){this._flagCenter=!0}function P0(){this._flagFocal=!0}function zd(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 a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}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 Dd(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),b0(r,l,o,c,s,d,a,u,i)}function aa(t,e,i){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Ed(r,l,o,c,s,d,a,u,i)}function Si(t){switch(t.renderer.type){case"texture":return Ze.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 F0=Math.cos,V0=Math.sin,Ld=Math.tan,la=[],At=class At extends ne{constructor(i,r,o,s,a,l){super();N(this,"elements",new Nd(9));N(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 S,v,$;const E=r[0]||0,F=r[1]||0,P=r[2]||0;return S=w[0]*E+w[1]*F+w[2]*P,v=w[3]*E+w[4]*F+w[5]*P,$=w[6]*E+w[7]*F+w[8]*P,[S,v,$]}const s=i[0],a=i[1],l=i[2],c=i[3],d=i[4],u=i[5],h=i[6],f=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],C=r[7],T=r[8];return o=o||new Nd(9),o[0]=s*p+a*y+l*x,o[1]=s*g+a*_+l*C,o[2]=s*b+a*k+l*T,o[3]=c*p+d*y+u*x,o[4]=c*g+d*_+u*C,o[5]=c*b+d*k+u*T,o[6]=h*p+f*y+m*x,o[7]=h*g+f*_+m*C,o[8]=h*b+f*k+m*T,o}static fromObject(i){return new At().copy(i)}set(i,r,o,s,a,l,c,d,u){if(typeof r>"u"){const h=i;i=h[0],r=h[1],o=h[2],s=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[8]}return this.elements[0]=i,this.elements[1]=r,this.elements[2]=o,this.elements[3]=s,this.elements[4]=a,this.elements[5]=l,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,a,l,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,a=this.elements;const K=a[0]*i+a[1]*r+a[2]*o,J=a[3]*i+a[4]*r+a[5]*o,Z=a[6]*i+a[7]*r+a[8]*o;return[K,J,Z]}const h=this.elements,f=[i,r,o,s,a,l,c,d,u],m=h[0],p=h[1],g=h[2],b=h[3],y=h[4],_=h[5],k=h[6],x=h[7],C=h[8],T=f[0],w=f[1],S=f[2],v=f[3],$=f[4],E=f[5],F=f[6],P=f[7],I=f[8];return this.elements[0]=m*T+p*v+g*F,this.elements[1]=m*w+p*$+g*P,this.elements[2]=m*S+p*E+g*I,this.elements[3]=b*T+y*v+_*F,this.elements[4]=b*w+y*$+_*P,this.elements[5]=b*S+y*E+_*I,this.elements[6]=k*T+x*v+C*F,this.elements[7]=k*w+x*$+C*P,this.elements[8]=k*S+x*E+C*I,this.trigger(ne.Types.change)}inverse(i){const r=this.elements;i=i||new At;const o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=f*c-d*h,p=-f*l+d*u,g=h*l-c*u;let b=o*m+s*p+a*g;return b?(b=1/b,i.elements[0]=m*b,i.elements[1]=(-f*s+a*h)*b,i.elements[2]=(d*s-a*c)*b,i.elements[3]=p*b,i.elements[4]=(f*o-a*u)*b,i.elements[5]=(-d*o+a*l)*b,i.elements[6]=g*b,i.elements[7]=(-h*o+s*u)*b,i.elements[8]=(c*o-s*l)*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=F0(i),o=V0(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=Ld(i);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(i){const r=Ld(i);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(i){return la.length=0,this.toTransformArray(i,la),la.map(Bn).join(" ")}toTransformArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(i){const f=o[6],m=o[7],p=o[8];if(s){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=m,r[6]=c,r[7]=h,r[8]=p;return}return[a,d,f,l,u,m,c,h,p]}if(s){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(i){const f=o[6],m=o[7],p=o[8];if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=f,r[7]=m,r[8]=p;return}return[a,l,c,d,u,h,f,m,p]}if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new At().copy(this)}};N(At,"Identity",[1,0,0,0,1,0,0,0,1]);let ir=At;m0(ir);const Zr=class Zr extends Pr{constructor(){super();N(this,"_flagMatrix",!0);N(this,"_flagScale",!1);N(this,"_matrix",null);N(this,"_worldMatrix",null);N(this,"_position",null);N(this,"_rotation",0);N(this,"_scale",1);N(this,"_skewX",0);N(this,"_skewY",0);for(let i in Io)Object.defineProperty(this,i,Io[i]);this._renderer.flagMatrix=Hd.bind(this),this.isShape=!0,this.matrix=new ir,this.worldMatrix=new ir,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(i){const r=new Zr().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 Io.position.get.apply(this,arguments)}set translation(i){Io.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||{},a=s.ignoreVisibility===!0;if(!a&&"visible"in this&&this.visible===!1||!a&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();return c?i>=c.left-l&&i<=c.right+l&&r>=c.top-l&&r<=c.bottom+l:!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 Zr;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}};N(Zr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Nn=Zr;const Io={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),Hd.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 p0(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Hd(){this._flagMatrix=!0}const Wd=/^(?:none|transparent)$/i,M0=8,ca=Number.EPSILON;function Ln(t,e){return{x:t,y:e}}function Ao(t,e,i=ca){return Math.abs(t.x-e.x)<=i&&Math.abs(t.y-e.y)<=i}function jd(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 a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*i<0&&(a=-a),a}function I0(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,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let b=p*f+g*m,y=-g*f+p*m,_=r*r,k=o*o;const x=b*b/_+y*y/k;if(x>1){const A=Math.sqrt(x);r*=A,o*=A,_=r*r,k=o*o}const C=_*y*y+k*b*b,T=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,T));a===l&&(w=-w);const S=w*r*y/o,v=-w*o*b/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,F=jd(1,0,(b-S)/r,(y-v)/o),P=jd((b-S)/r,(y-v)/o,(-b-S)/r,(-y-v)/o)%Kt,I=F+P,K=l===0,J=(()=>{const A=I-F,O=Math.abs(A)<Number.EPSILON;let V=jt(A,Kt);return V<Number.EPSILON&&(V=O?0:Kt),K&&!O&&(V=V===Kt?-Kt:V-Kt),V})(),Z=Math.max(Eo.Resolution,Math.max(i*2,1)),L=[];for(let A=1;A<=Z;A++){const O=A/Z,V=F+O*J;let R=$+r*Math.cos(V),H=E+o*Math.sin(V);if(s!==0){const Y=R-$,G=H-E,X=Math.cos(s),W=Math.sin(s);R=Y*X-G*W+$,H=Y*W+G*X+E}L.push(Ln(R,H))}return L}function A0(t,e=M0){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 a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!Ao(l,c)){const m=Ln(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&Ao(l,c)&&i.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}Ao(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?fe.move:fe.line);if(p===fe.move){u(!1);const g=Ln(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===fe.line)h(Ln(m.x,m.y));else if(p===fe.curve){const g=aa(m,d,s);for(let b=1;b<g.length;b++){const y=g[b];h(Ln(y.x,y.y))}h(Ln(m.x,m.y))}else if(p===fe.arc){const g=I0(d,m,s);for(let b=0;b<g.length;b++)h(g[b])}else if(p===fe.close){u(!0),d=m;continue}else h(Ln(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!Ao(l,c);u(f)}return{polygons:i,segments:r}}function O0(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 a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function z0(t,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<ca&&Math.abs(s)<ca){const f=t-i.x,m=e-i.y;return f*f+m*m}const a=((t-i.x)*o+(e-i.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=i.x+l*o,d=i.y+l*s,u=t-c,h=e-d;return u*u+h*h}function D0(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],a=z0(e,i,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function L0(t,e){if(typeof e=="boolean")return e;const i=t.fill;return!i&&i!==0?!1:typeof i=="string"?!Wd.test(i):!0}function H0(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"?!Wd.test(r):!0}function W0(t,e,i,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&i>=a&&i<=l}const Oo=Number.EPSILON;function zo(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)<Oo&&Math.abs(r)<Oo){zo(t)?o[e].clear():o[e].set(t.x,t.y);return}zo(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 j0(t,e){const i=t.controls;return!i||!i[e]?{x:0,y:0}:zo(t)?{x:i[e].x,y:i[e].y}:{x:i[e].x-t.x,y:i[e].y-t.y}}function rr(t,e){const i=j0(t,e);return Math.abs(i.x)>Oo||Math.abs(i.y)>Oo}function Do(t){t.command===fe.move||t.command===fe.close||(t.command=rr(t,"left")||rr(t,"right")?fe.curve:fe.line)}function qd(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function q0(t,e){return rr(e,"right")||rr(t,"left")||rr(t,"right")||rr(e,"left")||t.command===fe.curve||e.command===fe.curve}function or(t,e,i){return{x:Wt(t.x,e.x,i),y:Wt(t.y,e.y,i)}}function Xd(t,e){const i=t.controls&&t.controls[e];return i?zo(t)?{x:t.x+i.x,y:t.y+i.y}:{x:i.x,y:i.y}:{x:t.x,y:t.y}}function X0(t,e,i){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?Xd(t,"right"):{...s},l={x:e.x,y:e.y},c=o?Xd(e,"left"):{...l},d=or(s,a,i),u=or(a,c,i),h=or(c,l,i),f=or(d,u,i),m=or(u,h,i),p=or(f,m,i),g=new Ae(p.x,p.y);return qd(g,t),fn(g,"left",f.x-p.x,f.y-p.y),fn(g,"right",m.x-p.x,m.y-p.y),g.command=fe.curve,{anchor:g,startOut:d,endIn:h}}function Y0(t,e,i,r,o,s){const a=t.length,l=i-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-i-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=jt(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const b=c-1,y=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<b,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,F=S?2:s?0:1,P=v/g;g=k[w]=$-P,m=y[w]=E*f[w].x+F*f[w+1].x-P*m,p=_[w]=E*f[w].y+F*f[w+1].y-P*p}x[b]=y[b]/k[b],C[b]=_[b]/k[b];for(let w=c-2;w>=0;w-=1)x[w]=(y[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[b])/2,C[c]=(3*f[c].y-C[b])/2;const T=c-h;for(let w=u,S=e;w<=T;w+=1,S+=1){const v=jt(S,a),$=t[v],E=x[w]-$.x,F=C[w]-$.y;o||w<T?fn($,"right",E,F):qt($,"right"),o||w>u?fn($,"left",-E,-F):qt($,"left"),Do($)}}function U0(t,e,i,r,o,s){const a=e||t,l=t,c=i||t,d=pe.distanceBetween(a,l),u=pe.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const b=2*g+3*m*f+p,y=3*m*(m+f);if(y!==0){const _=(g*a.x+b*l.x-p*c.x)/y-l.x,k=(g*a.y+b*l.y-p*c.y)/y-l.y;fn(t,"left",_,k)}else qt(t,"left")}else qt(t,"left");if(!s&&i){const b=2*p+3*f*m+g,y=3*f*(f+m);if(y!==0){const _=(p*c.x+b*l.x-g*a.x)/y-l.x,k=(p*c.y+b*l.y-g*a.y)/y-l.y;fn(t,"right",_,k)}else qt(t,"right")}else qt(t,"right");Do(t)}function K0(t,e,i,r,o,s){if(!(e&&i)){e||qt(t,"left"),i||qt(t,"right"),Do(t);return}const a=e,l=t,c=i,d=pe.distanceBetween(a,l),u=pe.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;fn(t,"left",m.x*p,m.y*p)}else qt(t,"left");if(!s&&h!==0){const p=f*d/h-f;fn(t,"right",m.x*p,m.y*p)}else qt(t,"right");Do(t)}function G0(t,e,i,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=i;d+=1){const u=jt(d,c),h=t[u];if(h.command===fe.move){qt(h,"left"),qt(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===i&&!o?null:d+1,p=f===null?null:t[jt(f,c)],g=m===null?null:t[jt(m,c)],b=f===null,y=m===null;a==="geometric"?K0(h,p,g,l,b,y):U0(h,p,g,l,b,y)}}const sr=Math.min,ar=Math.max,Z0=Math.ceil,Q0=Math.floor,J0=new pe,eb=new ir,pn=class pn extends Nn{constructor(i,r,o,s){super();N(this,"_flagVertices",!0);N(this,"_flagLength",!0);N(this,"_flagFill",!0);N(this,"_flagStroke",!0);N(this,"_flagLinewidth",!0);N(this,"_flagOpacity",!0);N(this,"_flagVisible",!0);N(this,"_flagCap",!0);N(this,"_flagJoin",!0);N(this,"_flagMiter",!0);N(this,"_flagStrokeAttenuation",!0);N(this,"_flagMask",!1);N(this,"_flagClip",!1);N(this,"_length",0);N(this,"_fill","#fff");N(this,"_stroke","#000");N(this,"_linewidth",1);N(this,"_opacity",1);N(this,"_visible",!0);N(this,"_cap","round");N(this,"_join","round");N(this,"_miter",4);N(this,"_closed",!0);N(this,"_curved",!1);N(this,"_automatic",!0);N(this,"_beginning",0);N(this,"_ending",1);N(this,"_mask",null);N(this,"_clip",!1);N(this,"_dashes",null);N(this,"_strokeAttenuation",!0);for(let a in Yd)Object.defineProperty(this,a,Yd[a]);this._renderer.type="path",this._renderer.flagVertices=Ud.bind(this),this._renderer.bindVertices=Kd.bind(this),this._renderer.unbindVertices=Gd.bind(this),this._renderer.flagFill=Zd.bind(this),this._renderer.flagStroke=Qd.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,a=i.top+i.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=s,c.y-=a,c.x+=r,c.y+=o}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=r,this.mask.translation.y-=a,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 a=this.vertices[s];a.x-=r,a.y-=o}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getBoundingClientRect(i){let r,o,s,a,l,c,d=1/0,u=-1/0,h=1/0,f=-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}=h0(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(a=0;a<s;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+s-1)%s];const[m,p]=r.multiply(l.x,l.y),[g,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[k,x]=r.multiply(y,_),C=c.controls.left.x,T=c.controls.left.y;c.relative&&(C+=c.x,T+=c.y);let[w,S]=r.multiply(C,T);const v=_0(m,p,k,x,w,S,g,b);h=sr(v.min.y-o,h),d=sr(v.min.x-o,d),u=ar(v.max.x+o,u),f=ar(v.max.y+o,f)}else a<=1&&(h=sr(p-o,h),d=sr(m-o,d),u=ar(m+o,u),f=ar(p+o,f)),h=sr(b-o,h),d=sr(g-o,d),u=ar(g+o,u),f=ar(b+o,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}contains(i,r,o){const s=o||{},a=s.ignoreVisibility===!0;if(!a&&this.visible===!1||!a&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();if(!c||i<c.left-l||i>c.right+l||r<c.top-l||r>c.bottom+l)return!1;const d=this.worldMatrix,u=d&&d.inverse(eb);if(!u)return super.contains(i,r,s);const[h,f]=u.multiply(i,r,1),m=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,p=L0(this,s.fill),g=H0(this,s.stroke),{polygons:b,segments:y}=A0(this,m);if(p&&b.length>0&&O0(b,h,f))return!0;if(g&&y.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&D0(y,h,f)<=_/2+l)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,a,l,c,d,u,h,f,m,p,g,b,y,_,k=this.length*Math.min(Math.max(i,0),1);const x=this.vertices.length,C=x-1;let T=null,w=null;for(let L=0,A=this._lengths.length,O=0;L<A;L++){if(O+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),C)),T=this.vertices[o],w=this.vertices[s],k-=O,this._lengths[L]!==0?i=k/this._lengths[L]:i=0;break}O+=this._lengths[L]}if(T===null||w===null)return null;if(T){if(!w)return T}else return w;_=w.controls&&w.controls.right,y=T.controls&&T.controls.left,c=w.x,m=w.y,d=(_||w).x,p=(_||w).y,u=(y||T).x,g=(y||T).y,h=T.x,b=T.y,_&&w.relative&&(d+=w.x,p+=w.y),y&&T.relative&&(u+=T.x,g+=T.y),l=Po(i,c,d,u,h),f=Po(i,m,p,g,b);const S=Wt(c,d,i),v=Wt(m,p,i),$=Wt(d,u,i),E=Wt(p,g,i),F=Wt(u,h,i),P=Wt(g,b,i),I=Wt(S,$,i),K=Wt(v,E,i),J=Wt($,F,i),Z=Wt(E,P,i);return je.isObject(r)?(r.x=l,r.y=f,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-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=i,r):(a=new Ae(l,f,I-l,K-f,J-l,Z-f,this._curved?fe.curve:fe.line),a.t=i,a)}plot(){if(this.curved)return x0(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,a=s.length;if(a<2)return this;const l=this._closed||a>0&&s[a-1]&&s[a-1].command===fe.close,c=(m,p)=>{if(m==null)return p;if(typeof m=="number"){if(l)return jt(m,a);let b=m;return b<0&&(b+=a),Math.min(Math.max(b,0),a-1)}const g=s.indexOf(m);return g!==-1?g:p},d=l&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),h=c(r.to,a-1);if(u>h)if(l)u-=a;else{const m=u;u=h,h=m}const f=h-u+1;for(let m=0;m<f;m+=1){const p=jt(u+m,a),g=s[p],b=!l&&p===0;g.command===fe.move&&!b&&(g.command=fe.line)}if(o==="continuous"||o==="asymmetric")Y0(s,u,h,l,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const m={type:o,factor:r.factor};G0(s,u,h,l,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 a=null,l=null;for(let c=0;c<o;c+=1){const d=r[c];if(!a||d.command===fe.move){const h=d.clone();s.push(h),a=d,l=d;continue}if(q0(d,a)){const f=aa(d,a,i).length,m=s[s.length-1];let p=m.clone(),g=d.clone(),b=m,y=0;if(f<=1){const _=d.clone();s.push(_)}else{for(let k=1;k<f;k+=1){const x=k/f,C=1-y,T=C<=Number.EPSILON?x:(x-y)/C,w=X0(p,g,T);fn(b,"right",w.startOut.x-b.x,w.startOut.y-b.y);const S=w.anchor;s.push(S),b=S,p=S.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 h=aa(d,a,i);for(let m=1;m<h.length;m+=1){const p=h[m];qd(p,a),qt(p,"left"),qt(p,"right"),p.command=fe.line,s.push(p)}const f=d.clone();s.push(f)}a=d,d.command===fe.close&&(a=l)}return this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(i,r){r||this._update();const s=this.vertices.length-1;let a=this.vertices[s],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),je.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Dd(c,a,i),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const i=this._collection.length,r=this._closed,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=Mo(this,o*this._length),l=Mo(this,s*this._length),c=Z0(a),d=Q0(l);let u,h,f,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&&!h?(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),h=p,f=this._collection[g-1],f&&f.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),f.relative?this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(pe.zero,1-p.t):this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(f,1-p.t))):g>=c&&g<=d&&(p=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(p),g===d&&zd(this,s)?(h=p,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===c&&zd(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):(J0.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,p.t))))}return Nn.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,Nn.prototype.flagReset.call(this),this}};N(pn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),N(pn,"Utils",{getCurveLength:Dd});let Oe=pn;const Yd={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 Ze)&&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 Ze)&&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 Ze)&&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 Ze)&&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 vi?this._collection=t:this._collection=new vi(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 Ud(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Kd(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Gd(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Zd(){this._flagFill=!0}function Qd(){this._flagStroke=!0}const tb=Math.ceil,nb=Math.floor,Vn=class Vn extends Nn{constructor(i){super();N(this,"_flagVertices",!0);N(this,"_flagLength",!0);N(this,"_flagFill",!0);N(this,"_flagStroke",!0);N(this,"_flagLinewidth",!0);N(this,"_flagOpacity",!0);N(this,"_flagVisible",!0);N(this,"_flagSize",!0);N(this,"_flagSizeAttenuation",!0);N(this,"_flagStrokeAttenuation",!0);N(this,"_length",0);N(this,"_fill","#fff");N(this,"_stroke","#000");N(this,"_linewidth",1);N(this,"_opacity",1);N(this,"_visible",!0);N(this,"_size",1);N(this,"_sizeAttenuation",!1);N(this,"_beginning",0);N(this,"_ending",1);N(this,"_dashes",null);N(this,"_strokeAttenuation",!0);N(this,"noFill",Oe.prototype.noFill);N(this,"noStroke",Oe.prototype.noStroke);N(this,"corner",Oe.prototype.corner);N(this,"center",Oe.prototype.center);N(this,"getBoundingClientRect",Oe.prototype.getBoundingClientRect);N(this,"_updateLength",Oe.prototype._updateLength);for(let r in Jd)Object.defineProperty(this,r,Jd[r]);this._renderer.type="points",this._renderer.flagVertices=Ud.bind(this),this._renderer.bindVertices=Kd.bind(this),this._renderer.unbindVertices=Gd.bind(this),this._renderer.flagFill=Zd.bind(this),this._renderer.flagStroke=Qd.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 Vn().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<Vn.Properties.length;r++){const o=Vn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Vn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Vn.Properties.length;o++){const s=Vn.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(Vn.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],a=this.vertices[o-1];if(!a)continue;const l=s.x,c=s.y,d=a.x,u=a.y,h=Ed(l,c,l,c,d,u,d,u,i);r=r.concat(h)}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=Mo(this,i*this._length),s=Mo(this,r*this._length),a=tb(o),l=nb(s);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};N(Vn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Lo=Vn;const Jd={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 Ze)&&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 Ze)&&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 Ze)&&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 Ze)&&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 vi?this._collection=t:this._collection=new vi(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 eu extends vi{constructor(i){i=Array.isArray(i)?i:Array.prototype.slice.call(arguments);super(i);$l(this,ms,{});this.attach(i),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return zt(this,ms)}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}}ms=new WeakMap;const Xn=class Xn extends Oe{constructor(i,r,o,s,a,l,c){const d=c||Eo.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Ae);super(u,!0,!1,!0);N(this,"_flagStartAngle",!1);N(this,"_flagEndAngle",!1);N(this,"_flagInnerRadius",!1);N(this,"_flagOuterRadius",!1);N(this,"_startAngle",0);N(this,"_endAngle",Kt);N(this,"_innerRadius",0);N(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in tu)Object.defineProperty(this,h,tu[h]);typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),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,a=jt(i,Kt)===jt(r,Kt),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,m,p,g,b,y,_,k,x;for(a?d--:l||(d-=2),f=0,m=d-1;f<d;f++){switch(p=f/m,g=c[h],b=p*(r-i)+i,y=(r-i)/d,_=s*Math.cos(b),k=s*Math.sin(b),f){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),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=fe.close,h++):(d--,m=d-1),f=0;f<d;f++)p=f/m,g=c[h],b=(1-p)*(r-i)+i,y=(r-i)/d,_=o*Math.cos(b),k=o*Math.sin(b),u=fe.curve,f<=0&&(u=a?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),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=fe.line}else a||(c[h].command=fe.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].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,a=this.endAngle,l=this.vertices.length,c=new Xn(0,0,r,o,s,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<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}};N(Xn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let da=Xn;const tu={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}}},ua=Math.cos,fa=Math.sin,Yn=class Yn extends Oe{constructor(i,r,o,s){const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ae(0,0,0,0,0,0));super(l,!0,!0,!0);N(this,"_flagRadius",!1);N(this,"_radius",0);this._renderer.type="circle";for(let c in nu)Object.defineProperty(this,c,nu[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 a=0;a<this.vertices.length;a++){const c=a/i*Kt,d=o*ua(c),u=o*fa(c),h=s*ua(c-gt),f=s*fa(c-gt),m=s*ua(c+gt),p=s*fa(c+gt),g=this.vertices[a];g.command=a===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(h,f),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}};N(Yn,"Properties",["radius"]);let ha=Yn;const nu={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ma=Math.cos,pa=Math.sin,Un=class Un extends Oe{constructor(i,r,o,s,a){typeof s!="number"&&typeof o=="number"&&(s=o);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Ae);super(c,!0,!0,!0);N(this,"_flagWidth",!1);N(this,"_flagHeight",!1);N(this,"_width",0);N(this,"_height",0);this._renderer.type="ellipse";for(let d in iu)Object.defineProperty(this,d,iu[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 a=0;a<this.vertices.length;a++){const c=a/i*Kt,d=o*ma(c),u=s*pa(c),h=o*r*ma(c-gt),f=s*r*pa(c-gt),m=o*r*ma(c+gt),p=s*r*pa(c+gt),g=this.vertices[a];g.command=a===0?fe.move:fe.curve,g.set(d,u),g.controls.left.set(h,f),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,a=new Un(0,0,r,o,s);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}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}};N(Un,"Properties",["width","height"]);let ga=Un;const iu={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}}},ib=Math.cos,rb=Math.sin,Kn=class Kn extends Oe{constructor(i,r,o,s){s=Math.max(s||0,3);super();N(this,"_flagWidth",!1);N(this,"_flagHeight",!1);N(this,"_flagSides",!1);N(this,"_radius",0);N(this,"_width",0);N(this,"_height",0);N(this,"_sides",0);this._renderer.type="polygon";for(let a in ru)Object.defineProperty(this,a,ru[a]);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 a=(s+.5)/i,l=Kt*a+Math.PI/2,c=this._width*ib(l)/2,d=this._height*rb(l)/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}};N(Kn,"Properties",["width","height","sides"]);let ya=Kn;const ru={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}}},zi=class zi extends Oe{constructor(i,r,o,s){const a=[new Ae,new Ae,new Ae,new Ae];super(a,!0,!1,!0);N(this,"_flagWidth",!1);N(this,"_flagHeight",!1);N(this,"_width",0);N(this,"_height",0);N(this,"_origin",null);this._renderer.type="rectangle";for(let l in ou)Object.defineProperty(this,l,ou[l]);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 zi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<zi.Properties.length;r++){const o=zi.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 zi(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}};N(zi,"Properties",["width","height","origin"]);let Fr=zi;const ou={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,a){typeof a>"u"&&typeof o=="number"&&typeof s=="number"&&(a=Math.floor(Math.min(o,s)/12));const l=[];for(let c=0;c<10;c++)l.push(new Ae(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);N(this,"_flagWidth",!1);N(this,"_flagHeight",!1);N(this,"_flagRadius",!1);N(this,"_width",0);N(this,"_height",0);N(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in su)Object.defineProperty(this,c,su[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=ob.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof pe)&&(this.radius=a),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 a,l=i/2,c=r/2;a=this.vertices[0],a.x=-(l-o),a.y=-c,a=this.vertices[1],a.x=l-o,a.y=-c,a.controls.left.clear(),a.controls.right.x=o,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-s),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-s,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=s,a=this.vertices[4],a.x=l-o,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-o),a.y=c,a.controls.left.clear(),a.controls.right.x=-o,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-s,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-s),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-s,a=this.vertices[8],a.x=-(l-o),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(i){const r=this.width,o=this.height,s=this.radius,a=new Gn(0,0,r,o,s);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}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}};N(Gn,"Properties",["width","height","radius"]);let ba=Gn;const su={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 ob(){this._flagRadius=!0}const sb=Math.cos,ab=Math.sin,Zn=class Zn extends Oe{constructor(i,r,o,s,a){arguments.length<=3&&(s=o,o=s/2),(typeof a!="number"||a<=0)&&(a=5);super();N(this,"_flagInnerRadius",!1);N(this,"_flagOuterRadius",!1);N(this,"_flagSides",!1);N(this,"_innerRadius",0);N(this,"_outerRadius",0);N(this,"_sides",0);this._renderer.type="star";for(let l in au)Object.defineProperty(this,l,au[l]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof a=="number"&&(this.sides=a),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 a=(s+.5)/i,l=Kt*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*sb(l),u=c*ab(l);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,a=new Zn(0,0,r,o,s);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}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}};N(Zn,"Properties",["innerRadius","outerRadius","sides"]);let _a=Zn;const au={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 wa;const lu=Math.min,cu=Math.max;Sn.document&&(wa=document.createElement("canvas"));const Et=class Et extends Nn{constructor(i,r,o,s){super();N(this,"_flagValue",!0);N(this,"_flagFamily",!0);N(this,"_flagSize",!0);N(this,"_flagLeading",!0);N(this,"_flagAlignment",!0);N(this,"_flagBaseline",!0);N(this,"_flagStyle",!0);N(this,"_flagWeight",!0);N(this,"_flagDecoration",!0);N(this,"_flagFill",!0);N(this,"_flagStroke",!0);N(this,"_flagLinewidth",!0);N(this,"_flagOpacity",!0);N(this,"_flagVisible",!0);N(this,"_flagMask",!1);N(this,"_flagClip",!1);N(this,"_flagDirection",!0);N(this,"_flagStrokeAttenuation",!0);N(this,"_value","");N(this,"_family","sans-serif");N(this,"_size",13);N(this,"_leading",17);N(this,"_alignment","center");N(this,"_baseline","middle");N(this,"_style","normal");N(this,"_weight",500);N(this,"_decoration","none");N(this,"_direction","ltr");N(this,"_fill","#000");N(this,"_stroke","none");N(this,"_linewidth",1);N(this,"_opacity",1);N(this,"_visible",!0);N(this,"_mask",null);N(this,"_clip",!1);N(this,"_dashes",null);N(this,"_strokeAttenuation",!0);for(let a in du)Object.defineProperty(this,a,du[a]);if(this._renderer.type="text",this._renderer.flagFill=lb.bind(this),this._renderer.flagStroke=cb.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 a=0;a<Et.Properties.length;a++){const l=Et.Properties[a];l in s&&(this[l]=s[l])}}static Measure(i){if(wa){const r=wa.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,a,l;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":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,f]=r.multiply(o,a),[m,p]=r.multiply(o,l),[g,b]=r.multiply(s,a),[y,_]=r.multiply(s,l);return a=lu(f,p,b,_),o=lu(h,m,g,y),s=cu(h,m,g,y),l=cu(f,p,b,_),{top:a,left:o,right:s,bottom:l,width:s-o,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};N(Et,"Ratio",.6),N(Et,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let lr=Et;const du={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 Ze)&&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 Ze)&&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 Ze)&&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 Ze)&&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 lb(){this._flagFill=!0}function cb(){this._flagStroke=!0}const Qn=class Qn extends Fr{constructor(i,r,o,s){super(r,o,0,0);N(this,"_flagTextures",!1);N(this,"_flagFrameRate",!1);N(this,"_flagIndex",!1);N(this,"_amount",1);N(this,"_duration",0);N(this,"_index",0);N(this,"_startTime",0);N(this,"_playing",!1);N(this,"_firstFrame",0);N(this,"_lastFrame",0);N(this,"_loop",!0);N(this,"_textures",null);N(this,"_frameRate",0);N(this,"_origin",null);this._renderer.type="image-sequence";for(let a in uu)Object.defineProperty(this,a,uu[a]);this._renderer.flagTextures=db.bind(this),this._renderer.bindTextures=ub.bind(this),this._renderer.unbindTextures=fb.bind(this),this.noStroke(),this.noFill(),Array.isArray(i)?this.textures=i.map(fu.bind(this)):typeof i=="string"&&(this.textures=[fu(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,a,l,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?(a=this._amount,je.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=je.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?s=s%l:s=Math.min(s,l),d=Wt(this._firstFrame,u,s/l),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 Ze))&&(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}};N(Qn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),N(Qn,"DefaultFrameRate",30);let xa=Qn;const uu={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 vi((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 db(){this._flagTextures=!0}function ub(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fb(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fu(t){if(t instanceof Ze)return t;if(typeof t=="string")return new Ze(t)}const Di=class Di extends Fr{constructor(i,r,o,s,a,l){super(r,o,0,0);N(this,"_flagTexture",!1);N(this,"_flagColumns",!1);N(this,"_flagRows",!1);N(this,"_flagFrameRate",!1);N(this,"_flagIndex",!1);N(this,"_amount",1);N(this,"_duration",0);N(this,"_startTime",0);N(this,"_playing",!1);N(this,"_firstFrame",0);N(this,"_lastFrame",0);N(this,"_loop",!0);N(this,"_texture",null);N(this,"_columns",1);N(this,"_rows",1);N(this,"_frameRate",0);N(this,"_index",0);N(this,"_origin",null);this._renderer.type="sprite";for(let c in hu)Object.defineProperty(this,c,hu[c]);this.noStroke(),this.noFill(),i instanceof Ze?this.texture=i:typeof i=="string"&&(this.texture=new Ze(i)),this.origin=new pe,this._update(),typeof s=="number"&&(this.columns=s),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}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&&(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 Di(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,a,l,c,d,u,h,f,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)){h=i.image.width,f=i.image.height,s=h/r,a=f/o,c=this._amount,this.width!==s&&(this.width=s),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(je.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=je.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Wt(this._firstFrame,m,l/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+(h-s)/2,y=-a*g+(f-a)/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}};N(Di,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let ka=Di;const hu={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}}},Ho=Math.min,Wo=Math.max,hb={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},Ot=class Ot extends Nn{constructor(i){super();N(this,"_flagAdditions",!1);N(this,"_flagSubtractions",!1);N(this,"_flagOrder",!1);N(this,"_flagOpacity",!0);N(this,"_flagBeginning",!1);N(this,"_flagEnding",!1);N(this,"_flagLength",!1);N(this,"_flagMask",!1);N(this,"_fill","#fff");N(this,"_stroke","#000");N(this,"_linewidth",1);N(this,"_opacity",1);N(this,"_visible",!0);N(this,"_cap","round");N(this,"_join","round");N(this,"_miter",4);N(this,"_closed",!0);N(this,"_curved",!1);N(this,"_automatic",!0);N(this,"_beginning",0);N(this,"_ending",1);N(this,"_length",0);N(this,"_mask",null);N(this,"_strokeAttenuation",!0);for(let r in mu)Object.defineProperty(this,r,mu[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++)pu.call(this,i[r],this)}static RemoveChildren(i){for(let r=0;r<i.length;r++)pu.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 a=Ot.Properties[s];a in i&&(/(fill|stroke)/i.test(a)?r[a]=typeof i[a]=="string"?i[a]:Si(i[a]):r[a]=i[a])}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 da.fromObject(s);case"circle":return ha.fromObject(s);case"element":return Pr.fromObject(s);case"ellipse":return ga.fromObject(s);case"group":return Ot.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return xa.fromObject(s);case"path":return Oe.fromObject(s);case"points":return Lo.fromObject(s);case"polygon":return ya.fromObject(s);case"rectangle":return Fr.fromObject(s);case"rounded-rectangle":return ba.fromObject(s);case"shape":return Nn.fromObject(s);case"sprite":return ka.fromObject(s);case"star":return _a.fromObject(s);case"text":return lr.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,a,l,c){const d=i&&i.children;if(!d)return!1;const u=r.results;for(let h=d.length-1;h>=0;h--){const f=d[h];if(!f||!Ot.IsVisible(f,r.visibleOnly))continue;const m=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null;if(!(m&&!W0(m,r.x,r.y,l))){if(f instanceof Ot){if(o&&(!s||s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),c)||Ot.VisitForHitTest(f,r,o,s,a,l,c))return!0;continue}if(f instanceof Nn&&!(s&&!s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),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:a,hitOptions:l,context:c,single:d,empty:u}=hb.getShapesAtPoint;a.length=0;const h=s.mode==="deepest"||s.deepest?"deepest":"all",f=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"?l.precision=s.precision:delete l.precision,typeof s.fill<"u"?l.fill=s.fill:delete l.fill,typeof s.stroke<"u"?l.stroke=s.stroke:delete l.stroke,l.tolerance=g,l.ignoreVisibility=!f;const b=h==="deepest";if(c.x=i,c.y=r,c.visibleOnly=f,c.results=a,Ot.VisitForHitTest(this,c,m,p,l,g,b),b){if(a.length>0){const _=a[0];return a.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const y=a.slice();return a.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 a=this.children[s];a.isShape&&(a.translation.x-=r,a.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 a=0;a<s.children.length;a++)if(r=o(s.children[a]),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 a=0;a<s.children.length;a++){const l=s.children[a];o(l)}return r}return o(this)}getByType(i){const r=[];function o(s){if(s instanceof i&&r.push(s),s.children)for(let a=0;a<s.children.length;a++){const l=s.children[a];o(l)}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 a=i[s];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(i){let r,o,s,a,l,c;this._update(!0);let d=1/0,u=-1/0,h=1/0,f=-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),a=typeof r.left!="number"||je.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||je.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||je.isNaN(r.bottom)||!isFinite(r.bottom),!(s||a||l||c)))if(i){const[b,y]=o.multiply(r.left,r.top),[_,k]=o.multiply(r.right,r.top),[x,C]=o.multiply(r.left,r.bottom),[T,w]=o.multiply(r.right,r.bottom);h=Ho(y,k,C,w,h),d=Ho(b,_,x,T,d),u=Wo(b,_,x,T,u),f=Wo(y,k,C,w,f)}else h=Ho(r.top,h),d=Ho(r.left,d),u=Wo(r.right,u),f=Wo(r.bottom,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}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),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=s*l,u=a*l;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}};N(Ot,"Children",eu),N(Ot,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Hn=Ot;const mu={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 eu(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 pu(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 jo extends Oe{constructor(e,i,r,o){const s=[new Ae(e,i),new Ae(r,o)];super(s);for(let a in gu)Object.defineProperty(this,a,gu[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}N(jo,"Properties",["left","right"]);const gu={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 Fo("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 Fo("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class va{constructor(e=0,i=0){this.x=e,this.y=i}}class Tn{constructor(e=10,i=0,r="A"){N(this,"start",new va);N(this,"end",new va);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"}},mb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pb(t,e){return n.openBlock(),n.createElementBlock("svg",mb,[...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 qo=n.markRaw({name:"ion-close",render:pb}),gb={class:"mr-3 flex flex-col gap-2"},yb=["onClick"],bb={class:"h-full p-2"},_b={},wb=n.defineComponent({..._b,__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"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return n.onMounted(()=>{var c,d;(c=i.settings.templates)==null||c.forEach((u,h)=>{var m;const f=(m=o.value)==null?void 0:m.at(h);f&&a("init-draw-template",f,u)}),(d=i.settings.customTemplates)==null||d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.at(h);f&&a("init-draw-template",f,u)})}),n.watch(()=>[...i.settings.customTemplates],(c,d)=>{n.nextTick(()=>{c.forEach((u,h)=>{var f;if(!(d!=null&&d.includes(u))){const m=(f=s.value)==null?void 0:f.at(h);m&&a("init-draw-template",m,u)}}),d.length>c.length&&d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=qo;return n.openBlock(),n.createBlock(n.unref(M.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:n.withCtx(()=>[n.createElementVNode("div",gb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.settings.allTemplates,(h,f)=>(n.openBlock(),n.createElementBlock("div",{key:`${h.id}-${f}`,class:"group relative"},[n.createVNode(n.unref(M.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":f===t.selectTemplateIndex}]),onClick:m=>a("template:select",f)},[n.createElementVNode("div",bb,[n.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,yb)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:m=>l(f)},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):n.createCommentVNode("",!0)]))),128))])]),_:1})}}}),yu=An(wb,[["__scopeId","data-v-afccb364"]]),xb={class:"flex gap-3 min-w-[20rem] relative"},kb={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},vb={ref:"drawing-container",class:"size-full"},Cb={},bu=n.defineComponent({...Cb,__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=[],a=[],l=[],c=null;const d=.75,u=n.computed(()=>i.value.configuratorParams.linesAngles.map((L,A)=>new Tn(i.value.configuratorParams.linesWidths[A],L,`A-${A+1}`))),h=n.computed(()=>i.value.configuratorParams.colorSide==="bottom"),f=n.computed(()=>{var L,A;return i.value.configuratorParams.startTailType&&((L=i.settings.startTailConfigs)!=null&&L[i.value.configuratorParams.startTailType])?(A=i.settings.startTailConfigs)==null?void 0:A[i.value.configuratorParams.startTailType].points:[]}),m=n.computed(()=>{var A;const L=i.value.configuratorParams.endTailType!==void 0&&((A=i.settings.endTailConfigs)==null?void 0:A[i.value.configuratorParams.endTailType]);return!L||!L.points?[]:L.points.map((O,V)=>Array.isArray(O)?new Tn(O[0],O[1],`A-${V+1}`):new Tn(O.width,O.angle,`A-${V+1}`))}),p=(L,A=!1)=>{L[0].start.x=0,L[0].start.y=0;let O=0;for(let V=0;V<L.length;V++){const R=L[V],H=L[V-1]??new Tn(0,O);O+=!A||V>1?H.angle:0;const Y=(!A||V>0?R.angle:0)+O;if(L[V].end.x=R.width*Math.cos(Y*Math.PI/180)+L[V].start.x,L[V].end.y=R.width*Math.sin(Y*Math.PI/180)+L[V].start.y,V<L.length-1){const G=V+1;L[G].start.x=L[V].end.x,L[G].start.y=L[V].end.y}}return L},g=(L,A,O,V,R=!1)=>{let H=p([...O,...V]);A.length>0&&(H=[...p(A),...H]);let Y=0,G=0,X=0,W=0;H.forEach(ve=>{Y=Math.min(Y,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),W=Math.max(W,ve.start.y,ve.end.y)});let j,ae;Y===0&&G===0&&X===0&&W===0?(j=1,ae=1):(j=L.width/Math.abs(X-Y),ae=(R?L.height:L.height-qe.colorSideLabel.size)/Math.abs(W-G));const de=Math.min(j,ae);return Y=Y<0?-Y*de:0,G=G<0?-G*de:0,[de,Y,G]},b=L=>{const A=new Lo([L]);return A._size=qe.anchorPoint.size,A.fill=qe.anchorPoint.color,A.stroke="transparent",A._linewidth=qe.anchorPoint.strokeSize,l.push(A),A},y=(L,A)=>{if(l=[],i.settings.allowChangeFirstPoint){const O=L[0],V=new pe(O.vertices[0].x,O.vertices[0].y);V.bind(ne.Types.change,()=>{O.vertices[0].copy(V)});const R=b(V);A.add(R)}L.forEach((O,V)=>{const R=L[V+1],H=new pe(O.vertices[1].x,O.vertices[1].y);H.bind(ne.Types.change,()=>{O.vertices[1].copy(H),R!==void 0&&R.vertices[0].copy(H)});const Y=b(H);A.add(Y)})},_=L=>L*(Math.PI/180),k=(L,A,O)=>{const V=A.vertices.length-1;L.position.x=A.vertices[V].x,L.position.y=A.vertices[V].y;const R=Math.atan2(A.vertices[V].y-A.vertices[0].y,A.vertices[V].x-A.vertices[0].x);L.rotation=_(O)+R},x=(L,A,O)=>{if(A.vertices[0]===void 0)return;L.position.x=A.vertices[0].x,L.position.y=A.vertices[0].y;const V=A.vertices.length-1,R=Math.atan2(A.vertices[V].y-A.vertices[0].y,A.vertices[V].x-A.vertices[0].x);L.rotation=_(O)+R},C=(L,A,O)=>{const V=new Hn;if(L.length===0)return V;const R=[];return[...L].reverse().forEach((H,Y)=>{Y!==0&&H.angle>0&&(H.angle*=-1),R.push(H)}),L=p(R,!0),x(V,A,L[0].angle),[A.vertices[0],A.vertices[1]].forEach(H=>{H.bind(ne.Types.change,()=>{x(V,A,L[0].angle)})}),L.forEach(H=>{const Y=H.start.x*O,G=H.end.x*O,X=H.start.y*O,W=H.end.y*O,j=new jo(Y,X,G,W);j.linewidth=qe.line.size,j.stroke=qe.line.color,V.add(j)}),V},T=(L,A,O)=>{const V=new Hn;return L.length===0||(L=p(L,!0),k(V,A,L[0].angle),[A.vertices[0],A.vertices[1]].forEach(R=>{R.bind(ne.Types.change,()=>{k(V,A,L[0].angle)})}),L.forEach(R=>{const H=R.start.x*O,Y=R.end.x*O,G=R.start.y*O,X=R.end.y*O,W=new jo(H,G,Y,X);W.linewidth=qe.line.size,W.stroke=qe.line.color,V.add(W)})),V},w=(L,A,O,V)=>{const R=A.vertices[0].x+(A.vertices[1].x-A.vertices[0].x)/2-8*Math.sin(L.angle*Math.PI/180),H=A.vertices[0].y+(A.vertices[1].y-A.vertices[0].y)/2-8*Math.cos(L.angle*Math.PI/180),Y=new lr(L.label,R+10,H-10);let G;Y.size=qe.lineLabel.size,Y.weight=600,Y.fill=qe.lineLabel.color,Y.id+=1,Y.rotation=qe.lineLabel.rotation,V>0&&(G=new lr(`${L.angle}°`,A.vertices[0].x+25,A.vertices[0].y-25),G.size=qe.angleLabel.size,G.weight=600,G.fill=qe.angleLabel.color,G.rotation=qe.angleLabel.rotation,G.id+=V,s.push(G),O.add(G)),O.add(Y),v(Y,A,0,G),v(Y,A,1)},S=()=>{const{size:L}=qe.colorSideLabel,A=0,O=0,V=h.value?L/2:L/2-L,R=h.value?L/2-L:L/2,H=new Hn;if(!c)return H;const Y=5,G=Math.atan2(R-V,O-A),X=[new Ae(A,V,0,0,0,0,Cn.Commands.move),new Ae(O,R,0,0,0,0,Cn.Commands.line),new Ae(O-Y*Math.cos(G-Math.PI/4),R-Y*Math.sin(G-Math.PI/4),0,0,0,0,Cn.Commands.line),new Ae(O,R,0,0,0,0,Cn.Commands.move),new Ae(O-Y*Math.cos(G+Math.PI/4),R-Y*Math.sin(G+Math.PI/4),0,0,0,0,Cn.Commands.line)],W=new Oe(X,!1,!1,!0);W.noFill(),W.cap="round",W.join="round",W.linewidth=L/7,W.stroke=qe.colorSideLabel.color,H.add(W);const j=new lr(h.value?"Цвет снизу":"Цвет сверху",10,0);j.size=L,j.weight=600,j.fill=qe.colorSideLabel.color,j.alignment="left",H.add(j);const ae=H.getBoundingClientRect();return H.position.x=(c.width-ae.width)*d+10,H.position.y=h.value?c.height+ae.height*2:ae.height/2,H},v=(L,A,O,V)=>{A.vertices[O].bind(ne.Types.change,()=>{const R=A.vertices.length-1,H=Math.atan2(A.vertices[0].y-A.vertices[R].y,A.vertices[0].x-A.vertices[R].x)*180/Math.PI,Y=A.vertices[0].x+(A.vertices[R].x-A.vertices[0].x)/2-8*Math.sin(H*Math.PI/180),G=A.vertices[0].y+(A.vertices[R].y-A.vertices[0].y)/2-8*Math.cos(H*Math.PI/180);L.position.x=Y+10,L.position.y=G-10,L.rotation=-.5,V&&(V.position.x=A.vertices[0].x+25,V.position.y=A.vertices[0].y-25)})},$=(L,A,O,V,R=!1)=>{var st;if(L.clear(),O.length===0){L.update();return}const H=p(O),[Y,G,X]=g(L,A,H,V,R),W=new Hn,j=new Array,ae=new Array;R||(s=[],a=[]),H.forEach((_e,we)=>{const xt=_e.start.x*Y+G,$e=_e.end.x*Y+G,Zt=_e.start.y*Y+X,gn=_e.end.y*Y+X,Rt=new jo(xt,Zt,$e,gn);Rt.linewidth=R?qe.previewLine.size:qe.line.size,Rt.stroke=R?qe.previewLine.color:qe.line.color,a.push(Rt),j.push(Rt),W.add(Rt),!R&&_e.label!==""&&w(_e,Rt,W,we)});const de=j.at(-1);let ve=W.getBoundingClientRect();if(!R){const _e=S();ae.push(_e)}if(A.length>0){const _e=C(A,j[0],Y);W.add(_e)}if(V.length>0&&de){const _e=T(V,de,Y);W.add(_e)}if(ae.push(W),L.makeGroup(ae),ve=W.getBoundingClientRect(),W.position.x=0-ve.left+(L.width-ve.width)/(2*(R?1:d)),W.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";W.position.y=W.position.y+qe.colorSideLabel.size*Number(_e),y(j,W),L.update()}},E=(L,A)=>{if(L&&!A.isNewRec()){const O=new Cn({width:L.scrollWidth,height:L.scrollHeight});O.appendTo(L),$(O,[],A.points,[],!0)}},F=()=>{c&&$(c,f.value,u.value,m.value,!1)},P=L=>L*(180/Math.PI),I=(L,A)=>{const O=L[1].x-L[0].x,V=L[1].y-L[0].y,R=A[1].x-A[0].x,H=A[1].y-A[0].y;let Y=Math.atan2(O*H-V*R,O*R+V*H);return Y=P(Y),Math.round(Y)*-1},K=L=>{const A=a.map((O,V,R)=>{const H=R[V-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let Y=Math.ceil(O._length/L/i.settings.lineWidthStep)*i.settings.lineWidthStep;const G=s[V-1];Y<(R.length>1?i.settings.minLineWidth:i.settings.stripMinWidth)&&(Y=R.length>1?i.settings.minLineWidth:i.settings.stripMinWidth),Y>i.settings.maxLineWidth&&(Y=i.settings.maxLineWidth);const X=I(O.vertices,H.vertices);return G&&(G.value=`${X}°`),new Tn(Y,X,`A-${V+1}`)});r("pointer:move",A)},J=L=>{let A=null,O;const V=G=>{A=l.find(X=>{const W=X.renderer;return(W==null?void 0:W.elem)===G.target}),[O]=g(L,f.value,u.value.map(X=>X),m.value)},R=G=>{if(A){const X=A.renderer,W=X==null?void 0:X.elem;if(!W)return;const j=W.getBoundingClientRect();A.vertices[0].x-=j.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+qe.anchorPoint.size/2,A.vertices[0].y-=j.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+qe.anchorPoint.size/2,K(O),L.update()}},H=()=>{A&&r("pointer:up",u.value),A=null},Y=o.value;Y&&(Y.addEventListener("touchstart",V,{passive:!0}),Y.addEventListener("touchend",H,{passive:!0}),Y.addEventListener("mousedown",V),Y.addEventListener("mouseup",H),Y.addEventListener("mousemove",R),Y.addEventListener("touchmove",R,{passive:!0}))},Z=(L,A)=>{r("remove-custom-template",L,A)};return n.onMounted(()=>{o.value&&(c=new Cn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),n.watch(()=>i.value,()=>{F()},{deep:!0,immediate:!0}),J(c))}),n.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(L,A)=>(n.openBlock(),n.createElementBlock("div",xb,[n.createVNode(yu,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":A[0]||(A[0]=O=>r("template:select",O)),onInitDrawTemplate:E,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),n.createElementVNode("div",kb,[n.createElementVNode("div",vb,null,512)])]))}});class cr extends q.Identity{constructor(i,r){super();N(this,"label","");N(this,"points",[]);N(this,"isCustom",!1);N(this,"id",-1);N(this,"guid","");i?(this.label=i.label,this.points=i.points.map((o,s)=>z.isArray(o)?new Tn(o[0],o[1],`A-${s+1}`):new Tn(o.width,o.angle,`A-${s+1}`)),this.isCustom=i.isCustom):(this.label="-- Новая конфигурация --",this.points=[new Tn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Ca extends cr{constructor(i){super(i);N(this,"isDefault");this.isDefault=i.isDefault??!1}}class _u{constructor(e){N(this,"minLineWidth");N(this,"maxLineWidth");N(this,"lineWidthStep");N(this,"minLineAngle");N(this,"maxLineAngle");N(this,"lineAngleStep");N(this,"stripMinWidth");N(this,"stripMaxWidth");N(this,"stripMinLength");N(this,"stripMaxLength");N(this,"allowShowTable");N(this,"showOnlyTemplates");N(this,"templates");N(this,"customTemplates",[]);N(this,"startTailConfigs");N(this,"endTailConfigs");N(this,"bendCountForExtended");N(this,"extendedProductCatalog");N(this,"allowChangeFirstPoint");N(this,"allowSaveTemplates");N(this,"userTemplatesPrefix");N(this,"lengthStep");N(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 cr(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((i=e.startTailConfigs)==null?void 0:i.map(o=>new Ca(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Ca(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 a=new cr(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new cr({label:"-- Новая конфигурация --",points:[new Tn(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 cr(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 Sb={class:"flex flex-col gap-3"},Bb={class:"grid gap-5 md:grid-cols-5"},Nb={},wu=n.defineComponent({...Nb,__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),a=n.ref(!1),l=n.ref(i.cartItem),c=n.ref(new _u(i.settings)),d=n.ref({linesWidths:[...i.cartItem.configuratorParams.linesWidths],linesAngles:[...i.cartItem.configuratorParams.linesAngles]}),u=n.ref({quantity:{},marker:{},length:{}}),h=n.ref(0),f=n.useTemplateRef("kozyrek-configurator-params-form"),m=(v=0)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(v);$!==void 0&&(h.value=v,l.value.configuratorParams.linesWidths=$.points.map(F=>z.isArray(F)?F[0]:F.width),l.value.configuratorParams.linesAngles=$.points.map(F=>z.isArray(F)?F[1]:F.angle),k()),y(l.value.configuratorParams)},p=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const $={label:v,points:l.value.configuratorParams.linesWidths.map((F,P)=>[F,l.value.configuratorParams.linesAngles[P]])},E=F=>{F&&(c.value.addCustomTemplate($),h.value=c.value.allTemplates.length-2),a.value=!1};i.eventEmitter.emit("configurator:create-template",{category:i.cartItem.category,template:$,callback:E})},g=async(v,$)=>{var P;const E=(P=c.value.allTemplates)==null?void 0:P.at(v);if(!E||!E.isCustom)return;const F=I=>{I&&(c.value.removeCustomTemplate(E.id),m()),$==null||$()};i.eventEmitter.emit("configurator:remove-template",{category:i.cartItem.category,templateId:E.id,callback:F})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async v=>{var $,E;l.value.product=new q.ClientProduct,(E=($=f.value)==null?void 0:$.formReference)==null||E.validate(F=>{F||(k(),o.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:v,validationFieldResultData:u.value,callback:P=>{P?l.value.product=P:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(z.noop)},_=async()=>{var v,$;($=(v=f.value)==null?void 0:v.formReference)==null||$.validate(E=>{var F,P;if(!E){s.value=!0;const I=new q.OrderItemBase(l.value);(F=c.value.startTailConfigs)!=null&&F.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=f.value)==null?void 0:K.formReference)==null||J.restoreValidation()})})}}).catch(z.noop)},k=()=>{const v={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach(($,E)=>{v[`lines_widths[${E+1}]`]={},v[`lines_angles[${E+1}]`]={}}),u.value=v},x=v=>{d.value.linesWidths=v.map($=>$.width),d.value.linesAngles=v.map($=>$.angle)},C=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,k(),b(),y(l.value.configuratorParams)},T=(v,$)=>{d.value.linesWidths=v,d.value.linesAngles=$},w=v=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,E=0;l.value.configuratorParams.linesWidths.splice(v+1,0,$),l.value.configuratorParams.linesAngles.splice(v+1,0,E),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),b(),y(l.value.configuratorParams)},S=v=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(v,1),l.value.configuratorParams.linesAngles.splice(v,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),b(),y(l.value.configuratorParams))};return n.onMounted(()=>{i.cartItem.isNewRec()?m():(k(),h.value=-1,y(l.value.configuratorParams))}),n.watch(()=>i.cartItem,v=>{l.value=new q.OrderItemBase(v),v.isNewRec()?m():(k(),h.value=-1,y(l.value.configuratorParams))}),(v,$)=>{const E=M.NButton;return n.openBlock(),n.createElementBlock("div",Sb,[t.settings.allowShowTable?(n.openBlock(),n.createBlock(E,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=F=>r("click:view-switch"))},{default:n.withCtx(()=>[...$[3]||($[3]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Bb,[n.createVNode(bu,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":C,"onPointer:move":x,"onTemplate:select":m,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),n.createVNode(Ql,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=F=>l.value=F),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":$[2]||($[2]=F=>y(F)),"onUpdate:preview":T,onSubmit:_,"onClick:saveTemplate":p,"onClick:addLine":w,"onClick:removeLine":S},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),Tb={class:"flex flex-col items-center justify-between rounded-xl"},$b={class:"img-preview relative flex justify-center"},Eb={},Rb=n.defineComponent({...Eb,__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 z.keys(i.settings.crossbarCount).reverse().find(a=>s>=i.settings.crossbarCount[Number(a)])}),o=e;return(s,a)=>{const l=M.NButton;return n.openBlock(),n.createElementBlock("div",Tb,[n.createElementVNode("div",$b,[a[1]||(a[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(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>o("open-instructions"))},{default:n.withCtx(()=>[...a[2]||(a[2]=[n.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Sa=An(Rb,[["__scopeId","data-v-2a790a20"]]),Pb={key:0,class:"flex items-baseline gap-1"},Fb={key:0,class:"flex items-baseline gap-1"},Vb={key:1},Mb={class:"text-lg font-semibold"},Ib={key:2,class:"text-red-500 text-sm mb-2"},Ab={class:"flex gap-3"},Ob={},xu=n.defineComponent({...Ob,__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(()=>et.isPhoneDevice()),a=n.useTemplateRef("form-reference"),l=n.useTemplateRef("width-form-item-reference"),c=n.useTemplateRef("height-form-item-reference"),d=n.useTemplateRef("width-input-reference"),u=n.ref(z.cloneDeep(r.value)),h=n.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),f=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+h.value:0),b=n.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),y=n.ref(r.settings.canSetDopProdaga??!1),_=n.computed(()=>({"configuratorParams.width":[le.required,le.min(r.settings.minWidth-h.value),le.max(m.value-h.value),le.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[le.required,le.min(r.settings.minHeight-f.value),le.max(p.value-f.value),le.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[le.required,le.min(1),le.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),k=n.computed(()=>{var P;const S=g.value,v=b.value,{quantity:$}=r.value,E=((P=r.value.product)==null?void 0:P.costRub)||0;if(!S||!v||!$||E===0)return null;const F=S*v/1e6;return(E*$*F).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=n.computed(()=>{const S=g.value,v=b.value,$=!!(S&&S>=r.settings.minWidth&&S<=r.settings.maxWidths[u.value.configuratorParams.netType]),E=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[u.value.configuratorParams.netType]),F=!!(r.value.quantity&&r.value.quantity>0);return $&&E&&F}),C=(S,v)=>{var F,P;const $=u.value.configuratorParams;S&&S in $&&($[S]=v);const E={...$,width:g.value??0,height:b.value??0};S==="width"&&((F=l.value)==null||F.validate().catch(z.noop)),S==="height"&&((P=c.value)==null||P.validate().catch(z.noop)),n.nextTick(()=>{var K,J;!((K=l.value)!=null&&K.validationErrored)&&!((J=c.value)!=null&&J.validationErrored)&&E.height&&E.width&&o("update:params",E),T("configuratorParams",E)})},T=(S,v)=>{const $=new q.OrderItemBase(r.value);$[S]=v,S==="configuratorParams"&&($.product=new q.ClientProduct),o("update:value",$)};return n.watch(()=>r.value,S=>{const v=z.cloneDeep(n.toRaw(S)),$=v.configuratorParams.mountType,E=r.settings.widthOverlaps[$]??0,F=r.settings.heightOverlaps[$]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=E),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=F),u.value=v},{deep:!0,immediate:!0}),n.onMounted(()=>{var S;(S=d.value)==null||S.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(S,v)=>{const $=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=E=>u.value.configuratorParams.netType=E),v[1]||(v[1]=E=>C("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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=E=>u.value.configuratorParams.color=E),v[3]||(v[3]=E=>C("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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=E=>u.value.configuratorParams.mountType=E),v[5]||(v[5]=E=>C("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(M.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${m.value?" до "+(m.value-h.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",Pb,[n.createVNode(n.unref(M.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Ширина готового изделия "+n.toDisplayString(g.value),1)]),_:1}),n.createVNode(n.unref(M.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...v[25]||(v[25]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=E=>u.value.configuratorParams.width=E),v[9]||(v[9]=E=>C("width",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=E=>n.unref(at)(E)),onInput:v[8]||(v[8]=E=>n.unref(rt)(t.validation,"width")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(M.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${p.value?" до "+(p.value-f.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",Fb,[n.createVNode(n.unref(M.NText),{type:"success"},{default:n.withCtx(()=>[n.createTextVNode("Высота готового изделия "+n.toDisplayString(b.value),1)]),_:1}),n.createVNode(n.unref(M.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=E=>o("click:instructions-toggle"))},{default:n.withCtx(()=>[...v[26]||(v[26]=[n.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=E=>u.value.configuratorParams.height=E),v[14]||(v[14]=E=>C("height",E))],parse:n.unref(ct),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=E=>n.unref(at)(E)),onInput:v[13]||(v[13]=E=>n.unref(rt)(t.validation,"height")),onFocus:n.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),n.createVNode(n.unref(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[16]||(v[16]=E=>u.value.quantity=E),v[19]||(v[19]=E=>T("quantity",E??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=E=>n.unref(at)(E,!1)),onInput:v[18]||(v[18]=E=>n.unref(rt)(t.validation,"quantity")),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=E=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":v[21]||(v[21]=E=>{u.value.marker=E??null,T("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":v[22]||(v[22]=E=>{u.value.isAdditionalSale=E??!1,T("isAdditionalSale",E??!1)})},{default:n.withCtx(()=>[...v[27]||(v[27]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(Nr,{"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",Vb,[v[28]||(v[28]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",Mb,n.toDisplayString(k.value)+" ₽",1)])):n.createCommentVNode("",!0),x.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Ib," Пожалуйста, заполните все обязательные поля корректно. ")),n.createElementVNode("div",Ab,[n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[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(M.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=E=>o("click:show-preview-drawer"))},{default:n.withCtx(()=>[...v[29]||(v[29]=[n.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):n.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",u.value)]])}}}),zb="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Db="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Lb="/img/configurators/mosquitto/measurement-instructions/mount.png",Hb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Wb="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",jb={class:"flex flex-col gap-6"},qb={class:"flex gap-4"},Xb={class:"flex flex-col gap-2"},Yb={class:"flex gap-4"},Ub={class:"flex flex-col gap-2"},Kb={class:"flex gap-4"},Gb={class:"flex flex-col gap-2"},Zb={},ku=n.defineComponent({...Zb,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const i=et.initRefDependingOnDeviceResolution("small","small","medium"),r=et.initRefDependingOnDeviceResolution(.98,.95,.8),o=n.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=M.NText;return n.openBlock(),n.createBlock(n.unref(M.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:l[0]||(l[0]=d=>s("update:show",!1)),onEsc:l[1]||(l[1]=d=>s("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>s("update:show",!1))},{default:n.withCtx(()=>[n.createElementVNode("div",jb,[n.createVNode(c,{type:"error",class:"text-base font-medium"},{default:n.withCtx(()=>[...l[3]||(l[3]=[n.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[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:zb,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:Db,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",qb,[l[9]||(l[9]=n.createElementVNode("img",{src:Lb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",Xb,[l[8]||(l[8]=n.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),n.createElementVNode("span",null,[l[4]||(l[4]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=n.createElementVNode("br",null,null,-1)),l[7]||(l[7]=n.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),n.createElementVNode("div",Yb,[l[15]||(l[15]=n.createElementVNode("img",{src:Hb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",Ub,[l[14]||(l[14]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),n.createElementVNode("span",null,[l[10]||(l[10]=n.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=n.createElementVNode("br",null,null,-1)),l[13]||(l[13]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),n.createElementVNode("div",Kb,[l[21]||(l[21]=n.createElementVNode("img",{src:Wb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),n.createElementVNode("div",Gb,[l[20]||(l[20]=n.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),n.createElementVNode("span",null,[l[16]||(l[16]=n.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" Ширина светового проема +"+n.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+n.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=n.createElementVNode("br",null,null,-1)),l[19]||(l[19]=n.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Qb={class:"grid md:grid-cols-2"},Jb={},vu=n.defineComponent({...Jb,__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(()=>et.isPhoneDevice()),s=n.ref(!1),a=n.ref(!1),l=n.ref(i.cartItem),c=n.useTemplateRef("mosquito-configurator-form"),d=n.ref({width:{},height:{},quantity:{},marker:{}}),u=n.ref(!1),h=n.ref(!1),f=n.computed(()=>n.inject("debounce-input-time",300)),m=z.debounce(async g=>{var b,y;l.value.product=new q.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?l.value.product=k:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(z.noop)},f.value),p=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return n.watch(()=>i.cartItem,g=>{l.value=g},{deep:!0}),(g,b)=>{const y=qo;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(ku,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),n.createElementVNode("div",Qb,[o.value?(n.openBlock(),n.createBlock(n.unref(M.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(M.NDrawerContent),null,{header:n.withCtx(()=>[n.createVNode(n.unref(M.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(Sa,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(n.openBlock(),n.createBlock(Sa,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),n.createVNode(xu,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>n.unref(m)(_)),onSubmit:b[7]||(b[7]=_=>p()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),e1={},Cu=n.defineComponent({...e1,__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"),a=n.ref(!1),l=n.ref(r.value),c=n.useTemplateRef("form-item-reference"),d=n.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{l.value=m,o("update:value",m,r.index,a)},h=m=>{at(m),(m.key==="Enter"||m.code==="Enter")&&!r.isLastLine&&(m.preventDefault(),m.stopPropagation())},f=()=>{var m;(m=s.value)==null||m.select()};return n.watch(()=>r.value,m=>{l.value=m}),n.onMounted(()=>{r.autoFocus&&n.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(m,p)=>{const g=Zl,b=lo;return n.openBlock(),n.createBlock(n.unref(M.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(Nr,{key:0,"is-product-searching":a.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(M.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:n.unref(ct),placeholder:"Введите ширину",onKeydown:h,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(M.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(M.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"])}}}),t1={class:"my-2 flex w-full flex-col"},n1={key:1},i1={class:"text-lg font-semibold"},r1={class:"flex gap-3"},o1={},Su=n.defineComponent({...o1,__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"),a=n.useTemplateRef("line-items-reference"),l=n.ref(z.cloneDeep(r.value)),c=n.computed(()=>{const k={length:[le.required,le.min(r.settings.minLength),le.max(r.settings.maxLength),le.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[le.required,le.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return z.forEach(l.value,(x,C)=>{var T;k[`configuratorParams.linesWidths.${C}`]=[le.required,le.min(r.settings.minLineWidth),le.step(r.settings.lineWidthStep),We.serverValidation((T=r.validation[`linesWidths.${C}`])==null?void 0:T.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)),h=n.computed(()=>r.settings.width-u.value),f=n.computed(()=>!r.value.some(({product:k})=>!k||k.isNewRec())),m=n.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(k=>k.product.isNewRec())),p=n.computed(()=>k=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+k}]),g=n.computed(()=>{const{length:k}=r.value[0];return!k||u.value!==r.settings.width?null:(z.reduce(r.value,(C,T)=>{var S;const w=((S=T.product)==null?void 0:S.costRub)||0;return C+w},0)*r.value[0].quantity*k).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(k,x,C)=>{var w,S,v;l.value[x].product.id=-1;const{configuratorParams:T}=l.value[x];T.linesWidths[x]=k,y("configuratorParams",T),(v=(S=(w=a.value)==null?void 0:w.at(x))==null?void 0:S.formItemReference)==null||v.validate().catch(z.noop),n.nextTick(()=>{var $,E;(E=($=a.value)==null?void 0:$.at(x))!=null&&E.isValid&&o("update:params",T,x,C)})},y=(k,x)=>{l.value.forEach(C=>{C[k]=x}),o("update:value",l.value)};return n.watch(()=>r.value,k=>{l.value=z.cloneDeep(k)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(k,x)=>{const C=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var T;return[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(w,S)=>{var v,$,E;return n.openBlock(),n.createBlock(Cu,{key:S,ref_for:!0,ref:"line-items-reference",value:((v=w.configuratorParams)==null?void 0:v.linesWidths.at(S))??null,"auto-focus":((($=w.configuratorParams)==null?void 0:$.linesWidths.at(S))??0)===0,index:S,path:`configuratorParams.linesWidths.${S}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":p.value(((E=w.configuratorParams)==null?void 0:E.linesWidths.at(S))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(F=>F.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"is-last-line":S===l.value.length-1&&h.value===0,"onUpdate:value":b,"onClick:addLine":x[0]||(x[0]=F=>o("click:add-line",F)),"onClick:removeLine":x[1]||(x[1]=F=>o("click:remove-line",F))},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",t1,[h.value<0?(n.openBlock(),n.createBlock(n.unref(M.NText),{key:0,type:"error"},{default:n.withCtx(()=>[n.createTextVNode(" Сумма ширин всех полос должна быть равна "+n.toDisplayString(t.settings.width),1)]),_:1})):n.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(n.openBlock(),n.createBlock(n.unref(M.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(M.NText),{type:h.value>=0?"Success":"error"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value),1)]),_:1},8,["type"]),n.createTextVNode(" из "+n.toDisplayString(t.settings.width)+" мм ",1)])]),n.createVNode(n.unref(M.NButton),{disabled:m.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",l.value.length))},{default:n.withCtx(()=>[...x[17]||(x[17]=[n.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),n.createVNode(n.unref(M.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.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(at)(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(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.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(at)(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(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>n.unref(rt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,y("marker",w??null)}),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(C,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{l.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",n1,[x[19]||(x[19]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",i1,n.toDisplayString(g.value)+" ₽",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",r1,[n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((T=l.value[0])!=null&&T.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>o("submit",l.value))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[n.unref(ti),()=>o("submit",l.value)]])}}}),s1={class:"flex grow flex-col"},a1=["src"],l1={class:"w-full"},c1={},Bu=n.defineComponent({...c1,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",s1,[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,a1),n.createElementVNode("div",l1,[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)])]))}}),d1={class:"flex flex-col gap-2"},u1={class:"w-104 flex grow flex-col px-5"},f1={},Nu=n.defineComponent({...f1,__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),a=n.ref({width:{},length:{},quantity:{},marker:{}}),l=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 q.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)},h=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 a[`linesWidths.${p}`],delete a[`linesWidths.${p}`])},f=z.debounce(async(p,g,b)=>{const y={linesWidths:p.linesWidths.at(g)};b.value=!0,a.value[`linesWidths.${g}`]={},s.value[g].product=new q.ClientProduct,i.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:y,validationFieldResultData:a.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 q.ClientProduct,a.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){l.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,n.nextTick(()=>{var _,k;(k=(_=o.value)==null?void 0:_.formReference)==null||k.restoreValidation()})})}}).catch(z.noop)};return n.watch(()=>i.cartItems,p=>{s.value=p.map(g=>new q.OrderItemBase(g))}),(p,g)=>{const b=M.NButton;return n.openBlock(),n.createElementBlock("div",d1,[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",u1,[n.createVNode(Bu,{value:s.value,"onUpdate:value":g[1]||(g[1]=y=>s.value=y),settings:t.settings},null,8,["value","settings"]),n.createVNode(Su,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":n.unref(f),onSubmit:m,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),h1={class:"flex flex-col gap-3"},m1={},Tu=n.defineComponent({...m1,__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"),a=n.useTemplateRef("first-input-element"),l=n.ref(z.cloneDeep(r.value)),c=n.computed(()=>({"configuratorParams.width":[le.required,le.min(r.settings.minWidth),...r.settings.maxWidth?[le.max(r.settings.maxWidth)]:[],le.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[le.required,le.min(r.settings.minLength),le.max(r.settings.maxLength),le.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[le.required,le.min(1),le.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",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(p,g)=>{const b=new q.OrderItemBase(r.value);b[p]=g,p==="configuratorParams"&&(b.product=new q.ClientProduct),o("update:value",b)},f=()=>{var p;(p=a.value)==null||p.select()};return n.watch(()=>r.value,p=>{l.value=z.cloneDeep(p)},{deep:!0}),n.onMounted(()=>{r.value.isNewRec()&&n.nextTick(()=>{f()})}),e({validate:(m=s.value)==null?void 0:m.validate,formReference:s}),(p,g)=>{const b=M.NCheckbox;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:l.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(M.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:n.unref(ct),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=y=>n.unref(at)(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(M.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:n.unref(ct),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=y=>n.unref(at)(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(M.NFormItem),{path:"quantity",label:"Количество"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=y=>n.unref(at)(y,!1)),onInput:g[7]||(g[7]=y=>n.unref(rt)(t.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=y=>h("quantity",y??0)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),n.createVNode(n.unref(M.NFormItem),{path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.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=>h("marker",y??null)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(n.openBlock(),n.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:n.withCtx(()=>[...g[13]||(g[13]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(Nr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),n.createElementVNode("div",h1,[n.createVNode(n.unref(M.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",l.value)]])}}}),p1={class:"flex flex-col gap-2 w-72"},g1={},$u=n.defineComponent({...g1,__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),a=n.ref({width:{},length:{},quantity:{},marker:{}}),l=n.ref(!1),c=n.ref(!1),d=n.computed(()=>n.inject("debounce-input-time",300)),u=z.debounce(async f=>{var m,p;s.value.product=new q.ClientProduct,(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(g=>{g||(l.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:f,validationFieldResultData:a.value,callback:b=>{b?s.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(z.noop)},d.value),h=async()=>{var f,m;(m=(f=o.value)==null?void 0:f.formReference)==null||m.validate(p=>{p||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})}))}).catch(z.noop)};return n.watch(()=>i.cartItem,f=>{s.value=new q.OrderItemBase(f)},{deep:!0}),(f,m)=>{const p=M.NButton;return n.openBlock(),n.createElementBlock("div",p1,[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(Tu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":m[1]||(m[1]=g=>s.value=g),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":m[2]||(m[2]=g=>n.unref(u)(g)),onSubmit:m[3]||(m[3]=g=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),y1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b1(t,e){return n.openBlock(),n.createElementBlock("svg",y1,[...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 Eu=n.markRaw({name:"ion-add",render:b1}),_1={key:0,class:"-mt-1 text-sm text-gray-500"},w1={class:"font-bold"},x1={class:"flex flex-col gap-3"},k1={key:0,class:"mt-4 flex flex-col gap-1.5"},v1={class:"flex flex-col gap-1 text-sm text-gray-700"},C1={key:0},S1={key:1},B1={"form-array-name":"items",class:"flex flex-col gap-3"},N1={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},T1={key:0,class:"flex flex-wrap items-end gap-2"},$1={class:"whitespace-nowrap text-xl font-bold"},E1={key:0,class:"whitespace-nowrap text-lg text-gray-500"},R1={class:"font-bold"},P1={class:"font-bold"},F1={class:"flex gap-3"},V1={},Ru=n.defineComponent({...V1,__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 A;const r=t,o=i,s=n.useTemplateRef("form-reference"),a=n.ref(z.cloneDeep(r.value)),l=n.ref({...r.validation}),c=O=>{var V;delete l.value[O],(V=s.value)==null||V.restoreValidation()};n.watch(()=>r.validation,O=>{l.value={...O},Object.values(O).some(R=>R==null?void 0:R.feedback)&&n.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.validate(z.noop).catch(z.noop)})},{deep:!0});const d=n.computed(()=>r.value.category),u=n.ref(null),h=n.ref(null),f=n.computed(()=>d.value.products??[]),m=n.computed(()=>f.value.map(O=>({label:O.name,value:O.id}))),p=(O,V,R)=>{const H=O!=null&&O>0,Y=V!=null&&V>0;return!H&&!Y?null:H&&Y?`от ${O} ${R} до ${V} ${R}`:H?`от ${O} ${R}`:`до ${V} ${R}`},g=n.computed(()=>{var O,V;return p(r.settings.minWidth,(V=(O=u.value)==null?void 0:O.properties)==null?void 0:V.width,"мм")}),b=n.computed(()=>{var O,V;return p(r.settings.minLength,(V=(O=u.value)==null?void 0:O.properties)==null?void 0:V.length,"мм")}),y=n.ref(null),_=n.ref(!1),k=n.computed(()=>{var V;const O={marker:[We.serverValidation((V=l.value.marker)==null?void 0:V.feedback)]};return a.value.configuratorParams.items.forEach((R,H)=>{var Y,G,X,W,j,ae,de;O[`configuratorParams.items.${H}.width`]=[le.required,le.min(r.settings.minWidth),...(G=(Y=u.value)==null?void 0:Y.properties)!=null&&G.width?[le.max(u.value.properties.width)]:[],le.step(1),We.serverValidation((X=l.value[`items.${H}.width`])==null?void 0:X.feedback)],O[`configuratorParams.items.${H}.length`]=[le.required,le.min(r.settings.minLength),...(j=(W=u.value)==null?void 0:W.properties)!=null&&j.length?[le.max(u.value.properties.length)]:[],le.step(1),We.serverValidation((ae=l.value[`items.${H}.length`])==null?void 0:ae.feedback)],O[`configuratorParams.items.${H}.count`]=[le.required,le.min(1),le.step(1),We.serverValidation((de=l.value[`items.${H}.count`])==null?void 0:de.feedback)]}),O}),x=n.ref(r.settings.canSetDopProdaga??!1),C=n.computed(()=>a.value.configuratorParams.items.some(O=>{var V,R;return!u.value||!O.width||O.width<r.settings.minWidth||O.width>(((V=u.value.properties)==null?void 0:V.width)??0)||O.length===0||O.length<r.settings.minLength||O.length>(((R=u.value.properties)==null?void 0:R.length)??0)||!O.count||O.count<1})),T=n.computed(()=>!u.value||C.value||a.value.configuratorParams.items.length===0),w=n.ref(null),S=O=>{if(!O){u.value=null,h.value=null,a.value.product=new q.ClientProduct,y.value=null;return}const V=f.value.find(R=>R.id===O);V&&(u.value=V,h.value=O,a.value.product=V,Z("product",a.value.product),a.value.configuratorParams.items.forEach(R=>{var H,Y;(H=V.properties)!=null&&H.width&&R.width>V.properties.width&&(R.width=V.properties.width),(Y=V.properties)!=null&&Y.length&&R.length>V.properties.length&&(R.length=V.properties.length)}),$())};let v=!1;const $=()=>{v=!0,y.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},E=async()=>{var O;if(!u.value||a.value.configuratorParams.items.length===0||C.value){$();return}(O=s.value)==null||O.validate(V=>{if(V){$();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:a.value.configuratorParams.items},callback:R=>{R?(y.value=R,a.value.configuratorParams.calculationId=R.id,a.value.quantity=R.quantity,n.nextTick(()=>{Z("quantity",R.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,$()),Z("configuratorParams",a.value.configuratorParams),F(),_.value=!1}})}).catch(()=>{$(),_.value=!1})},F=()=>{var V;if(!((V=u.value)!=null&&V.costRub)||!y.value){w.value=null;return}const O=y.value.quantity*u.value.costRub;w.value=Math.round(O*100)/100},P=O=>{var R,H;const V=a.value.configuratorParams.items[O];u.value&&((R=u.value.properties)!=null&&R.width&&V.width>u.value.properties.width&&(V.width=u.value.properties.width),(H=u.value.properties)!=null&&H.length&&V.length>u.value.properties.length&&(V.length=u.value.properties.length)),Z("configuratorParams",a.value.configuratorParams),$()},I=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),Z("configuratorParams",a.value.configuratorParams),$(),o("add-item",a.value.configuratorParams.items.length)},K=O=>{a.value.configuratorParams.items.splice(O,1),Z("configuratorParams",a.value.configuratorParams),$(),o("remove-item",O)},J=()=>{if(!(T.value||_.value||r.isSubmitProcessing)){if(!y.value){E();return}o("submit",a.value)}},Z=(O,V)=>{const R=new q.OrderItemBase(r.value);R[O]=V,o("update:value",R)};n.watch(()=>r.value,O=>{const V=z.cloneDeep(n.toRaw(O));(!V.configuratorParams.items||V.configuratorParams.items.length===0)&&(V.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=V,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,h.value=null),v?v=!1:L()},{deep:!0});const L=()=>{const{calculationId:O}=a.value.configuratorParams,V=a.value.quantity??0;O&&V>0&&a.value.product&&!a.value.product.isNewRec()&&(y.value={id:O,quantity:V,sheets:[]},F())};return n.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),L()}),e({validate:(A=s.value)==null?void 0:A.validate,formReference:s}),(O,V)=>{const R=lo,H=Eu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{ref:"form-reference",model:a.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>{var Y;return[n.createVNode(n.unref(M.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:h.value,"onUpdate:value":[V[0]||(V[0]=G=>h.value=G),S],options:m.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((Y=u.value)==null?void 0:Y.costRub)!=null?(n.openBlock(),n.createElementBlock("div",_1,[n.createElementVNode("span",w1,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",x1,[u.value?(n.openBlock(),n.createElementBlock("div",k1,[V[7]||(V[7]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",v1,[g.value?(n.openBlock(),n.createElementBlock("div",C1,"Ширина "+n.toDisplayString(g.value)+".",1)):n.createCommentVNode("",!0),b.value?(n.openBlock(),n.createElementBlock("div",S1,"Длина "+n.toDisplayString(b.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",B1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.configuratorParams.items,(G,X)=>(n.openBlock(),n.createElementBlock("div",{key:X,class:"flex grow gap-2"},[n.createElementVNode("div",N1,[n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.items.${X}.width`,label:"Ширина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:a.value.configuratorParams.items[X].width,"onUpdate:value":[W=>a.value.configuratorParams.items[X].width=W,W=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:V[1]||(V[1]=W=>n.unref(at)(W)),onInput:W=>c(`items.${X}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.items.${X}.length`,label:"Длина, мм"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:a.value.configuratorParams.items[X].length,"onUpdate:value":[W=>a.value.configuratorParams.items[X].length=W,W=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:V[2]||(V[2]=W=>n.unref(at)(W)),onInput:W=>c(`items.${X}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`configuratorParams.items.${X}.count`,label:"Количество, шт"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:a.value.configuratorParams.items[X].count,"onUpdate:value":[W=>a.value.configuratorParams.items[X].count=W,W=>P(X)],parse:n.unref(ct),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:V[3]||(V[3]=W=>n.unref(at)(W,!1)),onInput:W=>c(`items.${X}.count`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createVNode(n.unref(M.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:W=>K(X)},{default:n.withCtx(()=>[n.createVNode(R)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:1,disabled:C.value,type:"default",class:"self-center",onClick:I},{default:n.withCtx(()=>[n.createVNode(H),V[8]||(V[8]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0)]),n.createVNode(n.unref(M.NFormItem),{path:"marker",label:"Маркировка распила"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:V[4]||(V[4]=G=>c("marker")),"onUpdate:value":V[5]||(V[5]=G=>Z("marker",G??null)),onFocus:n.unref(He)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(n.openBlock(),n.createBlock(n.unref(M.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":V[6]||(V[6]=G=>{a.value.isAdditionalSale=G??!1,Z("isAdditionalSale",G??!1)})},{default:n.withCtx(()=>[...V[9]||(V[9]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createVNode(n.unref(M.NSpin),{show:_.value,size:"small",class:"grow"},{default:n.withCtx(()=>{var G;return[y.value&&u.value&&w.value?(n.openBlock(),n.createElementBlock("div",T1,[n.createElementVNode("div",null,[V[10]||(V[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",$1,n.toDisplayString(w.value.toLocaleString())+" "+n.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(n.openBlock(),n.createElementBlock("div",E1,[n.createElementVNode("span",R1,"("+n.toDisplayString(y.value.quantity)+" шт.",1),V[11]||(V[11]=n.createTextVNode(" x ",-1)),n.createElementVNode("span",P1,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",F1,[y.value&&!_.value?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,loading:t.isSubmitProcessing,disabled:T.value||_.value,type:"primary",class:"self-start",onClick:J},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:1,loading:_.value,disabled:T.value||_.value,type:"info",class:"self-start",onClick:E},{default:n.withCtx(()=>[...V[12]||(V[12]=[n.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[n.unref(ti),J]])}}}),M1={class:"flex flex-col gap-2"},I1={class:"w-104 flex grow flex-col px-5"},A1={},Pu=n.defineComponent({...A1,__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),a=n.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=n.ref(!1),c=async()=>{var h,f;(f=(h=o.value)==null?void 0:h.formReference)==null||f.validate(m=>{if(!m){l.value=!0;const p=z.cloneDeep(s.value);"items"in p.configuratorParams&&delete p.configuratorParams.items,r("submit",p,a.value,()=>{l.value=!1,n.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})})}}).catch(z.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return n.onMounted(()=>{i.cartItem.configuratorParams.items.forEach((h,f)=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}})}),n.watch(()=>i.cartItem,h=>{s.value=new q.OrderItemBase(h)},{deep:!0}),(h,f)=>{const m=M.NButton;return n.openBlock(),n.createElementBlock("div",M1,[t.settings.allowShowTable&&s.value.isNewRec()?(n.openBlock(),n.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=p=>r("click:view-switch"))},{default:n.withCtx(()=>[...f[2]||(f[2]=[n.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",I1,[n.createVNode(Ru,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":f[1]||(f[1]=p=>s.value=p),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),O1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function z1(t,e){return n.openBlock(),n.createElementBlock("svg",O1,[...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 D1=n.markRaw({name:"ion-checkmark",render:z1}),L1={key:0,class:"-mt-1 text-sm text-gray-500"},H1={class:"font-bold"},W1={class:"flex flex-col gap-3"},j1={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},q1={class:"flex flex-col gap-1 text-sm text-gray-700"},X1={key:0},Y1={key:1},U1={"form-array-name":"items",class:"flex flex-col gap-3"},K1={class:"min-w-0 flex-1"},G1={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},Z1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},Q1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},J1={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},e_={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},t_={key:0,class:"lg:!flex-[2]"},n_={class:"font-bold"},i_={key:1,class:"lg:!flex-[3]"},r_={class:"font-bold"},o_={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"},s_={key:0},a_={class:"font-bold"},l_={key:1},c_={class:"font-bold"},d_={class:"flex flex-wrap items-center gap-3"},u_={},Fu=n.defineComponent({...u_,__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"),a=n.useTemplateRef("widthInputs"),l=r.value==null?[]:z.cloneDeep(n.toRaw(r.value)),c=n.ref(l.map(X=>new q.OrderItemBase(X))),d=n.computed(()=>({items:c.value})),u=n.ref({...r.validation}),h=X=>{var W;delete u.value[X],(W=s.value)==null||W.restoreValidation()},f=n.ref(null),m=n.ref(null),p=n.computed(()=>{var X,W;return((W=(X=c.value[0])==null?void 0:X.category)==null?void 0:W.products)??[]}),g=n.computed(()=>p.value.map(X=>({label:X.name,value:X.id}))),b=(X,W,j)=>{const ae=X!=null&&X>0,de=W!=null&&W>0;return!ae&&!de?null:ae&&de?`от ${X} ${j} до ${W} ${j}`:ae?`от ${X} ${j}`:`до ${W} ${j}`},y=n.computed(()=>{var X,W;return b(r.settings.minWidth,(W=(X=f.value)==null?void 0:X.properties)==null?void 0:W.width,"мм")}),_=n.computed(()=>{var X,W;return b(r.settings.minLength,(W=(X=f.value)==null?void 0:X.properties)==null?void 0:W.length,"мм")}),k=n.computed(()=>{const X={};return c.value.forEach((W,j)=>{var ae,de,ve,st,_e,we,xt,$e;X[`items.${j}.configuratorParams.width`]=[le.required,le.min(r.settings.minWidth),...(de=(ae=f.value)==null?void 0:ae.properties)!=null&&de.width?[le.max(f.value.properties.width)]:[],le.step(1),We.serverValidation((ve=u.value[`items.${j}.width`])==null?void 0:ve.feedback)],X[`items.${j}.configuratorParams.length`]=[le.required,le.min(r.settings.minLength),...(_e=(st=f.value)==null?void 0:st.properties)!=null&&_e.length?[le.max(f.value.properties.length)]:[],le.step(1),We.serverValidation((we=u.value[`items.${j}.length`])==null?void 0:we.feedback)],X[`items.${j}.quantity`]=[le.required,le.min(1),le.step(1),We.serverValidation((xt=u.value[`items.${j}.quantity`])==null?void 0:xt.feedback)],X[`items.${j}.marker`]=[We.serverValidation(($e=u.value[`items.${j}.marker`])==null?void 0:$e.feedback)]}),X});n.watch(()=>r.validation,X=>{u.value={...X},Object.values(X).some(j=>j==null?void 0:j.feedback)&&n.nextTick(()=>{var j;return(j=s.value)==null?void 0:j.validate(z.noop).catch(z.noop)})},{deep:!0});const x=n.ref(r.settings.canSetDopProdaga??!1),C=n.computed(()=>{const X=f.value;return X?c.value.some(W=>{var ve,st;const j=W.configuratorParams,ae=(ve=X.properties)==null?void 0:ve.width,de=(st=X.properties)==null?void 0:st.length;return j.width===0||j.width<r.settings.minWidth||ae!=null&&j.width>ae||j.length===0||j.length<r.settings.minLength||de!=null&&j.length>de||W.quantity===0||W.quantity<1}):!0}),T=n.computed(()=>!f.value||C.value||c.value.length===0),w=n.computed(()=>{const X=c.value[0];return X!=null&&!X.isNewRec()}),S=X=>r.itemStates[X]??"idle",v=X=>S(X)==="success",$=X=>S(X)==="loading",E=n.computed(()=>c.value.length===0?!0:c.value.every((X,W)=>{const j=S(W);return j==="success"||j==="loading"})),F=X=>X.width===0||X.length===0?0:X.width*X.length/1e6,P=X=>F(X).toLocaleString(void 0,{maximumFractionDigits:4}),I=X=>{var ve;const W=X.configuratorParams,j=F(W),ae=((ve=f.value)==null?void 0:ve.costRub)??0,de=X.quantity??0;return!j||!de?0:Math.round(j*ae*de*100)/100},K=n.computed(()=>z.sum(c.value.map(X=>{const W=X.configuratorParams;return!W.width||W.length===0||!X.quantity?0:W.width*W.length*X.quantity/1e6}))),J=n.computed(()=>Math.round(z.sum(c.value.map(X=>I(X)))*100)/100),Z=()=>{var X,W,j;return new q.OrderItemBase({category:(X=c.value[0])==null?void 0:X.category,configurator:(W=c.value[0])==null?void 0:W.configurator,product:f.value??new q.ClientProduct,quantity:1,isAdditionalSale:(j=c.value[0])==null?void 0:j.isAdditionalSale,configuratorParams:{width:0,length:0}})},L=X=>{if(!X){f.value=null,m.value=null,c.value.forEach(j=>{j.product=new q.ClientProduct}),o("update:value",c.value);return}const W=p.value.find(j=>j.id===X);W&&(f.value=W,m.value=X,c.value.forEach((j,ae)=>{var de,ve;j.product=W,(de=W.properties)!=null&&de.width&&j.configuratorParams.width>W.properties.width&&(j.configuratorParams.width=W.properties.width),(ve=W.properties)!=null&&ve.length&&j.configuratorParams.length>W.properties.length&&(j.configuratorParams.length=W.properties.length),o("item-reset",ae)}),o("update:value",c.value))},A=X=>{var ae,de;const W=c.value[X],j=f.value;j&&((ae=j.properties)!=null&&ae.width&&W.configuratorParams.width>j.properties.width&&(W.configuratorParams.width=j.properties.width),(de=j.properties)!=null&&de.length&&W.configuratorParams.length>j.properties.length&&(W.configuratorParams.length=j.properties.length)),o("item-reset",X),o("update:value",c.value)},O=(X,W)=>{c.value[X].marker=W===null||W===""?void 0:W,o("item-reset",X),o("update:value",c.value)},V=X=>{c.value.forEach(W=>{W.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 W,j,ae,de;const X=c.value.length-1;(j=(W=a.value)==null?void 0:W[X])==null||j.focus(),(de=(ae=a.value)==null?void 0:ae[X])==null||de.select()})},H=X=>{c.value.splice(X,1),o("update:value",c.value),o("remove-item",X)};n.watch(()=>r.value,X=>{var de;const j=(X==null?[]:z.cloneDeep(n.toRaw(X))).map(ve=>new q.OrderItemBase(ve));c.value=j.length>0?j:[Z()];const ae=(de=c.value[0])==null?void 0:de.product;ae&&!ae.isNewRec()?(f.value=ae,m.value=ae.id):(f.value=null,m.value=null)},{deep:!0});const Y=()=>{var W;if(f.value!==null)return;const X=(W=p.value[0])==null?void 0:W.id;X!=null&&L(X)};return n.watch(p,()=>{Y()}),n.onMounted(()=>{var W;c.value.length===0&&(c.value=[Z()]);const X=(W=c.value[0])==null?void 0:W.product;X&&!X.isNewRec()&&(f.value=X,m.value=X.id),Y()}),e({validate:(G=s.value)==null?void 0:G.validate,formReference:s}),(X,W)=>{const j=D1,ae=lo,de=Eu;return n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.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(M.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NSelect),{value:m.value,"onUpdate:value":[W[0]||(W[0]=_e=>m.value=_e),L],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(n.openBlock(),n.createElementBlock("div",L1,[n.createElementVNode("span",H1,n.toDisplayString(f.value.code),1),n.createTextVNode(" — "+n.toDisplayString(f.value.costRub.toLocaleString())+" "+n.toDisplayString(f.value.currency.symbol)+"/м² ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",W1,[f.value?(n.openBlock(),n.createElementBlock("div",j1,[W[6]||(W[6]=n.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),n.createElementVNode("div",q1,[y.value?(n.openBlock(),n.createElementBlock("div",X1,"Ширина "+n.toDisplayString(y.value)+".",1)):n.createCommentVNode("",!0),_.value?(n.openBlock(),n.createElementBlock("div",Y1,"Длина "+n.toDisplayString(_.value)+".",1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("div",U1,[(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",v(we)?"opacity-70":""])},[n.createElementVNode("div",K1,[n.createElementVNode("div",G1,[n.createElementVNode("div",Z1,[n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[we].configuratorParams.width,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.width=$e,$e=>A(we)],parse:n.unref(ct),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Ширина",class:"w-full",onKeydown:W[1]||(W[1]=$e=>n.unref(at)($e)),onInput:$e=>h(`items.${we}.width`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:d.value.items[we].configuratorParams.length,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.length=$e,$e=>A(we)],parse:n.unref(ct),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Длина",class:"w-full",onKeydown:W[2]||(W[2]=$e=>n.unref(at)($e)),onInput:$e=>h(`items.${we}.length`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),n.createElementVNode("div",Q1,[n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:d.value.items[we].quantity,"onUpdate:value":[$e=>d.value.items[we].quantity=$e,$e=>A(we)],parse:n.unref(ct),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Кол-во",class:"w-full",onKeydown:W[3]||(W[3]=$e=>n.unref(at)($e,!1)),onInput:$e=>h(`items.${we}.quantity`),onFocus:n.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),n.createVNode(n.unref(M.NFormItem),{path:`items.${we}.marker`,label:"Маркировка",class:"min-w-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:d.value.items[we].marker??null,disabled:!f.value||v(we)||$(we),placeholder:"Маркировка",class:"w-full",onInput:$e=>h(`items.${we}.marker`),"onUpdate:value":$e=>O(we,$e??null),onFocus:n.unref(He)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),$(we)||v(we)?(n.openBlock(),n.createElementBlock("div",J1,[$(we)?(n.openBlock(),n.createBlock(n.unref(M.NSpin),{key:0,size:14})):v(we)?(n.openBlock(),n.createBlock(j,{key:1,class:"text-green-600 text-xl"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),n.createElementVNode("div",e_,[_e.configuratorParams.width>0&&_e.configuratorParams.length>0?(n.openBlock(),n.createElementBlock("div",t_,[W[7]||(W[7]=n.createTextVNode(" Площадь (S) = ",-1)),n.createElementVNode("span",n_,n.toDisplayString(P(_e.configuratorParams))+" м²",1)])):n.createCommentVNode("",!0),I(_e)>0?(n.openBlock(),n.createElementBlock("div",i_,[W[8]||(W[8]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",r_,n.toDisplayString(I(_e).toLocaleString())+" "+n.toDisplayString((xt=f.value)==null?void 0:xt.currency.symbol),1)])):n.createCommentVNode("",!0)])]),w.value?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,disabled:$(we)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:$e=>H(we)},{default:n.withCtx(()=>[n.createVNode(ae)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(n.openBlock(),n.createElementBlock("div",o_,[K.value>0?(n.openBlock(),n.createElementBlock("div",s_,[W[9]||(W[9]=n.createTextVNode(" Общая площадь: ",-1)),n.createElementVNode("span",a_,n.toDisplayString(K.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):n.createCommentVNode("",!0),J.value>0?(n.openBlock(),n.createElementBlock("div",l_,[W[10]||(W[10]=n.createTextVNode(" Итого: ",-1)),n.createElementVNode("span",c_,n.toDisplayString(J.value.toLocaleString())+" "+n.toDisplayString(f.value.currency.symbol),1)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),x.value?(n.openBlock(),n.createBlock(n.unref(M.NCheckbox),{key:1,checked:((st=c.value[0])==null?void 0:st.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":W[4]||(W[4]=_e=>V(_e??!1))},{default:n.withCtx(()=>[...W[11]||(W[11]=[n.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):n.createCommentVNode("",!0),n.createElementVNode("div",d_,[f.value&&!w.value?(n.openBlock(),n.createBlock(n.unref(M.NButton),{key:0,disabled:C.value,type:"default",onClick:R},{default:n.withCtx(()=>[n.createVNode(de),W[12]||(W[12]=n.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):n.createCommentVNode("",!0),n.createVNode(n.unref(M.NButton),{loading:t.isSubmitProcessing,disabled:T.value||E.value,type:"primary",class:"ml-auto",onClick:W[5]||(W[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)]])}}}),f_={class:"flex flex-col gap-2"},h_={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},m_={},Vu=n.defineComponent({...m_,__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 q.OrderItemBase(k))),a=n.ref([]),l=n.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=k=>{c.forEach(x=>{l.value[`items.${k}.${x}`]={}})},u=k=>{c.forEach(x=>{delete l.value[`items.${k}.${x}`]})},h=n.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),m=(k,x)=>{let C=!1;return c.forEach(T=>{var F,P;const w=`items.0.${T}`,S=(F=k[T])==null?void 0:F.feedback,$=((P=k[w])==null?void 0:P.feedback)??S,E=`items.${x}.${T}`;$?(l.value[E]=k[w]??k[T],C=!0):l.value[E]={}}),C},p=(k,x,C)=>new Promise(T=>{const w=f();let S=!1;const v=$=>{if(S)return;S=!0;const E=m(w,x),F=($===void 0?!E:$)&&!E;a.value[x]=F?"success":"error",n.nextTick(()=>{var P,I;(I=(P=o.value)==null?void 0:P.formReference)==null||I.restoreValidation()}),T(F)};a.value[x]="loading",r("submit",[z.cloneDeep(k)],w,v,{isFinalSuccessfulCompletion:C})}),g=async()=>{var C,T;try{await((T=(C=o.value)==null?void 0:C.formReference)==null?void 0:T.validate())}catch{return}const k=s.value.map((w,S)=>S).filter(w=>{const S=a.value[w]??"idle";return S!=="success"&&S!=="loading"});let x=!0;for(let w=0;w<k.length;w+=1){const S=k[w],v=s.value[S];if(!v)break;const E=w===k.length-1&&x;await p(v,S,E)||(x=!1)}},b=k=>{const x=k-1;a.value[x]="idle",d(x)},y=k=>{a.value.splice(k,1),u(k);for(let x=k;x<s.value.length;x+=1)d(x)},_=k=>{const x=a.value[k];(x==="success"||x==="error")&&(a.value[k]="idle")};return n.onMounted(()=>{(i.cartItems??[]).forEach((k,x)=>{a.value[x]="idle",d(x)})}),n.watch(()=>i.cartItems,k=>{const x=(k??[]).map(C=>new q.OrderItemBase(C));s.value=x,a.value=x.map(()=>"idle"),x.forEach((C,T)=>{d(T)})},{deep:!0}),(k,x)=>{var T;const C=M.NButton;return n.openBlock(),n.createElementBlock("div",f_,[t.settings.allowShowTable&&((T=s.value[0])!=null&&T.isNewRec())?(n.openBlock(),n.createBlock(C,{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",h_,[n.createVNode(Fu,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":x[1]||(x[1]=w=>s.value=w),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":h.value,"item-states":a.value,onSubmit:g,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),p_={key:0,class:"flex justify-center p-4"},g_={key:1,class:"p-4 text-center text-red-500"},y_={key:2,class:"flex justify-center"},b_={class:"!bg-white p-4 m-2 rounded-md w-max"},__={key:3,class:"p-4 text-center text-gray-500"},w_={},Mu=n.defineComponent({...w_,__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),a=f=>{const m=f.configuratorParams;return[new q.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(m==null?void 0:m.width)??f.width??0,length:(m==null?void 0:m.length)??f.length??0}})]},l=n.ref(e.editor===q.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var m,p,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={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 q.OrderItemBase({...f,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:z.some(b.startTailConfigs,y=>y.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(y=>y.isDefault):void 0,endTailType:z.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 q.OrderItemBase({...f,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 q.OrderItemBase({...f,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new q.OrderItemBase({...f,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new q.OrderItemBase({...f,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new q.OrderItemBase({...f,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(f,m,p)=>{const g=b=>{p==null||p(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:g,validation:m})},u=(f,m,p,g)=>{const b=f[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})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return n.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(f,m)=>{const p=M.NSpin;return n.openBlock(),n.createElementBlock(n.Fragment,null,[i.value?(n.openBlock(),n.createElementBlock("div",p_,[n.createVNode(p,{size:"large"})])):r.value?(n.openBlock(),n.createElementBlock("div",g_,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0),t.settings!==null&&(o.value!==null||s.value!==null||l.value!==null)?(n.openBlock(),n.createElementBlock("div",y_,[n.createElementVNode("div",b_,[t.editor==="kozyrek"?(n.openBlock(),n.createBlock(wu,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(n.openBlock(),n.createBlock(vu,{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(Nu,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(n.openBlock(),n.createBlock($u,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(n.openBlock(),n.createBlock(Pu,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(n.openBlock(),n.createBlock(Vu,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):n.createCommentVNode("",!0)])])):(n.openBlock(),n.createElementBlock("div",__,' Конфигуратор "'+n.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function Iu(t){return Object.values(q.ConfiguratorsEnum).includes(t)}function Au(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==q.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&z.isArray(t.products)&&t.products.length>0}const x_={key:0,class:"pt-0.5"},k_={key:0},v_={class:"line-through"},C_={key:0},S_={key:1},B_={class:"flex flex-row gap-1"},N_={key:0},T_={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},$_={class:"flex flex-col gap-2.5 sm:flex-row"},E_={key:0,class:"header-extra"},R_={class:"mt-2"},P_={key:1,class:"flex flex-col"},F_={},V_=n.defineComponent({...F_,__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(Cr,"medium"),r=n.computed(()=>{var Y;return(Y=e==null?void 0:e.filteredItems)==null?void 0:Y[e.categoryItem.id]}),o=n.computed(()=>{var Y,G;return z.isArray((Y=e.categoryItem)==null?void 0:Y.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),s=n.computed(()=>{var Y;return z.isArray((Y=e.categoryItem)==null?void 0:Y.products)?e.categoryItem.products:[]}),a=n.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([Y,G])=>`${G} руб./${E(Y)}`).join(", ")),l=n.computed(()=>z.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(Y=>{var X;const G=(X=r.value)==null?void 0:X.products;return z.isArray(G)&&G.includes(Y.id)})),c=n.computed(()=>l.value.length>0),d=n.computed(()=>z.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=n.computed(()=>z.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=n.computed(()=>z.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=n.computed(()=>z.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=n.computed(()=>{var Y,G,X;return((Y=e.categoryItem.properties)==null?void 0:Y.configurator)!==void 0&&Iu((G=e.categoryItem.properties)==null?void 0:G.configurator)&&Au(e.categoryItem)&&((X=e.categoryItem.properties)==null?void 0:X.configuratorSettings)!==void 0&&(z.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),p=n.computed(()=>m.value&&(z.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),g=n.computed(()=>z.isNil(e.categoryContextButtonsConfig)?[]:z.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=n.computed(()=>new q.ClientCategory(e.categoryItem)),y=n.ref(!1),_=n.ref(!1),k=n.computed(()=>!z.isUndefined(e.isCategoryItemSelected)),x=n.computed(()=>z.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),C=n.computed(()=>z.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),T=n.computed(()=>z.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=n.computed(()=>V.value&&et.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),S=n.useTemplateRef("collapse-item-reference"),v=n.computed(()=>{var Y,G;return(G=(Y=e.categoryItem.properties)==null?void 0:Y.templateCost)==null?void 0:G.priceCoefficient}),$=n.computed(()=>{var Y,G;return(G=(Y=e.categoryItem.properties)==null?void 0:Y.templateCost)==null?void 0:G.increasePercent}),E=(Y,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:Y,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),F=Y=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:Y,target:S.value})},P=(Y,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:y,target:S.value})},I=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:S.value})},K=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:S.value})},J=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:S.value})},Z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:S.value})},L=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:S.value})},A=Y=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:Y,target:S.value})},O=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},V=n.ref(0),R=n.computed(()=>V.value&&s.value.length>0?Bg(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}):[]),H=z.debounce(()=>{V.value=window.innerWidth},20);return n.onUnmounted(()=>{window.removeEventListener("resize",H)}),window.addEventListener("resize",H),H(),(Y,G)=>{const X=M.NCheckbox,W=Dm,j=M.NTooltip,ae=Am,de=M.NTag,ve=Vm,st=Rm,_e=M.NButton,we=Tm,xt=Hl,$e=Ll,Zt=Dl,gn=Cs,Rt=M.NDropdown,Jn=M.NDataTable,yn=M.NAlert,an=M.NSpin;return n.openBlock(),n.createBlock(Wl,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":n.withCtx(()=>{var Ve,te;return[k.value?(n.openBlock(),n.createElementBlock("div",x_,[n.createVNode(X,{checked:x.value,indeterminate:T.value,disabled:C.value,"onUpdate:checked":F},null,8,["checked","indeterminate","disabled"])])):n.createCommentVNode("",!0),!d.value&&((Ve=b.value)!=null&&Ve.isDisabled)?(n.openBlock(),n.createBlock(j,{key:1,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(W,{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(j,{key:2,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(ae,{class:"pt-1.5"})]),default:n.withCtx(()=>[G[2]||(G[2]=n.createTextVNode(" Избранная категория ",-1))]),_:1})):n.createCommentVNode("",!0)]}),header:n.withCtx(()=>{var Ve,te,ce,Me,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":(Ve=b.value)==null?void 0:Ve.isDisabled})},[n.createVNode(j,{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((...lt)=>n.unref(z.noop)&&n.unref(z.noop)(...lt),["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 lt;return[n.createTextVNode(" Установленная стоимость: "+n.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(lt=t.categoryItem.properties)!=null&<.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",k_,n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0),n.createVNode(de,{size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createElementVNode("span",v_,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"])):(Me=t.categoryItem.properties)!=null&&Me.templateCost?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[v.value||$.value?(n.openBlock(),n.createBlock(de,{key:0,size:n.unref(i),round:""},{default:n.withCtx(()=>{var lt;return[v.value?(n.openBlock(),n.createElementBlock("span",C_,n.toDisplayString((lt=v.value)==null?void 0:lt.name),1)):n.createCommentVNode("",!0),$.value?(n.openBlock(),n.createElementBlock("span",S_,n.toDisplayString($.value>0?"+":"")+n.toDisplayString($.value.toFixed(2))+"%",1)):n.createCommentVNode("",!0)]}),_:1},8,["size"])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),a.value?(n.openBlock(),n.createBlock(de,{key:2,size:n.unref(i),round:""},{default:n.withCtx(()=>[n.createTextVNode(" Фиксированный курс: "+n.toDisplayString(a.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(j,{placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>{var lt,Qt;return[n.createElementVNode("span",B_,[n.createVNode(ve),n.createTextVNode(" "+n.toDisplayString((Qt=(lt=b.value)==null?void 0:lt.manager)==null?void 0:Qt.name),1)])]}),default:n.withCtx(()=>{var lt,Qt;return[n.createTextVNode(' Категория закреплена за "'+n.toDisplayString((Qt=(lt=b.value)==null?void 0:lt.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",N_,[n.createElementVNode("ul",T_,[t.showSlugs?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Ve),1))),128)):n.createCommentVNode("",!0),t.showProperties?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(t.categoryItem.properties,(Ve,te)=>(n.openBlock(),n.createElementBlock("li",{key:te}," ("+n.toDisplayString(te)+"): "+n.toDisplayString(Ve),1))),128)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),"header-extra":n.withCtx(()=>{var Ve;return[n.createElementVNode("div",$_,[Y.$slots["header-extra"]?(n.openBlock(),n.createElementBlock("div",E_,[n.renderSlot(Y.$slots,"header-extra",{categoryItem:t.categoryItem},void 0,!0)])):n.createCommentVNode("",!0),d.value?(n.openBlock(),n.createBlock(j,{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(W,{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&&!((Ve=b.value)!=null&&Ve.manager)?(n.openBlock(),n.createBlock(j,{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,Me;return[(te=b.value)!=null&&te.manager?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode('Категория закреплена за "'+n.toDisplayString(((Me=(ce=b.value)==null?void 0:ce.manager)==null?void 0:Me.name)??"-")+'"',1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createTextVNode("Закрепить")],64))]}),_:1})):n.createCommentVNode("",!0),h.value?(n.openBlock(),n.createBlock(j,{key:3,placement:"bottom",trigger:"hover"},{trigger:n.withCtx(()=>[n.createVNode(_e,{ghost:!0,disabled:h.value==="disabled",size:n.unref(i),onClick:K},{default:n.withCtx(()=>{var te;return[(te=b.value)!=null&&te.isRequired?(n.openBlock(),n.createBlock($e,{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),f.value?(n.openBlock(),n.createBlock(j,{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:A},{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(Y.$slots,"default",{},()=>{var Ve,te,ce;return[n.createElementVNode("div",R_,[o.value?(n.openBlock(),n.createBlock(zu,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ve=r.value)==null?void 0:Ve.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},[Y.$slots["header-extra"]?{name:"header-extra",fn:n.withCtx(({categoryItem:Me})=>[n.renderSlot(Y.$slots,"header-extra",{categoryItem:Me},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(Mu,{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",P_,[m.value?(n.openBlock(),n.createBlock(_e,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:O},{default:n.withCtx(()=>[...G[6]||(G[6]=[n.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):n.createCommentVNode("",!0),n.createVNode(Jn,{columns:R.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Me=>Me.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(an,{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"])}}}),M_=An(V_,[["__scopeId","data-v-fac0d674"]]),I_={class:"sc-collapse flex w-full flex-col"},A_={},Ou=n.defineComponent({...A_,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const i=t,r=e,o=(s,a)=>{r("on-item-header-click",s,a)};return n.provide("itemHeaderClickHandler",o),n.provide("defaultExpandedNames",i.defaultExpandedNames),n.provide("expandedNames",i.expandedNames),(s,a)=>(n.openBlock(),n.createElementBlock("div",I_,[n.renderSlot(s.$slots,"default")]))}}),O_={},zu=n.defineComponent({...O_,__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(Cr,"medium"),r=n.computed(()=>z.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(z.isUndefined(a))return;const l=a[s.id];if(l==="*")return;const c={};return c[s.id]=structuredClone(n.toRaw(l)),c};return(s,a)=>{const l=M.NSpin,c=M.NAlert;return n.openBlock(),n.createElementBlock(n.Fragment,null,[r.value.length>0?(n.openBlock(),n.createBlock(Ou,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,d=>(n.openBlock(),n.createBlock(M_,{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(l,{key:1,size:n.unref(i),class:"w-full"},{description:n.withCtx(()=>[...a[0]||(a[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)}}}),z_={},Du=n.defineComponent({...z_,__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(()=>z.isArray(r.value)),a=new q.Reference,l=n.computed(()=>z.isNil(r.value)?s.value?[]:null:z.isArray(r.value)?r.value.filter(p=>!z.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(z.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=>!z.isNil(y)):[];o("update:value",b)}else{const b=p===a.id||z.isNil(p)||(g=c.value.find(y=>y.value===p))==null?void 0:g.item;o("update:value",b)}},h=n.useTemplateRef("select-component");return e({focus:()=>{var p;return(p=h.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=h.value)==null?void 0:p.blur()}}),(p,g)=>(n.openBlock(),n.createBlock(n.unref(M.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple: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"]))}}),D_={},L_=n.defineComponent({...D_,__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,C;const i=t,r=e,o=()=>{const T=q.PriceCoefficient.getRetailPriceCoefficient();return z.unset(T,"isNewRec"),T},s=T=>!T||T.id===o().id,a=n.computed(()=>{var T;return((T=i.catalogItem)==null?void 0:T.type)==="product"}),l=n.computed(()=>a.value?i.catalogItem:void 0),c=T=>{var w,S,v,$;return T.id===o().id?(w=l.value)==null?void 0:w.getRetailCost():($=(v=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:v.find(E=>E.coefficient.id===T.id))==null?void 0:$.cost},d=n.computed(()=>{var S;const w=[...((S=q.useReferencesStore().priceCoefficientsReference)==null?void 0:S.map(v=>structuredClone(n.toRaw(v))))??[],o()].filter(v=>{var $;return(($=i.visibleCoefficient)==null?void 0:$.call(i,v))??!0});return a.value&&w.forEach(v=>{var E;const $=c(v);$?v.name+=` (${$} ${(E=l.value)==null?void 0:E.currency.symbol})`:v.name=""}),w.filter(v=>v.name!=="")}),u=n.ref(i.value.coefficient),h=n.ref(((C=(x=i.value)==null?void 0:x.value)==null?void 0:C.toString())??null),f=n.ref(null),m=n.computed(()=>{var T,w;return(w=(T=l.value)==null?void 0:T.priceCoefficients)==null?void 0:w.find(S=>S.coefficient.slug===q.PriceCoefficientEnum.K0)}),p=n.ref(void 0),g=T=>Number.parseFloat((T??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),b=()=>{var w,S;p.value=void 0;let T=g(h.value);if(T=Number.isNaN(T)?void 0:T,a.value)if(u.value||h.value){const v=o(),$=c(u.value??v)??0,E=$+$*((T??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(E),E>(((w=l.value)==null?void 0:w.getRetailCost())??E)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&E<(((S=m.value)==null?void 0:S.cost)??0)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN(T)?void 0:T,coefficient:s(u.value)?void 0:structuredClone(n.toRaw(u.value))})},y=T=>{z.isArray(T)||z.isNull(T)||(u.value=T,h.value=null,!u.value&&h.value&&(u.value=o()),b())},_=()=>{u.value||(u.value=o()),b()},k=T=>{var S,v,$,E,F;const w=g(T);if(a.value){if(Number.isNaN(w)){u.value=void 0,h.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let P=0;if(w<=0)u.value=void 0,h.value=null;else if(m.value&&w<(((S=m.value)==null?void 0:S.cost)??0))u.value=(v=m.value)==null?void 0:v.coefficient,P=(w-m.value.cost)*100/m.value.cost,p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>((($=l.value)==null?void 0:$.getRetailCost())??w)){u.value=o();const I=((E=l.value)==null?void 0:E.getRetailCost())??0;P=(w-I)*100/I,p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const I=((F=l.value)==null?void 0:F.priceCoefficients)??[],K=z.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}}h.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 T,w,S,v;i.calculationType===q.CalculationTypeEnum.m2Cost?f.value=((w=(T=i.value)==null?void 0:T.value)==null?void 0:w.toString())??null:!((S=i.value)!=null&&S.coefficient)&&((v=i.value)!=null&&v.value)&&(u.value=o()),b()}),(T,w)=>{var $,E,F;const S=M.NInput,v=M.NInputGroup;return n.openBlock(),n.createBlock(n.unref(M.NFormItem),{"show-label":!n.unref(z.isNil)(t.label),label:t.label,"show-feedback":!n.unref(z.isNil)((($=p.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=p.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((F=p.value)==null?void 0:F.validationStatus)??t.validationStatus},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==n.unref(q.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==n.unref(q.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(v,{key:0,class:n.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:n.withCtx(()=>[n.createVNode(Du,{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(S,{value:h.value,"onUpdate:value":[w[0]||(w[0]=P=>h.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},[h.value&&!h.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),a.value||t.calculationType===n.unref(q.CalculationTypeEnum).m2Cost?(n.openBlock(),n.createBlock(S,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=P=>f.value=P),k],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},n.createSlots({_:2},[a.value?{name:"suffix",fn:n.withCtx(()=>{var P;return[n.createTextVNode(n.toDisplayString((P=l.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"])}}}),H_={class:"text-sm"},W_={class:"text-sm"},j_={},q_=n.defineComponent({...j_,__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),a=n.ref(null),l=n.computed(()=>{var P,I,K;return((P=a.value)==null?void 0:P.unit.isLinear)&&((K=(I=a.value)==null?void 0:I.properties)==null?void 0:K.isLengthConfigurator)}),c=n.computed(()=>a.value?q.UnitsHelper.productIsMeasurable(a.value)||l.value?"шт.":a.value.unit.name:"шт."),d=n.ref(void 0),u=n.ref(void 0),h=n.ref(!0),f=n.ref(null),m=n.computed({get:()=>{var P;return((P=f.value)==null?void 0:P.quantity)??null},set:P=>{f.value&&(f.value.quantity=P??0)}}),p=n.computed({get:()=>{var P;return((P=f.value)==null?void 0:P.length)??null},set:P=>{f.value&&(f.value.length=P??void 0)}}),g=P=>{f.value&&(f.value.marker=P??void 0)},b=i,y=()=>({length:{},quantity:{},marker:{}}),_=n.ref(y()),k=n.ref(!1),x=n.computed(()=>{var Z,L,A,O;if(!a.value)return{};const P=q.UnitsHelper.getProductLengthMultiplicity(a.value),I=q.UnitsHelper.getProductMultiplicity(a.value),K=((L=(Z=a.value)==null?void 0:Z.properties)==null?void 0:L.minLength)||P,J=(O=(A=a.value)==null?void 0:A.properties)==null?void 0:O.maxLength;return{length:[le.required,le.min(K??.1),le.max(J),le.step(P),We.serverValidation(_.value.length.feedback)],quantity:[le.required,le.min(I),le.step(I),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),C=n.computed(()=>{var P,I,K;return a.value?((P=a.value.properties)==null?void 0:P.lengthStep)??((I=a.value.properties)!=null&&I.ignoreMinCountCheck?0:((K=a.value.properties)==null?void 0:K.minCount)??0):0}),T=n.computed(()=>{var K,J,Z,L,A,O,V,R,H;if(!a.value)return"";const P=((J=(K=a.value)==null?void 0:K.properties)==null?void 0:J.minLength)??((L=(Z=a.value)==null?void 0:Z.properties)!=null&&L.ignoreMinCountCheck?0:(O=(A=a.value)==null?void 0:A.properties)==null?void 0:O.minCount),I=(R=(V=a.value)==null?void 0:V.properties)==null?void 0:R.maxLength;return P||I?`(${P?`от ${P}`:""}${P&&I?" ":""}${I?`до ${I}`:""} ${(H=a.value)==null?void 0:H.unit.name})`:""}),w=P=>{var L,A;if(!((A=(L=a.value)==null?void 0:L.properties)!=null&&A.isLengthConfigurator)||!f.value||z.isNil(P)||C.value===0)return;const I=P/C.value,K=Math.round(I),J=q.UnitsHelper.getProductMultiplicity(a.value),Z=Math.max(K,J);f.value.quantity=Z},S=P=>{var Z,L,A,O;if(!((L=(Z=a.value)==null?void 0:Z.properties)!=null&&L.isLengthConfigurator)||!f.value||z.isNil(P)||C.value===0)return;const I=P*C.value,K=((A=a.value.properties)==null?void 0:A.minLength)||q.UnitsHelper.getProductLengthMultiplicity(a.value),J=(O=a.value.properties)==null?void 0:O.maxLength;K!==void 0&&I<K?f.value.length=K:J!==void 0&&I>J?f.value.length=J:f.value.length=I},v=async P=>{var K;const I=z.cloneDeep(f.value);try{await((K=r.value)==null?void 0:K.validate(J=>{if(!J){if(!a.value||!I)return;q.UnitsHelper.productIsMeasurable(a.value)||delete I.length,l.value&&C.value&&(I.length=C.value),k.value=!0,b("submit",I,_.value,()=>{k.value=!1,P(!1),n.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(z.noop).catch(z.noop)})})}}))}catch{}},$=()=>{a.value=null,d.value=void 0,f.value=null,_.value=y()},E=()=>{s.value=!1};return e({show:(P,I)=>{var K,J,Z,L,A;if($(),s.value=!0,a.value=P,d.value=I==null?void 0:I.cartItemData,u.value=I==null?void 0:I.orderId,h.value=(I==null?void 0:I.canSetDopProdaga)??!1,f.value=new q.OrderItemBase((I==null?void 0:I.cartItemData)??new q.OrderItemBase({product:P,quantity:q.UnitsHelper.productIsMeasurable(a.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})),(A=P==null?void 0:P.properties)!=null&&A.isLengthConfigurator&&f.value&&C.value>0){const O=C.value,V=f.value.quantity||1;f.value.length=V*O}},closeDialog:E}),(P,I)=>{var A;const K=M.NFormItem,J=M.NInputGroupLabel,Z=M.NInputGroup,L=M.NCheckbox;return n.openBlock(),n.createBlock(Ns,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(A=a.value)==null?void 0:A.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:k.value,"modal-width":500,onAccept:v,onClosing:E},{default:n.withCtx(()=>[a.value&&f.value?n.withDirectives((n.openBlock(),n.createBlock(n.unref(M.NForm),{key:0,ref:"form-reference",model:f.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:n.withCtx(()=>[n.unref(q.UnitsHelper).productIsMeasurable(a.value)?(n.openBlock(),n.createBlock(K,{key:0,path:"length",label:`Метраж, ${T.value+a.value.unit.name}`},n.createSlots({default:n.withCtx(()=>[n.createVNode(n.unref(M.NInputNumber),{value:p.value,"onUpdate:value":[I[0]||(I[0]=O=>p.value=O),w],parse:n.unref(ct),step:n.unref(q.UnitsHelper).getProductLengthMultiplicity(a.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:I[1]||(I[1]=O=>n.unref(ro)(O,".",!1)),onInput:I[2]||(I[2]=O=>n.unref(rt)(_.value,"length")),onFocus:n.unref(He)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&n.unref(q.UnitsHelper).getProductLengthMultiplicity(a.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",H_,"Метраж должно быть кратно "+n.toDisplayString(n.unref(q.UnitsHelper).getProductLengthMultiplicity(a.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(M.NInputNumber),{value:m.value,"onUpdate:value":[I[3]||(I[3]=O=>m.value=O),S],parse:n.unref(ct),step:n.unref(q.UnitsHelper).getProductMultiplicity(a.value),"show-button":n.unref(q.UnitsHelper).getProductMultiplicity(a.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:I[4]||(I[4]=O=>n.unref(ro)(O,".",!1)),onInput:I[5]||(I[5]=O=>n.unref(rt)(_.value,"quantity")),onFocus:n.unref(He)},null,8,["value","parse","step","show-button","onFocus"]),l.value?(n.openBlock(),n.createBlock(J,{key:0,class:"bg-orange-100 font-bold"},{default:n.withCtx(()=>[n.createTextVNode(" x "+n.toDisplayString(C.value)+" "+n.toDisplayString(a.value.unit.name),1)]),_:1})):n.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&n.unref(q.UnitsHelper).getProductMultiplicity(a.value)!==1?{name:"feedback",fn:n.withCtx(()=>[n.createElementVNode("span",W_,"Количество должно быть кратно "+n.toDisplayString(n.unref(q.UnitsHelper).getProductMultiplicity(a.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),n.unref(q.UnitsHelper).productIsMeasurable(a.value)?(n.openBlock(),n.createBlock(K,{key:1,path:"marker",label:"Маркировка"},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NInput),{value:f.value.marker??null,placeholder:"Введите маркировку",onInput:I[6]||(I[6]=O=>n.unref(rt)(_.value,"marker")),"onUpdate:value":I[7]||(I[7]=O=>g(O)),onFocus:n.unref(He)},null,8,["value","onFocus"])]),_:1})):n.createCommentVNode("",!0),h.value?(n.openBlock(),n.createBlock(L,{key:2,checked:f.value.isAdditionalSale,"onUpdate:checked":I[8]||(I[8]=O=>f.value.isAdditionalSale=O),"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 O,V;return(V=(O=o.value)==null?void 0:O.acceptHandler)==null?void 0:V.call(O)}]]):n.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),X_={class:"flex flex-row gap-1"},Y_={class:"sc-client-name flex flex-col gap-1 text-base"},U_=["href"],K_={key:1,class:"text-sc-grey"},G_={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Z_={key:0},Q_={key:1,class:"text-sm"},J_={},Vr=n.defineComponent({...J_,__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?Ie.format(i.client.lastLoginAt,q.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{z.isNil(i.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",i.client,a)};return(a,l)=>{const c=oo,d=M.NButton,u=M.NPopover;return n.openBlock(),n.createElementBlock("div",X_,[t.showClientInfoIcon?(n.openBlock(),n.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})):n.createCommentVNode("",!0),n.createVNode(u,{disabled:n.unref(z.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:n.withCtx(()=>[n.createElementVNode("div",Y_,[n.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>s(h))},[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",K_," [ Деактивирован ] "))],8,U_),t.showCityAndRegion&&t.client.city?(n.openBlock(),n.createElementBlock("span",G_," г. "+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",Z_,n.toDisplayString(t.client.alternativeName),1)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("span",Q_," Последний вход: "+n.toDisplayString(o.value),1)):n.createCommentVNode("",!0),n.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),ew={class:"text-base"},tw={},Lu=n.defineComponent({...tw,__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",ew,n.toDisplayString(i.value),1))}}),nw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iw(t,e){return n.openBlock(),n.createElementBlock("svg",nw,[...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 rw=n.markRaw({name:"tabler-mail",render:iw}),ow=["href"],sw={},aw=n.defineComponent({...sw,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,i)=>{const r=rw;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,ow)],2)}}}),lw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cw(t,e){return n.openBlock(),n.createElementBlock("svg",lw,[...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 Hu=n.markRaw({name:"fa6-brands-viber",render:cw}),dw={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},uw=["id"],fw=["id"],hw=["fill"],mw=["fill"];function pw(t,e){return n.openBlock(),n.createElementBlock("svg",dw,[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,uw),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,fw)]),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,hw),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,mw),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 Wu=n.markRaw({name:"logos-whatsapp-icon",render:pw,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),gw={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},yw=["id"],bw=["fill"];function _w(t,e){return n.openBlock(),n.createElementBlock("svg",gw,[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,yw)]),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,bw),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 ju=n.markRaw({name:"logos-telegram",render:_w,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),ww={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xw(t,e){return n.openBlock(),n.createElementBlock("svg",ww,[...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 qu=n.markRaw({name:"ion-call",render:xw}),kw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vw(t,e){return n.openBlock(),n.createElementBlock("svg",kw,[...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 Cw=n.markRaw({name:"tabler-phone-call",render:vw}),Sw={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Bw=["href"],Nw=["href"],Tw=["href"],$w=["href"],Ew={},Rw=n.defineComponent({...Ew,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,i=n.computed(()=>{try{return e.phone?wr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=n.computed(()=>{var l;return z.isString(i.value)?!1:((l=i.value)==null?void 0:l.isValid())??!1}),o=n.computed(()=>{var l;return z.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=n.computed(()=>{var l;return z.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("E.164"))??""}),a=n.ref(!1);return(l,c)=>{const d=Cw,u=qu,h=ju,f=Wu,m=Hu;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&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=p=>a.value=!a.value),onFocusout:c[1]||(c[1]=p=>a.value=!1),onMouseleave:c[2]||(c[2]=p=>a.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&&a.value?(n.openBlock(),n.createElementBlock("div",Sw,[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,Bw)):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(h)],8,Nw)):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(f)],8,Tw)):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,$w)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],34)])}}}),Pw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Fw(t,e){return n.openBlock(),n.createElementBlock("svg",Pw,[...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 Vw=n.markRaw({name:"mdi-envelope",render:Fw}),Mw={class:"flex flex-col gap-1"},Iw={key:0,class:"mb-2 flex flex-col text-base"},Aw={key:0,class:"text-sc-dark-grey text-sm"},Ow={key:1,class:"whitespace-nowrap text-sm"},zw={key:2,class:"whitespace-nowrap text-sm"},Dw={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Lw=["href"],Hw=["href"],Ww=["href"],jw=["href"],qw=["href"],Xw={key:0,class:"flex flex-col text-base"},Yw={key:0,class:"text-sc-dark-grey text-sm"},Uw={key:1,class:"mt-2 text-sm"},Kw={key:0,class:"-mt-1"},Gw={},Zw=n.defineComponent({...Gw,__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?wr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=n.computed(()=>{var d;return z.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=n.computed(()=>{var d;return z.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),a=n.computed(()=>{var d;return z.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),l=n.computed(()=>o.value||e.contact.email),c=n.ref(!1);return(d,u)=>{var y,_;const h=qu,f=ju,m=Wu,p=Hu,g=Vw,b=M.NPopover;return n.openBlock(),n.createElementBlock("div",Mw,[n.createVNode(b,{disabled:t.fullView,placement:"bottom"},{trigger:n.withCtx(()=>{var k,x,C,T;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",Iw,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(C=t.contact)!=null&&C.position?(n.openBlock(),n.createElementBlock("span",Aw,n.toDisplayString((T=t.contact)==null?void 0:T.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),t.contact.phone?(n.openBlock(),n.createElementBlock("div",Ow,n.toDisplayString(s.value),1)):n.createCommentVNode("",!0),t.contact.email?(n.openBlock(),n.createElementBlock("div",zw,n.toDisplayString(t.contact.email),1)):n.createCommentVNode("",!0),l.value&&c.value?(n.openBlock(),n.createElementBlock("div",Dw,[o.value?(n.openBlock(),n.createElementBlock("a",{key:0,href:`tel:${a.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[n.createVNode(h)],8,Lw)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:1,href:`https://t.me/${a.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(f)],8,Hw)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:2,href:`https://wa.me/${a.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[n.createVNode(m)],8,Ww)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createElementBlock("a",{key:3,href:`viber://chat?number=${a.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[n.createVNode(p)],8,jw)):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,qw)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])],38)]}),default:n.withCtx(()=>{var k,x,C,T;return[t.contact.name?(n.openBlock(),n.createElementBlock("div",Xw,[n.createTextVNode(n.toDisplayString(i.value)+" ",1),(k=t.contact)!=null&&k.position?(n.openBlock(),n.createElementBlock("span",Yw,n.toDisplayString((x=t.contact)==null?void 0:x.position),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(n.openBlock(),n.createElementBlock("div",Uw,[u[4]||(u[4]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((T=t.contact)==null?void 0:T.comment),1)])):n.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(n.openBlock(),n.createElementBlock("div",Kw,[u[5]||(u[5]=n.createElementVNode("sup",null,"**",-1)),n.createTextVNode(" "+n.toDisplayString((_=t.contact)==null?void 0:_.comment),1)])):n.createCommentVNode("",!0)])}}});class Qw{constructor(e){N(this,"minHeight");N(this,"maxHeights");N(this,"minWidth");N(this,"maxWidths");N(this,"netType");N(this,"color");N(this,"mountType");N(this,"descriptions");N(this,"crossbarCount");N(this,"heightOverlaps");N(this,"widthOverlaps");N(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=bs.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=bs.objectToSnake(e.heightOverlaps),this.widthOverlaps=bs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function Jw(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==q.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&z.isArray(t.products)&&t.products.length>0}const ex={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tx(t,e){return n.openBlock(),n.createElementBlock("svg",ex,[...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 nx=n.markRaw({name:"mdi-dots-horizontal",render:tx}),Xu="date-range.dialog.mode",Yu=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Uu=(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?Ie.startOfDay(r):void 0,to:o?Ie.endOfDay(o):void 0}},ix={class:"text-center font-semibold"},rx={class:"grid grid-cols-3 gap-1"},ox=["onPointerdown","onPointerenter","onKeydown"],sx={},ax=n.defineComponent({...sx,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const i=t,r=e,o=M.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})),a=w=>{const S=new Date().getFullYear();return w&&Ie.isValid(w)?w.getFullYear():S},l=n.ref(a(i.from??i.to)),c=et.initRefDependingOnDeviceResolution(1,3,3),d=n.computed(()=>c.value===1?[l.value]:[l.value-1,l.value,l.value+1]),u=n.ref(null),h=n.ref(null),f=n.ref(!1),m=n.ref(null),p=n.computed(()=>{const{from:w,to:S}=i;return!w||!S||!Ie.isSameDay(w,Ie.startOfMonth(w))||!Ie.isSameDay(S,Ie.endOfMonth(S))?null:[w.getFullYear()*12+w.getMonth(),S.getFullYear()*12+S.getMonth()]}),g=n.computed(()=>f.value&&h.value!==null&&m.value!==null?b(h.value,m.value):u.value!==null?m.value===null?[u.value,u.value]:b(u.value,m.value):p.value),b=(w,S)=>w<=S?[w,S]:[S,w],y=(w,S)=>{const v=w*12+S,$=g.value;return $&&v>=$[0]&&v<=$[1]?[v===$[0]||v===$[1]?"sc-month--bound":"sc-month--in-range"]:[]},_=(w,S)=>{const[v,$]=b(w,S);u.value=null,r("select",{from:new Date(Math.floor(v/12),v%12,1),to:Ie.endOfMonth(new Date(Math.floor($/12),$%12,1))})},k=w=>{u.value===null?(u.value=w,r("select",{from:new Date(Math.floor(w/12),w%12,1),to:Ie.endOfMonth(new Date(Math.floor(w/12),w%12,1))})):_(u.value,w)},x=()=>{globalThis.removeEventListener("pointerup",x);const w=h.value;if(w!==null){if(h.value=null,f.value){f.value=!1,m.value!==null&&_(w,m.value);return}k(w)}},C=(w,S)=>{h.value=w*12+S,f.value=!1,globalThis.addEventListener("pointerup",x)},T=(w,S)=>{const v=w*12+S;m.value=v,h.value!==null&&v!==h.value&&(f.value=!0)};return n.watch(()=>[i.from,i.to],()=>{const w=i.from??i.to;if(!w||!Ie.isValid(w))return;const S=w.getFullYear();(S<l.value-1||S>l.value+1)&&(l.value=S)}),n.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",x)}),(w,S)=>{const v=M.NButton;return n.openBlock(),n.createElementBlock("div",{class:"flex select-none items-start gap-2",style:n.normalizeStyle(s.value),onPointerleave:S[2]||(S[2]=$=>m.value=null)},[n.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[0]||(S[0]=$=>l.value-=1)},{default:n.withCtx(()=>[...S[3]||(S[3]=[n.createTextVNode(" ‹ ",-1)])]),_:1}),n.createElementVNode("div",{class:n.normalizeClass(["grid flex-1 gap-4 sm:gap-8",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-1"},[n.createElementVNode("div",ix,n.toDisplayString($),1),n.createElementVNode("div",rx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(Yu),(E,F)=>(n.openBlock(),n.createElementBlock("button",{key:E,type:"button",class:n.normalizeClass(["sc-month cursor-pointer rounded border-0 px-1 py-1 text-sm",y($,F)]),onPointerdown:n.withModifiers(P=>C($,F),["prevent"]),onPointerenter:P=>T($,F),onKeydown:[n.withKeys(n.withModifiers(P=>k($*12+F),["prevent"]),["enter"]),n.withKeys(n.withModifiers(P=>k($*12+F),["prevent"]),["space"])]},n.toDisplayString(E),43,ox))),128))])]))),128))],2),n.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[1]||(S[1]=$=>l.value+=1)},{default:n.withCtx(()=>[...S[4]||(S[4]=[n.createTextVNode(" › ",-1)])]),_:1})],36)}}}),lx=An(ax,[["__scopeId","data-v-7dd4941e"]]),cx={class:"sc-date-range-sidebar flex flex-col gap-1"},dx={class:"flex items-center justify-center gap-1"},ux={class:"min-w-12 text-center font-semibold"},fx={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},hx={},mx=n.defineComponent({...hx,__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=M.NButton;return n.openBlock(),n.createElementBlock("div",cx,[n.createElementVNode("div",dx,[n.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=a=>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]=a=>i("update:year",t.year+1))},{default:n.withCtx(()=>[...o[4]||(o[4]=[n.createTextVNode(" › ",-1)])]),_:1})]),n.createElementVNode("div",fx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(Yu),(a,l)=>(n.openBlock(),n.createBlock(s,{key:a,size:"small",quaternary:"",type:l===t.month?"primary":"default",onClick:c=>i("select-month",l)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a),1)]),_:2},1032,["type","onClick"]))),128))]),n.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=a=>i("today"))},{default:n.withCtx(()=>[...o[5]||(o[5]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),px={},Ku=n.defineComponent({...px,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>q.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(t,{emit:e}){const i=t,r=e,o=et.initRefDependingOnDeviceResolution(!0,!1,!1),s=n.ref(null),a=n.ref(!1),l=n.ref(0),c=n.ref(i.value&&Ie.isValid(i.value)?i.value:new Date),d=n.computed(()=>{const k=i.value&&Ie.isValid(i.value)?i.value:c.value;return k.getFullYear()===c.value.getFullYear()?k.getMonth():null});let u=0;const h=k=>{var x,C;(C=(x=k.target)==null?void 0:x.closest)!=null&&C.call(x,".n-base-clear")&&(u=performance.now())},f=k=>{k&&performance.now()-u<300||(a.value=k,k&&(c.value=i.value&&Ie.isValid(i.value)?i.value:new Date))},m=k=>{r("update:value",k===null?null:new Date(k))},p=(k,x)=>{const C=new Date(k,x,1);if(c.value=C,i.value&&Ie.isValid(i.value)){const T=Math.min(Ie.getDate(i.value),Ie.getDaysInMonth(C));r("update:value",new Date(k,x,T));return}l.value+=1,n.nextTick().then(()=>{var T;return(T=s.value)==null?void 0:T.focus()})},g=(k,x)=>{c.value=Ie.addYears(Ie.addMonths(c.value,k),x)},b=k=>{p(k,c.value.getMonth())},y=k=>{p(c.value.getFullYear(),k)},_=()=>{a.value=!1,r("update:value",new Date)};return(k,x)=>{const C=M.NButton,T=M.NDatePicker;return n.openBlock(),n.createBlock(T,{ref_key:"pickerReference",ref:s,key:l.value,value:i.value?i.value.getTime():null,show:a.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:h,"onUpdate:show":f,"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(C,{key:1,size:"small",text:"",type:"info",onClick:_},{default:n.withCtx(()=>[...x[4]||(x[4]=[n.createTextVNode(" Сегодня ",-1)])]),_:1})):(n.openBlock(),n.createBlock(mx,{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"])}}}),gx={key:0,class:"text-gray-400"},yx={},Gu=n.defineComponent({...yx,__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=et.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var a,l;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(Ku,{value:t.from,clearable:t.clearable,disabled:(a=t.disabled)==null?void 0:a.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",gx," – ")),n.createVNode(Ku,{value:t.to,clearable:t.clearable,disabled:(l=t.disabled)==null?void 0:l.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)}}}),bx={class:"flex flex-col items-stretch gap-3 sm:flex-row"},_x={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},wx={class:"flex flex-col items-stretch pr-3"},xx={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},kx={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},vx={},Cx=n.defineComponent({...vx,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const i=t,r=e,o="custom",s=et.initRefDependingOnDeviceResolution(!0,!1,!1),a=q.DateTimeProvider.standardPeriods(),l=n.ref(q.STANDARD_PERIOD_GROUPS[0].key),c=n.computed(()=>{const h=q.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return z.isEmpty(i.customPeriods)||h.push({key:o,value:o,label:"Пользовательские"}),h}),d=h=>Object.entries(h).map(([f,m])=>({value:f,label:m.label,item:m})),u=n.computed(()=>{if(l.value===o)return[{type:"group",key:o,children:d(i.customPeriods??{})}];const h=Object.entries(a).filter(([,m])=>m.group===l.value),f=Object.fromEntries(h);return l.value!=="other"?[{type:"group",key:l.value,children:d(f)}]:q.STANDARD_PERIOD_SECTIONS.map(m=>{const p=h.filter(([,g])=>g.section===m.key);return{type:"group",key:m.key,label:m.label,children:d(Object.fromEntries(p))}}).filter(m=>{var p;return(((p=m.children)==null?void 0:p.length)??0)>0})});return(h,f)=>{const m=M.NButton,p=M.NScrollbar,g=M.NSelect,b=M.NMenu;return n.openBlock(),n.createElementBlock("div",bx,[n.createElementVNode("div",_x,[n.createVNode(p,{class:"max-h-96"},{default:n.withCtx(()=>[n.createElementVNode("div",wx,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,y=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:y.key},[y.label?(n.openBlock(),n.createElementBlock("div",xx,n.toDisplayString(y.label),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.children,_=>(n.openBlock(),n.createBlock(m,{key:_.value,size:"small",quaternary:"",type:_.value===t.activeKey?"primary":"default",class:"justify-start",onClick:k=>r("apply",_),onMouseenter:k=>r("preview",_),onMouseleave:f[0]||(f[0]=k=>r("preview"))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(_.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),n.unref(s)?(n.openBlock(),n.createBlock(g,{key:0,value:l.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=y=>l.value=y)},null,8,["value","options"])):(n.openBlock(),n.createElementBlock("div",kx,[n.createVNode(b,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=y=>l.value=y)},null,8,["value","options"])]))])}}}),Sx={class:"flex flex-col gap-3"},Bx={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},Nx={key:0,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},Tx={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},$x={class:"flex gap-2"},Ex={},Rx=n.defineComponent({...Ex,__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=et.initRefDependingOnDeviceResolution("100%","90%","44rem"),s=n.ref("custom"),a=()=>q.PreferencesStorageProvider.getActualDataFromStorage(Xu)==="standard"?"standard":"custom",l=n.ref({}),c=n.ref(null),d=n.ref(null),u=n.computed(()=>c.value??l.value),h=(x,C)=>{var S,v;const T=(S=i.disabled)!=null&&S.from?l.value.from:x,w=(v=i.disabled)!=null&&v.to?l.value.to:C;c.value=null,l.value=Uu(T,w,i.disabled)},f=x=>{d.value=null,h(x,l.value.to)},m=x=>{d.value=null,h(l.value.from,x)},p=()=>{d.value=null,h(null,null)},g=x=>{d.value=null,h(x.from,x.to)},b=x=>{const C=x.item;h(C.from,C.to),d.value=String(x.value)},y=x=>{const C=x==null?void 0:x.item;c.value=C?{from:C.from,to:C.to}:null},_=()=>{c.value=null,s.value=s.value==="custom"?"standard":"custom";const x=Xu;q.PreferencesStorageProvider.saveActualDataToStorage(x,s.value,Ie.addYears(Ie.startOfToday(),1))},k=()=>{r("select",l.value),r("update:show",!1)};return n.watch(()=>i.show,x=>{x&&(s.value=a(),d.value=null,c.value=null,l.value={...i.dateRange})}),(x,C)=>{const T=M.NButton,w=M.NModal;return n.openBlock(),n.createBlock(w,{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":C[1]||(C[1]=S=>r("update:show",S))},{footer:n.withCtx(()=>[n.createElementVNode("div",Tx,[n.createVNode(T,{text:"",type:"info",onClick:_},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),n.createElementVNode("div",$x,[n.createVNode(T,{type:"primary",onClick:k},{default:n.withCtx(()=>[...C[3]||(C[3]=[n.createTextVNode(" Выбрать ",-1)])]),_:1}),n.createVNode(T,{onClick:C[0]||(C[0]=S=>r("update:show",!1))},{default:n.withCtx(()=>[...C[4]||(C[4]=[n.createTextVNode("Отмена",-1)])]),_:1})])])]),default:n.withCtx(()=>[n.createElementVNode("div",Sx,[n.createElementVNode("div",Bx,[n.createVNode(Gu,{from:u.value.from,to:u.value.to,clearable:t.clearable,disabled:t.disabled,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":f,"onUpdate:to":m},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(n.openBlock(),n.createBlock(T,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:p},{default:n.withCtx(()=>[...C[2]||(C[2]=[n.createTextVNode(" Очистить период ",-1)])]),_:1})):n.createCommentVNode("",!0)]),s.value==="custom"?(n.openBlock(),n.createElementBlock("div",Nx,[n.createVNode(lx,{from:l.value.from,to:l.value.to,onSelect:g},null,8,["from","to"])])):(n.openBlock(),n.createBlock(Cx,{key:1,"active-key":d.value,"custom-periods":t.customPeriods,onApply:b,onPreview:y},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),Px={class:"flex w-full min-w-0 items-center gap-1"},Fx={},Vx=n.defineComponent({...Fx,__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?q.DateTimeProvider.defaultDateRanges():{},...i.predefinedDateRanges};return z.isEmpty(u)?void 0:u}),a=(u,h)=>{r("update:date-range",Uu(u,h,i.disabled))},l=u=>{var h;a(u,(h=i.dateRange)==null?void 0:h.to)},c=u=>{var h;a((h=i.dateRange)==null?void 0:h.from,u)},d=u=>{a(u.from,u.to)};return(u,h)=>{var p,g,b,y;const f=nx,m=M.NButton;return n.openBlock(),n.createElementBlock("div",Px,[n.createVNode(Gu,{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":l,"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:h[0]||(h[0]=_=>o.value=!0)},{default:n.withCtx(()=>[n.createVNode(f)]),_:1},8,["disabled"]),n.createVNode(Rx,{show:o.value,"onUpdate:show":h[1]||(h[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"])])}}}),Mx={class:"sc-lbl-date text-nowrap"},Ix={},Xo=n.defineComponent({...Ix,__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(()=>Ie.format(e.date,q.useBaseConfigStateStore().config.dateFormats.uiDate)),r=n.computed(()=>Ie.format(e.date,"HH:mm"));return(o,s)=>(n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[n.createElementVNode("span",Mx,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))}}),Ax={},Ox=n.defineComponent({...Ax,__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)}}),zx={class:"flex flex-row gap-2.5"},Dx={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},Lx={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Hx={class:"mb-0.5 sm:mb-0 sm:ml-3"},Wx={},jx=n.defineComponent({...Wx,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,i)=>{const r=qo,o=M.NButton,s=M.NPopover;return n.openBlock(),n.createElementBlock("div",zx,[n.createElementVNode("div",Dx,[n.renderSlot(e.$slots,"main")]),n.createElementVNode("div",null,[n.createElementVNode("div",Lx,[n.renderSlot(e.$slots,"extra-buttons"),n.createElementVNode("div",Hx,[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]=a=>e.$emit("close"))},{default:n.withCtx(()=>[n.createVNode(r)]),_:1})]),default:n.withCtx(()=>[i[1]||(i[1]=n.createTextVNode(" Закрыть ",-1))]),_:1})):n.createCommentVNode("",!0)])])])])}}}),qx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xx(t,e){return n.openBlock(),n.createElementBlock("svg",qx,[...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 Yx=n.markRaw({name:"ion-checkmark-done-sharp",render:Xx}),Ux={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Kx(t,e){return n.openBlock(),n.createElementBlock("svg",Ux,[...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 Gx=n.markRaw({name:"ion-options-outline",render:Kx}),Zx={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Qx={class:"flex-auto"},Jx={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"},ek={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"},tk={},Ba=n.defineComponent({...tk,__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},a=()=>{r.value=!0,i("apply",s)},l=()=>{i("cancel",s)};return(c,d)=>{const u=Gx,h=M.NButton,f=M.NPopover,m=Yx,p=qo;return n.openBlock(),n.createElementBlock("div",Zx,[n.createElementVNode("div",Qx,[n.renderSlot(c.$slots,"default")]),n.createElementVNode("div",null,[n.createElementVNode("div",Jx,[n.createElementVNode("div",ek,[t.showEditButton?(n.openBlock(),n.createBlock(f,{key:0,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(h,{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(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(h,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{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(f,{key:2,placement:"bottom"},{trigger:n.withCtx(()=>[n.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{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")])])])}}}),nk={},Zu=n.defineComponent({...nk,__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=l=>{r("editor:apply",d=>{o.value=!d,l()})},a=l=>{o.value=!1,l(),r("editor:cancel")};return n.onMounted(()=>{n.watch(()=>i.showEditor,l=>{o.value=l})}),(l,c)=>(n.openBlock(),n.createElementBlock("div",null,[o.value?(n.openBlock(),n.createBlock(Ba,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,onCancel:a},{"extra-buttons":n.withCtx(()=>[n.renderSlot(l.$slots,"extra-editor-buttons")]),default:n.withCtx(()=>[n.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(n.openBlock(),n.createBlock(Ba,{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(l.$slots,"extra-viewer-buttons")]),default:n.withCtx(()=>[n.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),ik={key:0,class:"whitespace-pre-line"},rk={key:1,class:"text-sc-dark-grey"},ok={},sk=n.defineComponent({...ok,__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,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=i.comment};return(l,c)=>{const d=M.NInput;return n.openBlock(),n.createBlock(Zu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:n.withCtx(()=>[n.createElementVNode("div",null,[t.comment?(n.openBlock(),n.createElementBlock("span",ik,n.toDisplayString(t.comment),1)):(n.openBlock(),n.createElementBlock("span",rk," - Комментарий отсутствует - "))])]),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"])}}}),ak={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lk(t,e){return n.openBlock(),n.createElementBlock("svg",ak,[...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 ck=n.markRaw({name:"ion-download-outline",render:lk}),dk={},uk=n.defineComponent({...dk,__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(l=>(l.status=i.isError?"error":"finished",l))),a=l=>{o.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=ck;return n.openBlock(),n.createBlock(n.unref(M.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":a},{default:n.withCtx(()=>[n.createVNode(n.unref(M.NUploadDragger),null,{default:n.withCtx(()=>[n.renderSlot(l.$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"])}}}),fk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hk(t,e){return n.openBlock(),n.createElementBlock("svg",fk,[...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 mk=n.markRaw({name:"ion-warning",render:hk}),pk={},gk=n.defineComponent({...pk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,i)=>{const r=mk,o=M.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"])}}}),yk={},bk=n.defineComponent({...yk,__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)),a=z.debounce(()=>r("update:value",o.value),s.value),l=c=>{o.value=c,a()};return n.watch(()=>i.value,c=>{o.value=c}),(c,d)=>(n.openBlock(),n.createBlock(n.unref(M.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:n.withCtx(()=>[n.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),_k={},wk=n.defineComponent({..._k,__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),a=n.computed(()=>n.inject("debounce-input-time",r.debounceTime)),l=z.debounce(()=>o("update:value",s.value),a.value),c=m=>{s.value=m,l()};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(M.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"]))}}),xk={},kk=n.defineComponent({...xk,__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=z.debounce(c=>r("update:value",c),i.debounceTime??0),a=c=>{let d="";if(z.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(z.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof wr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}i.debounceTime?s(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=wr.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof wr.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,""))&&l(c)},{immediate:!0}),n.onBeforeMount(()=>l(o.value??"")),(c,d)=>(n.openBlock(),n.createBlock(n.unref(am.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),vk=An(kk,[["__scopeId","data-v-751dbb0e"]]),Ck={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Sk(t,e){return n.openBlock(),n.createElementBlock("svg",Ck,[...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 Bk=n.markRaw({name:"tabler-external-link",render:Sk}),Nk={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Tk=["href"],$k={},Ek=n.defineComponent({...$k,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,i)=>{const r=Bk,o=M.NTooltip;return n.openBlock(),n.createBlock(o,{disabled:n.unref(z.isUndefined)(t.description),placement:"top-start"},{trigger:n.withCtx(()=>[n.createElementVNode("span",Nk,[n.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},n.toDisplayString(t.text),9,Tk),n.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Rk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pk(t,e){return n.openBlock(),n.createElementBlock("svg",Rk,[...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 Fk=n.markRaw({name:"ion-remove-circle-outline",render:Pk});let Yo=[];const Qu=new WeakMap;function Vk(){Yo.forEach(t=>t(...Qu.get(t))),Yo=[]}function Ju(t,...e){Qu.set(t,e),!Yo.includes(t)&&Yo.push(t)===1&&requestAnimationFrame(Vk)}function Mr(t,e){let{target:i}=t;for(;i;){if(i.dataset&&i.dataset[e]!==void 0)return!0;i=i.parentElement}return!1}function Ir(t){return t.composedPath()[0]||null}function Ar(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Or(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 ef={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 Mk(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 Ik(t,e,i){e/=100,i/=100;let r=e*Math.min(i,1-i),o=(s,a=(s+t/30)%12)=>i-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const $n="^\\s*",En="\\s*$",li="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Gt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Bi="([0-9A-Fa-f])",Ni="([0-9A-Fa-f]{2})",tf=new RegExp(`${$n}hsl\\s*\\(${Gt},${li},${li}\\)${En}`),nf=new RegExp(`${$n}hsv\\s*\\(${Gt},${li},${li}\\)${En}`),rf=new RegExp(`${$n}hsla\\s*\\(${Gt},${li},${li},${Gt}\\)${En}`),of=new RegExp(`${$n}hsva\\s*\\(${Gt},${li},${li},${Gt}\\)${En}`),Ak=new RegExp(`${$n}rgb\\s*\\(${Gt},${Gt},${Gt}\\)${En}`),Ok=new RegExp(`${$n}rgba\\s*\\(${Gt},${Gt},${Gt},${Gt}\\)${En}`),zk=new RegExp(`${$n}#${Bi}${Bi}${Bi}${En}`),Dk=new RegExp(`${$n}#${Ni}${Ni}${Ni}${En}`),Lk=new RegExp(`${$n}#${Bi}${Bi}${Bi}${Bi}${En}`),Hk=new RegExp(`${$n}#${Ni}${Ni}${Ni}${Ni}${En}`);function Xt(t){return parseInt(t,16)}function Wk(t){try{let e;if(e=rf.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),$i(e[13])];if(e=tf.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function jk(t){try{let e;if(e=of.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),$i(e[13])];if(e=nf.exec(t))return[Ko(e[1]),ci(e[5]),ci(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function Ti(t){try{let e;if(e=Dk.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),1];if(e=Ak.exec(t))return[St(e[1]),St(e[5]),St(e[9]),1];if(e=Ok.exec(t))return[St(e[1]),St(e[5]),St(e[9]),$i(e[13])];if(e=zk.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),1];if(e=Hk.exec(t))return[Xt(e[1]),Xt(e[2]),Xt(e[3]),$i(Xt(e[4])/255)];if(e=Lk.exec(t))return[Xt(e[1]+e[1]),Xt(e[2]+e[2]),Xt(e[3]+e[3]),$i(Xt(e[4]+e[4])/255)];if(t in ef)return Ti(ef[t]);if(tf.test(t)||rf.test(t)){const[i,r,o,s]=Wk(t);return[...Ik(i,r,o),s]}else if(nf.test(t)||of.test(t)){const[i,r,o,s]=jk(t);return[...Mk(i,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function qk(t){return t>1?1:t<0?0:t}function Na(t,e,i,r){return`rgba(${St(t)}, ${St(e)}, ${St(i)}, ${qk(r)})`}function Ta(t,e,i,r,o){return St((t*e*(1-r)+i*r)/o)}function Xk(t,e){Array.isArray(t)||(t=Ti(t)),Array.isArray(e)||(e=Ti(e));const i=t[3],r=e[3],o=$i(i+r-i*r);return Na(Ta(t[0],i,e[0],r,o),Ta(t[1],i,e[1],r,o),Ta(t[2],i,e[2],r,o),o)}function Le(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:Ti(t);return typeof e.alpha=="number"?Na(i,r,o,e.alpha):Na(i,r,o,s)}function Uo(t,e){const[i,r,o,s=1]=Array.isArray(t)?t:Ti(t),{lightness:a=1,alpha:l=1}=e;return Yk([i*a,r*a,o*a,s*l])}function $i(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function Ko(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 Yk(t){const[e,i,r]=t;return 3 in t?`rgba(${St(e)}, ${St(i)}, ${St(r)}, ${$i(t[3])})`:`rgba(${St(e)}, ${St(i)}, ${St(r)}, 1)`}function Uk(t=8){return Math.random().toString(16).slice(2,2+t)}function sf(t){return Array.isArray(t)?t:[t]}const $a={STOP:"STOP"};function af(t,e){const i=e(t);t.children!==void 0&&i!==$a.STOP&&t.children.forEach(r=>af(r,e))}function Kk(t,e={}){const{preserveGroup:i=!1}=e,r=[],o=i?a=>{a.isLeaf||(r.push(a.key),s(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),s(a.children))};function s(a){a.forEach(o)}return s(t),r}function Gk(t,e){const{isLeaf:i}=t;return i!==void 0?i:!e(t)}function Zk(t){return t.children}function Qk(t){return t.key}function Jk(){return!1}function ev(t,e){const{isLeaf:i}=t;return!(i===!1&&!Array.isArray(e(t)))}function tv(t){return t.disabled===!0}function nv(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function iv(t,e){if(t.isLeaf===!0){const i=e(t);if(Array.isArray(i)&&i.length>0)return!0}return!1}function Ea(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Ra(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function rv(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)||i.add(r)}),Array.from(i)}function ov(t,e){const i=new Set(t);return e.forEach(r=>{i.has(r)&&i.delete(r)}),Array.from(i)}function sv(t){return(t==null?void 0:t.type)==="group"}function av(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 lv extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function cv(t,e,i,r){return Go(e.concat(t),i,r,!1)}function dv(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 uv(t,e,i,r){const o=Go(e,i,r,!1),s=Go(t,i,r,!0),a=dv(t,i),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function Pa(t,e){const{checkedKeys:i,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:rv(i,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:ov(i,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(i),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let h;o!==void 0?h=uv(o,i,e,d):r!==void 0?h=cv(r,i,e,d):h=Go(i,e,d,!1);const f=c==="parent",m=c==="child"||l,p=h,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:C,shallowLoaded:T}=x;if(m&&T&&x.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&p.has($.key)&&p.delete($.key)}),x.disabled||!T)continue;let w=!0,S=!1,v=!0;for(const $ of x.children){const E=$.key;if(!$.disabled){if(v&&(v=!1),p.has(E))S=!0;else if(g.has(E)){S=!0,w=!1;break}else if(w=!1,S)break}}w&&!v?(f&&x.children.forEach($=>{!$.disabled&&p.has($.key)&&p.delete($.key)}),p.add(C)):S&&g.add(C),_&&m&&p.has(C)&&p.delete(C)}}return{checkedKeys:Array.from(p),indeterminateKeys:Array.from(g)}}function Go(t,e,i,r){const{treeNodeMap:o,getChildren:s}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=o.get(c);d!==void 0&&af(d,u=>{if(u.disabled)return $a.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),nv(u.rawNode,s))){if(r)return $a.STOP;if(!i)throw new lv}})}),l}function fv(t,{includeGroup:e=!1,includeSelf:i=!0},r){var o;const s=r.treeNodeMap;let a=t==null?null:(o=s.get(t))!==null&&o!==void 0?o:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),i||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function hv(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function mv(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 lf(t,e,{loop:i=!1,includeDisabled:r=!1}={}){const o=e==="prev"?pv:mv,s={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=Fa(d,s);u!==null?l=u:c(o(d,i))}else{const u=o(d,!1);if(u!==null)c(u);else{const h=gv(d);h!=null&&h.isGroup?c(o(h,i)):i&&c(o(d,!0))}}}}return c(t),l}function pv(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 gv(t){return t.parent}function Fa(t,e={}){const{reverse:i=!1}=e,{children:r}=t;if(r){const{length:o}=r,s=i?o-1:0,a=i?-1:o,l=i?-1:1;for(let c=s;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Fa(d,e);if(u!==null)return u}else return d}}return null}const yv={getChild(){return this.ignored?null:Fa(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return lf(this,"next",t)},getPrev(t={}){return lf(this,"prev",t)}};function bv(t,e){const i=e?new Set(e):void 0,r=[];function o(s){s.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||i===void 0||i.has(a.key))&&o(a.children)})}return o(t),r}function _v(t,e){const i=t.key;for(;e;){if(e.key===i)return!0;e=e.parent}return!1}var wv={};function cf(t,e,i,r,o,s=null,a=0){const l=[];return t.forEach((c,d)=>{var u;wv.NODE_ENV!=="production"&&iv(c,o)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=s,!h.ignored){const f=o(c);Array.isArray(f)&&(h.children=cf(f,e,i,r,o,h,a+1))}l.push(h),e.set(h.key,h),i.has(a)||i.set(a,[]),(u=i.get(a))===null||u===void 0||u.push(h)}),l}function xv(t,e={}){var i;const r=new Map,o=new Map,{getDisabled:s=tv,getIgnored:a=Jk,getIsGroup:l=sv,getKey:c=Qk}=e,d=(i=e.getChildren)!==null&&i!==void 0?i:Zk,u=e.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return Gk(this.rawNode,u)},get shallowLoaded(){return ev(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return _v(this,x)}},yv),f=cf(t,r,o,h,u);function m(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function g(x,C){const T=p(x);return T?T.getPrev(C):null}function b(x,C){const T=p(x);return T?T.getNext(C):null}function y(x){const C=p(x);return C?C.getParent():null}function _(x){const C=p(x);return C?C.getChild():null}const k={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return bv(f,x)},getNode:m,getPrev:g,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return hv(f)},getPath(x,C={}){return fv(x,C,k)},getCheckedKeys(x,C={}){const{cascade:T=!0,leafOnly:w=!1,checkStrategy:S="all",allowNotLoaded:v=!1}=C;return Pa({checkedKeys:Ea(x),indeterminateKeys:Ra(x),cascade:T,leafOnly:w,checkStrategy:S,allowNotLoaded:v},k)},check(x,C,T={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=T;return Pa({checkedKeys:Ea(C),indeterminateKeys:Ra(C),keysToCheck:x==null?[]:sf(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},uncheck(x,C,T={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=T;return Pa({checkedKeys:Ea(C),indeterminateKeys:Ra(C),keysToUncheck:x==null?[]:sf(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},getNonLeafKeys(x={}){return Kk(f,x)}};return k}function Zo(t){return t.composedPath()[0]}const kv={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function vv(t,e,i){if(t==="mousemoveoutside"){const r=o=>{e.contains(Zo(o))||i(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(Zo(a))},s=a=>{r&&(e.contains(Zo(a))||i(a))};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 df(t,e,i){const r=kv[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=vv(t,e,i)),s}function Cv(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=df(t,e,i);return Object.keys(o).forEach(s=>{It(s,document,o[s],r)}),!0}return!1}function Sv(t,e,i,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=df(t,e,i);return Object.keys(o).forEach(s=>{ht(s,document,o[s],r)}),!0}return!1}function Bv(){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,S,v){const $=w[S];return w[S]=function(){return v.apply(w,arguments),$.apply(w,arguments)},w}function s(w,S){w[S]=Event.prototype[S]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,S){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:S??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(S){const{type:v,eventPhase:$,bubbles:E}=S,F=Zo(S);if($===2)return;const P=$===1?"capture":"bubble";let I=F;const K=[];for(;I===null&&(I=window),K.push(I),I!==window;)I=I.parentNode||null;const J=u.capture[v],Z=u.bubble[v];if(o(S,"stopPropagation",i),o(S,"stopImmediatePropagation",r),d(S,c),P==="capture"){if(J===void 0)return;for(let L=K.length-1;L>=0&&!t.has(S);--L){const A=K[L],O=J.get(A);if(O!==void 0){a.set(S,A);for(const V of O){if(e.has(S))break;V(S)}}if(L===0&&!E&&Z!==void 0){const V=Z.get(A);if(V!==void 0)for(const R of V){if(e.has(S))break;R(S)}}}}else if(P==="bubble"){if(Z===void 0)return;for(let L=0;L<K.length&&!t.has(S);++L){const A=K[L],O=Z.get(A);if(O!==void 0){a.set(S,A);for(const V of O){if(e.has(S))break;V(S)}}}}s(S,"stopPropagation"),s(S,"stopImmediatePropagation"),d(S)};return w.displayName="evtdUnifiedHandler",w}function m(){const w=function(S){const{type:v,eventPhase:$}=S;if($!==2)return;const E=h[v];E!==void 0&&E.forEach(F=>F(S))};return w.displayName="evtdUnifiedWindowEventHandler",w}const p=f(),g=m();function b(w,S){const v=u[w];return v[S]===void 0&&(v[S]=new Map,window.addEventListener(S,p,w==="capture")),v[S]}function y(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,g)),h[w]}function _(w,S){let v=w.get(S);return v===void 0&&w.set(S,v=new Set),v}function k(w,S,v,$){const E=u[S][v];if(E!==void 0){const F=E.get(w);if(F!==void 0&&F.has($))return!0}return!1}function x(w,S){const v=h[w];return!!(v!==void 0&&v.has(S))}function C(w,S,v,$){let E;if(typeof $=="object"&&$.once===!0?E=J=>{T(w,S,E,$),v(J)}:E=v,Cv(w,S,E,$))return;const P=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",I=b(P,w),K=_(I,S);if(K.has(E)||K.add(E),S===window){const J=y(w);J.has(E)||J.add(E)}}function T(w,S,v,$){if(Sv(w,S,v,$))return;const F=$===!0||typeof $=="object"&&$.capture===!0,P=F?"capture":"bubble",I=b(P,w),K=_(I,S);if(S===window&&!k(S,F?"bubble":"capture",w,v)&&x(w,v)){const Z=h[w];Z.delete(v),Z.size===0&&(window.removeEventListener(w,g),h[w]=void 0)}K.has(v)&&K.delete(v),K.size===0&&I.delete(S),I.size===0&&(window.removeEventListener(w,p,P==="capture"),u[P][w]=void 0)}return{on:C,off:T}}const{on:It,off:ht}=Bv(),dr="@@mmoContext",Nv={mounted(t,{value:e}){t[dr]={handler:void 0},typeof e=="function"&&(t[dr].handler=e,It("mousemoveoutside",t,e))},updated(t,{value:e}){const i=t[dr];typeof e=="function"?i.handler?i.handler!==e&&(ht("mousemoveoutside",t,i.handler),i.handler=e,It("mousemoveoutside",t,e)):(t[dr].handler=e,It("mousemoveoutside",t,e)):i.handler&&(ht("mousemoveoutside",t,i.handler),i.handler=void 0)},unmounted(t){const{handler:e}=t[dr];e&&ht("mousemoveoutside",t,e),t[dr].handler=void 0}},ur="@@coContext",Qo={mounted(t,{value:e,modifiers:i}){t[ur]={handler:void 0},typeof e=="function"&&(t[ur].handler=e,It("clickoutside",t,e,{capture:i.capture}))},updated(t,{value:e,modifiers:i}){const r=t[ur];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[ur].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[ur];i&&ht("clickoutside",t,i,{capture:e.capture}),t[ur].handler=void 0}};function Tv(t,e){console.error(`[vdirs/${t}]: ${e}`)}class $v{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&&Tv("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 Va=new $v,fr="@@ziContext",uf={mounted(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i;t[fr]={enabled:!!o,initialized:!1},o&&(Va.ensureZIndex(t,r),t[fr].initialized=!0)},updated(t,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i,s=t[fr].enabled;o&&!s&&(Va.ensureZIndex(t,r),t[fr].initialized=!0),t[fr].enabled=!!o},unmounted(t,e){if(!t[fr].initialized)return;const{value:i={}}=e,{zIndex:r}=i;Va.unregister(t,r)}};function Ev(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 Rv=typeof window<"u";let hr,zr;(()=>{var t,e;hr=Rv?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,zr=!1,hr!==void 0?hr.then(()=>{zr=!0}):zr=!0})();function Pv(t){if(zr)return;let e=!1;n.onMounted(()=>{zr||hr==null||hr.then(()=>{e||t()})}),n.onBeforeUnmount(()=>{e=!0})}function Ma(t,e){return n.watch(t,i=>{i!==void 0&&(e.value=i)}),n.computed(()=>t.value===void 0?e.value:t.value)}function Jo(){const t=n.ref(!1);return n.onMounted(()=>{t.value=!0}),n.readonly(t)}function ff(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 Fv=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Vv(){return Fv}function Ia(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);return r()}function Aa(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)){Aa(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Aa(r.children,e,i)}else r.type!==n.Comment&&i.push(r)}}),i}function hf(t,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${i}] is empty.`);const o=Aa(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${i}] should have exactly one child.`)}let di=null;function mf(){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 Mv(t,e){const i=mf();return{top:e,left:t,height:0,width:0,right:i.width-t,bottom:i.height-e}}function Oa(t){const e=t.getBoundingClientRect(),i=mf();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 Iv(t){return t.nodeType===9?null:t.parentNode}function pf(t){if(t===null)return null;const e=Iv(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 pf(e)}const gf=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 a=()=>{let y=r.value;for(;y=pf(y),y!==null;)s.push(y);for(const _ of s)It("scroll",_,h,!0)},l=()=>{for(const y of s)ht("scroll",y,h,!0);s=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{Ju(f)},f=()=>{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),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:p,removeResizeListener:g}},render(){return Ia("binder",this.$slots)}}),yf=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(hf("follower",this.$slots),[[e]]):hf("follower",this.$slots)}}),Av="@css-render/vue3-ssr";function Ov(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
|
-
</style>`}function
|
|
105
|
+
</style>`}function zv(t,e,i){const{styles:r,ids:o}=i;o.has(t)||r!==null&&(o.add(t),r.push(Ov(t,e)))}const Dv=typeof document<"u";function Ei(){if(Dv)return;const t=n.inject(Av,null);if(t!==null)return{adapter:(e,i)=>zv(e,i,t),context:t}}function bf(t,e){console.error(`[vueuc/${t}]: ${e}`)}function Lv(t){let e=0;for(let i=0;i<t.length;++i)t[i]==="&"&&++e;return e}const _f=/\s*,(?![^(]*\))\s*/g,Hv=/\s+/g;function Wv(t,e){const i=[];return e.split(_f).forEach(r=>{let o=Lv(r);if(o){if(o===1){t.forEach(a=>{i.push(r.replace("&",a))});return}}else{t.forEach(a=>{i.push((a&&a+" ")+r)});return}let s=[r];for(;o--;){const a=[];s.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),s=a}s.forEach(a=>i.push(a))}),i}function jv(t,e){const i=[];return e.split(_f).forEach(r=>{t.forEach(o=>{i.push((o&&o+" ")+r)})}),i}function qv(t){let e=[""];return t.forEach(i=>{i=i&&i.trim(),i&&(i.includes("&")?e=Wv(e,i):e=jv(e,i))}),e.join(", ").replace(Hv," ")}function wf(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function es(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function Xv(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ts(t){return t?/^\s*@(s|m)/.test(t):!1}const Yv=/[A-Z]/g;function xf(t){return t.replace(Yv,e=>"-"+e.toLowerCase())}function Uv(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(i=>e+` ${xf(i[0])}: ${i[1]};`).join(`
|
|
107
107
|
`)+`
|
|
108
|
-
`+e+"}":`: ${t};`}function
|
|
108
|
+
`+e+"}":`: ${t};`}function Kv(t,e,i){return typeof t=="function"?t({context:e.context,props:i}):t}function kf(t,e,i,r){if(!e)return"";const o=Kv(e,i,r);if(!o)return"";if(typeof o=="string")return`${t} {
|
|
109
109
|
${o}
|
|
110
110
|
}`;const s=Object.keys(o);if(s.length===0)return i.config.keepEmptyBlock?t+` {
|
|
111
111
|
}`:"";const a=t?[t+" {"]:[];return s.forEach(l=>{const c=o[l];if(l==="raw"){a.push(`
|
|
112
112
|
`+c+`
|
|
113
|
-
`);return}l=xf(l),c!=null&&a.push(` ${l}${
|
|
114
|
-
`)}function za(t,e,i){t&&t.forEach(r=>{if(Array.isArray(r))za(r,e,i);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?za(o,e,i):o&&i(o)}else r&&i(r)})}function vf(t,e,i,r,o){const s=t.$;let a="";if(!s||typeof s=="string")ts(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});ts(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")ts(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});ts(d)?a=d:e.push(d)}const l=
|
|
113
|
+
`);return}l=xf(l),c!=null&&a.push(` ${l}${Uv(c)}`)}),t&&a.push("}"),a.join(`
|
|
114
|
+
`)}function za(t,e,i){t&&t.forEach(r=>{if(Array.isArray(r))za(r,e,i);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?za(o,e,i):o&&i(o)}else r&&i(r)})}function vf(t,e,i,r,o){const s=t.$;let a="";if(!s||typeof s=="string")ts(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});ts(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")ts(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});ts(d)?a=d:e.push(d)}const l=qv(e),c=kf(l,t.props,r,o);a?i.push(`${a} {`):c.length&&i.push(c),t.children&&za(t.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=kf(l,{raw:d},r,o);i.push(u)}else vf(d,e,i,r,o)}),e.pop(),a&&i.push("}"),s&&s.after&&s.after(r.context)}function Gv(t,e,i){const r=[];return vf(t,[],r,e,i),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function Da(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 Gv(t,e,i,r){const{els:o}=e;if(i===void 0)o.forEach(wf),e.els=[];else{const s=es(i,r);s&&o.includes(s)&&(wf(s),e.els=o.filter(a=>a!==s))}}function Cf(t,e){t.push(e)}function Zv(t,e,i,r,o,s,a,l,c){let d;if(i===void 0&&(d=e.render(r),i=Da(d)),c){c.adapter(i,d??e.render(r));return}l===void 0&&(l=document.head);const u=es(i,l);if(u!==null&&!s)return u;const h=u??qv(i);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(h,f),Cf(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),Cf(e.els,h),h}function Qv(t){return Kv(this,this.instance,t)}function Jv(t={}){const{id:e,ssr:i,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return Zv(this.instance,this,e,r,o,s,a,l,i)}function eC(t={}){const{id:e,parent:i}=t;Gv(this.instance,this,e,i)}const ns=function(t,e,i,r){return{instance:t,$:e,props:i,children:r,els:[],render:Qv,mount:Jv,unmount:eC}},tC=function(t,e,i,r){return Array.isArray(e)?ns(t,{$:null},null,e):Array.isArray(i)?ns(t,e,null,i):Array.isArray(r)?ns(t,e,i,r):ns(t,e,i,null)};function Sf(t={}){const e={c:((...i)=>tC(e,...i)),use:(i,...r)=>i.install(e,...r),find:es,context:{},config:t};return e}function nC(t,e){if(t===void 0)return!1;if(e){const{context:{ids:i}}=e;return i.has(t)}return es(t)!==null}const{c:ui}=Sf(),La="vueuc-style";function Bf(t){return t&-t}class Tf{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+=Bf(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-=Bf(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 Nf(t){return typeof t=="string"?document.querySelector(t):t()||null}const iC=n.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:$v(n.toRef(t,"show")),mergedTo:n.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Ia("lazy-teleport",this.$slots):n.h(n.Teleport,{disabled:this.disabled,to:this.mergedTo},Ia("lazy-teleport",this.$slots)):null}}),is={top:"bottom",bottom:"top",left:"right",right:"left"},$f={start:"end",center:"center",end:"start"},Ha={top:"height",bottom:"height",left:"width",right:"width"},rC={"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"},oC={"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"},sC={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Ef={top:!0,bottom:!1,left:!0,right:!1},Rf={top:"end",bottom:"start",left:"end",right:"start"};function aC(t,e,i,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"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=Ef[p]?_:-_:b=Ef[p]?_:-_),{left:b,top:y}},h=a==="left"||a==="right";if(c!=="center"){const m=sC[t],p=is[m],g=Ha[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=$f[l],d=u(g,p,h)):d=u(g,m,h):c="center"}}else i[g]<e[g]&&e[p]<0&&e[m]>e[p]&&(c=$f[l])}else{const m=a==="bottom"||a==="top"?"left":"top",p=is[m],g=Ha[m],b=(i[g]-e[g])/2;(e[m]<b||e[p]<b)&&(e[m]>e[p]?(c=Rf[m],d=u(g,m,h)):(c=Rf[p],d=u(g,p,h)))}let f=a;return e[a]<i[Ha[a]]&&e[a]<e[is[a]]&&(f=is[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function lC(t,e){return e?oC[t]:rC[t]}function cC(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 dC=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"})])]),Pf=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:f}=t;f.includes("scroll")&&e.addScrollListener(c),f.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};n.onMounted(()=>{i.value&&(c(),s())});const l=Ei();dC.mount({id:"vueuc/binder",head:!0,anchorMetaName:La,ssr:l}),n.onBeforeUnmount(()=>{a()}),Rv(()=>{i.value&&c()});const c=()=>{if(!i.value)return;const f=r.value;if(f===null)return;const m=e.targetRef,{x:p,y:g,overlap:b}=t,y=p!==void 0&&g!==void 0?Vv(p,g):Oa(m);f.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:k,placement:x,internalShift:C,flip:N}=t;f.setAttribute("v-placement",x),b?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="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 S=Oa(f),v=Oa(o.value),{left:$,top:E,placement:F}=aC(x,y,S,C,N,b),P=lC(F,b),{left:I,top:K,transform:J}=cC(F,v,y,E,$,b);f.setAttribute("v-placement",F),f.style.setProperty("--v-offset-left",`${Math.round($)}px`),f.style.setProperty("--v-offset-top",`${Math.round(E)}px`),f.style.transform=`translateX(${I}) translateY(${K}) ${J}`,f.style.setProperty("--v-transform-origin",P),f.style.transformOrigin=P};n.watch(i,f=>{f?(s(),d()):a()});const d=()=>{n.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{n.watch(n.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{n.watch(n.toRef(t,f),d)}),n.watch(n.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=Jo(),h=on(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:i,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return n.h(iC,{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,[[uf,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):i}})}});var Ri=[],uC=function(){return Ri.some(function(t){return t.activeTargets.length>0})},fC=function(){return Ri.some(function(t){return t.skippedTargets.length>0})},Ff="ResizeObserver loop completed with undelivered notifications.",hC=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Ff}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Ff),window.dispatchEvent(t)},Dr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Dr||(Dr={}));var Pi=function(t){return Object.freeze(t)},mC=(function(){function t(e,i){this.inlineSize=e,this.blockSize=i,Pi(this)}return t})(),Vf=(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,Pi(this)}return t.prototype.toJSON=function(){var e=this,i=e.x,r=e.y,o=e.top,s=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:i,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),Wa=function(t){return t instanceof SVGElement&&"getBBox"in t},Mf=function(t){if(Wa(t)){var e=t.getBBox(),i=e.width,r=e.height;return!i&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},If=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)},pC=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},Lr=typeof window<"u"?window:{},rs=new WeakMap,Af=/auto|scroll/,gC=/^tb|vertical/,yC=/msie|trident/i.test(Lr.navigator&&Lr.navigator.userAgent),Rn=function(t){return parseFloat(t||"0")},mr=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=!1),new mC((i?e:t)||0,(i?t:e)||0)},Of=Pi({devicePixelContentBoxSize:mr(),borderBoxSize:mr(),contentBoxSize:mr(),contentRect:new Vf(0,0,0,0)}),zf=function(t,e){if(e===void 0&&(e=!1),rs.has(t)&&!e)return rs.get(t);if(Mf(t))return rs.set(t,Of),Of;var i=getComputedStyle(t),r=Wa(t)&&t.ownerSVGElement&&t.getBBox(),o=!yC&&i.boxSizing==="border-box",s=gC.test(i.writingMode||""),a=!r&&Af.test(i.overflowY||""),l=!r&&Af.test(i.overflowX||""),c=r?0:Rn(i.paddingTop),d=r?0:Rn(i.paddingRight),u=r?0:Rn(i.paddingBottom),h=r?0:Rn(i.paddingLeft),f=r?0:Rn(i.borderTopWidth),m=r?0:Rn(i.borderRightWidth),p=r?0:Rn(i.borderBottomWidth),g=r?0:Rn(i.borderLeftWidth),b=h+d,y=c+u,_=g+m,k=f+p,x=l?t.offsetHeight-k-t.clientHeight:0,C=a?t.offsetWidth-_-t.clientWidth:0,N=o?b+_:0,w=o?y+k:0,S=r?r.width:Rn(i.width)-N-C,v=r?r.height:Rn(i.height)-w-x,$=S+b+C+_,E=v+y+x+k,F=Pi({devicePixelContentBoxSize:mr(Math.round(S*devicePixelRatio),Math.round(v*devicePixelRatio),s),borderBoxSize:mr($,E,s),contentBoxSize:mr(S,v,s),contentRect:new Vf(h,c,S,v)});return rs.set(t,F),F},Df=function(t,e,i){var r=zf(t,i),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Dr.DEVICE_PIXEL_CONTENT_BOX:return a;case Dr.BORDER_BOX:return o;default:return s}},bC=(function(){function t(e){var i=zf(e);this.target=e,this.contentRect=i.contentRect,this.borderBoxSize=Pi([i.borderBoxSize]),this.contentBoxSize=Pi([i.contentBoxSize]),this.devicePixelContentBoxSize=Pi([i.devicePixelContentBoxSize])}return t})(),Lf=function(t){if(Mf(t))return 1/0;for(var e=0,i=t.parentNode;i;)e+=1,i=i.parentNode;return e},_C=function(){var t=1/0,e=[];Ri.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new bC(d.target),h=Lf(d.target);l.push(u),d.lastReportedSize=Df(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var i=0,r=e;i<r.length;i++){var o=r[i];o()}return t},Hf=function(t){Ri.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(o){o.isActive()&&(Lf(o.target)>t?i.activeTargets.push(o):i.skippedTargets.push(o))})})},wC=function(){var t=0;for(Hf(t);uC();)t=_C(),Hf(t);return fC()&&hC(),t>0},ja,Wf=[],xC=function(){return Wf.splice(0).forEach(function(t){return t()})},kC=function(t){if(!ja){var e=0,i=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return xC()}).observe(i,r),ja=function(){i.textContent="".concat(e?e--:e++)}}Wf.push(t),ja()},vC=function(t){kC(function(){requestAnimationFrame(t)})},os=0,CC=function(){return!!os},SC=250,BC={attributes:!0,characterData:!0,childList:!0,subtree:!0},jf=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],qf=function(t){return t===void 0&&(t=0),Date.now()+t},qa=!1,TC=(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=SC),!qa){qa=!0;var r=qf(e);vC(function(){var o=!1;try{o=wC()}finally{if(qa=!1,e=r-qf(),!CC())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,BC)};document.body?i():Lr.addEventListener("DOMContentLoaded",i)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),jf.forEach(function(i){return Lr.addEventListener(i,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),jf.forEach(function(i){return Lr.removeEventListener(i,e.listener,!0)}),this.stopped=!0)},t})(),Xa=new TC,Xf=function(t){!os&&t>0&&Xa.start(),os+=t,!os&&Xa.stop()},NC=function(t){return!Wa(t)&&!pC(t)&&getComputedStyle(t).display==="inline"},$C=(function(){function t(e,i){this.target=e,this.observedBox=i||Dr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Df(this.target,this.observedBox,!0);return NC(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),EC=(function(){function t(e,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=i}return t})(),ss=new WeakMap,Yf=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].target===e)return i;return-1},as=(function(){function t(){}return t.connect=function(e,i){var r=new EC(e,i);ss.set(e,r)},t.observe=function(e,i,r){var o=ss.get(e),s=o.observationTargets.length===0;Yf(o.observationTargets,i)<0&&(s&&Ri.push(o),o.observationTargets.push(new $C(i,r&&r.box)),Xf(1),Xa.schedule())},t.unobserve=function(e,i){var r=ss.get(e),o=Yf(r.observationTargets,i),s=r.observationTargets.length===1;o>=0&&(s&&Ri.splice(Ri.indexOf(r),1),r.observationTargets.splice(o,1),Xf(-1))},t.disconnect=function(e){var i=this,r=ss.get(e);r.observationTargets.slice().forEach(function(o){return i.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),RC=(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.");as.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(!If(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");as.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(!If(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");as.unobserve(this,e)},t.prototype.disconnect=function(){as.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class PC{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||RC)(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 Hr=new PC,ls=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){bf("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){bf("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Hr.registerHandler(o.nextElementSibling,r),e=!0)}),n.onBeforeUnmount(()=>{e&&Hr.unregisterHandler(i.$el.nextElementSibling)})},render(){return n.renderSlot(this.$slots,"default")}});let cs;function FC(){return typeof document>"u"?!1:(cs===void 0&&("matchMedia"in window?cs=window.matchMedia("(pointer:coarse)").matches:cs=!1),cs)}let Ya;function Uf(){return typeof document>"u"?1:(Ya===void 0&&(Ya="chrome"in window?window.devicePixelRatio:1),Ya)}const Kf="VVirtualListXScroll";function VC({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 Tf(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=on(()=>{const d=s.value;return d!==null?Math.max(d.getBound(o.value)-1,0):0}),l=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(Kf,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:i,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Gf=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(Kf);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:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:i,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=i[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),MC=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"})])]),IC=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=Ei();MC.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:La,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:a.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:a,listWidthRef:l}=VC({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,h=n.computed(()=>{const{items:P,itemSize:I,keyField:K}=t,J=new Tf(P.length,I);return P.forEach((Z,L)=>{const A=Z[K],O=u.get(A);O!==void 0&&J.add(L,O)}),J}),f=n.ref(0),m=n.ref(0),p=on(()=>Math.max(h.value.getBound(m.value-Ar(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 A=J;A<=Z;++A)L.push(I[A]);return L}),b=(P,I)=>{if(typeof P=="number"){x(P,I,"auto");return}const{left:K,top:J,index:Z,key:L,position:A,behavior:O,debounce:V=!0}=P;if(K!==void 0||J!==void 0)x(K,J,O);else if(Z!==void 0)k(Z,O,V);else if(L!==void 0){const R=s.value.get(L);R!==void 0&&k(R,O,V)}else A==="bottom"?x(0,Number.MAX_SAFE_INTEGER,O):A==="top"&&x(0,0,O)};let y,_=null;function k(P,I,K){const{value:J}=h,Z=J.sum(P)+Ar(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:A}=c.value;if(Z>L){const O=J.get(P);Z+O<=L+A||c.value.scrollTo({left:0,top:Z+O-A,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 C(P,I){var K,J,Z;if(i||t.ignoreItemResize||F(I.target))return;const{value:L}=h,A=s.value.get(P),O=L.get(A),V=(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(V===O)return;V-t.itemSize===0?u.delete(P):u.set(P,V-t.itemSize);const H=V-O;if(H===0)return;L.add(A,H);const U=c.value;if(U!=null){if(y===void 0){const G=L.sum(A);U.scrollTop>G&&U.scrollBy(0,H)}else if(A<y)U.scrollBy(0,H);else if(A===y){const G=L.sum(A);V+G>U.scrollTop+U.offsetHeight&&U.scrollBy(0,H)}E()}f.value++}const N=!FC();let w=!1;function S(P){var I;(I=t.onScroll)===null||I===void 0||I.call(t,P),(!N||!w)&&E()}function v(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/Uf(),K.scrollLeft+=P.deltaX/Uf(),E(),w=!0,Ju(()=>{w=!1})}}}function $(P){if(i||F(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===l.value)return;d.value=P.contentRect.height,l.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,a.value=P.scrollLeft)}function F(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=Or(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:Or(o.value),height:P?"":I,minHeight:P?I:"",paddingTop:Or(t.paddingTop),paddingBottom:Or(t.paddingBottom)}]}),visibleItemsStyle:n.computed(()=>(f.value,{transform:`translateY(${Or(h.value.sum(p.value))})`})),viewportItems:g,listElRef:c,itemsElRef:n.ref(null),scrollTo:b,handleListResize:$,handleListScroll:S,handleListWheel:v,handleItemResize:C}},render(){const{itemResizable:t,keyField:e,keyToIndex:i,visibleItemsTag:r}=this;return n.h(ls,{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:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=i.get(d),h=a!=null?n.h(Gf,{index:u,item:c}):void 0,f=l!=null?n.h(Gf,{index:u,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?n.h(ls,{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",AC=ui("[v-hidden]",{display:"none!important"}),Zf=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(a){const{value:l}=i,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Wn)&&u.removeAttribute(Wn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const k of h)k.hasAttribute(Wn)&&k.removeAttribute(Wn);const f=l.offsetWidth,m=[],p=e.tail?d==null?void 0:d():null;let g=p?p.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let k=0;k<y-1;++k){if(k<0)continue;const x=h[k];if(b){x.hasAttribute(Wn)||x.setAttribute(Wn,"");continue}else x.hasAttribute(Wn)&&x.removeAttribute(Wn);const C=x.offsetWidth;if(g+=C,m[k]=C,g>f){const{updateCounter:N}=t;for(let w=k;w>=0;--w){const S=y-1-w;N!==void 0?N(S):u.textContent=`${S}`;const v=u.offsetWidth;if(g-=m[w],g+v<=f||w===0){b=!0,k=w-1,p&&(k===-1?(p.style.maxWidth=`${f-v}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(S);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Wn,""))}const s=Ei();return AC.mount({id:"vueuc/overflow",head:!0,anchorMetaName:La,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 Qf(t){return t instanceof HTMLElement}function Jf(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];if(Qf(i)&&(th(i)||Jf(i)))return!0}return!1}function eh(t){for(let e=t.childNodes.length-1;e>=0;e--){const i=t.childNodes[e];if(Qf(i)&&(th(i)||eh(i)))return!0}return!1}function th(t){if(!OC(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function OC(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 Wr=[];const zC=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=Yk(),i=n.ref(null),r=n.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Wr[Wr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}n.onMounted(()=>{n.watch(()=>t.active,b=>{b?(h(),It("keydown",document,c)):(ht("keydown",document,c),o&&f())},{immediate:!0})}),n.onBeforeUnmount(()=>{ht("keydown",document,c),o&&f()});function d(b){if(!s&&l()){const y=u();if(y===null||y.contains(Ir(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 h(){var b;if(!t.disabled){if(Wr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?m("first"):(b=Nf(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),Wr=Wr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=Nf(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function m(b){if(l()&&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"?Jf(k):eh(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 OT(t){return t}const Ua="n-internal-select-menu",nh="n-internal-select-menu-body",ih="n-drawer-body",rh="n-modal-body",oh="n-popover-body",sh="__disabled__";function jn(t){const e=n.inject(rh,null),i=n.inject(ih,null),r=n.inject(oh,null),o=n.inject(nh,null),s=n.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};n.onMounted(()=>{It("fullscreenchange",document,a)}),n.onBeforeUnmount(()=>{ht("fullscreenchange",document,a)})}return on(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?sh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:i!=null&&i.value?i.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}jn.tdkey=sh,jn.propTo={type:[String,Object,Boolean],default:void 0};function DC(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 ah(t,e){e&&(n.onMounted(()=>{const{value:i}=t;i&&Hr.registerHandler(i,e)}),n.watch(t,(i,r)=>{r&&Hr.unregisterHandler(r)},{deep:!1}),n.onBeforeUnmount(()=>{const{value:i}=t;i&&Hr.unregisterHandler(i)}))}function lh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const LC=/^(\d|\.)+$/,ch=/(\d|\.)+/;function Ka(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(LC.test(t)){const o=(Number(t)+i)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=ch.exec(t);return o?t.replace(ch,String((Number(o[0])+i)*e)):t}return t}function dh(t){const{left:e,right:i,top:r,bottom:o}=hn(t);return`${r} ${e} ${o} ${i}`}var uh={};function HC(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 a(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 l(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(C=>`&${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${x!==void 0?`${i}${x}`:""}${r}${C}`).join(", ")}const k=g.bem.els;if(k!==null){if(uh.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(uh.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(a(p[0]),p[1],p[2])),cE:((...p)=>o(l(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 WC=".n-",jC="__",qC="--",fh=Sf(),hh=HC({blockPrefix:WC,elementPrefix:jC,modifierPrefix:qC});fh.use(hh);const{c:he,find:DT}=fh,{cB:be,cE:ke,cM:Re,cNotM:mn}=hh,XC=(...t)=>he(">",[be(...t)]);function nt(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,i=>i.toUpperCase()))}let Ga;function YC(){return Ga===void 0&&(Ga=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ga}const UC=new WeakSet;function KC(t){UC.add(t)}function mh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const ph=new Set;function fi(t,e){const i=`[naive/${t}]: ${e}`;ph.has(i)||(ph.add(i),console.error(i))}function gh(t,e){console.error(`[naive/${t}]: ${e}`)}function yh(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 Za(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)){Za(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Za(r.children,e,i)}else{if(r.type===n.Comment&&e)return;i.push(r)}}}),i}function GC(t,e="default",i=void 0){const r=t[e];if(!r)return gh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=Za(r(i));return o.length===1?o[0]:(gh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function ZC(t,e=[],i){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,i)}function Qa(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 pr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?n.createTextVNode(t):typeof t=="number"?n.createTextVNode(String(t)):null}function ds(t){return t.some(e=>n.isVNode(e)?!(e.type===n.Comment||e.type===n.Fragment&&!ds(e.children)):!0)?t:null}function Ja(t,e){return t&&ds(t())||e()}function Fi(t,e){const i=t&&ds(t());return e(i||null)}function bh(t){return!(t&&ds(t()))}const el=n.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Vi="n-config-provider",QC="n";function Mi(t={},e={defaultBordered:!0}){const i=n.inject(Vi,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(QC),namespaceRef:n.computed(()=>i==null?void 0:i.mergedNamespaceRef.value)}}function Ii(t,e,i,r){i||yh("useThemeClass","cssVarsRef is not passed");const o=n.inject(Vi,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=n.ref(""),c=Ei();let d;const u=`__${t}`,h=()=>{let f=u;const m=e?e.value:void 0,p=s==null?void 0:s.value;p&&(f+=`-${p}`),m&&(f+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:b}=r;g&&(f+=`-${Da(JSON.stringify(g))}`),b&&(f+=`-${Da(JSON.stringify(b))}`),l.value=f,d=()=>{const y=i.value;let _="";for(const k in y)_+=`${k}: ${y[k]};`;he(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return n.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const _h="n-form-item";function JC(t,{defaultSize:e="medium",mergedSize:i,mergedDisabled:r}={}){const o=n.inject(_h,null);n.provide(_h,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}),a=n.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=n.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return n.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const e2={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 tl(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}function jr(t){return(e,i)=>{const r=i!=null&&i.context?String(i.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=i!=null&&i.width?String(i.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=i!=null&&i.width?String(i.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function qr(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 a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?n2(l,h=>h.test(a)):t2(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=i.valueCallback?i.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function t2(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i}function n2(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i}function i2(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 a=t.valueCallback?t.valueCallback(s[0]):s[0];a=i.valueCallback?i.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const r2={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"}},o2=(t,e,i)=>{let r;const o=r2[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},s2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},a2=(t,e,i,r)=>s2[t],l2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},c2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},d2={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"]},u2={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"]},f2={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"}},h2={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"}},m2={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:jr({values:l2,defaultWidth:"wide"}),quarter:jr({values:c2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:jr({values:d2,defaultWidth:"wide"}),day:jr({values:u2,defaultWidth:"wide"}),dayPeriod:jr({values:f2,defaultWidth:"wide",formattingValues:h2,defaultFormattingWidth:"wide"})},p2=/^(\d+)(th|st|nd|rd)?/i,g2=/\d+/i,y2={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},b2={any:[/^b/i,/^(a|c)/i]},_2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},w2={any:[/1/i,/2/i,/3/i,/4/i]},x2={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},k2={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]},v2={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},C2={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]},S2={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},B2={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}},T2={ordinalNumber:i2({matchPattern:p2,parsePattern:g2,valueCallback:t=>parseInt(t,10)}),era:qr({matchPatterns:y2,defaultMatchWidth:"wide",parsePatterns:b2,defaultParseWidth:"any"}),quarter:qr({matchPatterns:_2,defaultMatchWidth:"wide",parsePatterns:w2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:qr({matchPatterns:x2,defaultMatchWidth:"wide",parsePatterns:k2,defaultParseWidth:"any"}),day:qr({matchPatterns:v2,defaultMatchWidth:"wide",parsePatterns:C2,defaultParseWidth:"any"}),dayPeriod:qr({matchPatterns:S2,defaultMatchWidth:"any",parsePatterns:B2,defaultParseWidth:"any"})},N2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},E2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},R2={date:tl({formats:N2,defaultWidth:"full"}),time:tl({formats:$2,defaultWidth:"full"}),dateTime:tl({formats:E2,defaultWidth:"full"})},P2={name:"en-US",locale:{code:"en-US",formatDistance:o2,formatLong:R2,formatRelative:a2,localize:m2,match:T2,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function wh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:i}=n.inject(Vi,null)||{},r=n.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&a!==void 0?a:e2[t]});return{dateLocaleRef:n.computed(()=>{var s;return(s=i==null?void 0:i.value)!==null&&s!==void 0?s:P2}),localeRef:r}}const Xr="naive-ui-style";function Yr(t,e,i){if(!e)return;const r=Ei(),o=n.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=n.inject(Vi,null),a=()=>{n.watchEffect(()=>{const{value:l}=i,c=`${l}${t}Rtl`;if(nC(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Xr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():n.onBeforeMount(a),o}const Ur={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:F2,fontFamily:V2,lineHeight:M2}=Ur,xh=he("body",`
|
|
116
|
+
`)}function Da(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 Zv(t,e,i,r){const{els:o}=e;if(i===void 0)o.forEach(wf),e.els=[];else{const s=es(i,r);s&&o.includes(s)&&(wf(s),e.els=o.filter(a=>a!==s))}}function Cf(t,e){t.push(e)}function Qv(t,e,i,r,o,s,a,l,c){let d;if(i===void 0&&(d=e.render(r),i=Da(d)),c){c.adapter(i,d??e.render(r));return}l===void 0&&(l=document.head);const u=es(i,l);if(u!==null&&!s)return u;const h=u??Xv(i);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(h,f),Cf(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),Cf(e.els,h),h}function Jv(t){return Gv(this,this.instance,t)}function eC(t={}){const{id:e,ssr:i,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return Qv(this.instance,this,e,r,o,s,a,l,i)}function tC(t={}){const{id:e,parent:i}=t;Zv(this.instance,this,e,i)}const ns=function(t,e,i,r){return{instance:t,$:e,props:i,children:r,els:[],render:Jv,mount:eC,unmount:tC}},nC=function(t,e,i,r){return Array.isArray(e)?ns(t,{$:null},null,e):Array.isArray(i)?ns(t,e,null,i):Array.isArray(r)?ns(t,e,i,r):ns(t,e,i,null)};function Sf(t={}){const e={c:((...i)=>nC(e,...i)),use:(i,...r)=>i.install(e,...r),find:es,context:{},config:t};return e}function iC(t,e){if(t===void 0)return!1;if(e){const{context:{ids:i}}=e;return i.has(t)}return es(t)!==null}const{c:ui}=Sf(),La="vueuc-style";function Bf(t){return t&-t}class Nf{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+=Bf(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-=Bf(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 Tf(t){return typeof t=="string"?document.querySelector(t):t()||null}const rC=n.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Ev(n.toRef(t,"show")),mergedTo:n.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Ia("lazy-teleport",this.$slots):n.h(n.Teleport,{disabled:this.disabled,to:this.mergedTo},Ia("lazy-teleport",this.$slots)):null}}),is={top:"bottom",bottom:"top",left:"right",right:"left"},$f={start:"end",center:"center",end:"start"},Ha={top:"height",bottom:"height",left:"width",right:"width"},oC={"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"},sC={"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"},aC={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Ef={top:!0,bottom:!1,left:!0,right:!1},Rf={top:"end",bottom:"start",left:"end",right:"start"};function lC(t,e,i,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"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=Ef[p]?_:-_:b=Ef[p]?_:-_),{left:b,top:y}},h=a==="left"||a==="right";if(c!=="center"){const m=aC[t],p=is[m],g=Ha[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=$f[l],d=u(g,p,h)):d=u(g,m,h):c="center"}}else i[g]<e[g]&&e[p]<0&&e[m]>e[p]&&(c=$f[l])}else{const m=a==="bottom"||a==="top"?"left":"top",p=is[m],g=Ha[m],b=(i[g]-e[g])/2;(e[m]<b||e[p]<b)&&(e[m]>e[p]?(c=Rf[m],d=u(g,m,h)):(c=Rf[p],d=u(g,p,h)))}let f=a;return e[a]<i[Ha[a]]&&e[a]<e[is[a]]&&(f=is[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function cC(t,e){return e?sC[t]:oC[t]}function dC(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 uC=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"})])]),Pf=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:f}=t;f.includes("scroll")&&e.addScrollListener(c),f.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};n.onMounted(()=>{i.value&&(c(),s())});const l=Ei();uC.mount({id:"vueuc/binder",head:!0,anchorMetaName:La,ssr:l}),n.onBeforeUnmount(()=>{a()}),Pv(()=>{i.value&&c()});const c=()=>{if(!i.value)return;const f=r.value;if(f===null)return;const m=e.targetRef,{x:p,y:g,overlap:b}=t,y=p!==void 0&&g!==void 0?Mv(p,g):Oa(m);f.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:k,placement:x,internalShift:C,flip:T}=t;f.setAttribute("v-placement",x),b?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="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 S=Oa(f),v=Oa(o.value),{left:$,top:E,placement:F}=lC(x,y,S,C,T,b),P=cC(F,b),{left:I,top:K,transform:J}=dC(F,v,y,E,$,b);f.setAttribute("v-placement",F),f.style.setProperty("--v-offset-left",`${Math.round($)}px`),f.style.setProperty("--v-offset-top",`${Math.round(E)}px`),f.style.transform=`translateX(${I}) translateY(${K}) ${J}`,f.style.setProperty("--v-transform-origin",P),f.style.transformOrigin=P};n.watch(i,f=>{f?(s(),d()):a()});const d=()=>{n.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{n.watch(n.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{n.watch(n.toRef(t,f),d)}),n.watch(n.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=Jo(),h=on(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:i,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return n.h(rC,{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,[[uf,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):i}})}});var Ri=[],fC=function(){return Ri.some(function(t){return t.activeTargets.length>0})},hC=function(){return Ri.some(function(t){return t.skippedTargets.length>0})},Ff="ResizeObserver loop completed with undelivered notifications.",mC=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Ff}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Ff),window.dispatchEvent(t)},Dr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Dr||(Dr={}));var Pi=function(t){return Object.freeze(t)},pC=(function(){function t(e,i){this.inlineSize=e,this.blockSize=i,Pi(this)}return t})(),Vf=(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,Pi(this)}return t.prototype.toJSON=function(){var e=this,i=e.x,r=e.y,o=e.top,s=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:i,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),Wa=function(t){return t instanceof SVGElement&&"getBBox"in t},Mf=function(t){if(Wa(t)){var e=t.getBBox(),i=e.width,r=e.height;return!i&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},If=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)},gC=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},Lr=typeof window<"u"?window:{},rs=new WeakMap,Af=/auto|scroll/,yC=/^tb|vertical/,bC=/msie|trident/i.test(Lr.navigator&&Lr.navigator.userAgent),Rn=function(t){return parseFloat(t||"0")},mr=function(t,e,i){return t===void 0&&(t=0),e===void 0&&(e=0),i===void 0&&(i=!1),new pC((i?e:t)||0,(i?t:e)||0)},Of=Pi({devicePixelContentBoxSize:mr(),borderBoxSize:mr(),contentBoxSize:mr(),contentRect:new Vf(0,0,0,0)}),zf=function(t,e){if(e===void 0&&(e=!1),rs.has(t)&&!e)return rs.get(t);if(Mf(t))return rs.set(t,Of),Of;var i=getComputedStyle(t),r=Wa(t)&&t.ownerSVGElement&&t.getBBox(),o=!bC&&i.boxSizing==="border-box",s=yC.test(i.writingMode||""),a=!r&&Af.test(i.overflowY||""),l=!r&&Af.test(i.overflowX||""),c=r?0:Rn(i.paddingTop),d=r?0:Rn(i.paddingRight),u=r?0:Rn(i.paddingBottom),h=r?0:Rn(i.paddingLeft),f=r?0:Rn(i.borderTopWidth),m=r?0:Rn(i.borderRightWidth),p=r?0:Rn(i.borderBottomWidth),g=r?0:Rn(i.borderLeftWidth),b=h+d,y=c+u,_=g+m,k=f+p,x=l?t.offsetHeight-k-t.clientHeight:0,C=a?t.offsetWidth-_-t.clientWidth:0,T=o?b+_:0,w=o?y+k:0,S=r?r.width:Rn(i.width)-T-C,v=r?r.height:Rn(i.height)-w-x,$=S+b+C+_,E=v+y+x+k,F=Pi({devicePixelContentBoxSize:mr(Math.round(S*devicePixelRatio),Math.round(v*devicePixelRatio),s),borderBoxSize:mr($,E,s),contentBoxSize:mr(S,v,s),contentRect:new Vf(h,c,S,v)});return rs.set(t,F),F},Df=function(t,e,i){var r=zf(t,i),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Dr.DEVICE_PIXEL_CONTENT_BOX:return a;case Dr.BORDER_BOX:return o;default:return s}},_C=(function(){function t(e){var i=zf(e);this.target=e,this.contentRect=i.contentRect,this.borderBoxSize=Pi([i.borderBoxSize]),this.contentBoxSize=Pi([i.contentBoxSize]),this.devicePixelContentBoxSize=Pi([i.devicePixelContentBoxSize])}return t})(),Lf=function(t){if(Mf(t))return 1/0;for(var e=0,i=t.parentNode;i;)e+=1,i=i.parentNode;return e},wC=function(){var t=1/0,e=[];Ri.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new _C(d.target),h=Lf(d.target);l.push(u),d.lastReportedSize=Df(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var i=0,r=e;i<r.length;i++){var o=r[i];o()}return t},Hf=function(t){Ri.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(o){o.isActive()&&(Lf(o.target)>t?i.activeTargets.push(o):i.skippedTargets.push(o))})})},xC=function(){var t=0;for(Hf(t);fC();)t=wC(),Hf(t);return hC()&&mC(),t>0},ja,Wf=[],kC=function(){return Wf.splice(0).forEach(function(t){return t()})},vC=function(t){if(!ja){var e=0,i=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return kC()}).observe(i,r),ja=function(){i.textContent="".concat(e?e--:e++)}}Wf.push(t),ja()},CC=function(t){vC(function(){requestAnimationFrame(t)})},os=0,SC=function(){return!!os},BC=250,NC={attributes:!0,characterData:!0,childList:!0,subtree:!0},jf=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],qf=function(t){return t===void 0&&(t=0),Date.now()+t},qa=!1,TC=(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=BC),!qa){qa=!0;var r=qf(e);CC(function(){var o=!1;try{o=xC()}finally{if(qa=!1,e=r-qf(),!SC())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,NC)};document.body?i():Lr.addEventListener("DOMContentLoaded",i)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),jf.forEach(function(i){return Lr.addEventListener(i,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),jf.forEach(function(i){return Lr.removeEventListener(i,e.listener,!0)}),this.stopped=!0)},t})(),Xa=new TC,Xf=function(t){!os&&t>0&&Xa.start(),os+=t,!os&&Xa.stop()},$C=function(t){return!Wa(t)&&!gC(t)&&getComputedStyle(t).display==="inline"},EC=(function(){function t(e,i){this.target=e,this.observedBox=i||Dr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Df(this.target,this.observedBox,!0);return $C(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),RC=(function(){function t(e,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=i}return t})(),ss=new WeakMap,Yf=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].target===e)return i;return-1},as=(function(){function t(){}return t.connect=function(e,i){var r=new RC(e,i);ss.set(e,r)},t.observe=function(e,i,r){var o=ss.get(e),s=o.observationTargets.length===0;Yf(o.observationTargets,i)<0&&(s&&Ri.push(o),o.observationTargets.push(new EC(i,r&&r.box)),Xf(1),Xa.schedule())},t.unobserve=function(e,i){var r=ss.get(e),o=Yf(r.observationTargets,i),s=r.observationTargets.length===1;o>=0&&(s&&Ri.splice(Ri.indexOf(r),1),r.observationTargets.splice(o,1),Xf(-1))},t.disconnect=function(e){var i=this,r=ss.get(e);r.observationTargets.slice().forEach(function(o){return i.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),PC=(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.");as.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(!If(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");as.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(!If(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");as.unobserve(this,e)},t.prototype.disconnect=function(){as.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class FC{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||PC)(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 Hr=new FC,ls=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){bf("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){bf("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Hr.registerHandler(o.nextElementSibling,r),e=!0)}),n.onBeforeUnmount(()=>{e&&Hr.unregisterHandler(i.$el.nextElementSibling)})},render(){return n.renderSlot(this.$slots,"default")}});let cs;function VC(){return typeof document>"u"?!1:(cs===void 0&&("matchMedia"in window?cs=window.matchMedia("(pointer:coarse)").matches:cs=!1),cs)}let Ya;function Uf(){return typeof document>"u"?1:(Ya===void 0&&(Ya="chrome"in window?window.devicePixelRatio:1),Ya)}const Kf="VVirtualListXScroll";function MC({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 Nf(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=on(()=>{const d=s.value;return d!==null?Math.max(d.getBound(o.value)-1,0):0}),l=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(Kf,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:i,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Gf=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(Kf);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:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:i,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=i[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),IC=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"})])]),AC=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=Ei();IC.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:La,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:a.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:a,listWidthRef:l}=MC({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,h=n.computed(()=>{const{items:P,itemSize:I,keyField:K}=t,J=new Nf(P.length,I);return P.forEach((Z,L)=>{const A=Z[K],O=u.get(A);O!==void 0&&J.add(L,O)}),J}),f=n.ref(0),m=n.ref(0),p=on(()=>Math.max(h.value.getBound(m.value-Ar(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 A=J;A<=Z;++A)L.push(I[A]);return L}),b=(P,I)=>{if(typeof P=="number"){x(P,I,"auto");return}const{left:K,top:J,index:Z,key:L,position:A,behavior:O,debounce:V=!0}=P;if(K!==void 0||J!==void 0)x(K,J,O);else if(Z!==void 0)k(Z,O,V);else if(L!==void 0){const R=s.value.get(L);R!==void 0&&k(R,O,V)}else A==="bottom"?x(0,Number.MAX_SAFE_INTEGER,O):A==="top"&&x(0,0,O)};let y,_=null;function k(P,I,K){const{value:J}=h,Z=J.sum(P)+Ar(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:A}=c.value;if(Z>L){const O=J.get(P);Z+O<=L+A||c.value.scrollTo({left:0,top:Z+O-A,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 C(P,I){var K,J,Z;if(i||t.ignoreItemResize||F(I.target))return;const{value:L}=h,A=s.value.get(P),O=L.get(A),V=(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(V===O)return;V-t.itemSize===0?u.delete(P):u.set(P,V-t.itemSize);const H=V-O;if(H===0)return;L.add(A,H);const Y=c.value;if(Y!=null){if(y===void 0){const G=L.sum(A);Y.scrollTop>G&&Y.scrollBy(0,H)}else if(A<y)Y.scrollBy(0,H);else if(A===y){const G=L.sum(A);V+G>Y.scrollTop+Y.offsetHeight&&Y.scrollBy(0,H)}E()}f.value++}const T=!VC();let w=!1;function S(P){var I;(I=t.onScroll)===null||I===void 0||I.call(t,P),(!T||!w)&&E()}function v(P){var I;if((I=t.onWheel)===null||I===void 0||I.call(t,P),T){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/Uf(),K.scrollLeft+=P.deltaX/Uf(),E(),w=!0,Ju(()=>{w=!1})}}}function $(P){if(i||F(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===l.value)return;d.value=P.contentRect.height,l.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,a.value=P.scrollLeft)}function F(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=Or(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:Or(o.value),height:P?"":I,minHeight:P?I:"",paddingTop:Or(t.paddingTop),paddingBottom:Or(t.paddingBottom)}]}),visibleItemsStyle:n.computed(()=>(f.value,{transform:`translateY(${Or(h.value.sum(p.value))})`})),viewportItems:g,listElRef:c,itemsElRef:n.ref(null),scrollTo:b,handleListResize:$,handleListScroll:S,handleListWheel:v,handleItemResize:C}},render(){const{itemResizable:t,keyField:e,keyToIndex:i,visibleItemsTag:r}=this;return n.h(ls,{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:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=i.get(d),h=a!=null?n.h(Gf,{index:u,item:c}):void 0,f=l!=null?n.h(Gf,{index:u,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?n.h(ls,{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",OC=ui("[v-hidden]",{display:"none!important"}),Zf=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(a){const{value:l}=i,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Wn)&&u.removeAttribute(Wn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const k of h)k.hasAttribute(Wn)&&k.removeAttribute(Wn);const f=l.offsetWidth,m=[],p=e.tail?d==null?void 0:d():null;let g=p?p.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let k=0;k<y-1;++k){if(k<0)continue;const x=h[k];if(b){x.hasAttribute(Wn)||x.setAttribute(Wn,"");continue}else x.hasAttribute(Wn)&&x.removeAttribute(Wn);const C=x.offsetWidth;if(g+=C,m[k]=C,g>f){const{updateCounter:T}=t;for(let w=k;w>=0;--w){const S=y-1-w;T!==void 0?T(S):u.textContent=`${S}`;const v=u.offsetWidth;if(g-=m[w],g+v<=f||w===0){b=!0,k=w-1,p&&(k===-1?(p.style.maxWidth=`${f-v}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(S);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Wn,""))}const s=Ei();return OC.mount({id:"vueuc/overflow",head:!0,anchorMetaName:La,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 Qf(t){return t instanceof HTMLElement}function Jf(t){for(let e=0;e<t.childNodes.length;e++){const i=t.childNodes[e];if(Qf(i)&&(th(i)||Jf(i)))return!0}return!1}function eh(t){for(let e=t.childNodes.length-1;e>=0;e--){const i=t.childNodes[e];if(Qf(i)&&(th(i)||eh(i)))return!0}return!1}function th(t){if(!zC(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function zC(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 Wr=[];const DC=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=Uk(),i=n.ref(null),r=n.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Wr[Wr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}n.onMounted(()=>{n.watch(()=>t.active,b=>{b?(h(),It("keydown",document,c)):(ht("keydown",document,c),o&&f())},{immediate:!0})}),n.onBeforeUnmount(()=>{ht("keydown",document,c),o&&f()});function d(b){if(!s&&l()){const y=u();if(y===null||y.contains(Ir(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 h(){var b;if(!t.disabled){if(Wr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?m("first"):(b=Tf(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),Wr=Wr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=Tf(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function m(b){if(l()&&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"?Jf(k):eh(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 zN(t){return t}const Ua="n-internal-select-menu",nh="n-internal-select-menu-body",ih="n-drawer-body",rh="n-modal-body",oh="n-popover-body",sh="__disabled__";function jn(t){const e=n.inject(rh,null),i=n.inject(ih,null),r=n.inject(oh,null),o=n.inject(nh,null),s=n.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};n.onMounted(()=>{It("fullscreenchange",document,a)}),n.onBeforeUnmount(()=>{ht("fullscreenchange",document,a)})}return on(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?sh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:i!=null&&i.value?i.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}jn.tdkey=sh,jn.propTo={type:[String,Object,Boolean],default:void 0};function LC(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 ah(t,e){e&&(n.onMounted(()=>{const{value:i}=t;i&&Hr.registerHandler(i,e)}),n.watch(t,(i,r)=>{r&&Hr.unregisterHandler(r)},{deep:!1}),n.onBeforeUnmount(()=>{const{value:i}=t;i&&Hr.unregisterHandler(i)}))}function lh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const HC=/^(\d|\.)+$/,ch=/(\d|\.)+/;function Ka(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(HC.test(t)){const o=(Number(t)+i)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=ch.exec(t);return o?t.replace(ch,String((Number(o[0])+i)*e)):t}return t}function dh(t){const{left:e,right:i,top:r,bottom:o}=hn(t);return`${r} ${e} ${o} ${i}`}var uh={};function WC(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 a(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 l(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(C=>`&${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${x!==void 0?`${i}${x}`:""}${r}${C}`).join(", ")}const k=g.bem.els;if(k!==null){if(uh.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(uh.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(a(p[0]),p[1],p[2])),cE:((...p)=>o(l(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 jC=".n-",qC="__",XC="--",fh=Sf(),hh=WC({blockPrefix:jC,elementPrefix:qC,modifierPrefix:XC});fh.use(hh);const{c:he,find:LN}=fh,{cB:be,cE:ke,cM:Re,cNotM:mn}=hh,YC=(...t)=>he(">",[be(...t)]);function nt(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,i=>i.toUpperCase()))}let Ga;function UC(){return Ga===void 0&&(Ga=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ga}const KC=new WeakSet;function GC(t){KC.add(t)}function mh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const ph=new Set;function fi(t,e){const i=`[naive/${t}]: ${e}`;ph.has(i)||(ph.add(i),console.error(i))}function gh(t,e){console.error(`[naive/${t}]: ${e}`)}function yh(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 Za(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)){Za(r,e,i);return}if(r.type===n.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Za(r.children,e,i)}else{if(r.type===n.Comment&&e)return;i.push(r)}}}),i}function ZC(t,e="default",i=void 0){const r=t[e];if(!r)return gh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=Za(r(i));return o.length===1?o[0]:(gh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function QC(t,e=[],i){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,i)}function Qa(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 pr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?n.createTextVNode(t):typeof t=="number"?n.createTextVNode(String(t)):null}function ds(t){return t.some(e=>n.isVNode(e)?!(e.type===n.Comment||e.type===n.Fragment&&!ds(e.children)):!0)?t:null}function Ja(t,e){return t&&ds(t())||e()}function Fi(t,e){const i=t&&ds(t());return e(i||null)}function bh(t){return!(t&&ds(t()))}const el=n.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Vi="n-config-provider",JC="n";function Mi(t={},e={defaultBordered:!0}){const i=n.inject(Vi,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(JC),namespaceRef:n.computed(()=>i==null?void 0:i.mergedNamespaceRef.value)}}function Ii(t,e,i,r){i||yh("useThemeClass","cssVarsRef is not passed");const o=n.inject(Vi,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=n.ref(""),c=Ei();let d;const u=`__${t}`,h=()=>{let f=u;const m=e?e.value:void 0,p=s==null?void 0:s.value;p&&(f+=`-${p}`),m&&(f+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:b}=r;g&&(f+=`-${Da(JSON.stringify(g))}`),b&&(f+=`-${Da(JSON.stringify(b))}`),l.value=f,d=()=>{const y=i.value;let _="";for(const k in y)_+=`${k}: ${y[k]};`;he(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return n.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const _h="n-form-item";function e2(t,{defaultSize:e="medium",mergedSize:i,mergedDisabled:r}={}){const o=n.inject(_h,null);n.provide(_h,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}),a=n.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=n.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return n.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const t2={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 tl(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}function jr(t){return(e,i)=>{const r=i!=null&&i.context?String(i.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=i!=null&&i.width?String(i.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=i!=null&&i.width?String(i.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function qr(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 a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?i2(l,h=>h.test(a)):n2(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=i.valueCallback?i.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function n2(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i}function i2(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i}function r2(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 a=t.valueCallback?t.valueCallback(s[0]):s[0];a=i.valueCallback?i.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const o2={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"}},s2=(t,e,i)=>{let r;const o=o2[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},a2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},l2=(t,e,i,r)=>a2[t],c2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},d2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},u2={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"]},f2={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"]},h2={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"}},m2={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"}},p2={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:jr({values:c2,defaultWidth:"wide"}),quarter:jr({values:d2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:jr({values:u2,defaultWidth:"wide"}),day:jr({values:f2,defaultWidth:"wide"}),dayPeriod:jr({values:h2,defaultWidth:"wide",formattingValues:m2,defaultFormattingWidth:"wide"})},g2=/^(\d+)(th|st|nd|rd)?/i,y2=/\d+/i,b2={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},_2={any:[/^b/i,/^(a|c)/i]},w2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},x2={any:[/1/i,/2/i,/3/i,/4/i]},k2={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},v2={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]},C2={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},S2={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]},B2={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},N2={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}},T2={ordinalNumber:r2({matchPattern:g2,parsePattern:y2,valueCallback:t=>parseInt(t,10)}),era:qr({matchPatterns:b2,defaultMatchWidth:"wide",parsePatterns:_2,defaultParseWidth:"any"}),quarter:qr({matchPatterns:w2,defaultMatchWidth:"wide",parsePatterns:x2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:qr({matchPatterns:k2,defaultMatchWidth:"wide",parsePatterns:v2,defaultParseWidth:"any"}),day:qr({matchPatterns:C2,defaultMatchWidth:"wide",parsePatterns:S2,defaultParseWidth:"any"}),dayPeriod:qr({matchPatterns:B2,defaultMatchWidth:"any",parsePatterns:N2,defaultParseWidth:"any"})},$2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},E2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},R2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P2={date:tl({formats:$2,defaultWidth:"full"}),time:tl({formats:E2,defaultWidth:"full"}),dateTime:tl({formats:R2,defaultWidth:"full"})},F2={name:"en-US",locale:{code:"en-US",formatDistance:s2,formatLong:P2,formatRelative:l2,localize:p2,match:T2,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function wh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:i}=n.inject(Vi,null)||{},r=n.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&a!==void 0?a:t2[t]});return{dateLocaleRef:n.computed(()=>{var s;return(s=i==null?void 0:i.value)!==null&&s!==void 0?s:F2}),localeRef:r}}const Xr="naive-ui-style";function Yr(t,e,i){if(!e)return;const r=Ei(),o=n.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=n.inject(Vi,null),a=()=>{n.watchEffect(()=>{const{value:l}=i,c=`${l}${t}Rtl`;if(iC(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Xr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():n.onBeforeMount(a),o}const Ur={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:V2,fontFamily:M2,lineHeight:I2}=Ur,xh=he("body",`
|
|
117
117
|
margin: 0;
|
|
118
|
-
font-size: ${
|
|
119
|
-
font-family: ${
|
|
120
|
-
line-height: ${
|
|
118
|
+
font-size: ${V2};
|
|
119
|
+
font-family: ${M2};
|
|
120
|
+
line-height: ${I2};
|
|
121
121
|
-webkit-text-size-adjust: 100%;
|
|
122
122
|
-webkit-tap-highlight-color: transparent;
|
|
123
123
|
`,[he("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var
|
|
126
|
+
`)]);var A2={};function us(t,e,i){if(!e){A2.NODE_ENV!=="production"&&yh("use-style","No style is specified.");return}const r=Ei(),o=n.inject(Vi,null),s=()=>{const a=i.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Xr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||xh.mount({id:"n-global",head:!0,anchorMetaName:Xr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():n.onBeforeMount(s)}function jN(t){return t}function Nt(t,e,i,r,o,s){const a=Ei(),l=n.inject(Vi,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:Xr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||xh.mount({id:"n-global",head:!0,anchorMetaName:Xr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():n.onBeforeMount(d)}return n.computed(()=>{var d;const{theme:{common:u,self:h,peers:f={}}={},themeOverrides:m={},builtinThemeOverrides:p={}}=o,{common:g,peers:b}=m,{common:y=void 0,[t]:{common:_=void 0,self:k=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:C=void 0,[t]:T={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:w,peers:S={}}=T,v=z.merge({},u||_||y||r.common,C,w,g),$=z.merge((d=h||k||r.self)===null||d===void 0?void 0:d(v),p,T,m);return{common:v,self:$,peers:z.merge({},r.peers,x,f),peerOverrides:z.merge({},p.peers,S,b)}})}Nt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const O2=be("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -134,7 +134,7 @@ ${o}
|
|
|
134
134
|
`,[he("svg",`
|
|
135
135
|
height: 1em;
|
|
136
136
|
width: 1em;
|
|
137
|
-
`)]),Kr=n.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){us("-base-icon",
|
|
137
|
+
`)]),Kr=n.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){us("-base-icon",O2,n.toRef(t,"clsPrefix"))},render(){return n.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),kh=n.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const i=Jo();return()=>n.h(n.Transition,{name:"icon-switch-transition",appear:i.value},e)}});function vh(t,e){const i=n.defineComponent({render(){return e()}});return n.defineComponent({name:z.upperFirst(t),setup(){var r;const o=(r=n.inject(Vi,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var s;const a=(s=o==null?void 0:o.value)===null||s===void 0?void 0:s[t];return a?a():n.h(i,null)}}})}const z2=n.defineComponent({name:"Checkmark",render(){return n.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},n.h("g",{fill:"none"},n.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),D2=n.defineComponent({name:"ChevronDown",render(){return n.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),L2=vh("clear",()=>n.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n.h("g",{fill:"currentColor","fill-rule":"nonzero"},n.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),H2=vh("close",()=>n.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},n.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n.h("g",{fill:"currentColor","fill-rule":"nonzero"},n.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),W2=n.defineComponent({name:"Empty",render(){return n.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),n.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:j2}=Ur;function nl({originalTransform:t="",left:e=0,top:i=0,transition:r=`all .3s ${j2} !important`}={}){return[he("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:i,opacity:0}),he("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:i,opacity:1}),he("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:i,transition:r})]}const q2=be("base-clear",`
|
|
138
138
|
flex-shrink: 0;
|
|
139
139
|
height: 1em;
|
|
140
140
|
width: 1em;
|
|
@@ -158,7 +158,7 @@ ${o}
|
|
|
158
158
|
left: 50%;
|
|
159
159
|
top: 50%;
|
|
160
160
|
transform: translateX(-50%) translateY(-50%);
|
|
161
|
-
`,[nl({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),
|
|
161
|
+
`,[nl({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),X2=n.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return us("-base-clear",q2,n.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return n.h("div",{class:`${t}-base-clear`},n.h(kh,null,{default:()=>{var e,i;return this.show?n.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Ja(this.$slots.icon,()=>[n.h(Kr,{clsPrefix:t},{default:()=>n.h(L2,null)})])):n.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(i=(e=this.$slots).placeholder)===null||i===void 0?void 0:i.call(e))}}))}}),Y2=be("base-close",`
|
|
162
162
|
display: flex;
|
|
163
163
|
align-items: center;
|
|
164
164
|
justify-content: center;
|
|
@@ -202,7 +202,7 @@ ${o}
|
|
|
202
202
|
background-color: transparent;
|
|
203
203
|
`),Re("round",[he("&::before",`
|
|
204
204
|
border-radius: 50%;
|
|
205
|
-
`)])]),
|
|
205
|
+
`)])]),U2=n.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(t){return us("-base-close",Y2,n.toRef(t,"clsPrefix")),()=>{const{clsPrefix:e,disabled:i,absolute:r,round:o,isButtonTag:s}=t,a=s?"button":"div";return n.h(a,{type:s?"button":void 0,tabindex:i||!t.focusable?-1:0,"aria-disabled":i,"aria-label":"close",role:s?void 0:"button",disabled:i,class:[`${e}-base-close`,r&&`${e}-base-close--absolute`,i&&`${e}-base-close--disabled`,o&&`${e}-base-close--round`],onMousedown:l=>{t.focusable||l.preventDefault()},onClick:t.onClick},n.h(Kr,{clsPrefix:e},{default:()=>n.h(H2,null)}))}}}),K2=n.defineComponent({props:{onFocus:Function,onBlur:Function},setup(t){return()=>n.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:t.onFocus,onBlur:t.onBlur})}}),G2=he([he("@keyframes rotator",`
|
|
206
206
|
0% {
|
|
207
207
|
-webkit-transform: rotate(0deg);
|
|
208
208
|
transform: rotate(0deg);
|
|
@@ -229,7 +229,7 @@ ${o}
|
|
|
229
229
|
`,[ke("icon",`
|
|
230
230
|
height: 1em;
|
|
231
231
|
width: 1em;
|
|
232
|
-
`)])])]),il="1.6s",
|
|
232
|
+
`)])])]),il="1.6s",Z2={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},Ch=n.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Z2),setup(t){us("-base-loading",G2,n.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:i,stroke:r,scale:o}=this,s=e/o;return n.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},n.h(kh,null,{default:()=>this.show?n.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},n.h("div",{class:`${t}-base-loading__container`},n.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*s} ${2*s}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},n.h("g",null,n.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};270 ${s} ${s}`,begin:"0s",dur:il,fill:"freeze",repeatCount:"indefinite"}),n.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":i,"stroke-linecap":"round",cx:s,cy:s,r:e-i/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},n.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};135 ${s} ${s};450 ${s} ${s}`,begin:"0s",dur:il,fill:"freeze",repeatCount:"indefinite"}),n.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:il,fill:"freeze",repeatCount:"indefinite"})))))):n.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Sh}=Ur;function Q2({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:i="0.2s",enterCubicBezier:r=Sh,leaveCubicBezier:o=Sh}={}){return[he(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),he(`&.${t}-transition-leave-active`,{transition:`all ${i} ${o}!important`}),he(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),he(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const ye={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},J2=Ti(ye.neutralBase),Bh=Ti(ye.neutralInvertBase),eS=`rgba(${Bh.slice(0,3).join(", ")}, `;function Nh(t){return`${eS+String(t)})`}function Tt(t){const e=Array.from(Bh);return e[3]=Number(t),Xk(J2,e)}const Ai=Object.assign(Object.assign({name:"common"},Ur),{baseColor:ye.neutralBase,primaryColor:ye.primaryDefault,primaryColorHover:ye.primaryHover,primaryColorPressed:ye.primaryActive,primaryColorSuppl:ye.primarySuppl,infoColor:ye.infoDefault,infoColorHover:ye.infoHover,infoColorPressed:ye.infoActive,infoColorSuppl:ye.infoSuppl,successColor:ye.successDefault,successColorHover:ye.successHover,successColorPressed:ye.successActive,successColorSuppl:ye.successSuppl,warningColor:ye.warningDefault,warningColorHover:ye.warningHover,warningColorPressed:ye.warningActive,warningColorSuppl:ye.warningSuppl,errorColor:ye.errorDefault,errorColorHover:ye.errorHover,errorColorPressed:ye.errorActive,errorColorSuppl:ye.errorSuppl,textColorBase:ye.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:Tt(ye.alpha4),placeholderColor:Tt(ye.alpha4),placeholderColorDisabled:Tt(ye.alpha5),iconColor:Tt(ye.alpha4),iconColorHover:Uo(Tt(ye.alpha4),{lightness:.75}),iconColorPressed:Uo(Tt(ye.alpha4),{lightness:.9}),iconColorDisabled:Tt(ye.alpha5),opacity1:ye.alpha1,opacity2:ye.alpha2,opacity3:ye.alpha3,opacity4:ye.alpha4,opacity5:ye.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:Tt(Number(ye.alphaClose)),closeIconColorHover:Tt(Number(ye.alphaClose)),closeIconColorPressed:Tt(Number(ye.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:Tt(ye.alpha4),clearColorHover:Uo(Tt(ye.alpha4),{lightness:.75}),clearColorPressed:Uo(Tt(ye.alpha4),{lightness:.9}),scrollbarColor:Nh(ye.alphaScrollbar),scrollbarColorHover:Nh(ye.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Tt(ye.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ye.neutralPopover,tableColor:ye.neutralCard,cardColor:ye.neutralCard,modalColor:ye.neutralModal,bodyColor:ye.neutralBody,tagColor:"#eee",avatarColor:Tt(ye.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:Tt(ye.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ye.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),tS={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function nS(t){const{scrollbarColor:e,scrollbarColorHover:i,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:s}=t;return Object.assign(Object.assign({},tS),{height:r,width:o,borderRadius:s,color:e,colorHover:i})}const rl={name:"Scrollbar",common:Ai,self:nS},iS=be("scrollbar",`
|
|
233
233
|
overflow: hidden;
|
|
234
234
|
position: relative;
|
|
235
235
|
z-index: auto;
|
|
@@ -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
|
-
`,[Z2(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),iS=Object.assign(Object.assign({},Tt.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"}}),Nh=n.defineComponent({name:"Scrollbar",props:iS,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedRtlRef:r}=Mi(t),o=Yr("Scrollbar",r,e),s=n.ref(null),a=n.ref(null),l=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),h=n.ref(null),f=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,C=!1,N,w,S=0,v=0,$=0,E=0;const F=Fv(),P=Tt("Scrollbar","-scrollbar",nS,rl,t,e),I=n.computed(()=>{const{value:D}=f,{value:Q}=u,{value:se}=p;return D===null||Q===null||se===null?0:Math.min(D,se*D/Q+Ar(P.value.self.width)*1.5)}),K=n.computed(()=>`${I.value}px`),J=n.computed(()=>{const{value:D}=m,{value:Q}=h,{value:se}=g;return D===null||Q===null||se===null?0:se*D/Q+Ar(P.value.self.height)*1.5}),Z=n.computed(()=>`${J.value}px`),L=n.computed(()=>{const{value:D}=f,{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}}),A=n.computed(()=>`${L.value}px`),O=n.computed(()=>{const{value:D}=m,{value:Q}=y,{value:se}=h,{value:me}=g;if(D===null||se===null||me===null)return 0;{const ge=se-D;return ge?Q/ge*(me-J.value):0}}),V=n.computed(()=>`${O.value}px`),R=n.computed(()=>{const{value:D}=f,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),H=n.computed(()=>{const{value:D}=m,{value:Q}=h;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():a.value}),W=n.computed(()=>{const{content:D}=t;return D?D():l.value}),j=(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:Se,behavior:Te,el:Je,debounce:Mn=!0}=D;(se!==void 0||me!==void 0)&&_e(se??0,me??0,0,!1,Te),Je!==void 0?_e(0,Je.offsetTop,Je.offsetHeight,Mn,Te):ge!==void 0&&xe!==void 0?_e(0,ge*xe,xe,Mn,Te):Se==="bottom"?_e(0,Number.MAX_SAFE_INTEGER,0,!1,Te):Se==="top"&&_e(0,0,0,!1,Te)},ae=DC(()=>{t.container||j({top:b.value,left:y.value})}),de=()=>{ae.isDeactivated||ce()},ve=D=>{if(ae.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:Se,offsetHeight:Te}=xe;if(Q>Se){Q+se<=Se+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(){$e()}function $e(){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),an()}function an(){const{value:D}=X;D&&(b.value=D.scrollTop,y.value=D.scrollLeft*(o!=null&&o.value?-1:1))}function Ve(){const{value:D}=W;D&&(u.value=D.offsetHeight,h.value=D.offsetWidth);const{value:Q}=X;Q&&(f.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),f.value=D.offsetHeight,m.value=D.offsetWidth,u.value=D.scrollHeight,h.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():(Ve(),an()))}function Le(D){var Q;return!(!((Q=s.value)===null||Q===void 0)&&Q.contains(Ir(D)))}function mi(D){D.preventDefault(),D.stopPropagation(),C=!0,It("mousemove",window,lt,!0),It("mouseup",window,Qt,!0),v=y.value,$=o!=null&&o.value?window.innerWidth-D.clientX:D.clientX}function lt(D){if(!C)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:Q}=m,{value:se}=h,{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),Se=se-Q;let Te=v+xe;Te=Math.min(Se,Te),Te=Math.max(Te,0);const{value:Je}=X;if(Je){Je.scrollLeft=Te*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Mn}=t;Mn&&Mn(Te)}}function Qt(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,lt,!0),ht("mouseup",window,Qt,!0),C=!1,ce(),Le(D)&&$e()}function gr(D){D.preventDefault(),D.stopPropagation(),x=!0,It("mousemove",window,pi,!0),It("mouseup",window,Li,!0),S=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}=f,{value:se}=u,{value:me}=I;if(Q===null||se===null)return;const xe=(D.clientY-E)*(se-Q)/(Q-me),Se=se-Q;let Te=S+xe;Te=Math.min(Se,Te),Te=Math.max(Te,0);const{value:Je}=X;Je&&(Je.scrollTop=Te)}function Li(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,pi,!0),ht("mouseup",window,Li,!0),x=!1,ce(),Le(D)&&$e()}n.watchEffect(()=>{const{value:D}=H,{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,Li,!0)});const yr=n.computed(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:se,height:me,width:ge,borderRadius:xe,railInsetHorizontalTop:Se,railInsetHorizontalBottom:Te,railInsetVerticalRight:Je,railInsetVerticalLeft:Mn,railColor:fl}}=P.value,{top:hl,right:ml,bottom:pl,left:gl}=hn(Se),{top:yl,right:bl,bottom:_l,left:wl}=hn(Te),{top:xl,right:kl,bottom:vl,left:Cl}=hn(o!=null&&o.value?dh(Je):Je),{top:Sl,right:Bl,bottom:Tl,left:Nl}=hn(o!=null&&o.value?dh(Mn):Mn);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":hl,"--n-scrollbar-rail-right-horizontal-top":ml,"--n-scrollbar-rail-bottom-horizontal-top":pl,"--n-scrollbar-rail-left-horizontal-top":gl,"--n-scrollbar-rail-top-horizontal-bottom":yl,"--n-scrollbar-rail-right-horizontal-bottom":bl,"--n-scrollbar-rail-bottom-horizontal-bottom":_l,"--n-scrollbar-rail-left-horizontal-bottom":wl,"--n-scrollbar-rail-top-vertical-right":xl,"--n-scrollbar-rail-right-vertical-right":kl,"--n-scrollbar-rail-bottom-vertical-right":vl,"--n-scrollbar-rail-left-vertical-right":Cl,"--n-scrollbar-rail-top-vertical-left":Sl,"--n-scrollbar-rail-right-vertical-left":Bl,"--n-scrollbar-rail-bottom-vertical-left":Tl,"--n-scrollbar-rail-left-vertical-left":Nl,"--n-scrollbar-rail-color":fl}}),bn=i?Ii("scrollbar",void 0,yr,t):void 0;return Object.assign(Object.assign({},{scrollTo:j,scrollBy:st,sync:ce,syncUnifiedContainer:te,handleMouseEnterWrapper:we,handleMouseLeaveWrapper:xt}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:R,needXBar:H,yBarSizePx:K,xBarSizePx:Z,yBarTopPx:A,xBarLeftPx:V,isShowXBar:U,isShowYBar:G,isIos:F,handleScroll:yn,handleContentResize:de,handleContainerResize:ve,handleYScrollMouseDown:gr,handleXScrollMouseDown:mi,cssVars:i?void 0:yr,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:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",u=(m,p)=>n.h("div",{ref:"yRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--vertical`,`${i}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[p||"",this.verticalRailStyle],"aria-hidden":!0},n.h(d?el: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})),h=()=>{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(ls,{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--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},n.h(d?el: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}))])},f=this.container?h():n.h(ls,{onResize:this.handleContainerResize},{default:h});return s?n.h(n.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),rS=Nh,oS={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function sS(t){const{textColorDisabled:e,iconColor:i,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},oS),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:i,extraTextColor:r})}const $h={name:"Empty",common:Ai,self:sS},aS=be("empty",`
|
|
297
|
+
`,[Q2(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),rS=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"}}),Th=n.defineComponent({name:"Scrollbar",props:rS,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedRtlRef:r}=Mi(t),o=Yr("Scrollbar",r,e),s=n.ref(null),a=n.ref(null),l=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),h=n.ref(null),f=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,C=!1,T,w,S=0,v=0,$=0,E=0;const F=Vv(),P=Nt("Scrollbar","-scrollbar",iS,rl,t,e),I=n.computed(()=>{const{value:D}=f,{value:Q}=u,{value:se}=p;return D===null||Q===null||se===null?0:Math.min(D,se*D/Q+Ar(P.value.self.width)*1.5)}),K=n.computed(()=>`${I.value}px`),J=n.computed(()=>{const{value:D}=m,{value:Q}=h,{value:se}=g;return D===null||Q===null||se===null?0:se*D/Q+Ar(P.value.self.height)*1.5}),Z=n.computed(()=>`${J.value}px`),L=n.computed(()=>{const{value:D}=f,{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}}),A=n.computed(()=>`${L.value}px`),O=n.computed(()=>{const{value:D}=m,{value:Q}=y,{value:se}=h,{value:me}=g;if(D===null||se===null||me===null)return 0;{const ge=se-D;return ge?Q/ge*(me-J.value):0}}),V=n.computed(()=>`${O.value}px`),R=n.computed(()=>{const{value:D}=f,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),H=n.computed(()=>{const{value:D}=m,{value:Q}=h;return D!==null&&Q!==null&&Q>D}),Y=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():a.value}),W=n.computed(()=>{const{content:D}=t;return D?D():l.value}),j=(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:Se,behavior:Ne,el:Je,debounce:Mn=!0}=D;(se!==void 0||me!==void 0)&&_e(se??0,me??0,0,!1,Ne),Je!==void 0?_e(0,Je.offsetTop,Je.offsetHeight,Mn,Ne):ge!==void 0&&xe!==void 0?_e(0,ge*xe,xe,Mn,Ne):Se==="bottom"?_e(0,Number.MAX_SAFE_INTEGER,0,!1,Ne):Se==="top"&&_e(0,0,0,!1,Ne)},ae=LC(()=>{t.container||j({top:b.value,left:y.value})}),de=()=>{ae.isDeactivated||ce()},ve=D=>{if(ae.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:Se,offsetHeight:Ne}=xe;if(Q>Se){Q+se<=Se+Ne||xe.scrollTo({left:D,top:Q+se-Ne,behavior:ge});return}}xe.scrollTo({left:D,top:Q,behavior:ge})}}function we(){Rt(),Jn(),ce()}function xt(){$e()}function $e(){Zt(),gn()}function Zt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{k.value=!1},t.duration)}function gn(){T!==void 0&&window.clearTimeout(T),T=window.setTimeout(()=>{_.value=!1},t.duration)}function Rt(){T!==void 0&&window.clearTimeout(T),_.value=!0}function Jn(){w!==void 0&&window.clearTimeout(w),k.value=!0}function yn(D){const{onScroll:Q}=t;Q&&Q(D),an()}function an(){const{value:D}=X;D&&(b.value=D.scrollTop,y.value=D.scrollLeft*(o!=null&&o.value?-1:1))}function Ve(){const{value:D}=W;D&&(u.value=D.offsetHeight,h.value=D.offsetWidth);const{value:Q}=X;Q&&(f.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),f.value=D.offsetHeight,m.value=D.offsetWidth,u.value=D.scrollHeight,h.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():(Ve(),an()))}function Me(D){var Q;return!(!((Q=s.value)===null||Q===void 0)&&Q.contains(Ir(D)))}function mi(D){D.preventDefault(),D.stopPropagation(),C=!0,It("mousemove",window,lt,!0),It("mouseup",window,Qt,!0),v=y.value,$=o!=null&&o.value?window.innerWidth-D.clientX:D.clientX}function lt(D){if(!C)return;T!==void 0&&window.clearTimeout(T),w!==void 0&&window.clearTimeout(w);const{value:Q}=m,{value:se}=h,{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),Se=se-Q;let Ne=v+xe;Ne=Math.min(Se,Ne),Ne=Math.max(Ne,0);const{value:Je}=X;if(Je){Je.scrollLeft=Ne*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Mn}=t;Mn&&Mn(Ne)}}function Qt(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,lt,!0),ht("mouseup",window,Qt,!0),C=!1,ce(),Me(D)&&$e()}function gr(D){D.preventDefault(),D.stopPropagation(),x=!0,It("mousemove",window,pi,!0),It("mouseup",window,Li,!0),S=b.value,E=D.clientY}function pi(D){if(!x)return;T!==void 0&&window.clearTimeout(T),w!==void 0&&window.clearTimeout(w);const{value:Q}=f,{value:se}=u,{value:me}=I;if(Q===null||se===null)return;const xe=(D.clientY-E)*(se-Q)/(Q-me),Se=se-Q;let Ne=S+xe;Ne=Math.min(Se,Ne),Ne=Math.max(Ne,0);const{value:Je}=X;Je&&(Je.scrollTop=Ne)}function Li(D){D.preventDefault(),D.stopPropagation(),ht("mousemove",window,pi,!0),ht("mouseup",window,Li,!0),x=!1,ce(),Me(D)&&$e()}n.watchEffect(()=>{const{value:D}=H,{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(()=>{T!==void 0&&window.clearTimeout(T),w!==void 0&&window.clearTimeout(w),ht("mousemove",window,pi,!0),ht("mouseup",window,Li,!0)});const yr=n.computed(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:se,height:me,width:ge,borderRadius:xe,railInsetHorizontalTop:Se,railInsetHorizontalBottom:Ne,railInsetVerticalRight:Je,railInsetVerticalLeft:Mn,railColor:fl}}=P.value,{top:hl,right:ml,bottom:pl,left:gl}=hn(Se),{top:yl,right:bl,bottom:_l,left:wl}=hn(Ne),{top:xl,right:kl,bottom:vl,left:Cl}=hn(o!=null&&o.value?dh(Je):Je),{top:Sl,right:Bl,bottom:Nl,left:Tl}=hn(o!=null&&o.value?dh(Mn):Mn);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":hl,"--n-scrollbar-rail-right-horizontal-top":ml,"--n-scrollbar-rail-bottom-horizontal-top":pl,"--n-scrollbar-rail-left-horizontal-top":gl,"--n-scrollbar-rail-top-horizontal-bottom":yl,"--n-scrollbar-rail-right-horizontal-bottom":bl,"--n-scrollbar-rail-bottom-horizontal-bottom":_l,"--n-scrollbar-rail-left-horizontal-bottom":wl,"--n-scrollbar-rail-top-vertical-right":xl,"--n-scrollbar-rail-right-vertical-right":kl,"--n-scrollbar-rail-bottom-vertical-right":vl,"--n-scrollbar-rail-left-vertical-right":Cl,"--n-scrollbar-rail-top-vertical-left":Sl,"--n-scrollbar-rail-right-vertical-left":Bl,"--n-scrollbar-rail-bottom-vertical-left":Nl,"--n-scrollbar-rail-left-vertical-left":Tl,"--n-scrollbar-rail-color":fl}}),bn=i?Ii("scrollbar",void 0,yr,t):void 0;return Object.assign(Object.assign({},{scrollTo:j,scrollBy:st,sync:ce,syncUnifiedContainer:te,handleMouseEnterWrapper:we,handleMouseLeaveWrapper:xt}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:R,needXBar:H,yBarSizePx:K,xBarSizePx:Z,yBarTopPx:A,xBarLeftPx:V,isShowXBar:Y,isShowYBar:G,isIos:F,handleScroll:yn,handleContentResize:de,handleContainerResize:ve,handleYScrollMouseDown:gr,handleXScrollMouseDown:mi,cssVars:i?void 0:yr,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:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",u=(m,p)=>n.h("div",{ref:"yRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--vertical`,`${i}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[p||"",this.verticalRailStyle],"aria-hidden":!0},n.h(d?el: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})),h=()=>{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(ls,{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--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},n.h(d?el: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}))])},f=this.container?h():n.h(ls,{onResize:this.handleContainerResize},{default:h});return s?n.h(n.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),oS=Th,sS={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function aS(t){const{textColorDisabled:e,iconColor:i,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},sS),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:i,extraTextColor:r})}const $h={name:"Empty",common:Ai,self:aS},lS=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
|
-
`)]),
|
|
320
|
+
`)]),cS=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}),dS=n.defineComponent({name:"Empty",props:cS,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedComponentPropsRef:r}=Mi(t),o=Nt("Empty","-empty",lS,$h,t,e),{localeRef:s}=wh("Empty"),a=n.computed(()=>{var u,h,f;return(u=t.description)!==null&&u!==void 0?u:(f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.description}),l=n.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>n.h(W2,null))}),c=n.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[nt("iconSize",u)]:f,[nt("fontSize",u)]:m,textColor:p,iconColor:g,extraTextColor:b}}=o.value;return{"--n-icon-size":f,"--n-font-size":m,"--n-bezier":h,"--n-text-color":p,"--n-icon-color":g,"--n-extra-text-color":b}}),d=i?Ii("empty",n.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:n.computed(()=>a.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(Kr,{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)}}),uS={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 fS(t){const{borderRadius:e,popoverColor:i,textColor3:r,dividerColor:o,textColor2:s,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:m,fontSizeLarge:p,fontSizeHuge:g,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:k,heightHuge:x}=t;return Object.assign(Object.assign({},uS),{optionFontSizeTiny:h,optionFontSizeSmall:f,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:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:s,loadingColor:c})}const Eh={name:"InternalSelectMenu",common:Ai,peers:{Scrollbar:rl,Empty:$h},self:fS},Rh=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(Ua);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),a=e?e(o,!1):pr(o[this.labelField],o,!1),l=n.h("div",Object.assign({},s,{class:[`${t}-base-select-group-header`,s==null?void 0:s.class]}),a);return o.render?o.render({node:l,option:o}):i?i({node:l,option:o,selected:!1}):l}});function hS(t,e){return n.h(n.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?n.h(Kr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>n.h(z2)}):null})}const Ph=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:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:h,handleOptionMouseEnter:f}=n.inject(Ua),m=on(()=>{const{value:y}=i;return y?t.tmNode.key===y.key:!1});function p(y){const{tmNode:_}=t;_.disabled||h(y,_)}function g(y){const{tmNode:_}=t;_.disabled||f(y,_)}function b(y){const{tmNode:_}=t,{value:k}=m;_.disabled||k||f(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:l,renderLabel:s,renderOption:a,handleMouseMove:b,handleMouseEnter:g,handleClick:p}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:i,isPending:r,isGrouped:o,showCheckmark:s,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:h}=this,f=hS(i,t),m=c?[c(e,i),s&&f]:[pr(e[this.labelField],e,i),s&&f],p=a==null?void 0:a(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:Qa([d,p==null?void 0:p.onClick]),onMouseenter:Qa([u,p==null?void 0:p.onMouseenter]),onMousemove:Qa([h,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}):l?l({node:g,option:e,selected:i}):g}}),{cubicBezierEaseIn:Fh,cubicBezierEaseOut:Vh}=Ur;function Mh({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} ${Fh}, transform ${e} ${Fh} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Vh}, transform ${e} ${Vh} ${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 mS=be("base-select-menu",`
|
|
321
321
|
line-height: 1.5;
|
|
322
322
|
outline: none;
|
|
323
323
|
z-index: 0;
|
|
@@ -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
|
-
`,[Mh({enterScale:"0.5"})])])]),
|
|
427
|
+
`,[Mh({enterScale:"0.5"})])])]),pS=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}=Mi(t),r=Yr("InternalSelectMenu",i,e),o=Nt("InternalSelectMenu","-internal-select-menu",mS,Eh,t,n.toRef(t,"clsPrefix")),s=n.ref(null),a=n.ref(null),l=n.ref(null),c=n.computed(()=>t.treeMate.getFlattenedNodes()),d=n.computed(()=>av(c.value)),u=n.ref(null);function h(){const{treeMate:R}=t;let H=null;const{value:Y}=t;Y===null?H=R.getFirstAvailableNode():(t.multiple?H=R.getNode((Y||[])[(Y||[]).length-1]):H=R.getNode(Y),(!H||H.disabled)&&(H=R.getFirstAvailableNode())),I(H||null)}function f(){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?h():f(),n.nextTick(K)):f()},{immediate:!0}):m==null||m()},{immediate:!0}),n.onBeforeUnmount(()=>{m==null||m()});const p=n.computed(()=>Ar(o.value.self[nt("optionHeight",t.size)])),g=n.computed(()=>hn(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:H}=t;H&&H(R)}function k(R){const{onScroll:H}=t;H&&H(R)}function x(R){var H;(H=l.value)===null||H===void 0||H.sync(),k(R)}function C(){var R;(R=l.value)===null||R===void 0||R.sync()}function T(){const{value:R}=u;return R||null}function w(R,H){H.disabled||I(H,!1)}function S(R,H){H.disabled||_(H)}function v(R){var H;Mr(R,"action")||(H=t.onKeyup)===null||H===void 0||H.call(t,R)}function $(R){var H;Mr(R,"action")||(H=t.onKeydown)===null||H===void 0||H.call(t,R)}function E(R){var H;(H=t.onMousedown)===null||H===void 0||H.call(t,R),!t.focusable&&R.preventDefault()}function F(){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,H=!1){u.value=R,H&&K()}function K(){var R,H;const Y=u.value;if(!Y)return;const G=d.value(Y.key);G!==null&&(t.virtualScroll?(R=a.value)===null||R===void 0||R.scrollTo({index:G}):(H=l.value)===null||H===void 0||H.scrollTo({index:G,elSize:p.value}))}function J(R){var H,Y;!((H=s.value)===null||H===void 0)&&H.contains(R.target)&&((Y=t.onFocus)===null||Y===void 0||Y.call(t,R))}function Z(R){var H,Y;!((H=s.value)===null||H===void 0)&&H.contains(R.relatedTarget)||(Y=t.onBlur)===null||Y===void 0||Y.call(t,R)}n.provide(Ua,{handleOptionMouseEnter:w,handleOptionClick:S,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(nh,s),n.onMounted(()=>{const{value:R}=l;R&&R.sync()});const L=n.computed(()=>{const{size:R}=t,{common:{cubicBezierEaseInOut:H},self:{height:Y,borderRadius:G,color:X,groupHeaderTextColor:W,actionDividerColor:j,optionTextColorPressed:ae,optionTextColor:de,optionTextColorDisabled:ve,optionTextColorActive:st,optionOpacityDisabled:_e,optionCheckColor:we,actionTextColor:xt,optionColorPending:$e,optionColorActive:Zt,loadingColor:gn,loadingSize:Rt,optionColorActivePending:Jn,[nt("optionFontSize",R)]:yn,[nt("optionHeight",R)]:an,[nt("optionPadding",R)]:Ve}}=o.value;return{"--n-height":Y,"--n-action-divider-color":j,"--n-action-text-color":xt,"--n-bezier":H,"--n-border-radius":G,"--n-color":X,"--n-option-font-size":yn,"--n-group-header-text-color":W,"--n-option-check-color":we,"--n-option-color-pending":$e,"--n-option-color-active":Zt,"--n-option-color-active-pending":Jn,"--n-option-height":an,"--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":ae,"--n-option-padding":Ve,"--n-option-padding-left":hn(Ve,"left"),"--n-option-padding-right":hn(Ve,"right"),"--n-loading-color":gn,"--n-loading-size":Rt}}),{inlineThemeDisabled:A}=t,O=A?Ii("internal-select-menu",n.computed(()=>t.size[0]),L,t):void 0,V={selfRef:s,next:F,prev:P,getPendingTmNode:T};return ah(s,t.onResize),Object.assign({mergedTheme:o,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:p,padding:g,flattenedNodes:c,empty:y,virtualListContainer(){const{value:R}=a;return R==null?void 0:R.listElRef},virtualListContent(){const{value:R}=a;return R==null?void 0:R.itemsElRef},doScroll:k,handleFocusin:J,handleFocusout:Z,handleKeyUp:v,handleKeyDown:$,handleMouseDown:E,handleVirtualListResize:C,handleVirtualListScroll:x,cssVars:A?void 0:L,themeClass:O==null?void 0:O.themeClass,onRender:O==null?void 0:O.onRender},V)},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},Fi(t.header,a=>a&&n.h("div",{class:`${i}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?n.h("div",{class:`${i}-base-select-menu__loading`},n.h(Ch,{clsPrefix:i,strokeWidth:20})):this.empty?n.h("div",{class:`${i}-base-select-menu__empty`,"data-empty":!0},Ja(t.empty,()=>[n.h(dS,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):n.h(Th,{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(AC,{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:a})=>a.isGroup?n.h(Rh,{key:a.key,clsPrefix:i,tmNode:a}):a.ignored?null:n.h(Ph,{clsPrefix:i,key:a.key,tmNode:a})}):n.h("div",{class:`${i}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?n.h(Rh,{key:a.key,clsPrefix:i,tmNode:a}):n.h(Ph,{clsPrefix:i,key:a.key,tmNode:a})))}),Fi(t.action,a=>a&&[n.h("div",{class:`${i}-base-select-menu__action`,"data-action":!0,key:"action"},a),n.h(K2,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),gS={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function yS(t){const{boxShadow2:e,popoverColor:i,textColor2:r,borderRadius:o,fontSize:s,dividerColor:a}=t;return Object.assign(Object.assign({},gS),{fontSize:s,borderRadius:o,color:i,dividerColor:a,textColor:r,boxShadow:e})}const Ih={name:"Popover",common:Ai,peers:{Scrollbar:rl},self:yS},ol={top:"bottom",bottom:"top",left:"right",right:"left"},mt="var(--n-arrow-height) * 1.414",bS=he([be("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -532,7 +532,7 @@ ${o}
|
|
|
532
532
|
margin-${ol[i]}: var(--n-space-arrow);
|
|
533
533
|
`),Re("overlap",`
|
|
534
534
|
margin: 0;
|
|
535
|
-
`),
|
|
535
|
+
`),YC("popover-arrow-wrapper",`
|
|
536
536
|
right: 0;
|
|
537
537
|
left: 0;
|
|
538
538
|
top: 0;
|
|
@@ -540,7 +540,7 @@ ${o}
|
|
|
540
540
|
${i}: 100%;
|
|
541
541
|
${ol[i]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[be("popover-arrow",e)])])])}const Ah=Object.assign(Object.assign({},Tt.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 bS({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 _S=n.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Ah,setup(t,{slots:e,attrs:i}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:a}=Mi(t),l=Tt("Popover","-popover",yS,Ih,t,o),c=Yr("Popover",a,o),d=n.ref(null),u=n.inject("NPopover"),h=n.ref(null),f=n.ref(t.show),m=n.ref(!1);n.watchEffect(()=>{const{show:v}=t;v&&!YC()&&!t.internalDeactivateImmediately&&(m.value=!0)});const p=n.computed(()=>{const{trigger:v,onClickoutside:$}=t,E=[],{positionManuallyRef:{value:F}}=u;return F||(v==="click"&&!$&&E.push([Qo,N,void 0,{capture:!0}]),v==="hover"&&E.push([Bv,C])),$&&E.push([Qo,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:v,cubicBezierEaseIn:$,cubicBezierEaseOut:E},self:{space:F,spaceArrow:P,padding:I,fontSize:K,textColor:J,dividerColor:Z,color:L,boxShadow:A,borderRadius:O,arrowHeight:V,arrowOffset:R,arrowOffsetVertical:H}}=l.value;return{"--n-box-shadow":A,"--n-bezier":v,"--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":O,"--n-arrow-height":V,"--n-arrow-offset":R,"--n-arrow-offset-vertical":H,"--n-padding":I,"--n-space":F,"--n-space-arrow":P}}),b=n.computed(()=>{const v=t.width==="trigger"?void 0:Ka(t.width),$=[];v&&$.push({width:v});const{maxWidth:E,minWidth:F}=t;return E&&$.push({maxWidth:Ka(E)}),F&&$.push({maxWidth:Ka(F)}),s||$.push(g.value),$}),y=s?Ii("popover",void 0,g,t):void 0;u.setBodyInstance({syncPosition:_}),n.onBeforeUnmount(()=>{u.setBodyInstance(null)}),n.watch(n.toRef(t,"show"),v=>{t.animated||(v?f.value=!0:f.value=!1)});function _(){var v;(v=d.value)===null||v===void 0||v.syncPosition()}function k(v){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(v)}function x(v){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(v)}function C(v){t.trigger==="hover"&&!w().contains(Ir(v))&&u.handleMouseMoveOutside(v)}function N(v){(t.trigger==="click"&&!w().contains(Ir(v))||t.onClickoutside)&&u.handleClickOutside(v)}function w(){return u.getTriggerElement()}n.provide(oh,h),n.provide(ih,null),n.provide(rh,null);function S(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let $;const E=u.internalRenderBodyRef.value,{value:F}=o;if(E)$=E([`${F}-popover-shared`,(c==null?void 0:c.value)&&`${F}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${F}-popover-shared--overlap`,t.showArrow&&`${F}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${F}-popover-shared--center-arrow`],h,b.value,k,x);else{const{value:P}=u.extraClassRef,{internalTrapFocus:I}=t,K=!bh(e.header)||!bh(e.footer),J=()=>{var Z,L;const A=K?n.h(n.Fragment,null,Fi(e.header,R=>R?n.h("div",{class:[`${F}-popover__header`,t.headerClass],style:t.headerStyle},R):null),Fi(e.default,R=>R?n.h("div",{class:[`${F}-popover__content`,t.contentClass],style:t.contentStyle},e):null),Fi(e.footer,R=>R?n.h("div",{class:[`${F}-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:[`${F}-popover__content`,t.contentClass],style:t.contentStyle},e),O=t.scrollable?n.h(rS,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:K?void 0:`${F}-popover__content ${(L=t.contentClass)!==null&&L!==void 0?L:""}`,contentStyle:K?void 0:t.contentStyle},{default:()=>A}):A,V=t.showArrow?bS({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:F}):null;return[O,V]};$=n.h("div",n.mergeProps({class:[`${F}-popover`,`${F}-popover-shared`,(c==null?void 0:c.value)&&`${F}-popover--rtl`,y==null?void 0:y.themeClass.value,P.map(Z=>`${F}-${Z}`),{[`${F}-popover--scrollable`]:t.scrollable,[`${F}-popover--show-header-or-footer`]:K,[`${F}-popover--raw`]:t.raw,[`${F}-popover-shared--overlap`]:t.overlap,[`${F}-popover-shared--show-arrow`]:t.showArrow,[`${F}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:b.value,onKeydown:u.handleKeydown,onMouseenter:k,onMouseleave:x},i),I?n.h(zC,{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:f,renderContentNode:S}},render(){return n.h(Pf,{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 wS={};const xS=Object.keys(Ah),kS={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function vS(t,e,i){kS[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]=(...a)=>{o(...a),s(...a)}:t.props[r]=s})}const CS={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},SS=Object.assign(Object.assign(Object.assign({},Tt.props),CS),{internalOnAfterLeave:Function,internalRenderBody:Function}),BS=n.defineComponent({name:"Popover",inheritAttrs:!1,props:SS,slots:Object,__popover__:!0,setup(t){wS.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=Jo(),i=n.ref(null),r=n.computed(()=>t.show),o=n.ref(t.defaultShow),s=Ma(r,o),a=on(()=>t.disabled?!1:s.value),l=()=>{if(t.disabled)return!0;const{getDisabled:K}=t;return!!(K!=null&&K())},c=()=>l()?!1:s.value,d=ff(t,["arrow","showArrow"]),u=n.computed(()=>t.overlap?!1:d.value);let h=null;const f=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:A}=t;o.value=K,J&&Bt(J,K),Z&&Bt(Z,K),K&&L&&Bt(L,!0),K&&A&&Bt(A,!1)}function b(){h&&h.syncPosition()}function y(){const{value:K}=f;K&&(window.clearTimeout(K),f.value=null)}function _(){const{value:K}=m;K&&(window.clearTimeout(K),m.value=null)}function k(){const K=l();if(t.trigger==="focus"&&!K){if(c())return;g(!0)}}function x(){const K=l();if(t.trigger==="focus"&&!K){if(!c())return;g(!1)}}function C(){const K=l();if(t.trigger==="hover"&&!K){if(_(),f.value!==null||c())return;const J=()=>{g(!0),f.value=null},{delay:Z}=t;Z===0?J():f.value=window.setTimeout(J,Z)}}function N(){const K=l();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 S(K){var J;c()&&(t.trigger==="click"&&(y(),_(),g(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,K))}function v(){if(t.trigger==="click"&&!l()){y(),_();const K=!c();g(K)}}function $(K){t.internalTrapFocus&&K.key==="Escape"&&(y(),_(),g(!1))}function E(K){o.value=K}function F(){var K;return(K=i.value)===null||K===void 0?void 0:K.targetRef}function P(K){h=K}return n.provide("NPopover",{getTriggerElement:F,handleKeydown:$,handleMouseEnter:C,handleMouseLeave:N,handleClickOutside:S,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&&l()&&g(!1)}),{binderInstRef:i,positionManually:p,mergedShowConsideringDisabledProp:a,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:E,handleClick:v,handleMouseEnter:C,handleMouseLeave:N,handleFocus:k,handleBlur:x,syncPosition:b}},render(){var t;const{positionManually:e,$slots:i}=this;let r,o=!1;if(!e&&(r=GC(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:a}=this,l=[s,...a],c={onBlur:d=>{l.forEach(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};vS(r,a?"nested":e?"manual":this.trigger,c)}}return n.h(gf,{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}}),[[uf,{enabled:s,zIndex:this.zIndex}]]):null,e?null:n.h(yf,null,{default:()=>r}),n.h(_S,ZC(this.$props,xS,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:s})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),TS={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 NS(t){const{textColor2:e,primaryColorHover:i,primaryColorPressed:r,primaryColor:o,infoColor:s,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:f,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:x,heightMini:C,heightTiny:N,heightSmall:w,heightMedium:S,closeColorHover:v,closeColorPressed:$,buttonColor2Hover:E,buttonColor2Pressed:F,fontWeightStrong:P}=t;return Object.assign(Object.assign({},TS),{closeBorderRadius:b,heightTiny:C,heightSmall:N,heightMedium:w,heightLarge:S,borderRadius:b,opacityDisabled:h,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:k,fontSizeLarge:x,fontWeightStrong:P,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:F,colorChecked:o,colorCheckedHover:i,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,closeColorHover:v,closeColorPressed:$,borderPrimary:`1px solid ${De(o,{alpha:.3})}`,textColorPrimary:o,colorPrimary:De(o,{alpha:.12}),colorBorderedPrimary:De(o,{alpha:.1}),closeIconColorPrimary:o,closeIconColorHoverPrimary:o,closeIconColorPressedPrimary:o,closeColorHoverPrimary:De(o,{alpha:.12}),closeColorPressedPrimary:De(o,{alpha:.18}),borderInfo:`1px solid ${De(s,{alpha:.3})}`,textColorInfo:s,colorInfo:De(s,{alpha:.12}),colorBorderedInfo:De(s,{alpha:.1}),closeIconColorInfo:s,closeIconColorHoverInfo:s,closeIconColorPressedInfo:s,closeColorHoverInfo:De(s,{alpha:.12}),closeColorPressedInfo:De(s,{alpha:.18}),borderSuccess:`1px solid ${De(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:De(a,{alpha:.12}),colorBorderedSuccess:De(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:De(a,{alpha:.12}),closeColorPressedSuccess:De(a,{alpha:.18}),borderWarning:`1px solid ${De(l,{alpha:.35})}`,textColorWarning:l,colorWarning:De(l,{alpha:.15}),colorBorderedWarning:De(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:De(l,{alpha:.12}),closeColorPressedWarning:De(l,{alpha:.18}),borderError:`1px solid ${De(c,{alpha:.23})}`,textColorError:c,colorError:De(c,{alpha:.1}),colorBorderedError:De(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:De(c,{alpha:.12}),closeColorPressedError:De(c,{alpha:.18})})}const $S={common:Ai,self:NS},ES={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},RS=be("tag",`
|
|
543
|
+
`,[be("popover-arrow",e)])])])}const Ah=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 _S({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 wS=n.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Ah,setup(t,{slots:e,attrs:i}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:a}=Mi(t),l=Nt("Popover","-popover",bS,Ih,t,o),c=Yr("Popover",a,o),d=n.ref(null),u=n.inject("NPopover"),h=n.ref(null),f=n.ref(t.show),m=n.ref(!1);n.watchEffect(()=>{const{show:v}=t;v&&!UC()&&!t.internalDeactivateImmediately&&(m.value=!0)});const p=n.computed(()=>{const{trigger:v,onClickoutside:$}=t,E=[],{positionManuallyRef:{value:F}}=u;return F||(v==="click"&&!$&&E.push([Qo,T,void 0,{capture:!0}]),v==="hover"&&E.push([Nv,C])),$&&E.push([Qo,T,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&E.push([n.vShow,t.show]),E}),g=n.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:$,cubicBezierEaseOut:E},self:{space:F,spaceArrow:P,padding:I,fontSize:K,textColor:J,dividerColor:Z,color:L,boxShadow:A,borderRadius:O,arrowHeight:V,arrowOffset:R,arrowOffsetVertical:H}}=l.value;return{"--n-box-shadow":A,"--n-bezier":v,"--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":O,"--n-arrow-height":V,"--n-arrow-offset":R,"--n-arrow-offset-vertical":H,"--n-padding":I,"--n-space":F,"--n-space-arrow":P}}),b=n.computed(()=>{const v=t.width==="trigger"?void 0:Ka(t.width),$=[];v&&$.push({width:v});const{maxWidth:E,minWidth:F}=t;return E&&$.push({maxWidth:Ka(E)}),F&&$.push({maxWidth:Ka(F)}),s||$.push(g.value),$}),y=s?Ii("popover",void 0,g,t):void 0;u.setBodyInstance({syncPosition:_}),n.onBeforeUnmount(()=>{u.setBodyInstance(null)}),n.watch(n.toRef(t,"show"),v=>{t.animated||(v?f.value=!0:f.value=!1)});function _(){var v;(v=d.value)===null||v===void 0||v.syncPosition()}function k(v){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(v)}function x(v){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(v)}function C(v){t.trigger==="hover"&&!w().contains(Ir(v))&&u.handleMouseMoveOutside(v)}function T(v){(t.trigger==="click"&&!w().contains(Ir(v))||t.onClickoutside)&&u.handleClickOutside(v)}function w(){return u.getTriggerElement()}n.provide(oh,h),n.provide(ih,null),n.provide(rh,null);function S(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let $;const E=u.internalRenderBodyRef.value,{value:F}=o;if(E)$=E([`${F}-popover-shared`,(c==null?void 0:c.value)&&`${F}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${F}-popover-shared--overlap`,t.showArrow&&`${F}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${F}-popover-shared--center-arrow`],h,b.value,k,x);else{const{value:P}=u.extraClassRef,{internalTrapFocus:I}=t,K=!bh(e.header)||!bh(e.footer),J=()=>{var Z,L;const A=K?n.h(n.Fragment,null,Fi(e.header,R=>R?n.h("div",{class:[`${F}-popover__header`,t.headerClass],style:t.headerStyle},R):null),Fi(e.default,R=>R?n.h("div",{class:[`${F}-popover__content`,t.contentClass],style:t.contentStyle},e):null),Fi(e.footer,R=>R?n.h("div",{class:[`${F}-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:[`${F}-popover__content`,t.contentClass],style:t.contentStyle},e),O=t.scrollable?n.h(oS,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:K?void 0:`${F}-popover__content ${(L=t.contentClass)!==null&&L!==void 0?L:""}`,contentStyle:K?void 0:t.contentStyle},{default:()=>A}):A,V=t.showArrow?_S({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:F}):null;return[O,V]};$=n.h("div",n.mergeProps({class:[`${F}-popover`,`${F}-popover-shared`,(c==null?void 0:c.value)&&`${F}-popover--rtl`,y==null?void 0:y.themeClass.value,P.map(Z=>`${F}-${Z}`),{[`${F}-popover--scrollable`]:t.scrollable,[`${F}-popover--show-header-or-footer`]:K,[`${F}-popover--raw`]:t.raw,[`${F}-popover-shared--overlap`]:t.overlap,[`${F}-popover-shared--show-arrow`]:t.showArrow,[`${F}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:b.value,onKeydown:u.handleKeydown,onMouseenter:k,onMouseleave:x},i),I?n.h(DC,{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:f,renderContentNode:S}},render(){return n.h(Pf,{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 xS={};const kS=Object.keys(Ah),vS={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function CS(t,e,i){vS[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]=(...a)=>{o(...a),s(...a)}:t.props[r]=s})}const SS={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},BS=Object.assign(Object.assign(Object.assign({},Nt.props),SS),{internalOnAfterLeave:Function,internalRenderBody:Function}),NS=n.defineComponent({name:"Popover",inheritAttrs:!1,props:BS,slots:Object,__popover__:!0,setup(t){xS.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=Jo(),i=n.ref(null),r=n.computed(()=>t.show),o=n.ref(t.defaultShow),s=Ma(r,o),a=on(()=>t.disabled?!1:s.value),l=()=>{if(t.disabled)return!0;const{getDisabled:K}=t;return!!(K!=null&&K())},c=()=>l()?!1:s.value,d=ff(t,["arrow","showArrow"]),u=n.computed(()=>t.overlap?!1:d.value);let h=null;const f=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:A}=t;o.value=K,J&&Bt(J,K),Z&&Bt(Z,K),K&&L&&Bt(L,!0),K&&A&&Bt(A,!1)}function b(){h&&h.syncPosition()}function y(){const{value:K}=f;K&&(window.clearTimeout(K),f.value=null)}function _(){const{value:K}=m;K&&(window.clearTimeout(K),m.value=null)}function k(){const K=l();if(t.trigger==="focus"&&!K){if(c())return;g(!0)}}function x(){const K=l();if(t.trigger==="focus"&&!K){if(!c())return;g(!1)}}function C(){const K=l();if(t.trigger==="hover"&&!K){if(_(),f.value!==null||c())return;const J=()=>{g(!0),f.value=null},{delay:Z}=t;Z===0?J():f.value=window.setTimeout(J,Z)}}function T(){const K=l();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(){T()}function S(K){var J;c()&&(t.trigger==="click"&&(y(),_(),g(!1)),(J=t.onClickoutside)===null||J===void 0||J.call(t,K))}function v(){if(t.trigger==="click"&&!l()){y(),_();const K=!c();g(K)}}function $(K){t.internalTrapFocus&&K.key==="Escape"&&(y(),_(),g(!1))}function E(K){o.value=K}function F(){var K;return(K=i.value)===null||K===void 0?void 0:K.targetRef}function P(K){h=K}return n.provide("NPopover",{getTriggerElement:F,handleKeydown:$,handleMouseEnter:C,handleMouseLeave:T,handleClickOutside:S,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&&l()&&g(!1)}),{binderInstRef:i,positionManually:p,mergedShowConsideringDisabledProp:a,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:E,handleClick:v,handleMouseEnter:C,handleMouseLeave:T,handleFocus:k,handleBlur:x,syncPosition:b}},render(){var t;const{positionManually:e,$slots:i}=this;let r,o=!1;if(!e&&(r=ZC(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:a}=this,l=[s,...a],c={onBlur:d=>{l.forEach(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};CS(r,a?"nested":e?"manual":this.trigger,c)}}return n.h(gf,{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}}),[[uf,{enabled:s,zIndex:this.zIndex}]]):null,e?null:n.h(yf,null,{default:()=>r}),n.h(wS,QC(this.$props,kS,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:s})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),TS={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 $S(t){const{textColor2:e,primaryColorHover:i,primaryColorPressed:r,primaryColor:o,infoColor:s,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:f,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:x,heightMini:C,heightTiny:T,heightSmall:w,heightMedium:S,closeColorHover:v,closeColorPressed:$,buttonColor2Hover:E,buttonColor2Pressed:F,fontWeightStrong:P}=t;return Object.assign(Object.assign({},TS),{closeBorderRadius:b,heightTiny:C,heightSmall:T,heightMedium:w,heightLarge:S,borderRadius:b,opacityDisabled:h,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:k,fontSizeLarge:x,fontWeightStrong:P,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:F,colorChecked:o,colorCheckedHover:i,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,closeColorHover:v,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(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Le(a,{alpha:.12}),colorBorderedSuccess:Le(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Le(a,{alpha:.12}),closeColorPressedSuccess:Le(a,{alpha:.18}),borderWarning:`1px solid ${Le(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Le(l,{alpha:.15}),colorBorderedWarning:Le(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Le(l,{alpha:.12}),closeColorPressedWarning:Le(l,{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 ES={common:Ai,self:$S},RS={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},PS=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;
|
|
@@ -610,7 +610,7 @@ ${o}
|
|
|
610
610
|
`,[mn("disabled",[he("&:hover","background-color: var(--n-color-hover-checkable);",[mn("checked","color: var(--n-text-color-hover-checkable);")]),he("&:active","background-color: var(--n-color-pressed-checkable);",[mn("checked","color: var(--n-text-color-pressed-checkable);")])]),Re("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[mn("disabled",[he("&:hover","background-color: var(--n-color-checked-hover);"),he("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var
|
|
613
|
+
`,[mn("disabled",[he("&:hover","background-color: var(--n-color-checked-hover);"),he("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var FS={};const VS=Object.assign(Object.assign(Object.assign({},Nt.props),RS),{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}),MS="n-tag",sl=n.defineComponent({name:"Tag",props:VS,slots:Object,setup(t){FS.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}=Mi(t),a=Nt("Tag","-tag",PS,ES,t,r);n.provide(MS,{roundRef:n.toRef(t,"round")});function l(){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=Yr("Tag",s,r),h=n.computed(()=>{const{type:m,size:p,color:{color:g,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:k,borderRadius:x,opacityDisabled:C,textColorCheckable:T,textColorHoverCheckable:w,textColorPressedCheckable:S,textColorChecked:v,colorCheckable:$,colorHoverCheckable:E,colorPressedCheckable:F,colorChecked:P,colorCheckedHover:I,colorCheckedPressed:K,closeBorderRadius:J,fontWeightStrong:Z,[nt("colorBordered",m)]:L,[nt("closeSize",p)]:A,[nt("closeIconSize",p)]:O,[nt("fontSize",p)]:V,[nt("height",p)]:R,[nt("color",m)]:H,[nt("textColor",m)]:Y,[nt("border",m)]:G,[nt("closeIconColor",m)]:X,[nt("closeIconColorHover",m)]:W,[nt("closeIconColorPressed",m)]:j,[nt("closeColorHover",m)]:ae,[nt("closeColorPressed",m)]:de}}=a.value,ve=hn(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":O,"--n-close-color-pressed":de,"--n-close-color-hover":ae,"--n-close-border-radius":J,"--n-close-icon-color":X,"--n-close-icon-color-hover":W,"--n-close-icon-color-pressed":j,"--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":A,"--n-color":g||(i.value?L:H),"--n-color-checkable":$,"--n-color-checked":P,"--n-color-checked-hover":I,"--n-color-checked-pressed":K,"--n-color-hover-checkable":E,"--n-color-pressed-checkable":F,"--n-font-size":V,"--n-height":R,"--n-opacity-disabled":C,"--n-padding":_,"--n-text-color":b||Y,"--n-text-color-checkable":T,"--n-text-color-checked":v,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":S}}),f=o?Ii("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${lh(b)}`),y&&(m+=`b${lh(y)}`),i.value&&(m+="c"),m}),h,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:i,handleClick:l,handleCloseClick:c,cssVars:o?void 0:h,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender})},render(){var t,e;const{mergedClsPrefix:i,rtlEnabled:r,closable:o,color:{borderColor:s}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=Fi(c.avatar,h=>h&&n.h("div",{class:`${i}-tag__avatar`},h)),u=Fi(c.icon,h=>h&&n.h("div",{class:`${i}-tag__icon`},h));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`]:a,[`${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(U2,{clsPrefix:i,class:`${i}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?n.h("div",{class:`${i}-tag__border`,style:{borderColor:s}}):null)}}),IS=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(Ch,{clsPrefix:i,class:`${i}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?n.h(X2,{clsPrefix:i,show:t.showClear,onClear:t.onClear},{placeholder:()=>n.h(Kr,{clsPrefix:i,class:`${i}-base-suffix__arrow`},{default:()=>Ja(e.default,()=>[n.h(D2,null)])})}):null})}}}),AS={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function OS(t){const{borderRadius:e,textColor2:i,textColorDisabled:r,inputColor:o,inputColorDisabled:s,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:h,borderColor:f,iconColor:m,iconColorDisabled:p,clearColor:g,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:k,fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:T,fontSizeLarge:w,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:E,fontWeight:F}=t;return Object.assign(Object.assign({},AS),{fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:T,fontSizeLarge:w,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:E,borderRadius:e,fontWeight:F,textColor:i,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:k,color:o,colorDisabled:s,colorActive:o,border:`1px solid ${f}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Le(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Le(a,{alpha:.2})}`,caretColor:a,arrowColor:m,arrowColorDisabled:p,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Le(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Le(c,{alpha:.2})}`,colorActiveWarning:o,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${h}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${h}`,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 Oh={name:"InternalSelection",common:Ai,peers:{Popover:Ih},self:OS},zS=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;
|
|
@@ -810,7 +810,7 @@ ${o}
|
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),zS=n.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Tt.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}=Mi(t),r=Yr("InternalSelection",i,e),o=n.ref(null),s=n.ref(null),a=n.ref(null),l=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),h=n.ref(null),f=n.ref(null),m=n.ref(null),p=n.ref(!1),g=n.ref(!1),b=n.ref(!1),y=Tt("InternalSelection","-internal-selection",OS,Oh,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):pr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=n.computed(()=>{const te=t.selectedOption;if(te)return te[t.labelField]}),C=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:Le}=s;Le&&(Le.style.width=`${ce.offsetWidth}px`,t.maxTagCount!=="responsive"&&((te=f.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:te}=m;te&&(te.style.display="none")}function S(){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 v(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 F(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=a.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)))&&v(te)}function K(te){var ce;!((ce=a.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)||$(te)}function J(te){F(te)}function Z(){b.value=!0}function L(){b.value=!1}function A(te){!t.active||!t.filterable||te.target!==s.value&&te.preventDefault()}function O(te){E(te)}const V=n.ref(!1);function R(te){if(te.key==="Backspace"&&!V.value&&!t.pattern.length){const{selectedOptions:ce}=t;ce!=null&&ce.length&&O(ce[ce.length-1])}}let H=null;function U(te){const{value:ce}=o;if(ce){const Le=te.target.value;ce.textContent=Le,N()}t.ignoreComposition&&V.value?H=te:P(te)}function G(){V.value=!0}function X(){V.value=!1,t.ignoreComposition&&P(H),H=null}function W(te){var ce;g.value=!0,(ce=t.onPatternFocus)===null||ce===void 0||ce.call(t,te)}function j(te){var ce;g.value=!1,(ce=t.onPatternBlur)===null||ce===void 0||ce.call(t,te)}function ae(){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:Le}=l;Le==null||Le.blur()}else{const{value:Le}=c;Le==null||Le.blur()}}function de(){var te,ce,Le;t.filterable?(g.value=!1,(te=d.value)===null||te===void 0||te.focus()):t.multiple?(ce=l.value)===null||ce===void 0||ce.focus():(Le=c.value)===null||Le===void 0||Le.focus()}function ve(){const{value:te}=s;te&&(S(),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}=h;return te}function xt(){return s.value}let $e=null;function Zt(){$e!==null&&window.clearTimeout($e)}function gn(){t.active||(Zt(),$e=window.setTimeout(()=>{C.value&&(p.value=!0)},100))}function Rt(){Zt()}function Jn(te){te||(Zt(),p.value=!1)}n.watch(C,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)})}),ah(a,t.onResize);const{inlineThemeDisabled:yn}=t,an=n.computed(()=>{const{size:te}=t,{common:{cubicBezierEaseInOut:ce},self:{fontWeight:Le,borderRadius:mi,color:lt,placeholderColor:Qt,textColor:gr,paddingSingle:pi,paddingMultiple:Li,caretColor:yr,colorDisabled:bn,textColorDisabled:ei,placeholderColorDisabled:D,colorActive:Q,boxShadowFocus:se,boxShadowActive:me,boxShadowHover:ge,border:xe,borderFocus:Se,borderHover:Te,borderActive:Je,arrowColor:Mn,arrowColorDisabled:fl,loadingColor:hl,colorActiveWarning:ml,boxShadowFocusWarning:pl,boxShadowActiveWarning:gl,boxShadowHoverWarning:yl,borderWarning:bl,borderFocusWarning:_l,borderHoverWarning:wl,borderActiveWarning:xl,colorActiveError:kl,boxShadowFocusError:vl,boxShadowActiveError:Cl,boxShadowHoverError:Sl,borderError:Bl,borderFocusError:Tl,borderHoverError:Nl,borderActiveError:TT,clearColor:NT,clearColorHover:$T,clearColorPressed:ET,clearSize:RT,arrowSize:PT,[nt("height",te)]:FT,[nt("fontSize",te)]:VT}}=y.value,ps=hn(pi),gs=hn(Li);return{"--n-bezier":ce,"--n-border":xe,"--n-border-active":Je,"--n-border-focus":Se,"--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":yr,"--n-color":lt,"--n-color-active":Q,"--n-color-disabled":bn,"--n-font-size":VT,"--n-height":FT,"--n-padding-single-top":ps.top,"--n-padding-multiple-top":gs.top,"--n-padding-single-right":ps.right,"--n-padding-multiple-right":gs.right,"--n-padding-single-left":ps.left,"--n-padding-multiple-left":gs.left,"--n-padding-single-bottom":ps.bottom,"--n-padding-multiple-bottom":gs.bottom,"--n-placeholder-color":Qt,"--n-placeholder-color-disabled":D,"--n-text-color":gr,"--n-text-color-disabled":ei,"--n-arrow-color":Mn,"--n-arrow-color-disabled":fl,"--n-loading-color":hl,"--n-color-active-warning":ml,"--n-box-shadow-focus-warning":pl,"--n-box-shadow-active-warning":gl,"--n-box-shadow-hover-warning":yl,"--n-border-warning":bl,"--n-border-focus-warning":_l,"--n-border-hover-warning":wl,"--n-border-active-warning":xl,"--n-color-active-error":kl,"--n-box-shadow-focus-error":vl,"--n-box-shadow-active-error":Cl,"--n-box-shadow-hover-error":Sl,"--n-border-error":Bl,"--n-border-focus-error":Tl,"--n-border-hover-error":Nl,"--n-border-active-error":TT,"--n-clear-size":RT,"--n-clear-color":NT,"--n-clear-color-hover":$T,"--n-clear-color-pressed":ET,"--n-arrow-size":PT,"--n-font-weight":Le}}),Ve=yn?Ii("internal-selection",n.computed(()=>t.size[0]),an,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:k,label:x,selected:C,showTagsPanel:p,isComposing:V,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:m,handleMouseDown:A,handleFocusin:I,handleClear:J,handleMouseEnter:Z,handleMouseLeave:L,handleDeleteOption:O,handlePatternKeyDown:R,handlePatternInputInput:U,handlePatternInputBlur:j,handlePatternInputFocus:W,handleMouseEnterCounter:gn,handleMouseLeaveCounter:Rt,handleFocusout:K,handleCompositionEnd:X,handleCompositionStart:G,onPopoverUpdateShow:Jn,focus:de,focusInput:ve,blur:ae,blurInput:st,updateCounter:_e,getCounter:we,getTail:xt,renderLabel:t.renderLabel,cssVars:yn?void 0:an,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:i,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const f=s==="responsive",m=typeof s=="number",p=f||m,g=n.h(el,null,{default:()=>n.h(MS,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=P=>n.h("div",{class:`${l}-base-selection-tag-wrapper`,key:P.value},u?u({option:P,handleClose:()=>{this.handleDeleteOption(P)}}):n.h(sl,{size:i,closable:!P.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(P)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(P,!0):pr(P[y],P,!0)})),k=()=>(m?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),x=o?n.h("div",{class:`${l}-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:`${l}-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:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,C=f?()=>n.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},n.h(sl,{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:`${l}-base-selection-tag-wrapper`,key:"__counter__"},n.h(sl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${P}`})))}const w=f?o?n.h(Zf,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C,tail:()=>x}):n.h(Zf,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C}):m&&N?k().concat(N):k(),S=p?()=>n.h("div",{class:`${l}-base-selection-popover`},f?k():this.selectedOptions.map(_)):void 0,v=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:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},n.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,F=o?n.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,g):n.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,g);b=n.h(n.Fragment,null,p?n.h(BS,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:S}):F,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:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:mh(this.label)},n.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),k?n.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},n.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):pr(this.label,this.selectedOption,!0))):null,_?n.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else b=n.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?n.h("div",{class:`${l}-base-selection-input`,title:mh(this.label),key:"input"},n.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):pr(this.label,this.selectedOption,!0))):n.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),g);return n.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?n.h("div",{class:`${l}-base-selection__border`}):null,a?n.h("div",{class:`${l}-base-selection__state-border`}):null)}});function DS(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const LS={name:"Select",common:Ai,peers:{InternalSelection:Oh,InternalSelectMenu:Eh},self:DS},HS=he([be("select",`
|
|
813
|
+
`)])])]),DS=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}=Mi(t),r=Yr("InternalSelection",i,e),o=n.ref(null),s=n.ref(null),a=n.ref(null),l=n.ref(null),c=n.ref(null),d=n.ref(null),u=n.ref(null),h=n.ref(null),f=n.ref(null),m=n.ref(null),p=n.ref(!1),g=n.ref(!1),b=n.ref(!1),y=Nt("InternalSelection","-internal-selection",zS,Oh,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):pr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=n.computed(()=>{const te=t.selectedOption;if(te)return te[t.labelField]}),C=n.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function T(){var te;const{value:ce}=o;if(ce){const{value:Me}=s;Me&&(Me.style.width=`${ce.offsetWidth}px`,t.maxTagCount!=="responsive"&&((te=f.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:te}=m;te&&(te.style.display="none")}function S(){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(T)});function v(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 F(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=a.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)))&&v(te)}function K(te){var ce;!((ce=a.value)===null||ce===void 0)&&ce.contains(te.relatedTarget)||$(te)}function J(te){F(te)}function Z(){b.value=!0}function L(){b.value=!1}function A(te){!t.active||!t.filterable||te.target!==s.value&&te.preventDefault()}function O(te){E(te)}const V=n.ref(!1);function R(te){if(te.key==="Backspace"&&!V.value&&!t.pattern.length){const{selectedOptions:ce}=t;ce!=null&&ce.length&&O(ce[ce.length-1])}}let H=null;function Y(te){const{value:ce}=o;if(ce){const Me=te.target.value;ce.textContent=Me,T()}t.ignoreComposition&&V.value?H=te:P(te)}function G(){V.value=!0}function X(){V.value=!1,t.ignoreComposition&&P(H),H=null}function W(te){var ce;g.value=!0,(ce=t.onPatternFocus)===null||ce===void 0||ce.call(t,te)}function j(te){var ce;g.value=!1,(ce=t.onPatternBlur)===null||ce===void 0||ce.call(t,te)}function ae(){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:Me}=l;Me==null||Me.blur()}else{const{value:Me}=c;Me==null||Me.blur()}}function de(){var te,ce,Me;t.filterable?(g.value=!1,(te=d.value)===null||te===void 0||te.focus()):t.multiple?(ce=l.value)===null||ce===void 0||ce.focus():(Me=c.value)===null||Me===void 0||Me.focus()}function ve(){const{value:te}=s;te&&(S(),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}=h;return te}function xt(){return s.value}let $e=null;function Zt(){$e!==null&&window.clearTimeout($e)}function gn(){t.active||(Zt(),$e=window.setTimeout(()=>{C.value&&(p.value=!0)},100))}function Rt(){Zt()}function Jn(te){te||(Zt(),p.value=!1)}n.watch(C,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)})}),ah(a,t.onResize);const{inlineThemeDisabled:yn}=t,an=n.computed(()=>{const{size:te}=t,{common:{cubicBezierEaseInOut:ce},self:{fontWeight:Me,borderRadius:mi,color:lt,placeholderColor:Qt,textColor:gr,paddingSingle:pi,paddingMultiple:Li,caretColor:yr,colorDisabled:bn,textColorDisabled:ei,placeholderColorDisabled:D,colorActive:Q,boxShadowFocus:se,boxShadowActive:me,boxShadowHover:ge,border:xe,borderFocus:Se,borderHover:Ne,borderActive:Je,arrowColor:Mn,arrowColorDisabled:fl,loadingColor:hl,colorActiveWarning:ml,boxShadowFocusWarning:pl,boxShadowActiveWarning:gl,boxShadowHoverWarning:yl,borderWarning:bl,borderFocusWarning:_l,borderHoverWarning:wl,borderActiveWarning:xl,colorActiveError:kl,boxShadowFocusError:vl,boxShadowActiveError:Cl,boxShadowHoverError:Sl,borderError:Bl,borderFocusError:Nl,borderHoverError:Tl,borderActiveError:TN,clearColor:$N,clearColorHover:EN,clearColorPressed:RN,clearSize:PN,arrowSize:FN,[nt("height",te)]:VN,[nt("fontSize",te)]:MN}}=y.value,ps=hn(pi),gs=hn(Li);return{"--n-bezier":ce,"--n-border":xe,"--n-border-active":Je,"--n-border-focus":Se,"--n-border-hover":Ne,"--n-border-radius":mi,"--n-box-shadow-active":me,"--n-box-shadow-focus":se,"--n-box-shadow-hover":ge,"--n-caret-color":yr,"--n-color":lt,"--n-color-active":Q,"--n-color-disabled":bn,"--n-font-size":MN,"--n-height":VN,"--n-padding-single-top":ps.top,"--n-padding-multiple-top":gs.top,"--n-padding-single-right":ps.right,"--n-padding-multiple-right":gs.right,"--n-padding-single-left":ps.left,"--n-padding-multiple-left":gs.left,"--n-padding-single-bottom":ps.bottom,"--n-padding-multiple-bottom":gs.bottom,"--n-placeholder-color":Qt,"--n-placeholder-color-disabled":D,"--n-text-color":gr,"--n-text-color-disabled":ei,"--n-arrow-color":Mn,"--n-arrow-color-disabled":fl,"--n-loading-color":hl,"--n-color-active-warning":ml,"--n-box-shadow-focus-warning":pl,"--n-box-shadow-active-warning":gl,"--n-box-shadow-hover-warning":yl,"--n-border-warning":bl,"--n-border-focus-warning":_l,"--n-border-hover-warning":wl,"--n-border-active-warning":xl,"--n-color-active-error":kl,"--n-box-shadow-focus-error":vl,"--n-box-shadow-active-error":Cl,"--n-box-shadow-hover-error":Sl,"--n-border-error":Bl,"--n-border-focus-error":Nl,"--n-border-hover-error":Tl,"--n-border-active-error":TN,"--n-clear-size":PN,"--n-clear-color":$N,"--n-clear-color-hover":EN,"--n-clear-color-pressed":RN,"--n-arrow-size":FN,"--n-font-weight":Me}}),Ve=yn?Ii("internal-selection",n.computed(()=>t.size[0]),an,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:k,label:x,selected:C,showTagsPanel:p,isComposing:V,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:m,handleMouseDown:A,handleFocusin:I,handleClear:J,handleMouseEnter:Z,handleMouseLeave:L,handleDeleteOption:O,handlePatternKeyDown:R,handlePatternInputInput:Y,handlePatternInputBlur:j,handlePatternInputFocus:W,handleMouseEnterCounter:gn,handleMouseLeaveCounter:Rt,handleFocusout:K,handleCompositionEnd:X,handleCompositionStart:G,onPopoverUpdateShow:Jn,focus:de,focusInput:ve,blur:ae,blurInput:st,updateCounter:_e,getCounter:we,getTail:xt,renderLabel:t.renderLabel,cssVars:yn?void 0:an,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:i,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const f=s==="responsive",m=typeof s=="number",p=f||m,g=n.h(el,null,{default:()=>n.h(IS,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=P=>n.h("div",{class:`${l}-base-selection-tag-wrapper`,key:P.value},u?u({option:P,handleClose:()=>{this.handleDeleteOption(P)}}):n.h(sl,{size:i,closable:!P.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(P)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(P,!0):pr(P[y],P,!0)})),k=()=>(m?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),x=o?n.h("div",{class:`${l}-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:`${l}-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:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,C=f?()=>n.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},n.h(sl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let T;if(m){const P=this.selectedOptions.length-s;P>0&&(T=n.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},n.h(sl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${P}`})))}const w=f?o?n.h(Zf,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C,tail:()=>x}):n.h(Zf,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C}):m&&T?k().concat(T):k(),S=p?()=>n.h("div",{class:`${l}-base-selection-popover`},f?k():this.selectedOptions.map(_)):void 0,v=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:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},n.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,F=o?n.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,g):n.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,g);b=n.h(n.Fragment,null,p?n.h(NS,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:S}):F,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:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:mh(this.label)},n.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),k?n.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},n.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):pr(this.label,this.selectedOption,!0))):null,_?n.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else b=n.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?n.h("div",{class:`${l}-base-selection-input`,title:mh(this.label),key:"input"},n.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):pr(this.label,this.selectedOption,!0))):n.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},n.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),g);return n.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?n.h("div",{class:`${l}-base-selection__border`}):null,a?n.h("div",{class:`${l}-base-selection__state-border`}):null)}});function LS(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const HS={name:"Select",common:Ai,peers:{InternalSelection:Oh,InternalSelectMenu:Eh},self:LS},WS=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
|
-
`,[Mh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function fs(t){return t.type==="group"}function zh(t){return t.type==="ignored"}function al(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function WS(t,e){return{getIsGroup:fs,getIgnored:zh,getKey(r){return fs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function jS(t,e,i,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(fs(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(zh(l))continue;e(i,l)&&a.push(l)}return a}return o(t)}function qS(t,e,i){const r=new Map;return t.forEach(o=>{fs(o)?o[i].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var XS={};const YS=Object.assign(Object.assign({},Tt.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}),US=n.defineComponent({name:"Select",props:YS,slots:Object,setup(t){XS.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}=Mi(t),s=Tt("Select","-select",HS,LS,t,e),a=n.ref(t.defaultValue),l=n.toRef(t,"value"),c=Ma(l,a),d=n.ref(!1),u=n.ref(""),h=ff(t,["items","options"]),f=n.ref([]),m=n.ref([]),p=n.computed(()=>m.value.concat(f.value).concat(h.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 al(me,xe);const Se=ge[se];return typeof Se=="string"?al(me,Se):typeof Se=="number"?al(me,String(Se)):!1}}),b=n.computed(()=>{if(t.remote)return h.value;{const{value:D}=p,{value:Q}=u;return!Q.length||!t.filterable?D:jS(D,g.value,Q,t.childrenField)}}),y=n.computed(()=>{const{valueField:D,childrenField:Q}=t,se=WS(D,Q);return wv(b.value,se)}),_=n.computed(()=>qS(p.value,t.valueField,t.childrenField)),k=n.ref(!1),x=Ma(n.toRef(t,"show"),k),C=n.ref(null),N=n.ref(null),w=n.ref(null),{localeRef:S}=wh("Select"),v=n.computed(()=>{var D;return(D=t.placeholder)!==null&&D!==void 0?D:S.value.placeholder}),$=[],E=n.ref(new Map),F=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}=F,xe=[];return D.forEach(Se=>{if(me.has(Se))xe.push(me.get(Se));else if(Q&&se.has(Se))xe.push(se.get(Se));else if(ge){const Te=ge(Se);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=JC(t),{mergedSizeRef:Z,mergedDisabledRef:L,mergedStatusRef:A}=J;function O(D,Q){const{onChange:se,"onUpdate:value":me,onUpdateValue:ge}=t,{nTriggerFormChange:xe,nTriggerFormInput:Se}=J;se&&Bt(se,D,Q),ge&&Bt(ge,D,Q),me&&Bt(me,D,Q),a.value=D,xe(),Se()}function V(D){const{onBlur:Q}=t,{nTriggerFormBlur:se}=J;Q&&Bt(Q,D),se()}function R(){const{onClear:D}=t;D&&Bt(D)}function H(D){const{onFocus:Q,showOnFocus:se}=t,{nTriggerFormFocus:me}=J;Q&&Bt(Q,D),me(),se&&j()}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 W(D){const{onUpdateShow:Q,"onUpdate:show":se}=t;Q&&Bt(Q,D),se&&Bt(se,D),k.value=D}function j(){L.value||(W(!0),k.value=!0,t.filterable&&pi())}function ae(){W(!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():ae():j())}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,V(D),ae())}function $e(D){H(D),d.value=!0}function Zt(){d.value=!0}function gn(D){var Q;!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(D.relatedTarget)||(d.value=!1,V(D),ae())}function Rt(){var D;(D=C.value)===null||D===void 0||D.focus(),ae()}function Jn(D){var Q;x.value&&(!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(Ir(D))||ae())}function yn(D){if(!Array.isArray(D))return[];if(F.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 an(D){Ve(D.rawNode)}function Ve(D){if(L.value)return;const{tag:Q,remote:se,clearFilterAfterSelect:me,valueField:ge}=t;if(Q&&!se){const{value:xe}=m,Se=xe[0]||null;if(Se){const Te=f.value;Te.length?Te.push(Se):f.value=[Se],m.value=$}}if(se&&E.value.set(D[ge],D),t.multiple){const xe=yn(c.value),Se=xe.findIndex(Te=>Te===D[ge]);if(~Se){if(xe.splice(Se,1),Q&&!se){const Te=te(D[ge]);~Te&&(f.value.splice(Te,1),me&&(u.value=""))}}else xe.push(D[ge]),me&&(u.value="");O(xe,P(xe))}else{if(Q&&!se){const xe=te(D[ge]);~xe?f.value=[f.value[xe]]:f.value=$}gr(),ae(),O(D[ge],D)}}function te(D){return f.value.findIndex(se=>se[t.valueField]===D)}function ce(D){x.value||j();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:Se,labelField:Te}=t;h.value.some(Je=>Je[Se]===xe[Se]||Je[Te]===xe[Te])||f.value.some(Je=>Je[Se]===xe[Se]||Je[Te]===xe[Te])?m.value=$:m.value=[xe]}}function Le(D){D.stopPropagation();const{multiple:Q}=t;!Q&&t.filterable&&ae(),R(),Q?O([],[]):O(null,null)}function mi(D){!Mr(D,"action")&&!Mr(D,"empty")&&!Mr(D,"header")&&D.preventDefault()}function lt(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=C.value)===null||Q===void 0)&&Q.isComposing)){if(x.value){const Se=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();Se?an(Se):t.filterable||(ae(),gr())}else if(j(),t.tag&&ve.value){const Se=m.value[0];if(Se){const Te=Se[t.valueField],{value:Je}=c;t.multiple&&Array.isArray(Je)&&Je.includes(Te)||Ve(Se)}}}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():j();break;case"Escape":x.value&&(KC(D),ae()),(xe=C.value)===null||xe===void 0||xe.focus();break}}function gr(){var D;(D=C.value)===null||D===void 0||D.focus()}function pi(){var D;(D=C.value)===null||D===void 0||D.focusInput()}function Li(){var D;x.value&&((D=N.value)===null||D===void 0||D.syncPosition())}X(),n.watch(n.toRef(t,"options"),X);const yr={focus:()=>{var D;(D=C.value)===null||D===void 0||D.focus()},focusInput:()=>{var D;(D=C.value)===null||D===void 0||D.focusInput()},blur:()=>{var D;(D=C.value)===null||D===void 0||D.blur()},blurInput:()=>{var D;(D=C.value)===null||D===void 0||D.blurInput()}},bn=n.computed(()=>{const{self:{menuBoxShadow:D}}=s.value;return{"--n-menu-box-shadow":D}}),ei=o?Ii("select",void 0,bn,t):void 0;return Object.assign(Object.assign({},yr),{mergedStatus:A,mergedClsPrefix:e,mergedBordered:i,namespace:r,treeMate:y,isMounted:Jo(),triggerRef:C,menuRef:w,pattern:u,uncontrolledShow:k,mergedShow:x,adjustedTo:jn(t),uncontrolledValue:a,mergedValue:c,followerRef:N,localizedPlaceholder:v,selectedOption:K,selectedOptions:I,mergedSize:Z,mergedDisabled:L,focused:d,activeWithoutMenuOpen:ve,inlineThemeDisabled:o,onTriggerInputFocus:st,onTriggerInputBlur:_e,handleTriggerOrMenuResize:Li,handleMenuFocus:Zt,handleMenuBlur:gn,handleMenuTabOut:Rt,handleTriggerClick:we,handleToggle:an,handleDeleteOption:Ve,handlePatternInput:ce,handleClear:Le,handleTriggerBlur:xt,handleTriggerFocus:$e,handleKeydown:Qt,handleMenuAfterLeave:de,handleMenuClickOutside:Jn,handleMenuScroll:lt,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(gf,null,{default:()=>[n.h(yf,null,{default:()=>n.h(zS,{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(Pf,{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(mS,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],[Qo,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Qo,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),KS={},Dh=n.defineComponent({...KS,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=q.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(()=>z.isArray(r.value)),a=n.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=n.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=n.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=n.ref(!1),u=n.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(k=>{if(z.isEmpty(k))return;const x=s.value?r.value:r.value?[r.value]:[],C=k.filter(N=>!x.some(w=>w.id===N.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const m=z.debounce(()=>h(f),800),p=_=>{f=_,m()},g=_=>{var k;if(z.isArray(_)){const x=_.length>0?_.map(C=>{var N;return n.toRaw((N=l.value.find(w=>w.value===C))==null?void 0:N.item)}):[];o("update:value",x)}else if(_>0){const x=n.toRaw((k=l.value.find(C=>C.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(US),{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:a.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"]))}}),GS={},Lh=n.defineComponent({...GS,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=q.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"),a=async h=>r.searchType==="categories"?q.HttpRequester.getInstance(q.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?q.HttpRequester.getInstance(q.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(h,f)=>{if(r.renderLabel)return r.renderLabel(h,f);if(r.searchType==="products"){const m=h.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=h.item;return n.h("div",{},[m.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,f)=>(n.openBlock(),n.createBlock(Dh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":f[0]||(f[0]=m=>o("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),ZS={class:"col-span-2 flex flex-row gap-2.5"},QS={class:"flex-1"},JS={class:"text-sc-grey"},eB={class:"ml-2.5"},tB={key:0,class:"flex-none"},nB={},iB=n.defineComponent({...nB,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=q.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)),a=n.ref(s()),l=()=>{r("update:value",a.value.map(h=>n.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>n.toRaw(f)),...(z.isArray(h)?h:[h]).filter(f=>!a.value.some(m=>m.id===f.id))],n.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:n.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return n.watch(()=>i.value,()=>{a.value=s()}),(h,f)=>{const m=M.NListItem,p=Pk,g=M.NButton,b=M.NList;return n.openBlock(),n.createBlock(b,{"show-divider":!1,hoverable:!0},{header:n.withCtx(()=>[n.renderSlot(h.$slots,"header")]),footer:n.withCtx(()=>[n.createVNode(Lh,{value:o.value,"onUpdate:value":[f[0]||(f[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(()=>[a.value.length===0?(n.openBlock(),n.createBlock(m,{key:0,class:"text-center text-sm text-gray-600"},{default:n.withCtx(()=>[...f[1]||(f[1]=[n.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.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",ZS,[n.createElementVNode("span",QS,[n.createElementVNode("span",JS,n.toDisplayString(y.code),1),n.createElementVNode("span",eB,n.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(n.openBlock(),n.createElementBlock("div",tB,[n.renderSlot(h.$slots,"item-extra",{item:y,updateItemCallback:d})])):n.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),rB={class:"flex flex-col"},oB={class:"flex flex-col gap-1.5 text-base text-nowrap"},sB={class:"font-medium"},aB={class:"flex flex-col text-sc-dark-grey"},lB={key:0},cB={class:"font-medium"},dB={class:"font-medium"},uB={class:"font-medium"},fB={class:"font-medium"},hB={class:"font-medium"},mB={class:"font-medium"},pB={class:"font-medium"},gB={class:"font-medium"},yB={class:"font-medium"},bB={class:"font-medium"},_B={class:"flex flex-col gap-1.5 text-base text-nowrap"},wB={class:"font-medium"},xB={class:"flex flex-col text-sc-dark-grey"},kB={class:"font-medium"},vB={class:"font-medium"},CB={class:"flex flex-col gap-1.5 text-base text-nowrap"},SB={class:"font-medium"},BB={class:"text-sc-dark-grey"},TB={class:"font-medium"},NB={key:1,class:"text-base font-medium text-nowrap"},$B={},Hh=n.defineComponent({...$B,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[q.ConfiguratorsEnum.Kozyrek,q.ConfiguratorsEnum.Mosquitto,q.ConfiguratorsEnum.Strip,q.ConfiguratorsEnum.MetalForDoors,q.ConfiguratorsEnum.Sandwich,q.ConfiguratorsEnum.SandwichM2],i=t,r=n.ref(!1),o=n.computed(()=>{var f,m;return((f=i.item.product.unit)==null?void 0:f.isLinear)&&((m=i.item.product.properties)==null?void 0:m.isLengthConfigurator)}),s=n.computed(()=>q.UnitsHelper.getProductLengthMultiplicity(i.item.product)),a=n.computed(()=>q.UnitsHelper.getProductMultiplicity(i.item.product)),l=n.computed(()=>a.value>1),c=n.ref({quantity:i.item.quantity});n.watch(()=>i.item,f=>{c.value={quantity:f.quantity}});const d=f=>{var m;f!==null&&(c.value.quantity=f,(m=i.eventEmitter)==null||m.emit("order-item:edit-quantity",{item:i.item,quantity:f,loaderRef:r}))},u=()=>{var f;(f=i.eventEmitter)==null||f.emit("order-item:open-configurator",{item:i.item})},h=()=>{var f;(f=i.eventEmitter)==null||f.emit("order-item:edit",{item:i.item})};return(f,m)=>{const p=M.NInputNumber;return n.openBlock(),n.createElementBlock("div",rB,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",oB,[n.createElementVNode("span",null,[m[1]||(m[1]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",sB,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",aB,[t.item.configurator===n.unref(q.ConfiguratorsEnum).Kozyrek?(n.openBlock(),n.createElementBlock("span",lB,[m[2]||(m[2]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",cB,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.ConfiguratorsEnum).Mosquitto?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("span",null,[m[3]||(m[3]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",dB,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[4]||(m[4]=n.createTextVNode(" Высота: ",-1)),n.createElementVNode("span",uB,n.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.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",fB,n.toDisplayString(g)+" мм.",1)]))),128)),n.createElementVNode("span",null,[m[5]||(m[5]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",hB,n.toDisplayString(t.item.length)+" м.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.ConfiguratorsEnum).MetalForDoors?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("span",null,[m[6]||(m[6]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",mB,n.toDisplayString(t.item.width)+" мм.",1)]),n.createElementVNode("span",null,[m[7]||(m[7]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",pB,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.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",gB,n.toDisplayString(g.width)+"×"+n.toDisplayString(g.length)+" мм, "+n.toDisplayString(g.count)+" шт.",1)]))),128)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.ConfiguratorsEnum).SandwichM2?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("span",null,[m[8]||(m[8]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",yB,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[9]||(m[9]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",bB,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",_B,[n.createElementVNode("span",null,[m[10]||(m[10]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",wB,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",xB,[n.createElementVNode("span",null,[m[11]||(m[11]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",kB,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",vB,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(h,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("div",CB,[n.createElementVNode("span",null,[m[13]||(m[13]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",SB,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("span",BB,[m[14]||(m[14]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",TB,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(h,["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:a.value,step:a.value,"show-button":l.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(ro)(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",NB,n.toDisplayString(t.item.quantity)+" "+n.toDisplayString(t.item.product.unit.name),1))],64))])}}}),EB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RB(t,e){return n.openBlock(),n.createElementBlock("svg",EB,[...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 PB=n.markRaw({name:"tabler-truck-filled",render:RB}),FB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VB(t,e){return n.openBlock(),n.createElementBlock("svg",FB,[...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 MB=n.markRaw({name:"tabler-truck-delivery",render:VB}),IB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AB(t,e){return n.openBlock(),n.createElementBlock("svg",IB,[...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 OB=n.markRaw({name:"tabler-truck-loading",render:AB}),zB={class:"flex flex-col gap-1"},DB={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},LB={key:1,class:"text-base"},HB={class:"text-sc-dark-grey mr-1.5"},WB={key:0},jB={key:1},qB={},hs=n.defineComponent({...qB,__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=q.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),i=n.computed(()=>Me.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,a)=>{var u,h,f,m,p,g,b,y;const l=OB,c=MB,d=PB;return n.openBlock(),n.createElementBlock("div",zB,[t.showType?(n.openBlock(),n.createElementBlock("span",DB,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(n.openBlock(),n.createBlock(l,{key:0})):n.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(n.openBlock(),n.createBlock(c,{key:1})):n.createCommentVNode("",!0),((f=e.value)==null?void 0:f.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",LB,[n.createElementVNode("span",HB,n.toDisplayString(i.value),1),(g=(p=t.delivery)==null?void 0:p.address)!=null&&g.address?(n.openBlock(),n.createElementBlock("span",WB,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",jB," со склада "+n.toDisplayString(t.delivery.warehouse.address),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])}}}),XB={class:"flex flex-col gap-2.5"},YB={class:"text-base"},UB=["href"],KB={key:1,class:"text-sc-grey"},GB={},Wh=n.defineComponent({...GB,__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(Fe.Id)?e.order.id:void 0),r=n.computed(()=>{var h,f;return e.fields.includes(Fe.Status)?(f=(h=q.useReferencesStore().orderStatusReference)==null?void 0:h.find(m=>{var p;return m.id===(((p=e.order.status)==null?void 0:p.id)??-1)}))==null?void 0:f.name:void 0}),o=n.computed(()=>{var h;return bi((h=e.order.status)==null?void 0:h.slug)}),s=n.computed(()=>{var f,m;const h=(f=e.order.status)==null?void 0:f.slug;return!!h&&(((m=e.highlightSettings)==null?void 0:m.statuses.includes(h))??!1)}),a=n.computed(()=>ks(e.order).filter(h=>[it.OnOrder,it.NotInStock].includes(h))),l=h=>{var f;return((f=e.highlightSettings)==null?void 0:f.markers.includes(h))??!1},c=n.computed(()=>e.fields.includes(Fe.CreatedAt)),d=n.computed(()=>e.fields.includes(Fe.ClientInfo)||e.fields.includes(Fe.ClientInfoShort)?e.order.client:void 0),u=n.computed(()=>e.fields.includes(Fe.DeliveryInfo)?e.order.delivery:void 0);return(h,f)=>(n.openBlock(),n.createElementBlock("div",XB,[n.createElementVNode("span",YB,[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,UB)):n.createCommentVNode("",!0),c.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[f[0]||(f[0]=n.createTextVNode(" от ",-1)),n.createVNode(Xo,{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},[f[1]||(f[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",KB,n.toDisplayString(r.value),1))],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m},[f[2]||(f[2]=n.createTextVNode(" - ",-1)),n.createElementVNode("span",{class:n.normalizeClass({"font-medium":l(m),"text-sc-dark-grey":!l(m)}),style:n.normalizeStyle(l(m)?{color:n.unref(vr)(m).color}:void 0)},n.toDisplayString(n.unref(xs)(m)),7)],64))),128))]),d.value?(n.openBlock(),n.createBlock(Vr,{key:0,client:d.value,class:"ml-3"},null,8,["client"])):n.createCommentVNode("",!0),u.value?(n.openBlock(),n.createBlock(hs,{key:1,delivery:u.value,class:"ml-3"},null,8,["delivery"])):n.createCommentVNode("",!0)]))}}),ZB={},ll=n.defineComponent({...ZB,__name:"order-payment",props:{payment:{}},setup(t){const e=t,i=n.computed(()=>{var r;return(r=q.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)}}}),QB={},Gr=n.defineComponent({...QB,__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={[q.UserTypeEnum.Manager]:"менеджером",[q.UserTypeEnum.Operator]:"оператором",[q.UserTypeEnum.Client]:"клиентом",[q.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>i[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${l}`}const a=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${a}`.trim()});return(s,a)=>(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))}}),JB={class:"flex flex-row gap-1.5"},e3={class:"flex-none text-nowrap"},t3={class:"flex flex-1 flex-col gap-2.5"},n3={key:0,class:"text-sm"},i3={class:"text-gray-600"},r3={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},o3={key:0},s3={key:1},a3={},jh=n.defineComponent({...a3,__name:"order-product-info",props:{product:{},index:{}},setup(t){const e=n.inject(q.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",JB,[n.createElementVNode("span",e3,n.toDisplayString(t.index+1)+".",1),n.createElementVNode("div",t3,[n.createVNode(Br,{product:t.product.product},null,8,["product"]),t.product.marker?(n.openBlock(),n.createElementBlock("span",n3,[o[0]||(o[0]=n.createTextVNode(" Маркировка: ",-1)),n.createElementVNode("span",i3,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(Gr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):n.createCommentVNode("",!0),n.createElementVNode("div",r3,[o[1]||(o[1]=n.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock("span",o3,n.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(n.openBlock(),n.createElementBlock("span",s3,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"])])])])}}}),l3={class:"flex items-center gap-1.5"},c3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},d3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},u3={},qh=n.defineComponent({...u3,__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(()=>Il(e.status.slug)),o=n.computed(()=>e.statusDetail?`${e.status.name} (${e.statusDetail.name})`:e.status.name);return(s,a)=>{const l=M.NTag;return t.variant==="filled"?(n.openBlock(),n.createBlock(l,{key:0,color:r.value,bordered:!1,size:t.size,round:""},{default:n.withCtx(()=>[n.createElementVNode("span",l3,[t.showDot?(n.openBlock(),n.createElementBlock("span",c3)):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",d3)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)],4))}}}),f3={},cl=n.defineComponent({...f3,__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))}}),h3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function m3(t,e){return n.openBlock(),n.createElementBlock("svg",h3,[...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 p3=n.markRaw({name:"ion-trash-outline",render:m3}),g3={},y3=n.defineComponent({...g3,__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(M.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))}}),b3={class:"flex flex-col gap-0.5"},_3={class:"text-gray-600"},w3={},x3=n.defineComponent({...w3,__name:"order-item-name",props:{item:{}},setup(t){const e=t,i=n.inject(q.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)}),a=n.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),l=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",b3,[n.createElementVNode("div",{class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(Br,{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",_3,n.toDisplayString(t.item.marker),1)],2)):n.createCommentVNode("",!0),a.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(y3,{src:a.value},null,8,["src"])],2)):n.createCommentVNode("",!0),s.value&&!o.value?(n.openBlock(),n.createBlock(Gr,{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&&l.value.length===0?(n.openBlock(),n.createBlock(Gr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):n.createCommentVNode("",!0),t.item.replacementId&&l.value.length>0?(n.openBlock(),n.createBlock(Gr,{key:4,"user-type":c.value,"changed-fields":l.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):n.createCommentVNode("",!0)]))}}),k3={},v3=n.defineComponent({...k3,__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(()=>z.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)},a=m=>e.selectable?{class:i.value.includes(m.id)?void 0:"opacity-60"}:{},l=(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(et.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(x3,{item:g})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:l,render:g=>n.h(Hh,{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:l,render:g=>o(g)?null:n.h(M.NButton,{quaternary:!0,type:"error",onClick:()=>{var b;(b=e.eventEmitter)==null||b.emit("order-item:delete",{item:g})}},()=>n.h(p3))}]:[]],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(M.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(jh,{product:g,index:b})}];case Xe.laptop:return[...p,...m];default:return[...p,...m]}},h=n.computed(()=>u()),f=()=>{c.value=et.getDeviceTypeByResolution(),d.value=window.innerWidth};return n.onMounted(()=>{f(),window.addEventListener("resize",f)}),n.onUnmounted(()=>{window.removeEventListener("resize",f)}),(m,p)=>{const g=M.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:h.value,data:r.value,"row-key":b=>b.id,"row-props":a,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Xh=An(v3,[["__scopeId","data-v-e1fad754"]]),C3={key:0,class:"text-sc-dark-grey my-2 text-center"},S3={key:1,class:"text-sc-dark-grey my-2"},B3={},Yh=n.defineComponent({...B3,__name:"order-status-history",props:{order:{}},setup(t){const e=t,i=n.ref(!1),r=n.ref([]),o=a=>{const{uiDateWithTime:l}=q.useBaseConfigStateStore().config.dateFormats;return Me.format(a,l)},s=(a=!0)=>{a&&(i.value=!0),q.HttpRequester.getInstance(q.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(l=>{r.value=l}).finally(()=>{a&&(i.value=!1)})};return n.watch(()=>e.order,()=>{s(!1)}),n.onMounted(()=>{s()}),(a,l)=>{const c=M.NSpin,d=M.NTimelineItem,u=M.NTimeline;return n.openBlock(),n.createElementBlock("div",null,[l[1]||(l[1]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),i.value?(n.openBlock(),n.createElementBlock("div",C3,[n.createVNode(c,{size:"small",class:"mb-1 align-middle"}),l[0]||(l[0]=n.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(n.openBlock(),n.createElementBlock("div",S3," История статусов отсутствует. ")):(n.openBlock(),n.createBlock(u,{key:2},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(h,f)=>(n.openBlock(),n.createBlock(d,{key:f,color:n.unref(bi)(h.status.slug).color,time:o(h.createdAt),content:h.user.name},{header:n.withCtx(()=>[n.createVNode(qh,{status:h.status,"status-detail":h.statusDetail,variant:f===0?"filled":"text","show-dot":!1,size:"small"},null,8,["status","status-detail","variant"])]),_:2},1032,["color","time","content"]))),128))]),_:1}))])}}}),T3={class:"text-base"},N3={},dl=n.defineComponent({...N3,__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",T3,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))}}),$3={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},E3={class:"col-span-2"},R3={class:"col-span-2"},P3={},Uh=n.defineComponent({...P3,__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",$3,[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(dl,{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(Vr,{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(Lu,{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",E3,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(ll,{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(hs,{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",R3,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(dl,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):n.createCommentVNode("",!0)])]))}}),F3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function V3(t,e){return n.openBlock(),n.createElementBlock("svg",F3,[...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 M3=n.markRaw({name:"ion-copy-outline",render:V3}),I3={class:"flex flex-col items-start gap-1.5 text-base"},A3=["href"],O3=["href"],z3={key:1,class:"flex items-center gap-2"},D3=["href"],L3={},Kh=n.defineComponent({...L3,__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 a;const o=M3,s=M.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",I3,[t.order.erpOrderUrl?(n.openBlock(),n.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,A3)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.order.invoices??[],(l,c)=>(n.openBlock(),n.createElementBlock("a",{key:c,class:"btn btn-primary",href:l}," Скачать счет №"+n.toDisplayString(c+1),9,O3))),128)),(a=t.order.payment)!=null&&a.onlinePaymentLink?(n.openBlock(),n.createElementBlock("div",z3,[n.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,D3),n.withDirectives((n.openBlock(),n.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:n.withCtx(()=>[n.createVNode(o)]),_:1})),[[n.unref(Pl),t.order.payment.onlinePaymentLink]])])):n.createCommentVNode("",!0)])],64)):n.createCommentVNode("",!0)}}}),H3={key:0},W3={class:"text-sc-dark-grey my-2 text-center"},j3={key:1,class:"text-sc-dark-grey my-2 text-center"},q3={key:2},X3={class:"text-sc-dark-grey mt-4 text-right font-bold"},Y3={class:"text-sc-primary"},U3={},Gh=n.defineComponent({...U3,__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(q.currentOrderInjectionKey,n.computed(()=>s.value??null));const a=(d=!0)=>{if("products"in i.order){s.value=new q.Order(i.order);return}d&&(o.value=!0),q.HttpRequester.getInstance(q.OrdersDataProvider).getOrder(i.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=n.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=n.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return n.watch(()=>i.order,()=>{a(!1)}),n.onMounted(()=>{a()}),(d,u)=>{const h=M.NSpin;return o.value?(n.openBlock(),n.createElementBlock("div",H3,[n.createElementVNode("div",W3,[n.createVNode(h,{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",j3," --- Не удалось загрузить данные о заказе --- ")):(n.openBlock(),n.createElementBlock("div",q3,[n.createVNode(Xh,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),n.createElementVNode("div",X3,[u[2]||(u[2]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",Y3,n.toDisplayString(c.value)+" ₽",1)]),n.createVNode(Uh,{order:s.value,"onClick:clientName":u[0]||(u[0]=f=>r("click:client-name",s.value.client,f))},null,8,["order"]),n.createVNode(Kh,{order:s.value},null,8,["order"]),n.createVNode(Yh,{order:s.value},null,8,["order"])]))}}}),K3={},G3=n.defineComponent({...K3,__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(Cr,"small"),r=n.computed(()=>z.isNil(e.orderContextButtonsConfig)?[]:z.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),o=s=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,s)};return(s,a)=>{var u;const l=Cs,c=M.NButton,d=M.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(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)}}}),Z3={},Q3=n.defineComponent({...Z3,__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"),a=(R,H)=>{H?s.value.includes(R)||(s.value=[...s.value,R]):s.value=s.value.filter(U=>U!==R)},l=()=>z.cloneDeep(r.sort??[{field:"id",direction:"desc"}]),c=n.ref(l()),d=n.ref([]),u=n.ref(!1),h=n.ref(700),f=()=>{const R=et.getDeviceTypeByResolution(),H=R===Xe.phone||R===Xe.tablet;if(!(!r.stickyHeaderOnMobile&&H))return h.value*(q.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},m=n.ref(f()),p=n.computed(()=>r.highlightSettings?r.highlightSettings:{statuses:[],markers:r.useCellIndication?[...io]:[]}),g=R=>{const H={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(ks(R).filter(de=>G.markers.includes(de))),W={},ae=[it.NotInStock,it.OnOrder,it.LargeOrder].find(de=>X.has(de));if(ae){const de=vr(ae);U.push("order-id-marked",ae),W["--sc-order-id-bg"]=de.backgroundColor,W["--sc-order-id-text"]=de.textOnBackgroundColor}if(X.has(it.NextDayDelivery)){const de=vr(it.NextDayDelivery);U.push("delivery-date-marked"),W["--sc-delivery-date-bg"]=de.backgroundColor,W["--sc-delivery-date-text"]=de.textOnBackgroundColor}return R.status.slug&&G.statuses.includes(R.status.slug)&&(U.push("order-status-highlighted",R.status.slug),z.assign(W,Al(R.status.slug))),z.isEmpty(W)||(H.style=W),U.length>0&&(H.class=U.join(" ")),H},b=()=>{const R=[Fe.CreatedAt,Fe.Id,Fe.ClientInfo,Fe.ClientCity,Fe.DeliveryDate,Fe.PaymentType,Fe.SalesDirections,Fe.Status,...r.showAttachedUserColumn?[Fe.AttachedUser]:[],Fe.actions],H=r.fields.length>0?r.fields:R,U={title:"???",key:"undefined",render:()=>n.h("span",{},["--- unknown ---"])},G={type:"expand",expandable:z.constant(!0),renderExpand:j=>n.h(Gh,{order:j,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{o("click:client-name",j.client,null)}}),width:"30"};let X=[{title:"Дата заказа",key:Fe.CreatedAt,resizable:!0,width:100,render:j=>n.h(Xo,{date:j.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Fe.Id,resizable:!0,width:75,className:"order-id",render:j=>n.h("a",{href:r.orderUrl.replace(":id",j.id.toString()),class:"text-base"},j.id)},{title:"Дата доставки / самовывоза",key:Fe.DeliveryDate,resizable:!0,width:120,className:"delivery-date",render:j=>n.h(Xo,{date:j.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Fe.ClientInfo,resizable:!0,minWidth:320,render:j=>n.h(Vr,{client:j.client,"onClick:client-name":()=>{o("click:client-name",j.client,null)}})},{title:"Тип доставки",key:Fe.DeliveryInfo,resizable:!0,minWidth:320,render:j=>n.h(hs,{delivery:j.delivery})},{title:"Клиент",key:Fe.ClientInfoShort,resizable:!0,minWidth:320,render:j=>n.h(Vr,{client:j.client,showCityAndRegion:!1,"onClick:client-name":()=>{o("click:client-name",j.client,null)}})},{title:"Город клиента",key:Fe.ClientCity,resizable:!0,minWidth:90,width:120,render:j=>{var ae;return n.h("span",{class:"text-base"},((ae=j.client)==null?void 0:ae.city.name)??"—")}},{title:"Статус",key:Fe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:j=>n.h("span",{class:"text-base"},[j.status.name])},{title:"Тип оплаты",key:Fe.PaymentType,resizable:!0,width:115,minWidth:95,render:j=>j.payment?n.h(ll,{payment:j.payment}):n.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Fe.SalesDirections,resizable:!0,width:80,render:j=>{var ae;return n.h("span",{class:"text-base"},[((ae=j.salesDirection)==null?void 0:ae.name)??""])}},...r.showAttachedUserColumn?[{title:"Закреплено за",key:Fe.AttachedUser,resizable:!0,minWidth:120,render:j=>{var ae;return n.h("span",{class:"text-base"},[((ae=j==null?void 0:j.attachedUser)==null?void 0:ae.name)??""])}}]:[]];r.orderContextButtonsConfig&&X.push({key:"actions",title:"",className:"align-top",width:50,render:j=>n.h(G3,{order:j,orderContextButtonsConfig:r.orderContextButtonsConfig,onOrderContextSelect:r.onOrderContextSelect})}),r.enableSorting&&(X=X.map(j=>[Fe.Id,Fe.CreatedAt,Fe.DeliveryDate].includes(j.key)?{...j,sorter:!0,sortOrder:!1,...j.width===void 0?{}:{width:j.width+16}}:j));const W=r.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:j=>{var de;const ae=((de=r.isRowSelectable)==null?void 0:de.call(r,j))??!0;return{class:ae?"cursor-pointer":void 0,onClick:()=>{ae&&a(j.id,!s.value.includes(j.id))}}},render:j=>{var ae;return((ae=r.isRowSelectable)==null?void 0:ae.call(r,j))??!0?n.h(M.NCheckbox,{checked:s.value.includes(j.id)}):null}}]:[];switch(et.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...W,G,{key:"order",title:"Заказ",resizable:!0,render:j=>n.h(Wh,{order:j,fields:H,orderUrl:r.orderUrl,highlightSettings:p.value})}];case Xe.laptop:{const j=r.showAttachedUserColumn?H:H.filter(ae=>ae!==Fe.AttachedUser);return[...W,G,...j.map(ae=>X.find(de=>de.key===ae)??U)]}default:return[U]}},y=n.ref(b()),_=n.ref(new q.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),C=n.ref(null),N=n.ref(null),w=n.ref(null),S=n.ref(null),v=()=>{S.value!==null&&(clearInterval(S.value),S.value=null)},$=()=>{v(),r.refreshInterval&&(S.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},F=()=>{var R,H,U;r.filters&&((R=C.value)==null||R.abort(),C.value=null,(H=N.value)==null||H.abort(),N.value=null,w.value=null,(U=x.value)==null||U.abort(),x.value=new AbortController,u.value=!0,q.HttpRequester.getInstance(q.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=C.value)==null||R.abort(),C.value=new AbortController,q.HttpRequester.getInstance(q.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},C.value.signal).then(H=>{d.value=d.value.map(U=>H.data.find(X=>X.id===U.id)??U),_.value.itemCount!==H.meta.total&&(_.value.itemCount=H.meta.total),_.value.pageCount!==H.meta.lastPage&&(_.value.pageCount=H.meta.lastPage)}).catch(H=>{if((H==null?void 0:H.name)!=="CanceledError")throw H}))},I=R=>R.meta.total===_.value.itemCount&&z.isEqual(z.map(R.data,"id"),z.map(d.value,"id")),K=async()=>{var H,U;if(!r.filters||u.value)return!1;(H=C.value)==null||H.abort(),C.value=null,(U=N.value)==null||U.abort(),N.value=new AbortController;let R;try{R=await q.HttpRequester.getInstance(q.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,F(),o("update:pagination",_.value)},A=R=>{_.value.pageSize=R,_.value.page=1,F(),o("update:pagination",_.value)},O=R=>{if(z.isNull(R))c.value=l();else{const[H]=c.value;H.field=R.columnKey.toString(),H.direction=R.order==="ascend"?"asc":"desc",c.value=[H]}y.value.forEach(H=>{if(Object.hasOwn(H,"sortOrder")){const U=H;U.sortOrder=U.key===(R==null?void 0:R.columnKey)&&(R!=null&&R.sorter)&&R.order!==!1?R.order:!1}}),F(),o("update:sort",c.value)},V=()=>{y.value=b(),h.value=window.innerHeight,m.value=f()};return n.watch(()=>r.filters,()=>{_.value.page=1,F(),$()}),n.watch(()=>r.sort,()=>{c.value=l(),_.value.page=1,F(),$()}),n.onMounted(()=>{V(),window.addEventListener("resize",V),n.nextTick(()=>{F(),$()})}),n.onUnmounted(()=>{var R,H,U;window.removeEventListener("resize",V),(R=x.value)==null||R.abort(),(H=C.value)==null||H.abort(),(U=N.value)==null||U.abort(),v()}),e({reload:F,checkForUpdates:K,applyPendingUpdate:J,discardPendingUpdate:Z}),(R,H)=>{const U=M.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":A,"onUpdate:sorter":O},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),J3=An(Q3,[["__scopeId","data-v-aff76adb"]]),e5=n.computed(()=>q.useReferencesStore().deliveryTypeReference??[]),t5=n.computed(()=>q.useReferencesStore().managersList??[]),n5=n.computed(()=>q.useReferencesStore().opfReference??[]),i5=n.computed(()=>q.useReferencesStore().partnerGroupsReference??[]),r5=n.computed(()=>q.useReferencesStore().priceCoefficientsReference??[]),o5=n.computed(()=>q.useReferencesStore().productFilesTypesReference??[]),s5=n.computed(()=>q.useReferencesStore().resourceTypesReference),a5=n.computed(()=>q.useReferencesStore().salesDirectionsReference??[]),l5=n.computed(()=>q.useReferencesStore().warehousesReference??[]),c5=n.computed(()=>q.useReferencesStore().paymentTypeReference??[]),Zh=n.computed(()=>q.useReferencesStore().orderStatusReference??[]),d5=n.computed(()=>q.useReferencesStore().orderStatusDetailReference??[]),u5=n.computed(()=>q.useReferencesStore().operatorReference??[]),f5=n.computed(()=>bt.convertReferencesToSelectOptionsList(q.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),h5=n.computed(()=>bt.convertReferencesToSelectOptionsList(q.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),m5=t=>q.HttpRequester.getInstance(q.ReferenceDataProvider).searchCity(t),p5=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()),g5=t=>q.HttpRequester.getInstance(q.ClientDataProvider).searchClient(t),y5=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()),b5={class:"flex flex-col gap-4"},_5={class:"flex flex-wrap gap-2"},w5={class:"flex flex-col gap-1.5"},x5={class:"inline-flex items-center gap-2"},k5={class:"flex flex-col gap-1.5"},v5={class:"inline-flex items-center gap-2"},C5={},S5=n.defineComponent({...C5,__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??Zh.value),s=d=>!!d&&i.settings.statuses.includes(d),a=(d,u)=>{if(!d)return;const h=i.settings.statuses.filter(f=>f!==d);r("update:settings",{...i.settings,statuses:u?[...h,d]:h})},l=(d,u)=>{const h=i.settings.markers.filter(f=>f!==d);r("update:settings",{...i.settings,markers:u?[...h,d]:h})},c=d=>{r("update:settings",{statuses:d?o.value.flatMap(u=>u.slug?[u.slug]:[]):[],markers:d?[...io]:[]})};return(d,u)=>{const h=M.NButton,f=M.NCheckbox;return n.openBlock(),n.createElementBlock("div",b5,[n.createElementVNode("div",_5,[n.createVNode(h,{size:"small",onClick:u[0]||(u[0]=m=>c(!0))},{default:n.withCtx(()=>[...u[2]||(u[2]=[n.createTextVNode(" Выделять всё ",-1)])]),_:1}),n.createVNode(h,{size:"small",onClick:u[1]||(u[1]=m=>c(!1))},{default:n.withCtx(()=>[...u[3]||(u[3]=[n.createTextVNode(" Снять всё ",-1)])]),_:1})]),n.createElementVNode("div",w5,[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(f,{key:m.id,checked:s(m.slug),"onUpdate:checked":p=>a(m.slug,p)},{default:n.withCtx(()=>[n.createElementVNode("span",x5,[n.createVNode(cl,{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",k5,[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(io),m=>(n.openBlock(),n.createBlock(f,{key:m,checked:t.settings.markers.includes(m),"onUpdate:checked":p=>l(m,p)},{default:n.withCtx(()=>[n.createElementVNode("span",v5,[n.createVNode(cl,{colors:n.unref(vr)(m)},null,8,["colors"]),n.createTextVNode(" "+n.toDisplayString(n.unref(xs)(m)),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))])])}}}),B5=["href"],T5={class:"text-sc-dark-grey"},N5={},$5=n.defineComponent({...N5,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const i=t,r=e,o=n.computed(()=>Me.format(i.order.createdAt,q.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{z.isNil(i.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",i.order,a)};return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("span",null,[l[1]||(l[1]=n.createTextVNode(" #",-1)),n.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},n.toDisplayString(t.order.id),9,B5),n.createTextVNode(" от "+n.toDisplayString(o.value),1)]),l[2]||(l[2]=n.createTextVNode(", ",-1)),n.createElementVNode("span",T5,"автор: "+n.toDisplayString(t.order.creator.name)+" ["+n.toDisplayString(t.order.creator.type)+"]",1)],64))}}),E5={class:"sc-page flex flex-col bg-inherit"},R5={class:"my-2 flex flex-row items-end"},P5={class:"sc-title grow"},F5={key:0,class:"sc-title-buttons flex-1 grow-0"},V5={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},M5={key:0,class:"sc-title-extra mt-2 sm:mt-4"},I5={},Qh=n.defineComponent({...I5,__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=M.NH1;return n.openBlock(),n.createElementBlock("div",E5,[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",R5,[n.createElementVNode("div",P5,[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",F5,[n.createElementVNode("div",V5,[n.renderSlot(r.$slots,"title-buttons")])])):n.createCommentVNode("",!0)]),r.$slots["title-extra"]?(n.openBlock(),n.createElementBlock("div",M5,[n.renderSlot(r.$slots,"title-extra")])):n.createCommentVNode("",!0),n.renderSlot(r.$slots,"sticky-extra")],6),n.renderSlot(r.$slots,"default")])}}}),A5={class:"overflow-hidden transition-all duration-300"},O5={class:"text-lg font-medium leading-none"},z5={},Jh=n.defineComponent({...z5,__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),a=()=>{switch(et.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?z.isUndefined(i.drawerWidth)?o.value=a():o.value=z.isFunction(i.drawerWidth)?i.drawerWidth():i.drawerWidth:o.value=0};return n.watch(()=>i.drawerWidth,()=>{l()}),n.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),n.watch(()=>i.showDrawer,c=>{s.value=c}),n.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=M.NDrawerContent,h=M.NDrawer;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",A5,[n.createElementVNode("div",{style:n.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[n.renderSlot(c.$slots,"default")],4)]),n.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=f=>s.value=f),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",O5,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)}}}),D5={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},L5={key:0},H5={class:"sc-page-preview-panel grow"},W5={key:1,class:"sc-page-preview-panel-extra flex-none"},j5={},q5=n.defineComponent({...j5,__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:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&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+l,behavior:"smooth"})})},showPanel:r,closePanel:o}),(l,c)=>{const d=M.NButton;return n.openBlock(),n.createBlock(Qh,{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(Jh,{"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(l.$slots,"panel-content")]),default:n.withCtx(()=>[n.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:n.withCtx(()=>[n.createElementVNode("div",D5,[t.isShowPanelButtonVisible?(n.openBlock(),n.createElementBlock("div",L5,[n.renderSlot(l.$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",H5,[n.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(n.openBlock(),n.createElementBlock("div",W5,[n.renderSlot(l.$slots,"preview-panel-extra")])):n.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),X5={},Y5=n.defineComponent({...X5,__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(()=>z.isArray(r.value)),a=n.computed(()=>{var p;return z.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=n.computed(()=>{const p=new q.Curator({id:-1,name:"",contacts:{},curatedDirection:new q.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 q.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),g}),c=n.computed(()=>bt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,p=>{const g=z.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"),h=p=>{if(z.isArray(p)){const g=p.length>0?p.map(b=>l.value.find(y=>y.id===b)).filter(b=>!z.isNil(b)):[];o("update:value",g)}else{const g=p>0?l.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(M.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),U5={},K5=n.defineComponent({...U5,__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(()=>z.isArray(r.value)),a=n.computed(()=>{var y;return z.isArray(r.value)?r.value.filter(_=>!z.isNil(_)).map(_=>_.id):((y=r.value)==null?void 0:y.id)??null}),l=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(C=>({label:C.name,value:C.id,item:C}))});let _=r.managerReferenceList;if(r.showActualOnly){const C=z.isArray(r.value)?r.value.map(N=>N.id):[(x=r.value)==null?void 0:x.id];_=_.filter(N=>N.isActive||C.includes(N.id))}const k=bt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,C=>`${C.name}${C.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=z.isArray(r.value)?r.value.map(w=>w.id):[(N=r.value)==null?void 0:N.id],_=w=>r.showActualOnly?w.filter(S=>!("isActive"in S)||S.isActive||y.includes(S.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 C=_(r.operatorReferenceList);return C.length>0&&k.push({type:"group",label:"Операторы",key:"operators",children:bt.convertReferencesToSelectOptionsList(C,!0,!1,!1,d)}),k}),h=n.computed(()=>r.groupByEmployeeType?u.value:c.value),f=n.computed(()=>h.value.map(y=>({...y,class:r.wrapContent?`${y.class??""} consistent-menu-width`:y.class}))),m=n.useTemplateRef("select-component"),p=y=>{if(z.isArray(y)){const _=y.map(k=>l.value.find(x=>x.id===k)).filter(k=>!z.isNil(k));o("update:value",_)}else{const _=z.isNil(y)?null:l.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(M.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||h.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:f.value,placeholder:"",class:"w-full","onUpdate:value":p},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),G5={},Z5=n.defineComponent({...G5,__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(()=>z.isArray(r.value)),a=n.computed(()=>{var p;return z.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=n.computed(()=>r.showEmptyValue?[q.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=n.computed(()=>{var b;let p=l.value,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=z.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];g=z.union(g,l.value.filter(_=>!_.isActive).map(_=>_.id)),p=p.filter(_=>(r.showEmptyValue?q.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&&z.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"),h=p=>{if(z.isArray(p)){const g=p.length>0?p.filter(b=>!z.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!z.isNil(b)):[];o("update:value",g)}else{const g=p>0&&!z.some(r.disabledManagerReferenceList,["id",p])?l.value.find(b=>b.id===p):new q.Manager;o("update:value",g??new q.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;z.some(g,b=>z.some(p,["id",b.id]))&&o("update:value",g.filter(b=>!z.some(p,["id",b.id])))}else{const g=r.value;z.some(p,["id",g.id])&&o("update:value",new q.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(M.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Q5={class:"m-0.5 flex flex-col p-0.5"},J5={class:"flex flex-row gap-1"},eT={key:0},tT={key:1},nT={key:2},iT={key:3},rT={class:"flex flex-row gap-1"},oT={key:0},sT={key:1},aT={key:2},lT={key:3},cT={},em=n.defineComponent({...cT,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",Q5,[n.createElementVNode("span",J5,[t.addr.postIndex?(n.openBlock(),n.createElementBlock("span",eT,n.toDisplayString(t.addr.postIndex)+", ",1)):n.createCommentVNode("",!0),t.addr.city?(n.openBlock(),n.createElementBlock("span",tT,n.toDisplayString(t.addr.city)+", ",1)):n.createCommentVNode("",!0),t.addr.locality?(n.openBlock(),n.createElementBlock("span",nT,n.toDisplayString(t.addr.locality)+", ",1)):n.createCommentVNode("",!0),t.addr.region?(n.openBlock(),n.createElementBlock("span",iT,n.toDisplayString(t.addr.region)+", ",1)):n.createCommentVNode("",!0)]),n.createElementVNode("span",rT,[t.addr.street?(n.openBlock(),n.createElementBlock("span",oT,n.toDisplayString(t.addr.street)+", ",1)):n.createCommentVNode("",!0),t.addr.building?(n.openBlock(),n.createElementBlock("span",sT,n.toDisplayString(t.addr.building)+", ",1)):n.createCommentVNode("",!0),t.addr.buildingPart?(n.openBlock(),n.createElementBlock("span",aT,n.toDisplayString(t.addr.buildingPart)+", ",1)):n.createCommentVNode("",!0),t.addr.apartments?(n.openBlock(),n.createElementBlock("span",lT,n.toDisplayString(t.addr.apartments)+", ",1)):n.createCommentVNode("",!0)])]))}}),ul={clearable:!1,value:"",field:void 0,disabled:!1},dT={},uT=n.defineComponent({...dT,__name:"address-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...ul,minTermLength:()=>{var t,e;return((e=(t=q.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),a=n.ref(!1),l=n.ref([]),c=n.computed(()=>l.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=z.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(s.value,a):q.HttpRequester.getInstance(q.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return n.h(em,{addr:y,selected:b},{default:z.constant("-")})},f=g=>{d.cancel();const b=l.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=M.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:a.value,options:c.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:f},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),fT={class:"m-0.5 flex flex-col p-0.5"},hT={class:"font-medium"},mT={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},pT={key:0},gT={key:1},yT={},tm=n.defineComponent({...yT,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",fT,[n.createElementVNode("span",hT,n.toDisplayString(t.bank.name),1),n.createElementVNode("span",mT,[t.bank.bic?(n.openBlock(),n.createElementBlock("span",pT," БИК: "+n.toDisplayString(t.bank.bic),1)):n.createCommentVNode("",!0),t.bank.inn?(n.openBlock(),n.createElementBlock("span",gT," ИНН: "+n.toDisplayString(t.bank.inn),1)):n.createCommentVNode("",!0)])]))}}),bT={},_T=n.defineComponent({...bT,__name:"bank-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...ul,minTermLength:()=>{var t,e;return((e=(t=q.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),a=n.ref(!1),l=n.ref([]),c=n.computed(()=>l.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=z.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await q.HttpRequester.getInstance(q.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return n.h(tm,{bank:y,selected:b},{default:z.constant("-")})},f=g=>{d.cancel();const b=l.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=M.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:a.value,options:c.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:f},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),wT={class:"font-medium"},xT={key:0,class:"flex flex-row gap-2"},kT={key:0,class:"text-xs font-light text-blue-800"},vT={key:1,class:"text-sc-dark-grey text-xs font-light"},CT={},nm=n.defineComponent({...CT,__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",wT,n.toDisplayString(t.org.name),1),t.org.inn||r.value?(n.openBlock(),n.createElementBlock("div",xT,[t.org.inn?(n.openBlock(),n.createElementBlock("span",kT,n.toDisplayString(t.org.inn),1)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("span",vT,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),ST={},BT=n.defineComponent({...ST,__name:"org-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...ul,minTermLength:()=>{var t,e;return((e=(t=q.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),a=n.ref(!1),l=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(l.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=z.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await q.HttpRequester.getInstance(q.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},f=(b,y)=>{const _=l.value.find(k=>k.id===b.value)||{};return n.h(nm,{org:_,selected:y},{default:z.constant("-")})},m=b=>{u.cancel();const y=l.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 _=M.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:a.value,options:d.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:m},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}});Y.ALL_ORDER_MARKERS=io,Y.CommonValidators=mm,Y.ConfiguratorSettingsKozyrek=_u,Y.ConfiguratorSettingsMosquito=Zw,Y.ContentHelper=_i,Y.DEFAULT_ORDER_STATUS_COLORS=_s,Y.DateValidators=pm,Y.EntityNameHelper=ni,Y.FileHelper=hm,Y.KozyrekLine=Nn,Y.KozyrekTailTemplate=Ca,Y.KozyrekTemplate=cr,Y.NumericValidators=le,Y.ORDER_MARKER_COLORS=ws,Y.ORDER_MARKER_NAMES=Ol,Y.ORDER_STATUS_COLORS=Ml,Y.OrderMarkerEnum=it,Y.OrdersTableFields=Fe,Y.Point=va,Y.ScAddProductToCartDialog=j_,Y.ScAddressSuggestion=uT,Y.ScAddressSuggestionLabel=em,Y.ScBankSuggestion=_T,Y.ScBankSuggestionLabel=tm,Y.ScBaseDialog=Ts,Y.ScButtonWithConfirmAction=ym,Y.ScCategoryCollapse=zu,Y.ScClientNameWithShortInfo=Vr,Y.ScCollapse=Ou,Y.ScCollapseItem=Wl,Y.ScCommentEditor=ok,Y.ScConfiguratorsProductInfo=Tr,Y.ScContragentWithShortInfo=Lu,Y.ScCreatorUserTypeTag=Gr,Y.ScCuratorSelect=Y5,Y.ScDateRange=Fx,Y.ScDateTimeLabel=Xo,Y.ScDebouncedInput=yk,Y.ScDebouncedInputNumber=_k,Y.ScDebt=Ax,Y.ScDialogHeader=Wx,Y.ScDynamicConfigurator=Mu,Y.ScEmail=sw,Y.ScExternalLink=$k,Y.ScImageGallery=Ul,Y.ScInlineEditableItem=Zu,Y.ScInlineView=Ba,Y.ScKozyrekConfigurator=wu,Y.ScKozyrekConfiguratorParamsForm=Ql,Y.ScKozyrekConfiguratorPreview=bu,Y.ScKozyrekConfiguratorTemplates=yu,Y.ScLightGallery=Yl,Y.ScManagerOperatorSelect=K5,Y.ScManagerSelect=Z5,Y.ScMetalForDoorsConfigurator=$u,Y.ScMetalForDoorsConfiguratorForm=Nu,Y.ScMosquitoConfigurator=vu,Y.ScMosquitoConfiguratorForm=xu,Y.ScMosquitoConfiguratorMeasurementInstructions=ku,Y.ScMosquitoConfiguratorPreview=Sa,Y.ScOrderColorSwatch=cl,Y.ScOrderCommonInfo=Wh,Y.ScOrderDeliveryLabel=hs,Y.ScOrderDetails=Uh,Y.ScOrderExternalLinks=Kh,Y.ScOrderHighlightSettings=S5,Y.ScOrderInfo=Gh,Y.ScOrderItemParams=Hh,Y.ScOrderItemsList=Xh,Y.ScOrderPayment=ll,Y.ScOrderProductInfo=jh,Y.ScOrderStatusHistory=Yh,Y.ScOrderStatusTag=qh,Y.ScOrdersList=J3,Y.ScOrgSuggestion=BT,Y.ScOrgSuggestionLabel=nm,Y.ScPage=Qh,Y.ScPageWithSlidingPanel=q5,Y.ScPersonContactsBlock=Gw,Y.ScPhone=Ew,Y.ScPhoneInput=kk,Y.ScProductInfoContent=Bs,Y.ScProductInfoDialog=Kl,Y.ScProductInfoPopover=Gl,Y.ScProductName=Br,Y.ScProductsList=iB,Y.ScReferenceSelect=Du,Y.ScSandwichConfigurator=Pu,Y.ScSandwichConfiguratorForm=Ru,Y.ScSandwichM2Configurator=Vu,Y.ScSandwichM2ConfiguratorForm=Fu,Y.ScSearchableProductSelect=Lh,Y.ScSearchableReferenceSelect=Dh,Y.ScSetClientPriceFormItem=D_,Y.ScShortTextOrderInfo=$5,Y.ScSingleFileUploadSelector=dk,Y.ScSlidingContentWithDrawer=Jh,Y.ScStripConfigurator=Tu,Y.ScStripConfiguratorForm=Su,Y.ScStripConfiguratorLineItem=Cu,Y.ScStripConfiguratorPreview=Bu,Y.ScUserShortInfo=dl,Y.ScWarningIcon=pk,Y.SelectOptionHelper=bt,Y.UiNotificationProvider=xr,Y.Validators=We,Y.WindowResolutionEnum=Xe,Y.WindowResolutionProvider=et,Y.channelPrimaryInterestOptionsList=f5,Y.componentSizeInjectionKey=Cr,Y.copyToClipboard=Rl,Y.deliveryTypeReferenceList=e5,Y.getOrderMarkerColors=vr,Y.getOrderMarkerName=xs,Y.getOrderMarkers=ks,Y.getOrderStatusColors=bi,Y.getOrderStatusCssVariables=Al,Y.getOrderStatusTagColor=Il,Y.getProductInfoFiles=vs,Y.handleFloatInput=ro,Y.handleIntegerInput=at,Y.hasProductInfo=zl,Y.isCanSandwichM2Show=Qw,Y.isCanSandwichShow=Au,Y.isConfiguratorType=Iu,Y.managersReferenceList=t5,Y.naiveUiTheme=ip,Y.operatorReferenceList=u5,Y.opfReferenceList=n5,Y.orderStatusDetailReferenceList=d5,Y.orderStatusReferenceList=Zh,Y.parse=ct,Y.partnerGroupReferenceList=i5,Y.paymentTypeReferenceList=c5,Y.priceCoefficientsReferenceList=r5,Y.productFilesTypesReferenceList=o5,Y.renderConfig=qe,Y.resetInputValidation=rt,Y.resourceReferencesList=s5,Y.salesDirectionsReferenceList=a5,Y.searchCityReferenceDataHandler=m5,Y.searchCityReferenceLabelRenderer=p5,Y.searchClientReferenceDataHandler=g5,Y.searchClientReferenceLabelRenderer=y5,Y.selectAllTextOnFocus=He,Y.sourcePrimaryInterestOptionsList=h5,Y.vCopy=Pl,Y.vFocusNext=ti,Y.warehousesReferenceList=l5,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[Mh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function fs(t){return t.type==="group"}function zh(t){return t.type==="ignored"}function al(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function jS(t,e){return{getIsGroup:fs,getIgnored:zh,getKey(r){return fs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function qS(t,e,i,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(fs(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(zh(l))continue;e(i,l)&&a.push(l)}return a}return o(t)}function XS(t,e,i){const r=new Map;return t.forEach(o=>{fs(o)?o[i].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var YS={};const US=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}),KS=n.defineComponent({name:"Select",props:US,slots:Object,setup(t){YS.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}=Mi(t),s=Nt("Select","-select",WS,HS,t,e),a=n.ref(t.defaultValue),l=n.toRef(t,"value"),c=Ma(l,a),d=n.ref(!1),u=n.ref(""),h=ff(t,["items","options"]),f=n.ref([]),m=n.ref([]),p=n.computed(()=>m.value.concat(f.value).concat(h.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 al(me,xe);const Se=ge[se];return typeof Se=="string"?al(me,Se):typeof Se=="number"?al(me,String(Se)):!1}}),b=n.computed(()=>{if(t.remote)return h.value;{const{value:D}=p,{value:Q}=u;return!Q.length||!t.filterable?D:qS(D,g.value,Q,t.childrenField)}}),y=n.computed(()=>{const{valueField:D,childrenField:Q}=t,se=jS(D,Q);return xv(b.value,se)}),_=n.computed(()=>XS(p.value,t.valueField,t.childrenField)),k=n.ref(!1),x=Ma(n.toRef(t,"show"),k),C=n.ref(null),T=n.ref(null),w=n.ref(null),{localeRef:S}=wh("Select"),v=n.computed(()=>{var D;return(D=t.placeholder)!==null&&D!==void 0?D:S.value.placeholder}),$=[],E=n.ref(new Map),F=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}=F,xe=[];return D.forEach(Se=>{if(me.has(Se))xe.push(me.get(Se));else if(Q&&se.has(Se))xe.push(se.get(Se));else if(ge){const Ne=ge(Se);Ne&&xe.push(Ne)}}),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=e2(t),{mergedSizeRef:Z,mergedDisabledRef:L,mergedStatusRef:A}=J;function O(D,Q){const{onChange:se,"onUpdate:value":me,onUpdateValue:ge}=t,{nTriggerFormChange:xe,nTriggerFormInput:Se}=J;se&&Bt(se,D,Q),ge&&Bt(ge,D,Q),me&&Bt(me,D,Q),a.value=D,xe(),Se()}function V(D){const{onBlur:Q}=t,{nTriggerFormBlur:se}=J;Q&&Bt(Q,D),se()}function R(){const{onClear:D}=t;D&&Bt(D)}function H(D){const{onFocus:Q,showOnFocus:se}=t,{nTriggerFormFocus:me}=J;Q&&Bt(Q,D),me(),se&&j()}function Y(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 W(D){const{onUpdateShow:Q,"onUpdate:show":se}=t;Q&&Bt(Q,D),se&&Bt(se,D),k.value=D}function j(){L.value||(W(!0),k.value=!0,t.filterable&&pi())}function ae(){W(!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():ae():j())}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,V(D),ae())}function $e(D){H(D),d.value=!0}function Zt(){d.value=!0}function gn(D){var Q;!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(D.relatedTarget)||(d.value=!1,V(D),ae())}function Rt(){var D;(D=C.value)===null||D===void 0||D.focus(),ae()}function Jn(D){var Q;x.value&&(!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(Ir(D))||ae())}function yn(D){if(!Array.isArray(D))return[];if(F.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 an(D){Ve(D.rawNode)}function Ve(D){if(L.value)return;const{tag:Q,remote:se,clearFilterAfterSelect:me,valueField:ge}=t;if(Q&&!se){const{value:xe}=m,Se=xe[0]||null;if(Se){const Ne=f.value;Ne.length?Ne.push(Se):f.value=[Se],m.value=$}}if(se&&E.value.set(D[ge],D),t.multiple){const xe=yn(c.value),Se=xe.findIndex(Ne=>Ne===D[ge]);if(~Se){if(xe.splice(Se,1),Q&&!se){const Ne=te(D[ge]);~Ne&&(f.value.splice(Ne,1),me&&(u.value=""))}}else xe.push(D[ge]),me&&(u.value="");O(xe,P(xe))}else{if(Q&&!se){const xe=te(D[ge]);~xe?f.value=[f.value[xe]]:f.value=$}gr(),ae(),O(D[ge],D)}}function te(D){return f.value.findIndex(se=>se[t.valueField]===D)}function ce(D){x.value||j();const{value:Q}=D.target;u.value=Q;const{tag:se,remote:me}=t;if(Y(Q),se&&!me){if(!Q){m.value=$;return}const{onCreate:ge}=t,xe=ge?ge(Q):{[t.labelField]:Q,[t.valueField]:Q},{valueField:Se,labelField:Ne}=t;h.value.some(Je=>Je[Se]===xe[Se]||Je[Ne]===xe[Ne])||f.value.some(Je=>Je[Se]===xe[Se]||Je[Ne]===xe[Ne])?m.value=$:m.value=[xe]}}function Me(D){D.stopPropagation();const{multiple:Q}=t;!Q&&t.filterable&&ae(),R(),Q?O([],[]):O(null,null)}function mi(D){!Mr(D,"action")&&!Mr(D,"empty")&&!Mr(D,"header")&&D.preventDefault()}function lt(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=C.value)===null||Q===void 0)&&Q.isComposing)){if(x.value){const Se=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();Se?an(Se):t.filterable||(ae(),gr())}else if(j(),t.tag&&ve.value){const Se=m.value[0];if(Se){const Ne=Se[t.valueField],{value:Je}=c;t.multiple&&Array.isArray(Je)&&Je.includes(Ne)||Ve(Se)}}}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():j();break;case"Escape":x.value&&(GC(D),ae()),(xe=C.value)===null||xe===void 0||xe.focus();break}}function gr(){var D;(D=C.value)===null||D===void 0||D.focus()}function pi(){var D;(D=C.value)===null||D===void 0||D.focusInput()}function Li(){var D;x.value&&((D=T.value)===null||D===void 0||D.syncPosition())}X(),n.watch(n.toRef(t,"options"),X);const yr={focus:()=>{var D;(D=C.value)===null||D===void 0||D.focus()},focusInput:()=>{var D;(D=C.value)===null||D===void 0||D.focusInput()},blur:()=>{var D;(D=C.value)===null||D===void 0||D.blur()},blurInput:()=>{var D;(D=C.value)===null||D===void 0||D.blurInput()}},bn=n.computed(()=>{const{self:{menuBoxShadow:D}}=s.value;return{"--n-menu-box-shadow":D}}),ei=o?Ii("select",void 0,bn,t):void 0;return Object.assign(Object.assign({},yr),{mergedStatus:A,mergedClsPrefix:e,mergedBordered:i,namespace:r,treeMate:y,isMounted:Jo(),triggerRef:C,menuRef:w,pattern:u,uncontrolledShow:k,mergedShow:x,adjustedTo:jn(t),uncontrolledValue:a,mergedValue:c,followerRef:T,localizedPlaceholder:v,selectedOption:K,selectedOptions:I,mergedSize:Z,mergedDisabled:L,focused:d,activeWithoutMenuOpen:ve,inlineThemeDisabled:o,onTriggerInputFocus:st,onTriggerInputBlur:_e,handleTriggerOrMenuResize:Li,handleMenuFocus:Zt,handleMenuBlur:gn,handleMenuTabOut:Rt,handleTriggerClick:we,handleToggle:an,handleDeleteOption:Ve,handlePatternInput:ce,handleClear:Me,handleTriggerBlur:xt,handleTriggerFocus:$e,handleKeydown:Qt,handleMenuAfterLeave:de,handleMenuClickOutside:Jn,handleMenuScroll:lt,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(gf,null,{default:()=>[n.h(yf,null,{default:()=>n.h(DS,{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(Pf,{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(pS,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],[Qo,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Qo,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),GS={},Dh=n.defineComponent({...GS,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=q.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(()=>z.isArray(r.value)),a=n.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=n.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=n.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=n.ref(!1),u=n.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(k=>{if(z.isEmpty(k))return;const x=s.value?r.value:r.value?[r.value]:[],C=k.filter(T=>!x.some(w=>w.id===T.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const m=z.debounce(()=>h(f),800),p=_=>{f=_,m()},g=_=>{var k;if(z.isArray(_)){const x=_.length>0?_.map(C=>{var T;return n.toRaw((T=l.value.find(w=>w.value===C))==null?void 0:T.item)}):[];o("update:value",x)}else if(_>0){const x=n.toRaw((k=l.value.find(C=>C.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(KS),{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:a.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"]))}}),ZS={},Lh=n.defineComponent({...ZS,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=q.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"),a=async h=>r.searchType==="categories"?q.HttpRequester.getInstance(q.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?q.HttpRequester.getInstance(q.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(h,f)=>{if(r.renderLabel)return r.renderLabel(h,f);if(r.searchType==="products"){const m=h.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=h.item;return n.h("div",{},[m.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,f)=>(n.openBlock(),n.createBlock(Dh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":f[0]||(f[0]=m=>o("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),QS={class:"col-span-2 flex flex-row gap-2.5"},JS={class:"flex-1"},eB={class:"text-sc-grey"},tB={class:"ml-2.5"},nB={key:0,class:"flex-none"},iB={},rB=n.defineComponent({...iB,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=q.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)),a=n.ref(s()),l=()=>{r("update:value",a.value.map(h=>n.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>n.toRaw(f)),...(z.isArray(h)?h:[h]).filter(f=>!a.value.some(m=>m.id===f.id))],n.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:n.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return n.watch(()=>i.value,()=>{a.value=s()}),(h,f)=>{const m=M.NListItem,p=Fk,g=M.NButton,b=M.NList;return n.openBlock(),n.createBlock(b,{"show-divider":!1,hoverable:!0},{header:n.withCtx(()=>[n.renderSlot(h.$slots,"header")]),footer:n.withCtx(()=>[n.createVNode(Lh,{value:o.value,"onUpdate:value":[f[0]||(f[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(()=>[a.value.length===0?(n.openBlock(),n.createBlock(m,{key:0,class:"text-center text-sm text-gray-600"},{default:n.withCtx(()=>[...f[1]||(f[1]=[n.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.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",QS,[n.createElementVNode("span",JS,[n.createElementVNode("span",eB,n.toDisplayString(y.code),1),n.createElementVNode("span",tB,n.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(n.openBlock(),n.createElementBlock("div",nB,[n.renderSlot(h.$slots,"item-extra",{item:y,updateItemCallback:d})])):n.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),oB={class:"flex flex-col"},sB={class:"flex flex-col gap-1.5 text-base text-nowrap"},aB={class:"font-medium"},lB={class:"flex flex-col text-sc-dark-grey"},cB={key:0},dB={class:"font-medium"},uB={class:"font-medium"},fB={class:"font-medium"},hB={class:"font-medium"},mB={class:"font-medium"},pB={class:"font-medium"},gB={class:"font-medium"},yB={class:"font-medium"},bB={class:"font-medium"},_B={class:"font-medium"},wB={class:"flex flex-col gap-1.5 text-base text-nowrap"},xB={class:"font-medium"},kB={class:"flex flex-col text-sc-dark-grey"},vB={class:"font-medium"},CB={class:"font-medium"},SB={class:"flex flex-col gap-1.5 text-base text-nowrap"},BB={class:"font-medium"},NB={class:"text-sc-dark-grey"},TB={class:"font-medium"},$B={key:1,class:"text-base font-medium text-nowrap"},EB={},Hh=n.defineComponent({...EB,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[q.ConfiguratorsEnum.Kozyrek,q.ConfiguratorsEnum.Mosquitto,q.ConfiguratorsEnum.Strip,q.ConfiguratorsEnum.MetalForDoors,q.ConfiguratorsEnum.Sandwich,q.ConfiguratorsEnum.SandwichM2],i=t,r=n.ref(!1),o=n.computed(()=>{var f,m;return((f=i.item.product.unit)==null?void 0:f.isLinear)&&((m=i.item.product.properties)==null?void 0:m.isLengthConfigurator)}),s=n.computed(()=>q.UnitsHelper.getProductLengthMultiplicity(i.item.product)),a=n.computed(()=>q.UnitsHelper.getProductMultiplicity(i.item.product)),l=n.computed(()=>a.value>1),c=n.ref({quantity:i.item.quantity});n.watch(()=>i.item,f=>{c.value={quantity:f.quantity}});const d=f=>{var m;f!==null&&(c.value.quantity=f,(m=i.eventEmitter)==null||m.emit("order-item:edit-quantity",{item:i.item,quantity:f,loaderRef:r}))},u=()=>{var f;(f=i.eventEmitter)==null||f.emit("order-item:open-configurator",{item:i.item})},h=()=>{var f;(f=i.eventEmitter)==null||f.emit("order-item:edit",{item:i.item})};return(f,m)=>{const p=M.NInputNumber;return n.openBlock(),n.createElementBlock("div",oB,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",sB,[n.createElementVNode("span",null,[m[1]||(m[1]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",aB,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",lB,[t.item.configurator===n.unref(q.ConfiguratorsEnum).Kozyrek?(n.openBlock(),n.createElementBlock("span",cB,[m[2]||(m[2]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",dB,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.ConfiguratorsEnum).Mosquitto?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("span",null,[m[3]||(m[3]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",uB,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[4]||(m[4]=n.createTextVNode(" Высота: ",-1)),n.createElementVNode("span",fB,n.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.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",hB,n.toDisplayString(g)+" мм.",1)]))),128)),n.createElementVNode("span",null,[m[5]||(m[5]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",mB,n.toDisplayString(t.item.length)+" м.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.ConfiguratorsEnum).MetalForDoors?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("span",null,[m[6]||(m[6]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",pB,n.toDisplayString(t.item.width)+" мм.",1)]),n.createElementVNode("span",null,[m[7]||(m[7]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",gB,n.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.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",yB,n.toDisplayString(g.width)+"×"+n.toDisplayString(g.length)+" мм, "+n.toDisplayString(g.count)+" шт.",1)]))),128)):n.createCommentVNode("",!0),t.item.configurator===n.unref(q.ConfiguratorsEnum).SandwichM2?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("span",null,[m[8]||(m[8]=n.createTextVNode(" Ширина: ",-1)),n.createElementVNode("span",bB,n.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),n.createElementVNode("span",null,[m[9]||(m[9]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",_B,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",wB,[n.createElementVNode("span",null,[m[10]||(m[10]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",xB,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("div",kB,[n.createElementVNode("span",null,[m[11]||(m[11]=n.createTextVNode(" Длина: ",-1)),n.createElementVNode("span",vB,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",CB,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(h,["prevent"])}," Изменить ")):n.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("div",SB,[n.createElementVNode("span",null,[m[13]||(m[13]=n.createTextVNode(" Количество: ",-1)),n.createElementVNode("span",BB,n.toDisplayString(t.item.quantity)+" шт.",1)]),n.createElementVNode("span",NB,[m[14]||(m[14]=n.createTextVNode(" Метраж: ",-1)),n.createElementVNode("span",TB,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(h,["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:a.value,step:a.value,"show-button":l.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(ro)(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",$B,n.toDisplayString(t.item.quantity)+" "+n.toDisplayString(t.item.product.unit.name),1))],64))])}}}),RB={viewBox:"0 0 24 24",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:"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 FB=n.markRaw({name:"tabler-truck-filled",render:PB}),VB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MB(t,e){return n.openBlock(),n.createElementBlock("svg",VB,[...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 IB=n.markRaw({name:"tabler-truck-delivery",render:MB}),AB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OB(t,e){return n.openBlock(),n.createElementBlock("svg",AB,[...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 zB=n.markRaw({name:"tabler-truck-loading",render:OB}),DB={class:"flex flex-col gap-1"},LB={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},HB={key:1,class:"text-base"},WB={class:"text-sc-dark-grey mr-1.5"},jB={key:0},qB={key:1},XB={},hs=n.defineComponent({...XB,__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=q.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),i=n.computed(()=>Ie.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,a)=>{var u,h,f,m,p,g,b,y;const l=zB,c=IB,d=FB;return n.openBlock(),n.createElementBlock("div",DB,[t.showType?(n.openBlock(),n.createElementBlock("span",LB,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(n.openBlock(),n.createBlock(l,{key:0})):n.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(n.openBlock(),n.createBlock(c,{key:1})):n.createCommentVNode("",!0),((f=e.value)==null?void 0:f.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",HB,[n.createElementVNode("span",WB,n.toDisplayString(i.value),1),(g=(p=t.delivery)==null?void 0:p.address)!=null&&g.address?(n.openBlock(),n.createElementBlock("span",jB,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",qB," со склада "+n.toDisplayString(t.delivery.warehouse.address),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)])}}}),YB={class:"flex flex-col gap-2.5"},UB={class:"text-base"},KB=["href"],GB={key:1,class:"text-sc-grey"},ZB={},Wh=n.defineComponent({...ZB,__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(Fe.Id)?e.order.id:void 0),r=n.computed(()=>{var h,f;return e.fields.includes(Fe.Status)?(f=(h=q.useReferencesStore().orderStatusReference)==null?void 0:h.find(m=>{var p;return m.id===(((p=e.order.status)==null?void 0:p.id)??-1)}))==null?void 0:f.name:void 0}),o=n.computed(()=>{var h;return bi((h=e.order.status)==null?void 0:h.slug)}),s=n.computed(()=>{var f,m;const h=(f=e.order.status)==null?void 0:f.slug;return!!h&&(((m=e.highlightSettings)==null?void 0:m.statuses.includes(h))??!1)}),a=n.computed(()=>ks(e.order).filter(h=>[it.OnOrder,it.NotInStock].includes(h))),l=h=>{var f;return((f=e.highlightSettings)==null?void 0:f.markers.includes(h))??!1},c=n.computed(()=>e.fields.includes(Fe.CreatedAt)),d=n.computed(()=>e.fields.includes(Fe.ClientInfo)||e.fields.includes(Fe.ClientInfoShort)?e.order.client:void 0),u=n.computed(()=>e.fields.includes(Fe.DeliveryInfo)?e.order.delivery:void 0);return(h,f)=>(n.openBlock(),n.createElementBlock("div",YB,[n.createElementVNode("span",UB,[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,KB)):n.createCommentVNode("",!0),c.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[f[0]||(f[0]=n.createTextVNode(" от ",-1)),n.createVNode(Xo,{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},[f[1]||(f[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",GB,n.toDisplayString(r.value),1))],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m},[f[2]||(f[2]=n.createTextVNode(" - ",-1)),n.createElementVNode("span",{class:n.normalizeClass({"font-medium":l(m),"text-sc-dark-grey":!l(m)}),style:n.normalizeStyle(l(m)?{color:n.unref(vr)(m).color}:void 0)},n.toDisplayString(n.unref(xs)(m)),7)],64))),128))]),d.value?(n.openBlock(),n.createBlock(Vr,{key:0,client:d.value,class:"ml-3"},null,8,["client"])):n.createCommentVNode("",!0),u.value?(n.openBlock(),n.createBlock(hs,{key:1,delivery:u.value,class:"ml-3"},null,8,["delivery"])):n.createCommentVNode("",!0)]))}}),QB={},ll=n.defineComponent({...QB,__name:"order-payment",props:{payment:{}},setup(t){const e=t,i=n.computed(()=>{var r;return(r=q.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)}}}),JB={},Gr=n.defineComponent({...JB,__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={[q.UserTypeEnum.Manager]:"менеджером",[q.UserTypeEnum.Operator]:"оператором",[q.UserTypeEnum.Client]:"клиентом",[q.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>i[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${l}`}const a=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${a}`.trim()});return(s,a)=>(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))}}),e3={class:"flex flex-row gap-1.5"},t3={class:"flex-none text-nowrap"},n3={class:"flex flex-1 flex-col gap-2.5"},i3={key:0,class:"text-sm"},r3={class:"text-gray-600"},o3={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},s3={key:0},a3={key:1},l3={},jh=n.defineComponent({...l3,__name:"order-product-info",props:{product:{},index:{}},setup(t){const e=n.inject(q.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",e3,[n.createElementVNode("span",t3,n.toDisplayString(t.index+1)+".",1),n.createElementVNode("div",n3,[n.createVNode(Br,{product:t.product.product},null,8,["product"]),t.product.marker?(n.openBlock(),n.createElementBlock("span",i3,[o[0]||(o[0]=n.createTextVNode(" Маркировка: ",-1)),n.createElementVNode("span",r3,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(Gr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):n.createCommentVNode("",!0),n.createElementVNode("div",o3,[o[1]||(o[1]=n.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(n.openBlock(),n.createElementBlock("span",s3,n.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(n.openBlock(),n.createElementBlock("span",a3,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"])])])])}}}),c3={class:"flex items-center gap-1.5"},d3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},u3={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},f3={},qh=n.defineComponent({...f3,__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(()=>Il(e.status.slug)),o=n.computed(()=>e.statusDetail?`${e.status.name} (${e.statusDetail.name})`:e.status.name);return(s,a)=>{const l=M.NTag;return t.variant==="filled"?(n.openBlock(),n.createBlock(l,{key:0,color:r.value,bordered:!1,size:t.size,round:""},{default:n.withCtx(()=>[n.createElementVNode("span",c3,[t.showDot?(n.openBlock(),n.createElementBlock("span",d3)):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",u3)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(o.value),1)],4))}}}),h3={},cl=n.defineComponent({...h3,__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))}}),m3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function p3(t,e){return n.openBlock(),n.createElementBlock("svg",m3,[...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 g3=n.markRaw({name:"ion-trash-outline",render:p3}),y3={},b3=n.defineComponent({...y3,__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(M.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))}}),_3={class:"flex flex-col gap-0.5"},w3={class:"text-gray-600"},x3={},k3=n.defineComponent({...x3,__name:"order-item-name",props:{item:{}},setup(t){const e=t,i=n.inject(q.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)}),a=n.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),l=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",_3,[n.createElementVNode("div",{class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(Br,{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",w3,n.toDisplayString(t.item.marker),1)],2)):n.createCommentVNode("",!0),a.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(o.value?"line-through opacity-50":"")},[n.createVNode(b3,{src:a.value},null,8,["src"])],2)):n.createCommentVNode("",!0),s.value&&!o.value?(n.openBlock(),n.createBlock(Gr,{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&&l.value.length===0?(n.openBlock(),n.createBlock(Gr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):n.createCommentVNode("",!0),t.item.replacementId&&l.value.length>0?(n.openBlock(),n.createBlock(Gr,{key:4,"user-type":c.value,"changed-fields":l.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):n.createCommentVNode("",!0)]))}}),v3={},C3=n.defineComponent({...v3,__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(()=>z.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)},a=m=>e.selectable?{class:i.value.includes(m.id)?void 0:"opacity-60"}:{},l=(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(et.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(k3,{item:g})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:l,render:g=>n.h(Hh,{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:l,render:g=>o(g)?null:n.h(M.NButton,{quaternary:!0,type:"error",onClick:()=>{var b;(b=e.eventEmitter)==null||b.emit("order-item:delete",{item:g})}},()=>n.h(g3))}]:[]],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(M.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(jh,{product:g,index:b})}];case Xe.laptop:return[...p,...m];default:return[...p,...m]}},h=n.computed(()=>u()),f=()=>{c.value=et.getDeviceTypeByResolution(),d.value=window.innerWidth};return n.onMounted(()=>{f(),window.addEventListener("resize",f)}),n.onUnmounted(()=>{window.removeEventListener("resize",f)}),(m,p)=>{const g=M.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:h.value,data:r.value,"row-key":b=>b.id,"row-props":a,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Xh=An(C3,[["__scopeId","data-v-e1fad754"]]),S3={key:0,class:"text-sc-dark-grey my-2 text-center"},B3={key:1,class:"text-sc-dark-grey my-2"},N3={},Yh=n.defineComponent({...N3,__name:"order-status-history",props:{order:{}},setup(t){const e=t,i=n.ref(!1),r=n.ref([]),o=a=>{const{uiDateWithTime:l}=q.useBaseConfigStateStore().config.dateFormats;return Ie.format(a,l)},s=(a=!0)=>{a&&(i.value=!0),q.HttpRequester.getInstance(q.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(l=>{r.value=l}).finally(()=>{a&&(i.value=!1)})};return n.watch(()=>e.order,()=>{s(!1)}),n.onMounted(()=>{s()}),(a,l)=>{const c=M.NSpin,d=M.NTimelineItem,u=M.NTimeline;return n.openBlock(),n.createElementBlock("div",null,[l[1]||(l[1]=n.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),i.value?(n.openBlock(),n.createElementBlock("div",S3,[n.createVNode(c,{size:"small",class:"mb-1 align-middle"}),l[0]||(l[0]=n.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(n.openBlock(),n.createElementBlock("div",B3," История статусов отсутствует. ")):(n.openBlock(),n.createBlock(u,{key:2},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(h,f)=>(n.openBlock(),n.createBlock(d,{key:f,color:n.unref(bi)(h.status.slug).color,time:o(h.createdAt),content:h.user.name},{header:n.withCtx(()=>[n.createVNode(qh,{status:h.status,"status-detail":h.statusDetail,variant:f===0?"filled":"text","show-dot":!1,size:"small"},null,8,["status","status-detail","variant"])]),_:2},1032,["color","time","content"]))),128))]),_:1}))])}}}),T3={class:"text-base"},$3={},dl=n.defineComponent({...$3,__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",T3,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))}}),E3={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},R3={class:"col-span-2"},P3={class:"col-span-2"},F3={},Uh=n.defineComponent({...F3,__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",E3,[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(dl,{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(Vr,{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(Lu,{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",R3,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(ll,{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(hs,{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",P3,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(dl,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):n.createCommentVNode("",!0)])]))}}),V3={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function M3(t,e){return n.openBlock(),n.createElementBlock("svg",V3,[...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 I3=n.markRaw({name:"ion-copy-outline",render:M3}),A3={class:"flex flex-col items-start gap-1.5 text-base"},O3=["href"],z3=["href"],D3={key:1,class:"flex items-center gap-2"},L3=["href"],H3={},Kh=n.defineComponent({...H3,__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 a;const o=I3,s=M.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",A3,[t.order.erpOrderUrl?(n.openBlock(),n.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,O3)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.order.invoices??[],(l,c)=>(n.openBlock(),n.createElementBlock("a",{key:c,class:"btn btn-primary",href:l}," Скачать счет №"+n.toDisplayString(c+1),9,z3))),128)),(a=t.order.payment)!=null&&a.onlinePaymentLink?(n.openBlock(),n.createElementBlock("div",D3,[n.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,L3),n.withDirectives((n.openBlock(),n.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:n.withCtx(()=>[n.createVNode(o)]),_:1})),[[n.unref(Pl),t.order.payment.onlinePaymentLink]])])):n.createCommentVNode("",!0)])],64)):n.createCommentVNode("",!0)}}}),W3={key:0},j3={class:"text-sc-dark-grey my-2 text-center"},q3={key:1,class:"text-sc-dark-grey my-2 text-center"},X3={key:2},Y3={class:"text-sc-dark-grey mt-4 text-right font-bold"},U3={class:"text-sc-primary"},K3={},Gh=n.defineComponent({...K3,__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(q.currentOrderInjectionKey,n.computed(()=>s.value??null));const a=(d=!0)=>{if("products"in i.order){s.value=new q.Order(i.order);return}d&&(o.value=!0),q.HttpRequester.getInstance(q.OrdersDataProvider).getOrder(i.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=n.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=n.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return n.watch(()=>i.order,()=>{a(!1)}),n.onMounted(()=>{a()}),(d,u)=>{const h=M.NSpin;return o.value?(n.openBlock(),n.createElementBlock("div",W3,[n.createElementVNode("div",j3,[n.createVNode(h,{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",q3," --- Не удалось загрузить данные о заказе --- ")):(n.openBlock(),n.createElementBlock("div",X3,[n.createVNode(Xh,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),n.createElementVNode("div",Y3,[u[2]||(u[2]=n.createTextVNode(" ИТОГО: ",-1)),n.createElementVNode("span",U3,n.toDisplayString(c.value)+" ₽",1)]),n.createVNode(Uh,{order:s.value,"onClick:clientName":u[0]||(u[0]=f=>r("click:client-name",s.value.client,f))},null,8,["order"]),n.createVNode(Kh,{order:s.value},null,8,["order"]),n.createVNode(Yh,{order:s.value},null,8,["order"])]))}}}),G3={},Z3=n.defineComponent({...G3,__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(Cr,"small"),r=n.computed(()=>z.isNil(e.orderContextButtonsConfig)?[]:z.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),o=s=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,s)};return(s,a)=>{var u;const l=Cs,c=M.NButton,d=M.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(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):n.createCommentVNode("",!0)}}}),Q3={},J3=n.defineComponent({...Q3,__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"),a=(R,H)=>{H?s.value.includes(R)||(s.value=[...s.value,R]):s.value=s.value.filter(Y=>Y!==R)},l=()=>z.cloneDeep(r.sort??[{field:"id",direction:"desc"}]),c=n.ref(l()),d=n.ref([]),u=n.ref(!1),h=n.ref(700),f=()=>{const R=et.getDeviceTypeByResolution(),H=R===Xe.phone||R===Xe.tablet;if(!(!r.stickyHeaderOnMobile&&H))return h.value*(q.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},m=n.ref(f()),p=n.computed(()=>r.highlightSettings?r.highlightSettings:{statuses:[],markers:r.useCellIndication?[...io]:[]}),g=R=>{const H={onDblclick:()=>o("dblclick:row",R)},Y=[];r.selectable&&s.value.length>0&&!s.value.includes(R.id)&&Y.push("opacity-60");const G=p.value,X=new Set(ks(R).filter(de=>G.markers.includes(de))),W={},ae=[it.NotInStock,it.OnOrder,it.LargeOrder].find(de=>X.has(de));if(ae){const de=vr(ae);Y.push("order-id-marked",ae),W["--sc-order-id-bg"]=de.backgroundColor,W["--sc-order-id-text"]=de.textOnBackgroundColor}if(X.has(it.NextDayDelivery)){const de=vr(it.NextDayDelivery);Y.push("delivery-date-marked"),W["--sc-delivery-date-bg"]=de.backgroundColor,W["--sc-delivery-date-text"]=de.textOnBackgroundColor}return R.status.slug&&G.statuses.includes(R.status.slug)&&(Y.push("order-status-highlighted",R.status.slug),z.assign(W,Al(R.status.slug))),z.isEmpty(W)||(H.style=W),Y.length>0&&(H.class=Y.join(" ")),H},b=()=>{const R=[Fe.CreatedAt,Fe.Id,Fe.ClientInfo,Fe.ClientCity,Fe.DeliveryDate,Fe.PaymentType,Fe.SalesDirections,Fe.Status,...r.showAttachedUserColumn?[Fe.AttachedUser]:[],Fe.actions],H=r.fields.length>0?r.fields:R,Y={title:"???",key:"undefined",render:()=>n.h("span",{},["--- unknown ---"])},G={type:"expand",expandable:z.constant(!0),renderExpand:j=>n.h(Gh,{order:j,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{o("click:client-name",j.client,null)}}),width:"30"};let X=[{title:"Дата заказа",key:Fe.CreatedAt,resizable:!0,width:100,render:j=>n.h(Xo,{date:j.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Fe.Id,resizable:!0,width:75,className:"order-id",render:j=>n.h("a",{href:r.orderUrl.replace(":id",j.id.toString()),class:"text-base"},j.id)},{title:"Дата доставки / самовывоза",key:Fe.DeliveryDate,resizable:!0,width:120,className:"delivery-date",render:j=>n.h(Xo,{date:j.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Fe.ClientInfo,resizable:!0,minWidth:320,render:j=>n.h(Vr,{client:j.client,"onClick:client-name":()=>{o("click:client-name",j.client,null)}})},{title:"Тип доставки",key:Fe.DeliveryInfo,resizable:!0,minWidth:320,render:j=>n.h(hs,{delivery:j.delivery})},{title:"Клиент",key:Fe.ClientInfoShort,resizable:!0,minWidth:320,render:j=>n.h(Vr,{client:j.client,showCityAndRegion:!1,"onClick:client-name":()=>{o("click:client-name",j.client,null)}})},{title:"Город клиента",key:Fe.ClientCity,resizable:!0,minWidth:90,width:120,render:j=>{var ae;return n.h("span",{class:"text-base"},((ae=j.client)==null?void 0:ae.city.name)??"—")}},{title:"Статус",key:Fe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:j=>n.h("span",{class:"text-base"},[j.status.name])},{title:"Тип оплаты",key:Fe.PaymentType,resizable:!0,width:115,minWidth:95,render:j=>j.payment?n.h(ll,{payment:j.payment}):n.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Fe.SalesDirections,resizable:!0,width:80,render:j=>{var ae;return n.h("span",{class:"text-base"},[((ae=j.salesDirection)==null?void 0:ae.name)??""])}},...r.showAttachedUserColumn?[{title:"Закреплено за",key:Fe.AttachedUser,resizable:!0,minWidth:120,render:j=>{var ae;return n.h("span",{class:"text-base"},[((ae=j==null?void 0:j.attachedUser)==null?void 0:ae.name)??""])}}]:[]];r.orderContextButtonsConfig&&X.push({key:"actions",title:"",className:"align-top",width:50,render:j=>n.h(Z3,{order:j,orderContextButtonsConfig:r.orderContextButtonsConfig,onOrderContextSelect:r.onOrderContextSelect})}),r.enableSorting&&(X=X.map(j=>[Fe.Id,Fe.CreatedAt,Fe.DeliveryDate].includes(j.key)?{...j,sorter:!0,sortOrder:!1,...j.width===void 0?{}:{width:j.width+16}}:j));const W=r.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:j=>{var de;const ae=((de=r.isRowSelectable)==null?void 0:de.call(r,j))??!0;return{class:ae?"cursor-pointer":void 0,onClick:()=>{ae&&a(j.id,!s.value.includes(j.id))}}},render:j=>{var ae;return((ae=r.isRowSelectable)==null?void 0:ae.call(r,j))??!0?n.h(M.NCheckbox,{checked:s.value.includes(j.id)}):null}}]:[];switch(et.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...W,G,{key:"order",title:"Заказ",resizable:!0,render:j=>n.h(Wh,{order:j,fields:H,orderUrl:r.orderUrl,highlightSettings:p.value})}];case Xe.laptop:{const j=r.showAttachedUserColumn?H:H.filter(ae=>ae!==Fe.AttachedUser);return[...W,G,...j.map(ae=>X.find(de=>de.key===ae)??Y)]}default:return[Y]}},y=n.ref(b()),_=n.ref(new q.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),C=n.ref(null),T=n.ref(null),w=n.ref(null),S=n.ref(null),v=()=>{S.value!==null&&(clearInterval(S.value),S.value=null)},$=()=>{v(),r.refreshInterval&&(S.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},F=()=>{var R,H,Y;r.filters&&((R=C.value)==null||R.abort(),C.value=null,(H=T.value)==null||H.abort(),T.value=null,w.value=null,(Y=x.value)==null||Y.abort(),x.value=new AbortController,u.value=!0,q.HttpRequester.getInstance(q.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=C.value)==null||R.abort(),C.value=new AbortController,q.HttpRequester.getInstance(q.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},C.value.signal).then(H=>{d.value=d.value.map(Y=>H.data.find(X=>X.id===Y.id)??Y),_.value.itemCount!==H.meta.total&&(_.value.itemCount=H.meta.total),_.value.pageCount!==H.meta.lastPage&&(_.value.pageCount=H.meta.lastPage)}).catch(H=>{if((H==null?void 0:H.name)!=="CanceledError")throw H}))},I=R=>R.meta.total===_.value.itemCount&&z.isEqual(z.map(R.data,"id"),z.map(d.value,"id")),K=async()=>{var H,Y;if(!r.filters||u.value)return!1;(H=C.value)==null||H.abort(),C.value=null,(Y=T.value)==null||Y.abort(),T.value=new AbortController;let R;try{R=await q.HttpRequester.getInstance(q.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},T.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,F(),o("update:pagination",_.value)},A=R=>{_.value.pageSize=R,_.value.page=1,F(),o("update:pagination",_.value)},O=R=>{if(z.isNull(R))c.value=l();else{const[H]=c.value;H.field=R.columnKey.toString(),H.direction=R.order==="ascend"?"asc":"desc",c.value=[H]}y.value.forEach(H=>{if(Object.hasOwn(H,"sortOrder")){const Y=H;Y.sortOrder=Y.key===(R==null?void 0:R.columnKey)&&(R!=null&&R.sorter)&&R.order!==!1?R.order:!1}}),F(),o("update:sort",c.value)},V=()=>{y.value=b(),h.value=window.innerHeight,m.value=f()};return n.watch(()=>r.filters,()=>{_.value.page=1,F(),$()}),n.watch(()=>r.sort,()=>{c.value=l(),_.value.page=1,F(),$()}),n.onMounted(()=>{V(),window.addEventListener("resize",V),n.nextTick(()=>{F(),$()})}),n.onUnmounted(()=>{var R,H,Y;window.removeEventListener("resize",V),(R=x.value)==null||R.abort(),(H=C.value)==null||H.abort(),(Y=T.value)==null||Y.abort(),v()}),e({reload:F,checkForUpdates:K,applyPendingUpdate:J,discardPendingUpdate:Z}),(R,H)=>{const Y=M.NDataTable;return n.openBlock(),n.createBlock(Y,{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":A,"onUpdate:sorter":O},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),e5=An(J3,[["__scopeId","data-v-aff76adb"]]),t5=n.computed(()=>q.useReferencesStore().deliveryTypeReference??[]),n5=n.computed(()=>q.useReferencesStore().managersList??[]),i5=n.computed(()=>q.useReferencesStore().opfReference??[]),r5=n.computed(()=>q.useReferencesStore().partnerGroupsReference??[]),o5=n.computed(()=>q.useReferencesStore().priceCoefficientsReference??[]),s5=n.computed(()=>q.useReferencesStore().productFilesTypesReference??[]),a5=n.computed(()=>q.useReferencesStore().resourceTypesReference),l5=n.computed(()=>q.useReferencesStore().salesDirectionsReference??[]),c5=n.computed(()=>q.useReferencesStore().warehousesReference??[]),d5=n.computed(()=>q.useReferencesStore().paymentTypeReference??[]),Zh=n.computed(()=>q.useReferencesStore().orderStatusReference??[]),u5=n.computed(()=>q.useReferencesStore().orderStatusDetailReference??[]),f5=n.computed(()=>q.useReferencesStore().operatorReference??[]),h5=n.computed(()=>bt.convertReferencesToSelectOptionsList(q.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),m5=n.computed(()=>bt.convertReferencesToSelectOptionsList(q.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),p5=t=>q.HttpRequester.getInstance(q.ReferenceDataProvider).searchCity(t),g5=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()),y5=t=>q.HttpRequester.getInstance(q.ClientDataProvider).searchClient(t),b5=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()),_5={class:"flex flex-col gap-4"},w5={class:"flex flex-wrap gap-2"},x5={class:"flex flex-col gap-1.5"},k5={class:"inline-flex items-center gap-2"},v5={class:"flex flex-col gap-1.5"},C5={class:"inline-flex items-center gap-2"},S5={},B5=n.defineComponent({...S5,__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??Zh.value),s=d=>!!d&&i.settings.statuses.includes(d),a=(d,u)=>{if(!d)return;const h=i.settings.statuses.filter(f=>f!==d);r("update:settings",{...i.settings,statuses:u?[...h,d]:h})},l=(d,u)=>{const h=i.settings.markers.filter(f=>f!==d);r("update:settings",{...i.settings,markers:u?[...h,d]:h})},c=d=>{r("update:settings",{statuses:d?o.value.flatMap(u=>u.slug?[u.slug]:[]):[],markers:d?[...io]:[]})};return(d,u)=>{const h=M.NButton,f=M.NCheckbox;return n.openBlock(),n.createElementBlock("div",_5,[n.createElementVNode("div",w5,[n.createVNode(h,{size:"small",onClick:u[0]||(u[0]=m=>c(!0))},{default:n.withCtx(()=>[...u[2]||(u[2]=[n.createTextVNode(" Выделять всё ",-1)])]),_:1}),n.createVNode(h,{size:"small",onClick:u[1]||(u[1]=m=>c(!1))},{default:n.withCtx(()=>[...u[3]||(u[3]=[n.createTextVNode(" Снять всё ",-1)])]),_:1})]),n.createElementVNode("div",x5,[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(f,{key:m.id,checked:s(m.slug),"onUpdate:checked":p=>a(m.slug,p)},{default:n.withCtx(()=>[n.createElementVNode("span",k5,[n.createVNode(cl,{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",v5,[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(io),m=>(n.openBlock(),n.createBlock(f,{key:m,checked:t.settings.markers.includes(m),"onUpdate:checked":p=>l(m,p)},{default:n.withCtx(()=>[n.createElementVNode("span",C5,[n.createVNode(cl,{colors:n.unref(vr)(m)},null,8,["colors"]),n.createTextVNode(" "+n.toDisplayString(n.unref(xs)(m)),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))])])}}}),N5=["href"],T5={class:"text-sc-dark-grey"},$5={},E5=n.defineComponent({...$5,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const i=t,r=e,o=n.computed(()=>Ie.format(i.order.createdAt,q.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{z.isNil(i.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",i.order,a)};return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("span",null,[l[1]||(l[1]=n.createTextVNode(" #",-1)),n.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},n.toDisplayString(t.order.id),9,N5),n.createTextVNode(" от "+n.toDisplayString(o.value),1)]),l[2]||(l[2]=n.createTextVNode(", ",-1)),n.createElementVNode("span",T5,"автор: "+n.toDisplayString(t.order.creator.name)+" ["+n.toDisplayString(t.order.creator.type)+"]",1)],64))}}),R5={class:"sc-page flex flex-col bg-inherit"},P5={class:"my-2 flex flex-row items-end"},F5={class:"sc-title grow"},V5={key:0,class:"sc-title-buttons flex-1 grow-0"},M5={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},I5={key:0,class:"sc-title-extra mt-2 sm:mt-4"},A5={},Qh=n.defineComponent({...A5,__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=M.NH1;return n.openBlock(),n.createElementBlock("div",R5,[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",P5,[n.createElementVNode("div",F5,[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",V5,[n.createElementVNode("div",M5,[n.renderSlot(r.$slots,"title-buttons")])])):n.createCommentVNode("",!0)]),r.$slots["title-extra"]?(n.openBlock(),n.createElementBlock("div",I5,[n.renderSlot(r.$slots,"title-extra")])):n.createCommentVNode("",!0),n.renderSlot(r.$slots,"sticky-extra")],6),n.renderSlot(r.$slots,"default")])}}}),O5={class:"overflow-hidden transition-all duration-300"},z5={class:"text-lg font-medium leading-none"},D5={},Jh=n.defineComponent({...D5,__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),a=()=>{switch(et.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?z.isUndefined(i.drawerWidth)?o.value=a():o.value=z.isFunction(i.drawerWidth)?i.drawerWidth():i.drawerWidth:o.value=0};return n.watch(()=>i.drawerWidth,()=>{l()}),n.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),n.watch(()=>i.showDrawer,c=>{s.value=c}),n.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=M.NDrawerContent,h=M.NDrawer;return n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",O5,[n.createElementVNode("div",{style:n.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[n.renderSlot(c.$slots,"default")],4)]),n.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=f=>s.value=f),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",z5,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)}}}),L5={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},H5={key:0},W5={class:"sc-page-preview-panel grow"},j5={key:1,class:"sc-page-preview-panel-extra flex-none"},q5={},X5=n.defineComponent({...q5,__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:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&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+l,behavior:"smooth"})})},showPanel:r,closePanel:o}),(l,c)=>{const d=M.NButton;return n.openBlock(),n.createBlock(Qh,{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(Jh,{"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(l.$slots,"panel-content")]),default:n.withCtx(()=>[n.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:n.withCtx(()=>[n.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:n.withCtx(()=>[n.createElementVNode("div",L5,[t.isShowPanelButtonVisible?(n.openBlock(),n.createElementBlock("div",H5,[n.renderSlot(l.$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",W5,[n.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(n.openBlock(),n.createElementBlock("div",j5,[n.renderSlot(l.$slots,"preview-panel-extra")])):n.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),Y5={},U5=n.defineComponent({...Y5,__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(()=>z.isArray(r.value)),a=n.computed(()=>{var p;return z.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=n.computed(()=>{const p=new q.Curator({id:-1,name:"",contacts:{},curatedDirection:new q.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 q.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),g}),c=n.computed(()=>bt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,p=>{const g=z.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"),h=p=>{if(z.isArray(p)){const g=p.length>0?p.map(b=>l.value.find(y=>y.id===b)).filter(b=>!z.isNil(b)):[];o("update:value",g)}else{const g=p>0?l.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(M.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),K5={},G5=n.defineComponent({...K5,__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(()=>z.isArray(r.value)),a=n.computed(()=>{var y;return z.isArray(r.value)?r.value.filter(_=>!z.isNil(_)).map(_=>_.id):((y=r.value)==null?void 0:y.id)??null}),l=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(C=>({label:C.name,value:C.id,item:C}))});let _=r.managerReferenceList;if(r.showActualOnly){const C=z.isArray(r.value)?r.value.map(T=>T.id):[(x=r.value)==null?void 0:x.id];_=_.filter(T=>T.isActive||C.includes(T.id))}const k=bt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,C=>`${C.name}${C.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 T;const y=z.isArray(r.value)?r.value.map(w=>w.id):[(T=r.value)==null?void 0:T.id],_=w=>r.showActualOnly?w.filter(S=>!("isActive"in S)||S.isActive||y.includes(S.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 C=_(r.operatorReferenceList);return C.length>0&&k.push({type:"group",label:"Операторы",key:"operators",children:bt.convertReferencesToSelectOptionsList(C,!0,!1,!1,d)}),k}),h=n.computed(()=>r.groupByEmployeeType?u.value:c.value),f=n.computed(()=>h.value.map(y=>({...y,class:r.wrapContent?`${y.class??""} consistent-menu-width`:y.class}))),m=n.useTemplateRef("select-component"),p=y=>{if(z.isArray(y)){const _=y.map(k=>l.value.find(x=>x.id===k)).filter(k=>!z.isNil(k));o("update:value",_)}else{const _=z.isNil(y)?null:l.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(M.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||h.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:f.value,placeholder:"",class:"w-full","onUpdate:value":p},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Z5={},Q5=n.defineComponent({...Z5,__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(()=>z.isArray(r.value)),a=n.computed(()=>{var p;return z.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=n.computed(()=>r.showEmptyValue?[q.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=n.computed(()=>{var b;let p=l.value,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=z.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];g=z.union(g,l.value.filter(_=>!_.isActive).map(_=>_.id)),p=p.filter(_=>(r.showEmptyValue?q.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&&z.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"),h=p=>{if(z.isArray(p)){const g=p.length>0?p.filter(b=>!z.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!z.isNil(b)):[];o("update:value",g)}else{const g=p>0&&!z.some(r.disabledManagerReferenceList,["id",p])?l.value.find(b=>b.id===p):new q.Manager;o("update:value",g??new q.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;z.some(g,b=>z.some(p,["id",b.id]))&&o("update:value",g.filter(b=>!z.some(p,["id",b.id])))}else{const g=r.value;z.some(p,["id",g.id])&&o("update:value",new q.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(M.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),J5={class:"m-0.5 flex flex-col p-0.5"},eN={class:"flex flex-row gap-1"},tN={key:0},nN={key:1},iN={key:2},rN={key:3},oN={class:"flex flex-row gap-1"},sN={key:0},aN={key:1},lN={key:2},cN={key:3},dN={},em=n.defineComponent({...dN,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",J5,[n.createElementVNode("span",eN,[t.addr.postIndex?(n.openBlock(),n.createElementBlock("span",tN,n.toDisplayString(t.addr.postIndex)+", ",1)):n.createCommentVNode("",!0),t.addr.city?(n.openBlock(),n.createElementBlock("span",nN,n.toDisplayString(t.addr.city)+", ",1)):n.createCommentVNode("",!0),t.addr.locality?(n.openBlock(),n.createElementBlock("span",iN,n.toDisplayString(t.addr.locality)+", ",1)):n.createCommentVNode("",!0),t.addr.region?(n.openBlock(),n.createElementBlock("span",rN,n.toDisplayString(t.addr.region)+", ",1)):n.createCommentVNode("",!0)]),n.createElementVNode("span",oN,[t.addr.street?(n.openBlock(),n.createElementBlock("span",sN,n.toDisplayString(t.addr.street)+", ",1)):n.createCommentVNode("",!0),t.addr.building?(n.openBlock(),n.createElementBlock("span",aN,n.toDisplayString(t.addr.building)+", ",1)):n.createCommentVNode("",!0),t.addr.buildingPart?(n.openBlock(),n.createElementBlock("span",lN,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)])]))}}),ul={clearable:!1,value:"",field:void 0,disabled:!1},uN={},fN=n.defineComponent({...uN,__name:"address-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...ul,minTermLength:()=>{var t,e;return((e=(t=q.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),a=n.ref(!1),l=n.ref([]),c=n.computed(()=>l.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=z.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(s.value,a):q.HttpRequester.getInstance(q.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return n.h(em,{addr:y,selected:b},{default:z.constant("-")})},f=g=>{d.cancel();const b=l.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=M.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:a.value,options:c.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:f},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),hN={class:"m-0.5 flex flex-col p-0.5"},mN={class:"font-medium"},pN={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},gN={key:0},yN={key:1},bN={},tm=n.defineComponent({...bN,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,i)=>(n.openBlock(),n.createElementBlock("div",hN,[n.createElementVNode("span",mN,n.toDisplayString(t.bank.name),1),n.createElementVNode("span",pN,[t.bank.bic?(n.openBlock(),n.createElementBlock("span",gN," БИК: "+n.toDisplayString(t.bank.bic),1)):n.createCommentVNode("",!0),t.bank.inn?(n.openBlock(),n.createElementBlock("span",yN," ИНН: "+n.toDisplayString(t.bank.inn),1)):n.createCommentVNode("",!0)])]))}}),_N={},wN=n.defineComponent({..._N,__name:"bank-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...ul,minTermLength:()=>{var t,e;return((e=(t=q.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),a=n.ref(!1),l=n.ref([]),c=n.computed(()=>l.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=z.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await q.HttpRequester.getInstance(q.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return n.h(tm,{bank:y,selected:b},{default:z.constant("-")})},f=g=>{d.cancel();const b=l.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=M.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:a.value,options:c.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:f},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),xN={class:"font-medium"},kN={key:0,class:"flex flex-row gap-2"},vN={key:0,class:"text-xs font-light text-blue-800"},CN={key:1,class:"text-sc-dark-grey text-xs font-light"},SN={},nm=n.defineComponent({...SN,__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",xN,n.toDisplayString(t.org.name),1),t.org.inn||r.value?(n.openBlock(),n.createElementBlock("div",kN,[t.org.inn?(n.openBlock(),n.createElementBlock("span",vN,n.toDisplayString(t.org.inn),1)):n.createCommentVNode("",!0),r.value?(n.openBlock(),n.createElementBlock("span",CN,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),BN={},NN=n.defineComponent({...BN,__name:"org-suggestion",props:n.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...ul,minTermLength:()=>{var t,e;return((e=(t=q.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),a=n.ref(!1),l=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(l.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=z.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await q.HttpRequester.getInstance(q.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},f=(b,y)=>{const _=l.value.find(k=>k.id===b.value)||{};return n.h(nm,{org:_,selected:y},{default:z.constant("-")})},m=b=>{u.cancel();const y=l.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 _=M.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:a.value,options:d.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:m},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}});U.ALL_ORDER_MARKERS=io,U.CommonValidators=mm,U.ConfiguratorSettingsKozyrek=_u,U.ConfiguratorSettingsMosquito=Qw,U.ContentHelper=_i,U.DEFAULT_ORDER_STATUS_COLORS=_s,U.DateValidators=pm,U.EntityNameHelper=ni,U.FileHelper=hm,U.KozyrekLine=Tn,U.KozyrekTailTemplate=Ca,U.KozyrekTemplate=cr,U.NumericValidators=le,U.ORDER_MARKER_COLORS=ws,U.ORDER_MARKER_NAMES=Ol,U.ORDER_STATUS_COLORS=Ml,U.OrderMarkerEnum=it,U.OrdersTableFields=Fe,U.Point=va,U.ScAddProductToCartDialog=q_,U.ScAddressSuggestion=fN,U.ScAddressSuggestionLabel=em,U.ScBankSuggestion=wN,U.ScBankSuggestionLabel=tm,U.ScBaseDialog=Ns,U.ScButtonWithConfirmAction=ym,U.ScCategoryCollapse=zu,U.ScClientNameWithShortInfo=Vr,U.ScCollapse=Ou,U.ScCollapseItem=Wl,U.ScCommentEditor=sk,U.ScConfiguratorsProductInfo=Nr,U.ScContragentWithShortInfo=Lu,U.ScCreatorUserTypeTag=Gr,U.ScCuratorSelect=U5,U.ScDateRange=Vx,U.ScDateTimeLabel=Xo,U.ScDebouncedInput=bk,U.ScDebouncedInputNumber=wk,U.ScDebt=Ox,U.ScDialogHeader=jx,U.ScDynamicConfigurator=Mu,U.ScEmail=aw,U.ScExternalLink=Ek,U.ScImageGallery=Ul,U.ScInlineEditableItem=Zu,U.ScInlineView=Ba,U.ScKozyrekConfigurator=wu,U.ScKozyrekConfiguratorParamsForm=Ql,U.ScKozyrekConfiguratorPreview=bu,U.ScKozyrekConfiguratorTemplates=yu,U.ScLightGallery=Yl,U.ScManagerOperatorSelect=G5,U.ScManagerSelect=Q5,U.ScMetalForDoorsConfigurator=$u,U.ScMetalForDoorsConfiguratorForm=Tu,U.ScMosquitoConfigurator=vu,U.ScMosquitoConfiguratorForm=xu,U.ScMosquitoConfiguratorMeasurementInstructions=ku,U.ScMosquitoConfiguratorPreview=Sa,U.ScOrderColorSwatch=cl,U.ScOrderCommonInfo=Wh,U.ScOrderDeliveryLabel=hs,U.ScOrderDetails=Uh,U.ScOrderExternalLinks=Kh,U.ScOrderHighlightSettings=B5,U.ScOrderInfo=Gh,U.ScOrderItemParams=Hh,U.ScOrderItemsList=Xh,U.ScOrderPayment=ll,U.ScOrderProductInfo=jh,U.ScOrderStatusHistory=Yh,U.ScOrderStatusTag=qh,U.ScOrdersList=e5,U.ScOrgSuggestion=NN,U.ScOrgSuggestionLabel=nm,U.ScPage=Qh,U.ScPageWithSlidingPanel=X5,U.ScPersonContactsBlock=Zw,U.ScPhone=Rw,U.ScPhoneInput=vk,U.ScProductInfoContent=Bs,U.ScProductInfoDialog=Kl,U.ScProductInfoPopover=Gl,U.ScProductName=Br,U.ScProductsList=rB,U.ScReferenceSelect=Du,U.ScSandwichConfigurator=Pu,U.ScSandwichConfiguratorForm=Ru,U.ScSandwichM2Configurator=Vu,U.ScSandwichM2ConfiguratorForm=Fu,U.ScSearchableProductSelect=Lh,U.ScSearchableReferenceSelect=Dh,U.ScSetClientPriceFormItem=L_,U.ScShortTextOrderInfo=E5,U.ScSingleFileUploadSelector=uk,U.ScSlidingContentWithDrawer=Jh,U.ScStripConfigurator=Nu,U.ScStripConfiguratorForm=Su,U.ScStripConfiguratorLineItem=Cu,U.ScStripConfiguratorPreview=Bu,U.ScUserShortInfo=dl,U.ScWarningIcon=gk,U.SelectOptionHelper=bt,U.UiNotificationProvider=xr,U.Validators=We,U.WindowResolutionEnum=Xe,U.WindowResolutionProvider=et,U.channelPrimaryInterestOptionsList=h5,U.componentSizeInjectionKey=Cr,U.copyToClipboard=Rl,U.deliveryTypeReferenceList=t5,U.getOrderMarkerColors=vr,U.getOrderMarkerName=xs,U.getOrderMarkers=ks,U.getOrderStatusColors=bi,U.getOrderStatusCssVariables=Al,U.getOrderStatusTagColor=Il,U.getProductInfoFiles=vs,U.handleFloatInput=ro,U.handleIntegerInput=at,U.hasProductInfo=zl,U.isCanSandwichM2Show=Jw,U.isCanSandwichShow=Au,U.isConfiguratorType=Iu,U.managersReferenceList=n5,U.naiveUiTheme=ip,U.operatorReferenceList=f5,U.opfReferenceList=i5,U.orderStatusDetailReferenceList=u5,U.orderStatusReferenceList=Zh,U.parse=ct,U.partnerGroupReferenceList=r5,U.paymentTypeReferenceList=d5,U.priceCoefficientsReferenceList=o5,U.productFilesTypesReferenceList=s5,U.renderConfig=qe,U.resetInputValidation=rt,U.resourceReferencesList=a5,U.salesDirectionsReferenceList=l5,U.searchCityReferenceDataHandler=p5,U.searchCityReferenceLabelRenderer=g5,U.searchClientReferenceDataHandler=y5,U.searchClientReferenceLabelRenderer=b5,U.selectAllTextOnFocus=He,U.sourcePrimaryInterestOptionsList=m5,U.vCopy=Pl,U.vFocusNext=ti,U.warehousesReferenceList=c5,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
|