diff --git a/admin/admin.js b/admin/admin.js index 1f4fa8e..bb7daeb 100644 --- a/admin/admin.js +++ b/admin/admin.js @@ -426,4 +426,4 @@ Error generating stack: `+n.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var Tw={"add-point":bn,perspective:Yr,orthographic:Hi,select:ki,move:Ei,pen:Di,rectangle:Oi,curve:Vi,undo:$i,redo:_i,activity:Kr,alert:kn,apps:$r,building:Zr,camera:Qr,check:Wr,"chevron-down":Jr,"chevron-up":ai,"chevron-left":ei,"chevron-right":ti,circle:ni,clipboard:li,close:Qi,copy:oi,database:ri,download:ii,edit:Ti,eye:di,"eye-off":si,expand:Ci,external:ui,file:ci,folder:fi,globe:wn,grid:xi,image:mi,inbox:pi,info:hi,key:gi,layers:In,list:yi,target:vi,lock:Li,mail:bi,minimize:wi,network:Mi,panel:Ai,plan:Si,play:Ni,power:Bi,plus:Ri,minus:Ii,profile:Sn,refresh:zi,"rotate-clockwise":qi,save:Ui,search:Pi,settings:Fi,shield:ji,sliders:Gi,stop:Xi,terminal:Ki,trash:Yi,upload:Cn,users:En,video:Zi};function ie({name:e,label:t,size:a=16,strokeWidth:n=1.6,fill:l,...o}){let r=Tw[e],i=e==="play"||e==="stop";return(0,xv.jsx)(r,{size:a,strokeWidth:i?0:n,fill:l??(i?"currentColor":"none"),"aria-hidden":t?void 0:"true","aria-label":t,role:t?"img":void 0,focusable:"false",...o})}var vv=E(z(),1);var Dm=E(z(),1),sl=E(q(),1),Rw=E(Wt(),1),UA=(0,sl.createContext)(null);var Lv=E(z(),1);var bv=E(q(),1);var ma=E(z(),1),Bm=E(q(),1);function Cv(e){return Math.max(0,Math.min(255,Math.round(e)))}function Bw(e){let t=Cv(e)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ow(e){let[t,a,n]=e.map(Bw);return t*.2126+a*.7152+n*.0722}function wv(e){return Ow(e)>.46?[11,17,23]:[247,248,244]}function Sv(e){return e.map(Cv).join(" ")}function Wi(e){return{"--nodedc-accent-rgb":Sv(e),"--nodedc-on-accent-rgb":Sv(wv(e))}}function Tm({anchor:e,surfaceWidth:t,surfaceHeight:a,placement:n="bottom-start",offset:l=8,flip:o=!0,viewportWidth:r=typeof window>"u"?1920:window.innerWidth,viewportHeight:i=typeof window>"u"?1080:window.innerHeight,viewportPadding:u=8}){let s=Math.max(0,i-u*2);if(n.startsWith("left")||n.startsWith("right")){let A=Math.max(0,e.left-l-u),I=Math.max(0,r-e.right-l-u),N=n.startsWith("left"),w=o&&(N?t>A&&I>A:t>I&&A>I)?!N:N,O=w?A:I,te=Math.min(t,O),se=Math.min(a,s);return{left:w?e.left-l-te:e.right+l,top:Math.max(u,Math.min(e.top,i-u-se)),maxHeight:s,maxWidth:O,resolvedPlacement:w?"left-start":"right-start"}}let m=Math.min(s,Math.max(0,i-e.bottom-l-u)),c=Math.min(s,Math.max(0,e.top-l-u)),p=n.startsWith("top"),v=o&&(p?a>c&&m>c:a>m&&c>m)?`${p?"bottom":"top"}-${n.endsWith("end")?"end":"start"}`:n,S=v.endsWith("end")?e.right-t:e.left,L=Math.min(Math.max(u,S),Math.max(u,r-t-u)),x=v.startsWith("top")?c:m,g=Math.min(s,Math.max(Math.min(96,s),x)),y=Math.min(a,g),b=v.startsWith("top")?e.top-l-y:e.bottom+l;return{top:Math.min(Math.max(u,b),Math.max(u,i-y-u)),left:L,maxHeight:g,resolvedPlacement:v}}function Iv([e,t,a]){return`${e} ${t} ${a}`}function ed(e){return Math.max(0,Math.min(1,e))}function Nm(e,{theme:t="dark",accent:a,material:n,appearance:l="default",edges:o="default"}={}){if(e.dataset.nodedcTheme=t,e.dataset.nodedcAppearance=l,e.dataset.nodedcEdges=o,e.dataset.nodedcUi="true",a){let r=Wi(a);Object.entries(r).forEach(([i,u])=>{e.style.setProperty(i,u)})}if(n){if(n.panel&&e.style.setProperty("--nodedc-panel-material-rgb",Iv(n.panel)),typeof n.panelOpacity=="number"&&Number.isFinite(n.panelOpacity)){let r=ed(n.panelOpacity);e.style.setProperty("--nodedc-panel-material-opacity",String(r)),e.style.setProperty("--nodedc-panel-material-strong-opacity",String(ed(r+.12))),e.style.setProperty("--nodedc-panel-material-soft-opacity",String(ed(Math.max(.12,r-.2))))}n.field&&e.style.setProperty("--nodedc-field-material-rgb",Iv(n.field)),typeof n.fieldOpacity=="number"&&Number.isFinite(n.fieldOpacity)&&e.style.setProperty("--nodedc-field-material-opacity",String(ed(n.fieldOpacity)))}}var kv=Object.freeze({background:"#111115",border:"#111117",outline:"#1c1c1c",minSize:25,maxSize:87,lensCount:5,gap:10,padding:6,hideDelay:5e3}),tD=Object.freeze({mass:.1,stiffness:170,damping:12,maxStep:1/240});var pa=(0,Bm.forwardRef)(function({variant:t="secondary",tone:a="theme",size:n="default",width:l="auto",shape:o="default",accent:r,icon:i,className:u,children:s,style:m,type:c="button",loading:p=!1,disabled:h,...v},S){let L=r?Wi(r):void 0;return(0,ma.jsxs)("button",{ref:S,type:c,className:B("nodedc-button",u),"data-variant":t,"data-tone":a==="theme"?void 0:a,"data-size":n==="default"?void 0:n,"data-width":l==="auto"?void 0:l,"data-shape":o==="default"?void 0:o,style:L?{...L,...m}:m,...v,disabled:h||p,"aria-busy":p||v["aria-busy"],"data-loading":p||void 0,children:[(0,ma.jsxs)("span",{className:"nodedc-button__content",children:[i?(0,ma.jsx)("span",{className:"nodedc-button__icon","aria-hidden":"true",children:i}):null,s]}),p?(0,ma.jsx)("span",{className:"nodedc-action-loading","aria-hidden":"true",children:(0,ma.jsx)(Ys,{size:"compact"})}):null]})}),pt=(0,Bm.forwardRef)(function({label:t,shape:a="circle",className:n,children:l,type:o="button",loading:r=!1,disabled:i,...u},s){return(0,ma.jsxs)("button",{ref:s,type:o,className:B("nodedc-icon-button",n),"data-shape":a==="circle"?void 0:a,"aria-label":t,title:t,...u,disabled:i||r,"aria-busy":r||u["aria-busy"],"data-loading":r||void 0,children:[l,r?(0,ma.jsx)("span",{className:"nodedc-action-loading","aria-hidden":"true",children:(0,ma.jsx)(Ys,{size:"compact"})}):null]})});var _m=E(z(),1),Uw=E(q(),1);var Om=E(z(),1);function Ji({label:e,value:t,valueText:a,className:n,style:l,...o}){let r=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):void 0;return(0,Om.jsx)("div",{...o,className:B("nodedc-progress-bar",n),role:"progressbar","aria-label":e,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r===void 0?void 0:Math.round(r*100),"aria-valuetext":a,"data-indeterminate":r===void 0||void 0,style:{...l,"--nodedc-progress-fraction":r??0},children:(0,Om.jsx)("span",{className:"nodedc-progress-bar__fill"})})}var Dv=E(z(),1);var Um=E(z(),1),Hm=E(q(),1);var ze=E(z(),1),le=E(q(),1),Bv=E(Wt(),1);var Tv=E(q(),1),Io=(0,Tv.createContext)(!1);var Nv=E(q(),1),zm=(0,Nv.createContext)(null);var qm=["n","s","e","w","ne","nw","se","sw"],Mn=(e,t,a)=>Math.max(t,Math.min(a,e));function An(e,t){let a=Mn(e.width,Math.min(320,t.width-16),Math.max(1,t.width-16)),n=Mn(e.height,Math.min(200,t.height-16),Math.max(1,t.height-16));return{width:a,height:n,left:Mn(e.left,8,Math.max(8,t.width-a-8)),top:Mn(e.top,8,Math.max(8,t.height-n-8))}}function td(e,t,a,n,l){let o=An(e,l),r=o.left+o.width,i=o.top+o.height,u=Math.min(320,l.width-16),s=Math.min(200,l.height-16),m=t.includes("w")?Mn(o.left+a,8,r-u):o.left,c=t.includes("n")?Mn(o.top+n,8,i-s):o.top,p=t.includes("e")?Mn(r+a,m+u,l.width-8):r,h=t.includes("s")?Mn(i+n,c+s,l.height-8):i;return{left:m,top:c,width:p-m,height:h-c}}var Rv=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function ad({open:e,title:t,subtitle:a,children:n,footer:l,headerActions:o,size:r="md",placement:i="center",closeLabel:u="\u0417\u0430\u043A\u0440\u044B\u0442\u044C",closeOnBackdrop:s,closeOnEscape:m=!0,lockBodyScroll:c,trapFocus:p,draggable:h=!1,resizable:v=!1,initialRect:S,rect:L,onRectCommit:x,allowFloating:g=!0,onClose:y,className:b,style:M,...A}){let[I,N]=(0,le.useState)(0),T=(0,le.useCallback)(()=>(N(_=>_+1),()=>N(_=>Math.max(0,_-1))),[]),w=I>0,O=(0,le.useId)(),te=(0,le.useId)(),se=(0,le.useRef)(null),et=(0,le.useRef)(y),de=(0,le.useRef)(null),[H,_t]=(0,le.useState)(null),[rt,Re]=(0,le.useState)(!1),[oe,Qt]=(0,le.useState)(null),vt=(0,le.useRef)(null),ja=(0,le.useRef)(null),Ga=(0,le.useRef)(x);Ga.current=x;let Un=_=>{vt.current=_,Qt(_)},wl=(0,le.useRef)(!1),Va=(0,le.useRef)(null),Lt=rt&&g&&i==="center",bt=Lt||v&&i==="end",hu=h||bt,$p=!w&&!Lt&&(c??i==="center"),Zp=!w&&!Lt&&(p??i==="center"),qo=(0,le.useRef)({shouldTrapFocus:Zp,isFloating:Lt,suspended:w});if(qo.current={shouldTrapFocus:Zp,isFloating:Lt,suspended:w},et.current=y,(0,le.useEffect)(()=>{if(!e||typeof document>"u")return;let _=document.activeElement instanceof HTMLElement?document.activeElement:null,Se=window.requestAnimationFrame(()=>{(Array.from(se.current?.querySelectorAll(Rv)??[]).find(tt=>tt.getClientRects().length>0)??se.current)?.focus()}),Be=Ce=>{if(Ce.defaultPrevented||qo.current.suspended)return;let tt=document.activeElement?.closest('[role="dialog"]');if(tt&&tt!==se.current)return;if(!tt){let Il=Array.from(document.querySelectorAll('[role="dialog"][aria-modal="true"]')).filter(rS=>rS.getClientRects().length>0).at(-1);if(Il&&Il!==se.current)return}if(Ce.key==="Escape"&&m&&(!qo.current.isFloating||se.current?.contains(document.activeElement))){Ce.preventDefault(),et.current();return}if(Ce.key!=="Tab"||!qo.current.shouldTrapFocus||!se.current)return;let Hn=Array.from(se.current.querySelectorAll(Rv)).filter(Il=>Il.getClientRects().length>0);if(Hn.length===0){Ce.preventDefault(),se.current.focus();return}let Pn=Hn[0],gu=Hn[Hn.length-1];Ce.shiftKey&&document.activeElement===Pn?(Ce.preventDefault(),gu.focus()):!Ce.shiftKey&&document.activeElement===gu&&(Ce.preventDefault(),Pn.focus())};return document.addEventListener("keydown",Be),()=>{window.cancelAnimationFrame(Se),document.removeEventListener("keydown",Be),(!qo.current.isFloating||document.activeElement===document.body||se.current?.contains(document.activeElement))&&_?.focus()}},[m,e]),(0,le.useEffect)(()=>{if(!e||!$p)return;let _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=_}},[e,$p]),(0,le.useLayoutEffect)(()=>{if(e&&bt&&!de.current&&!Va.current){if(i==="center"&&!x&&!L&&vt.current)return;let _=se.current?.getBoundingClientRect();_&&(ja.current??=S??{left:_.left,top:_.top,width:_.width,height:_.height},Un(An(L??ja.current,{width:window.innerWidth,height:window.innerHeight})))}},[e,bt,L?.left,L?.top,L?.width,L?.height]),(0,le.useEffect)(()=>{e||(_t(null),Re(!1),Un(null),ja.current=null,de.current=null,Va.current=null)},[e]),(0,le.useEffect)(()=>{if(!hu||!e)return;let _=Be=>{let Ce=Va.current;if(Ce&&Be.pointerId===Ce.pointerId){wl.current=!0,Un(td(Ce.rect,Ce.edge,Be.clientX-Ce.x,Be.clientY-Ce.y,{width:window.innerWidth,height:window.innerHeight}));return}let tt=de.current,Hn=se.current;if(!tt||!Hn||Be.pointerId!==tt.pointerId)return;let Pn=Hn.getBoundingClientRect();if(bt){wl.current=!0,Un(An({left:Be.clientX-tt.offsetX,top:Be.clientY-tt.offsetY,width:Pn.width,height:Pn.height},{width:window.innerWidth,height:window.innerHeight}));return}let gu=Math.max(8,Math.min(window.innerWidth-Pn.width-8,Be.clientX-tt.offsetX)),Il=Math.max(76,Math.min(window.innerHeight-Pn.height-8,Be.clientY-tt.offsetY));_t({left:gu,top:Il})},Se=Be=>{let Ce=de.current?.pointerId===Be.pointerId||Va.current?.pointerId===Be.pointerId;de.current?.pointerId===Be.pointerId&&(de.current=null),Va.current?.pointerId===Be.pointerId&&(Va.current=null),Ce&&wl.current&&vt.current&&(wl.current=!1,Ga.current?.({...vt.current}))};return window.addEventListener("pointermove",_),window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[hu,bt,e]),(0,le.useEffect)(()=>{if(!bt||!e)return;let _=()=>{vt.current&&Un(An(L??vt.current,{width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[bt,e,L]),!e||typeof document>"u")return null;let lS=!Lt&&(s??i==="center"),oS=_=>{lS&&_.target===_.currentTarget&&y()};return(0,Bv.createPortal)((0,ze.jsx)($s.Provider,{value:null,children:(0,ze.jsx)(Io.Provider,{value:!1,children:(0,ze.jsx)(zm.Provider,{value:T,children:(0,ze.jsx)("div",{className:"nodedc-overlay nodedc-ui-root",style:w?{display:"none"}:void 0,"data-placement":i,"data-floating":Lt||void 0,onPointerDown:oS,children:(0,ze.jsxs)("div",{ref:se,className:B("nodedc-window nodedc-glass-material nodedc-material-rim",b),"data-material":"glass-v4","data-size":r==="md"?void 0:r,"data-placement":i,"data-draggable":hu?"true":void 0,"data-resizable":bt||void 0,"data-floating":Lt||void 0,role:"dialog","aria-modal":i==="center"&&!Lt?"true":void 0,"aria-labelledby":O,"aria-describedby":a?te:void 0,tabIndex:-1,style:bt&&oe?{...M,position:"fixed",...oe,right:"auto",bottom:"auto",maxWidth:"none",maxHeight:"none"}:H?{...M,position:"fixed",left:H.left,top:H.top,right:"auto",bottom:"auto"}:M,...A,children:[(0,ze.jsxs)("header",{className:"nodedc-window__head",tabIndex:bt?0:void 0,"aria-label":bt?"\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u043E\u043A\u043D\u0430: \u0441\u0442\u0440\u0435\u043B\u043A\u0438; \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u043C\u0435\u0440\u0430: Shift \u0438 \u0441\u0442\u0440\u0435\u043B\u043A\u0438":void 0,onKeyDown:_=>{if(!bt||!oe||_.target!==_.currentTarget||!_.key.startsWith("Arrow"))return;_.preventDefault();let Se=_.key==="ArrowLeft"?-10:_.key==="ArrowRight"?10:0,Be=_.key==="ArrowUp"?-10:_.key==="ArrowDown"?10:0,Ce={width:window.innerWidth,height:window.innerHeight},tt=_.shiftKey?td(oe,"se",Se,Be,Ce):An({...oe,left:oe.left+Se,top:oe.top+Be},Ce);Un(tt),Ga.current?.(tt)},onPointerDown:_=>{if(!hu||_.button!==0||_.target.closest("button, input, select, textarea, a"))return;let Se=se.current?.getBoundingClientRect();Se&&(de.current={pointerId:_.pointerId,offsetX:_.clientX-Se.left,offsetY:_.clientY-Se.top},wl.current=!1,_.currentTarget.setPointerCapture(_.pointerId),_.preventDefault())},children:[(0,ze.jsxs)("div",{className:"nodedc-window__titles",children:[(0,ze.jsx)("h2",{id:O,className:"nodedc-window__title",children:t}),a?(0,ze.jsx)("p",{id:te,className:"nodedc-window__subtitle",children:a}):null]}),(0,ze.jsxs)("div",{className:"nodedc-window__actions",children:[o,g&&i==="center"&&(0,ze.jsx)(pt,{label:Lt?"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C":"\u0421\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043E\u043A\u043D\u043E","aria-pressed":Lt,onClick:()=>{if(de.current=null,Va.current=null,!Lt){let _=se.current?.getBoundingClientRect();_&&Un(An(vt.current??{left:_.left,top:_.top,width:_.width,height:_.height},{width:window.innerWidth,height:window.innerHeight}))}Re(!Lt)},children:(0,ze.jsx)(ie,{name:"move"})}),(0,ze.jsx)("button",{type:"button",className:"nodedc-window__close","aria-label":u,onClick:y,children:(0,ze.jsx)(ie,{name:"close",size:16,strokeWidth:1.6})})]})]}),bt&&qm.map(_=>(0,ze.jsx)("div",{className:"nodedc-window__resize","data-edge":_,"aria-hidden":"true",onPointerDown:Se=>{Se.button!==0||!oe||(Va.current={pointerId:Se.pointerId,x:Se.clientX,y:Se.clientY,rect:oe,edge:_},wl.current=!1,Se.currentTarget.setPointerCapture(Se.pointerId),Se.preventDefault(),Se.stopPropagation())}},_)),(0,ze.jsx)("div",{className:"nodedc-window__body",children:n}),l?(0,ze.jsx)("footer",{className:"nodedc-window__footer",children:l}):null]})})})})}),document.fullscreenElement??document.body)}var eu=E(z(),1),fe=E(q(),1),zv=E(Wt(),1);var _v=(0,fe.createContext)([]),Pm=new Map;function ha({trigger:e,children:t,placement:a="bottom-start",minWidth:n=180,width:l="anchor",offset:o=8,disabled:r=!1,className:i,surfaceClassName:u,surfaceRole:s="menu",onOpenChange:m,getAnchorRect:c,flip:p=!0,onPointerDownOutside:h}){let v=(0,fe.useId)(),S=(0,fe.useContext)(_v),L=(0,fe.useMemo)(()=>[...S,v],[S,v]),x=`${v.replaceAll(":","")}-surface`,[g,y]=(0,fe.useState)(!1),[b,M]=(0,fe.useState)(null),[A,I]=(0,fe.useState)(null),N=(0,fe.useRef)(null),[T,w]=(0,fe.useState)({visibility:"hidden"});(0,fe.useEffect)(()=>{m?.(g)},[g,m]);let O=(0,fe.useCallback)(()=>y(!1),[]),te=(0,fe.useCallback)(()=>{r||y(!0)},[r]),se=(0,fe.useCallback)(()=>{r||y(de=>!de)},[r]),et=(0,fe.useCallback)(()=>{let de=b??A;if(!de||!N.current)return;let H=c?.()??de.getBoundingClientRect();if(!(H.bottom>0&&H.top0&&H.leftObject.keys(vt).every(Ga=>ja[Ga]===vt[Ga])?ja:vt)},[b,O,n,o,a,A,l,c,p]);return(0,fe.useLayoutEffect)(()=>{g&&et()},[g,et]),(0,fe.useEffect)(()=>{if(!g||!c)return;let de,H=()=>{et(),de=requestAnimationFrame(H)};return de=requestAnimationFrame(H),()=>cancelAnimationFrame(de)},[g,c,et]),(0,fe.useEffect)(()=>{if(!g)return;let de=Re=>{let oe=Re.target;!(oe instanceof Node)||b?.contains(oe)||A?.contains(oe)||N.current?.contains(oe)||(oe instanceof Element?oe:oe.parentElement)?.closest("[data-dropdown-lineage]")?.getAttribute("data-dropdown-lineage")?.split(" ").includes(v)||(O(),h?.(Re))},H=Re=>{if(Re.key==="Escape"&&!Re.defaultPrevented){if([...Pm].some(([oe,Qt])=>oe!==v&&Qt.includes(v)))return;O(),Re.preventDefault(),Re.stopImmediatePropagation(),A?.focus()}},_t=Re=>{let oe=Re.detail;oe.id!==v&&!oe.lineage?.includes(v)&&O()},rt=()=>et();return Pm.set(v,L),window.dispatchEvent(new CustomEvent("nodedc-dropdown-open",{detail:{id:v,lineage:L}})),document.addEventListener("pointerdown",de,!0),document.addEventListener("keydown",H,!0),window.addEventListener("nodedc-dropdown-open",_t),window.addEventListener("resize",rt),window.addEventListener("scroll",rt,!0),()=>{Pm.delete(v),document.removeEventListener("pointerdown",de,!0),document.removeEventListener("keydown",H,!0),window.removeEventListener("nodedc-dropdown-open",_t),window.removeEventListener("resize",rt),window.removeEventListener("scroll",rt,!0)}},[b,O,v,g,A,et,L,h]),(0,eu.jsxs)("span",{className:B("nodedc-dropdown-anchor",i),children:[e({open:g,show:te,close:O,toggle:se,setAnchorRef:M,setTriggerRef:I,surfaceId:x}),g&&typeof document<"u"?(0,zv.createPortal)((0,eu.jsx)("div",{ref:N,id:x,"data-dropdown-lineage":L.join(" "),className:B("nodedc-dropdown-surface",u),role:s,style:T,children:(0,eu.jsx)(_v.Provider,{value:L,children:typeof t=="function"?t({close:O}):t})}),document.fullscreenElement??document.body):null]})}var Fv=E(z(),1),dl=E(q(),1);var qv=E(z(),1),Uv=E(q(),1);var lT=(0,dl.createContext)({disabled:!0,onKey:()=>{}});var jv=E(z(),1),nd=E(q(),1);var Gv=E(z(),1),ko=E(q(),1),Xw=E(Wt(),1);var Vv=E(z(),1),Kw=E(q(),1);var Qe=E(z(),1),ld=E(q(),1);function Fm({open:e,title:t,subtitle:a,identity:n,sections:l,activeSection:o,onSectionChange:r,onClose:i,children:u,footer:s,headerActions:m}){let c=(0,ld.useRef)(null);return(0,ld.useLayoutEffect)(()=>{c.current&&(c.current.scrollTop=0)},[o]),(0,Qe.jsx)(ad,{open:e,title:t,subtitle:a,size:"lg",className:"nodedc-feature-settings-window",footer:s,headerActions:m,closeOnBackdrop:!1,onClose:i,children:(0,Qe.jsxs)("div",{className:"nodedc-feature-settings",children:[(0,Qe.jsxs)("aside",{className:"nodedc-feature-settings__navigation","aria-label":"\u0420\u0430\u0437\u0434\u0435\u043B\u044B \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A",tabIndex:0,children:[(0,Qe.jsxs)("div",{className:"nodedc-feature-settings__identity",children:[(0,Qe.jsx)(Lo,{label:n.avatarLabel,imageUrl:n.avatarUrl}),(0,Qe.jsxs)("span",{children:[(0,Qe.jsx)("strong",{children:n.title}),n.subtitle?(0,Qe.jsx)("small",{children:n.subtitle}):null]})]}),(0,Qe.jsx)("nav",{children:l.map((p,h)=>{let v=p.group&&p.group!==l[h-1]?.group;return(0,Qe.jsxs)("div",{className:"nodedc-feature-settings__navigation-entry",children:[v?(0,Qe.jsx)("span",{className:"nodedc-feature-settings__group",children:p.group}):null,(0,Qe.jsxs)("button",{type:"button",className:"nodedc-feature-settings__section","data-active":p.id===o?"true":void 0,disabled:p.disabled,onClick:()=>r(p.id),children:[p.icon?(0,Qe.jsx)(ie,{name:p.icon,size:16}):null,(0,Qe.jsx)("span",{children:p.label})]})]},p.id)})})]}),(0,Qe.jsx)("section",{ref:c,className:"nodedc-feature-settings__content","aria-label":"\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A",tabIndex:0,children:u})]})})}var Yw=E(z(),1);var Xv=E(z(),1),Kv=E(q(),1);var K=E(z(),1),Dn=E(q(),1);function cl({value:e,options:t,label:a,onChange:n,searchable:l=!1,searchPlaceholder:o="\u041F\u043E\u0438\u0441\u043A",emptyLabel:r="\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",placement:i="bottom-start",minMenuWidth:u=180,menuWidth:s="anchor",disabled:m=!1,variant:c="integrated",shape:p="default",className:h,triggerClassName:v,menuClassName:S}){let x=(0,Dn.useContext)(Io)?"split":c,[g,y]=(0,Dn.useState)(""),b=(0,Dn.useRef)(null),M=t.find(T=>T.value===e)??t[0],A=t.some(T=>T.action),I=A?"dialog":"listbox",N=(0,Dn.useMemo)(()=>{let T=g.trim().toLocaleLowerCase();return T?t.filter(w=>`${w.label} ${w.description??""}`.toLocaleLowerCase().includes(T)):t},[t,g]);return(0,K.jsx)(ha,{className:B("nodedc-select-anchor",h),placement:i,minWidth:u,width:s,disabled:m,surfaceRole:I,surfaceClassName:B(x==="split"&&"nodedc-select__menu",S),trigger:({open:T,toggle:w,setAnchorRef:O,setTriggerRef:te,surfaceId:se})=>{let et=H=>{b.current=H.currentTarget,w()},de=H=>{b.current=H.currentTarget,(H.key==="ArrowDown"||H.key==="Enter"||H.key===" ")&&(H.preventDefault(),T||w())};return x==="split"?(0,K.jsx)("div",{className:B("nodedc-select",v),"data-shape":p==="pill"?"pill":void 0,"data-disabled":m?"true":void 0,children:(0,K.jsxs)("div",{ref:O,className:"nodedc-select__control",children:[(0,K.jsxs)("div",{className:"nodedc-select__value",children:[M?.icon?(0,K.jsx)("span",{className:"nodedc-select__value-icon",children:M.icon}):null,(0,K.jsx)("span",{children:M?.label??"\u2014"})]}),(0,K.jsx)("button",{ref:te,type:"button",className:"nodedc-select__toggle","aria-label":a,"aria-haspopup":I,"aria-controls":se,"aria-expanded":T,disabled:m,onClick:et,onKeyDown:de,children:(0,K.jsx)("span",{className:"nodedc-select-trigger__chevron","aria-hidden":"true"})})]})}):x==="inline"?(0,K.jsxs)("button",{ref:te,type:"button",className:B("nodedc-select-inline",v),"aria-label":a,"aria-haspopup":I,"aria-controls":se,"aria-expanded":T,disabled:m,onClick:et,onKeyDown:de,children:[M?.icon?(0,K.jsx)("span",{className:"nodedc-select-trigger__icon",children:M.icon}):null,(0,K.jsx)("span",{children:M?.label??"\u2014"})]}):(0,K.jsxs)("button",{ref:te,type:"button",className:B("nodedc-select-trigger",v),"aria-label":a,"aria-haspopup":I,"aria-controls":se,"aria-expanded":T,disabled:m,onClick:et,onKeyDown:de,children:[M?.icon?(0,K.jsx)("span",{className:"nodedc-select-trigger__icon",children:M.icon}):(0,K.jsx)("span",{className:"nodedc-select-trigger__icon","aria-hidden":"true"}),(0,K.jsx)("span",{className:"nodedc-select-trigger__label",children:M?.label??"\u2014"}),(0,K.jsx)("span",{className:"nodedc-select-trigger__chevron","aria-hidden":"true"})]})},children:({close:T})=>(0,K.jsxs)(K.Fragment,{children:[l?(0,K.jsxs)("label",{className:"nodedc-dropdown-search",children:[(0,K.jsx)("span",{"aria-hidden":"true",children:"\u2315"}),(0,K.jsx)("input",{value:g,onChange:w=>y(w.target.value),placeholder:o})]}):null,N.map(w=>(0,K.jsxs)("div",{className:"nodedc-select-option-row",children:[(0,K.jsxs)("button",{type:"button",className:"nodedc-dropdown-option",role:A?void 0:"option","aria-selected":A?void 0:w.value===e,"aria-pressed":A?w.value===e:void 0,"data-selected":w.value===e?"true":void 0,disabled:w.disabled,onClick:()=>{w.disabled||(n(w.value,w),y(""),T())},children:[w.icon?(0,K.jsx)("span",{className:"nodedc-dropdown-option__icon",children:w.icon}):(0,K.jsx)("span",{}),(0,K.jsxs)("span",{className:"nodedc-dropdown-option__body",children:[(0,K.jsx)("span",{className:"nodedc-dropdown-option__label",children:w.label}),w.description?(0,K.jsx)("span",{className:"nodedc-dropdown-option__description",children:w.description}):null]}),w.value===e?(0,K.jsx)("span",{className:"nodedc-dropdown-option__check","aria-hidden":"true",children:"\u2022"}):null]}),w.action?(0,K.jsx)(pt,{label:w.action.label,"data-tone":w.action.tone??"neutral",disabled:w.action.disabled,onClick:()=>{y(""),T(),b.current?.focus(),w.action?.onAction()},children:w.action.icon}):null]},w.value)),N.length===0?(0,K.jsx)("div",{className:"nodedc-empty-state",children:r}):null]})})}var Yv=E(z(),1),$w=E(q(),1);var $v=E(z(),1),Zw=E(q(),1);var W=E(z(),1),je=E(q(),1);var fl=E(z(),1),Wv=E(q(),1),od=E(q(),1);var tu=(e,t,a)=>Math.max(t,Math.min(a,e));function jm(e,t,a){let n=tu(e[0],t,a);return[n,tu(e[1],n,a)]}function Zv([e,t],a){return a<=(e+t)/2?0:1}function Qv(e,t,a,n,l,o=1){let r=jm(e,n,l),i=Number(o),u=tu(a,n,l),s=u===n||u===l||!Number.isFinite(i)||i<=0?u:Number((n+Math.round((u-n)/i)*i).toPrecision(12));return r[t]=t===0?tu(s,n,r[1]):tu(s,r[0],l),r}function Jv({label:e,value:t,min:a,max:n,step:l=1,onChange:o,lowerLabel:r=`${e}: \u043D\u0438\u0436\u043D\u044F\u044F \u0433\u0440\u0430\u043D\u0438\u0446\u0430`,upperLabel:i=`${e}: \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0433\u0440\u0430\u043D\u0438\u0446\u0430`,formatValue:u=String,formatLimit:s=String,limitSide:m="right",disabled:c=!1,className:p,style:h,orientation:v,...S}){let L=n>a?n:a+1,x=jm(t,a,L),g=(0,od.useRef)(x);g.current=x;let y=(0,od.useRef)([]),b=(0,od.useRef)(null),M=x.map(w=>(w-a)/(L-a)*100),A={...h,"--nodedc-range-lower":`${M[0]}%`,"--nodedc-range-upper":`${M[1]}%`},I=(w,O)=>{let te=Qv(g.current,w,O,a,L,l);g.current=te,o(te)},N=w=>{let O=w.currentTarget.getBoundingClientRect();return a+Math.max(0,Math.min(1,(O.bottom-w.clientY)/O.height))*(L-a)},T=w=>{b.current?.id===w.pointerId&&(b.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId))};return(0,fl.jsxs)("div",{className:"nodedc-range-scale","data-band":"true","data-limit-side":m,"data-disabled":c||void 0,style:A,children:[(0,fl.jsx)("div",{className:B("nodedc-range",p),"data-orientation":"vertical",children:(0,fl.jsx)("div",{className:"nodedc-range-band__target",onPointerDown:w=>{if(c||w.button!==0||b.current)return;w.preventDefault(),w.stopPropagation();let O=N(w),te=Zv(g.current,O);b.current={id:w.pointerId,boundary:te},y.current[te]?.focus({preventScroll:!0}),w.currentTarget.setPointerCapture(w.pointerId),I(te,O)},onPointerMove:w=>{c||b.current?.id!==w.pointerId||(w.preventDefault(),w.stopPropagation(),I(b.current.boundary,N(w)))},onPointerUp:T,onPointerCancel:T,onLostPointerCapture:()=>{b.current=null},children:[0,1].map(w=>(0,Wv.createElement)("input",{...S,key:w,ref:O=>{y.current[w]=O},type:"range","data-boundary":w===0?"lower":"upper",min:a,max:L,step:l,value:x[w],disabled:c,"aria-label":w===0?r:i,"aria-orientation":"vertical","aria-valuemin":w===0?a:x[0],"aria-valuemax":w===0?x[1]:L,"aria-valuetext":u(x[w]),onChange:O=>I(w,Number(O.target.value))}))})}),(0,fl.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--max",children:s(x[1])}),(0,fl.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--min",children:s(x[0])})]})}var Gm=(e,t,a)=>Math.max(t,Math.min(a,e)),eL=e=>{let[t,a]=String(e).toLowerCase().split("e"),n=t?.split(".")[1]?.length??0;if(a===void 0)return n;let l=Number.parseInt(a,10);return Number.isFinite(l)?Math.max(0,n-l):n},Qw=(e,t,a,n,l)=>{let o=l?.min??Number.NEGATIVE_INFINITY,r=l?.max??Number.POSITIVE_INFINITY,i=Gm(e,o,r);if(n==="any")return i;let u=n===void 0?1:Number(n);if(!Number.isFinite(u)||u<=0)return i;let s=Math.min(12,Math.max(eL(t),eL(u))),m=t+Math.round((i-t)/u)*u;return Gm(Number(m.toFixed(s)),o,r)},au=e=>Number.isInteger(e)?String(e):String(Number(e.toFixed(12)));function Ww(e){return Array.isArray(e.value)}function Xm(e){return Ww(e)?(0,W.jsx)(Jv,{...e}):(0,W.jsx)(Jw,{...e})}function Jw({label:e,orientation:t="horizontal",value:a,min:n,max:l,exactValueBounds:o,step:r,formatValue:i=String,formatLimit:u=String,limitSide:s="right",onChange:m,className:c,disabled:p=!1,tabIndex:h,...v}){let S=(0,je.useRef)(null),L=(0,je.useRef)(null),x=(0,je.useRef)(null),g=(0,je.useRef)(!1),[y,b]=(0,je.useState)(!1),[M,A]=(0,je.useState)(()=>au(a)),[I,N]=(0,je.useState)("base"),T=l===n?n+1:l,w=Math.max(0,Math.min(100,(a-n)/(T-n)*100)),O=i(a),te=Math.max(1,Math.min(14,y?M.length||au(a).length:O.length)),se={"--nodedc-range-progress":`${w}%`,"--nodedc-range-editor-characters":te};(0,je.useLayoutEffect)(()=>A(au(a)),[a]),(0,je.useEffect)(()=>{y||A(au(a))},[y,a]),(0,je.useLayoutEffect)(()=>{let H=S.current,_t=x.current;if(!H||!_t)return;let rt=()=>{let oe=H.getBoundingClientRect(),Qt=_t.getBoundingClientRect(),vt=Number.parseFloat(getComputedStyle(_t).paddingRight)||0,ja=oe.left+oe.width*w/100,Ga=Qt.right-vt;N(ja>=Ga?"fill":"base")};rt();let Re=typeof ResizeObserver>"u"?null:new ResizeObserver(rt);return Re?.observe(H),()=>Re?.disconnect()},[te,w]);let et=(H,_t)=>{if(H){let rt=Number(M.trim().replace(",","."));Number.isFinite(rt)&&m(Qw(rt,n,l,r,o))}b(!1),_t&&requestAnimationFrame(()=>L.current?.focus())},de=H=>{H.stopPropagation(),H.key==="Enter"&&(H.preventDefault(),H.currentTarget.blur()),H.key==="Escape"&&(H.preventDefault(),g.current=!0,A(au(a)),b(!1),H.currentTarget.blur(),requestAnimationFrame(()=>L.current?.focus()))};return t==="vertical"?(0,W.jsxs)("div",{className:"nodedc-range-scale","data-limit-side":s,style:se,children:[(0,W.jsx)("div",{ref:S,className:B("nodedc-range",c),style:se,"data-orientation":"vertical",children:(0,W.jsx)("input",{ref:L,...v,type:"range",value:a,min:n,max:T,step:r,disabled:p,tabIndex:h,"aria-label":e,"aria-orientation":"vertical","aria-valuetext":O,onChange:H=>m(Number(H.target.value))})}),(0,W.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--max",children:u(Gm(a,n,T))}),(0,W.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--min",children:u(n)})]}):(0,W.jsxs)("div",{ref:S,className:B("nodedc-range",c),style:se,"data-editing":y||void 0,children:[(0,W.jsx)("input",{ref:L,...v,type:"range",value:a,min:n,max:T,step:r,disabled:p,tabIndex:y?-1:h,"aria-label":e,"aria-valuetext":O,onChange:H=>m(Number(H.target.value))}),(0,W.jsx)("span",{className:"nodedc-range__label",children:e}),(0,W.jsx)("span",{className:"nodedc-range__value",children:O}),(0,W.jsxs)("span",{className:"nodedc-range__fill-text","aria-hidden":"true",children:[(0,W.jsx)("span",{className:"nodedc-range__label",children:e}),(0,W.jsx)("span",{className:"nodedc-range__value",children:O})]}),(0,W.jsx)("input",{ref:x,className:"nodedc-range__editor",type:"text",inputMode:"decimal",value:M,"aria-label":`${e}: \u0442\u043E\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435`,disabled:p,spellCheck:!1,"data-active":y||void 0,"data-contrast":I,onFocus:()=>{y||b(!0)},onChange:H=>A(H.target.value),onKeyDown:de,onBlur:()=>{if(g.current){g.current=!1;return}et(!0,!1)}})]})}var e4=["#ff2f92","#ff6caf","#d746ff","#7a3cff","#4ea4ff","#35d7c1","#c3ff66","#ffffff","#404040","#111116"];function nu(e,t,a){return Math.max(t,Math.min(a,e))}function Vm(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let a=t[1];return[Number.parseInt(a.slice(0,2),16),Number.parseInt(a.slice(2,4),16),Number.parseInt(a.slice(4,6),16)]}function tL(e){let t=Vm(e);if(!t)return null;let[a,n,l]=t.map(s=>s/255),o=Math.max(a,n,l),r=Math.min(a,n,l),i=o-r,u=0;return i&&(o===a?u=60*((n-l)/i%6):o===n?u=60*((l-a)/i+2):u=60*((a-n)/i+4)),{h:(u+360)%360,s:o===0?0:i/o*100,v:o*100}}function ml({h:e,s:t,v:a}){let n=(e%360+360)%360,l=nu(t,0,100)/100,o=nu(a,0,100)/100,r=o*l,i=n/60%2,u=r*(1-Math.abs(i-1)),s=n<60?[r,u,0]:n<120?[u,r,0]:n<180?[0,r,u]:n<240?[0,u,r]:n<300?[u,0,r]:[r,0,u],m=o-r;return`#${s.map(c=>Math.round((c+m)*255).toString(16).padStart(2,"0")).join("")}`}function aL({value:e,onChange:t,label:a="\u0426\u0432\u0435\u0442",className:n,disabled:l=!1,onBlur:o,onKeyDown:r,...i}){let[u,s]=(0,je.useState)(e);(0,je.useEffect)(()=>s(e),[e]);let m=tL(e),[c,p]=(0,je.useState)(()=>m??{h:330,s:82,v:100}),h={"--nodedc-color-value":ml(m||c)};(0,je.useEffect)(()=>{m&&p(m)},[e,m?.h,m?.s,m?.v]);let v=L=>{let x={h:nu(L.h,0,360),s:nu(L.s,0,100),v:nu(L.v,0,100)};p(x),s(ml(x)),t(ml(x))},S=L=>{let x=L.currentTarget.getBoundingClientRect();v({...c,s:(L.clientX-x.left)/x.width*100,v:100-(L.clientY-x.top)/x.height*100})};return(0,W.jsxs)("div",{className:B("nodedc-color-field",n),style:h,children:[(0,W.jsx)(ha,{className:"nodedc-color-field__dropdown",placement:"bottom-start",minWidth:296,width:296,disabled:l,surfaceRole:"dialog",surfaceClassName:"nodedc-color-palette-surface",trigger:({open:L,toggle:x,setTriggerRef:g,surfaceId:y})=>(0,W.jsx)("button",{ref:g,type:"button",className:"nodedc-color-field__picker","aria-label":`\u0412\u044B\u0431\u0440\u0430\u0442\u044C ${a}`,"aria-haspopup":"dialog","aria-controls":y,"aria-expanded":L,"data-open":L?"true":void 0,disabled:l,onClick:x,children:(0,W.jsx)("span",{"aria-hidden":"true"})}),children:(0,W.jsxs)("div",{className:"nodedc-color-palette","aria-label":`\u041F\u0430\u043B\u0438\u0442\u0440\u0430: ${a}`,children:[(0,W.jsx)("div",{className:"nodedc-color-palette__spectrum",role:"slider",tabIndex:l?-1:0,"aria-label":`${a}: \u043D\u0430\u0441\u044B\u0449\u0435\u043D\u043D\u043E\u0441\u0442\u044C \u0438 \u044F\u0440\u043A\u043E\u0441\u0442\u044C`,"aria-valuetext":ml(c),style:{"--nodedc-color-hue":ml({h:c.h,s:100,v:100}),"--nodedc-color-s":`${c.s}%`,"--nodedc-color-v":`${100-c.v}%`},onPointerDown:L=>{l||(L.currentTarget.setPointerCapture(L.pointerId),S(L))},onPointerMove:L=>{L.currentTarget.hasPointerCapture(L.pointerId)&&S(L)},onPointerUp:L=>{L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId)},onKeyDown:L=>{let x=L.shiftKey?10:2;L.key==="ArrowLeft"&&(L.preventDefault(),v({...c,s:c.s-x})),L.key==="ArrowRight"&&(L.preventDefault(),v({...c,s:c.s+x})),L.key==="ArrowDown"&&(L.preventDefault(),v({...c,v:c.v-x})),L.key==="ArrowUp"&&(L.preventDefault(),v({...c,v:c.v+x}))},children:(0,W.jsx)("span",{className:"nodedc-color-palette__marker","aria-hidden":"true"})}),(0,W.jsxs)("label",{className:"nodedc-color-palette__hue",children:[(0,W.jsx)("span",{children:"\u041E\u0442\u0442\u0435\u043D\u043E\u043A"}),(0,W.jsx)("input",{type:"range",min:0,max:360,value:Math.round(c.h),"aria-label":`${a}: \u043E\u0442\u0442\u0435\u043D\u043E\u043A`,disabled:l,onChange:L=>v({...c,h:Number(L.target.value)})})]}),(0,W.jsx)("div",{className:"nodedc-color-palette__presets","aria-label":"\u0411\u044B\u0441\u0442\u0440\u044B\u0435 \u0446\u0432\u0435\u0442\u0430",children:e4.map(L=>(0,W.jsx)("button",{type:"button","aria-label":`\u0412\u044B\u0431\u0440\u0430\u0442\u044C ${L}`,"aria-pressed":ml(c).toLowerCase()===L,style:{"--nodedc-palette-swatch":L},onClick:()=>{let x=tL(L);x&&v(x)}},L))})]})}),(0,W.jsx)("input",{className:"nodedc-color-field__text",...i,value:u,"aria-label":`${a}: HEX`,disabled:l,spellCheck:!1,onChange:L=>{let x=L.target.value;s(x),Vm(x)&&t(`#${x.trim().replace(/^#/,"").toLowerCase()}`)},onBlur:L=>{s(Vm(u)?`#${u.trim().replace(/^#/,"").toLowerCase()}`:e),o?.(L)},onKeyDown:L=>{L.key==="Escape"&&(L.preventDefault(),L.stopPropagation(),s(e)),L.key==="Enter"&&(L.preventDefault(),L.currentTarget.blur()),r?.(L)}})]})}var nL=E(z(),1);var Km=E(z(),1),lL=E(q(),1);var aN=(0,lL.forwardRef)(function({active:t,className:a,type:n="button",...l},o){return(0,Km.jsx)("button",{...l,ref:o,type:n,className:B("nodedc-segmented__item",a),"data-active":t?"true":void 0})});var oL=E(z(),1);function rL({tone:e="neutral",variant:t="badge",pulse:a=!1,className:n,children:l,...o}){return(0,oL.jsx)("span",{className:B("nodedc-status",n),"data-tone":e==="neutral"?void 0:e,"data-variant":t==="indicator"?t:void 0,"data-pulse":a?"true":void 0,...o,children:t==="indicator"?null:l})}var ht=E(z(),1);function rd({eyebrow:e,title:t,description:a,actions:n,children:l,align:o="start",className:r,...i}){return(0,ht.jsxs)("section",{className:B("nodedc-settings-card",r),"data-align":o==="center"?"center":void 0,...i,children:[(0,ht.jsxs)("header",{className:"nodedc-settings-card__head",children:[(0,ht.jsxs)("div",{className:"nodedc-settings-card__titles",children:[e?(0,ht.jsx)("span",{children:e}):null,(0,ht.jsx)("h2",{children:t}),a?(0,ht.jsx)($y,{children:a}):null]}),n?(0,ht.jsx)("div",{className:"nodedc-settings-card__actions",children:n}):null]}),o==="center"&&(l==null||l===!1)?null:(0,ht.jsx)("div",{className:"nodedc-settings-card__body",children:l})]})}function Ym({checked:e,label:t,disabled:a=!1,onChange:n}){return(0,ht.jsxs)("button",{type:"button",className:"nodedc-switch",role:"switch","aria-checked":e,disabled:a,onClick:()=>n(!e),children:[(0,ht.jsx)("span",{className:"nodedc-switch__track","aria-hidden":"true",children:(0,ht.jsx)("span",{})}),(0,ht.jsx)("span",{children:t})]})}var $m=E(z(),1),Zm=E(q(),1);var uL=E(z(),1),id=E(q(),1);var iL=E(q(),1);var sL=E(z(),1),dL=E(q(),1),o4=E(Wt(),1);var ue=E(z(),1);function cL({displayName:e,variant:t="header",subtitle:a,avatarUrl:n,coverImageUrl:l,triggerLabel:o,triggerIcon:r,actions:i}){let u=e||"NODE.DC";return(0,ue.jsx)(ha,{placement:"bottom-end",width:296,offset:10,surfaceClassName:"nodedc-user-profile-menu",trigger:({open:s,toggle:m,setTriggerRef:c,setAnchorRef:p,surfaceId:h})=>t==="header"?(0,ue.jsxs)(jy,{ref:p,children:[(0,ue.jsx)(Gy,{"aria-haspopup":"menu","aria-expanded":s,"aria-controls":h,onClick:v=>{c(v.currentTarget),m()},children:o??"\u041F\u0440\u043E\u0444\u0438\u043B\u044C"}),(0,ue.jsx)(pt,{ref:c,label:`\u041C\u0435\u043D\u044E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${u}`,"aria-haspopup":"menu","aria-expanded":s,"aria-controls":h,onClick:v=>{c(v.currentTarget),m()},children:(0,ue.jsx)(ie,{name:r??"inbox",size:20,strokeWidth:1.7})}),(0,ue.jsx)("button",{type:"button",className:"nodedc-user-profile-menu__trigger","aria-label":`\u041F\u0440\u043E\u0444\u0438\u043B\u044C ${u}`,"aria-haspopup":"menu","aria-expanded":s,"aria-controls":h,onClick:v=>{c(v.currentTarget),m()},children:(0,ue.jsx)(Lo,{label:u,imageUrl:n})})]}):(0,ue.jsxs)("button",{ref:c,type:"button",className:"nodedc-user-profile-menu__trigger",title:u,"aria-label":`\u041C\u0435\u043D\u044E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${u}`,"aria-expanded":s,"aria-controls":h,onClick:m,children:[o===null?null:(0,ue.jsx)("span",{className:"nodedc-user-profile-menu__trigger-label",children:o??u}),r?(0,ue.jsx)(ie,{name:r,size:18}):null,(0,ue.jsx)(Lo,{label:u,imageUrl:n})]}),children:({close:s})=>(0,ue.jsxs)("div",{className:"nodedc-user-profile-card",children:[(0,ue.jsxs)("div",{className:"nodedc-user-profile-card__cover",style:l?{backgroundImage:`linear-gradient(180deg, rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.52)), url(${JSON.stringify(l)})`}:void 0,children:[(0,ue.jsx)(Lo,{label:u,imageUrl:n}),(0,ue.jsx)("strong",{children:u}),a?(0,ue.jsx)("span",{children:a}):null]}),(0,ue.jsx)("div",{className:"nodedc-user-profile-card__actions",children:i.map(m=>{let c=(0,ue.jsxs)(ue.Fragment,{children:[m.icon?(0,ue.jsx)(ie,{name:m.icon,size:16}):(0,ue.jsx)("span",{}),(0,ue.jsx)("span",{children:m.label})]});return m.href&&!m.disabled?(0,ue.jsx)("a",{className:"nodedc-user-profile-card__action","data-tone":m.tone==="danger"?"danger":void 0,href:m.href,onClick:()=>s(),children:c},m.id):(0,ue.jsx)("button",{type:"button",className:"nodedc-user-profile-card__action","data-tone":m.tone==="danger"?"danger":void 0,disabled:m.disabled,onClick:()=>{m.onSelect?.(),s()},children:c},m.id)})})]})})}var fL=E(z(),1),ud=E(q(),1);var mL=E(z(),1),Wm=E(q(),1);var Qm=E(z(),1),sd=E(q(),1);var jN=["image/png","image/jpeg","image/gif","image/webp","image/avif","video/mp4","video/webm","video/quicktime",".png",".jpg",".jpeg",".gif",".webp",".avif",".mp4",".webm",".mov"].join(",");var r4=E(z(),1),Jm=E(q(),1);var pL=E(z(),1);var hL=E(z(),1),gL=E(q(),1);var i4=(0,gL.forwardRef)(function({pressed:t=!1,label:a,children:n,className:l,type:o="button",disabled:r,...i},u){return(0,hL.jsx)("button",{...i,ref:u,type:o,disabled:r,"aria-label":a,title:a,"aria-pressed":t&&!r,className:B("nodedc-key-button",l),children:n})});var xL=E(z(),1),ep=E(q(),1);var yL=E(z(),1),u4=E(q(),1);var vL=E(z(),1),LL=E(q(),1);var s4=(0,LL.forwardRef)(function({className:t,...a},n){return(0,vL.jsx)(pa,{...a,ref:n,variant:"ghost",size:"dense",className:B("nodedc-scene-annotation",t)})});var bL=E(z(),1);var ga=E(q(),1),wL=E(pm(),1),IL=E(Wt(),1);function SL({root:e,navigationOpen:t=!1,activeView:a=null,contentExpanded:n=!0,onChange:l}={}){let o={navigationOpen:t||a!==null,activeView:a,contentOpen:a!==null,contentExpanded:n},r=i=>{o={...o,...i},o.contentOpen=o.activeView!==null,e?.toggleAttribute("data-navigation-open",o.navigationOpen),e?.toggleAttribute("data-content-open",o.contentOpen),e?.toggleAttribute("data-content-expanded",o.contentOpen&&o.contentExpanded),l?.({...o})};return r({}),{getState:()=>({...o}),openNavigation:()=>r({navigationOpen:!0}),toggleNavigation:()=>r({navigationOpen:!o.navigationOpen,activeView:o.navigationOpen?null:o.activeView}),closeNavigation:()=>r({navigationOpen:!1,activeView:null}),openView:i=>r({navigationOpen:!0,activeView:i,contentExpanded:!0}),closeView:()=>r({activeView:null}),setContentExpanded:i=>r({contentExpanded:i})}}var CL=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function tp({overlay:e,dialog:t,closeControls:a=[],closeOnBackdrop:n=!0,closeOnEscape:l=!0,lockBodyScroll:o=!0,onOpenChange:r}){let i=!1,u=null,s="",m=Array.from(a);e.classList.add("nodedc-overlay","nodedc-ui-root"),t.classList.add("nodedc-window"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.tabIndex=-1,e.hidden=!0;let c=()=>{(t.querySelector(CL)??t).focus()},p=()=>{i||(i=!0,u=document.activeElement instanceof HTMLElement?document.activeElement:null,s=document.body.style.overflow,o&&(document.body.style.overflow="hidden"),e.hidden=!1,requestAnimationFrame(c),r?.(!0))},h=()=>{i&&(i=!1,e.hidden=!0,o&&(document.body.style.overflow=s),u?.focus(),r?.(!1))},v=L=>{n&&L.target===e&&h()},S=L=>{if(!i)return;if(L.key==="Escape"&&l){L.preventDefault(),h();return}if(L.key!=="Tab")return;let x=Array.from(t.querySelectorAll(CL));if(x.length===0){L.preventDefault(),t.focus();return}let g=x[0],y=x[x.length-1];L.shiftKey&&document.activeElement===g?(L.preventDefault(),y.focus()):!L.shiftKey&&document.activeElement===y&&(L.preventDefault(),g.focus())};return e.addEventListener("pointerdown",v),document.addEventListener("keydown",S),m.forEach(L=>L.addEventListener("click",h)),{open:p,close:h,isOpen:()=>i,destroy:()=>{h(),e.removeEventListener("pointerdown",v),document.removeEventListener("keydown",S),m.forEach(L=>L.removeEventListener("click",h))}}}var Bt=ga.default.createElement,ap="dc-cms.ui-preferences.v1",lp={theme:"dark",accent:"#ffffff"};function kL(e){return{theme:e?.theme==="light"?"light":"dark",accent:/^#[\da-f]{6}$/i.test(e?.accent||"")?e.accent.toLowerCase():lp.accent}}function EL(){try{return kL(JSON.parse(localStorage.getItem(ap)))}catch{return{...lp}}}function np(e){let t=e.accent.match(/[\da-f]{2}/gi).map(a=>parseInt(a,16));Nm(document.documentElement,{theme:e.theme,accent:t,edges:"flat"})}function d4({initial:e}){let[t,a]=(0,ga.useState)(e),[n,l]=(0,ga.useState)(!1),[o,r]=(0,ga.useState)(null),[i,u]=(0,ga.useState)(!1);(0,ga.useEffect)(()=>{let h=new AbortController;fetch("/api/me",{credentials:"same-origin",signal:h.signal}).then(S=>S.ok?S.json():null).then(r).catch(()=>{});let v=S=>{if(S.key===ap||S.key===null){let L=EL();np(L),a(L)}};return window.addEventListener("storage",v),()=>{h.abort(),window.removeEventListener("storage",v)}},[]);function s(h){let v=kL({...t,...h});np(v),a(v);try{localStorage.setItem(ap,JSON.stringify(v)),u(!1)}catch{u(!0)}}let m=o?.user,c=m?.name||m?.username||"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",p=[{id:"appearance",label:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430",icon:"settings",onSelect:()=>l(!0)}];return o?.authEnabled&&p.push({id:"logout",label:"\u0412\u044B\u0439\u0442\u0438",icon:"external",href:"/auth/logout"}),Bt(ga.default.Fragment,null,Bt(cL,{displayName:c,subtitle:m?.email||void 0,avatarUrl:m?.picture||void 0,triggerLabel:"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",triggerIcon:"inbox",actions:p}),Bt(Fm,{open:n,title:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438",subtitle:"\u0418\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 CMS",identity:{title:c,subtitle:"NODE.DC CMS",avatarLabel:c,avatarUrl:m?.picture||void 0},sections:[{id:"appearance",label:"\u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435",icon:"settings",group:"\u041E\u0431\u0449\u0438\u0435"}],activeSection:"appearance",onSectionChange:()=>{},onClose:()=>l(!1),footer:Bt(pa,{onClick:()=>s(lp),tone:"neutral"},"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435")},Bt("div",{className:"cms-preferences-fields"},Bt(rd,{title:"\u0422\u0435\u043C\u0430",description:"\u0421\u0432\u0435\u0442\u043B\u044B\u0439 \u0438\u043B\u0438 \u0442\u0451\u043C\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441",actions:Bt("div",{className:"cms-preference-controls"},Bt(cl,{label:"\u0422\u0435\u043C\u0430 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430",value:t.theme,options:[{value:"dark",label:"\u0422\u0451\u043C\u043D\u0430\u044F"},{value:"light",label:"\u0421\u0432\u0435\u0442\u043B\u0430\u044F"}],onChange:h=>s({theme:h})}))}),Bt(rd,{title:"\u0410\u043A\u0446\u0435\u043D\u0442\u043D\u044B\u0439 \u0446\u0432\u0435\u0442",description:"\u0426\u0432\u0435\u0442 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",actions:Bt("div",{className:"cms-preference-controls"},Bt(aL,{label:"\u0410\u043A\u0446\u0435\u043D\u0442\u043D\u044B\u0439 \u0446\u0432\u0435\u0442",value:t.accent,onChange:h=>s({accent:h})}))})),Bt("p",{className:"nodedc-description",role:"status"},i?"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044E\u0442 \u0432 \u044D\u0442\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u043D\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043B \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438\u0445 \u0434\u043B\u044F \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E \u0432\u0445\u043E\u0434\u0430.":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u044E\u0442\u0441\u044F \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.")))}function ML(){let e=EL();np(e),(0,IL.flushSync)(()=>(0,wL.createRoot)(document.querySelector("#cms-profile")).render(Bt(d4,{initial:e})))}var qe=AL.default.createElement,R=(e,t=document)=>t.querySelector(e),ve=(e,t=document)=>[...t.querySelectorAll(e)],Nn=e=>R(`#ds-${e}`).content.firstElementChild.cloneNode(!0);function Ge(e,t){e&&e.classList.add(...t.split(" "))}var ou=new Map,lu=[],op=!1,rp,c4=0,dd;function Tn(){op||(op=!0,queueMicrotask(()=>{op=!1,ip()}))}function pl(e){let t=ou.get(e);if(!t){let a=document.createElement("span");a.className="cms-ui-island",e.after(a),e.hidden=!0,e.tabIndex=-1,e.setAttribute("aria-hidden","true"),t={host:a,root:(0,DL.createRoot)(a),signature:""},ou.set(e,t)}return t}function f4(){for(let e of ve("select")){let t=pl(e),a=[...e.options].map(r=>({value:r.value,label:e.id==="site-selector"?r.textContent.replace(/^NODE\.?DC\s*[—–-]\s*/i,""):r.textContent,disabled:r.disabled})),n=e.getAttribute("aria-label")||e.closest("label")?.querySelector(".nodedc-field__label")?.textContent||"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",l=JSON.stringify([e.value,a,e.disabled,n]);if(l===t.signature)continue;t.signature=l,(0,Rn.flushSync)(()=>t.root.render(qe(cl,{variant:e.id==="site-selector"?"split":"integrated",shape:e.id==="site-selector"?"pill":"default",value:e.value,options:a,label:n,disabled:e.disabled,onChange:r=>{e.value=r,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),Tn()}}))),e.id&&e.closest("label")?.setAttribute("for",e.id+"-trigger");let o=R("button",t.host);o&&e.id&&(o.id=e.id+"-trigger")}}function m4(){for(let e of ve("input[type=checkbox]")){let t=e.closest("label")||e.parentElement,a=ou.get(e);if(!a){let l=t.querySelector(".field-label-text")?.textContent||[...t.childNodes].filter(o=>o!==e).map(o=>o.textContent).join(" ").trim()||e.getAttribute("aria-label")||"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E";a=pl(e),a.label=l.replace(/\s+/g," ").trim();for(let o of[...t.childNodes])o!==e&&o!==a.host&&!(o.nodeType===1&&o.matches("input,select,textarea"))&&(o.nodeType===1?o.hidden=!0:o.nodeType===3&&(o.textContent=""));t.classList.contains("link-mode-row")||t.classList.add("cms-switch-binding");for(let o of ve("input:not([type=checkbox])",t))o.setAttribute("aria-label",a.label);t.addEventListener("click",o=>{o.target.closest("button")&&o.preventDefault()})}let n=JSON.stringify([e.checked,e.disabled]);n!==a.signature&&(a.signature=n,(0,Rn.flushSync)(()=>a.root.render(qe(Ym,{checked:e.checked,disabled:e.disabled,label:a.label,onChange:l=>{e.checked=l,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),Tn()}}))))}}function p4(){for(let e of ve("input[type=range]")){if(e.closest(".cms-ui-island,.nodedc-color-palette-surface"))continue;let t=pl(e),a=e.closest(".range-field"),n=a?.querySelector(".range-value");n&&(n.hidden=!0);let l=a?.querySelector(".field-label-text")?.textContent||"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",o=JSON.stringify([e.value,e.min,e.max,e.step,e.disabled]);if(o===t.signature)continue;t.signature=o;let r=Number(e.min),i=Number(e.max);(0,Rn.flushSync)(()=>t.root.render(qe(Xm,{label:l,value:Number(e.value),min:r,max:i,step:e.step,exactValueBounds:{min:r,max:i},disabled:e.disabled,onChange:u=>{e.value=String(u),e.dispatchEvent(new Event("input",{bubbles:!0})),Tn()}})))}}function h4(){for(let e of ve(".publish-progress-track")){let t=pl(e),a=Number(e.getAttribute("aria-valuenow")||0);t.signature!==String(a)&&(t.signature=String(a),(0,Rn.flushSync)(()=>t.root.render(qe(Ji,{label:"\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441 \u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0446\u0438\u0438",value:a/100}))))}}function g4(){for(let e of ve(".field-control:not(.boolean-field):not(.service-media-field),.json-field,.media-search,.site-dialog label")){if(e.dataset.dsField)continue;e.dataset.dsField="true",Ge(e,"nodedc-field");let t=R(":scope > .field-label-row",e),a=t?.querySelector(".field-label-text")||R(":scope > span:not(.field-kind):not(.field-path):not(.field-hint)",e);if(!t){if(t=Nn("field").querySelector(".nodedc-field__label-row"),a)t.querySelector(".nodedc-field__label").replaceWith(a);else{a=t.querySelector(".nodedc-field__label"),a.textContent=[...e.childNodes].filter(l=>l.nodeType===3).map(l=>l.textContent).join(" ").trim();for(let l of[...e.childNodes])l.nodeType===3&&(l.textContent="")}e.prepend(t)}Ge(t,"nodedc-field__label-row"),Ge(a||R(".field-label-text",t),"nodedc-field__label");let n=R("input:not([type=hidden]):not([type=checkbox]),textarea,select",e);n&&!n.id&&(n.id="cms-field-"+ ++c4),n&&e.tagName==="LABEL"&&(e.htmlFor=n.id);for(let l of ve(".field-hint,.group-desc",e))Ge(l,"nodedc-field__description")}for(let e of ve("input:not([type=hidden]):not([type=checkbox]):not([type=file]):not([type=range]),textarea"))e.closest(".cms-ui-island")||Ge(e,"nodedc-field__control")}function x4(){for(let e of ve(".collection-item-card,.json-details")){if(e.dataset.dsSurface)continue;let t=Nn("nestedSurface");for(let a of t.attributes)a.name==="class"?Ge(e,a.value):e.setAttribute(a.name,a.value);e.dataset.dsSurface="true"}for(let e of ve(".settings-card,.content-group,.content-panel")){if(e.dataset.dsCard)continue;e.dataset.dsCard="true",Ge(e,"nodedc-settings-card");let t=R(":scope > .card-head,:scope > .group-head,:scope > .panel-head,:scope > .publish-progress-head",e),a=Nn("card"),n=R(".nodedc-settings-card__head",a),l=R(".nodedc-settings-card__titles",a),o=R(".nodedc-settings-card__body",a);if(n.replaceChildren(l),l.replaceChildren(),o.replaceChildren(),t){let r=R("h3,h2",t)||t,i=R(".section-kicker",t);if(i&&l.append(i),r?.hasAttribute("data-publish-title"))l.append(r);else if(r===t){let s=document.createElement("h2");for(let m of[...r.childNodes])(m.nodeType===3||m.nodeType===1&&!m.matches("label,button"))&&s.append(m);l.append(s);for(let m of[...r.children])n.append(m)}else if(r){let s=document.createElement("h2");for(let m of r.attributes)s.setAttribute(m.name,m.value);s.append(...r.childNodes),l.append(s)}let u=R(".project-settings-hint,.panel-note,.group-desc",t)||R(":scope > .group-desc",e);if(u){let s=document.createElement("p");for(let m of u.attributes)s.setAttribute(m.name,m.value);s.classList.add("nodedc-description"),s.append(...u.childNodes),u.remove(),l.append(s)}for(let s of ve(":scope > .toggle-row,:scope > .button-row,:scope > .group-head-toggle,:scope > [data-publish-percent]",t))n.append(s);t.remove()}else n.remove();o.append(...e.childNodes),e.append(...a.childNodes)}}var y4={"move-up":"chevron-up","move-down":"chevron-down",duplicate:"copy",copy:"copy","paste-after":"clipboard","delete-block":"trash","template-modal-close":"close","media-modal-close":"close","media-trash-toggle":"trash","media-delete":"trash"};function v4(){for(let e of ve("button")){if(e.closest(".cms-ui-island,.nodedc-color-palette-surface")||e.className.includes("nodedc-")||e.matches(".media-entry,.knowledge-tree-select,.service-media-source-button,.service-media-file-button,.media-breadcrumb-button,.template-card"))continue;let t=e.matches(".icon-action-btn,.collection-icon-btn,.knowledge-tree-action,.secret-toggle-button,.collection-drag-handle,.modal-close-button,.media-header-action"),a=Nn(t?"iconButton":"button");if(Ge(e,a.className),t){let n=e.getAttribute("aria-label")||e.title||e.textContent;e.setAttribute("aria-label",n),e.title=n;let l=y4[e.id]||(e.classList.contains("secret-toggle-button")?"eye":/удал/i.test(n)?"trash":/добав/i.test(n)?"plus":/выше|вверх|поднять/i.test(n)?"chevron-up":/ниже|вниз|опустить/i.test(n)?"chevron-down":/коп|дублир/i.test(n)?"copy":"move");e.replaceChildren(e.matches(".collection-drag-handle")?Nn("dragHandle").firstElementChild:Nn("icon-"+l))}else{e.dataset.variant=e.matches(".primary-btn,[type=submit]")?"primary":e.matches(".danger-btn")?"danger":"secondary",e.dataset.tone="neutral";let n=a.firstElementChild;n.replaceChildren(...e.childNodes),e.append(n)}}}function L4(){for(let e of ve(".block-btn,.knowledge-tree-select")){Ge(e,"nodedc-admin-panel__nav-item"),e.dataset.active=String(e.classList.contains("active")||e.closest(".knowledge-tree-row")?.dataset.active==="true");let t=R(".block-name,.knowledge-tree-title",e);t&&(e.title=t.textContent);let a=R(".block-icon,.knowledge-tree-icon",e);a&&!a.dataset.dsIcon&&(a.dataset.dsIcon="true",Ge(a,"nodedc-admin-panel__nav-icon"),a.replaceChildren(Nn("icon-"+(e.classList.contains("knowledge-tree-select")?"file":"layers"))));let n=R(".block-drag-handle",e);n&&(Ge(n,"nodedc-drag-handle"),n.dataset.dsIcon||(n.dataset.dsIcon="true",n.replaceChildren(Nn("dragHandle").firstElementChild)))}for(let e of ve(".region-title"))Ge(e,"nodedc-admin-panel__group-label")}function b4(){for(let e of ve(".knowledge-tree-actions")){let t=ve(":scope > button",e);if(t.length<2)continue;let a=pl(e),n=e.closest(".knowledge-tree-row")?.querySelector(".knowledge-tree-title")?.textContent||"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B",l=t.map(r=>({label:r.title||r.getAttribute("aria-label"),disabled:r.disabled})),o=JSON.stringify([n,l]);o!==a.signature&&(a.signature=o,(0,Rn.flushSync)(()=>a.root.render(qe(ha,{minWidth:240,placement:"bottom-end",trigger:r=>qe(pt,{label:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F: "+n,ref:i=>{r.setAnchorRef(i),r.setTriggerRef(i)},onClick:r.toggle,"aria-expanded":r.open,"aria-controls":r.surfaceId,"aria-haspopup":"menu"},qe(ie,{name:"chevron-down"}))},({close:r})=>t.map((i,u)=>qe("button",{key:u,type:"button",role:"menuitem",className:"nodedc-dropdown-option",disabled:i.disabled,onClick:()=>{r(),i.click()}},qe("span",null),qe("span",{className:"nodedc-dropdown-option__body"},qe("span",{className:"nodedc-dropdown-option__label"},l[u].label))))))))}}function S4(){let e=matchMedia("(max-width:760px)").matches,t=R("#dirty-state"),a=pl(t),n=t.dataset.dirty==="true"?"warning":"neutral",l=t.textContent,o=JSON.stringify([n,l,e]);a.signature!==o&&(a.signature=o,(0,Rn.flushSync)(()=>a.root.render(qe(rL,{tone:n,variant:e?"indicator":"badge",title:l,"aria-label":l,role:"status"},e?null:l))));let r=R("#cms-mobile-actions-binding");r||(r=document.createElement("span"),r.id="cms-mobile-actions-binding",R(".cms-editor-actions").append(r));let i=pl(r),u=["reload","render","publish"].map(c=>R("#"+c));for(let c of u)c.hidden=e;if(i.host.hidden=!e,!e)return;let s=u.filter(c=>!c.classList.contains("hidden")).map(c=>({button:c,label:c.id==="reload"?"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435":c.textContent,disabled:c.disabled})),m=JSON.stringify(s.map(({label:c,disabled:p})=>[c,p]));i.signature!==m&&(i.signature=m,(0,Rn.flushSync)(()=>i.root.render(qe(ha,{minWidth:240,placement:"bottom-end",trigger:c=>qe(pt,{label:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441 \u0441\u0430\u0439\u0442\u043E\u043C",ref:p=>{c.setAnchorRef(p),c.setTriggerRef(p)},onClick:c.toggle,"aria-expanded":c.open,"aria-controls":c.surfaceId,"aria-haspopup":"menu"},qe(ie,{name:"chevron-down"}))},({close:c})=>s.map(({button:p,label:h,disabled:v})=>qe("button",{key:p.id,type:"button",role:"menuitem",className:"nodedc-dropdown-option",disabled:v,onClick:()=>{c(),p.click()}},qe("span",null),qe("span",{className:"nodedc-dropdown-option__body"},qe("span",{className:"nodedc-dropdown-option__label"},h))))))))}function C4(){let e={".service-media-field":"nodedc-media-field",".field-label-row":"nodedc-media-field__label-row",".field-label-text":"nodedc-media-field__label",".service-media-control":"nodedc-media-control",".service-media-file-control":"nodedc-media-file",".service-media-file-button":"nodedc-media-file__button",".service-media-file-name":"nodedc-media-file__name",".service-media-url-input":"nodedc-media-url",".service-media-source-switch":"nodedc-media-source-switch",".service-media-source-button":"nodedc-media-source-button",".service-media-preview":"nodedc-media-preview",".media-upload-hint":"nodedc-media-field__hint",".media-upload-error":"nodedc-media-field__error"};for(let t of ve(".service-media-field")){for(let[n,l]of Object.entries(e))for(let o of t.matches(n)?[t]:ve(n,t))Ge(o,l);for(let n of ve(".service-media-source-button",t))n.setAttribute("aria-pressed",n.dataset.active);let a=R(".service-media-control",t);a&&(a.dataset.source=R(".service-media-url-input",t).hidden?"file":"url")}}function w4(){for(let e of ve(".template-modal-layer")){let t=R(":scope > article",e),a=R(":scope > header",t),n=R(":scope > footer",t),l=document.createElement("div");l.className="nodedc-window__body";for(let i of[...t.children])i!==a&&i!==n&&l.append(i);a&&(Ge(a,"nodedc-window__head"),Ge(R("h2",a),"nodedc-window__title")),n&&Ge(n,"nodedc-window__footer"),t.replaceChildren(...[a,l,n].filter(Boolean)),t.dataset.size=e.id==="media-modal"||e.id==="template-modal"?"lg":"sm",Ge(t,"nodedc-glass nodedc-material-rim"),t.dataset.tone="strong";let o=e.getAttribute("aria-labelledby");o&&t.setAttribute("aria-labelledby",o),e.removeAttribute("role"),e.removeAttribute("aria-modal");let r=tp({overlay:e,dialog:t,closeOnBackdrop:!1,closeOnEscape:!1,lockBodyScroll:!1});lu.push({overlay:e,dialog:t,controller:r})}for(let e of ve("dialog.site-dialog")){let t=document.createElement("div");t.className="hidden",e.before(t),t.append(e),e.setAttribute("open",""),e.dataset.size="sm",Ge(e,"nodedc-glass nodedc-material-rim"),e.dataset.tone="strong";let a=R("form",e),n=document.createElement("header"),l=document.createElement("div"),o=R(".site-dialog-actions",a);n.className="nodedc-window__head",l.className="nodedc-window__body";let r=document.createElement("div");r.className="nodedc-window__titles",n.append(r);let i=R("h2",a);i.id=e.id+"-title",e.setAttribute("aria-labelledby",i.id),i.className="nodedc-window__title",r.append(i),l.append(...[...a.childNodes].filter(m=>m!==o)),o.classList.add("nodedc-window__footer"),a.replaceChildren(n,l,o);let u,s=tp({overlay:t,dialog:e,closeOnEscape:!0,lockBodyScroll:!1,onOpenChange:m=>{t.classList.toggle("hidden",!m),m||requestAnimationFrame(()=>u?.focus())}});e.showModal=()=>{u=document.activeElement,document.body.append(t),t.classList.remove("hidden"),s.open()},e.close=()=>{t.classList.add("hidden"),s.close()},lu.push({overlay:t,dialog:e,controller:s})}}function ip(){rp?.disconnect();try{for(let[n,l]of ou)n.isConnected||(l.root.unmount(),l.host.remove(),ou.delete(n));x4(),g4(),m4(),f4(),p4(),h4(),v4(),L4(),b4(),S4(),C4(),R("#cms-shell").inert=!1;for(let n of lu)n.dialog.inert=!1;for(let n of lu){let l=!n.overlay.classList.contains("hidden");l&&!n.controller.isOpen()?(document.body.append(n.overlay),n.controller.open()):!l&&n.controller.isOpen()&&n.controller.close()}let e=ve(".nodedc-overlay:not(.hidden):not([hidden])").at(-1);R("#cms-shell").inert=!!e;for(let n of lu)n.dialog.inert=!!(e&&n.overlay!==e);R("#delete-modal-body").textContent==="\u0412\u044B \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430?"&&(R("#delete-modal-body").textContent="\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442?"),R("#delete-modal-confirm").textContent.trim()==="\u0414\u0430"&&(R("#delete-modal-confirm").textContent="\u0423\u0434\u0430\u043B\u0438\u0442\u044C");let t=R("#regions > section:first-child .block-btn");if(t){let n=t.closest(".cms-static-row");n||(n=document.createElement("div"),n.className="cms-static-row",t.before(n),n.append(t)),n.append(dd)}else dd&&R("#cms-add-block-parking").append(dd);let a=R("#dirty-state");a.dataset.tone=a.dataset.dirty==="true"?"warning":"neutral";for(let n of ve(".nodedc-header__nav-item"))n.dataset.active==="true"?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current")}finally{rp?.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","disabled","data-dirty","data-active","hidden","aria-valuenow"]})}}function TL(){ML(),dd=R("#add-block");for(let a of ve("[data-cms-mode]"))a.closest("button").id="admin-mode-"+a.dataset.cmsMode;R(".nodedc-header-navigation").classList.add("nodedc-expanded-nav-group"),R(".nodedc-admin-panel__nav").id="regions",R(".nodedc-application-panel__titles h1").id="selected-title",R(".nodedc-application-panel__titles p").id="selected-region",R("#status").setAttribute("role","status"),R("#status").setAttribute("aria-live","polite");let e=R("#cms-shell"),t=SL({navigationOpen:!0,activeView:"cms",contentExpanded:!0,onChange:a=>{R(".cms-stage").hidden=a.navigationOpen||a.contentOpen,e.dataset.navigationOpen=String(a.navigationOpen),e.dataset.contentOpen=String(a.contentOpen),e.dataset.contentExpanded=String(a.contentExpanded),R(".nodedc-app-shell__navigation").hidden=!a.navigationOpen,R(".nodedc-app-shell__navigation").inert=matchMedia("(max-width:760px)").matches&&a.contentOpen,R(".nodedc-app-shell__content").hidden=!a.contentOpen}});matchMedia("(max-width:760px)").addEventListener("change",a=>{R(".nodedc-app-shell__navigation").inert=a.matches&&t.getState().contentOpen,Tn()}),R("#toggle-navigation").onclick=()=>{matchMedia("(max-width:760px)").matches&&t.getState().contentOpen&&t.closeView(),t.openNavigation()},R("#open-navigation").onclick=()=>t.openNavigation(),R(".nodedc-admin-panel__close").onclick=()=>t.closeNavigation(),R(".nodedc-application-panel [data-action=close]").onclick=()=>{t.closeView(),t.openNavigation()},document.addEventListener("click",a=>{a.target.closest(".block-btn,.knowledge-tree-select,#project-settings,#admin-mode-content,#admin-mode-seo,#admin-mode-knowledge")&&(t.openView("cms"),queueMicrotask(()=>R(".nodedc-application-panel__body").scrollTop=0)),Tn()}),document.addEventListener("input",Tn),document.addEventListener("change",Tn),w4(),ip(),rp=new MutationObserver(Tn),ip()}TL();await Promise.resolve().then(()=>(nS(),BI)); + */var Tw={"add-point":bn,perspective:Yr,orthographic:Hi,select:ki,move:Ei,pen:Di,rectangle:Oi,curve:Vi,undo:$i,redo:_i,activity:Kr,alert:kn,apps:$r,building:Zr,camera:Qr,check:Wr,"chevron-down":Jr,"chevron-up":ai,"chevron-left":ei,"chevron-right":ti,circle:ni,clipboard:li,close:Qi,copy:oi,database:ri,download:ii,edit:Ti,eye:di,"eye-off":si,expand:Ci,external:ui,file:ci,folder:fi,globe:wn,grid:xi,image:mi,inbox:pi,info:hi,key:gi,layers:In,list:yi,target:vi,lock:Li,mail:bi,minimize:wi,network:Mi,panel:Ai,plan:Si,play:Ni,power:Bi,plus:Ri,minus:Ii,profile:Sn,refresh:zi,"rotate-clockwise":qi,save:Ui,search:Pi,settings:Fi,shield:ji,sliders:Gi,stop:Xi,terminal:Ki,trash:Yi,upload:Cn,users:En,video:Zi};function ie({name:e,label:t,size:a=16,strokeWidth:n=1.6,fill:l,...o}){let r=Tw[e],i=e==="play"||e==="stop";return(0,xv.jsx)(r,{size:a,strokeWidth:i?0:n,fill:l??(i?"currentColor":"none"),"aria-hidden":t?void 0:"true","aria-label":t,role:t?"img":void 0,focusable:"false",...o})}var vv=E(z(),1);var Dm=E(z(),1),sl=E(q(),1),Rw=E(Wt(),1),UA=(0,sl.createContext)(null);var Lv=E(z(),1);var bv=E(q(),1);var ma=E(z(),1),Bm=E(q(),1);function Cv(e){return Math.max(0,Math.min(255,Math.round(e)))}function Bw(e){let t=Cv(e)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Ow(e){let[t,a,n]=e.map(Bw);return t*.2126+a*.7152+n*.0722}function wv(e){return Ow(e)>.46?[11,17,23]:[247,248,244]}function Sv(e){return e.map(Cv).join(" ")}function Wi(e){return{"--nodedc-accent-rgb":Sv(e),"--nodedc-on-accent-rgb":Sv(wv(e))}}function Tm({anchor:e,surfaceWidth:t,surfaceHeight:a,placement:n="bottom-start",offset:l=8,flip:o=!0,viewportWidth:r=typeof window>"u"?1920:window.innerWidth,viewportHeight:i=typeof window>"u"?1080:window.innerHeight,viewportPadding:u=8}){let s=Math.max(0,i-u*2);if(n.startsWith("left")||n.startsWith("right")){let A=Math.max(0,e.left-l-u),I=Math.max(0,r-e.right-l-u),N=n.startsWith("left"),w=o&&(N?t>A&&I>A:t>I&&A>I)?!N:N,O=w?A:I,te=Math.min(t,O),se=Math.min(a,s);return{left:w?e.left-l-te:e.right+l,top:Math.max(u,Math.min(e.top,i-u-se)),maxHeight:s,maxWidth:O,resolvedPlacement:w?"left-start":"right-start"}}let m=Math.min(s,Math.max(0,i-e.bottom-l-u)),c=Math.min(s,Math.max(0,e.top-l-u)),p=n.startsWith("top"),v=o&&(p?a>c&&m>c:a>m&&c>m)?`${p?"bottom":"top"}-${n.endsWith("end")?"end":"start"}`:n,S=v.endsWith("end")?e.right-t:e.left,L=Math.min(Math.max(u,S),Math.max(u,r-t-u)),x=v.startsWith("top")?c:m,g=Math.min(s,Math.max(Math.min(96,s),x)),y=Math.min(a,g),b=v.startsWith("top")?e.top-l-y:e.bottom+l;return{top:Math.min(Math.max(u,b),Math.max(u,i-y-u)),left:L,maxHeight:g,resolvedPlacement:v}}function Iv([e,t,a]){return`${e} ${t} ${a}`}function ed(e){return Math.max(0,Math.min(1,e))}function Nm(e,{theme:t="dark",accent:a,material:n,appearance:l="default",edges:o="default"}={}){if(e.dataset.nodedcTheme=t,e.dataset.nodedcAppearance=l,e.dataset.nodedcEdges=o,e.dataset.nodedcUi="true",a){let r=Wi(a);Object.entries(r).forEach(([i,u])=>{e.style.setProperty(i,u)})}if(n){if(n.panel&&e.style.setProperty("--nodedc-panel-material-rgb",Iv(n.panel)),typeof n.panelOpacity=="number"&&Number.isFinite(n.panelOpacity)){let r=ed(n.panelOpacity);e.style.setProperty("--nodedc-panel-material-opacity",String(r)),e.style.setProperty("--nodedc-panel-material-strong-opacity",String(ed(r+.12))),e.style.setProperty("--nodedc-panel-material-soft-opacity",String(ed(Math.max(.12,r-.2))))}n.field&&e.style.setProperty("--nodedc-field-material-rgb",Iv(n.field)),typeof n.fieldOpacity=="number"&&Number.isFinite(n.fieldOpacity)&&e.style.setProperty("--nodedc-field-material-opacity",String(ed(n.fieldOpacity)))}}var kv=Object.freeze({background:"#111115",border:"#111117",outline:"#1c1c1c",minSize:25,maxSize:87,lensCount:5,gap:10,padding:6,hideDelay:5e3}),tD=Object.freeze({mass:.1,stiffness:170,damping:12,maxStep:1/240});var pa=(0,Bm.forwardRef)(function({variant:t="secondary",tone:a="theme",size:n="default",width:l="auto",shape:o="default",accent:r,icon:i,className:u,children:s,style:m,type:c="button",loading:p=!1,disabled:h,...v},S){let L=r?Wi(r):void 0;return(0,ma.jsxs)("button",{ref:S,type:c,className:B("nodedc-button",u),"data-variant":t,"data-tone":a==="theme"?void 0:a,"data-size":n==="default"?void 0:n,"data-width":l==="auto"?void 0:l,"data-shape":o==="default"?void 0:o,style:L?{...L,...m}:m,...v,disabled:h||p,"aria-busy":p||v["aria-busy"],"data-loading":p||void 0,children:[(0,ma.jsxs)("span",{className:"nodedc-button__content",children:[i?(0,ma.jsx)("span",{className:"nodedc-button__icon","aria-hidden":"true",children:i}):null,s]}),p?(0,ma.jsx)("span",{className:"nodedc-action-loading","aria-hidden":"true",children:(0,ma.jsx)(Ys,{size:"compact"})}):null]})}),pt=(0,Bm.forwardRef)(function({label:t,shape:a="circle",className:n,children:l,type:o="button",loading:r=!1,disabled:i,...u},s){return(0,ma.jsxs)("button",{ref:s,type:o,className:B("nodedc-icon-button",n),"data-shape":a==="circle"?void 0:a,"aria-label":t,title:t,...u,disabled:i||r,"aria-busy":r||u["aria-busy"],"data-loading":r||void 0,children:[l,r?(0,ma.jsx)("span",{className:"nodedc-action-loading","aria-hidden":"true",children:(0,ma.jsx)(Ys,{size:"compact"})}):null]})});var _m=E(z(),1),Uw=E(q(),1);var Om=E(z(),1);function Ji({label:e,value:t,valueText:a,className:n,style:l,...o}){let r=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):void 0;return(0,Om.jsx)("div",{...o,className:B("nodedc-progress-bar",n),role:"progressbar","aria-label":e,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r===void 0?void 0:Math.round(r*100),"aria-valuetext":a,"data-indeterminate":r===void 0||void 0,style:{...l,"--nodedc-progress-fraction":r??0},children:(0,Om.jsx)("span",{className:"nodedc-progress-bar__fill"})})}var Dv=E(z(),1);var Um=E(z(),1),Hm=E(q(),1);var ze=E(z(),1),le=E(q(),1),Bv=E(Wt(),1);var Tv=E(q(),1),Io=(0,Tv.createContext)(!1);var Nv=E(q(),1),zm=(0,Nv.createContext)(null);var qm=["n","s","e","w","ne","nw","se","sw"],Mn=(e,t,a)=>Math.max(t,Math.min(a,e));function An(e,t){let a=Mn(e.width,Math.min(320,t.width-16),Math.max(1,t.width-16)),n=Mn(e.height,Math.min(200,t.height-16),Math.max(1,t.height-16));return{width:a,height:n,left:Mn(e.left,8,Math.max(8,t.width-a-8)),top:Mn(e.top,8,Math.max(8,t.height-n-8))}}function td(e,t,a,n,l){let o=An(e,l),r=o.left+o.width,i=o.top+o.height,u=Math.min(320,l.width-16),s=Math.min(200,l.height-16),m=t.includes("w")?Mn(o.left+a,8,r-u):o.left,c=t.includes("n")?Mn(o.top+n,8,i-s):o.top,p=t.includes("e")?Mn(r+a,m+u,l.width-8):r,h=t.includes("s")?Mn(i+n,c+s,l.height-8):i;return{left:m,top:c,width:p-m,height:h-c}}var Rv=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function ad({open:e,title:t,subtitle:a,children:n,footer:l,headerActions:o,size:r="md",placement:i="center",closeLabel:u="\u0417\u0430\u043A\u0440\u044B\u0442\u044C",closeOnBackdrop:s,closeOnEscape:m=!0,lockBodyScroll:c,trapFocus:p,draggable:h=!1,resizable:v=!1,initialRect:S,rect:L,onRectCommit:x,allowFloating:g=!0,onClose:y,className:b,style:M,...A}){let[I,N]=(0,le.useState)(0),T=(0,le.useCallback)(()=>(N(_=>_+1),()=>N(_=>Math.max(0,_-1))),[]),w=I>0,O=(0,le.useId)(),te=(0,le.useId)(),se=(0,le.useRef)(null),et=(0,le.useRef)(y),de=(0,le.useRef)(null),[H,_t]=(0,le.useState)(null),[rt,Re]=(0,le.useState)(!1),[oe,Qt]=(0,le.useState)(null),vt=(0,le.useRef)(null),ja=(0,le.useRef)(null),Ga=(0,le.useRef)(x);Ga.current=x;let Un=_=>{vt.current=_,Qt(_)},wl=(0,le.useRef)(!1),Va=(0,le.useRef)(null),Lt=rt&&g&&i==="center",bt=Lt||v&&i==="end",hu=h||bt,$p=!w&&!Lt&&(c??i==="center"),Zp=!w&&!Lt&&(p??i==="center"),qo=(0,le.useRef)({shouldTrapFocus:Zp,isFloating:Lt,suspended:w});if(qo.current={shouldTrapFocus:Zp,isFloating:Lt,suspended:w},et.current=y,(0,le.useEffect)(()=>{if(!e||typeof document>"u")return;let _=document.activeElement instanceof HTMLElement?document.activeElement:null,Se=window.requestAnimationFrame(()=>{(Array.from(se.current?.querySelectorAll(Rv)??[]).find(tt=>tt.getClientRects().length>0)??se.current)?.focus()}),Be=Ce=>{if(Ce.defaultPrevented||qo.current.suspended)return;let tt=document.activeElement?.closest('[role="dialog"]');if(tt&&tt!==se.current)return;if(!tt){let Il=Array.from(document.querySelectorAll('[role="dialog"][aria-modal="true"]')).filter(rS=>rS.getClientRects().length>0).at(-1);if(Il&&Il!==se.current)return}if(Ce.key==="Escape"&&m&&(!qo.current.isFloating||se.current?.contains(document.activeElement))){Ce.preventDefault(),et.current();return}if(Ce.key!=="Tab"||!qo.current.shouldTrapFocus||!se.current)return;let Hn=Array.from(se.current.querySelectorAll(Rv)).filter(Il=>Il.getClientRects().length>0);if(Hn.length===0){Ce.preventDefault(),se.current.focus();return}let Pn=Hn[0],gu=Hn[Hn.length-1];Ce.shiftKey&&document.activeElement===Pn?(Ce.preventDefault(),gu.focus()):!Ce.shiftKey&&document.activeElement===gu&&(Ce.preventDefault(),Pn.focus())};return document.addEventListener("keydown",Be),()=>{window.cancelAnimationFrame(Se),document.removeEventListener("keydown",Be),(!qo.current.isFloating||document.activeElement===document.body||se.current?.contains(document.activeElement))&&_?.focus()}},[m,e]),(0,le.useEffect)(()=>{if(!e||!$p)return;let _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=_}},[e,$p]),(0,le.useLayoutEffect)(()=>{if(e&&bt&&!de.current&&!Va.current){if(i==="center"&&!x&&!L&&vt.current)return;let _=se.current?.getBoundingClientRect();_&&(ja.current??=S??{left:_.left,top:_.top,width:_.width,height:_.height},Un(An(L??ja.current,{width:window.innerWidth,height:window.innerHeight})))}},[e,bt,L?.left,L?.top,L?.width,L?.height]),(0,le.useEffect)(()=>{e||(_t(null),Re(!1),Un(null),ja.current=null,de.current=null,Va.current=null)},[e]),(0,le.useEffect)(()=>{if(!hu||!e)return;let _=Be=>{let Ce=Va.current;if(Ce&&Be.pointerId===Ce.pointerId){wl.current=!0,Un(td(Ce.rect,Ce.edge,Be.clientX-Ce.x,Be.clientY-Ce.y,{width:window.innerWidth,height:window.innerHeight}));return}let tt=de.current,Hn=se.current;if(!tt||!Hn||Be.pointerId!==tt.pointerId)return;let Pn=Hn.getBoundingClientRect();if(bt){wl.current=!0,Un(An({left:Be.clientX-tt.offsetX,top:Be.clientY-tt.offsetY,width:Pn.width,height:Pn.height},{width:window.innerWidth,height:window.innerHeight}));return}let gu=Math.max(8,Math.min(window.innerWidth-Pn.width-8,Be.clientX-tt.offsetX)),Il=Math.max(76,Math.min(window.innerHeight-Pn.height-8,Be.clientY-tt.offsetY));_t({left:gu,top:Il})},Se=Be=>{let Ce=de.current?.pointerId===Be.pointerId||Va.current?.pointerId===Be.pointerId;de.current?.pointerId===Be.pointerId&&(de.current=null),Va.current?.pointerId===Be.pointerId&&(Va.current=null),Ce&&wl.current&&vt.current&&(wl.current=!1,Ga.current?.({...vt.current}))};return window.addEventListener("pointermove",_),window.addEventListener("pointerup",Se),window.addEventListener("pointercancel",Se),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",Se),window.removeEventListener("pointercancel",Se)}},[hu,bt,e]),(0,le.useEffect)(()=>{if(!bt||!e)return;let _=()=>{vt.current&&Un(An(L??vt.current,{width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[bt,e,L]),!e||typeof document>"u")return null;let lS=!Lt&&(s??i==="center"),oS=_=>{lS&&_.target===_.currentTarget&&y()};return(0,Bv.createPortal)((0,ze.jsx)($s.Provider,{value:null,children:(0,ze.jsx)(Io.Provider,{value:!1,children:(0,ze.jsx)(zm.Provider,{value:T,children:(0,ze.jsx)("div",{className:"nodedc-overlay nodedc-ui-root",style:w?{display:"none"}:void 0,"data-placement":i,"data-floating":Lt||void 0,onPointerDown:oS,children:(0,ze.jsxs)("div",{ref:se,className:B("nodedc-window nodedc-glass-material nodedc-material-rim",b),"data-material":"glass-v4","data-size":r==="md"?void 0:r,"data-placement":i,"data-draggable":hu?"true":void 0,"data-resizable":bt||void 0,"data-floating":Lt||void 0,role:"dialog","aria-modal":i==="center"&&!Lt?"true":void 0,"aria-labelledby":O,"aria-describedby":a?te:void 0,tabIndex:-1,style:bt&&oe?{...M,position:"fixed",...oe,right:"auto",bottom:"auto",maxWidth:"none",maxHeight:"none"}:H?{...M,position:"fixed",left:H.left,top:H.top,right:"auto",bottom:"auto"}:M,...A,children:[(0,ze.jsxs)("header",{className:"nodedc-window__head",tabIndex:bt?0:void 0,"aria-label":bt?"\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u043E\u043A\u043D\u0430: \u0441\u0442\u0440\u0435\u043B\u043A\u0438; \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u043C\u0435\u0440\u0430: Shift \u0438 \u0441\u0442\u0440\u0435\u043B\u043A\u0438":void 0,onKeyDown:_=>{if(!bt||!oe||_.target!==_.currentTarget||!_.key.startsWith("Arrow"))return;_.preventDefault();let Se=_.key==="ArrowLeft"?-10:_.key==="ArrowRight"?10:0,Be=_.key==="ArrowUp"?-10:_.key==="ArrowDown"?10:0,Ce={width:window.innerWidth,height:window.innerHeight},tt=_.shiftKey?td(oe,"se",Se,Be,Ce):An({...oe,left:oe.left+Se,top:oe.top+Be},Ce);Un(tt),Ga.current?.(tt)},onPointerDown:_=>{if(!hu||_.button!==0||_.target.closest("button, input, select, textarea, a"))return;let Se=se.current?.getBoundingClientRect();Se&&(de.current={pointerId:_.pointerId,offsetX:_.clientX-Se.left,offsetY:_.clientY-Se.top},wl.current=!1,_.currentTarget.setPointerCapture(_.pointerId),_.preventDefault())},children:[(0,ze.jsxs)("div",{className:"nodedc-window__titles",children:[(0,ze.jsx)("h2",{id:O,className:"nodedc-window__title",children:t}),a?(0,ze.jsx)("p",{id:te,className:"nodedc-window__subtitle",children:a}):null]}),(0,ze.jsxs)("div",{className:"nodedc-window__actions",children:[o,g&&i==="center"&&(0,ze.jsx)(pt,{label:Lt?"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u043C\u043E\u0434\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C":"\u0421\u0432\u043E\u0431\u043E\u0434\u043D\u043E\u0435 \u043E\u043A\u043D\u043E","aria-pressed":Lt,onClick:()=>{if(de.current=null,Va.current=null,!Lt){let _=se.current?.getBoundingClientRect();_&&Un(An(vt.current??{left:_.left,top:_.top,width:_.width,height:_.height},{width:window.innerWidth,height:window.innerHeight}))}Re(!Lt)},children:(0,ze.jsx)(ie,{name:"move"})}),(0,ze.jsx)("button",{type:"button",className:"nodedc-window__close","aria-label":u,onClick:y,children:(0,ze.jsx)(ie,{name:"close",size:16,strokeWidth:1.6})})]})]}),bt&&qm.map(_=>(0,ze.jsx)("div",{className:"nodedc-window__resize","data-edge":_,"aria-hidden":"true",onPointerDown:Se=>{Se.button!==0||!oe||(Va.current={pointerId:Se.pointerId,x:Se.clientX,y:Se.clientY,rect:oe,edge:_},wl.current=!1,Se.currentTarget.setPointerCapture(Se.pointerId),Se.preventDefault(),Se.stopPropagation())}},_)),(0,ze.jsx)("div",{className:"nodedc-window__body",children:n}),l?(0,ze.jsx)("footer",{className:"nodedc-window__footer",children:l}):null]})})})})}),document.fullscreenElement??document.body)}var eu=E(z(),1),fe=E(q(),1),zv=E(Wt(),1);var _v=(0,fe.createContext)([]),Pm=new Map;function ha({trigger:e,children:t,placement:a="bottom-start",minWidth:n=180,width:l="anchor",offset:o=8,disabled:r=!1,className:i,surfaceClassName:u,surfaceRole:s="menu",onOpenChange:m,getAnchorRect:c,flip:p=!0,onPointerDownOutside:h}){let v=(0,fe.useId)(),S=(0,fe.useContext)(_v),L=(0,fe.useMemo)(()=>[...S,v],[S,v]),x=`${v.replaceAll(":","")}-surface`,[g,y]=(0,fe.useState)(!1),[b,M]=(0,fe.useState)(null),[A,I]=(0,fe.useState)(null),N=(0,fe.useRef)(null),[T,w]=(0,fe.useState)({visibility:"hidden"});(0,fe.useEffect)(()=>{m?.(g)},[g,m]);let O=(0,fe.useCallback)(()=>y(!1),[]),te=(0,fe.useCallback)(()=>{r||y(!0)},[r]),se=(0,fe.useCallback)(()=>{r||y(de=>!de)},[r]),et=(0,fe.useCallback)(()=>{let de=b??A;if(!de||!N.current)return;let H=c?.()??de.getBoundingClientRect();if(!(H.bottom>0&&H.top0&&H.leftObject.keys(vt).every(Ga=>ja[Ga]===vt[Ga])?ja:vt)},[b,O,n,o,a,A,l,c,p]);return(0,fe.useLayoutEffect)(()=>{g&&et()},[g,et]),(0,fe.useEffect)(()=>{if(!g||!c)return;let de,H=()=>{et(),de=requestAnimationFrame(H)};return de=requestAnimationFrame(H),()=>cancelAnimationFrame(de)},[g,c,et]),(0,fe.useEffect)(()=>{if(!g)return;let de=Re=>{let oe=Re.target;!(oe instanceof Node)||b?.contains(oe)||A?.contains(oe)||N.current?.contains(oe)||(oe instanceof Element?oe:oe.parentElement)?.closest("[data-dropdown-lineage]")?.getAttribute("data-dropdown-lineage")?.split(" ").includes(v)||(O(),h?.(Re))},H=Re=>{if(Re.key==="Escape"&&!Re.defaultPrevented){if([...Pm].some(([oe,Qt])=>oe!==v&&Qt.includes(v)))return;O(),Re.preventDefault(),Re.stopImmediatePropagation(),A?.focus()}},_t=Re=>{let oe=Re.detail;oe.id!==v&&!oe.lineage?.includes(v)&&O()},rt=()=>et();return Pm.set(v,L),window.dispatchEvent(new CustomEvent("nodedc-dropdown-open",{detail:{id:v,lineage:L}})),document.addEventListener("pointerdown",de,!0),document.addEventListener("keydown",H,!0),window.addEventListener("nodedc-dropdown-open",_t),window.addEventListener("resize",rt),window.addEventListener("scroll",rt,!0),()=>{Pm.delete(v),document.removeEventListener("pointerdown",de,!0),document.removeEventListener("keydown",H,!0),window.removeEventListener("nodedc-dropdown-open",_t),window.removeEventListener("resize",rt),window.removeEventListener("scroll",rt,!0)}},[b,O,v,g,A,et,L,h]),(0,eu.jsxs)("span",{className:B("nodedc-dropdown-anchor",i),children:[e({open:g,show:te,close:O,toggle:se,setAnchorRef:M,setTriggerRef:I,surfaceId:x}),g&&typeof document<"u"?(0,zv.createPortal)((0,eu.jsx)("div",{ref:N,id:x,"data-dropdown-lineage":L.join(" "),className:B("nodedc-dropdown-surface",u),role:s,style:T,children:(0,eu.jsx)(_v.Provider,{value:L,children:typeof t=="function"?t({close:O}):t})}),document.fullscreenElement??document.body):null]})}var Fv=E(z(),1),dl=E(q(),1);var qv=E(z(),1),Uv=E(q(),1);var lT=(0,dl.createContext)({disabled:!0,onKey:()=>{}});var jv=E(z(),1),nd=E(q(),1);var Gv=E(z(),1),ko=E(q(),1),Xw=E(Wt(),1);var Vv=E(z(),1),Kw=E(q(),1);var Qe=E(z(),1),ld=E(q(),1);function Fm({open:e,title:t,subtitle:a,identity:n,sections:l,activeSection:o,onSectionChange:r,onClose:i,children:u,footer:s,headerActions:m}){let c=(0,ld.useRef)(null);return(0,ld.useLayoutEffect)(()=>{c.current&&(c.current.scrollTop=0)},[o]),(0,Qe.jsx)(ad,{open:e,title:t,subtitle:a,size:"lg",className:"nodedc-feature-settings-window",footer:s,headerActions:m,closeOnBackdrop:!1,onClose:i,children:(0,Qe.jsxs)("div",{className:"nodedc-feature-settings",children:[(0,Qe.jsxs)("aside",{className:"nodedc-feature-settings__navigation","aria-label":"\u0420\u0430\u0437\u0434\u0435\u043B\u044B \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A",tabIndex:0,children:[(0,Qe.jsxs)("div",{className:"nodedc-feature-settings__identity",children:[(0,Qe.jsx)(Lo,{label:n.avatarLabel,imageUrl:n.avatarUrl}),(0,Qe.jsxs)("span",{children:[(0,Qe.jsx)("strong",{children:n.title}),n.subtitle?(0,Qe.jsx)("small",{children:n.subtitle}):null]})]}),(0,Qe.jsx)("nav",{children:l.map((p,h)=>{let v=p.group&&p.group!==l[h-1]?.group;return(0,Qe.jsxs)("div",{className:"nodedc-feature-settings__navigation-entry",children:[v?(0,Qe.jsx)("span",{className:"nodedc-feature-settings__group",children:p.group}):null,(0,Qe.jsxs)("button",{type:"button",className:"nodedc-feature-settings__section","data-active":p.id===o?"true":void 0,disabled:p.disabled,onClick:()=>r(p.id),children:[p.icon?(0,Qe.jsx)(ie,{name:p.icon,size:16}):null,(0,Qe.jsx)("span",{children:p.label})]})]},p.id)})})]}),(0,Qe.jsx)("section",{ref:c,className:"nodedc-feature-settings__content","aria-label":"\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A",tabIndex:0,children:u})]})})}var Yw=E(z(),1);var Xv=E(z(),1),Kv=E(q(),1);var K=E(z(),1),Dn=E(q(),1);function cl({value:e,options:t,label:a,onChange:n,searchable:l=!1,searchPlaceholder:o="\u041F\u043E\u0438\u0441\u043A",emptyLabel:r="\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",placement:i="bottom-start",minMenuWidth:u=180,menuWidth:s="anchor",disabled:m=!1,variant:c="integrated",shape:p="default",className:h,triggerClassName:v,menuClassName:S}){let x=(0,Dn.useContext)(Io)?"split":c,[g,y]=(0,Dn.useState)(""),b=(0,Dn.useRef)(null),M=t.find(T=>T.value===e)??t[0],A=t.some(T=>T.action),I=A?"dialog":"listbox",N=(0,Dn.useMemo)(()=>{let T=g.trim().toLocaleLowerCase();return T?t.filter(w=>`${w.label} ${w.description??""}`.toLocaleLowerCase().includes(T)):t},[t,g]);return(0,K.jsx)(ha,{className:B("nodedc-select-anchor",h),placement:i,minWidth:u,width:s,disabled:m,surfaceRole:I,surfaceClassName:B(x==="split"&&"nodedc-select__menu",S),trigger:({open:T,toggle:w,setAnchorRef:O,setTriggerRef:te,surfaceId:se})=>{let et=H=>{b.current=H.currentTarget,w()},de=H=>{b.current=H.currentTarget,(H.key==="ArrowDown"||H.key==="Enter"||H.key===" ")&&(H.preventDefault(),T||w())};return x==="split"?(0,K.jsx)("div",{className:B("nodedc-select",v),"data-shape":p==="pill"?"pill":void 0,"data-disabled":m?"true":void 0,children:(0,K.jsxs)("div",{ref:O,className:"nodedc-select__control",children:[(0,K.jsxs)("div",{className:"nodedc-select__value",children:[M?.icon?(0,K.jsx)("span",{className:"nodedc-select__value-icon",children:M.icon}):null,(0,K.jsx)("span",{children:M?.label??"\u2014"})]}),(0,K.jsx)("button",{ref:te,type:"button",className:"nodedc-select__toggle","aria-label":a,"aria-haspopup":I,"aria-controls":se,"aria-expanded":T,disabled:m,onClick:et,onKeyDown:de,children:(0,K.jsx)("span",{className:"nodedc-select-trigger__chevron","aria-hidden":"true"})})]})}):x==="inline"?(0,K.jsxs)("button",{ref:te,type:"button",className:B("nodedc-select-inline",v),"aria-label":a,"aria-haspopup":I,"aria-controls":se,"aria-expanded":T,disabled:m,onClick:et,onKeyDown:de,children:[M?.icon?(0,K.jsx)("span",{className:"nodedc-select-trigger__icon",children:M.icon}):null,(0,K.jsx)("span",{children:M?.label??"\u2014"})]}):(0,K.jsxs)("button",{ref:te,type:"button",className:B("nodedc-select-trigger",v),"aria-label":a,"aria-haspopup":I,"aria-controls":se,"aria-expanded":T,disabled:m,onClick:et,onKeyDown:de,children:[M?.icon?(0,K.jsx)("span",{className:"nodedc-select-trigger__icon",children:M.icon}):(0,K.jsx)("span",{className:"nodedc-select-trigger__icon","aria-hidden":"true"}),(0,K.jsx)("span",{className:"nodedc-select-trigger__label",children:M?.label??"\u2014"}),(0,K.jsx)("span",{className:"nodedc-select-trigger__chevron","aria-hidden":"true"})]})},children:({close:T})=>(0,K.jsxs)(K.Fragment,{children:[l?(0,K.jsxs)("label",{className:"nodedc-dropdown-search",children:[(0,K.jsx)("span",{"aria-hidden":"true",children:"\u2315"}),(0,K.jsx)("input",{value:g,onChange:w=>y(w.target.value),placeholder:o})]}):null,N.map(w=>(0,K.jsxs)("div",{className:"nodedc-select-option-row",children:[(0,K.jsxs)("button",{type:"button",className:"nodedc-dropdown-option",role:A?void 0:"option","aria-selected":A?void 0:w.value===e,"aria-pressed":A?w.value===e:void 0,"data-selected":w.value===e?"true":void 0,disabled:w.disabled,onClick:()=>{w.disabled||(n(w.value,w),y(""),T())},children:[w.icon?(0,K.jsx)("span",{className:"nodedc-dropdown-option__icon",children:w.icon}):(0,K.jsx)("span",{}),(0,K.jsxs)("span",{className:"nodedc-dropdown-option__body",children:[(0,K.jsx)("span",{className:"nodedc-dropdown-option__label",children:w.label}),w.description?(0,K.jsx)("span",{className:"nodedc-dropdown-option__description",children:w.description}):null]}),w.value===e?(0,K.jsx)("span",{className:"nodedc-dropdown-option__check","aria-hidden":"true",children:"\u2022"}):null]}),w.action?(0,K.jsx)(pt,{label:w.action.label,"data-tone":w.action.tone??"neutral",disabled:w.action.disabled,onClick:()=>{y(""),T(),b.current?.focus(),w.action?.onAction()},children:w.action.icon}):null]},w.value)),N.length===0?(0,K.jsx)("div",{className:"nodedc-empty-state",children:r}):null]})})}var Yv=E(z(),1),$w=E(q(),1);var $v=E(z(),1),Zw=E(q(),1);var W=E(z(),1),je=E(q(),1);var fl=E(z(),1),Wv=E(q(),1),od=E(q(),1);var tu=(e,t,a)=>Math.max(t,Math.min(a,e));function jm(e,t,a){let n=tu(e[0],t,a);return[n,tu(e[1],n,a)]}function Zv([e,t],a){return a<=(e+t)/2?0:1}function Qv(e,t,a,n,l,o=1){let r=jm(e,n,l),i=Number(o),u=tu(a,n,l),s=u===n||u===l||!Number.isFinite(i)||i<=0?u:Number((n+Math.round((u-n)/i)*i).toPrecision(12));return r[t]=t===0?tu(s,n,r[1]):tu(s,r[0],l),r}function Jv({label:e,value:t,min:a,max:n,step:l=1,onChange:o,lowerLabel:r=`${e}: \u043D\u0438\u0436\u043D\u044F\u044F \u0433\u0440\u0430\u043D\u0438\u0446\u0430`,upperLabel:i=`${e}: \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0433\u0440\u0430\u043D\u0438\u0446\u0430`,formatValue:u=String,formatLimit:s=String,limitSide:m="right",disabled:c=!1,className:p,style:h,orientation:v,...S}){let L=n>a?n:a+1,x=jm(t,a,L),g=(0,od.useRef)(x);g.current=x;let y=(0,od.useRef)([]),b=(0,od.useRef)(null),M=x.map(w=>(w-a)/(L-a)*100),A={...h,"--nodedc-range-lower":`${M[0]}%`,"--nodedc-range-upper":`${M[1]}%`},I=(w,O)=>{let te=Qv(g.current,w,O,a,L,l);g.current=te,o(te)},N=w=>{let O=w.currentTarget.getBoundingClientRect();return a+Math.max(0,Math.min(1,(O.bottom-w.clientY)/O.height))*(L-a)},T=w=>{b.current?.id===w.pointerId&&(b.current=null,w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId))};return(0,fl.jsxs)("div",{className:"nodedc-range-scale","data-band":"true","data-limit-side":m,"data-disabled":c||void 0,style:A,children:[(0,fl.jsx)("div",{className:B("nodedc-range",p),"data-orientation":"vertical",children:(0,fl.jsx)("div",{className:"nodedc-range-band__target",onPointerDown:w=>{if(c||w.button!==0||b.current)return;w.preventDefault(),w.stopPropagation();let O=N(w),te=Zv(g.current,O);b.current={id:w.pointerId,boundary:te},y.current[te]?.focus({preventScroll:!0}),w.currentTarget.setPointerCapture(w.pointerId),I(te,O)},onPointerMove:w=>{c||b.current?.id!==w.pointerId||(w.preventDefault(),w.stopPropagation(),I(b.current.boundary,N(w)))},onPointerUp:T,onPointerCancel:T,onLostPointerCapture:()=>{b.current=null},children:[0,1].map(w=>(0,Wv.createElement)("input",{...S,key:w,ref:O=>{y.current[w]=O},type:"range","data-boundary":w===0?"lower":"upper",min:a,max:L,step:l,value:x[w],disabled:c,"aria-label":w===0?r:i,"aria-orientation":"vertical","aria-valuemin":w===0?a:x[0],"aria-valuemax":w===0?x[1]:L,"aria-valuetext":u(x[w]),onChange:O=>I(w,Number(O.target.value))}))})}),(0,fl.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--max",children:s(x[1])}),(0,fl.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--min",children:s(x[0])})]})}var Gm=(e,t,a)=>Math.max(t,Math.min(a,e)),eL=e=>{let[t,a]=String(e).toLowerCase().split("e"),n=t?.split(".")[1]?.length??0;if(a===void 0)return n;let l=Number.parseInt(a,10);return Number.isFinite(l)?Math.max(0,n-l):n},Qw=(e,t,a,n,l)=>{let o=l?.min??Number.NEGATIVE_INFINITY,r=l?.max??Number.POSITIVE_INFINITY,i=Gm(e,o,r);if(n==="any")return i;let u=n===void 0?1:Number(n);if(!Number.isFinite(u)||u<=0)return i;let s=Math.min(12,Math.max(eL(t),eL(u))),m=t+Math.round((i-t)/u)*u;return Gm(Number(m.toFixed(s)),o,r)},au=e=>Number.isInteger(e)?String(e):String(Number(e.toFixed(12)));function Ww(e){return Array.isArray(e.value)}function Xm(e){return Ww(e)?(0,W.jsx)(Jv,{...e}):(0,W.jsx)(Jw,{...e})}function Jw({label:e,orientation:t="horizontal",value:a,min:n,max:l,exactValueBounds:o,step:r,formatValue:i=String,formatLimit:u=String,limitSide:s="right",onChange:m,className:c,disabled:p=!1,tabIndex:h,...v}){let S=(0,je.useRef)(null),L=(0,je.useRef)(null),x=(0,je.useRef)(null),g=(0,je.useRef)(!1),[y,b]=(0,je.useState)(!1),[M,A]=(0,je.useState)(()=>au(a)),[I,N]=(0,je.useState)("base"),T=l===n?n+1:l,w=Math.max(0,Math.min(100,(a-n)/(T-n)*100)),O=i(a),te=Math.max(1,Math.min(14,y?M.length||au(a).length:O.length)),se={"--nodedc-range-progress":`${w}%`,"--nodedc-range-editor-characters":te};(0,je.useLayoutEffect)(()=>A(au(a)),[a]),(0,je.useEffect)(()=>{y||A(au(a))},[y,a]),(0,je.useLayoutEffect)(()=>{let H=S.current,_t=x.current;if(!H||!_t)return;let rt=()=>{let oe=H.getBoundingClientRect(),Qt=_t.getBoundingClientRect(),vt=Number.parseFloat(getComputedStyle(_t).paddingRight)||0,ja=oe.left+oe.width*w/100,Ga=Qt.right-vt;N(ja>=Ga?"fill":"base")};rt();let Re=typeof ResizeObserver>"u"?null:new ResizeObserver(rt);return Re?.observe(H),()=>Re?.disconnect()},[te,w]);let et=(H,_t)=>{if(H){let rt=Number(M.trim().replace(",","."));Number.isFinite(rt)&&m(Qw(rt,n,l,r,o))}b(!1),_t&&requestAnimationFrame(()=>L.current?.focus())},de=H=>{H.stopPropagation(),H.key==="Enter"&&(H.preventDefault(),H.currentTarget.blur()),H.key==="Escape"&&(H.preventDefault(),g.current=!0,A(au(a)),b(!1),H.currentTarget.blur(),requestAnimationFrame(()=>L.current?.focus()))};return t==="vertical"?(0,W.jsxs)("div",{className:"nodedc-range-scale","data-limit-side":s,style:se,children:[(0,W.jsx)("div",{ref:S,className:B("nodedc-range",c),style:se,"data-orientation":"vertical",children:(0,W.jsx)("input",{ref:L,...v,type:"range",value:a,min:n,max:T,step:r,disabled:p,tabIndex:h,"aria-label":e,"aria-orientation":"vertical","aria-valuetext":O,onChange:H=>m(Number(H.target.value))})}),(0,W.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--max",children:u(Gm(a,n,T))}),(0,W.jsx)("span",{className:"nodedc-range-scale__limit nodedc-range-scale__limit--min",children:u(n)})]}):(0,W.jsxs)("div",{ref:S,className:B("nodedc-range",c),style:se,"data-editing":y||void 0,children:[(0,W.jsx)("input",{ref:L,...v,type:"range",value:a,min:n,max:T,step:r,disabled:p,tabIndex:y?-1:h,"aria-label":e,"aria-valuetext":O,onChange:H=>m(Number(H.target.value))}),(0,W.jsx)("span",{className:"nodedc-range__label",children:e}),(0,W.jsx)("span",{className:"nodedc-range__value",children:O}),(0,W.jsxs)("span",{className:"nodedc-range__fill-text","aria-hidden":"true",children:[(0,W.jsx)("span",{className:"nodedc-range__label",children:e}),(0,W.jsx)("span",{className:"nodedc-range__value",children:O})]}),(0,W.jsx)("input",{ref:x,className:"nodedc-range__editor",type:"text",inputMode:"decimal",value:M,"aria-label":`${e}: \u0442\u043E\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435`,disabled:p,spellCheck:!1,"data-active":y||void 0,"data-contrast":I,onFocus:()=>{y||b(!0)},onChange:H=>A(H.target.value),onKeyDown:de,onBlur:()=>{if(g.current){g.current=!1;return}et(!0,!1)}})]})}var e4=["#ff2f92","#ff6caf","#d746ff","#7a3cff","#4ea4ff","#35d7c1","#c3ff66","#ffffff","#404040","#111116"];function nu(e,t,a){return Math.max(t,Math.min(a,e))}function Vm(e){let t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let a=t[1];return[Number.parseInt(a.slice(0,2),16),Number.parseInt(a.slice(2,4),16),Number.parseInt(a.slice(4,6),16)]}function tL(e){let t=Vm(e);if(!t)return null;let[a,n,l]=t.map(s=>s/255),o=Math.max(a,n,l),r=Math.min(a,n,l),i=o-r,u=0;return i&&(o===a?u=60*((n-l)/i%6):o===n?u=60*((l-a)/i+2):u=60*((a-n)/i+4)),{h:(u+360)%360,s:o===0?0:i/o*100,v:o*100}}function ml({h:e,s:t,v:a}){let n=(e%360+360)%360,l=nu(t,0,100)/100,o=nu(a,0,100)/100,r=o*l,i=n/60%2,u=r*(1-Math.abs(i-1)),s=n<60?[r,u,0]:n<120?[u,r,0]:n<180?[0,r,u]:n<240?[0,u,r]:n<300?[u,0,r]:[r,0,u],m=o-r;return`#${s.map(c=>Math.round((c+m)*255).toString(16).padStart(2,"0")).join("")}`}function aL({value:e,onChange:t,label:a="\u0426\u0432\u0435\u0442",className:n,disabled:l=!1,onBlur:o,onKeyDown:r,...i}){let[u,s]=(0,je.useState)(e);(0,je.useEffect)(()=>s(e),[e]);let m=tL(e),[c,p]=(0,je.useState)(()=>m??{h:330,s:82,v:100}),h={"--nodedc-color-value":ml(m||c)};(0,je.useEffect)(()=>{m&&p(m)},[e,m?.h,m?.s,m?.v]);let v=L=>{let x={h:nu(L.h,0,360),s:nu(L.s,0,100),v:nu(L.v,0,100)};p(x),s(ml(x)),t(ml(x))},S=L=>{let x=L.currentTarget.getBoundingClientRect();v({...c,s:(L.clientX-x.left)/x.width*100,v:100-(L.clientY-x.top)/x.height*100})};return(0,W.jsxs)("div",{className:B("nodedc-color-field",n),style:h,children:[(0,W.jsx)(ha,{className:"nodedc-color-field__dropdown",placement:"bottom-start",minWidth:296,width:296,disabled:l,surfaceRole:"dialog",surfaceClassName:"nodedc-color-palette-surface",trigger:({open:L,toggle:x,setTriggerRef:g,surfaceId:y})=>(0,W.jsx)("button",{ref:g,type:"button",className:"nodedc-color-field__picker","aria-label":`\u0412\u044B\u0431\u0440\u0430\u0442\u044C ${a}`,"aria-haspopup":"dialog","aria-controls":y,"aria-expanded":L,"data-open":L?"true":void 0,disabled:l,onClick:x,children:(0,W.jsx)("span",{"aria-hidden":"true"})}),children:(0,W.jsxs)("div",{className:"nodedc-color-palette","aria-label":`\u041F\u0430\u043B\u0438\u0442\u0440\u0430: ${a}`,children:[(0,W.jsx)("div",{className:"nodedc-color-palette__spectrum",role:"slider",tabIndex:l?-1:0,"aria-label":`${a}: \u043D\u0430\u0441\u044B\u0449\u0435\u043D\u043D\u043E\u0441\u0442\u044C \u0438 \u044F\u0440\u043A\u043E\u0441\u0442\u044C`,"aria-valuetext":ml(c),style:{"--nodedc-color-hue":ml({h:c.h,s:100,v:100}),"--nodedc-color-s":`${c.s}%`,"--nodedc-color-v":`${100-c.v}%`},onPointerDown:L=>{l||(L.currentTarget.setPointerCapture(L.pointerId),S(L))},onPointerMove:L=>{L.currentTarget.hasPointerCapture(L.pointerId)&&S(L)},onPointerUp:L=>{L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId)},onKeyDown:L=>{let x=L.shiftKey?10:2;L.key==="ArrowLeft"&&(L.preventDefault(),v({...c,s:c.s-x})),L.key==="ArrowRight"&&(L.preventDefault(),v({...c,s:c.s+x})),L.key==="ArrowDown"&&(L.preventDefault(),v({...c,v:c.v-x})),L.key==="ArrowUp"&&(L.preventDefault(),v({...c,v:c.v+x}))},children:(0,W.jsx)("span",{className:"nodedc-color-palette__marker","aria-hidden":"true"})}),(0,W.jsxs)("label",{className:"nodedc-color-palette__hue",children:[(0,W.jsx)("span",{children:"\u041E\u0442\u0442\u0435\u043D\u043E\u043A"}),(0,W.jsx)("input",{type:"range",min:0,max:360,value:Math.round(c.h),"aria-label":`${a}: \u043E\u0442\u0442\u0435\u043D\u043E\u043A`,disabled:l,onChange:L=>v({...c,h:Number(L.target.value)})})]}),(0,W.jsx)("div",{className:"nodedc-color-palette__presets","aria-label":"\u0411\u044B\u0441\u0442\u0440\u044B\u0435 \u0446\u0432\u0435\u0442\u0430",children:e4.map(L=>(0,W.jsx)("button",{type:"button","aria-label":`\u0412\u044B\u0431\u0440\u0430\u0442\u044C ${L}`,"aria-pressed":ml(c).toLowerCase()===L,style:{"--nodedc-palette-swatch":L},onClick:()=>{let x=tL(L);x&&v(x)}},L))})]})}),(0,W.jsx)("input",{className:"nodedc-color-field__text",...i,value:u,"aria-label":`${a}: HEX`,disabled:l,spellCheck:!1,onChange:L=>{let x=L.target.value;s(x),Vm(x)&&t(`#${x.trim().replace(/^#/,"").toLowerCase()}`)},onBlur:L=>{s(Vm(u)?`#${u.trim().replace(/^#/,"").toLowerCase()}`:e),o?.(L)},onKeyDown:L=>{L.key==="Escape"&&(L.preventDefault(),L.stopPropagation(),s(e)),L.key==="Enter"&&(L.preventDefault(),L.currentTarget.blur()),r?.(L)}})]})}var nL=E(z(),1);var Km=E(z(),1),lL=E(q(),1);var aN=(0,lL.forwardRef)(function({active:t,className:a,type:n="button",...l},o){return(0,Km.jsx)("button",{...l,ref:o,type:n,className:B("nodedc-segmented__item",a),"data-active":t?"true":void 0})});var oL=E(z(),1);function rL({tone:e="neutral",variant:t="badge",pulse:a=!1,className:n,children:l,...o}){return(0,oL.jsx)("span",{className:B("nodedc-status",n),"data-tone":e==="neutral"?void 0:e,"data-variant":t==="indicator"?t:void 0,"data-pulse":a?"true":void 0,...o,children:t==="indicator"?null:l})}var ht=E(z(),1);function rd({eyebrow:e,title:t,description:a,actions:n,children:l,align:o="start",className:r,...i}){return(0,ht.jsxs)("section",{className:B("nodedc-settings-card",r),"data-align":o==="center"?"center":void 0,...i,children:[(0,ht.jsxs)("header",{className:"nodedc-settings-card__head",children:[(0,ht.jsxs)("div",{className:"nodedc-settings-card__titles",children:[e?(0,ht.jsx)("span",{children:e}):null,(0,ht.jsx)("h2",{children:t}),a?(0,ht.jsx)($y,{children:a}):null]}),n?(0,ht.jsx)("div",{className:"nodedc-settings-card__actions",children:n}):null]}),o==="center"&&(l==null||l===!1)?null:(0,ht.jsx)("div",{className:"nodedc-settings-card__body",children:l})]})}function Ym({checked:e,label:t,disabled:a=!1,onChange:n}){return(0,ht.jsxs)("button",{type:"button",className:"nodedc-switch",role:"switch","aria-checked":e,disabled:a,onClick:()=>n(!e),children:[(0,ht.jsx)("span",{className:"nodedc-switch__track","aria-hidden":"true",children:(0,ht.jsx)("span",{})}),(0,ht.jsx)("span",{children:t})]})}var $m=E(z(),1),Zm=E(q(),1);var uL=E(z(),1),id=E(q(),1);var iL=E(q(),1);var sL=E(z(),1),dL=E(q(),1),o4=E(Wt(),1);var ue=E(z(),1);function cL({displayName:e,variant:t="header",subtitle:a,avatarUrl:n,coverImageUrl:l,triggerLabel:o,triggerIcon:r,actions:i}){let u=e||"NODE.DC";return(0,ue.jsx)(ha,{placement:"bottom-end",width:296,offset:10,surfaceClassName:"nodedc-user-profile-menu",trigger:({open:s,toggle:m,setTriggerRef:c,setAnchorRef:p,surfaceId:h})=>t==="header"?(0,ue.jsxs)(jy,{ref:p,children:[(0,ue.jsx)(Gy,{"aria-haspopup":"menu","aria-expanded":s,"aria-controls":h,onClick:v=>{c(v.currentTarget),m()},children:o??"\u041F\u0440\u043E\u0444\u0438\u043B\u044C"}),(0,ue.jsx)(pt,{ref:c,label:`\u041C\u0435\u043D\u044E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${u}`,"aria-haspopup":"menu","aria-expanded":s,"aria-controls":h,onClick:v=>{c(v.currentTarget),m()},children:(0,ue.jsx)(ie,{name:r??"inbox",size:20,strokeWidth:1.7})}),(0,ue.jsx)("button",{type:"button",className:"nodedc-user-profile-menu__trigger","aria-label":`\u041F\u0440\u043E\u0444\u0438\u043B\u044C ${u}`,"aria-haspopup":"menu","aria-expanded":s,"aria-controls":h,onClick:v=>{c(v.currentTarget),m()},children:(0,ue.jsx)(Lo,{label:u,imageUrl:n})})]}):(0,ue.jsxs)("button",{ref:c,type:"button",className:"nodedc-user-profile-menu__trigger",title:u,"aria-label":`\u041C\u0435\u043D\u044E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${u}`,"aria-expanded":s,"aria-controls":h,onClick:m,children:[o===null?null:(0,ue.jsx)("span",{className:"nodedc-user-profile-menu__trigger-label",children:o??u}),r?(0,ue.jsx)(ie,{name:r,size:18}):null,(0,ue.jsx)(Lo,{label:u,imageUrl:n})]}),children:({close:s})=>(0,ue.jsxs)("div",{className:"nodedc-user-profile-card",children:[(0,ue.jsxs)("div",{className:"nodedc-user-profile-card__cover",style:l?{backgroundImage:`linear-gradient(180deg, rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.52)), url(${JSON.stringify(l)})`}:void 0,children:[(0,ue.jsx)(Lo,{label:u,imageUrl:n}),(0,ue.jsx)("strong",{children:u}),a?(0,ue.jsx)("span",{children:a}):null]}),(0,ue.jsx)("div",{className:"nodedc-user-profile-card__actions",children:i.map(m=>{let c=(0,ue.jsxs)(ue.Fragment,{children:[m.icon?(0,ue.jsx)(ie,{name:m.icon,size:16}):(0,ue.jsx)("span",{}),(0,ue.jsx)("span",{children:m.label})]});return m.href&&!m.disabled?(0,ue.jsx)("a",{className:"nodedc-user-profile-card__action","data-tone":m.tone==="danger"?"danger":void 0,href:m.href,onClick:()=>s(),children:c},m.id):(0,ue.jsx)("button",{type:"button",className:"nodedc-user-profile-card__action","data-tone":m.tone==="danger"?"danger":void 0,disabled:m.disabled,onClick:()=>{m.onSelect?.(),s()},children:c},m.id)})})]})})}var fL=E(z(),1),ud=E(q(),1);var mL=E(z(),1),Wm=E(q(),1);var Qm=E(z(),1),sd=E(q(),1);var jN=["image/png","image/jpeg","image/gif","image/webp","image/avif","video/mp4","video/webm","video/quicktime",".png",".jpg",".jpeg",".gif",".webp",".avif",".mp4",".webm",".mov"].join(",");var r4=E(z(),1),Jm=E(q(),1);var pL=E(z(),1);var hL=E(z(),1),gL=E(q(),1);var i4=(0,gL.forwardRef)(function({pressed:t=!1,label:a,children:n,className:l,type:o="button",disabled:r,...i},u){return(0,hL.jsx)("button",{...i,ref:u,type:o,disabled:r,"aria-label":a,title:a,"aria-pressed":t&&!r,className:B("nodedc-key-button",l),children:n})});var xL=E(z(),1),ep=E(q(),1);var yL=E(z(),1),u4=E(q(),1);var vL=E(z(),1),LL=E(q(),1);var s4=(0,LL.forwardRef)(function({className:t,...a},n){return(0,vL.jsx)(pa,{...a,ref:n,variant:"ghost",size:"dense",className:B("nodedc-scene-annotation",t)})});var bL=E(z(),1);var ga=E(q(),1),wL=E(pm(),1),IL=E(Wt(),1);function SL({root:e,navigationOpen:t=!1,activeView:a=null,contentExpanded:n=!0,onChange:l}={}){let o={navigationOpen:t||a!==null,activeView:a,contentOpen:a!==null,contentExpanded:n},r=i=>{o={...o,...i},o.contentOpen=o.activeView!==null,e?.toggleAttribute("data-navigation-open",o.navigationOpen),e?.toggleAttribute("data-content-open",o.contentOpen),e?.toggleAttribute("data-content-expanded",o.contentOpen&&o.contentExpanded),l?.({...o})};return r({}),{getState:()=>({...o}),openNavigation:()=>r({navigationOpen:!0}),toggleNavigation:()=>r({navigationOpen:!o.navigationOpen,activeView:o.navigationOpen?null:o.activeView}),closeNavigation:()=>r({navigationOpen:!1,activeView:null}),openView:i=>r({navigationOpen:!0,activeView:i,contentExpanded:!0}),closeView:()=>r({activeView:null}),setContentExpanded:i=>r({contentExpanded:i})}}var CL=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function tp({overlay:e,dialog:t,closeControls:a=[],closeOnBackdrop:n=!0,closeOnEscape:l=!0,lockBodyScroll:o=!0,onOpenChange:r}){let i=!1,u=null,s="",m=Array.from(a);e.classList.add("nodedc-overlay","nodedc-ui-root"),t.classList.add("nodedc-window"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.tabIndex=-1,e.hidden=!0;let c=()=>{(t.querySelector(CL)??t).focus()},p=()=>{i||(i=!0,u=document.activeElement instanceof HTMLElement?document.activeElement:null,s=document.body.style.overflow,o&&(document.body.style.overflow="hidden"),e.hidden=!1,requestAnimationFrame(c),r?.(!0))},h=()=>{i&&(i=!1,e.hidden=!0,o&&(document.body.style.overflow=s),u?.focus(),r?.(!1))},v=L=>{n&&L.target===e&&h()},S=L=>{if(!i)return;if(L.key==="Escape"&&l){L.preventDefault(),h();return}if(L.key!=="Tab")return;let x=Array.from(t.querySelectorAll(CL));if(x.length===0){L.preventDefault(),t.focus();return}let g=x[0],y=x[x.length-1];L.shiftKey&&document.activeElement===g?(L.preventDefault(),y.focus()):!L.shiftKey&&document.activeElement===y&&(L.preventDefault(),g.focus())};return e.addEventListener("pointerdown",v),document.addEventListener("keydown",S),m.forEach(L=>L.addEventListener("click",h)),{open:p,close:h,isOpen:()=>i,destroy:()=>{h(),e.removeEventListener("pointerdown",v),document.removeEventListener("keydown",S),m.forEach(L=>L.removeEventListener("click",h))}}}var Bt=ga.default.createElement,ap="dc-cms.ui-preferences.v1",lp={theme:"dark",accent:"#ffffff"};function kL(e){return{theme:e?.theme==="light"?"light":"dark",accent:/^#[\da-f]{6}$/i.test(e?.accent||"")?e.accent.toLowerCase():lp.accent}}function EL(){try{return kL(JSON.parse(localStorage.getItem(ap)))}catch{return{...lp}}}function np(e){let t=e.accent.match(/[\da-f]{2}/gi).map(a=>parseInt(a,16));Nm(document.documentElement,{theme:e.theme,accent:t,edges:"flat"})}function d4({initial:e}){let[t,a]=(0,ga.useState)(e),[n,l]=(0,ga.useState)(!1),[o,r]=(0,ga.useState)(null),[i,u]=(0,ga.useState)(!1);(0,ga.useEffect)(()=>{let h=new AbortController;fetch("/api/me",{credentials:"same-origin",signal:h.signal}).then(S=>S.ok?S.json():null).then(r).catch(()=>{});let v=S=>{if(S.key===ap||S.key===null){let L=EL();np(L),a(L)}};return window.addEventListener("storage",v),()=>{h.abort(),window.removeEventListener("storage",v)}},[]);function s(h){let v=kL({...t,...h});np(v),a(v);try{localStorage.setItem(ap,JSON.stringify(v)),u(!1)}catch{u(!0)}}let m=o?.user,c=m?.name||m?.username||"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",p=[{id:"appearance",label:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430",icon:"settings",onSelect:()=>l(!0)}];return o?.authEnabled&&p.push({id:"logout",label:"\u0412\u044B\u0439\u0442\u0438",icon:"external",href:"/auth/logout"}),Bt(ga.default.Fragment,null,Bt(cL,{displayName:c,subtitle:m?.email||void 0,avatarUrl:m?.picture||void 0,triggerLabel:"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",triggerIcon:"inbox",actions:p}),Bt(Fm,{open:n,title:"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438",subtitle:"\u0418\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 CMS",identity:{title:c,subtitle:"NODE.DC CMS",avatarLabel:c,avatarUrl:m?.picture||void 0},sections:[{id:"appearance",label:"\u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435",icon:"settings",group:"\u041E\u0431\u0449\u0438\u0435"}],activeSection:"appearance",onSectionChange:()=>{},onClose:()=>l(!1),footer:Bt(pa,{onClick:()=>s(lp),tone:"neutral"},"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435")},Bt("div",{className:"cms-preferences-fields"},Bt(rd,{title:"\u0422\u0435\u043C\u0430",description:"\u0421\u0432\u0435\u0442\u043B\u044B\u0439 \u0438\u043B\u0438 \u0442\u0451\u043C\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441",actions:Bt("div",{className:"cms-preference-controls"},Bt(cl,{label:"\u0422\u0435\u043C\u0430 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430",value:t.theme,options:[{value:"dark",label:"\u0422\u0451\u043C\u043D\u0430\u044F"},{value:"light",label:"\u0421\u0432\u0435\u0442\u043B\u0430\u044F"}],onChange:h=>s({theme:h})}))}),Bt(rd,{title:"\u0410\u043A\u0446\u0435\u043D\u0442\u043D\u044B\u0439 \u0446\u0432\u0435\u0442",description:"\u0426\u0432\u0435\u0442 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0445 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",actions:Bt("div",{className:"cms-preference-controls"},Bt(aL,{label:"\u0410\u043A\u0446\u0435\u043D\u0442\u043D\u044B\u0439 \u0446\u0432\u0435\u0442",value:t.accent,onChange:h=>s({accent:h})}))})),Bt("p",{className:"nodedc-description",role:"status"},i?"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044E\u0442 \u0432 \u044D\u0442\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u043D\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043B \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438\u0445 \u0434\u043B\u044F \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E \u0432\u0445\u043E\u0434\u0430.":"\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u044E\u0442\u0441\u044F \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.")))}function ML(){let e=EL();np(e),(0,IL.flushSync)(()=>(0,wL.createRoot)(document.querySelector("#cms-profile")).render(Bt(d4,{initial:e})))}var qe=AL.default.createElement,R=(e,t=document)=>t.querySelector(e),ve=(e,t=document)=>[...t.querySelectorAll(e)],Nn=e=>R(`#ds-${e}`).content.firstElementChild.cloneNode(!0);function Ge(e,t){e&&e.classList.add(...t.split(" "))}var ou=new Map,lu=[],op=!1,rp,c4=0,dd;function Tn(){op||(op=!0,queueMicrotask(()=>{op=!1,ip()}))}function pl(e){let t=ou.get(e);if(!t){let a=document.createElement("span");a.className="cms-ui-island",e.after(a),e.hidden=!0,e.tabIndex=-1,e.setAttribute("aria-hidden","true"),t={host:a,root:(0,DL.createRoot)(a),signature:""},ou.set(e,t)}return t}function f4(){for(let e of ve("select")){let t=pl(e),a=[...e.options].map(r=>({value:r.value,label:e.id==="site-selector"?r.textContent.replace(/^NODE\.?DC\s*[—–-]\s*/i,""):r.textContent,disabled:r.disabled})),n=e.getAttribute("aria-label")||e.closest("label")?.querySelector(".nodedc-field__label")?.textContent||"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",l=JSON.stringify([e.value,a,e.disabled,n]);if(l===t.signature)continue;t.signature=l,(0,Rn.flushSync)(()=>t.root.render(qe(cl,{variant:e.id==="site-selector"?"split":"integrated",shape:e.id==="site-selector"?"pill":"default",value:e.value,options:a,label:n,disabled:e.disabled,onChange:r=>{e.value=r,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),Tn()}}))),e.id&&e.closest("label")?.setAttribute("for",e.id+"-trigger");let o=R("button",t.host);o&&e.id&&(o.id=e.id+"-trigger")}}function m4(){for(let e of ve("input[type=checkbox]")){let t=e.closest("label")||e.parentElement,a=ou.get(e);if(!a){let l=t.querySelector(".field-label-text")?.textContent||[...t.childNodes].filter(o=>o!==e).map(o=>o.textContent).join(" ").trim()||e.getAttribute("aria-label")||"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E";a=pl(e),a.label=l.replace(/\s+/g," ").trim();for(let o of[...t.childNodes])o!==e&&o!==a.host&&!(o.nodeType===1&&o.matches("input,select,textarea"))&&(o.nodeType===1?o.hidden=!0:o.nodeType===3&&(o.textContent=""));t.classList.contains("link-mode-row")||t.classList.add("cms-switch-binding");for(let o of ve("input:not([type=checkbox])",t))o.setAttribute("aria-label",a.label);t.addEventListener("click",o=>{o.target.closest("button")&&o.preventDefault()})}let n=JSON.stringify([e.checked,e.disabled]);n!==a.signature&&(a.signature=n,(0,Rn.flushSync)(()=>a.root.render(qe(Ym,{checked:e.checked,disabled:e.disabled,label:a.label,onChange:l=>{e.checked=l,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),Tn()}}))))}}function p4(){for(let e of ve("input[type=range]")){if(e.closest(".cms-ui-island,.nodedc-color-palette-surface"))continue;let t=pl(e),a=e.closest(".range-field"),n=a?.querySelector(".range-value");n&&(n.hidden=!0);let l=a?.querySelector(".field-label-text")?.textContent||"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",o=JSON.stringify([e.value,e.min,e.max,e.step,e.disabled]);if(o===t.signature)continue;t.signature=o;let r=Number(e.min),i=Number(e.max);(0,Rn.flushSync)(()=>t.root.render(qe(Xm,{label:l,value:Number(e.value),min:r,max:i,step:e.step,exactValueBounds:{min:r,max:i},disabled:e.disabled,onChange:u=>{e.value=String(u),e.dispatchEvent(new Event("input",{bubbles:!0})),Tn()}})))}}function h4(){for(let e of ve(".publish-progress-track")){let t=pl(e),a=Number(e.getAttribute("aria-valuenow")||0);t.signature!==String(a)&&(t.signature=String(a),(0,Rn.flushSync)(()=>t.root.render(qe(Ji,{label:"\u041F\u0440\u043E\u0433\u0440\u0435\u0441\u0441 \u043F\u0443\u0431\u043B\u0438\u043A\u0430\u0446\u0438\u0438",value:a/100}))))}}function g4(){for(let e of ve(".field-control:not(.boolean-field):not(.service-media-field),.json-field,.media-search,.site-dialog label")){if(e.dataset.dsField)continue;e.dataset.dsField="true",Ge(e,"nodedc-field");let t=R(":scope > .field-label-row",e),a=t?.querySelector(".field-label-text")||R(":scope > span:not(.field-kind):not(.field-path):not(.field-hint)",e);if(!t){if(t=Nn("field").querySelector(".nodedc-field__label-row"),a)t.querySelector(".nodedc-field__label").replaceWith(a);else{a=t.querySelector(".nodedc-field__label"),a.textContent=[...e.childNodes].filter(l=>l.nodeType===3).map(l=>l.textContent).join(" ").trim();for(let l of[...e.childNodes])l.nodeType===3&&(l.textContent="")}e.prepend(t)}Ge(t,"nodedc-field__label-row"),Ge(a||R(".field-label-text",t),"nodedc-field__label");let n=R("input:not([type=hidden]):not([type=checkbox]),textarea,select",e);n&&!n.id&&(n.id="cms-field-"+ ++c4),n&&e.tagName==="LABEL"&&(e.htmlFor=n.id);for(let l of ve(".field-hint,.group-desc",e))Ge(l,"nodedc-field__description")}for(let e of ve("input:not([type=hidden]):not([type=checkbox]):not([type=file]):not([type=range]),textarea"))e.closest(".cms-ui-island")||Ge(e,"nodedc-field__control")}function x4(){for(let e of ve(".collection-item-card,.json-details,.field-grid,.group-grid")){if(e.dataset.dsSurface||e.matches(".field-grid,.group-grid")&&(e.closest(".collection-item-card")||e.querySelector(".collection-field")))continue;let t=Nn("nestedSurface");for(let a of t.attributes)a.name==="class"?Ge(e,a.value):e.setAttribute(a.name,a.value);e.dataset.dsSurface="true"}for(let e of ve(".settings-card,.content-group,.content-panel")){if(e.dataset.dsCard)continue;e.dataset.dsCard="true",Ge(e,"nodedc-settings-card");let t=R(":scope > .card-head,:scope > .group-head,:scope > .panel-head,:scope > .publish-progress-head",e),a=Nn("card"),n=R(".nodedc-settings-card__head",a),l=R(".nodedc-settings-card__titles",a),o=R(".nodedc-settings-card__body",a);if(n.replaceChildren(l),l.replaceChildren(),o.replaceChildren(),t){let r=R("h3,h2",t)||t,i=R(".section-kicker",t);if(i&&l.append(i),r?.hasAttribute("data-publish-title"))l.append(r);else if(r===t){let s=document.createElement("h2");for(let m of[...r.childNodes])(m.nodeType===3||m.nodeType===1&&!m.matches("label,button"))&&s.append(m);l.append(s);for(let m of[...r.children])n.append(m)}else if(r){let s=document.createElement("h2");for(let m of r.attributes)s.setAttribute(m.name,m.value);s.append(...r.childNodes),l.append(s)}let u=R(".project-settings-hint,.panel-note,.group-desc",t)||R(":scope > .group-desc",e);if(u){let s=document.createElement("p");for(let m of u.attributes)s.setAttribute(m.name,m.value);s.classList.add("nodedc-description"),s.append(...u.childNodes),u.remove(),l.append(s)}for(let s of ve(":scope > .toggle-row,:scope > .button-row,:scope > .group-head-toggle,:scope > [data-publish-percent]",t))n.append(s);t.remove()}else n.remove();o.append(...e.childNodes),e.append(...a.childNodes)}}var y4={"move-up":"chevron-up","move-down":"chevron-down",duplicate:"copy",copy:"copy","paste-after":"clipboard","delete-block":"trash","template-modal-close":"close","media-modal-close":"close","media-trash-toggle":"trash","media-delete":"trash"};function v4(){for(let e of ve("button")){if(e.closest(".cms-ui-island,.nodedc-color-palette-surface")||e.className.includes("nodedc-")||e.matches(".media-entry,.knowledge-tree-select,.service-media-source-button,.service-media-file-button,.media-breadcrumb-button,.template-card"))continue;let t=e.matches(".icon-action-btn,.collection-icon-btn,.knowledge-tree-action,.secret-toggle-button,.collection-drag-handle,.modal-close-button,.media-header-action"),a=Nn(t?"iconButton":"button");if(Ge(e,a.className),t){let n=e.getAttribute("aria-label")||e.title||e.textContent;e.setAttribute("aria-label",n),e.title=n;let l=y4[e.id]||(e.classList.contains("secret-toggle-button")?"eye":/удал/i.test(n)?"trash":/добав/i.test(n)?"plus":/выше|вверх|поднять/i.test(n)?"chevron-up":/ниже|вниз|опустить/i.test(n)?"chevron-down":/коп|дублир/i.test(n)?"copy":"move");e.replaceChildren(e.matches(".collection-drag-handle")?Nn("dragHandle").firstElementChild:Nn("icon-"+l))}else{e.dataset.variant=e.matches(".primary-btn,[type=submit]")?"primary":e.matches(".danger-btn")?"danger":"secondary",e.dataset.tone="neutral";let n=a.firstElementChild;n.replaceChildren(...e.childNodes),e.append(n)}}}function L4(){for(let e of ve(".block-btn,.knowledge-tree-select")){Ge(e,"nodedc-admin-panel__nav-item"),e.dataset.active=String(e.classList.contains("active")||e.closest(".knowledge-tree-row")?.dataset.active==="true");let t=R(".block-name,.knowledge-tree-title",e);t&&(e.title=t.textContent);let a=R(".block-icon,.knowledge-tree-icon",e);a&&!a.dataset.dsIcon&&(a.dataset.dsIcon="true",Ge(a,"nodedc-admin-panel__nav-icon"),a.replaceChildren(Nn("icon-"+(e.classList.contains("knowledge-tree-select")?"file":"layers"))));let n=R(".block-drag-handle",e);n&&(Ge(n,"nodedc-drag-handle"),n.dataset.dsIcon||(n.dataset.dsIcon="true",n.replaceChildren(Nn("dragHandle").firstElementChild)))}for(let e of ve(".region-title"))Ge(e,"nodedc-admin-panel__group-label")}function b4(){for(let e of ve(".knowledge-tree-actions")){let t=ve(":scope > button",e);if(t.length<2)continue;let a=pl(e),n=e.closest(".knowledge-tree-row")?.querySelector(".knowledge-tree-title")?.textContent||"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B",l=t.map(r=>({label:r.title||r.getAttribute("aria-label"),disabled:r.disabled})),o=JSON.stringify([n,l]);o!==a.signature&&(a.signature=o,(0,Rn.flushSync)(()=>a.root.render(qe(ha,{minWidth:240,placement:"bottom-end",trigger:r=>qe(pt,{label:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F: "+n,ref:i=>{r.setAnchorRef(i),r.setTriggerRef(i)},onClick:r.toggle,"aria-expanded":r.open,"aria-controls":r.surfaceId,"aria-haspopup":"menu"},qe(ie,{name:"chevron-down"}))},({close:r})=>t.map((i,u)=>qe("button",{key:u,type:"button",role:"menuitem",className:"nodedc-dropdown-option",disabled:i.disabled,onClick:()=>{r(),i.click()}},qe("span",null),qe("span",{className:"nodedc-dropdown-option__body"},qe("span",{className:"nodedc-dropdown-option__label"},l[u].label))))))))}}function S4(){let e=matchMedia("(max-width:760px)").matches,t=R("#dirty-state"),a=pl(t),n=t.dataset.dirty==="true"?"warning":"neutral",l=t.textContent,o=JSON.stringify([n,l,e]);a.signature!==o&&(a.signature=o,(0,Rn.flushSync)(()=>a.root.render(qe(rL,{tone:n,variant:e?"indicator":"badge",title:l,"aria-label":l,role:"status"},e?null:l))));let r=R("#cms-mobile-actions-binding");r||(r=document.createElement("span"),r.id="cms-mobile-actions-binding",R(".cms-editor-actions").append(r));let i=pl(r),u=["reload","render","publish"].map(c=>R("#"+c));for(let c of u)c.hidden=e;if(i.host.hidden=!e,!e)return;let s=u.filter(c=>!c.classList.contains("hidden")).map(c=>({button:c,label:c.id==="reload"?"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435":c.textContent,disabled:c.disabled})),m=JSON.stringify(s.map(({label:c,disabled:p})=>[c,p]));i.signature!==m&&(i.signature=m,(0,Rn.flushSync)(()=>i.root.render(qe(ha,{minWidth:240,placement:"bottom-end",trigger:c=>qe(pt,{label:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441 \u0441\u0430\u0439\u0442\u043E\u043C",ref:p=>{c.setAnchorRef(p),c.setTriggerRef(p)},onClick:c.toggle,"aria-expanded":c.open,"aria-controls":c.surfaceId,"aria-haspopup":"menu"},qe(ie,{name:"chevron-down"}))},({close:c})=>s.map(({button:p,label:h,disabled:v})=>qe("button",{key:p.id,type:"button",role:"menuitem",className:"nodedc-dropdown-option",disabled:v,onClick:()=>{c(),p.click()}},qe("span",null),qe("span",{className:"nodedc-dropdown-option__body"},qe("span",{className:"nodedc-dropdown-option__label"},h))))))))}function C4(){let e={".service-media-field":"nodedc-media-field",".field-label-row":"nodedc-media-field__label-row",".field-label-text":"nodedc-media-field__label",".service-media-control":"nodedc-media-control",".service-media-file-control":"nodedc-media-file",".service-media-file-button":"nodedc-media-file__button",".service-media-file-name":"nodedc-media-file__name",".service-media-url-input":"nodedc-media-url",".service-media-source-switch":"nodedc-media-source-switch",".service-media-source-button":"nodedc-media-source-button",".service-media-preview":"nodedc-media-preview",".media-upload-hint":"nodedc-media-field__hint",".media-upload-error":"nodedc-media-field__error"};for(let t of ve(".service-media-field")){for(let[n,l]of Object.entries(e))for(let o of t.matches(n)?[t]:ve(n,t))Ge(o,l);for(let n of ve(".service-media-source-button",t))n.setAttribute("aria-pressed",n.dataset.active);let a=R(".service-media-control",t);a&&(a.dataset.source=R(".service-media-url-input",t).hidden?"file":"url")}}function w4(){for(let e of ve(".template-modal-layer")){let t=R(":scope > article",e),a=R(":scope > header",t),n=R(":scope > footer",t),l=document.createElement("div");l.className="nodedc-window__body";for(let i of[...t.children])i!==a&&i!==n&&l.append(i);a&&(Ge(a,"nodedc-window__head"),Ge(R("h2",a),"nodedc-window__title")),n&&Ge(n,"nodedc-window__footer"),t.replaceChildren(...[a,l,n].filter(Boolean)),t.dataset.size=e.id==="media-modal"||e.id==="template-modal"?"lg":"sm",Ge(t,"nodedc-glass nodedc-material-rim"),t.dataset.tone="strong";let o=e.getAttribute("aria-labelledby");o&&t.setAttribute("aria-labelledby",o),e.removeAttribute("role"),e.removeAttribute("aria-modal");let r=tp({overlay:e,dialog:t,closeOnBackdrop:!1,closeOnEscape:!1,lockBodyScroll:!1});lu.push({overlay:e,dialog:t,controller:r})}for(let e of ve("dialog.site-dialog")){let t=document.createElement("div");t.className="hidden",e.before(t),t.append(e),e.setAttribute("open",""),e.dataset.size="sm",Ge(e,"nodedc-glass nodedc-material-rim"),e.dataset.tone="strong";let a=R("form",e),n=document.createElement("header"),l=document.createElement("div"),o=R(".site-dialog-actions",a);n.className="nodedc-window__head",l.className="nodedc-window__body";let r=document.createElement("div");r.className="nodedc-window__titles",n.append(r);let i=R("h2",a);i.id=e.id+"-title",e.setAttribute("aria-labelledby",i.id),i.className="nodedc-window__title",r.append(i),l.append(...[...a.childNodes].filter(m=>m!==o)),o.classList.add("nodedc-window__footer"),a.replaceChildren(n,l,o);let u,s=tp({overlay:t,dialog:e,closeOnEscape:!0,lockBodyScroll:!1,onOpenChange:m=>{t.classList.toggle("hidden",!m),m||requestAnimationFrame(()=>u?.focus())}});e.showModal=()=>{u=document.activeElement,document.body.append(t),t.classList.remove("hidden"),s.open()},e.close=()=>{t.classList.add("hidden"),s.close()},lu.push({overlay:t,dialog:e,controller:s})}}function ip(){rp?.disconnect();try{for(let[n,l]of ou)n.isConnected||(l.root.unmount(),l.host.remove(),ou.delete(n));x4(),g4(),m4(),f4(),p4(),h4(),v4(),L4(),b4(),S4(),C4(),R("#cms-shell").inert=!1;for(let n of lu)n.dialog.inert=!1;for(let n of lu){let l=!n.overlay.classList.contains("hidden");l&&!n.controller.isOpen()?(document.body.append(n.overlay),n.controller.open()):!l&&n.controller.isOpen()&&n.controller.close()}let e=ve(".nodedc-overlay:not(.hidden):not([hidden])").at(-1);R("#cms-shell").inert=!!e;for(let n of lu)n.dialog.inert=!!(e&&n.overlay!==e);R("#delete-modal-body").textContent==="\u0412\u044B \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430?"&&(R("#delete-modal-body").textContent="\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442?"),R("#delete-modal-confirm").textContent.trim()==="\u0414\u0430"&&(R("#delete-modal-confirm").textContent="\u0423\u0434\u0430\u043B\u0438\u0442\u044C");let t=R("#regions > section:first-child .block-btn");if(t){let n=t.closest(".cms-static-row");n||(n=document.createElement("div"),n.className="cms-static-row",t.before(n),n.append(t)),n.append(dd)}else dd&&R("#cms-add-block-parking").append(dd);let a=R("#dirty-state");a.dataset.tone=a.dataset.dirty==="true"?"warning":"neutral";for(let n of ve(".nodedc-header__nav-item"))n.dataset.active==="true"?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current")}finally{rp?.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","disabled","data-dirty","data-active","hidden","aria-valuenow"]})}}function TL(){ML(),dd=R("#add-block");for(let a of ve("[data-cms-mode]"))a.closest("button").id="admin-mode-"+a.dataset.cmsMode;R(".nodedc-header-navigation").classList.add("nodedc-expanded-nav-group"),R(".nodedc-admin-panel__nav").id="regions",R(".nodedc-application-panel__titles h1").id="selected-title",R(".nodedc-application-panel__titles p").id="selected-region",R("#status").setAttribute("role","status"),R("#status").setAttribute("aria-live","polite");let e=R("#cms-shell"),t=SL({navigationOpen:!0,activeView:"cms",contentExpanded:!0,onChange:a=>{R(".cms-stage").hidden=a.navigationOpen||a.contentOpen,e.dataset.navigationOpen=String(a.navigationOpen),e.dataset.contentOpen=String(a.contentOpen),e.dataset.contentExpanded=String(a.contentExpanded),R(".nodedc-app-shell__navigation").hidden=!a.navigationOpen,R(".nodedc-app-shell__navigation").inert=matchMedia("(max-width:760px)").matches&&a.contentOpen,R(".nodedc-app-shell__content").hidden=!a.contentOpen}});matchMedia("(max-width:760px)").addEventListener("change",a=>{R(".nodedc-app-shell__navigation").inert=a.matches&&t.getState().contentOpen,Tn()}),R("#toggle-navigation").onclick=()=>{matchMedia("(max-width:760px)").matches&&t.getState().contentOpen&&t.closeView(),t.openNavigation()},R("#open-navigation").onclick=()=>t.openNavigation(),R(".nodedc-admin-panel__close").onclick=()=>t.closeNavigation(),R(".nodedc-application-panel [data-action=close]").onclick=()=>{t.closeView(),t.openNavigation()},document.addEventListener("click",a=>{a.target.closest(".block-btn,.knowledge-tree-select,#project-settings,#admin-mode-content,#admin-mode-seo,#admin-mode-knowledge")&&(t.openView("cms"),queueMicrotask(()=>R(".nodedc-application-panel__body").scrollTop=0)),Tn()}),document.addEventListener("input",Tn),document.addEventListener("change",Tn),w4(),ip(),rp=new MutationObserver(Tn),ip()}TL();await Promise.resolve().then(()=>(nS(),BI)); diff --git a/docs/design-guideline-adoption.md b/docs/design-guideline-adoption.md index 7ee8721..5279164 100644 --- a/docs/design-guideline-adoption.md +++ b/docs/design-guideline-adoption.md @@ -91,8 +91,11 @@ Verified: dark/light, accent change and reload persistence, reset to white, nested palette Escape, 390px modal, plus/template picker, pointer drag/reorder (discarded), switching independent sites, and the shared component/type checks. -Collection entries and JSON disclosures consume `GlassSurface tone="soft"` +Form groups, collection entries and JSON disclosures consume `GlassSurface tone="soft"` with its shared padding/radius/material. The former app-local translucent item background accumulated across nested cards and converged with TextField fill; using the canonical opaque nested surface preserves visible field zones in both themes without adding borders or changing input tokens. +Form groups outside collections use the same nested surface so light-theme +white inputs remain separated from white outer panels; collections already +provide that surface and do not receive a second wrapper or double padding. diff --git a/ui/src/design-system.mjs b/ui/src/design-system.mjs index 4130fcb..0c4de89 100644 --- a/ui/src/design-system.mjs +++ b/ui/src/design-system.mjs @@ -137,8 +137,10 @@ function fields() { function cards() { // Use the library's opaque nested surface: translucent local layers made // collection backgrounds converge with the field material at greater depth. - for (const region of all(".collection-item-card,.json-details")) { + for (const region of all(".collection-item-card,.json-details,.field-grid,.group-grid")) { if (region.dataset.dsSurface) continue; + // A collection already owns this surface; avoid stacking or double padding. + if (region.matches(".field-grid,.group-grid") && (region.closest(".collection-item-card") || region.querySelector(".collection-field"))) continue; const surface = clone("nestedSurface"); for (const attribute of surface.attributes) { if (attribute.name === "class") addClass(region, attribute.value);