import{a4 as l,cp as g}from"./index-C88DWJny.js";const r={createClusterGroup:"create-cluster-group",createClusterLink:"create-cluster-link",createGroup:"create-groups",createIdpGroup:"create-idp-groups",editIdpGroup:"edit-idp-groups",createTLSIdentity:"create-tls-identity",createPlacementGroup:"create-placement-group",editPlacementGroup:"edit-placement-group",createStorageBucket:"create-bucket",createStorageBucketKey:"create-bucket-key",editClusterGroups:"edit-cluster-group",editClusterLink:"edit-cluster-link",editClusterMember:"edit-cluster-member",createNetworkDevice:"create-network-device",editNetworkDevice:"edit-network-device",createLocalPeering:"create-local-peering",editLocalPeering:"edit-local-peering",editGroup:"edit-groups",editStorageBucket:"edit-bucket",editStorageBucketKey:"edit-bucket-key",groupIdentities:"group-identities",identityGroups:"identity-groups",instanceSummary:"instance-summary",profileSummary:"profile-summary",createImageRegistry:"create-image-registry",editImageRegistry:"edit-image-registry"},k=()=>{const{project:u}=l(),[o,p]=g(),c=()=>{setTimeout(()=>window.dispatchEvent(new Event("resize")),100)},t=(e,a={})=>{const i=new URLSearchParams;i.set("panel",e);for(const[n,s]of Object.entries(a))s&&i.set(n,s);p(i),c()},d=()=>{const e=new URLSearchParams(o);e.delete("bucket"),e.delete("bucket-key"),e.delete("group"),e.delete("identity"),e.delete("idp-group"),e.delete("instance"),e.delete("member"),e.delete("panel"),e.delete("profile"),e.delete("panel-pool"),e.delete("panel-project"),e.delete("sub-form"),e.delete("target"),e.delete("device-name"),e.delete("local-peering"),e.delete("create-image-registry"),e.delete("image-registry"),p(e),c()};return{bucket:o.get("bucket"),group:o.get("group"),identity:o.get("identity"),idpGroup:o.get("idp-group"),instance:o.get("instance"),key:o.get("bucket-key"),member:o.get("member"),panel:o.get("panel"),pool:o.get("panel-pool"),profile:o.get("profile"),project:o.get("panel-project")??u?.name??"default",subForm:o.get("sub-form"),target:o.get("target")??"",deviceName:o.get("device-name"),localPeering:o.get("local-peering"),imageRegistry:o.get("image-registry"),clear:()=>{d()},openCreateClusterGroup:()=>{t(r.createClusterGroup)},openCreateClusterLink:()=>{t(r.createClusterLink)},openCreateGroup:e=>{const a={};e&&(a["sub-form"]=e),t(r.createGroup,a)},openCreateIdpGroup:()=>{t(r.createIdpGroup)},openCreateStorageBucket:()=>{t(r.createStorageBucket)},openCreateStorageBucketKey:()=>{t(r.createStorageBucketKey)},openCreateTLSIdentity:()=>{t(r.createTLSIdentity)},openEditClusterGroup:e=>{t(r.editClusterGroups,{group:e})},openEditClusterLink:e=>{t(r.editClusterLink,{identity:e})},openEditGroup:(e,a)=>{const i={group:e||""};a&&(i["sub-form"]=a),t(r.editGroup,i)},openEditIdpGroup:e=>{t(r.editIdpGroup,{"idp-group":e||""})},openEditMember:e=>{t(r.editClusterMember,{member:e})},openCreatePlacementGroup:()=>{t(r.createPlacementGroup)},openEditPlacementGroup:e=>{t(r.editPlacementGroup,{group:e||""})},openEditStorageBucket:(e,a,i)=>{const n={bucket:e||"","panel-pool":a||"",target:i||""};t(r.editStorageBucket,n)},openEditStorageBucketKey:e=>{const a={"bucket-key":e||""};t(r.editStorageBucketKey,a)},openEditNetworkDevice:e=>{const a={"device-name":e};t(r.editNetworkDevice,a)},openCreateNetworkDevice:()=>{t(r.createNetworkDevice)},openCreateLocalPeering:()=>{t(r.createLocalPeering)},openEditLocalPeering:e=>{const a={"local-peering":e||""};t(r.editLocalPeering,a)},openGroupIdentities:e=>{t(r.groupIdentities,{group:e||""})},openIdentityGroups:e=>{const a=new URLSearchParams(o);a.append("identity",e||""),t(r.identityGroups,Object.fromEntries(a))},openInstanceSummary:(e,a)=>{t(r.instanceSummary,{instance:e,"panel-project":a})},openProfileSummary:(e,a)=>{t(r.profileSummary,{profile:e,"panel-project":a})},openCreateImageRegistry:()=>{t(r.createImageRegistry)},openEditImageRegistry:e=>{t(r.editImageRegistry,{"image-registry":e})}}};export{r as p,k as u};
