import{checkArg as r}from"../utilities/checkArg.js";export var WMTSInfo;!function(e){e.applyToEsriApiLayer=async function(e,t){if(r("infoJson",e).isNotMissing(),r("layer",t).isNotMissing(),e.hasOwnProperty("customLayerParameters")&&(t.customLayerParameters={...e.customLayerParameters}),e.hasOwnProperty("customParameters")&&(t.customParameters={...e.customParameters}),e.hasOwnProperty("url")&&null!=e.url&&(t.url=e.url),e.hasOwnProperty("layerIdentifier")){let r;t.sublayers&&(r=t.sublayers.find((r=>r.id===e.layerIdentifier))),r||(r=new((await import("@arcgis/core/layers/support/WMTSSublayer")).default)({id:e.layerIdentifier})),e.hasOwnProperty("tileMatrixSet")&&null!=e.tileMatrixSet&&(r.tileMatrixSetId=e.tileMatrixSet),t.activeLayer=r}},e.fromEsriApiLayer=function(e){r("layer",e).isNotMissing();const t={};return e.customLayerParameters&&(t.customLayerParameters={...e.customLayerParameters}),e.customParameters&&(t.customParameters={...e.customParameters}),e.url&&(t.url=e.url),e.activeLayer&&(t.layerIdentifier=e.activeLayer.id,e.activeLayer.tileMatrixSetId&&(t.tileMatrixSet=e.activeLayer.tileMatrixSetId)),t}}(WMTSInfo||(WMTSInfo={}));