import{B as I,aG as A,m as N,cq as T,cA as C,V as F,cB as O,cC as j,bx as v,by as g,c8 as V,o as u,e as h,F as E,G as H,P as D,U as X,p as S,i as y,q as x,a0 as f,d as W,u as Y,r as _,N as q,O as J,E as Q,t as Z,h as p,g as b,f as k,k as z,_ as ee}from"./index-D92x6h1h.js";var te=`
    .p-splitter {
        display: flex;
        flex-wrap: nowrap;
        border: 1px solid dt('splitter.border.color');
        background: dt('splitter.background');
        border-radius: dt('border.radius.md');
        color: dt('splitter.color');
    }

    .p-splitter-vertical {
        flex-direction: column;
    }

    .p-splitter-gutter {
        flex-grow: 0;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
        background: dt('splitter.gutter.background');
    }

    .p-splitter-gutter-handle {
        border-radius: dt('splitter.handle.border.radius');
        background: dt('splitter.handle.background');
        transition:
            outline-color dt('splitter.transition.duration'),
            box-shadow dt('splitter.transition.duration');
        outline-color: transparent;
    }

    .p-splitter-gutter-handle:focus-visible {
        box-shadow: dt('splitter.handle.focus.ring.shadow');
        outline: dt('splitter.handle.focus.ring.width') dt('splitter.handle.focus.ring.style') dt('splitter.handle.focus.ring.color');
        outline-offset: dt('splitter.handle.focus.ring.offset');
    }

    .p-splitter-horizontal.p-splitter-resizing {
        cursor: col-resize;
        user-select: none;
    }

    .p-splitter-vertical.p-splitter-resizing {
        cursor: row-resize;
        user-select: none;
    }

    .p-splitter-horizontal > .p-splitter-gutter > .p-splitter-gutter-handle {
        height: dt('splitter.handle.size');
        width: 100%;
    }

    .p-splitter-vertical > .p-splitter-gutter > .p-splitter-gutter-handle {
        width: dt('splitter.handle.size');
        height: 100%;
    }

    .p-splitter-horizontal > .p-splitter-gutter {
        cursor: col-resize;
    }

    .p-splitter-vertical > .p-splitter-gutter {
        cursor: row-resize;
    }

    .p-splitterpanel {
        flex-grow: 1;
        overflow: hidden;
    }

    .p-splitterpanel-nested {
        display: flex;
    }

    .p-splitterpanel .p-splitter {
        flex-grow: 1;
        min-width: 0;
        min-height: 0;
        border: 0 none;
    }
`,ne={root:function(e){var n=e.props;return["p-splitter p-component","p-splitter-"+n.layout]},gutter:"p-splitter-gutter",gutterHandle:"p-splitter-gutter-handle"},ie=I.extend({name:"splitter",style:te,classes:ne}),se={name:"BaseSplitter",extends:A,props:{layout:{type:String,default:"horizontal"},gutterSize:{type:Number,default:4},stateKey:{type:String,default:null},stateStorage:{type:String,default:"session"},step:{type:Number,default:5}},style:ie,provide:function(){return{$pcSplitter:this,$parentInstance:this}}};function m(t){"@babel/helpers - typeof";return m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(t)}function $(t,e,n){return(e=re(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function re(t){var e=ae(t,"string");return m(e)=="symbol"?e:e+""}function ae(t,e){if(m(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var s=n.call(t,e);if(m(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function U(t){return he(t)||ue(t)||le(t)||oe()}function oe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(t,e){if(t){if(typeof t=="string")return w(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}function ue(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function he(t){if(Array.isArray(t))return w(t)}function w(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,s=Array(e);n<e;n++)s[n]=t[n];return s}var G={name:"Splitter",extends:se,inheritAttrs:!1,emits:["resizestart","resizeend","resize"],dragging:!1,mouseMoveListener:null,mouseUpListener:null,touchMoveListener:null,touchEndListener:null,size:null,gutterElement:null,startPos:null,prevPanelElement:null,nextPanelElement:null,nextPanelSize:null,prevPanelSize:null,panelSizes:null,prevPanelIndex:null,timer:null,data:function(){return{prevSize:null}},mounted:function(){this.initializePanels()},watch:{panelSizeConfig:function(){this.initializePanels()}},beforeUnmount:function(){this.clear(),this.unbindMouseListeners()},methods:{isSplitterPanel:function(e){return e.type.name==="SplitterPanel"},getPanelSize:function(e){var n=e.props&&V(e.props.size)?e.props.size:null;return n??100/this.panels.length},initializePanels:function(){var e=this;if(this.panels&&this.panels.length){var n=!1;if(this.isStateful()&&(n=this.restoreState()),!n){var s=U(this.$el.children).filter(function(i){return i.getAttribute("data-pc-name")==="splitterpanel"}),r=[];this.panels.map(function(i,a){var o=e.getPanelSize(i);r[a]=o,s[a].style.flexBasis="calc("+o+"% - "+(e.panels.length-1)*e.gutterSize+"px)"}),this.panelSizes=r,this.prevSize=parseFloat(r[0]).toFixed(4)}}},onResizeStart:function(e,n,s){this.gutterElement=e.currentTarget||e.target.parentElement,this.size=this.horizontal?O(this.$el):j(this.$el),s||(this.dragging=!0,this.startPos=this.layout==="horizontal"?e.pageX||e.changedTouches[0].pageX:e.pageY||e.changedTouches[0].pageY),this.prevPanelElement=this.gutterElement.previousElementSibling,this.nextPanelElement=this.gutterElement.nextElementSibling,s?(this.prevPanelSize=this.horizontal?v(this.prevPanelElement,!0):g(this.prevPanelElement,!0),this.nextPanelSize=this.horizontal?v(this.nextPanelElement,!0):g(this.nextPanelElement,!0)):(this.prevPanelSize=100*(this.horizontal?v(this.prevPanelElement,!0):g(this.prevPanelElement,!0))/this.size,this.nextPanelSize=100*(this.horizontal?v(this.nextPanelElement,!0):g(this.nextPanelElement,!0))/this.size),this.prevPanelIndex=n,this.$emit("resizestart",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter[n].setAttribute("data-p-gutter-resizing",!0),this.$el.setAttribute("data-p-resizing",!0)},onResize:function(e,n,s){var r,i,a;s?this.horizontal?(i=100*(this.prevPanelSize+n)/this.size,a=100*(this.nextPanelSize-n)/this.size):(i=100*(this.prevPanelSize-n)/this.size,a=100*(this.nextPanelSize+n)/this.size):(this.horizontal?F(this.$el)?r=(this.startPos-e.pageX)*100/this.size:r=(e.pageX-this.startPos)*100/this.size:r=(e.pageY-this.startPos)*100/this.size,i=this.prevPanelSize+r,a=this.nextPanelSize-r),this.validateResize(i,a)||(i=Math.min(Math.max(this.prevPanelMinSize,i),100-this.nextPanelMinSize),a=Math.min(Math.max(this.nextPanelMinSize,a),100-this.prevPanelMinSize)),this.prevPanelElement.style.flexBasis="calc("+i+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.nextPanelElement.style.flexBasis="calc("+a+"% - "+(this.panels.length-1)*this.gutterSize+"px)",this.panelSizes[this.prevPanelIndex]=i,this.panelSizes[this.prevPanelIndex+1]=a,this.prevSize=parseFloat(i).toFixed(4),this.$emit("resize",{originalEvent:e,sizes:this.panelSizes})},onResizeEnd:function(e){this.isStateful()&&this.saveState(),this.$emit("resizeend",{originalEvent:e,sizes:this.panelSizes}),this.$refs.gutter.forEach(function(n){return n.setAttribute("data-p-gutter-resizing",!1)}),this.$el.setAttribute("data-p-resizing",!1),this.clear()},repeat:function(e,n,s){this.onResizeStart(e,n,!0),this.onResize(e,s,!0)},setTimer:function(e,n,s){var r=this;this.timer||(this.timer=setInterval(function(){r.repeat(e,n,s)},40))},clearTimer:function(){this.timer&&(clearInterval(this.timer),this.timer=null)},onGutterKeyUp:function(){this.clearTimer(),this.onResizeEnd()},onGutterKeyDown:function(e,n){switch(e.code){case"ArrowLeft":{this.layout==="horizontal"&&this.setTimer(e,n,this.step*-1),e.preventDefault();break}case"ArrowRight":{this.layout==="horizontal"&&this.setTimer(e,n,this.step),e.preventDefault();break}case"ArrowDown":{this.layout==="vertical"&&this.setTimer(e,n,this.step*-1),e.preventDefault();break}case"ArrowUp":{this.layout==="vertical"&&this.setTimer(e,n,this.step),e.preventDefault();break}}},onGutterMouseDown:function(e,n){this.onResizeStart(e,n),this.bindMouseListeners()},onGutterTouchStart:function(e,n){this.onResizeStart(e,n),this.bindTouchListeners(),e.preventDefault()},onGutterTouchMove:function(e){this.onResize(e),e.preventDefault()},onGutterTouchEnd:function(e){this.onResizeEnd(e),this.unbindTouchListeners(),e.preventDefault()},bindMouseListeners:function(){var e=this;this.mouseMoveListener||(this.mouseMoveListener=function(n){return e.onResize(n)},document.addEventListener("mousemove",this.mouseMoveListener)),this.mouseUpListener||(this.mouseUpListener=function(n){e.onResizeEnd(n),e.unbindMouseListeners()},document.addEventListener("mouseup",this.mouseUpListener))},bindTouchListeners:function(){var e=this;this.touchMoveListener||(this.touchMoveListener=function(n){return e.onResize(n.changedTouches[0])},document.addEventListener("touchmove",this.touchMoveListener)),this.touchEndListener||(this.touchEndListener=function(n){e.resizeEnd(n),e.unbindTouchListeners()},document.addEventListener("touchend",this.touchEndListener))},validateResize:function(e,n){return!(e>100||e<0||n>100||n<0||this.prevPanelMinSize>e||this.nextPanelMinSize>n)},unbindMouseListeners:function(){this.mouseMoveListener&&(document.removeEventListener("mousemove",this.mouseMoveListener),this.mouseMoveListener=null),this.mouseUpListener&&(document.removeEventListener("mouseup",this.mouseUpListener),this.mouseUpListener=null)},unbindTouchListeners:function(){this.touchMoveListener&&(document.removeEventListener("touchmove",this.touchMoveListener),this.touchMoveListener=null),this.touchEndListener&&(document.removeEventListener("touchend",this.touchEndListener),this.touchEndListener=null)},clear:function(){this.dragging=!1,this.size=null,this.startPos=null,this.prevPanelElement=null,this.nextPanelElement=null,this.prevPanelSize=null,this.nextPanelSize=null,this.gutterElement=null,this.prevPanelIndex=null},isStateful:function(){return this.stateKey!=null},getStorage:function(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState:function(){C(this.panelSizes)&&this.getStorage().setItem(this.stateKey,JSON.stringify(this.panelSizes))},restoreState:function(){var e=this,n=this.getStorage(),s=n.getItem(this.stateKey);if(s){this.panelSizes=JSON.parse(s);var r=U(this.$el.children).filter(function(i){return i.getAttribute("data-pc-name")==="splitterpanel"});return r.forEach(function(i,a){i.style.flexBasis="calc("+e.panelSizes[a]+"% - "+(e.panels.length-1)*e.gutterSize+"px)"}),!0}return!1},resetState:function(){this.initializePanels()}},computed:{panels:function(){var e=this,n=[];return this.$slots.default().forEach(function(s){e.isSplitterPanel(s)?n.push(s):s.children instanceof Array&&s.children.forEach(function(r){e.isSplitterPanel(r)&&n.push(r)})}),n},panelSizeConfig:function(){var e=this;return this.panels.map(function(n){return e.getPanelSize(n)}).join(",")},gutterStyle:function(){return this.horizontal?{width:this.gutterSize+"px"}:{height:this.gutterSize+"px"}},horizontal:function(){return this.layout==="horizontal"},getPTOptions:function(){var e;return{context:{nested:(e=this.$parentInstance)===null||e===void 0?void 0:e.nestedState}}},prevPanelMinSize:function(){var e=T(this.panels[this.prevPanelIndex],"minSize");return this.panels[this.prevPanelIndex].props&&e?e:0},nextPanelMinSize:function(){var e=T(this.panels[this.prevPanelIndex+1],"minSize");return this.panels[this.prevPanelIndex+1].props&&e?e:0},dataP:function(){var e;return N($($({},this.layout,this.layout),"nested",((e=this.$parentInstance)===null||e===void 0?void 0:e.nestedState)!=null))}}},de=["data-p"],ce=["onMousedown","onTouchstart","onTouchmove","onTouchend","data-p"],pe=["aria-orientation","aria-valuenow","onKeydown","data-p"];function fe(t,e,n,s,r,i){return u(),h("div",S({class:t.cx("root"),"data-p-resizing":!1,"data-p":i.dataP},t.ptmi("root",i.getPTOptions)),[(u(!0),h(E,null,H(i.panels,function(a,o){return u(),h(E,{key:o},[(u(),D(X(a),{tabindex:"-1"})),o!==i.panels.length-1?(u(),h("div",S({key:0,ref_for:!0,ref:"gutter",class:t.cx("gutter"),tabindex:"-1",onMousedown:function(l){return i.onGutterMouseDown(l,o)},onTouchstart:function(l){return i.onGutterTouchStart(l,o)},onTouchmove:function(l){return i.onGutterTouchMove(l,o)},onTouchend:function(l){return i.onGutterTouchEnd(l,o)},"data-p-gutter-resizing":!1,"data-p":i.dataP},{ref_for:!0},t.ptm("gutter")),[y("div",S({class:t.cx("gutterHandle"),role:"separator",tabindex:"0",style:[i.gutterStyle],"aria-orientation":t.layout,"aria-valuenow":r.prevSize,onKeyup:e[0]||(e[0]=function(){return i.onGutterKeyUp&&i.onGutterKeyUp.apply(i,arguments)}),onKeydown:function(l){return i.onGutterKeyDown(l,o)},"data-p":i.dataP},{ref_for:!0},t.ptm("gutterHandle")),null,16,pe)],16,ce)):x("",!0)],64)}),128))],16,de)}G.render=fe;var me={root:function(e){var n=e.instance;return["p-splitterpanel",{"p-splitterpanel-nested":n.isNested}]}},ve=I.extend({name:"splitterpanel",classes:me}),ge={name:"BaseSplitterPanel",extends:A,props:{size:{type:Number,default:null},minSize:{type:Number,default:null}},style:ve,provide:function(){return{$pcSplitterPanel:this,$parentInstance:this}}},L={name:"SplitterPanel",extends:ge,inheritAttrs:!1,data:function(){return{nestedState:null}},computed:{isNested:function(){var e=this;return this.$slots.default().some(function(n){return e.nestedState=n.type.name==="Splitter"?!0:null,e.nestedState})},getPTOptions:function(){return{context:{nested:this.isNested}}}}};function ze(t,e,n,s,r,i){return u(),h("div",S({ref:"container",class:t.cx("root")},t.ptmi("root",i.getPTOptions)),[f(t.$slots,"default")],16)}L.render=ze;const Se={key:0,class:"master-detail__master master-detail__master--phone"},ye={key:1,class:"master-detail__detail master-detail__detail--phone"},Pe=["aria-label"],be={class:"master-detail__master"},Ee={class:"master-detail__detail"},xe=W({__name:"MasterDetailLayout",props:{selectedUuid:{},phoneBreakpoint:{default:768},defaultDetailFraction:{default:30},minMasterFraction:{default:30},minDetailFraction:{default:20},storageKey:{default:void 0}},emits:["update:selectedUuid"],setup(t,{emit:e}){const{t:n}=Y(),s=t,r=e,i=_(globalThis.window!==void 0&&globalThis.window.innerWidth<s.phoneBreakpoint);function a(){i.value=globalThis.window.innerWidth<s.phoneBreakpoint}q(()=>{globalThis.window.addEventListener("resize",a)}),J(()=>{globalThis.window.removeEventListener("resize",a)});function o(c){r("update:selectedUuid",c)}function d(){r("update:selectedUuid",null)}const l=z(()=>i.value&&s.selectedUuid===null),R=z(()=>i.value&&s.selectedUuid!==null),P=z(()=>s.storageKey?`${s.storageKey}:split`:void 0),K=z(()=>100-s.defaultDetailFraction),M=_(0);function B(){if(P.value)try{globalThis.localStorage.removeItem(P.value)}catch{}M.value++}return(c,we)=>(u(),h("div",{class:Q(["master-detail",{"master-detail--phone":i.value}])},[i.value?(u(),h(E,{key:0},[l.value?(u(),h("div",Se,[f(c.$slots,"master",{selectedUuid:t.selectedUuid,select:o,isPhone:i.value},void 0,!0)])):x("",!0),R.value?(u(),h("div",ye,[y("button",{type:"button",class:"master-detail__back","aria-label":p(n)("Back to list"),onClick:d}," ← "+Z(p(n)("Back")),9,Pe),f(c.$slots,"detail",{selectedUuid:t.selectedUuid,close:d,isPhone:i.value},void 0,!0)])):x("",!0)],64)):(u(),D(p(G),{key:M.value,class:"master-detail__splitter","state-key":P.value,"state-storage":"local","gutter-size":6,pt:{gutter:{onDblclick:B,title:p(n)("Drag to resize · double-click to reset")}}},{default:b(()=>[k(p(L),{size:K.value,"min-size":t.minMasterFraction},{default:b(()=>[y("div",be,[f(c.$slots,"master",{selectedUuid:t.selectedUuid,select:o,isPhone:i.value},void 0,!0)])]),_:3},8,["size","min-size"]),k(p(L),{size:t.defaultDetailFraction,"min-size":t.minDetailFraction},{default:b(()=>[y("div",Ee,[f(c.$slots,"detail",{selectedUuid:t.selectedUuid,close:d,isPhone:i.value},void 0,!0)])]),_:3},8,["size","min-size"])]),_:3},8,["state-key","pt"]))],2))}}),Me=ee(xe,[["__scopeId","data-v-c50cdc38"]]);export{Me as M};
