"use strict"; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; }; Object.defineProperty(exports, "__esModule", { value: true }); const WarningAggregator = __importStar(require("../../utils/warnings")); const core_plugins_1 = require("../core-plugins"); const ios_plugins_1 = require("../ios-plugins"); const static_plugins_1 = require("../static-plugins"); const packageName = 'expo-document-picker'; const withICloudEntitlement = (config, { appleTeamId }) => { return ios_plugins_1.withEntitlementsPlist(config, config => { config.modResults = setICloudEntitlement(config, config.modResults, appleTeamId); return config; }); }; function setICloudEntitlement(config, entitlementsPlist, appleTeamId) { var _a; if ((_a = config.ios) === null || _a === void 0 ? void 0 : _a.usesIcloudStorage) { // TODO: need access to the appleTeamId for this one! WarningAggregator.addWarningIOS('ios.usesIcloudStorage', 'Enable the iCloud Storage Entitlement from the Capabilities tab in your Xcode project.' // TODO: add a link to a docs page with more information on how to do this ); } return entitlementsPlist; } const withUnversionedDocumentPicker = core_plugins_1.createRunOncePlugin(config => { // No mechanism to get Apple Team ID. config = withICloudEntitlement(config, { appleTeamId: 'TODO-GET-APPLE-TEAM-ID' }); return config; }, packageName); const withDocumentPicker = config => { return static_plugins_1.withStaticPlugin(config, { _isLegacyPlugin: true, plugin: packageName, // If the static plugin isn't found, use the unversioned one. fallback: withUnversionedDocumentPicker, }); }; exports.default = withDocumentPicker; //# sourceMappingURL=expo-document-picker.js.map