/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{a as O,c as R,d as g,e as u}from"./M3G2IY5Z.js";import{a}from"./V3GUZ2LX.js";import"./EB2LK6CL.js";import"./XRDO4BZF.js";import{b as s,d as o,e as c}from"./77NDVP55.js";import"./WPAMUSBR.js";import"./AZKJO6MZ.js";import"./XJPOVJV7.js";import"./LDNQ56OK.js";import"./3HUY3T5F.js";import"./Z6G5PBUQ.js";import"./TKZAMPEI.js";import"./2IHQU2FX.js";import"./CGLFPVBM.js";import"./5JJMGPOW.js";import"./TYX345MZ.js";import{c as r}from"./5UWT66A7.js";import"./OR4HXHSY.js";var A={[r.channelRead]:s.READ,[r.channelWrite]:s.WRITE,[r.channelReadWrite]:s.READWRITE,[r.channelManage]:s.MANAGE,[r.channelModerate]:s.MODERATE,[r.channelOwner]:s.OWNER},C={[a.anonymous]:{category:o.ANONYMOUS_USER,subCategory:null},[a.authenticated]:{category:o.AUTHENTICATED_USER,subCategory:null},[a.group]:{category:o.GROUP,subCategory:c.MEMBER},[a.groupAdmin]:{category:o.GROUP,subCategory:c.ADMIN},[a.org]:{category:o.ORG,subCategory:c.MEMBER},[a.orgAdmin]:{category:o.ORG,subCategory:c.ADMIN},[a.owner]:{category:o.USER,subCategory:null},[a.user]:{category:o.USER,subCategory:null}};function i(n){function e(l,t){let E=C[t.collaborationType];return E?[...l,Object.assign(Object.assign({},E),{key:t.collaborationId||null,role:A[t.permission]})]:l}return{name:n.name,blockWords:n.blockWords,allowAsAnonymous:n.allowAsAnonymous,channelAclDefinition:n.permissions.reduce(e,[])}}async function f(n,e){let l=i(n),t=await O(Object.assign({data:l},e.hubRequestOptions));return u(t,e.currentUser)}async function I(n,e){let l=i(n),t=await R(Object.assign({channelId:n.id,data:l},e.hubRequestOptions));return u(t,e.currentUser)}async function T(n,e){await g(Object.assign({channelId:n},e.hubRequestOptions))}export{f as createHubChannel,T as deleteHubChannel,I as updateHubChannel};
