@snabcentr/vue-ui-lib 4.5.2 → 4.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(W,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],A):(W=typeof globalThis<"u"?globalThis:W||self,A(W.SC_VueUiLib={},W["lodash-es"],W.Vue,W["naive-ui"],W["@snabcentr/common-lib"],W["date-fns"],W["libphonenumber-js"],W["ts-case-convert"],W["vue-tel-input"]))})(this,(function(W,A,i,z,Y,un,or,Ho,tf){"use strict";var LB=Object.defineProperty;var Zh=W=>{throw TypeError(W)};var HB=(W,A,i)=>A in W?LB(W,A,{enumerable:!0,configurable:!0,writable:!0,value:i}):W[A]=i;var B=(W,A,i)=>HB(W,typeof A!="symbol"?A+"":A,i),Qh=(W,A,i)=>A.has(W)||Zh("Cannot "+i);var Ft=(W,A,i)=>(Qh(W,A,"read from private field"),i?i.call(W):A.get(W)),qa=(W,A,i)=>A.has(W)?Zh("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(W):A.set(W,i),Jh=(W,A,i,z)=>(Qh(W,A,"write to private field"),z?z.call(W,i):A.set(W,i),i);var Bi,ft,Oo;const Ya=t=>{if(t.key!=="Enter"&&t.code!=="Enter")return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||e.type==="range")return;t.preventDefault();const r=[...t.currentTarget.querySelectorAll("input")].filter(a=>a.type!=="range"&&!a.readOnly&&!a.disabled),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);s&&(s.focus(),s.select())},Ua={mounted(t){t.addEventListener("keydown",Ya)},unmounted(t){t.removeEventListener("keydown",Ya)}};var Pe=(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))(Pe||{}),Qe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Qe||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&A.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const tt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Or=(t,e=".",n=!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())||n&&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()},it=t=>t?Number.parseFloat(t.replace(",",".")):null,et=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Vt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=A.isString(r.key)?A.get(d,r.key):r.key(c),h=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const nf={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},rf={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},He={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",of,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Wo=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:sf}),af={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Ka=i.markRaw({name:"tabler-edit",render:lf}),cf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function df(t,e){return i.openBlock(),i.createElementBlock("svg",cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"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 Ga=i.markRaw({name:"ion-checkmark-done-circle",render:df}),uf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hf(t,e){return i.openBlock(),i.createElementBlock("svg",uf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Za=i.markRaw({name:"ion-checkmark-done-circle-outline",render:hf}),ff={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 gf=i.markRaw({name:"fluent-pin32-regular",render:mf}),pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const bf=i.markRaw({name:"ion-eye-outline",render:yf}),_f={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 xf=i.markRaw({name:"fluent-pin32-filled",render:wf}),kf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vf(t,e){return i.openBlock(),i.createElementBlock("svg",kf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const Cf=i.markRaw({name:"ion-bookmark-outline",render:vf}),Sf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Bf(t,e){return i.openBlock(),i.createElementBlock("svg",Sf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const Tf=i.markRaw({name:"ion-eye-off-sharp",render:Bf}),Nf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $f(t,e){return i.openBlock(),i.createElementBlock("svg",Nf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const Ef=i.markRaw({name:"ion-chevron-forward-outline",render:$f}),Rf=["data-name"],Pf={class:"sc-collapse-item-header flex flex-row gap-2.5"},Ff={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Vf={key:0},If={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Mf={class:"flex flex-1 flex-col"},Af={key:0,class:"sc-collapse-item-sub-title flex-1"},Of={key:1,class:"sc-collapse-item-title-extra flex-none"},zf={key:0,class:"sc-collapse-item-content"},Df={},Lf=i.defineComponent({...Df,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("itemHeaderClickHandler",A.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=A.some(a,p=>p===r.name),d=i.computed(()=>A.some(l,p=>p===r.name)),u=i.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:i.readonly(u)}),(p,y)=>{const b=Ef;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Pf,[i.createElementVNode("div",Ff,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Vf,[i.createElementVNode("div",If,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Mf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Af,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Of,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",zf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Rf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Qa=Wn(Lf,[["__scopeId","data-v-f1311d1c"]]),Hf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Ja=i.markRaw({name:"ion-cart-outline",render:Wf}),sr=Symbol(),jf={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"}},qf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Xf={},el=i.defineComponent({...Xf,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(sr,"medium"),r=i.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.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 $;const g=Za,m=Ga,p=z.NButton,y=z.NTooltip,b=Ka,_=Ja,S=Wo,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",qf,[s.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(m,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createBlock(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),(($=a.value)==null?void 0:$.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Yf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Uf(t,e){return i.openBlock(),i.createElementBlock("svg",Yf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Kf=i.markRaw({name:"tabler-history",render:Uf}),Gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 Qf=i.markRaw({name:"mdi-percent-outline",render:Zf}),Jf={class:"flex flex-row gap-1"},em={key:0,class:"flex gap-1"},tm={key:0,class:"flex text-nowrap text-sm line-through"},nm={key:1,class:"flex flex-row text-nowrap text-sm"},im={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},rm={},jn=i.defineComponent({...rm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var y;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),o=i.computed(()=>A.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),s=i.computed(()=>{const b=A.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return o.value||!b||A.isNil(l.value)||A.isNil(b.cost)?!1:l.value<b.cost}),a=((y=Y.useBaseConfigStateStore().getConfig())==null?void 0:y.defaultCurrency)??"RUB",l=i.computed(()=>o.value?o.value.cost:A.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?un.format(r.value.costDate,Y.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!A.isNil(l.value)),f=i.computed(()=>A.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const b=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*b)}),m=i.computed(()=>A.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const b=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(b)});return(b,_)=>{var x;const S=z.NTag,k=z.NTooltip,$=Qf,E=Kf;return i.openBlock(),i.createElementBlock("div",Jf,[t.showTag?(i.openBlock(),i.createBlock(k,{key:0},{trigger:i.withCtx(()=>[i.createVNode(S,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!o.value}])},{default:i.withCtx(()=>{var C;return[i.createTextVNode(i.toDisplayString(((C=o.value)==null?void 0:C.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var C;return[i.createTextVNode(" "+i.toDisplayString(((C=o.value)==null?void 0:C.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":s.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",em,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",tm,i.toDisplayString(m.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":s.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(x=o.value)==null?void 0:x.readOnly,"font-bold":!o.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var C;h.value&&((C=t.eventEmitter)==null||C.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(f.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!o.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(k,{key:0},{trigger:i.withCtx(()=>[i.createVNode($,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",nm," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(A.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",im,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(k,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(E,{class:"cursor-pointer",onClick:_[1]||(_[1]=C=>{var w;return(w=t.eventEmitter)==null?void 0:w.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),om={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sm(t,e){return i.openBlock(),i.createElementBlock("svg",om,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const jo=i.markRaw({name:"ion-information-circle-outline",render:sm}),am={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lm(t,e){return i.openBlock(),i.createElementBlock("svg",am,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const tl=i.markRaw({name:"ion-images",render:lm}),cm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function dm(t,e){return i.openBlock(),i.createElementBlock("svg",cm,[...e[0]||(e[0]=[i.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 um=i.markRaw({name:"ion-information-circle",render:dm}),hm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function fm(t,e){return i.openBlock(),i.createElementBlock("svg",hm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const mm=i.markRaw({name:"ion-bookmark",render:fm});/*!
1
+ (function(W,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],A):(W=typeof globalThis<"u"?globalThis:W||self,A(W.SC_VueUiLib={},W["lodash-es"],W.Vue,W["naive-ui"],W["@snabcentr/common-lib"],W["date-fns"],W["libphonenumber-js"],W["ts-case-convert"],W["vue-tel-input"]))})(this,(function(W,A,i,z,Y,un,or,Ho,tf){"use strict";var HB=Object.defineProperty;var Zh=W=>{throw TypeError(W)};var WB=(W,A,i)=>A in W?HB(W,A,{enumerable:!0,configurable:!0,writable:!0,value:i}):W[A]=i;var B=(W,A,i)=>WB(W,typeof A!="symbol"?A+"":A,i),Qh=(W,A,i)=>A.has(W)||Zh("Cannot "+i);var Ft=(W,A,i)=>(Qh(W,A,"read from private field"),i?i.call(W):A.get(W)),qa=(W,A,i)=>A.has(W)?Zh("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(W):A.set(W,i),Jh=(W,A,i,z)=>(Qh(W,A,"write to private field"),z?z.call(W,i):A.set(W,i),i);var Bi,ft,Oo;const Ya=t=>{if(t.key!=="Enter"&&t.code!=="Enter")return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||e.type==="range")return;t.preventDefault();const r=[...t.currentTarget.querySelectorAll("input")].filter(a=>a.type!=="range"&&!a.readOnly&&!a.disabled),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);s&&(s.focus(),s.select())},Ua={mounted(t){t.addEventListener("keydown",Ya)},unmounted(t){t.removeEventListener("keydown",Ya)}};var Pe=(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))(Pe||{}),Qe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Qe||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&A.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const tt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Or=(t,e=".",n=!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())||n&&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()},it=t=>t?Number.parseFloat(t.replace(",",".")):null,et=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Vt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=A.isString(r.key)?A.get(d,r.key):r.key(c),h=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const nf={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},rf={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},He={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",of,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Wo=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:sf}),af={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Ka=i.markRaw({name:"tabler-edit",render:lf}),cf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function df(t,e){return i.openBlock(),i.createElementBlock("svg",cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"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 Ga=i.markRaw({name:"ion-checkmark-done-circle",render:df}),uf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hf(t,e){return i.openBlock(),i.createElementBlock("svg",uf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Za=i.markRaw({name:"ion-checkmark-done-circle-outline",render:hf}),ff={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 gf=i.markRaw({name:"fluent-pin32-regular",render:mf}),pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const bf=i.markRaw({name:"ion-eye-outline",render:yf}),_f={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 xf=i.markRaw({name:"fluent-pin32-filled",render:wf}),kf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vf(t,e){return i.openBlock(),i.createElementBlock("svg",kf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const Cf=i.markRaw({name:"ion-bookmark-outline",render:vf}),Sf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Bf(t,e){return i.openBlock(),i.createElementBlock("svg",Sf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const Tf=i.markRaw({name:"ion-eye-off-sharp",render:Bf}),Nf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $f(t,e){return i.openBlock(),i.createElementBlock("svg",Nf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const Ef=i.markRaw({name:"ion-chevron-forward-outline",render:$f}),Rf=["data-name"],Pf={class:"sc-collapse-item-header flex flex-row gap-2.5"},Ff={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Vf={key:0},If={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Mf={class:"flex flex-1 flex-col"},Af={key:0,class:"sc-collapse-item-sub-title flex-1"},Of={key:1,class:"sc-collapse-item-title-extra flex-none"},zf={key:0,class:"sc-collapse-item-content"},Df={},Lf=i.defineComponent({...Df,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("itemHeaderClickHandler",A.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=A.some(a,p=>p===r.name),d=i.computed(()=>A.some(l,p=>p===r.name)),u=i.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:i.readonly(u)}),(p,y)=>{const b=Ef;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Pf,[i.createElementVNode("div",Ff,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Vf,[i.createElementVNode("div",If,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Mf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Af,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Of,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",zf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Rf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Qa=Wn(Lf,[["__scopeId","data-v-f1311d1c"]]),Hf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Ja=i.markRaw({name:"ion-cart-outline",render:Wf}),sr=Symbol(),jf={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"}},qf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Xf={},el=i.defineComponent({...Xf,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(sr,"medium"),r=i.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.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 $;const g=Za,m=Ga,p=z.NButton,y=z.NTooltip,b=Ka,_=Ja,S=Wo,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",qf,[s.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(m,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createBlock(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),(($=a.value)==null?void 0:$.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Yf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Uf(t,e){return i.openBlock(),i.createElementBlock("svg",Yf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Kf=i.markRaw({name:"tabler-history",render:Uf}),Gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 Qf=i.markRaw({name:"mdi-percent-outline",render:Zf}),Jf={class:"flex flex-row gap-1"},em={key:0,class:"flex gap-1"},tm={key:0,class:"flex text-nowrap text-sm line-through"},nm={key:1,class:"flex flex-row text-nowrap text-sm"},im={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},rm={},jn=i.defineComponent({...rm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var y;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),o=i.computed(()=>A.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),s=i.computed(()=>{const b=A.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return o.value||!b||A.isNil(l.value)||A.isNil(b.cost)?!1:l.value<b.cost}),a=((y=Y.useBaseConfigStateStore().getConfig())==null?void 0:y.defaultCurrency)??"RUB",l=i.computed(()=>o.value?o.value.cost:A.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?un.format(r.value.costDate,Y.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!A.isNil(l.value)),f=i.computed(()=>A.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const b=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*b)}),m=i.computed(()=>A.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const b=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(b)});return(b,_)=>{var x;const S=z.NTag,k=z.NTooltip,$=Qf,E=Kf;return i.openBlock(),i.createElementBlock("div",Jf,[t.showTag?(i.openBlock(),i.createBlock(k,{key:0},{trigger:i.withCtx(()=>[i.createVNode(S,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!o.value}])},{default:i.withCtx(()=>{var C;return[i.createTextVNode(i.toDisplayString(((C=o.value)==null?void 0:C.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var C;return[i.createTextVNode(" "+i.toDisplayString(((C=o.value)==null?void 0:C.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":s.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",em,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",tm,i.toDisplayString(m.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":s.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(x=o.value)==null?void 0:x.readOnly,"font-bold":!o.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var C;h.value&&((C=t.eventEmitter)==null||C.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(f.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!o.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(k,{key:0},{trigger:i.withCtx(()=>[i.createVNode($,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",nm," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(A.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",im,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(k,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(E,{class:"cursor-pointer",onClick:_[1]||(_[1]=C=>{var w;return(w=t.eventEmitter)==null?void 0:w.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),om={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sm(t,e){return i.openBlock(),i.createElementBlock("svg",om,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const jo=i.markRaw({name:"ion-information-circle-outline",render:sm}),am={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lm(t,e){return i.openBlock(),i.createElementBlock("svg",am,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const tl=i.markRaw({name:"ion-images",render:lm}),cm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function dm(t,e){return i.openBlock(),i.createElementBlock("svg",cm,[...e[0]||(e[0]=[i.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 um=i.markRaw({name:"ion-information-circle",render:dm}),hm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function fm(t,e){return i.openBlock(),i.createElementBlock("svg",hm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const mm=i.markRaw({name:"ion-bookmark",render:fm});/*!
2
2
  * lightgallery | 2.9.0 | October 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -113,7 +113,7 @@ ${o}
113
113
  `);return}l=yu(l),c!=null&&a.push(` ${l}${Qw(c)}`)}),t&&a.push("}"),a.join(`
114
114
  `)}function ta(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))ta(r,e,n);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?ta(o,e,n):o&&n(o)}else r&&n(r)})}function _u(t,e,n,r,o){const s=t.$;let a="";if(!s||typeof s=="string")So(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});So(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")So(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});So(d)?a=d:e.push(d)}const l=Kw(e),c=bu(l,t.props,r,o);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&ta(t.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=bu(l,{raw:d},r,o);n.push(u)}else _u(d,e,n,r,o)}),e.pop(),a&&n.push("}"),s&&s.after&&s.after(r.context)}function ex(t,e,n){const r=[];return _u(t,[],r,e,n),r.join(`
115
115
 
116
- `)}function na(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(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 tx(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(pu),e.els=[];else{const s=Co(n,r);s&&o.includes(s)&&(pu(s),e.els=o.filter(a=>a!==s))}}function wu(t,e){t.push(e)}function nx(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=na(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=Co(n,l);if(u!==null&&!s)return u;const h=u??Gw(n);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),wu(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),wu(e.els,h),h}function ix(t){return ex(this,this.instance,t)}function rx(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return nx(this.instance,this,e,r,o,s,a,l,n)}function ox(t={}){const{id:e,parent:n}=t;tx(this.instance,this,e,n)}const Bo=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:ix,mount:rx,unmount:ox}},sx=function(t,e,n,r){return Array.isArray(e)?Bo(t,{$:null},null,e):Array.isArray(n)?Bo(t,e,null,n):Array.isArray(r)?Bo(t,e,n,r):Bo(t,e,n,null)};function xu(t={}){const e={c:((...n)=>sx(e,...n)),use:(n,...r)=>n.install(e,...r),find:Co,context:{},config:t};return e}function ax(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return Co(t)!==null}const{c:Jn}=xu(),ia="vueuc-style";function ku(t){return t&-t}class vu{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=n,e+=ku(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=n[e],e-=ku(e);return s}getBound(e){let n=0,r=this.l;for(;r>n;){const o=Math.floor((n+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(n===o)return this.sum(n+1)<=e?n+1:o;n=o}else return o}return n}}function Cu(t){return typeof t=="string"?document.querySelector(t):t()||null}const lx=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Vw(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Qs("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Qs("lazy-teleport",this.$slots)):null}}),To={top:"bottom",bottom:"top",left:"right",right:"left"},Su={start:"end",center:"center",end:"start"},ra={top:"height",bottom:"height",left:"width",right:"width"},cx={"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"},dx={"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"},ux={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Bu={top:!0,bottom:!1,left:!0,right:!1},Tu={top:"end",bottom:"start",left:"end",right:"start"};function hx(t,e,n,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=(g,m,p)=>{let y=0,b=0;const _=n[g]-e[m]-e[g];return _>0&&r&&(p?b=Bu[m]?_:-_:y=Bu[m]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const g=ux[t],m=To[g],p=ra[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[m]<y?e[g]<e[m]?(c=Su[l],d=u(p,m,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[m]<0&&e[g]>e[m]&&(c=Su[l])}else{const g=a==="bottom"||a==="top"?"left":"top",m=To[g],p=ra[g],y=(n[p]-e[p])/2;(e[g]<y||e[m]<y)&&(e[g]>e[m]?(c=Tu[g],d=u(p,g,h)):(c=Tu[m],d=u(p,m,h)))}let f=a;return e[a]<n[ra[a]]&&e[a]<e[To[a]]&&(f=To[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function fx(t,e){return e?dx[t]:cx[t]}function mx(t,e,n,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const gx=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),Nu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Zt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),o=i.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)};i.onMounted(()=>{n.value&&(c(),s())});const l=bi();gx.mount({id:"vueuc/binder",head:!0,anchorMetaName:ia,ssr:l}),i.onBeforeUnmount(()=>{a()}),Mw(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const g=e.targetRef,{x:m,y:p,overlap:y}=t,b=m!==void 0&&p!==void 0?zw(m,p):ea(g);f.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:S,placement:k,internalShift:$,flip:E}=t;f.setAttribute("v-placement",k),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:x}=f;_==="target"?x.width=`${b.width}px`:_!==void 0?x.width=_:x.width="",S==="target"?x.minWidth=`${b.width}px`:S!==void 0?x.minWidth=S:x.minWidth="";const C=ea(f),w=ea(o.value),{left:T,top:N,placement:M}=hx(k,b,C,$,E,y),V=fx(M,y),{left:O,top:D,transform:ee}=mx(M,w,b,N,T,y);f.setAttribute("v-placement",M),f.style.setProperty("--v-offset-left",`${Math.round(T)}px`),f.style.setProperty("--v-offset-top",`${Math.round(N)}px`),f.style.transform=`translateX(${O}) translateY(${D}) ${ee}`,f.style.setProperty("--v-transform-origin",V),f.style.transformOrigin=V};i.watch(n,f=>{f?(s(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(t,f),d)}),i.watch(i.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=vo(),h=Zt(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(lx,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[au,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],px=function(){return _i.some(function(t){return t.activeTargets.length>0})},yx=function(){return _i.some(function(t){return t.skippedTargets.length>0})},$u="ResizeObserver loop completed with undelivered notifications.",bx=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:$u}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=$u),window.dispatchEvent(t)},kr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(kr||(kr={}));var wi=function(t){return Object.freeze(t)},_x=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Eu=(function(){function t(e,n,r,o){return this.x=e,this.y=n,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,wi(this)}return t.prototype.toJSON=function(){var e=this,n=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:n,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})(),oa=function(t){return t instanceof SVGElement&&"getBBox"in t},Ru=function(t){if(oa(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},Pu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},wx=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},vr=typeof window<"u"?window:{},No=new WeakMap,Fu=/auto|scroll/,xx=/^tb|vertical/,kx=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),kn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new _x((n?e:t)||0,(n?t:e)||0)},Vu=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Eu(0,0,0,0)}),Iu=function(t,e){if(e===void 0&&(e=!1),No.has(t)&&!e)return No.get(t);if(Ru(t))return No.set(t,Vu),Vu;var n=getComputedStyle(t),r=oa(t)&&t.ownerSVGElement&&t.getBBox(),o=!kx&&n.boxSizing==="border-box",s=xx.test(n.writingMode||""),a=!r&&Fu.test(n.overflowY||""),l=!r&&Fu.test(n.overflowX||""),c=r?0:kn(n.paddingTop),d=r?0:kn(n.paddingRight),u=r?0:kn(n.paddingBottom),h=r?0:kn(n.paddingLeft),f=r?0:kn(n.borderTopWidth),g=r?0:kn(n.borderRightWidth),m=r?0:kn(n.borderBottomWidth),p=r?0:kn(n.borderLeftWidth),y=h+d,b=c+u,_=p+g,S=f+m,k=l?t.offsetHeight-S-t.clientHeight:0,$=a?t.offsetWidth-_-t.clientWidth:0,E=o?y+_:0,x=o?b+S:0,C=r?r.width:kn(n.width)-E-$,w=r?r.height:kn(n.height)-x-k,T=C+y+$+_,N=w+b+k+S,M=wi({devicePixelContentBoxSize:Ji(Math.round(C*devicePixelRatio),Math.round(w*devicePixelRatio),s),borderBoxSize:Ji(T,N,s),contentBoxSize:Ji(C,w,s),contentRect:new Eu(h,c,C,w)});return No.set(t,M),M},Mu=function(t,e,n){var r=Iu(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case kr.DEVICE_PIXEL_CONTENT_BOX:return a;case kr.BORDER_BOX:return o;default:return s}},vx=(function(){function t(e){var n=Iu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),Au=function(t){if(Ru(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Cx=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new vx(d.target),h=Au(d.target);l.push(u),d.lastReportedSize=Mu(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 n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},Ou=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(Au(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Sx=function(){var t=0;for(Ou(t);px();)t=Cx(),Ou(t);return yx()&&bx(),t>0},sa,zu=[],Bx=function(){return zu.splice(0).forEach(function(t){return t()})},Tx=function(t){if(!sa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Bx()}).observe(n,r),sa=function(){n.textContent="".concat(e?e--:e++)}}zu.push(t),sa()},Nx=function(t){Tx(function(){requestAnimationFrame(t)})},$o=0,$x=function(){return!!$o},Ex=250,Rx={attributes:!0,characterData:!0,childList:!0,subtree:!0},Du=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Lu=function(t){return t===void 0&&(t=0),Date.now()+t},aa=!1,Px=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Ex),!aa){aa=!0;var r=Lu(e);Nx(function(){var o=!1;try{o=Sx()}finally{if(aa=!1,e=r-Lu(),!$x())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Rx)};document.body?n():vr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Du.forEach(function(n){return vr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Du.forEach(function(n){return vr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),la=new Px,Hu=function(t){!$o&&t>0&&la.start(),$o+=t,!$o&&la.stop()},Fx=function(t){return!oa(t)&&!wx(t)&&getComputedStyle(t).display==="inline"},Vx=(function(){function t(e,n){this.target=e,this.observedBox=n||kr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Mu(this.target,this.observedBox,!0);return Fx(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Ix=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Eo=new WeakMap,Wu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ro=(function(){function t(){}return t.connect=function(e,n){var r=new Ix(e,n);Eo.set(e,r)},t.observe=function(e,n,r){var o=Eo.get(e),s=o.observationTargets.length===0;Wu(o.observationTargets,n)<0&&(s&&_i.push(o),o.observationTargets.push(new Vx(n,r&&r.box)),Hu(1),la.schedule())},t.unobserve=function(e,n){var r=Eo.get(e),o=Wu(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(o,1),Hu(-1))},t.disconnect=function(e){var n=this,r=Eo.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Mx=(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.");Ro.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Pu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ro.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Pu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ro.unobserve(this,e)},t.prototype.disconnect=function(){Ro.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Ax{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Mx)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Cr=new Ax,Po=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}i.onMounted(()=>{const o=n.$el;if(o===void 0){mu("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){mu("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Cr.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Cr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Fo;function Ox(){return typeof document>"u"?!1:(Fo===void 0&&("matchMedia"in window?Fo=window.matchMedia("(pointer:coarse)").matches:Fo=!1),Fo)}let ca;function ju(){return typeof document>"u"?1:(ca===void 0&&(ca="chrome"in window?window.devicePixelRatio:1),ca)}const qu="VVirtualListXScroll";function zx({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),o=i.ref(0),s=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new vu(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=Zt(()=>{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=Zt(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(qu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Xu=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=i.inject(qu);return{startIndex:t,endIndex:e,columns:n,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),Dx=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Lx=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=bi();Dx.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ia,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:O}=t;V!=null?y({index:V}):O!=null&&y({key:O})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=Zt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(O=>{V+=O.width}),V}),s=i.computed(()=>{const V=new Map,{keyField:O}=t;return t.items.forEach((D,ee)=>{V.set(D[O],ee)}),V}),{scrollLeftRef:a,listWidthRef:l}=zx({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:V,itemSize:O,keyField:D}=t,ee=new vu(V.length,O);return V.forEach((ie,P)=>{const R=ie[D],H=u.get(R);H!==void 0&&ee.add(P,H)}),ee}),f=i.ref(0),g=i.ref(0),m=Zt(()=>Math.max(h.value.getBound(g.value-_r(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:O,itemSize:D}=t,ee=m.value,ie=Math.min(ee+Math.ceil(V/D+1),O.length-1),P=[];for(let R=ee;R<=ie;++R)P.push(O[R]);return P}),y=(V,O)=>{if(typeof V=="number"){k(V,O,"auto");return}const{left:D,top:ee,index:ie,key:P,position:R,behavior:H,debounce:U=!0}=V;if(D!==void 0||ee!==void 0)k(D,ee,H);else if(ie!==void 0)S(ie,H,U);else if(P!==void 0){const L=s.value.get(P);L!==void 0&&S(L,H,U)}else R==="bottom"?k(0,Number.MAX_SAFE_INTEGER,H):R==="top"&&k(0,0,H)};let b,_=null;function S(V,O,D){const{value:ee}=h,ie=ee.sum(V)+_r(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:ie,behavior:O});else{b=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:P,offsetHeight:R}=c.value;if(ie>P){const H=ee.get(V);ie+H<=P+R||c.value.scrollTo({left:0,top:ie+H-R,behavior:O})}else c.value.scrollTo({left:0,top:ie,behavior:O})}}function k(V,O,D){c.value.scrollTo({left:V,top:O,behavior:D})}function $(V,O){var D,ee,ie;if(n||t.ignoreItemResize||M(O.target))return;const{value:P}=h,R=s.value.get(V),H=P.get(R),U=(ie=(ee=(D=O.borderBoxSize)===null||D===void 0?void 0:D[0])===null||ee===void 0?void 0:ee.blockSize)!==null&&ie!==void 0?ie:O.contentRect.height;if(U===H)return;U-t.itemSize===0?u.delete(V):u.set(V,U-t.itemSize);const X=U-H;if(X===0)return;P.add(R,X);const j=c.value;if(j!=null){if(b===void 0){const F=P.sum(R);j.scrollTop>F&&j.scrollBy(0,X)}else if(R<b)j.scrollBy(0,X);else if(R===b){const F=P.sum(R);U+F>j.scrollTop+j.offsetHeight&&j.scrollBy(0,X)}N()}f.value++}const E=!Ox();let x=!1;function C(V){var O;(O=t.onScroll)===null||O===void 0||O.call(t,V),(!E||!x)&&N()}function w(V){var O;if((O=t.onWheel)===null||O===void 0||O.call(t,V),E){const D=c.value;if(D!=null){if(V.deltaX===0&&(D.scrollTop===0&&V.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),D.scrollTop+=V.deltaY/ju(),D.scrollLeft+=V.deltaX/ju(),N(),x=!0,Gd(()=>{x=!1})}}}function T(V){if(n||M(V.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(V.contentRect.height===d.value)return}else if(V.contentRect.height===d.value&&V.contentRect.width===l.value)return;d.value=V.contentRect.height,l.value=V.contentRect.width;const{onResize:O}=t;O!==void 0&&O(V)}function N(){const{value:V}=c;V!=null&&(g.value=V.scrollTop,a.value=V.scrollLeft)}function M(V){let O=V;for(;O!==null;){if(O.style.display==="none")return!0;O=O.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,O=wr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:wr(o.value),height:V?"":O,minHeight:V?O:"",paddingTop:wr(t.paddingTop),paddingBottom:wr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${wr(h.value.sum(m.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:T,handleListScroll:C,handleListWheel:w,handleItemResize:$}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Po,{onResize:this.handleListResize},{default:()=>{var o,s;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Xu,{index:u,item:c}):void 0,f=l!=null?i.h(Xu,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(Po,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>g}):(g.key=d,g)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Rn="v-hidden",Hx=Jn("[v-hidden]",{display:"none!important"}),Yu=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function o(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Rn)&&u.removeAttribute(Rn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const S of h)S.hasAttribute(Rn)&&S.removeAttribute(Rn);const f=l.offsetWidth,g=[],m=e.tail?d==null?void 0:d():null;let p=m?m.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let S=0;S<b-1;++S){if(S<0)continue;const k=h[S];if(y){k.hasAttribute(Rn)||k.setAttribute(Rn,"");continue}else k.hasAttribute(Rn)&&k.removeAttribute(Rn);const $=k.offsetWidth;if(p+=$,g[S]=$,p>f){const{updateCounter:E}=t;for(let x=S;x>=0;--x){const C=b-1-x;E!==void 0?E(C):u.textContent=`${C}`;const w=u.offsetWidth;if(p-=g[x],p+w<=f||x===0){y=!0,S=x-1,m&&(S===-1?(m.style.maxWidth=`${f-w}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:T}=t;T&&T(C);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Rn,""))}const s=bi();return Hx.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ia,ssr:s}),i.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:o}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Uu(t){return t instanceof HTMLElement}function Ku(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Ku(n)))return!0}return!1}function Gu(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Gu(n)))return!0}return!1}function Zu(t){if(!Wx(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Wx(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 Sr=[];const jx=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=Q1(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Sr[Sr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(h(),Et("keydown",document,c)):(at("keydown",document,c),o&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{at("keydown",document,c),o&&f()});function d(y){if(!s&&l()){const b=u();if(b===null||b.contains(br(y)))return;g("first")}}function u(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function h(){var y;if(!t.disabled){if(Sr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=Cu(b))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),Sr=Sr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=Cu(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function g(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const S=u();if(S==null||S===_){s=!0,b.focus({preventScroll:!0}),s=!1;return}s=!0;const k=y==="first"?Ku(S):Gu(S);s=!1,k||(s=!0,b.focus({preventScroll:!0}),s=!1)}}}function m(y){if(s)return;const b=u();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?g("last"):g("first"))}function p(y){s||(y.relatedTarget!==null&&y.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:m,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function jB(t){return t}const da="n-internal-select-menu",Qu="n-internal-select-menu-body",Ju="n-drawer-body",eh="n-modal-body",th="n-popover-body",nh="__disabled__";function Pn(t){const e=i.inject(eh,null),n=i.inject(Ju,null),r=i.inject(th,null),o=i.inject(Qu,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Et("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{at("fullscreenchange",document,a)})}return Zt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?nh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Pn.tdkey=nh,Pn.propTo={type:[String,Object,Boolean],default:void 0};function qx(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function ih(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Cr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Cr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Cr.unregisterHandler(n)}))}function rh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Xx=/^(\d|\.)+$/,oh=/(\d|\.)+/;function ua(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(Xx.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=oh.exec(t);return o?t.replace(oh,String((Number(o[0])+n)*e)):t}return t}function sh(t){const{left:e,right:n,top:r,bottom:o}=nn(t);return`${r} ${e} ${o} ${n}`}var ah={};function Yx(t){let e=".",n="__",r="--",o;if(t){let m=t.blockPrefix;m&&(e=m),m=t.elementPrefix,m&&(n=m),m=t.modifierPrefix,m&&(r=m)}const s={install(m){o=m.c;const p=m.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(m){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return m=typeof m=="string"?m:m({context:b,props:_}),b.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(m){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return m=typeof m=="string"?m:m({context:y,props:b}),y.bem.els=m.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=m.split(",").map(k=>k.trim());function _(k){return b.map($=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${$}`).join(", ")}const S=p.bem.els;if(S!==null){if(ah.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(S[0])}else return _()}}}function d(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=p.bem.els;if(ah.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${m})`}}}return Object.assign(s,{cB:((...m)=>o(a(m[0]),m[1],m[2])),cE:((...m)=>o(l(m[0]),m[1],m[2])),cM:((...m)=>o(c(m[0]),m[1],m[2])),cNotM:((...m)=>o(d(m[0]),m[1],m[2]))}),s}const Ux=".n-",Kx="__",Gx="--",lh=xu(),ch=Yx({blockPrefix:Ux,elementPrefix:Kx,modifierPrefix:Gx});lh.use(ch);const{c:ue,find:XB}=lh,{cB:ye,cE:we,cM:Ee,cNotM:rn}=ch,Zx=(...t)=>ue(">",[ye(...t)]);function Je(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ha;function Qx(){return ha===void 0&&(ha=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ha}const Jx=new WeakSet;function ek(t){Jx.add(t)}function dh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const uh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;uh.has(n)||(uh.add(n),console.error(n))}function hh(t,e){console.error(`[naive/${t}]: ${e}`)}function fh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function _t(t,...e){if(Array.isArray(t))t.forEach(n=>_t(n,...e));else return t(...e)}function fa(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){fa(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&fa(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function tk(t,e="default",n=void 0){const r=t[e];if(!r)return hh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=fa(r(n));return o.length===1?o[0]:(hh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function nk(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function ma(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Vo(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Vo(e.children)):!0)?t:null}function ga(t,e){return t&&Vo(t())||e()}function xi(t,e){const n=t&&Vo(t());return e(n||null)}function mh(t){return!(t&&Vo(t()))}const pa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",ik="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(ik),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||fh("useThemeClass","cssVarsRef is not passed");const o=i.inject(ki,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let f=u;const g=e?e.value:void 0,m=s==null?void 0:s.value;m&&(f+=`-${m}`),g&&(f+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(f+=`-${na(JSON.stringify(p))}`),y&&(f+=`-${na(JSON.stringify(y))}`),l.value=f,d=()=>{const b=n.value;let _="";for(const S in b)_+=`${S}: ${b[S]};`;ue(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const gh="n-form-item";function rk(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(gh,null);i.provide(gh,null);const s=i.computed(n?()=>n(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=i.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return i.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 ok={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 ya(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Br(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function Tr(t){return(e,n={})=>{const r=n.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)?ak(l,h=>h.test(a)):sk(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function sk(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ak(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function lk(t){return(e,n={})=>{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=n.valueCallback?n.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const ck={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"}},dk=(t,e,n)=>{let r;const o=ck[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},uk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hk=(t,e,n,r)=>uk[t],fk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gk={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"]},pk={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"]},yk={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"}},bk={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"}},_k={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Br({values:fk,defaultWidth:"wide"}),quarter:Br({values:mk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Br({values:gk,defaultWidth:"wide"}),day:Br({values:pk,defaultWidth:"wide"}),dayPeriod:Br({values:yk,defaultWidth:"wide",formattingValues:bk,defaultFormattingWidth:"wide"})},wk=/^(\d+)(th|st|nd|rd)?/i,xk=/\d+/i,kk={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},vk={any:[/^b/i,/^(a|c)/i]},Ck={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sk={any:[/1/i,/2/i,/3/i,/4/i]},Bk={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},Tk={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]},Nk={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},$k={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]},Ek={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},Rk={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}},Pk={ordinalNumber:lk({matchPattern:wk,parsePattern:xk,valueCallback:t=>parseInt(t,10)}),era:Tr({matchPatterns:kk,defaultMatchWidth:"wide",parsePatterns:vk,defaultParseWidth:"any"}),quarter:Tr({matchPatterns:Ck,defaultMatchWidth:"wide",parsePatterns:Sk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Tr({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:Tk,defaultParseWidth:"any"}),day:Tr({matchPatterns:Nk,defaultMatchWidth:"wide",parsePatterns:$k,defaultParseWidth:"any"}),dayPeriod:Tr({matchPatterns:Ek,defaultMatchWidth:"any",parsePatterns:Rk,defaultParseWidth:"any"})},Fk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ik={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mk={date:ya({formats:Fk,defaultWidth:"full"}),time:ya({formats:Vk,defaultWidth:"full"}),dateTime:ya({formats:Ik,defaultWidth:"full"})},Ak={name:"en-US",locale:{code:"en-US",formatDistance:dk,formatLong:Mk,formatRelative:hk,localize:_k,match:Pk,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function ph(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,null)||{},r=i.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:ok[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:Ak}),localeRef:r}}const Nr="naive-ui-style";function $r(t,e,n){if(!e)return;const r=bi(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(ax(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Nr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const Er={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:Ok,fontFamily:zk,lineHeight:Dk}=Er,yh=ue("body",`
116
+ `)}function na(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(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 tx(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(pu),e.els=[];else{const s=Co(n,r);s&&o.includes(s)&&(pu(s),e.els=o.filter(a=>a!==s))}}function wu(t,e){t.push(e)}function nx(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=na(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=Co(n,l);if(u!==null&&!s)return u;const h=u??Gw(n);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),wu(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),wu(e.els,h),h}function ix(t){return ex(this,this.instance,t)}function rx(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return nx(this.instance,this,e,r,o,s,a,l,n)}function ox(t={}){const{id:e,parent:n}=t;tx(this.instance,this,e,n)}const Bo=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:ix,mount:rx,unmount:ox}},sx=function(t,e,n,r){return Array.isArray(e)?Bo(t,{$:null},null,e):Array.isArray(n)?Bo(t,e,null,n):Array.isArray(r)?Bo(t,e,n,r):Bo(t,e,n,null)};function xu(t={}){const e={c:((...n)=>sx(e,...n)),use:(n,...r)=>n.install(e,...r),find:Co,context:{},config:t};return e}function ax(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return Co(t)!==null}const{c:Jn}=xu(),ia="vueuc-style";function ku(t){return t&-t}class vu{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=n,e+=ku(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=n[e],e-=ku(e);return s}getBound(e){let n=0,r=this.l;for(;r>n;){const o=Math.floor((n+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(n===o)return this.sum(n+1)<=e?n+1:o;n=o}else return o}return n}}function Cu(t){return typeof t=="string"?document.querySelector(t):t()||null}const lx=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Vw(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Qs("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Qs("lazy-teleport",this.$slots)):null}}),To={top:"bottom",bottom:"top",left:"right",right:"left"},Su={start:"end",center:"center",end:"start"},ra={top:"height",bottom:"height",left:"width",right:"width"},cx={"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"},dx={"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"},ux={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Bu={top:!0,bottom:!1,left:!0,right:!1},Tu={top:"end",bottom:"start",left:"end",right:"start"};function hx(t,e,n,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=(g,m,p)=>{let y=0,b=0;const _=n[g]-e[m]-e[g];return _>0&&r&&(p?b=Bu[m]?_:-_:y=Bu[m]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const g=ux[t],m=To[g],p=ra[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[m]<y?e[g]<e[m]?(c=Su[l],d=u(p,m,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[m]<0&&e[g]>e[m]&&(c=Su[l])}else{const g=a==="bottom"||a==="top"?"left":"top",m=To[g],p=ra[g],y=(n[p]-e[p])/2;(e[g]<y||e[m]<y)&&(e[g]>e[m]?(c=Tu[g],d=u(p,g,h)):(c=Tu[m],d=u(p,m,h)))}let f=a;return e[a]<n[ra[a]]&&e[a]<e[To[a]]&&(f=To[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function fx(t,e){return e?dx[t]:cx[t]}function mx(t,e,n,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const gx=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),Nu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Zt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),o=i.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)};i.onMounted(()=>{n.value&&(c(),s())});const l=bi();gx.mount({id:"vueuc/binder",head:!0,anchorMetaName:ia,ssr:l}),i.onBeforeUnmount(()=>{a()}),Mw(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const g=e.targetRef,{x:m,y:p,overlap:y}=t,b=m!==void 0&&p!==void 0?zw(m,p):ea(g);f.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:S,placement:k,internalShift:$,flip:E}=t;f.setAttribute("v-placement",k),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:x}=f;_==="target"?x.width=`${b.width}px`:_!==void 0?x.width=_:x.width="",S==="target"?x.minWidth=`${b.width}px`:S!==void 0?x.minWidth=S:x.minWidth="";const C=ea(f),w=ea(o.value),{left:T,top:N,placement:M}=hx(k,b,C,$,E,y),V=fx(M,y),{left:O,top:D,transform:ee}=mx(M,w,b,N,T,y);f.setAttribute("v-placement",M),f.style.setProperty("--v-offset-left",`${Math.round(T)}px`),f.style.setProperty("--v-offset-top",`${Math.round(N)}px`),f.style.transform=`translateX(${O}) translateY(${D}) ${ee}`,f.style.setProperty("--v-transform-origin",V),f.style.transformOrigin=V};i.watch(n,f=>{f?(s(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(t,f),d)}),i.watch(i.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=vo(),h=Zt(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(lx,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[au,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],px=function(){return _i.some(function(t){return t.activeTargets.length>0})},yx=function(){return _i.some(function(t){return t.skippedTargets.length>0})},$u="ResizeObserver loop completed with undelivered notifications.",bx=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:$u}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=$u),window.dispatchEvent(t)},kr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(kr||(kr={}));var wi=function(t){return Object.freeze(t)},_x=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Eu=(function(){function t(e,n,r,o){return this.x=e,this.y=n,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,wi(this)}return t.prototype.toJSON=function(){var e=this,n=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:n,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})(),oa=function(t){return t instanceof SVGElement&&"getBBox"in t},Ru=function(t){if(oa(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},Pu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},wx=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},vr=typeof window<"u"?window:{},No=new WeakMap,Fu=/auto|scroll/,xx=/^tb|vertical/,kx=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),kn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new _x((n?e:t)||0,(n?t:e)||0)},Vu=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Eu(0,0,0,0)}),Iu=function(t,e){if(e===void 0&&(e=!1),No.has(t)&&!e)return No.get(t);if(Ru(t))return No.set(t,Vu),Vu;var n=getComputedStyle(t),r=oa(t)&&t.ownerSVGElement&&t.getBBox(),o=!kx&&n.boxSizing==="border-box",s=xx.test(n.writingMode||""),a=!r&&Fu.test(n.overflowY||""),l=!r&&Fu.test(n.overflowX||""),c=r?0:kn(n.paddingTop),d=r?0:kn(n.paddingRight),u=r?0:kn(n.paddingBottom),h=r?0:kn(n.paddingLeft),f=r?0:kn(n.borderTopWidth),g=r?0:kn(n.borderRightWidth),m=r?0:kn(n.borderBottomWidth),p=r?0:kn(n.borderLeftWidth),y=h+d,b=c+u,_=p+g,S=f+m,k=l?t.offsetHeight-S-t.clientHeight:0,$=a?t.offsetWidth-_-t.clientWidth:0,E=o?y+_:0,x=o?b+S:0,C=r?r.width:kn(n.width)-E-$,w=r?r.height:kn(n.height)-x-k,T=C+y+$+_,N=w+b+k+S,M=wi({devicePixelContentBoxSize:Ji(Math.round(C*devicePixelRatio),Math.round(w*devicePixelRatio),s),borderBoxSize:Ji(T,N,s),contentBoxSize:Ji(C,w,s),contentRect:new Eu(h,c,C,w)});return No.set(t,M),M},Mu=function(t,e,n){var r=Iu(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case kr.DEVICE_PIXEL_CONTENT_BOX:return a;case kr.BORDER_BOX:return o;default:return s}},vx=(function(){function t(e){var n=Iu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),Au=function(t){if(Ru(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Cx=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new vx(d.target),h=Au(d.target);l.push(u),d.lastReportedSize=Mu(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 n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},Ou=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(Au(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Sx=function(){var t=0;for(Ou(t);px();)t=Cx(),Ou(t);return yx()&&bx(),t>0},sa,zu=[],Bx=function(){return zu.splice(0).forEach(function(t){return t()})},Tx=function(t){if(!sa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Bx()}).observe(n,r),sa=function(){n.textContent="".concat(e?e--:e++)}}zu.push(t),sa()},Nx=function(t){Tx(function(){requestAnimationFrame(t)})},$o=0,$x=function(){return!!$o},Ex=250,Rx={attributes:!0,characterData:!0,childList:!0,subtree:!0},Du=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Lu=function(t){return t===void 0&&(t=0),Date.now()+t},aa=!1,Px=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Ex),!aa){aa=!0;var r=Lu(e);Nx(function(){var o=!1;try{o=Sx()}finally{if(aa=!1,e=r-Lu(),!$x())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Rx)};document.body?n():vr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Du.forEach(function(n){return vr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Du.forEach(function(n){return vr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),la=new Px,Hu=function(t){!$o&&t>0&&la.start(),$o+=t,!$o&&la.stop()},Fx=function(t){return!oa(t)&&!wx(t)&&getComputedStyle(t).display==="inline"},Vx=(function(){function t(e,n){this.target=e,this.observedBox=n||kr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Mu(this.target,this.observedBox,!0);return Fx(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Ix=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Eo=new WeakMap,Wu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ro=(function(){function t(){}return t.connect=function(e,n){var r=new Ix(e,n);Eo.set(e,r)},t.observe=function(e,n,r){var o=Eo.get(e),s=o.observationTargets.length===0;Wu(o.observationTargets,n)<0&&(s&&_i.push(o),o.observationTargets.push(new Vx(n,r&&r.box)),Hu(1),la.schedule())},t.unobserve=function(e,n){var r=Eo.get(e),o=Wu(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(o,1),Hu(-1))},t.disconnect=function(e){var n=this,r=Eo.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Mx=(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.");Ro.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Pu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ro.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Pu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ro.unobserve(this,e)},t.prototype.disconnect=function(){Ro.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Ax{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Mx)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Cr=new Ax,Po=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}i.onMounted(()=>{const o=n.$el;if(o===void 0){mu("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){mu("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Cr.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Cr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Fo;function Ox(){return typeof document>"u"?!1:(Fo===void 0&&("matchMedia"in window?Fo=window.matchMedia("(pointer:coarse)").matches:Fo=!1),Fo)}let ca;function ju(){return typeof document>"u"?1:(ca===void 0&&(ca="chrome"in window?window.devicePixelRatio:1),ca)}const qu="VVirtualListXScroll";function zx({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),o=i.ref(0),s=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new vu(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=Zt(()=>{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=Zt(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(qu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Xu=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=i.inject(qu);return{startIndex:t,endIndex:e,columns:n,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),Dx=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Lx=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=bi();Dx.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ia,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:O}=t;V!=null?y({index:V}):O!=null&&y({key:O})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=Zt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(O=>{V+=O.width}),V}),s=i.computed(()=>{const V=new Map,{keyField:O}=t;return t.items.forEach((D,ee)=>{V.set(D[O],ee)}),V}),{scrollLeftRef:a,listWidthRef:l}=zx({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:V,itemSize:O,keyField:D}=t,ee=new vu(V.length,O);return V.forEach((ie,P)=>{const R=ie[D],H=u.get(R);H!==void 0&&ee.add(P,H)}),ee}),f=i.ref(0),g=i.ref(0),m=Zt(()=>Math.max(h.value.getBound(g.value-_r(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:O,itemSize:D}=t,ee=m.value,ie=Math.min(ee+Math.ceil(V/D+1),O.length-1),P=[];for(let R=ee;R<=ie;++R)P.push(O[R]);return P}),y=(V,O)=>{if(typeof V=="number"){k(V,O,"auto");return}const{left:D,top:ee,index:ie,key:P,position:R,behavior:H,debounce:U=!0}=V;if(D!==void 0||ee!==void 0)k(D,ee,H);else if(ie!==void 0)S(ie,H,U);else if(P!==void 0){const L=s.value.get(P);L!==void 0&&S(L,H,U)}else R==="bottom"?k(0,Number.MAX_SAFE_INTEGER,H):R==="top"&&k(0,0,H)};let b,_=null;function S(V,O,D){const{value:ee}=h,ie=ee.sum(V)+_r(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:ie,behavior:O});else{b=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:P,offsetHeight:R}=c.value;if(ie>P){const H=ee.get(V);ie+H<=P+R||c.value.scrollTo({left:0,top:ie+H-R,behavior:O})}else c.value.scrollTo({left:0,top:ie,behavior:O})}}function k(V,O,D){c.value.scrollTo({left:V,top:O,behavior:D})}function $(V,O){var D,ee,ie;if(n||t.ignoreItemResize||M(O.target))return;const{value:P}=h,R=s.value.get(V),H=P.get(R),U=(ie=(ee=(D=O.borderBoxSize)===null||D===void 0?void 0:D[0])===null||ee===void 0?void 0:ee.blockSize)!==null&&ie!==void 0?ie:O.contentRect.height;if(U===H)return;U-t.itemSize===0?u.delete(V):u.set(V,U-t.itemSize);const X=U-H;if(X===0)return;P.add(R,X);const j=c.value;if(j!=null){if(b===void 0){const F=P.sum(R);j.scrollTop>F&&j.scrollBy(0,X)}else if(R<b)j.scrollBy(0,X);else if(R===b){const F=P.sum(R);U+F>j.scrollTop+j.offsetHeight&&j.scrollBy(0,X)}N()}f.value++}const E=!Ox();let x=!1;function C(V){var O;(O=t.onScroll)===null||O===void 0||O.call(t,V),(!E||!x)&&N()}function w(V){var O;if((O=t.onWheel)===null||O===void 0||O.call(t,V),E){const D=c.value;if(D!=null){if(V.deltaX===0&&(D.scrollTop===0&&V.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),D.scrollTop+=V.deltaY/ju(),D.scrollLeft+=V.deltaX/ju(),N(),x=!0,Gd(()=>{x=!1})}}}function T(V){if(n||M(V.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(V.contentRect.height===d.value)return}else if(V.contentRect.height===d.value&&V.contentRect.width===l.value)return;d.value=V.contentRect.height,l.value=V.contentRect.width;const{onResize:O}=t;O!==void 0&&O(V)}function N(){const{value:V}=c;V!=null&&(g.value=V.scrollTop,a.value=V.scrollLeft)}function M(V){let O=V;for(;O!==null;){if(O.style.display==="none")return!0;O=O.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,O=wr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:wr(o.value),height:V?"":O,minHeight:V?O:"",paddingTop:wr(t.paddingTop),paddingBottom:wr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${wr(h.value.sum(m.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:T,handleListScroll:C,handleListWheel:w,handleItemResize:$}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Po,{onResize:this.handleListResize},{default:()=>{var o,s;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Xu,{index:u,item:c}):void 0,f=l!=null?i.h(Xu,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(Po,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>g}):(g.key=d,g)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Rn="v-hidden",Hx=Jn("[v-hidden]",{display:"none!important"}),Yu=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function o(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Rn)&&u.removeAttribute(Rn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const S of h)S.hasAttribute(Rn)&&S.removeAttribute(Rn);const f=l.offsetWidth,g=[],m=e.tail?d==null?void 0:d():null;let p=m?m.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let S=0;S<b-1;++S){if(S<0)continue;const k=h[S];if(y){k.hasAttribute(Rn)||k.setAttribute(Rn,"");continue}else k.hasAttribute(Rn)&&k.removeAttribute(Rn);const $=k.offsetWidth;if(p+=$,g[S]=$,p>f){const{updateCounter:E}=t;for(let x=S;x>=0;--x){const C=b-1-x;E!==void 0?E(C):u.textContent=`${C}`;const w=u.offsetWidth;if(p-=g[x],p+w<=f||x===0){y=!0,S=x-1,m&&(S===-1?(m.style.maxWidth=`${f-w}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:T}=t;T&&T(C);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Rn,""))}const s=bi();return Hx.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ia,ssr:s}),i.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:o}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Uu(t){return t instanceof HTMLElement}function Ku(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Ku(n)))return!0}return!1}function Gu(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Gu(n)))return!0}return!1}function Zu(t){if(!Wx(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Wx(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 Sr=[];const jx=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=Q1(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Sr[Sr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(h(),Et("keydown",document,c)):(at("keydown",document,c),o&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{at("keydown",document,c),o&&f()});function d(y){if(!s&&l()){const b=u();if(b===null||b.contains(br(y)))return;g("first")}}function u(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function h(){var y;if(!t.disabled){if(Sr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=Cu(b))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),Sr=Sr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=Cu(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function g(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const S=u();if(S==null||S===_){s=!0,b.focus({preventScroll:!0}),s=!1;return}s=!0;const k=y==="first"?Ku(S):Gu(S);s=!1,k||(s=!0,b.focus({preventScroll:!0}),s=!1)}}}function m(y){if(s)return;const b=u();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?g("last"):g("first"))}function p(y){s||(y.relatedTarget!==null&&y.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:m,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function qB(t){return t}const da="n-internal-select-menu",Qu="n-internal-select-menu-body",Ju="n-drawer-body",eh="n-modal-body",th="n-popover-body",nh="__disabled__";function Pn(t){const e=i.inject(eh,null),n=i.inject(Ju,null),r=i.inject(th,null),o=i.inject(Qu,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Et("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{at("fullscreenchange",document,a)})}return Zt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?nh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Pn.tdkey=nh,Pn.propTo={type:[String,Object,Boolean],default:void 0};function qx(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function ih(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Cr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Cr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Cr.unregisterHandler(n)}))}function rh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Xx=/^(\d|\.)+$/,oh=/(\d|\.)+/;function ua(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(Xx.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=oh.exec(t);return o?t.replace(oh,String((Number(o[0])+n)*e)):t}return t}function sh(t){const{left:e,right:n,top:r,bottom:o}=nn(t);return`${r} ${e} ${o} ${n}`}var ah={};function Yx(t){let e=".",n="__",r="--",o;if(t){let m=t.blockPrefix;m&&(e=m),m=t.elementPrefix,m&&(n=m),m=t.modifierPrefix,m&&(r=m)}const s={install(m){o=m.c;const p=m.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(m){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return m=typeof m=="string"?m:m({context:b,props:_}),b.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(m){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return m=typeof m=="string"?m:m({context:y,props:b}),y.bem.els=m.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=m.split(",").map(k=>k.trim());function _(k){return b.map($=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${$}`).join(", ")}const S=p.bem.els;if(S!==null){if(ah.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(S[0])}else return _()}}}function d(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=p.bem.els;if(ah.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${m})`}}}return Object.assign(s,{cB:((...m)=>o(a(m[0]),m[1],m[2])),cE:((...m)=>o(l(m[0]),m[1],m[2])),cM:((...m)=>o(c(m[0]),m[1],m[2])),cNotM:((...m)=>o(d(m[0]),m[1],m[2]))}),s}const Ux=".n-",Kx="__",Gx="--",lh=xu(),ch=Yx({blockPrefix:Ux,elementPrefix:Kx,modifierPrefix:Gx});lh.use(ch);const{c:ue,find:YB}=lh,{cB:ye,cE:we,cM:Ee,cNotM:rn}=ch,Zx=(...t)=>ue(">",[ye(...t)]);function Je(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ha;function Qx(){return ha===void 0&&(ha=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ha}const Jx=new WeakSet;function ek(t){Jx.add(t)}function dh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const uh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;uh.has(n)||(uh.add(n),console.error(n))}function hh(t,e){console.error(`[naive/${t}]: ${e}`)}function fh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function _t(t,...e){if(Array.isArray(t))t.forEach(n=>_t(n,...e));else return t(...e)}function fa(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){fa(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&fa(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function tk(t,e="default",n=void 0){const r=t[e];if(!r)return hh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=fa(r(n));return o.length===1?o[0]:(hh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function nk(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function ma(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Vo(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Vo(e.children)):!0)?t:null}function ga(t,e){return t&&Vo(t())||e()}function xi(t,e){const n=t&&Vo(t());return e(n||null)}function mh(t){return!(t&&Vo(t()))}const pa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",ik="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(ik),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||fh("useThemeClass","cssVarsRef is not passed");const o=i.inject(ki,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let f=u;const g=e?e.value:void 0,m=s==null?void 0:s.value;m&&(f+=`-${m}`),g&&(f+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(f+=`-${na(JSON.stringify(p))}`),y&&(f+=`-${na(JSON.stringify(y))}`),l.value=f,d=()=>{const b=n.value;let _="";for(const S in b)_+=`${S}: ${b[S]};`;ue(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const gh="n-form-item";function rk(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(gh,null);i.provide(gh,null);const s=i.computed(n?()=>n(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=i.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return i.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 ok={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 ya(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Br(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function Tr(t){return(e,n={})=>{const r=n.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)?ak(l,h=>h.test(a)):sk(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function sk(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ak(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function lk(t){return(e,n={})=>{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=n.valueCallback?n.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const ck={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"}},dk=(t,e,n)=>{let r;const o=ck[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},uk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hk=(t,e,n,r)=>uk[t],fk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gk={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"]},pk={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"]},yk={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"}},bk={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"}},_k={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Br({values:fk,defaultWidth:"wide"}),quarter:Br({values:mk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Br({values:gk,defaultWidth:"wide"}),day:Br({values:pk,defaultWidth:"wide"}),dayPeriod:Br({values:yk,defaultWidth:"wide",formattingValues:bk,defaultFormattingWidth:"wide"})},wk=/^(\d+)(th|st|nd|rd)?/i,xk=/\d+/i,kk={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},vk={any:[/^b/i,/^(a|c)/i]},Ck={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Sk={any:[/1/i,/2/i,/3/i,/4/i]},Bk={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},Tk={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]},Nk={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},$k={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]},Ek={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},Rk={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}},Pk={ordinalNumber:lk({matchPattern:wk,parsePattern:xk,valueCallback:t=>parseInt(t,10)}),era:Tr({matchPatterns:kk,defaultMatchWidth:"wide",parsePatterns:vk,defaultParseWidth:"any"}),quarter:Tr({matchPatterns:Ck,defaultMatchWidth:"wide",parsePatterns:Sk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Tr({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:Tk,defaultParseWidth:"any"}),day:Tr({matchPatterns:Nk,defaultMatchWidth:"wide",parsePatterns:$k,defaultParseWidth:"any"}),dayPeriod:Tr({matchPatterns:Ek,defaultMatchWidth:"any",parsePatterns:Rk,defaultParseWidth:"any"})},Fk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ik={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Mk={date:ya({formats:Fk,defaultWidth:"full"}),time:ya({formats:Vk,defaultWidth:"full"}),dateTime:ya({formats:Ik,defaultWidth:"full"})},Ak={name:"en-US",locale:{code:"en-US",formatDistance:dk,formatLong:Mk,formatRelative:hk,localize:_k,match:Pk,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function ph(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,null)||{},r=i.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:ok[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:Ak}),localeRef:r}}const Nr="naive-ui-style";function $r(t,e,n){if(!e)return;const r=bi(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(ax(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Nr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const Er={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:Ok,fontFamily:zk,lineHeight:Dk}=Er,yh=ue("body",`
117
117
  margin: 0;
118
118
  font-size: ${Ok};
119
119
  font-family: ${zk};
@@ -123,7 +123,7 @@ ${o}
123
123
  `,[ue("input",`
124
124
  font-family: inherit;
125
125
  font-size: inherit;
126
- `)]);var Lk={};function Io(t,e,n){if(!e){Lk.NODE_ENV!=="production"&&fh("use-style","No style is specified.");return}const r=bi(),o=i.inject(ki,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Nr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||yh.mount({id:"n-global",head:!0,anchorMetaName:Nr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function KB(t){return t}function wt(t,e,n,r,o,s){const a=bi(),l=i.inject(ki,null);if(n){const d=()=>{const u=s==null?void 0:s.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Nr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||yh.mount({id:"n-global",head:!0,anchorMetaName:Nr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:f={}}={},themeOverrides:g={},builtinThemeOverrides:m={}}=o,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:S=void 0,peers:k={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:$=void 0,[t]:E={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:C={}}=E,w=A.merge({},u||_||b||r.common,$,x,p),T=A.merge((d=h||S||r.self)===null||d===void 0?void 0:d(w),m,E,g);return{common:w,self:T,peers:A.merge({},r.peers,k,f),peerOverrides:A.merge({},m.peers,C,y)}})}wt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Hk=ye("base-icon",`
126
+ `)]);var Lk={};function Io(t,e,n){if(!e){Lk.NODE_ENV!=="production"&&fh("use-style","No style is specified.");return}const r=bi(),o=i.inject(ki,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Nr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||yh.mount({id:"n-global",head:!0,anchorMetaName:Nr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function GB(t){return t}function wt(t,e,n,r,o,s){const a=bi(),l=i.inject(ki,null);if(n){const d=()=>{const u=s==null?void 0:s.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Nr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||yh.mount({id:"n-global",head:!0,anchorMetaName:Nr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:f={}}={},themeOverrides:g={},builtinThemeOverrides:m={}}=o,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:S=void 0,peers:k={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:$=void 0,[t]:E={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:C={}}=E,w=A.merge({},u||_||b||r.common,$,x,p),T=A.merge((d=h||S||r.self)===null||d===void 0?void 0:d(w),m,E,g);return{common:w,self:T,peers:A.merge({},r.peers,k,f),peerOverrides:A.merge({},m.peers,C,y)}})}wt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Hk=ye("base-icon",`
127
127
  height: 1em;
128
128
  width: 1em;
129
129
  line-height: 1em;
@@ -810,7 +810,7 @@ ${o}
810
810
  line-height: 1.25;
811
811
  text-overflow: ellipsis;
812
812
  overflow: hidden;
813
- `)])])]),jv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},wt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=$r("InternalSelection",n,e),o=i.ref(null),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=wt("InternalSelection","-internal-selection",Wv,Vh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),S=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const Q=t.selectedOption;if(Q)return Q[t.labelField]}),$=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function E(){var Q;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((Q=f.value)===null||Q===void 0||Q.sync({showAllItemsBeforeCalculate:!1})))}}function x(){const{value:Q}=g;Q&&(Q.style.display="none")}function C(){const{value:Q}=g;Q&&(Q.style.display="inline-block")}i.watch(i.toRef(t,"active"),Q=>{Q||x()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(E)});function w(Q){const{onFocus:le}=t;le&&le(Q)}function T(Q){const{onBlur:le}=t;le&&le(Q)}function N(Q){const{onDeleteOption:le}=t;le&&le(Q)}function M(Q){const{onClear:le}=t;le&&le(Q)}function V(Q){const{onPatternInput:le}=t;le&&le(Q)}function O(Q){var le;(!Q.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(Q.relatedTarget)))&&w(Q)}function D(Q){var le;!((le=a.value)===null||le===void 0)&&le.contains(Q.relatedTarget)||T(Q)}function ee(Q){M(Q)}function ie(){y.value=!0}function P(){y.value=!1}function R(Q){!t.active||!t.filterable||Q.target!==s.value&&Q.preventDefault()}function H(Q){N(Q)}const U=i.ref(!1);function L(Q){if(Q.key==="Backspace"&&!U.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&H(le[le.length-1])}}let X=null;function j(Q){const{value:le}=o;if(le){const De=Q.target.value;le.textContent=De,E()}t.ignoreComposition&&U.value?X=Q:V(Q)}function F(){U.value=!0}function q(){U.value=!1,t.ignoreComposition&&V(X),X=null}function K(Q){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,Q)}function J(Q){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,Q)}function he(){var Q,le;if(t.filterable)p.value=!1,(Q=d.value)===null||Q===void 0||Q.blur(),(le=s.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function Be(){var Q,le,De;t.filterable?(p.value=!1,(Q=d.value)===null||Q===void 0||Q.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:Q}=s;Q&&(C(),Q.focus())}function We(){const{value:Q}=s;Q&&Q.blur()}function ce(Q){const{value:le}=u;le&&le.setTextContent(`+${Q}`)}function mt(){const{value:Q}=h;return Q}function Ne(){return s.value}let Pt=null;function Wt(){Pt!==null&&window.clearTimeout(Pt)}function an(){t.active||(Wt(),Pt=window.setTimeout(()=>{$.value&&(m.value=!0)},100))}function Ct(){Wt()}function Ln(Q){Q||(Wt(),m.value=!1)}i.watch($,Q=>{Q||(m.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const Q=d.value;Q&&(t.disabled?Q.removeAttribute("tabindex"):Q.tabIndex=p.value?-1:0)})}),ih(a,t.onResize);const{inlineThemeDisabled:ln}=t,Jt=i.computed(()=>{const{size:Q}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ni,color:nt,placeholderColor:jt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:cn,textColorDisabled:Hn,placeholderColorDisabled:I,colorActive:G,boxShadowFocus:se,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Ce,borderActive:Ze,arrowColor:Bn,arrowColorDisabled:Na,loadingColor:$a,colorActiveWarning:Ea,boxShadowFocusWarning:Ra,boxShadowActiveWarning:Pa,boxShadowHoverWarning:Fa,borderWarning:Va,borderFocusWarning:Ia,borderHoverWarning:Ma,borderActiveWarning:Aa,colorActiveError:Oa,boxShadowFocusError:za,boxShadowActiveError:Da,boxShadowHoverError:La,borderError:Ha,borderFocusError:Wa,borderHoverError:ja,borderActiveError:FB,clearColor:VB,clearColorHover:IB,clearColorPressed:MB,clearSize:AB,arrowSize:OB,[Je("height",Q)]:zB,[Je("fontSize",Q)]:DB}}=b.value,zo=nn(ii),Do=nn($i);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Ze,"--n-border-focus":ke,"--n-border-hover":Ce,"--n-border-radius":ni,"--n-box-shadow-active":fe,"--n-box-shadow-focus":se,"--n-box-shadow-hover":me,"--n-caret-color":nr,"--n-color":nt,"--n-color-active":G,"--n-color-disabled":cn,"--n-font-size":DB,"--n-height":zB,"--n-padding-single-top":zo.top,"--n-padding-multiple-top":Do.top,"--n-padding-single-right":zo.right,"--n-padding-multiple-right":Do.right,"--n-padding-single-left":zo.left,"--n-padding-multiple-left":Do.left,"--n-padding-single-bottom":zo.bottom,"--n-padding-multiple-bottom":Do.bottom,"--n-placeholder-color":jt,"--n-placeholder-color-disabled":I,"--n-text-color":tr,"--n-text-color-disabled":Hn,"--n-arrow-color":Bn,"--n-arrow-color-disabled":Na,"--n-loading-color":$a,"--n-color-active-warning":Ea,"--n-box-shadow-focus-warning":Ra,"--n-box-shadow-active-warning":Pa,"--n-box-shadow-hover-warning":Fa,"--n-border-warning":Va,"--n-border-focus-warning":Ia,"--n-border-hover-warning":Ma,"--n-border-active-warning":Aa,"--n-color-active-error":Oa,"--n-box-shadow-focus-error":za,"--n-box-shadow-active-error":Da,"--n-box-shadow-hover-error":La,"--n-border-error":Ha,"--n-border-focus-error":Wa,"--n-border-hover-error":ja,"--n-border-active-error":FB,"--n-clear-size":AB,"--n-clear-color":VB,"--n-clear-color-hover":IB,"--n-clear-color-pressed":MB,"--n-arrow-size":OB,"--n-font-weight":De}}),Ve=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Jt,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:S,label:k,selected:$,showTagsPanel:m,isComposing:U,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:g,handleMouseDown:R,handleFocusin:O,handleClear:ee,handleMouseEnter:ie,handleMouseLeave:P,handleDeleteOption:H,handlePatternKeyDown:L,handlePatternInputInput:j,handlePatternInputBlur:J,handlePatternInputFocus:K,handleMouseEnterCounter:an,handleMouseLeaveCounter:Ct,handleFocusout:D,handleCompositionEnd:q,handleCompositionStart:F,onPopoverUpdateShow:Ln,focus:Be,focusInput:Te,blur:he,blurInput:We,updateCounter:ce,getCounter:mt,getTail:Ne,renderLabel:t.renderLabel,cssVars:ln?void 0:Jt,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,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",g=typeof s=="number",m=f||g,p=i.h(pa,null,{default:()=>i.h(Dv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},u?u({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(ka,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(V,!0):er(V[b],V,!0)})),S=()=>(g?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),k=o?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,$=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let E;if(g){const V=this.selectedOptions.length-s;V>0&&(E=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const x=f?o?i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:$,tail:()=>k}):i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:$}):g&&E?S().concat(E):S(),C=m?()=>i.h("div",{class:`${l}-base-selection-popover`},f?S():this.selectedOptions.map(_)):void 0,w=m?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,N=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,M=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},x,f?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},x,p);y=i.h(i.Fragment,null,m?i.h(Rv,Object.assign({},w,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>M,default:C}):M,N)}else if(o){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,S=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:dh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:dh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function qv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Xv={name:"Select",common:Si,peers:{InternalSelection:Vh,InternalSelectMenu:Bh},self:qv},Yv=ue([ye("select",`
813
+ `)])])]),jv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},wt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=$r("InternalSelection",n,e),o=i.ref(null),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=wt("InternalSelection","-internal-selection",Wv,Vh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),S=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const Q=t.selectedOption;if(Q)return Q[t.labelField]}),$=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function E(){var Q;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((Q=f.value)===null||Q===void 0||Q.sync({showAllItemsBeforeCalculate:!1})))}}function x(){const{value:Q}=g;Q&&(Q.style.display="none")}function C(){const{value:Q}=g;Q&&(Q.style.display="inline-block")}i.watch(i.toRef(t,"active"),Q=>{Q||x()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(E)});function w(Q){const{onFocus:le}=t;le&&le(Q)}function T(Q){const{onBlur:le}=t;le&&le(Q)}function N(Q){const{onDeleteOption:le}=t;le&&le(Q)}function M(Q){const{onClear:le}=t;le&&le(Q)}function V(Q){const{onPatternInput:le}=t;le&&le(Q)}function O(Q){var le;(!Q.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(Q.relatedTarget)))&&w(Q)}function D(Q){var le;!((le=a.value)===null||le===void 0)&&le.contains(Q.relatedTarget)||T(Q)}function ee(Q){M(Q)}function ie(){y.value=!0}function P(){y.value=!1}function R(Q){!t.active||!t.filterable||Q.target!==s.value&&Q.preventDefault()}function H(Q){N(Q)}const U=i.ref(!1);function L(Q){if(Q.key==="Backspace"&&!U.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&H(le[le.length-1])}}let X=null;function j(Q){const{value:le}=o;if(le){const De=Q.target.value;le.textContent=De,E()}t.ignoreComposition&&U.value?X=Q:V(Q)}function F(){U.value=!0}function q(){U.value=!1,t.ignoreComposition&&V(X),X=null}function K(Q){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,Q)}function J(Q){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,Q)}function he(){var Q,le;if(t.filterable)p.value=!1,(Q=d.value)===null||Q===void 0||Q.blur(),(le=s.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function Be(){var Q,le,De;t.filterable?(p.value=!1,(Q=d.value)===null||Q===void 0||Q.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:Q}=s;Q&&(C(),Q.focus())}function We(){const{value:Q}=s;Q&&Q.blur()}function ce(Q){const{value:le}=u;le&&le.setTextContent(`+${Q}`)}function mt(){const{value:Q}=h;return Q}function Ne(){return s.value}let Pt=null;function Wt(){Pt!==null&&window.clearTimeout(Pt)}function an(){t.active||(Wt(),Pt=window.setTimeout(()=>{$.value&&(m.value=!0)},100))}function Ct(){Wt()}function Ln(Q){Q||(Wt(),m.value=!1)}i.watch($,Q=>{Q||(m.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const Q=d.value;Q&&(t.disabled?Q.removeAttribute("tabindex"):Q.tabIndex=p.value?-1:0)})}),ih(a,t.onResize);const{inlineThemeDisabled:ln}=t,Jt=i.computed(()=>{const{size:Q}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ni,color:nt,placeholderColor:jt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:cn,textColorDisabled:Hn,placeholderColorDisabled:I,colorActive:G,boxShadowFocus:se,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Ce,borderActive:Ze,arrowColor:Bn,arrowColorDisabled:Na,loadingColor:$a,colorActiveWarning:Ea,boxShadowFocusWarning:Ra,boxShadowActiveWarning:Pa,boxShadowHoverWarning:Fa,borderWarning:Va,borderFocusWarning:Ia,borderHoverWarning:Ma,borderActiveWarning:Aa,colorActiveError:Oa,boxShadowFocusError:za,boxShadowActiveError:Da,boxShadowHoverError:La,borderError:Ha,borderFocusError:Wa,borderHoverError:ja,borderActiveError:VB,clearColor:IB,clearColorHover:MB,clearColorPressed:AB,clearSize:OB,arrowSize:zB,[Je("height",Q)]:DB,[Je("fontSize",Q)]:LB}}=b.value,zo=nn(ii),Do=nn($i);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Ze,"--n-border-focus":ke,"--n-border-hover":Ce,"--n-border-radius":ni,"--n-box-shadow-active":fe,"--n-box-shadow-focus":se,"--n-box-shadow-hover":me,"--n-caret-color":nr,"--n-color":nt,"--n-color-active":G,"--n-color-disabled":cn,"--n-font-size":LB,"--n-height":DB,"--n-padding-single-top":zo.top,"--n-padding-multiple-top":Do.top,"--n-padding-single-right":zo.right,"--n-padding-multiple-right":Do.right,"--n-padding-single-left":zo.left,"--n-padding-multiple-left":Do.left,"--n-padding-single-bottom":zo.bottom,"--n-padding-multiple-bottom":Do.bottom,"--n-placeholder-color":jt,"--n-placeholder-color-disabled":I,"--n-text-color":tr,"--n-text-color-disabled":Hn,"--n-arrow-color":Bn,"--n-arrow-color-disabled":Na,"--n-loading-color":$a,"--n-color-active-warning":Ea,"--n-box-shadow-focus-warning":Ra,"--n-box-shadow-active-warning":Pa,"--n-box-shadow-hover-warning":Fa,"--n-border-warning":Va,"--n-border-focus-warning":Ia,"--n-border-hover-warning":Ma,"--n-border-active-warning":Aa,"--n-color-active-error":Oa,"--n-box-shadow-focus-error":za,"--n-box-shadow-active-error":Da,"--n-box-shadow-hover-error":La,"--n-border-error":Ha,"--n-border-focus-error":Wa,"--n-border-hover-error":ja,"--n-border-active-error":VB,"--n-clear-size":OB,"--n-clear-color":IB,"--n-clear-color-hover":MB,"--n-clear-color-pressed":AB,"--n-arrow-size":zB,"--n-font-weight":De}}),Ve=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Jt,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:S,label:k,selected:$,showTagsPanel:m,isComposing:U,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:g,handleMouseDown:R,handleFocusin:O,handleClear:ee,handleMouseEnter:ie,handleMouseLeave:P,handleDeleteOption:H,handlePatternKeyDown:L,handlePatternInputInput:j,handlePatternInputBlur:J,handlePatternInputFocus:K,handleMouseEnterCounter:an,handleMouseLeaveCounter:Ct,handleFocusout:D,handleCompositionEnd:q,handleCompositionStart:F,onPopoverUpdateShow:Ln,focus:Be,focusInput:Te,blur:he,blurInput:We,updateCounter:ce,getCounter:mt,getTail:Ne,renderLabel:t.renderLabel,cssVars:ln?void 0:Jt,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,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",g=typeof s=="number",m=f||g,p=i.h(pa,null,{default:()=>i.h(Dv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},u?u({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(ka,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(V,!0):er(V[b],V,!0)})),S=()=>(g?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),k=o?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,$=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let E;if(g){const V=this.selectedOptions.length-s;V>0&&(E=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const x=f?o?i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:$,tail:()=>k}):i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:$}):g&&E?S().concat(E):S(),C=m?()=>i.h("div",{class:`${l}-base-selection-popover`},f?S():this.selectedOptions.map(_)):void 0,w=m?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,N=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,M=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},x,f?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},x,p);y=i.h(i.Fragment,null,m?i.h(Rv,Object.assign({},w,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>M,default:C}):M,N)}else if(o){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,S=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:dh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:dh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function qv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Xv={name:"Select",common:Si,peers:{InternalSelection:Vh,InternalSelectMenu:Bh},self:qv},Yv=ue([ye("select",`
814
814
  z-index: auto;
815
815
  outline: none;
816
816
  width: 100%;
@@ -819,4 +819,4 @@ ${o}
819
819
  `),ye("select-menu",`
820
820
  margin: 4px 0;
821
821
  box-shadow: var(--n-menu-box-shadow);
822
- `,[Rh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Mo(t){return t.type==="group"}function Ih(t){return t.type==="ignored"}function va(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function Uv(t,e){return{getIsGroup:Mo,getIgnored:Ih,getKey(r){return Mo(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function Kv(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(Mo(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ih(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function Gv(t,e,n){const r=new Map;return t.forEach(o=>{Mo(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var Zv={};const Qv=Object.assign(Object.assign({},wt.props),{to:Pn.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}),Jv=i.defineComponent({name:"Select",props:Qv,slots:Object,setup(t){Zv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=vi(t),s=wt("Select","-select",Yv,Xv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Zs(l,a),d=i.ref(!1),u=i.ref(""),h=lu(t,["items","options"]),f=i.ref([]),g=i.ref([]),m=i.computed(()=>g.value.concat(f.value).concat(h.value)),p=i.computed(()=>{const{filter:I}=t;if(I)return I;const{labelField:G,valueField:se}=t;return(fe,me)=>{if(!me)return!1;const _e=me[G];if(typeof _e=="string")return va(fe,_e);const ke=me[se];return typeof ke=="string"?va(fe,ke):typeof ke=="number"?va(fe,String(ke)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:I}=m,{value:G}=u;return!G.length||!t.filterable?I:Kv(I,p.value,G,t.childrenField)}}),b=i.computed(()=>{const{valueField:I,childrenField:G}=t,se=Uv(I,G);return Sw(y.value,se)}),_=i.computed(()=>Gv(m.value,t.valueField,t.childrenField)),S=i.ref(!1),k=Zs(i.toRef(t,"show"),S),$=i.ref(null),E=i.ref(null),x=i.ref(null),{localeRef:C}=ph("Select"),w=i.computed(()=>{var I;return(I=t.placeholder)!==null&&I!==void 0?I:C.value.placeholder}),T=[],N=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:I}=t;if(I===void 0){const{labelField:G,valueField:se}=t;return fe=>({[G]:String(fe),[se]:fe})}return I===!1?!1:G=>Object.assign(I(G),{value:G})});function V(I){const G=t.remote,{value:se}=N,{value:fe}=_,{value:me}=M,_e=[];return I.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(G&&se.has(ke))_e.push(se.get(ke));else if(me){const Ce=me(ke);Ce&&_e.push(Ce)}}),_e}const O=i.computed(()=>{if(t.multiple){const{value:I}=c;return Array.isArray(I)?V(I):[]}return null}),D=i.computed(()=>{const{value:I}=c;return!t.multiple&&!Array.isArray(I)?I===null?null:V([I])[0]||null:null}),ee=rk(t),{mergedSizeRef:ie,mergedDisabledRef:P,mergedStatusRef:R}=ee;function H(I,G){const{onChange:se,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=ee;se&&_t(se,I,G),me&&_t(me,I,G),fe&&_t(fe,I,G),a.value=I,_e(),ke()}function U(I){const{onBlur:G}=t,{nTriggerFormBlur:se}=ee;G&&_t(G,I),se()}function L(){const{onClear:I}=t;I&&_t(I)}function X(I){const{onFocus:G,showOnFocus:se}=t,{nTriggerFormFocus:fe}=ee;G&&_t(G,I),fe(),se&&J()}function j(I){const{onSearch:G}=t;G&&_t(G,I)}function F(I){const{onScroll:G}=t;G&&_t(G,I)}function q(){var I;const{remote:G,multiple:se}=t;if(G){const{value:fe}=N;if(se){const{valueField:me}=t;(I=O.value)===null||I===void 0||I.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=D.value;me&&fe.set(me[t.valueField],me)}}}function K(I){const{onUpdateShow:G,"onUpdate:show":se}=t;G&&_t(G,I),se&&_t(se,I),S.value=I}function J(){P.value||(K(!0),S.value=!0,t.filterable&&ii())}function he(){K(!1)}function Be(){u.value="",g.value=T}const Te=i.ref(!1);function We(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,k.value||Be())}function mt(){P.value||(k.value?t.filterable?ii():he():J())}function Ne(I){var G,se;!((se=(G=x.value)===null||G===void 0?void 0:G.selfRef)===null||se===void 0)&&se.contains(I.relatedTarget)||(d.value=!1,U(I),he())}function Pt(I){X(I),d.value=!0}function Wt(){d.value=!0}function an(I){var G;!((G=$.value)===null||G===void 0)&&G.$el.contains(I.relatedTarget)||(d.value=!1,U(I),he())}function Ct(){var I;(I=$.value)===null||I===void 0||I.focus(),he()}function Ln(I){var G;k.value&&(!((G=$.value)===null||G===void 0)&&G.$el.contains(br(I))||he())}function ln(I){if(!Array.isArray(I))return[];if(M.value)return Array.from(I);{const{remote:G}=t,{value:se}=_;if(G){const{value:fe}=N;return I.filter(me=>se.has(me)||fe.has(me))}else return I.filter(fe=>se.has(fe))}}function Jt(I){Ve(I.rawNode)}function Ve(I){if(P.value)return;const{tag:G,remote:se,clearFilterAfterSelect:fe,valueField:me}=t;if(G&&!se){const{value:_e}=g,ke=_e[0]||null;if(ke){const Ce=f.value;Ce.length?Ce.push(ke):f.value=[ke],g.value=T}}if(se&&N.value.set(I[me],I),t.multiple){const _e=ln(c.value),ke=_e.findIndex(Ce=>Ce===I[me]);if(~ke){if(_e.splice(ke,1),G&&!se){const Ce=Q(I[me]);~Ce&&(f.value.splice(Ce,1),fe&&(u.value=""))}}else _e.push(I[me]),fe&&(u.value="");H(_e,V(_e))}else{if(G&&!se){const _e=Q(I[me]);~_e?f.value=[f.value[_e]]:f.value=T}tr(),he(),H(I[me],I)}}function Q(I){return f.value.findIndex(se=>se[t.valueField]===I)}function le(I){k.value||J();const{value:G}=I.target;u.value=G;const{tag:se,remote:fe}=t;if(j(G),se&&!fe){if(!G){g.value=T;return}const{onCreate:me}=t,_e=me?me(G):{[t.labelField]:G,[t.valueField]:G},{valueField:ke,labelField:Ce}=t;h.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Ce]===_e[Ce])||f.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Ce]===_e[Ce])?g.value=T:g.value=[_e]}}function De(I){I.stopPropagation();const{multiple:G}=t;!G&&t.filterable&&he(),L(),G?H([],[]):H(null,null)}function ni(I){!yr(I,"action")&&!yr(I,"empty")&&!yr(I,"header")&&I.preventDefault()}function nt(I){F(I)}function jt(I){var G,se,fe,me,_e;if(!t.keyboard){I.preventDefault();return}switch(I.key){case" ":if(t.filterable)break;I.preventDefault();case"Enter":if(!(!((G=$.value)===null||G===void 0)&&G.isComposing)){if(k.value){const ke=(se=x.value)===null||se===void 0?void 0:se.getPendingTmNode();ke?Jt(ke):t.filterable||(he(),tr())}else if(J(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Ce=ke[t.valueField],{value:Ze}=c;t.multiple&&Array.isArray(Ze)&&Ze.includes(Ce)||Ve(ke)}}}I.preventDefault();break;case"ArrowUp":if(I.preventDefault(),t.loading)return;k.value&&((fe=x.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(I.preventDefault(),t.loading)return;k.value?(me=x.value)===null||me===void 0||me.next():J();break;case"Escape":k.value&&(ek(I),he()),(_e=$.value)===null||_e===void 0||_e.focus();break}}function tr(){var I;(I=$.value)===null||I===void 0||I.focus()}function ii(){var I;(I=$.value)===null||I===void 0||I.focusInput()}function $i(){var I;k.value&&((I=E.value)===null||I===void 0||I.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const nr={focus:()=>{var I;(I=$.value)===null||I===void 0||I.focus()},focusInput:()=>{var I;(I=$.value)===null||I===void 0||I.focusInput()},blur:()=>{var I;(I=$.value)===null||I===void 0||I.blur()},blurInput:()=>{var I;(I=$.value)===null||I===void 0||I.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:I}}=s.value;return{"--n-menu-box-shadow":I}}),Hn=o?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:R,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:vo(),triggerRef:$,menuRef:x,pattern:u,uncontrolledShow:S,mergedShow:k,adjustedTo:Pn(t),uncontrolledValue:a,mergedValue:c,followerRef:E,localizedPlaceholder:w,selectedOption:D,selectedOptions:O,mergedSize:ie,mergedDisabled:P,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:o,onTriggerInputFocus:We,onTriggerInputBlur:ce,handleTriggerOrMenuResize:$i,handleMenuFocus:Wt,handleMenuBlur:an,handleMenuTabOut:Ct,handleTriggerClick:mt,handleToggle:Jt,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:Ne,handleTriggerFocus:Pt,handleKeydown:jt,handleMenuAfterLeave:Be,handleMenuClickOutside:Ln,handleMenuScroll:nt,handleMenuKeydown:jt,handleMenuMousedown:ni,mergedTheme:s,cssVars:o?void 0:cn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(hu,null,{default:()=>[i.h(fu,null,{default:()=>i.h(jv,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(Nu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Pn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(_v,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,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"?[[i.vShow,this.mergedShow],[ko,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ko,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),e2={},Mh=i.defineComponent({...e2,__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=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(S=>{if(A.isEmpty(S))return;const k=s.value?r.value:r.value?[r.value]:[],$=S.filter(E=>!k.some(x=>x.id===E.id));l.value=r.optionsListConverter([...k,...$])}).finally(()=>{d.value=!1}))};let f="";const g=A.debounce(()=>h(f),800),m=_=>{f=_,g()},p=_=>{var S;if(A.isArray(_)){const k=_.length>0?_.map($=>{var E;return i.toRaw((E=l.value.find(x=>x.value===$))==null?void 0:E.item)}):[];o("update:value",k)}else if(_>0){const k=i.toRaw((S=l.value.find($=>$.value===_))==null?void 0:S.item);o("update:value",k)}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()}}),(_,S)=>(i.openBlock(),i.createBlock(i.unref(Jv),{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:m,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),t2={},Ah=i.defineComponent({...t2,__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=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?Vt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?Vt.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 g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,f)=>(i.openBlock(),i.createBlock(Mh,{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]=g=>o("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),n2={class:"col-span-2 flex flex-row gap-2.5"},i2={class:"flex-1"},r2={class:"text-sc-grey"},o2={class:"ml-2.5"},s2={key:0,class:"flex-none"},a2={},l2=i.defineComponent({...a2,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(null),s=()=>structuredClone(i.toRaw(n.value)),a=i.ref(s()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(A.isArray(h)?h:[h]).filter(f=>!a.value.some(g=>g.id===f.id))],i.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:i.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=s()}),(h,f)=>{const g=z.NListItem,m=A1,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Ah,{value:o.value,"onUpdate:value":[f[0]||(f[0]=b=>o.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...f[1]||(f[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,b=>(i.openBlock(),i.createBlock(g,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",n2,[i.createElementVNode("span",i2,[i.createElementVNode("span",r2,i.toDisplayString(b.code),1),i.createElementVNode("span",o2,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",s2,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),c2={class:"flex flex-col"},d2={class:"flex flex-col gap-1.5 text-base text-nowrap"},u2={class:"font-medium"},h2={class:"flex flex-col text-sc-dark-grey"},f2={key:0},m2={class:"font-medium"},g2={class:"font-medium"},p2={class:"font-medium"},y2={class:"font-medium"},b2={class:"font-medium"},_2={class:"font-medium"},w2={class:"font-medium"},x2={class:"font-medium"},k2={class:"font-medium"},v2={class:"font-medium"},C2={class:"flex flex-col gap-1.5 text-base text-nowrap"},S2={class:"font-medium"},B2={class:"flex flex-col text-sc-dark-grey"},T2={class:"font-medium"},N2={class:"font-medium"},$2={class:"flex flex-col gap-1.5 text-base text-nowrap"},E2={class:"font-medium"},R2={class:"text-sc-dark-grey"},P2={class:"font-medium"},F2={key:1,class:"text-base text-nowrap"},V2={class:"font-medium"},I2={},Oh=i.defineComponent({...I2,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[Y.ConfiguratorsEnum.Kozyrek,Y.ConfiguratorsEnum.Mosquitto,Y.ConfiguratorsEnum.Strip,Y.ConfiguratorsEnum.MetalForDoors,Y.ConfiguratorsEnum.Sandwich,Y.ConfiguratorsEnum.SandwichM2],n=t,r=i.ref(!1),o=i.computed(()=>{var u,h;return((u=n.item.product.unit)==null?void 0:u.isLinear)&&((h=n.item.product.properties)==null?void 0:h.isLengthConfigurator)}),s=i.computed(()=>Y.UnitsHelper.getProductLengthMultiplicity(n.item.product)),a=i.ref({quantity:n.item.quantity});i.watch(()=>n.item,u=>{a.value={quantity:u.quantity}});const l=u=>{var h;u!==null&&(a.value.quantity=u,(h=n.eventEmitter)==null||h.emit("order-item:edit-quantity",{item:n.item,quantity:u,loaderRef:r}))},c=()=>{var u;(u=n.eventEmitter)==null||u.emit("order-item:open-configurator",{item:n.item})},d=()=>{var u;(u=n.eventEmitter)==null||u.emit("order-item:edit",{item:n.item})};return(u,h)=>{const f=z.NInputNumber;return i.openBlock(),i.createElementBlock("div",c2,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",d2,[i.createElementVNode("span",null,[h[1]||(h[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",u2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",h2,[t.item.configurator===i.unref(Y.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",f2,[h[2]||(h[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",m2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).Mosquitto?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",null,[h[3]||(h[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",g2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[h[4]||(h[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",p2,i.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).Strip?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.item.configuratorParams.linesWidths,(g,m)=>(i.openBlock(),i.createElementBlock("span",{key:m},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(m)+1)+": ",1),i.createElementVNode("span",y2,i.toDisplayString(g)+" мм.",1)]))),128)),i.createElementVNode("span",null,[h[5]||(h[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",b2,i.toDisplayString(t.item.length)+" м.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).MetalForDoors?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("span",null,[h[6]||(h[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",_2,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[h[7]||(h[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",w2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).Sandwich?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:4},i.renderList(t.item.configuratorParams.items??[],(g,m)=>(i.openBlock(),i.createElementBlock("span",{key:m},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(m)+1)+": ",1),i.createElementVNode("span",x2,i.toDisplayString(g.width)+"×"+i.toDisplayString(g.length)+" мм, "+i.toDisplayString(g.count)+" шт.",1)]))),128)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).SandwichM2?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[i.createElementVNode("span",null,[h[8]||(h[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",k2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[h[9]||(h[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",v2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(c,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):o.value&&s.value>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",C2,[i.createElementVNode("span",null,[h[10]||(h[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",S2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",B2,[i.createElementVNode("span",null,[h[11]||(h[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",T2,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[h[12]||(h[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",N2,i.toDisplayString(t.item.quantity*s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(d,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",$2,[i.createElementVNode("span",null,[h[13]||(h[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",E2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",R2,[h[14]||(h[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",P2,i.toDisplayString(t.item.length??t.item.width)+" "+i.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(d,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[t.allowEdit?(i.openBlock(),i.createBlock(f,{key:0,value:a.value.quantity,parse:i.unref(it),"show-button":!1,disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:h[0]||(h[0]=g=>i.unref(Or)(g,".",!1)),onFocus:i.unref(Le),"onUpdate:value":l},{suffix:i.withCtx(()=>[...h[15]||(h[15]=[i.createTextVNode(" шт. ",-1)])]),_:1},8,["value","parse","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",F2,[h[16]||(h[16]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",V2,i.toDisplayString(t.item.quantity)+" шт.",1)]))],64))])}}}),M2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A2(t,e){return i.openBlock(),i.createElementBlock("svg",M2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const O2=i.markRaw({name:"tabler-truck-filled",render:A2}),z2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D2(t,e){return i.openBlock(),i.createElementBlock("svg",z2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const L2=i.markRaw({name:"tabler-truck-delivery",render:D2}),H2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W2(t,e){return i.openBlock(),i.createElementBlock("svg",H2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const j2=i.markRaw({name:"tabler-truck-loading",render:W2}),q2={class:"flex flex-col gap-1"},X2={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},Y2={key:1,class:"text-base"},U2={class:"text-sc-dark-grey mr-1.5"},K2={key:0},G2={key:1},Z2={},Ao=i.defineComponent({...Z2,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var o;return(o=Y.useReferencesStore().deliveryTypeReference)==null?void 0:o.find(s=>s.id===r.delivery.type)}),n=i.computed(()=>un.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(o,s)=>{var d,u,h,f,g,m,p,y;const a=j2,l=L2,c=O2;return i.openBlock(),i.createElementBlock("div",q2,[t.showType?(i.openBlock(),i.createElementBlock("span",X2,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=e.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Y2,[i.createElementVNode("span",U2,i.toDisplayString(n.value),1),(m=(g=t.delivery)==null?void 0:g.address)!=null&&m.address?(i.openBlock(),i.createElementBlock("span",K2,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(p=t.delivery)==null?void 0:p.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",G2," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),Q2={class:"flex flex-col gap-2.5"},J2={class:"text-base"},eC=["href"],tC={class:"text-sc-grey"},nC={},zh=i.defineComponent({...nC,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Pe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Pe.Status)?(c=(l=Y.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>{var u;return d.id===(((u=e.order.status)==null?void 0:u.id)??-1)}))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Pe.CreatedAt)),s=i.computed(()=>e.fields.includes(Pe.ClientInfo)||e.fields.includes(Pe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Pe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Q2,[i.createElementVNode("span",J2,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,eC)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(po,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",tC,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(pr,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ao,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),iC={},Ca=i.defineComponent({...iC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Y.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((s=n.value)==null?void 0:s.name)??"-"),1)}}}),rC={},Pr=i.defineComponent({...rC,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,n={quantity:"количество",length:"длина"},r=i.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=i.computed(()=>{const s={[Y.UserTypeEnum.Manager]:"менеджером",[Y.UserTypeEnum.Operator]:"оператором",[Y.UserTypeEnum.Client]:"клиентом",[Y.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>n[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)=>(i.openBlock(),i.createElementBlock("small",{class:i.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}`)},i.toDisplayString(o.value),3))}}),oC={class:"flex flex-row gap-1.5"},sC={class:"flex-none text-nowrap"},aC={class:"flex flex-1 flex-col gap-2.5"},lC={key:0,class:"text-sm"},cC={class:"text-gray-600"},dC={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},uC={key:0},hC={key:1},fC={},Dh=i.defineComponent({...fC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",oC,[i.createElementVNode("span",sC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",aC,[i.createVNode(lr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.marker?(i.openBlock(),i.createElementBlock("span",lC,[n[0]||(n[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",cC,i.toDisplayString(t.product.marker),1)])):i.createCommentVNode("",!0),t.product.creator&&t.product.creator.type?(i.openBlock(),i.createBlock(Pr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",dC,[n[1]||(n[1]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",uC,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",hC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[2]||(n[2]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[3]||(n[3]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])]))}}),mC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gC(t,e){return i.openBlock(),i.createElementBlock("svg",mC,[...e[0]||(e[0]=[i.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),i.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),i.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 pC=i.markRaw({name:"ion-trash-outline",render:gC}),yC={},bC=i.defineComponent({...yC,__name:"order-item-specification",props:{src:{}},setup(t){const e=i.useTemplateRef("image-reference");return(n,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.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()})}," Спецификация "),i.withDirectives(i.createVNode(i.unref(z.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"]),[[i.vShow,!1]])],64))}}),_C={class:"flex flex-col gap-0.5"},wC={class:"text-gray-600"},xC={},kC=i.defineComponent({...xC,__name:"order-item-name",props:{item:{}},setup(t){const e=t,n=i.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),r=i.computed(()=>{var a;return"creator"in e.item&&!!((a=e.item.creator)!=null&&a.type)}),o=i.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),s=i.computed(()=>"changedFields"in e.item?e.item.changedFields:[]);return(a,l)=>(i.openBlock(),i.createElementBlock("div",_C,[i.createElementVNode("div",{class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(lr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1,"show-planning-dates":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[l[0]||(l[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",wC,i.toDisplayString(t.item.marker),1)],2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(bC,{src:o.value},null,8,["src"])],2)):i.createCommentVNode("",!0),r.value&&!n.value?(i.openBlock(),i.createBlock(Pr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&s.value.length===0?(i.openBlock(),i.createBlock(Pr,{key:3,"user-type":r.value?t.item.creator.type:void 0,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.replacementId&&s.value.length>0?(i.openBlock(),i.createBlock(Pr,{key:4,"user-type":r.value?t.item.creator.type:void 0,"changed-fields":s.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):i.createCommentVNode("",!0)]))}}),vC={},CC=i.defineComponent({...vC,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>A.sortBy(e.products,"ord")),r=c=>!!c.isRemoved||!!c.replacementId,o=(c,d)=>{const u=n.value,h=c.logicGroupId;if(!h)return 1;const f=u.at(d-1);return d&&f&&f.logicGroupId===h?0:u.filter(g=>g.logicGroupId===h).length},s=()=>{const c=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(d,u)=>i.h("span",{class:`text-base${r(d)?" line-through opacity-50":""}`},[u+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:d=>i.h("span",{class:`text-base${r(d)?" line-through opacity-50":""}`},[d.product.code])},{title:"Наименование",key:"name",resizable:!0,width:"45%",render:d=>i.h(kC,{item:d})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:o,render:d=>i.h(Oh,{class:r(d)?"line-through opacity-50":"",item:d,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!r(d)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:d=>i.h("div",{class:r(d)?"line-through opacity-50":""},[i.h(jn,{product:d,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:d=>i.h("div",{class:r(d)?"line-through opacity-50":""},[i.h(jn,{product:d,costFieldName:"cost",showQuantityUnit:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:o,render:d=>r(d)?null:i.h(z.NButton,{quaternary:!0,type:"error",onClick:()=>{var u;(u=e.eventEmitter)==null||u.emit("order-item:delete",{item:d})}},()=>i.h(pC))}]:[]];switch(St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[{title:"",key:"items",resizable:!0,render:(d,u)=>i.h(Dh,{product:d,index:u})}];case Qe.laptop:return c;default:return c}},a=i.ref(s()),l=()=>{a.value=s()};return i.onMounted(()=>{l(),window.addEventListener("resize",l)}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),(c,d)=>{const u=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[d[0]||(d[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(u,{columns:a.value,data:n.value,"row-key":h=>h.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Lh=Wn(CC,[["__scopeId","data-v-045b8f6e"]]),SC={class:"ml-4 text-base"},BC={key:0,class:"text-sc-dark-grey my-2 text-center"},TC={key:1,class:"text-sc-dark-grey my-2"},NC={key:2,class:"grid grid-cols-3 gap-1.5"},$C={class:"text-sc-dark-grey"},EC={class:"col-span-2"},RC={class:"font-medium"},PC={key:0,class:"text-sc-dark-grey"},FC={class:"text-sc-dark-grey text-sm"},VC={},Hh=i.defineComponent({...VC,__name:"order-status-history",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref([]),o=a=>un.format(a,Y.useBaseConfigStateStore().config.dateFormats.uiDateWithTime),s=(a=!0)=>{a&&(n.value=!0),Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(l=>{r.value=l}).finally(()=>{a&&(n.value=!1)})};return i.watch(()=>e.order,()=>{s(!1)}),i.onMounted(()=>{s()}),(a,l)=>{const c=z.NSpin;return i.openBlock(),i.createElementBlock("div",null,[l[1]||(l[1]=i.createElementVNode("h3",null,"История статусов",-1)),i.createElementVNode("div",SC,[n.value?(i.openBlock(),i.createElementBlock("div",BC,[i.createVNode(c,{size:"small",class:"mb-1 align-middle"}),l[0]||(l[0]=i.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(i.openBlock(),i.createElementBlock("div",TC," История статусов отсутствует. ")):(i.openBlock(),i.createElementBlock("div",NC,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(d,u)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:u},[i.createElementVNode("span",$C,i.toDisplayString(o(d.createdAt)),1),i.createElementVNode("div",EC,[i.createElementVNode("span",RC,i.toDisplayString(d.status.name),1),d.statusDetail?(i.openBlock(),i.createElementBlock("span",PC,"  ("+i.toDisplayString(d.statusDetail.name)+") ",1)):i.createCommentVNode("",!0),i.createElementVNode("div",FC,i.toDisplayString(d.user.name),1)])],64))),128))]))])])}}}),IC={class:"text-base"},MC={},Sa=i.defineComponent({...MC,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",IC,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),AC=["href"],OC=["href"],zC={},Wh=i.defineComponent({...zC,__name:"order-external-links",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[t.order.erpOrderUrl?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Открыть в ERP",-1)),i.createElementVNode("a",{href:t.order.erpOrderUrl,target:"_blank",class:"col-span-2"}," Открыть заявку в ERP ",8,AC)],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,o)=>(i.openBlock(),i.createElementBlock("div",{key:o,class:"col-span-2"},[i.createElementVNode("a",{class:"btn btn-primary",href:r}," Скачать счет №"+i.toDisplayString(o+1),9,OC)]))),128))],64)):i.createCommentVNode("",!0)],64))}}),DC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},LC={class:"col-span-2"},HC=["href"],WC={class:"col-span-2"},jC={},jh=i.defineComponent({...jC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("div",null,[o[12]||(o[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",DC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o[1]||(o[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Sa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[11]||(o[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(pr,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=a=>n("click:client-name",t.order.client,a))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o[2]||(o[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Wd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[o[3]||(o[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[o[5]||(o[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",LC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[o[6]||(o[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ca,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),(s=t.order.payment)!=null&&s.onlinePaymentLink?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[o[7]||(o[7]=i.createElementVNode("span",null,"Онлайн-оплата",-1)),i.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank",class:"col-span-2"}," Оплатить заказ ",8,HC)],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[o[8]||(o[8]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Ao,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[o[9]||(o[9]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",WC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[o[10]||(o[10]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Sa,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),i.createVNode(Wh,{order:t.order},null,8,["order"])])])}}}),qC={key:0},XC={class:"text-sc-dark-grey my-2 text-center"},YC={key:1,class:"text-sc-dark-grey my-2 text-center"},UC={key:2},KC={class:"text-sc-dark-grey mt-4 text-right font-bold"},GC={class:"text-sc-primary"},ZC={},qh=i.defineComponent({...ZC,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=(c=!0)=>{if("products"in n.order){s.value=new Y.Order(n.order);return}c&&(o.value=!0),Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrder(n.order.id).then(d=>{s.value=d}).finally(()=>{c&&(o.value=!1)})},l=i.computed(()=>{var c;return(((c=s.value)==null?void 0:c.products)??[]).filter(d=>!d.isRemoved&&!d.replacementId).reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2})});return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=z.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",qC,[i.createElementVNode("div",XC,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",YC," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",UC,[i.createVNode(Lh,{products:s.value.products,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),i.createElementVNode("div",KC,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",GC,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(jh,{order:s.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"]),i.createVNode(Hh,{order:s.value},null,8,["order"])]))}}}),QC={},JC=i.defineComponent({...QC,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(sr,"small"),r=i.computed(()=>A.isNil(e.orderContextButtonsConfig)?[]:A.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=Wo,c=z.NButton,d=z.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:o},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),eS={},tS=i.defineComponent({...eS,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,o=()=>A.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),s=i.ref(o()),a=i.ref([]),l=i.ref(!1),c=i.ref(700),d=w=>{const T={onDblclick:()=>r("dblclick:row",w)};if(!n.useCellIndication)return T;const N=[];return w.isOnOrder&&N.push("on-order"),w.isLargeOrder&&N.push("large-order"),w.isNotInStock&&N.push("not-in-stock"),N.push("order-status",w.status.slug),w.delivery.date&&un.isTomorrow(new Date(w.delivery.date))&&N.push("next-day-order"),N.length>0&&(T.class=N.join(" ")),T},u=()=>{const w=[Pe.CreatedAt,Pe.Id,Pe.ClientInfo,Pe.ClientCity,Pe.DeliveryDate,Pe.PaymentType,Pe.SalesDirections,Pe.Status,...n.showAttachedUserColumn?[Pe.AttachedUser]:[],Pe.actions],T=n.fields.length>0?n.fields:w,N={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},M={type:"expand",expandable:A.constant(!0),renderExpand:O=>i.h(qh,{order:O,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",O.client,null)}}),width:"30"};let V=[{title:"Дата заказа",key:Pe.CreatedAt,resizable:!0,width:100,render:O=>i.h(po,{date:O.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Pe.Id,resizable:!0,width:75,className:"order-id",render:O=>i.h("a",{href:n.orderUrl.replace(":id",O.id.toString()),class:"text-base"},O.id)},{title:"Дата доставки / самовывоза",key:Pe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:O=>i.h(po,{date:O.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Pe.ClientInfo,resizable:!0,minWidth:320,render:O=>i.h(pr,{client:O.client,"onClick:client-name":()=>{r("click:client-name",O.client,null)}})},{title:"Тип доставки",key:Pe.DeliveryInfo,resizable:!0,minWidth:320,render:O=>i.h(Ao,{delivery:O.delivery})},{title:"Клиент",key:Pe.ClientInfoShort,resizable:!0,minWidth:320,render:O=>i.h(pr,{client:O.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",O.client,null)}})},{title:"Город клиента",key:Pe.ClientCity,resizable:!0,minWidth:90,width:120,render:O=>{var D;return i.h("span",{class:"text-base"},((D=O.client)==null?void 0:D.city.name)??"—")}},{title:"Статус",key:Pe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:O=>i.h("span",{class:"text-base"},[O.status.name])},{title:"Тип оплаты",key:Pe.PaymentType,resizable:!0,width:115,minWidth:95,render:O=>O.payment?i.h(Ca,{payment:O.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Pe.SalesDirections,resizable:!0,width:70,render:O=>{var D;return i.h("span",{class:"text-base"},[((D=O.salesDirection)==null?void 0:D.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Pe.AttachedUser,resizable:!0,minWidth:120,render:O=>{var D;return i.h("span",{class:"text-base"},[((D=O==null?void 0:O.attachedUser)==null?void 0:D.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&V.push({key:"actions",title:"",className:"align-top",width:50,render:O=>i.h(JC,{order:O,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(V=V.map(O=>[Pe.Id,Pe.CreatedAt,Pe.DeliveryDate].includes(O.key)?{...O,sorter:!0,sortOrder:!1,...O.width===void 0?{}:{width:O.width+16}}:O)),St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[M,{key:"order",title:"Заказ",resizable:!0,render:O=>i.h(zh,{order:O,fields:T,orderUrl:n.orderUrl})}];case Qe.laptop:{const O=n.showAttachedUserColumn?T:T.filter(D=>D!==Pe.AttachedUser);return[M,...O.map(D=>V.find(ee=>ee.key===D)??N)]}default:return[N]}},h=i.ref(u()),f=i.ref(new Y.DataTablePagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),g=i.computed(()=>({...f.value,prefix({itemCount:w}){return`Всего заказов: ${w}`}})),m=i.ref(null),p=i.ref(null),y=i.ref(null),b=()=>{y.value!==null&&(clearInterval(y.value),y.value=null)},_=()=>{b(),n.refreshInterval&&(y.value=setInterval(()=>{k()},n.refreshInterval))},S=()=>{var w,T;n.filters&&((w=p.value)==null||w.abort(),p.value=null,(T=m.value)==null||T.abort(),m.value=new AbortController,l.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(n.filters,s.value,{page:f.value.page,pageSize:f.value.pageSize},m.value.signal).then(N=>{f.value.itemCount!==N.meta.total&&(f.value.itemCount=N.meta.total),f.value.page!==N.meta.currentPage&&(f.value.page=N.meta.currentPage),f.value.pageCount!==N.meta.lastPage&&(f.value.pageCount=N.meta.lastPage),f.value.pageSize!==N.meta.perPage&&(f.value.pageSize=N.meta.perPage),a.value=N.data,l.value=!1}).catch(N=>{if((N==null?void 0:N.name)!=="CanceledError")throw l.value=!1,N}))},k=()=>{var w;!n.filters||l.value||((w=p.value)==null||w.abort(),p.value=new AbortController,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(n.filters,s.value,{page:f.value.page,pageSize:f.value.pageSize},p.value.signal).then(T=>{a.value=a.value.map(N=>T.data.find(V=>V.id===N.id)??N),f.value.itemCount!==T.meta.total&&(f.value.itemCount=T.meta.total),f.value.pageCount!==T.meta.lastPage&&(f.value.pageCount=T.meta.lastPage)}).catch(T=>{if((T==null?void 0:T.name)!=="CanceledError")throw T}))},$=w=>{f.value.page=w,S(),r("update:pagination",f.value)},E=w=>{f.value.pageSize=w,f.value.page=1,S(),r("update:pagination",f.value)},x=w=>{if(A.isNull(w))s.value=o();else{const[T]=s.value;T.field=w.columnKey.toString(),T.direction=w.order==="ascend"?"asc":"desc",s.value=[T]}h.value.forEach(T=>{if(Object.hasOwn(T,"sortOrder")){const N=T;N.sortOrder=N.key===(w==null?void 0:w.columnKey)&&(w!=null&&w.sorter)&&w.order!==!1?w.order:!1}}),S(),r("update:sort",s.value)},C=()=>{h.value=u(),c.value=window.innerHeight};return i.watch(()=>n.filters,()=>{f.value.page=1,S(),_()}),i.watch(()=>n.sort,()=>{s.value=o(),f.value.page=1,S(),_()}),i.onMounted(()=>{C(),window.addEventListener("resize",C),i.nextTick(()=>{S(),_()})}),i.onUnmounted(()=>{var w,T;window.removeEventListener("resize",C),(w=m.value)==null||w.abort(),(T=p.value)==null||T.abort(),b()}),(w,T)=>{const N=z.NDataTable;return i.openBlock(),i.createBlock(N,{columns:h.value,data:a.value,"row-key":M=>M.id,"row-props":d,"scroll-x":t.tableMinWidth,pagination:g.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":c.value*(i.unref(Y.useBaseConfigStateStore)().config.tableDefaultHeightCoefficient??.6),"pagination-behavior-on-filter":"first","onUpdate:page":$,"onUpdate:pageSize":E,"onUpdate:sorter":x},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),nS=Wn(tS,[["__scopeId","data-v-2a162c0c"]]),iS=["href"],rS={class:"text-sc-dark-grey"},oS={},sS=i.defineComponent({...oS,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>un.format(n.order.createdAt,Y.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{A.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,iS),i.createTextVNode(" от "+i.toDisplayString(o.value),1)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",rS,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),aS={class:"sc-page flex flex-col bg-inherit"},lS={class:"my-2 flex flex-row items-end"},cS={class:"sc-title grow"},dS={key:0,class:"sc-title-buttons flex-1 grow-0"},uS={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},hS={key:0,class:"sc-title-extra mt-2 sm:mt-4"},fS={},Xh=i.defineComponent({...fS,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",aS,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",lS,[i.createElementVNode("div",cS,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",dS,[i.createElementVNode("div",uS,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",hS,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),mS={class:"overflow-hidden transition-all duration-300"},gS={class:"text-lg font-medium leading-none"},pS={},Yh=i.defineComponent({...pS,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(0),s=i.ref(n.showDrawer),a=()=>{switch(St.getDeviceTypeByResolution()){case Qe.phone:return window.innerWidth*.8;case Qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?A.isUndefined(n.drawerWidth)?o.value=a():o.value=A.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:o.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),i.watch(()=>n.showDrawer,c=>{s.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=z.NDrawerContent,h=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",mS,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=f=>s.value=f),resizable:!0,width:o.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",gS,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),yS={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},bS={key:0},_S={class:"sc-page-preview-panel grow"},wS={key:1,class:"sc-page-preview-panel-extra flex-none"},xS={},kS=i.defineComponent({...xS,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},o=()=>{n.value=!1},s=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.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=z.NButton;return i.openBlock(),i.createBlock(Xh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(Yh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",yS,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",bS,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",_S,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",wS,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),vS={},CS=i.defineComponent({...vS,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var m;return A.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>{const m=new Y.Curator({id:-1,name:"",contacts:{},curatedDirection:new Y.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{p.push(new Y.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),p}),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const p=A.some(s.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${p}`})),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(A.isArray(m)){const p=m.length>0?m.map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=m>0?l.value.find(y=>y.id===m):null;o("update:value",p??null)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),SS={},BS=i.defineComponent({...SS,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var m;return A.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let m=l.value,p=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=A.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];p=A.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?Y.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return Vt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(s.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>p.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(A.isArray(m)){const p=m.length>0?m.filter(y=>!A.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=m>0&&!A.some(r.disabledManagerReferenceList,["id",m])?l.value.find(y=>y.id===m):new Y.Manager;o("update:value",p??new Y.Manager)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(s.value){const p=r.value;A.some(p,y=>A.some(m,["id",y.id]))&&o("update:value",p.filter(y=>!A.some(m,["id",y.id])))}else{const p=r.value;A.some(m,["id",p.id])&&o("update:value",new Y.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),TS={class:"m-0.5 flex flex-col p-0.5"},NS={class:"flex flex-row gap-1"},$S={key:0},ES={key:1},RS={key:2},PS={key:3},FS={class:"flex flex-row gap-1"},VS={key:0},IS={key:1},MS={key:2},AS={key:3},OS={},Uh=i.defineComponent({...OS,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",TS,[i.createElementVNode("span",NS,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",$S,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",ES,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",RS,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",PS,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",FS,[t.addr.street?(i.openBlock(),i.createElementBlock("span",VS,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",IS,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",MS,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",AS,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ba={clearable:!1,value:"",field:void 0,disabled:!1},zS={},DS=i.defineComponent({...zS,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.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):Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Uh,{addr:b,selected:y},{default:A.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),LS={class:"m-0.5 flex flex-col p-0.5"},HS={class:"font-medium"},WS={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},jS={key:0},qS={key:1},XS={},Kh=i.defineComponent({...XS,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",LS,[i.createElementVNode("span",HS,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",WS,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",jS," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",qS," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),YS={},US=i.defineComponent({...YS,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Kh,{bank:b,selected:y},{default:A.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),KS={class:"font-medium"},GS={key:0,class:"flex flex-row gap-2"},ZS={key:0,class:"text-xs font-light text-blue-800"},QS={key:1,class:"text-sc-dark-grey text-xs font-light"},JS={},Gh=i.defineComponent({...JS,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",KS,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",GS,[t.org.inn?(i.openBlock(),i.createElementBlock("span",ZS,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",QS,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),eB={},tB=i.defineComponent({...eB,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{s.value=y}),i.watch(s,()=>{o("update:value",s.value)});const u=A.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},f=(y,b)=>{const _=l.value.find(S=>S.id===y.value)||{};return i.h(Gh,{org:_,selected:b},{default:A.constant("-")})},g=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&o("select",b)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[b[0]||(b[0]=S=>s.value=S),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),nB={},iB=i.defineComponent({...nB,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{n.disableConfirm?s():o.value=!0};return(l,c)=>{const d=z.NButton,u=z.NPopover,h=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show: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:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=f=>o.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),rB={key:0,class:"whitespace-pre-line"},oB={key:1,class:"text-sc-dark-grey"},sB={},aB=i.defineComponent({...sB,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.comment);i.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=n.comment};return(l,c)=>{const d=z.NInput;return i.openBlock(),i.createBlock(Ud,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",rB,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",oB," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.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"])}}}),lB={},cB=i.defineComponent({...lB,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),dB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uB(t,e){return i.openBlock(),i.createElementBlock("svg",dB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const hB=i.markRaw({name:"ion-warning",render:uB}),fB={},mB=i.defineComponent({...fB,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=hB,o=z.NPopover;return i.openBlock(),i.createBlock(o,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),vt=class vt{static init(e,n){vt.messagesService&&vt.notificationsService||(vt.messagesService=e,vt.notificationsService=n)}static getMessagesService(){if(!vt.messagesService)throw new Error("UI provider is not initialized.");return vt.messagesService}static getNotificationsService(){if(!vt.notificationsService)throw new Error("UI provider is not initialized.");return vt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(A.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";vt.notificationsService?vt.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(n,s)?n[s]=new Y.FieldValidationResultData(e.errors[s].toString(),"error"):vt.messagesService?vt.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};B(vt,"messagesService"),B(vt,"notificationsService");let Ta=vt;const gB=i.computed(()=>Y.useReferencesStore().deliveryTypeReference??[]),pB=i.computed(()=>Y.useReferencesStore().managersList??[]),yB=i.computed(()=>Y.useReferencesStore().opfReference??[]),bB=i.computed(()=>Y.useReferencesStore().partnerGroupsReference??[]),_B=i.computed(()=>Y.useReferencesStore().priceCoefficientsReference??[]),wB=i.computed(()=>Y.useReferencesStore().productFilesTypesReference??[]),xB=i.computed(()=>Y.useReferencesStore().resourceTypesReference),kB=i.computed(()=>Y.useReferencesStore().salesDirectionsReference??[]),vB=i.computed(()=>Y.useReferencesStore().warehousesReference??[]),CB=i.computed(()=>Y.useReferencesStore().paymentTypeReference??[]),SB=i.computed(()=>Y.useReferencesStore().orderStatusReference??[]),BB=i.computed(()=>Y.useReferencesStore().operatorReference??[]),TB=i.computed(()=>Vt.convertReferencesToSelectOptionsList(Y.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),NB=i.computed(()=>Vt.convertReferencesToSelectOptionsList(Y.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),$B=t=>Y.HttpRequester.getInstance(Y.ReferenceDataProvider).searchCity(t),EB=t=>Vt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.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()),RB=t=>Y.HttpRequester.getInstance(Y.ClientDataProvider).searchClient(t),PB=t=>Vt.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());W.CommonValidators=nf,W.ConfiguratorSettingsKozyrek=wd,W.ConfiguratorSettingsMosquito=W_,W.ContentHelper=ai,W.DateValidators=rf,W.KozyrekLine=_n,W.KozyrekTailTemplate=Ds,W.KozyrekTemplate=Ui,W.NumericValidators=ae,W.OrdersTableFields=Pe,W.Point=zs,W.ScAddProductToCartDialog=Mb,W.ScAddressSuggestion=DS,W.ScAddressSuggestionLabel=Uh,W.ScBankSuggestion=US,W.ScBankSuggestionLabel=Kh,W.ScBaseDialog=Hd,W.ScButtonWithConfirmAction=iB,W.ScCategoryCollapse=Dd,W.ScClientNameWithShortInfo=pr,W.ScCollapse=zd,W.ScCollapseItem=Qa,W.ScCommentEditor=aB,W.ScConfiguratorsProductInfo=cr,W.ScContragentWithShortInfo=Wd,W.ScCreatorUserTypeTag=Pr,W.ScCuratorSelect=CS,W.ScDateRange=K_,W.ScDateTimeLabel=po,W.ScDebouncedInput=k1,W.ScDebouncedInputNumber=C1,W.ScDebt=cB,W.ScDialogHeader=i1,W.ScDynamicConfigurator=Md,W.ScEmail=Qb,W.ScExternalLink=V1,W.ScImageGallery=il,W.ScInlineEditableItem=Ud,W.ScInlineView=Hs,W.ScKozyrekConfigurator=xd,W.ScKozyrekConfiguratorParamsForm=ol,W.ScKozyrekConfiguratorPreview=_d,W.ScKozyrekConfiguratorTemplates=bd,W.ScLightGallery=nl,W.ScManagerSelect=BS,W.ScMetalForDoorsConfigurator=Ed,W.ScMetalForDoorsConfiguratorForm=$d,W.ScMosquitoConfigurator=Cd,W.ScMosquitoConfiguratorForm=kd,W.ScMosquitoConfiguratorMeasurementInstructions=vd,W.ScMosquitoConfiguratorPreview=Ls,W.ScOrderCommonInfo=zh,W.ScOrderDeliveryLabel=Ao,W.ScOrderDetails=jh,W.ScOrderExternalLinks=Wh,W.ScOrderInfo=qh,W.ScOrderItemParams=Oh,W.ScOrderItemsList=Lh,W.ScOrderPayment=Ca,W.ScOrderProductInfo=Dh,W.ScOrderStatusHistory=Hh,W.ScOrdersList=nS,W.ScOrgSuggestion=tB,W.ScOrgSuggestionLabel=Gh,W.ScPage=Xh,W.ScPageWithSlidingPanel=kS,W.ScPersonContactsBlock=H_,W.ScPhone=k_,W.ScPhoneInput=T1,W.ScProductName=lr,W.ScProductsList=l2,W.ScReferenceSelect=Ld,W.ScSandwichConfigurator=Fd,W.ScSandwichConfiguratorForm=Pd,W.ScSandwichM2Configurator=Id,W.ScSandwichM2ConfiguratorForm=Vd,W.ScSearchableProductSelect=Ah,W.ScSearchableReferenceSelect=Mh,W.ScSetClientPriceFormItem=$b,W.ScShortTextOrderInfo=sS,W.ScSingleFileUploadSelector=l1,W.ScSlidingContentWithDrawer=Yh,W.ScStripConfigurator=Nd,W.ScStripConfiguratorForm=Bd,W.ScStripConfiguratorLineItem=Sd,W.ScStripConfiguratorPreview=Td,W.ScUserShortInfo=Sa,W.ScWarningIcon=mB,W.SelectOptionHelper=Vt,W.UiNotificationProvider=Ta,W.Validators=He,W.WindowResolutionEnum=Qe,W.WindowResolutionProvider=St,W.channelPrimaryInterestOptionsList=TB,W.componentSizeInjectionKey=sr,W.deliveryTypeReferenceList=gB,W.handleFloatInput=Or,W.handleIntegerInput=tt,W.isCanSandwichM2Show=j_,W.isCanSandwichShow=Od,W.isConfiguratorType=Ad,W.managersReferenceList=pB,W.naiveUiTheme=jf,W.operatorReferenceList=BB,W.opfReferenceList=yB,W.orderStatusReferenceList=SB,W.parse=it,W.partnerGroupReferenceList=bB,W.paymentTypeReferenceList=CB,W.priceCoefficientsReferenceList=_B,W.productFilesTypesReferenceList=wB,W.renderConfig=je,W.resetInputValidation=et,W.resourceReferencesList=xB,W.salesDirectionsReferenceList=kB,W.searchCityReferenceDataHandler=$B,W.searchCityReferenceLabelRenderer=EB,W.searchClientReferenceDataHandler=RB,W.searchClientReferenceLabelRenderer=PB,W.selectAllTextOnFocus=Le,W.sourcePrimaryInterestOptionsList=NB,W.vFocusNext=Ua,W.warehousesReferenceList=vB,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
822
+ `,[Rh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Mo(t){return t.type==="group"}function Ih(t){return t.type==="ignored"}function va(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function Uv(t,e){return{getIsGroup:Mo,getIgnored:Ih,getKey(r){return Mo(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function Kv(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(Mo(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ih(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function Gv(t,e,n){const r=new Map;return t.forEach(o=>{Mo(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var Zv={};const Qv=Object.assign(Object.assign({},wt.props),{to:Pn.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}),Jv=i.defineComponent({name:"Select",props:Qv,slots:Object,setup(t){Zv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=vi(t),s=wt("Select","-select",Yv,Xv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Zs(l,a),d=i.ref(!1),u=i.ref(""),h=lu(t,["items","options"]),f=i.ref([]),g=i.ref([]),m=i.computed(()=>g.value.concat(f.value).concat(h.value)),p=i.computed(()=>{const{filter:I}=t;if(I)return I;const{labelField:G,valueField:se}=t;return(fe,me)=>{if(!me)return!1;const _e=me[G];if(typeof _e=="string")return va(fe,_e);const ke=me[se];return typeof ke=="string"?va(fe,ke):typeof ke=="number"?va(fe,String(ke)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:I}=m,{value:G}=u;return!G.length||!t.filterable?I:Kv(I,p.value,G,t.childrenField)}}),b=i.computed(()=>{const{valueField:I,childrenField:G}=t,se=Uv(I,G);return Sw(y.value,se)}),_=i.computed(()=>Gv(m.value,t.valueField,t.childrenField)),S=i.ref(!1),k=Zs(i.toRef(t,"show"),S),$=i.ref(null),E=i.ref(null),x=i.ref(null),{localeRef:C}=ph("Select"),w=i.computed(()=>{var I;return(I=t.placeholder)!==null&&I!==void 0?I:C.value.placeholder}),T=[],N=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:I}=t;if(I===void 0){const{labelField:G,valueField:se}=t;return fe=>({[G]:String(fe),[se]:fe})}return I===!1?!1:G=>Object.assign(I(G),{value:G})});function V(I){const G=t.remote,{value:se}=N,{value:fe}=_,{value:me}=M,_e=[];return I.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(G&&se.has(ke))_e.push(se.get(ke));else if(me){const Ce=me(ke);Ce&&_e.push(Ce)}}),_e}const O=i.computed(()=>{if(t.multiple){const{value:I}=c;return Array.isArray(I)?V(I):[]}return null}),D=i.computed(()=>{const{value:I}=c;return!t.multiple&&!Array.isArray(I)?I===null?null:V([I])[0]||null:null}),ee=rk(t),{mergedSizeRef:ie,mergedDisabledRef:P,mergedStatusRef:R}=ee;function H(I,G){const{onChange:se,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=ee;se&&_t(se,I,G),me&&_t(me,I,G),fe&&_t(fe,I,G),a.value=I,_e(),ke()}function U(I){const{onBlur:G}=t,{nTriggerFormBlur:se}=ee;G&&_t(G,I),se()}function L(){const{onClear:I}=t;I&&_t(I)}function X(I){const{onFocus:G,showOnFocus:se}=t,{nTriggerFormFocus:fe}=ee;G&&_t(G,I),fe(),se&&J()}function j(I){const{onSearch:G}=t;G&&_t(G,I)}function F(I){const{onScroll:G}=t;G&&_t(G,I)}function q(){var I;const{remote:G,multiple:se}=t;if(G){const{value:fe}=N;if(se){const{valueField:me}=t;(I=O.value)===null||I===void 0||I.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=D.value;me&&fe.set(me[t.valueField],me)}}}function K(I){const{onUpdateShow:G,"onUpdate:show":se}=t;G&&_t(G,I),se&&_t(se,I),S.value=I}function J(){P.value||(K(!0),S.value=!0,t.filterable&&ii())}function he(){K(!1)}function Be(){u.value="",g.value=T}const Te=i.ref(!1);function We(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,k.value||Be())}function mt(){P.value||(k.value?t.filterable?ii():he():J())}function Ne(I){var G,se;!((se=(G=x.value)===null||G===void 0?void 0:G.selfRef)===null||se===void 0)&&se.contains(I.relatedTarget)||(d.value=!1,U(I),he())}function Pt(I){X(I),d.value=!0}function Wt(){d.value=!0}function an(I){var G;!((G=$.value)===null||G===void 0)&&G.$el.contains(I.relatedTarget)||(d.value=!1,U(I),he())}function Ct(){var I;(I=$.value)===null||I===void 0||I.focus(),he()}function Ln(I){var G;k.value&&(!((G=$.value)===null||G===void 0)&&G.$el.contains(br(I))||he())}function ln(I){if(!Array.isArray(I))return[];if(M.value)return Array.from(I);{const{remote:G}=t,{value:se}=_;if(G){const{value:fe}=N;return I.filter(me=>se.has(me)||fe.has(me))}else return I.filter(fe=>se.has(fe))}}function Jt(I){Ve(I.rawNode)}function Ve(I){if(P.value)return;const{tag:G,remote:se,clearFilterAfterSelect:fe,valueField:me}=t;if(G&&!se){const{value:_e}=g,ke=_e[0]||null;if(ke){const Ce=f.value;Ce.length?Ce.push(ke):f.value=[ke],g.value=T}}if(se&&N.value.set(I[me],I),t.multiple){const _e=ln(c.value),ke=_e.findIndex(Ce=>Ce===I[me]);if(~ke){if(_e.splice(ke,1),G&&!se){const Ce=Q(I[me]);~Ce&&(f.value.splice(Ce,1),fe&&(u.value=""))}}else _e.push(I[me]),fe&&(u.value="");H(_e,V(_e))}else{if(G&&!se){const _e=Q(I[me]);~_e?f.value=[f.value[_e]]:f.value=T}tr(),he(),H(I[me],I)}}function Q(I){return f.value.findIndex(se=>se[t.valueField]===I)}function le(I){k.value||J();const{value:G}=I.target;u.value=G;const{tag:se,remote:fe}=t;if(j(G),se&&!fe){if(!G){g.value=T;return}const{onCreate:me}=t,_e=me?me(G):{[t.labelField]:G,[t.valueField]:G},{valueField:ke,labelField:Ce}=t;h.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Ce]===_e[Ce])||f.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Ce]===_e[Ce])?g.value=T:g.value=[_e]}}function De(I){I.stopPropagation();const{multiple:G}=t;!G&&t.filterable&&he(),L(),G?H([],[]):H(null,null)}function ni(I){!yr(I,"action")&&!yr(I,"empty")&&!yr(I,"header")&&I.preventDefault()}function nt(I){F(I)}function jt(I){var G,se,fe,me,_e;if(!t.keyboard){I.preventDefault();return}switch(I.key){case" ":if(t.filterable)break;I.preventDefault();case"Enter":if(!(!((G=$.value)===null||G===void 0)&&G.isComposing)){if(k.value){const ke=(se=x.value)===null||se===void 0?void 0:se.getPendingTmNode();ke?Jt(ke):t.filterable||(he(),tr())}else if(J(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Ce=ke[t.valueField],{value:Ze}=c;t.multiple&&Array.isArray(Ze)&&Ze.includes(Ce)||Ve(ke)}}}I.preventDefault();break;case"ArrowUp":if(I.preventDefault(),t.loading)return;k.value&&((fe=x.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(I.preventDefault(),t.loading)return;k.value?(me=x.value)===null||me===void 0||me.next():J();break;case"Escape":k.value&&(ek(I),he()),(_e=$.value)===null||_e===void 0||_e.focus();break}}function tr(){var I;(I=$.value)===null||I===void 0||I.focus()}function ii(){var I;(I=$.value)===null||I===void 0||I.focusInput()}function $i(){var I;k.value&&((I=E.value)===null||I===void 0||I.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const nr={focus:()=>{var I;(I=$.value)===null||I===void 0||I.focus()},focusInput:()=>{var I;(I=$.value)===null||I===void 0||I.focusInput()},blur:()=>{var I;(I=$.value)===null||I===void 0||I.blur()},blurInput:()=>{var I;(I=$.value)===null||I===void 0||I.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:I}}=s.value;return{"--n-menu-box-shadow":I}}),Hn=o?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:R,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:vo(),triggerRef:$,menuRef:x,pattern:u,uncontrolledShow:S,mergedShow:k,adjustedTo:Pn(t),uncontrolledValue:a,mergedValue:c,followerRef:E,localizedPlaceholder:w,selectedOption:D,selectedOptions:O,mergedSize:ie,mergedDisabled:P,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:o,onTriggerInputFocus:We,onTriggerInputBlur:ce,handleTriggerOrMenuResize:$i,handleMenuFocus:Wt,handleMenuBlur:an,handleMenuTabOut:Ct,handleTriggerClick:mt,handleToggle:Jt,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:Ne,handleTriggerFocus:Pt,handleKeydown:jt,handleMenuAfterLeave:Be,handleMenuClickOutside:Ln,handleMenuScroll:nt,handleMenuKeydown:jt,handleMenuMousedown:ni,mergedTheme:s,cssVars:o?void 0:cn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(hu,null,{default:()=>[i.h(fu,null,{default:()=>i.h(jv,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(Nu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Pn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(_v,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,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"?[[i.vShow,this.mergedShow],[ko,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ko,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),e2={},Mh=i.defineComponent({...e2,__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=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(S=>{if(A.isEmpty(S))return;const k=s.value?r.value:r.value?[r.value]:[],$=S.filter(E=>!k.some(x=>x.id===E.id));l.value=r.optionsListConverter([...k,...$])}).finally(()=>{d.value=!1}))};let f="";const g=A.debounce(()=>h(f),800),m=_=>{f=_,g()},p=_=>{var S;if(A.isArray(_)){const k=_.length>0?_.map($=>{var E;return i.toRaw((E=l.value.find(x=>x.value===$))==null?void 0:E.item)}):[];o("update:value",k)}else if(_>0){const k=i.toRaw((S=l.value.find($=>$.value===_))==null?void 0:S.item);o("update:value",k)}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()}}),(_,S)=>(i.openBlock(),i.createBlock(i.unref(Jv),{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:m,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),t2={},Ah=i.defineComponent({...t2,__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=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?Vt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?Vt.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 g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,f)=>(i.openBlock(),i.createBlock(Mh,{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]=g=>o("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),n2={class:"col-span-2 flex flex-row gap-2.5"},i2={class:"flex-1"},r2={class:"text-sc-grey"},o2={class:"ml-2.5"},s2={key:0,class:"flex-none"},a2={},l2=i.defineComponent({...a2,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(null),s=()=>structuredClone(i.toRaw(n.value)),a=i.ref(s()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(A.isArray(h)?h:[h]).filter(f=>!a.value.some(g=>g.id===f.id))],i.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:i.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=s()}),(h,f)=>{const g=z.NListItem,m=A1,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Ah,{value:o.value,"onUpdate:value":[f[0]||(f[0]=b=>o.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...f[1]||(f[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,b=>(i.openBlock(),i.createBlock(g,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",n2,[i.createElementVNode("span",i2,[i.createElementVNode("span",r2,i.toDisplayString(b.code),1),i.createElementVNode("span",o2,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",s2,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),c2={class:"flex flex-col"},d2={class:"flex flex-col gap-1.5 text-base text-nowrap"},u2={class:"font-medium"},h2={class:"flex flex-col text-sc-dark-grey"},f2={key:0},m2={class:"font-medium"},g2={class:"font-medium"},p2={class:"font-medium"},y2={class:"font-medium"},b2={class:"font-medium"},_2={class:"font-medium"},w2={class:"font-medium"},x2={class:"font-medium"},k2={class:"font-medium"},v2={class:"font-medium"},C2={class:"flex flex-col gap-1.5 text-base text-nowrap"},S2={class:"font-medium"},B2={class:"flex flex-col text-sc-dark-grey"},T2={class:"font-medium"},N2={class:"font-medium"},$2={class:"flex flex-col gap-1.5 text-base text-nowrap"},E2={class:"font-medium"},R2={class:"text-sc-dark-grey"},P2={class:"font-medium"},F2={key:1,class:"text-base text-nowrap"},V2={class:"font-medium"},I2={},Oh=i.defineComponent({...I2,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[Y.ConfiguratorsEnum.Kozyrek,Y.ConfiguratorsEnum.Mosquitto,Y.ConfiguratorsEnum.Strip,Y.ConfiguratorsEnum.MetalForDoors,Y.ConfiguratorsEnum.Sandwich,Y.ConfiguratorsEnum.SandwichM2],n=t,r=i.ref(!1),o=i.computed(()=>{var u,h;return((u=n.item.product.unit)==null?void 0:u.isLinear)&&((h=n.item.product.properties)==null?void 0:h.isLengthConfigurator)}),s=i.computed(()=>Y.UnitsHelper.getProductLengthMultiplicity(n.item.product)),a=i.ref({quantity:n.item.quantity});i.watch(()=>n.item,u=>{a.value={quantity:u.quantity}});const l=u=>{var h;u!==null&&(a.value.quantity=u,(h=n.eventEmitter)==null||h.emit("order-item:edit-quantity",{item:n.item,quantity:u,loaderRef:r}))},c=()=>{var u;(u=n.eventEmitter)==null||u.emit("order-item:open-configurator",{item:n.item})},d=()=>{var u;(u=n.eventEmitter)==null||u.emit("order-item:edit",{item:n.item})};return(u,h)=>{const f=z.NInputNumber;return i.openBlock(),i.createElementBlock("div",c2,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",d2,[i.createElementVNode("span",null,[h[1]||(h[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",u2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",h2,[t.item.configurator===i.unref(Y.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",f2,[h[2]||(h[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",m2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).Mosquitto?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",null,[h[3]||(h[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",g2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[h[4]||(h[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",p2,i.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).Strip?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.item.configuratorParams.linesWidths,(g,m)=>(i.openBlock(),i.createElementBlock("span",{key:m},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(m)+1)+": ",1),i.createElementVNode("span",y2,i.toDisplayString(g)+" мм.",1)]))),128)),i.createElementVNode("span",null,[h[5]||(h[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",b2,i.toDisplayString(t.item.length)+" м.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).MetalForDoors?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("span",null,[h[6]||(h[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",_2,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[h[7]||(h[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",w2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).Sandwich?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:4},i.renderList(t.item.configuratorParams.items??[],(g,m)=>(i.openBlock(),i.createElementBlock("span",{key:m},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(m)+1)+": ",1),i.createElementVNode("span",x2,i.toDisplayString(g.width)+"×"+i.toDisplayString(g.length)+" мм, "+i.toDisplayString(g.count)+" шт.",1)]))),128)):i.createCommentVNode("",!0),t.item.configurator===i.unref(Y.ConfiguratorsEnum).SandwichM2?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[i.createElementVNode("span",null,[h[8]||(h[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",k2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[h[9]||(h[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",v2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(c,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):o.value&&s.value>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",C2,[i.createElementVNode("span",null,[h[10]||(h[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",S2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",B2,[i.createElementVNode("span",null,[h[11]||(h[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",T2,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[h[12]||(h[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",N2,i.toDisplayString(t.item.quantity*s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(d,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",$2,[i.createElementVNode("span",null,[h[13]||(h[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",E2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",R2,[h[14]||(h[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",P2,i.toDisplayString(t.item.length??t.item.width)+" "+i.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(d,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[t.allowEdit?(i.openBlock(),i.createBlock(f,{key:0,value:a.value.quantity,parse:i.unref(it),"show-button":!1,disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:h[0]||(h[0]=g=>i.unref(Or)(g,".",!1)),onFocus:i.unref(Le),"onUpdate:value":l},{suffix:i.withCtx(()=>[...h[15]||(h[15]=[i.createTextVNode(" шт. ",-1)])]),_:1},8,["value","parse","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",F2,[h[16]||(h[16]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",V2,i.toDisplayString(t.item.quantity)+" шт.",1)]))],64))])}}}),M2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A2(t,e){return i.openBlock(),i.createElementBlock("svg",M2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const O2=i.markRaw({name:"tabler-truck-filled",render:A2}),z2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D2(t,e){return i.openBlock(),i.createElementBlock("svg",z2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const L2=i.markRaw({name:"tabler-truck-delivery",render:D2}),H2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W2(t,e){return i.openBlock(),i.createElementBlock("svg",H2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const j2=i.markRaw({name:"tabler-truck-loading",render:W2}),q2={class:"flex flex-col gap-1"},X2={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},Y2={key:1,class:"text-base"},U2={class:"text-sc-dark-grey mr-1.5"},K2={key:0},G2={key:1},Z2={},Ao=i.defineComponent({...Z2,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var o;return(o=Y.useReferencesStore().deliveryTypeReference)==null?void 0:o.find(s=>s.id===r.delivery.type)}),n=i.computed(()=>un.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(o,s)=>{var d,u,h,f,g,m,p,y;const a=j2,l=L2,c=O2;return i.openBlock(),i.createElementBlock("div",q2,[t.showType?(i.openBlock(),i.createElementBlock("span",X2,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=e.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Y2,[i.createElementVNode("span",U2,i.toDisplayString(n.value),1),(m=(g=t.delivery)==null?void 0:g.address)!=null&&m.address?(i.openBlock(),i.createElementBlock("span",K2,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(p=t.delivery)==null?void 0:p.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",G2," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),Q2={class:"flex flex-col gap-2.5"},J2={class:"text-base"},eC=["href"],tC={class:"text-sc-grey"},nC={},zh=i.defineComponent({...nC,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Pe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Pe.Status)?(c=(l=Y.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>{var u;return d.id===(((u=e.order.status)==null?void 0:u.id)??-1)}))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Pe.CreatedAt)),s=i.computed(()=>e.fields.includes(Pe.ClientInfo)||e.fields.includes(Pe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Pe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Q2,[i.createElementVNode("span",J2,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,eC)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(po,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",tC,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(pr,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ao,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),iC={},Ca=i.defineComponent({...iC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Y.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((s=n.value)==null?void 0:s.name)??"-"),1)}}}),rC={},Pr=i.defineComponent({...rC,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,n={quantity:"количество",length:"длина"},r=i.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=i.computed(()=>{const s={[Y.UserTypeEnum.Manager]:"менеджером",[Y.UserTypeEnum.Operator]:"оператором",[Y.UserTypeEnum.Client]:"клиентом",[Y.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>n[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)=>(i.openBlock(),i.createElementBlock("small",{class:i.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}`)},i.toDisplayString(o.value),3))}}),oC={class:"flex flex-row gap-1.5"},sC={class:"flex-none text-nowrap"},aC={class:"flex flex-1 flex-col gap-2.5"},lC={key:0,class:"text-sm"},cC={class:"text-gray-600"},dC={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},uC={key:0},hC={key:1},fC={},Dh=i.defineComponent({...fC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",oC,[i.createElementVNode("span",sC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",aC,[i.createVNode(lr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.marker?(i.openBlock(),i.createElementBlock("span",lC,[n[0]||(n[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",cC,i.toDisplayString(t.product.marker),1)])):i.createCommentVNode("",!0),t.product.creator&&t.product.creator.type?(i.openBlock(),i.createBlock(Pr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",dC,[n[1]||(n[1]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",uC,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",hC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[2]||(n[2]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[3]||(n[3]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])]))}}),mC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gC(t,e){return i.openBlock(),i.createElementBlock("svg",mC,[...e[0]||(e[0]=[i.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),i.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),i.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 pC=i.markRaw({name:"ion-trash-outline",render:gC}),yC={},bC=i.defineComponent({...yC,__name:"order-item-specification",props:{src:{}},setup(t){const e=i.useTemplateRef("image-reference");return(n,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.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()})}," Спецификация "),i.withDirectives(i.createVNode(i.unref(z.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"]),[[i.vShow,!1]])],64))}}),_C={class:"flex flex-col gap-0.5"},wC={class:"text-gray-600"},xC={},kC=i.defineComponent({...xC,__name:"order-item-name",props:{item:{}},setup(t){const e=t,n=i.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),r=i.computed(()=>{var a;return"creator"in e.item&&!!((a=e.item.creator)!=null&&a.type)}),o=i.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),s=i.computed(()=>"changedFields"in e.item?e.item.changedFields:[]);return(a,l)=>(i.openBlock(),i.createElementBlock("div",_C,[i.createElementVNode("div",{class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(lr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1,"show-planning-dates":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[l[0]||(l[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",wC,i.toDisplayString(t.item.marker),1)],2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(bC,{src:o.value},null,8,["src"])],2)):i.createCommentVNode("",!0),r.value&&!n.value?(i.openBlock(),i.createBlock(Pr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&s.value.length===0?(i.openBlock(),i.createBlock(Pr,{key:3,"user-type":r.value?t.item.creator.type:void 0,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.replacementId&&s.value.length>0?(i.openBlock(),i.createBlock(Pr,{key:4,"user-type":r.value?t.item.creator.type:void 0,"changed-fields":s.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):i.createCommentVNode("",!0)]))}}),vC={},CC=i.defineComponent({...vC,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>A.sortBy(e.products,"ord")),r=c=>!!c.isRemoved||!!c.replacementId,o=(c,d)=>{const u=n.value,h=c.logicGroupId;if(!h)return 1;const f=u.at(d-1);if(d&&f&&f.logicGroupId===h)return 0;const g=u.slice(d),m=g.findIndex(p=>p.logicGroupId!==h);return m===-1?g.length:m},s=()=>{const c=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(d,u)=>i.h("span",{class:`text-base${r(d)?" line-through opacity-50":""}`},[u+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:d=>i.h("span",{class:`text-base${r(d)?" line-through opacity-50":""}`},[d.product.code])},{title:"Наименование",key:"name",resizable:!0,width:"45%",render:d=>i.h(kC,{item:d})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:o,render:d=>i.h(Oh,{class:r(d)?"line-through opacity-50":"",item:d,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!r(d)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:d=>i.h("div",{class:r(d)?"line-through opacity-50":""},[i.h(jn,{product:d,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:d=>i.h("div",{class:r(d)?"line-through opacity-50":""},[i.h(jn,{product:d,costFieldName:"cost",showQuantityUnit:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:o,render:d=>r(d)?null:i.h(z.NButton,{quaternary:!0,type:"error",onClick:()=>{var u;(u=e.eventEmitter)==null||u.emit("order-item:delete",{item:d})}},()=>i.h(pC))}]:[]];switch(St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[{title:"",key:"items",resizable:!0,render:(d,u)=>i.h(Dh,{product:d,index:u})}];case Qe.laptop:return c;default:return c}},a=i.ref(s()),l=()=>{a.value=s()};return i.onMounted(()=>{l(),window.addEventListener("resize",l)}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),(c,d)=>{const u=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[d[0]||(d[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(u,{columns:a.value,data:n.value,"row-key":h=>h.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Lh=Wn(CC,[["__scopeId","data-v-9340e631"]]),SC={class:"ml-4 text-base"},BC={key:0,class:"text-sc-dark-grey my-2 text-center"},TC={key:1,class:"text-sc-dark-grey my-2"},NC={key:2,class:"grid grid-cols-3 gap-1.5"},$C={class:"text-sc-dark-grey"},EC={class:"col-span-2"},RC={class:"font-medium"},PC={key:0,class:"text-sc-dark-grey"},FC={class:"text-sc-dark-grey text-sm"},VC={},Hh=i.defineComponent({...VC,__name:"order-status-history",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref([]),o=a=>un.format(a,Y.useBaseConfigStateStore().config.dateFormats.uiDateWithTime),s=(a=!0)=>{a&&(n.value=!0),Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(l=>{r.value=l}).finally(()=>{a&&(n.value=!1)})};return i.watch(()=>e.order,()=>{s(!1)}),i.onMounted(()=>{s()}),(a,l)=>{const c=z.NSpin;return i.openBlock(),i.createElementBlock("div",null,[l[1]||(l[1]=i.createElementVNode("h3",null,"История статусов",-1)),i.createElementVNode("div",SC,[n.value?(i.openBlock(),i.createElementBlock("div",BC,[i.createVNode(c,{size:"small",class:"mb-1 align-middle"}),l[0]||(l[0]=i.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(i.openBlock(),i.createElementBlock("div",TC," История статусов отсутствует. ")):(i.openBlock(),i.createElementBlock("div",NC,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(d,u)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:u},[i.createElementVNode("span",$C,i.toDisplayString(o(d.createdAt)),1),i.createElementVNode("div",EC,[i.createElementVNode("span",RC,i.toDisplayString(d.status.name),1),d.statusDetail?(i.openBlock(),i.createElementBlock("span",PC,"  ("+i.toDisplayString(d.statusDetail.name)+") ",1)):i.createCommentVNode("",!0),i.createElementVNode("div",FC,i.toDisplayString(d.user.name),1)])],64))),128))]))])])}}}),IC={class:"text-base"},MC={},Sa=i.defineComponent({...MC,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",IC,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),AC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},OC={class:"col-span-2"},zC=["href"],DC={class:"col-span-2"},LC={},Wh=i.defineComponent({...LC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("div",null,[o[12]||(o[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",AC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o[1]||(o[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Sa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[11]||(o[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(pr,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=a=>n("click:client-name",t.order.client,a))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o[2]||(o[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Wd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[o[3]||(o[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[o[5]||(o[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",OC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[o[6]||(o[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ca,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),(s=t.order.payment)!=null&&s.onlinePaymentLink?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[o[7]||(o[7]=i.createElementVNode("span",null,"Онлайн-оплата",-1)),i.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank",class:"col-span-2"}," Оплатить заказ ",8,zC)],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[o[8]||(o[8]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Ao,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[o[9]||(o[9]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",DC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[o[10]||(o[10]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Sa,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0)])])}}}),HC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},WC=["href"],jC=["href"],qC={},jh=i.defineComponent({...qC,__name:"order-external-links",props:{order:{}},setup(t){const e=i.computed(()=>{var n;return!!t.order.erpOrderUrl||(((n=t.order.invoices)==null?void 0:n.length)??0)>0});return(n,r)=>e.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[r[2]||(r[2]=i.createElementVNode("h3",null,"Внешние ссылки",-1)),i.createElementVNode("div",HC,[t.order.erpOrderUrl?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[r[0]||(r[0]=i.createElementVNode("span",null,"Открыть в ERP",-1)),i.createElementVNode("a",{href:t.order.erpOrderUrl,target:"_blank",class:"col-span-2"}," Открыть заявку в ERP ",8,WC)],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[r[1]||(r[1]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(o,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",{class:"btn btn-primary",href:o}," Скачать счет №"+i.toDisplayString(s+1),9,jC)]))),128))],64)):i.createCommentVNode("",!0)])],64)):i.createCommentVNode("",!0)}}),XC={key:0},YC={class:"text-sc-dark-grey my-2 text-center"},UC={key:1,class:"text-sc-dark-grey my-2 text-center"},KC={key:2},GC={class:"text-sc-dark-grey mt-4 text-right font-bold"},ZC={class:"text-sc-primary"},QC={},qh=i.defineComponent({...QC,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=(d=!0)=>{if("products"in n.order){s.value=new Y.Order(n.order);return}d&&(o.value=!0),Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrder(n.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=i.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=i.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(d,u)=>{const h=z.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",XC,[i.createElementVNode("div",YC,[i.createVNode(h,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",UC," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",KC,[i.createVNode(Lh,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),i.createElementVNode("div",GC,[u[2]||(u[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",ZC,i.toDisplayString(c.value)+" ₽",1)]),i.createVNode(Wh,{order:s.value,"onClick:clientName":u[0]||(u[0]=f=>r("click:client-name",s.value.client,f))},null,8,["order"]),i.createVNode(jh,{order:s.value},null,8,["order"]),i.createVNode(Hh,{order:s.value},null,8,["order"])]))}}}),JC={},eS=i.defineComponent({...JC,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(sr,"small"),r=i.computed(()=>A.isNil(e.orderContextButtonsConfig)?[]:A.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=Wo,c=z.NButton,d=z.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:o},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),tS={},nS=i.defineComponent({...tS,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,o=()=>A.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),s=i.ref(o()),a=i.ref([]),l=i.ref(!1),c=i.ref(700),d=w=>{const T={onDblclick:()=>r("dblclick:row",w)};if(!n.useCellIndication)return T;const N=[];return w.isOnOrder&&N.push("on-order"),w.isLargeOrder&&N.push("large-order"),w.isNotInStock&&N.push("not-in-stock"),N.push("order-status",w.status.slug),w.delivery.date&&un.isTomorrow(new Date(w.delivery.date))&&N.push("next-day-order"),N.length>0&&(T.class=N.join(" ")),T},u=()=>{const w=[Pe.CreatedAt,Pe.Id,Pe.ClientInfo,Pe.ClientCity,Pe.DeliveryDate,Pe.PaymentType,Pe.SalesDirections,Pe.Status,...n.showAttachedUserColumn?[Pe.AttachedUser]:[],Pe.actions],T=n.fields.length>0?n.fields:w,N={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},M={type:"expand",expandable:A.constant(!0),renderExpand:O=>i.h(qh,{order:O,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",O.client,null)}}),width:"30"};let V=[{title:"Дата заказа",key:Pe.CreatedAt,resizable:!0,width:100,render:O=>i.h(po,{date:O.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Pe.Id,resizable:!0,width:75,className:"order-id",render:O=>i.h("a",{href:n.orderUrl.replace(":id",O.id.toString()),class:"text-base"},O.id)},{title:"Дата доставки / самовывоза",key:Pe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:O=>i.h(po,{date:O.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Pe.ClientInfo,resizable:!0,minWidth:320,render:O=>i.h(pr,{client:O.client,"onClick:client-name":()=>{r("click:client-name",O.client,null)}})},{title:"Тип доставки",key:Pe.DeliveryInfo,resizable:!0,minWidth:320,render:O=>i.h(Ao,{delivery:O.delivery})},{title:"Клиент",key:Pe.ClientInfoShort,resizable:!0,minWidth:320,render:O=>i.h(pr,{client:O.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",O.client,null)}})},{title:"Город клиента",key:Pe.ClientCity,resizable:!0,minWidth:90,width:120,render:O=>{var D;return i.h("span",{class:"text-base"},((D=O.client)==null?void 0:D.city.name)??"—")}},{title:"Статус",key:Pe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:O=>i.h("span",{class:"text-base"},[O.status.name])},{title:"Тип оплаты",key:Pe.PaymentType,resizable:!0,width:115,minWidth:95,render:O=>O.payment?i.h(Ca,{payment:O.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Pe.SalesDirections,resizable:!0,width:70,render:O=>{var D;return i.h("span",{class:"text-base"},[((D=O.salesDirection)==null?void 0:D.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Pe.AttachedUser,resizable:!0,minWidth:120,render:O=>{var D;return i.h("span",{class:"text-base"},[((D=O==null?void 0:O.attachedUser)==null?void 0:D.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&V.push({key:"actions",title:"",className:"align-top",width:50,render:O=>i.h(eS,{order:O,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(V=V.map(O=>[Pe.Id,Pe.CreatedAt,Pe.DeliveryDate].includes(O.key)?{...O,sorter:!0,sortOrder:!1,...O.width===void 0?{}:{width:O.width+16}}:O)),St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[M,{key:"order",title:"Заказ",resizable:!0,render:O=>i.h(zh,{order:O,fields:T,orderUrl:n.orderUrl})}];case Qe.laptop:{const O=n.showAttachedUserColumn?T:T.filter(D=>D!==Pe.AttachedUser);return[M,...O.map(D=>V.find(ee=>ee.key===D)??N)]}default:return[N]}},h=i.ref(u()),f=i.ref(new Y.DataTablePagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),g=i.computed(()=>({...f.value,prefix({itemCount:w}){return`Всего заказов: ${w}`}})),m=i.ref(null),p=i.ref(null),y=i.ref(null),b=()=>{y.value!==null&&(clearInterval(y.value),y.value=null)},_=()=>{b(),n.refreshInterval&&(y.value=setInterval(()=>{k()},n.refreshInterval))},S=()=>{var w,T;n.filters&&((w=p.value)==null||w.abort(),p.value=null,(T=m.value)==null||T.abort(),m.value=new AbortController,l.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(n.filters,s.value,{page:f.value.page,pageSize:f.value.pageSize},m.value.signal).then(N=>{f.value.itemCount!==N.meta.total&&(f.value.itemCount=N.meta.total),f.value.page!==N.meta.currentPage&&(f.value.page=N.meta.currentPage),f.value.pageCount!==N.meta.lastPage&&(f.value.pageCount=N.meta.lastPage),f.value.pageSize!==N.meta.perPage&&(f.value.pageSize=N.meta.perPage),a.value=N.data,l.value=!1}).catch(N=>{if((N==null?void 0:N.name)!=="CanceledError")throw l.value=!1,N}))},k=()=>{var w;!n.filters||l.value||((w=p.value)==null||w.abort(),p.value=new AbortController,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(n.filters,s.value,{page:f.value.page,pageSize:f.value.pageSize},p.value.signal).then(T=>{a.value=a.value.map(N=>T.data.find(V=>V.id===N.id)??N),f.value.itemCount!==T.meta.total&&(f.value.itemCount=T.meta.total),f.value.pageCount!==T.meta.lastPage&&(f.value.pageCount=T.meta.lastPage)}).catch(T=>{if((T==null?void 0:T.name)!=="CanceledError")throw T}))},$=w=>{f.value.page=w,S(),r("update:pagination",f.value)},E=w=>{f.value.pageSize=w,f.value.page=1,S(),r("update:pagination",f.value)},x=w=>{if(A.isNull(w))s.value=o();else{const[T]=s.value;T.field=w.columnKey.toString(),T.direction=w.order==="ascend"?"asc":"desc",s.value=[T]}h.value.forEach(T=>{if(Object.hasOwn(T,"sortOrder")){const N=T;N.sortOrder=N.key===(w==null?void 0:w.columnKey)&&(w!=null&&w.sorter)&&w.order!==!1?w.order:!1}}),S(),r("update:sort",s.value)},C=()=>{h.value=u(),c.value=window.innerHeight};return i.watch(()=>n.filters,()=>{f.value.page=1,S(),_()}),i.watch(()=>n.sort,()=>{s.value=o(),f.value.page=1,S(),_()}),i.onMounted(()=>{C(),window.addEventListener("resize",C),i.nextTick(()=>{S(),_()})}),i.onUnmounted(()=>{var w,T;window.removeEventListener("resize",C),(w=m.value)==null||w.abort(),(T=p.value)==null||T.abort(),b()}),(w,T)=>{const N=z.NDataTable;return i.openBlock(),i.createBlock(N,{columns:h.value,data:a.value,"row-key":M=>M.id,"row-props":d,"scroll-x":t.tableMinWidth,pagination:g.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":c.value*(i.unref(Y.useBaseConfigStateStore)().config.tableDefaultHeightCoefficient??.6),"pagination-behavior-on-filter":"first","onUpdate:page":$,"onUpdate:pageSize":E,"onUpdate:sorter":x},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),iS=Wn(nS,[["__scopeId","data-v-2a162c0c"]]),rS=["href"],oS={class:"text-sc-dark-grey"},sS={},aS=i.defineComponent({...sS,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>un.format(n.order.createdAt,Y.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{A.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,rS),i.createTextVNode(" от "+i.toDisplayString(o.value),1)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",oS,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),lS={class:"sc-page flex flex-col bg-inherit"},cS={class:"my-2 flex flex-row items-end"},dS={class:"sc-title grow"},uS={key:0,class:"sc-title-buttons flex-1 grow-0"},hS={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},fS={key:0,class:"sc-title-extra mt-2 sm:mt-4"},mS={},Xh=i.defineComponent({...mS,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",lS,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",cS,[i.createElementVNode("div",dS,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",uS,[i.createElementVNode("div",hS,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",fS,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),gS={class:"overflow-hidden transition-all duration-300"},pS={class:"text-lg font-medium leading-none"},yS={},Yh=i.defineComponent({...yS,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(0),s=i.ref(n.showDrawer),a=()=>{switch(St.getDeviceTypeByResolution()){case Qe.phone:return window.innerWidth*.8;case Qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?A.isUndefined(n.drawerWidth)?o.value=a():o.value=A.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:o.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),i.watch(()=>n.showDrawer,c=>{s.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=z.NDrawerContent,h=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",gS,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=f=>s.value=f),resizable:!0,width:o.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",pS,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),bS={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},_S={key:0},wS={class:"sc-page-preview-panel grow"},xS={key:1,class:"sc-page-preview-panel-extra flex-none"},kS={},vS=i.defineComponent({...kS,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},o=()=>{n.value=!1},s=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.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=z.NButton;return i.openBlock(),i.createBlock(Xh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(Yh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",bS,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",_S,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",wS,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",xS,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),CS={},SS=i.defineComponent({...CS,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var m;return A.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>{const m=new Y.Curator({id:-1,name:"",contacts:{},curatedDirection:new Y.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{p.push(new Y.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),p}),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const p=A.some(s.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${p}`})),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(A.isArray(m)){const p=m.length>0?m.map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=m>0?l.value.find(y=>y.id===m):null;o("update:value",p??null)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),BS={},TS=i.defineComponent({...BS,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var m;return A.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let m=l.value,p=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=A.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];p=A.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?Y.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return Vt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(s.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>p.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(A.isArray(m)){const p=m.length>0?m.filter(y=>!A.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=m>0&&!A.some(r.disabledManagerReferenceList,["id",m])?l.value.find(y=>y.id===m):new Y.Manager;o("update:value",p??new Y.Manager)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(s.value){const p=r.value;A.some(p,y=>A.some(m,["id",y.id]))&&o("update:value",p.filter(y=>!A.some(m,["id",y.id])))}else{const p=r.value;A.some(m,["id",p.id])&&o("update:value",new Y.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),NS={class:"m-0.5 flex flex-col p-0.5"},$S={class:"flex flex-row gap-1"},ES={key:0},RS={key:1},PS={key:2},FS={key:3},VS={class:"flex flex-row gap-1"},IS={key:0},MS={key:1},AS={key:2},OS={key:3},zS={},Uh=i.defineComponent({...zS,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",NS,[i.createElementVNode("span",$S,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",ES,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",RS,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",PS,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",FS,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",VS,[t.addr.street?(i.openBlock(),i.createElementBlock("span",IS,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",MS,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",AS,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",OS,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ba={clearable:!1,value:"",field:void 0,disabled:!1},DS={},LS=i.defineComponent({...DS,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.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):Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Uh,{addr:b,selected:y},{default:A.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),HS={class:"m-0.5 flex flex-col p-0.5"},WS={class:"font-medium"},jS={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},qS={key:0},XS={key:1},YS={},Kh=i.defineComponent({...YS,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",HS,[i.createElementVNode("span",WS,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",jS,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",qS," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",XS," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),US={},KS=i.defineComponent({...US,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Kh,{bank:b,selected:y},{default:A.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),GS={class:"font-medium"},ZS={key:0,class:"flex flex-row gap-2"},QS={key:0,class:"text-xs font-light text-blue-800"},JS={key:1,class:"text-sc-dark-grey text-xs font-light"},eB={},Gh=i.defineComponent({...eB,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",GS,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",ZS,[t.org.inn?(i.openBlock(),i.createElementBlock("span",QS,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",JS,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),tB={},nB=i.defineComponent({...tB,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=Y.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{s.value=y}),i.watch(s,()=>{o("update:value",s.value)});const u=A.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},f=(y,b)=>{const _=l.value.find(S=>S.id===y.value)||{};return i.h(Gh,{org:_,selected:b},{default:A.constant("-")})},g=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&o("select",b)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[b[0]||(b[0]=S=>s.value=S),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),iB={},rB=i.defineComponent({...iB,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{n.disableConfirm?s():o.value=!0};return(l,c)=>{const d=z.NButton,u=z.NPopover,h=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show: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:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=f=>o.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),oB={key:0,class:"whitespace-pre-line"},sB={key:1,class:"text-sc-dark-grey"},aB={},lB=i.defineComponent({...aB,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.comment);i.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=n.comment};return(l,c)=>{const d=z.NInput;return i.openBlock(),i.createBlock(Ud,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",oB,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",sB," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.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"])}}}),cB={},dB=i.defineComponent({...cB,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),uB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hB(t,e){return i.openBlock(),i.createElementBlock("svg",uB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const fB=i.markRaw({name:"ion-warning",render:hB}),mB={},gB=i.defineComponent({...mB,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=fB,o=z.NPopover;return i.openBlock(),i.createBlock(o,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),vt=class vt{static init(e,n){vt.messagesService&&vt.notificationsService||(vt.messagesService=e,vt.notificationsService=n)}static getMessagesService(){if(!vt.messagesService)throw new Error("UI provider is not initialized.");return vt.messagesService}static getNotificationsService(){if(!vt.notificationsService)throw new Error("UI provider is not initialized.");return vt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(A.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";vt.notificationsService?vt.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(n,s)?n[s]=new Y.FieldValidationResultData(e.errors[s].toString(),"error"):vt.messagesService?vt.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};B(vt,"messagesService"),B(vt,"notificationsService");let Ta=vt;const pB=i.computed(()=>Y.useReferencesStore().deliveryTypeReference??[]),yB=i.computed(()=>Y.useReferencesStore().managersList??[]),bB=i.computed(()=>Y.useReferencesStore().opfReference??[]),_B=i.computed(()=>Y.useReferencesStore().partnerGroupsReference??[]),wB=i.computed(()=>Y.useReferencesStore().priceCoefficientsReference??[]),xB=i.computed(()=>Y.useReferencesStore().productFilesTypesReference??[]),kB=i.computed(()=>Y.useReferencesStore().resourceTypesReference),vB=i.computed(()=>Y.useReferencesStore().salesDirectionsReference??[]),CB=i.computed(()=>Y.useReferencesStore().warehousesReference??[]),SB=i.computed(()=>Y.useReferencesStore().paymentTypeReference??[]),BB=i.computed(()=>Y.useReferencesStore().orderStatusReference??[]),TB=i.computed(()=>Y.useReferencesStore().operatorReference??[]),NB=i.computed(()=>Vt.convertReferencesToSelectOptionsList(Y.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),$B=i.computed(()=>Vt.convertReferencesToSelectOptionsList(Y.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),EB=t=>Y.HttpRequester.getInstance(Y.ReferenceDataProvider).searchCity(t),RB=t=>Vt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.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()),PB=t=>Y.HttpRequester.getInstance(Y.ClientDataProvider).searchClient(t),FB=t=>Vt.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());W.CommonValidators=nf,W.ConfiguratorSettingsKozyrek=wd,W.ConfiguratorSettingsMosquito=W_,W.ContentHelper=ai,W.DateValidators=rf,W.KozyrekLine=_n,W.KozyrekTailTemplate=Ds,W.KozyrekTemplate=Ui,W.NumericValidators=ae,W.OrdersTableFields=Pe,W.Point=zs,W.ScAddProductToCartDialog=Mb,W.ScAddressSuggestion=LS,W.ScAddressSuggestionLabel=Uh,W.ScBankSuggestion=KS,W.ScBankSuggestionLabel=Kh,W.ScBaseDialog=Hd,W.ScButtonWithConfirmAction=rB,W.ScCategoryCollapse=Dd,W.ScClientNameWithShortInfo=pr,W.ScCollapse=zd,W.ScCollapseItem=Qa,W.ScCommentEditor=lB,W.ScConfiguratorsProductInfo=cr,W.ScContragentWithShortInfo=Wd,W.ScCreatorUserTypeTag=Pr,W.ScCuratorSelect=SS,W.ScDateRange=K_,W.ScDateTimeLabel=po,W.ScDebouncedInput=k1,W.ScDebouncedInputNumber=C1,W.ScDebt=dB,W.ScDialogHeader=i1,W.ScDynamicConfigurator=Md,W.ScEmail=Qb,W.ScExternalLink=V1,W.ScImageGallery=il,W.ScInlineEditableItem=Ud,W.ScInlineView=Hs,W.ScKozyrekConfigurator=xd,W.ScKozyrekConfiguratorParamsForm=ol,W.ScKozyrekConfiguratorPreview=_d,W.ScKozyrekConfiguratorTemplates=bd,W.ScLightGallery=nl,W.ScManagerSelect=TS,W.ScMetalForDoorsConfigurator=Ed,W.ScMetalForDoorsConfiguratorForm=$d,W.ScMosquitoConfigurator=Cd,W.ScMosquitoConfiguratorForm=kd,W.ScMosquitoConfiguratorMeasurementInstructions=vd,W.ScMosquitoConfiguratorPreview=Ls,W.ScOrderCommonInfo=zh,W.ScOrderDeliveryLabel=Ao,W.ScOrderDetails=Wh,W.ScOrderExternalLinks=jh,W.ScOrderInfo=qh,W.ScOrderItemParams=Oh,W.ScOrderItemsList=Lh,W.ScOrderPayment=Ca,W.ScOrderProductInfo=Dh,W.ScOrderStatusHistory=Hh,W.ScOrdersList=iS,W.ScOrgSuggestion=nB,W.ScOrgSuggestionLabel=Gh,W.ScPage=Xh,W.ScPageWithSlidingPanel=vS,W.ScPersonContactsBlock=H_,W.ScPhone=k_,W.ScPhoneInput=T1,W.ScProductName=lr,W.ScProductsList=l2,W.ScReferenceSelect=Ld,W.ScSandwichConfigurator=Fd,W.ScSandwichConfiguratorForm=Pd,W.ScSandwichM2Configurator=Id,W.ScSandwichM2ConfiguratorForm=Vd,W.ScSearchableProductSelect=Ah,W.ScSearchableReferenceSelect=Mh,W.ScSetClientPriceFormItem=$b,W.ScShortTextOrderInfo=aS,W.ScSingleFileUploadSelector=l1,W.ScSlidingContentWithDrawer=Yh,W.ScStripConfigurator=Nd,W.ScStripConfiguratorForm=Bd,W.ScStripConfiguratorLineItem=Sd,W.ScStripConfiguratorPreview=Td,W.ScUserShortInfo=Sa,W.ScWarningIcon=gB,W.SelectOptionHelper=Vt,W.UiNotificationProvider=Ta,W.Validators=He,W.WindowResolutionEnum=Qe,W.WindowResolutionProvider=St,W.channelPrimaryInterestOptionsList=NB,W.componentSizeInjectionKey=sr,W.deliveryTypeReferenceList=pB,W.handleFloatInput=Or,W.handleIntegerInput=tt,W.isCanSandwichM2Show=j_,W.isCanSandwichShow=Od,W.isConfiguratorType=Ad,W.managersReferenceList=yB,W.naiveUiTheme=jf,W.operatorReferenceList=TB,W.opfReferenceList=bB,W.orderStatusReferenceList=BB,W.parse=it,W.partnerGroupReferenceList=_B,W.paymentTypeReferenceList=SB,W.priceCoefficientsReferenceList=wB,W.productFilesTypesReferenceList=xB,W.renderConfig=je,W.resetInputValidation=et,W.resourceReferencesList=kB,W.salesDirectionsReferenceList=vB,W.searchCityReferenceDataHandler=EB,W.searchCityReferenceLabelRenderer=RB,W.searchClientReferenceDataHandler=PB,W.searchClientReferenceLabelRenderer=FB,W.selectAllTextOnFocus=Le,W.sourcePrimaryInterestOptionsList=$B,W.vFocusNext=Ua,W.warehousesReferenceList=CB,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));