/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{checkWasmError as e}from"./wasmUtils.js";function t(t,r,a,o=!1){const c=new a.ClientDataFetchRequestEncoder;c.deleteLater();for(const e of t){const t=n(e,r,a,o);c.add_client_data_fetch_request_parameter(t)}c.encode();const s=c.get_encoding_result();return e(s.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(s.get_byte_buffer())}function n(e,t,n,r){const a=new n.ClientDataKey;a.deleteLater(),a.key_string=e;const o=new n.ClientDataFetchRequestParameter;o.deleteLater(),o.set_key(a);const c=t.get(e);return c&&!r&&(o.v_tag={v_tag:c.version}),o}export{n as clientDataKeyToWasmFetchRequestParam,t as encodeClientDataAtKeysRequest};
