{"version":3,"sources":["webpack://wpdev_utils/webpack/bootstrap","webpack://wpdev_utils/external \"wp['i18n']\"","webpack://wpdev_utils/external \"React\"","webpack://wpdev_utils/./lib/options.tsx","webpack://wpdev_utils/./lib/helpers.tsx","webpack://wpdev_utils/./lib/factory/context.tsx","webpack://wpdev_utils/./lib/factory/ajax/routeHttpVerbEnum.tsx","webpack://wpdev_utils/./lib/factory/ajax/commonUrlBuilder.tsx","webpack://wpdev_utils/./lib/factory/ajax/parseResult.tsx","webpack://wpdev_utils/./lib/factory/ajax/commonRequest.tsx","webpack://wpdev_utils/./lib/factory/ajax/createRequestFactory.tsx","webpack://wpdev_utils/./lib/factory/ajax/corruptRestApi.tsx","webpack://wpdev_utils/./lib/factory/i18n.tsx","webpack://wpdev_utils/./lib/wp-api/rest.plugin.get.tsx","webpack://wpdev_utils/./lib/components/button.tsx","webpack://wpdev_utils/./lib/components/notice.tsx","webpack://wpdev_utils/external \"wp\""],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","wp","React","BaseOptions","slug","textDomain","version","restUrl","restNamespace","restRoot","restQuery","restNonce","publicUrl","replace","g","toUpperCase","env","camelCase","slugCamelCase","untrailingslashit","str","endsWith","trailingslashit","createContextFactory","StoreContext","createContext","StoreProvider","children","Provider","useStores","useContext","RouteHttpVerb","WP_REST_API_USE_GLOBAL_METHOD","commonUrlBuilder","location","params","nonce","options","apiUrl","Url","query","permalinkPath","rest_route","pathname","foundParams","path","match","group","getParams","keys","checkParam","indexOf","usePath","namespace","useThisProtocol","href","protocol","set","_wpnonce","method","GET","_method","deepMerge","all","toString","parseResult","url","a","cloneForFallback","clone","json","text","body","console","warn","split","line","startsWith","JSON","parse","lastError","commonRequest","routeRequest","request","settings","POST","allowBody","apiUrlBuilt","fetch","headers","stringify","undefined","ok","responseJSON","detectCorrupRestApiFailed","resultAny","createRequestFactory","urlBuilder","passOptions","handleCorrupRestApi","resolve","forceRerequest","setTimeout","notice","document","getElementById","style","display","li","createElement","innerHTML","childNodes","appendChild","createLocalizationFactory","wpi18nLazy","i18n","localeData","setLocaleData","_n","single","plural","count","args","wpi18n","_nx","context","_x","__","_i","translation","components","interpolate","mixedString","ButtonType","locationRestPluginGet","NoticeType","Button","className","type","rest","buttonClassName","classNames","Primary","Secondary","Notice","classes","Error","Info","Success"],"mappings":"4BACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAAGA,EAAIY,EAAgBV,OAAQF,IAAK,CAG/C,IAFA,IAAIgB,EAAiBJ,EAAgBZ,GACjCiB,GAAY,EACRC,EAAI,EAAGA,EAAIF,EAAed,OAAQgB,IAAK,CAC9C,IAAIC,EAAQH,EAAeE,GACG,IAA3BX,EAAgBY,KAAcF,GAAY,GAE3CA,I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":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonpwpdev_utils\"] = window[\"webpackJsonpwpdev_utils\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([27,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","module.exports = wp['i18n'];","module.exports = React;","/**\n * See PHP file inc/Assets.php.\n */\nabstract class BaseOptions {\n public slug: string;\n public textDomain: string;\n public version: string;\n public restUrl?: string;\n public restNamespace?: string;\n public restRoot?: string;\n public restQuery?: {};\n public restNonce?: string;\n public publicUrl?: string;\n\n /**\n * Convert a slug like \"my-plugin\" to \"myPlugin\". This can\n * be useful for library naming (window[\"\"] is bad because the hyphens).\n *\n * @param slug\n * @returns\n */\n public static slugCamelCase(slug: string) {\n return slug.replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n }\n\n /**\n * Get the slug from the current process (webpack) instead of the PHP plugin output.\n * For some cases you need to use that.\n *\n * @param env\n * @param camelCase\n */\n public static getPureSlug(env: typeof process.env, camelCase = false) {\n return camelCase ? BaseOptions.slugCamelCase(env.slug) : env.slug;\n }\n}\n\nexport { BaseOptions };\n","const untrailingslashit = (str: string): string =>\n str.endsWith(\"/\") || str.endsWith(\"\\\\\") ? untrailingslashit(str.slice(0, -1)) : str;\nconst trailingslashit = (str: string): string => `${untrailingslashit(str)}/`;\n\n// Allows to make an interface extension and make some properties optional (https://git.io/JeK6J)\ntype AllKeyOf = T extends never ? never : keyof T;\ntype Optional = { [P in Extract]?: T[P] };\ntype WithOptional> = T extends never ? never : Omit & Optional;\n\nexport { untrailingslashit, trailingslashit, AllKeyOf, Optional, WithOptional };\n","import { createContext, FC, useContext } from \"react\";\n\n/* istanbul ignore next: no logic in this factory! */\n/**\n * Create context relevant objects to use within React.\n *\n * @param object\n * @returns\n */\nfunction createContextFactory(object: T) {\n /**\n * MobX stores collection\n */\n const StoreContext = createContext(object);\n\n /**\n * MobX HOC to get the context via hook.\n *\n * @param children\n */\n const StoreProvider: FC<{}> = ({ children }) => (\n {children}\n );\n\n /**\n * Get all the MobX stores via a single hook.\n */\n const useStores = () => useContext(StoreContext);\n\n return { StoreContext, StoreProvider, useStores };\n}\n\nexport { createContextFactory };\n","enum RouteHttpVerb {\n GET = \"GET\",\n POST = \"POST\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n PATCH = \"PATCH\"\n}\n\nexport { RouteHttpVerb };\n","import Url from \"url-parse\";\nimport { trailingslashit, untrailingslashit } from \"../../helpers\";\nimport { BaseOptions } from \"../../options\";\nimport { RouteHttpVerb } from \".\";\nimport deepMerge from \"deepmerge\";\n\n// Use _method instead of Http verb\nconst WP_REST_API_USE_GLOBAL_METHOD = true;\n\ninterface RouteLocationInterface {\n path: string;\n namespace?: string;\n method?: RouteHttpVerb;\n}\n\ntype RouteRequestInterface = {}; // POST-Query in JSON-format\ntype RouteParamsInterface = {}; // Parameters in IRouteLocationInterface#path which gets resolved like \"example/:id\", items not found in the URL are appended as GET\ntype RouteResponseInterface = {}; // Result in JSON-format\n\ninterface RequestArgs {\n location: RouteLocationInterface;\n params?: RouteParamsInterface;\n options: {\n restRoot: BaseOptions[\"restRoot\"];\n restNamespace: BaseOptions[\"restNamespace\"];\n restNonce?: BaseOptions[\"restNonce\"];\n restQuery?: BaseOptions[\"restQuery\"];\n };\n}\n\n/**\n * Build an URL for a specific scheme.\n *\n * @param param0\n */\nfunction commonUrlBuilder({\n location,\n params = {},\n nonce = true,\n options\n}: {\n nonce?: boolean;\n} & RequestArgs) {\n const apiUrl = new Url(options.restRoot, true);\n const { query } = apiUrl;\n const permalinkPath = (query.rest_route as string) || apiUrl.pathname; // Determine path from permalink settings\n\n // Find dynamic parameters from URL bindings (like /user/:id)\n const foundParams: string[] = [];\n const path = location.path.replace(/:([A-Za-z0-9-_]+)/g, (match: string, group: string) => {\n foundParams.push(group);\n return (params as any)[group];\n });\n const getParams: any = {};\n\n // Find undeclared body params (which are not bind above) and add it to GET query\n for (const checkParam of Object.keys(params)) {\n if (foundParams.indexOf(checkParam) === -1) {\n getParams[checkParam] = (params as any)[checkParam]; // We do not need `encodeURIComponent` as it is supported by `url-parse` already\n }\n }\n\n const usePath =\n trailingslashit(permalinkPath) + untrailingslashit(location.namespace || options.restNamespace) + path;\n\n // Force protocol from parent location\n const useThisProtocol = new Url(window.location.href).protocol.slice(0, -1);\n apiUrl.set(\"protocol\", useThisProtocol);\n\n // Set path depending on permalink settings\n if (query.rest_route) {\n query.rest_route = usePath; // eslint-disable-line @typescript-eslint/naming-convention\n } else {\n apiUrl.set(\"pathname\", usePath); // Set path\n }\n\n // Append others\n if (nonce && options.restNonce) {\n query._wpnonce = options.restNonce;\n }\n if (WP_REST_API_USE_GLOBAL_METHOD && location.method && location.method !== RouteHttpVerb.GET) {\n query._method = location.method;\n }\n\n return apiUrl.set(\"query\", deepMerge.all([options.restQuery, getParams, query])).toString();\n}\n\nexport {\n WP_REST_API_USE_GLOBAL_METHOD,\n RouteLocationInterface,\n RouteRequestInterface,\n RouteParamsInterface,\n RouteResponseInterface,\n RequestArgs,\n commonUrlBuilder,\n Url\n};\n","import { RouteResponseInterface } from \".\";\n\n/**\n * Get the result of the `Response`. It also handles multiline responses, e. g.\n * a PHP `Notice:` message is output through a conflicting plugin:\n */\nasync function parseResult(url: string, result: Response) {\n const cloneForFallback = result.clone();\n try {\n return (await result.json()) as TResponse;\n } catch (e) {\n // Something went wrong, try each line as result of a JSON string\n const body = await cloneForFallback.text();\n console.warn(`The response of ${url} contains unexpected JSON, try to resolve the JSON line by line...`, {\n body\n });\n let lastError: any;\n for (const line of body.split(\"\\n\")) {\n if (line.startsWith(\"[\") || line.startsWith(\"{\")) {\n try {\n return JSON.parse(line) as TResponse;\n } catch (e) {\n lastError = e;\n }\n }\n }\n throw lastError;\n }\n}\n\nexport { parseResult };\n","import {\n WP_REST_API_USE_GLOBAL_METHOD,\n RouteRequestInterface,\n RouteParamsInterface,\n RouteResponseInterface,\n RequestArgs,\n commonUrlBuilder,\n RouteHttpVerb\n} from \"./\";\nimport deepMerge from \"deepmerge\";\nimport Url from \"url-parse\";\nimport \"whatwg-fetch\"; // window.fetch polyfill\nimport { parseResult } from \".\";\n\n/**\n * Build and execute a specific REST query.\n *\n * @see urlBuilder\n * @returns Result of REST API\n * @throws\n */\nasync function commonRequest<\n TRequest extends RouteRequestInterface,\n TParams extends RouteParamsInterface,\n TResponse extends RouteResponseInterface\n>({\n location,\n options,\n request: routeRequest,\n params,\n settings = {}\n}: {\n request?: TRequest;\n params?: TParams;\n settings?: Partial<{ -readonly [P in keyof Request]: Request[P] }>;\n} & RequestArgs): Promise {\n const url = commonUrlBuilder({ location, params, nonce: false, options });\n\n // Use global parameter (see https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/)\n if (WP_REST_API_USE_GLOBAL_METHOD && location.method && location.method !== RouteHttpVerb.GET) {\n settings.method = RouteHttpVerb.POST;\n } else {\n settings.method = RouteHttpVerb.GET;\n }\n\n // Request with GET/HEAD method cannot have body\n const apiUrl = new Url(url, true);\n const allowBody = [\"HEAD\", \"GET\"].indexOf(settings.method) === -1;\n if (!allowBody && routeRequest) {\n apiUrl.set(\"query\", deepMerge(apiUrl.query, routeRequest));\n }\n\n const apiUrlBuilt = apiUrl.toString();\n const result = await window.fetch(\n apiUrlBuilt,\n deepMerge.all([\n settings,\n {\n headers: {\n \"Content-Type\": \"application/json;charset=utf-8\",\n \"X-WP-Nonce\": options.restNonce\n },\n body: allowBody ? JSON.stringify(routeRequest) : undefined\n }\n ])\n );\n\n // `window.fetch` does not throw an error if the server response an error code.\n if (!result.ok) {\n let responseJSON = undefined;\n try {\n responseJSON = await parseResult(apiUrlBuilt, result);\n } catch (e) {\n // Silence is golden.\n }\n\n // Set this request as failing so the endpoint is probably corrupt (see `corrupRestApi.tsx`)\n settings.method === RouteHttpVerb.GET &&\n (window.detectCorrupRestApiFailed = (window.detectCorrupRestApiFailed || 0) + 1);\n\n const resultAny = result as any;\n resultAny.responseJSON = responseJSON;\n throw resultAny;\n }\n\n return parseResult(apiUrlBuilt, result);\n}\n\nexport { commonRequest };\n","import { BaseOptions } from \"../../options\";\nimport { WithOptional } from \"../..\";\nimport {\n commonUrlBuilder,\n RouteRequestInterface,\n RouteParamsInterface,\n RouteResponseInterface,\n commonRequest\n} from \"./\";\n\n/**\n * Create a uri builder and request function for your specific plugin depending\n * on the rest root and additional parameters.\n *\n * @param options\n * @see urlBuilder\n * @see request\n */\nfunction createRequestFactory(options: BaseOptions) {\n const urlBuilder = (passOptions: WithOptional[0], \"options\">) =>\n commonUrlBuilder({\n ...passOptions,\n options: {\n restNamespace: options.restNamespace,\n restNonce: options.restNonce,\n restQuery: options.restQuery,\n restRoot: options.restRoot\n }\n });\n\n const request = <\n Request extends RouteRequestInterface,\n Params extends RouteParamsInterface,\n Response extends RouteResponseInterface\n >(\n passOptions: WithOptional[0], \"options\"> & {\n params?: Params;\n request?: Request;\n }\n ): Promise =>\n commonRequest({\n ...passOptions,\n options: {\n restNamespace: options.restNamespace,\n restNonce: options.restNonce,\n restQuery: options.restQuery,\n restRoot: options.restRoot\n }\n });\n\n return {\n urlBuilder,\n request\n };\n}\n\nexport { createRequestFactory };\n","declare global {\n interface Window {\n /**\n * This number indicates the failed `GET` requests for all REST API calls.\n * See also `commonRequest.tsx`.\n */\n detectCorrupRestApiFailed: number;\n }\n}\n\nconst WAIT_TO_TEST = 10000;\n\nconst NOTICE_ID = \"notice-corrupt-rest-api\";\n\n/**\n * Register a new endpoint which needs to resolve to a valid JSON result. In this way we\n * can detect a corrupt REST API namespace e. g. it is blocked through a security plugin.\n */\nfunction handleCorrupRestApi(resolve: Record Promise>, forceRerequest = false) {\n // Initially set\n window.detectCorrupRestApiFailed = window.detectCorrupRestApiFailed || 0;\n\n setTimeout(async () => {\n const notice = document.getElementById(NOTICE_ID);\n\n // Only in backend and when a corrupt REST API detected\n if (notice && (window.detectCorrupRestApiFailed > 0 || forceRerequest)) {\n for (const namespace of Object.keys(resolve)) {\n try {\n await resolve[namespace]();\n } catch (e) {\n notice.style.display = \"block\";\n const li = document.createElement(\"li\");\n li.innerHTML = `- ${namespace}`;\n notice.childNodes[1].appendChild(li);\n }\n }\n }\n }, WAIT_TO_TEST);\n}\n\nexport { handleCorrupRestApi };\n","// @see https://github.com/Automattic/wp-calypso/blob/master/packages/i18n-calypso/src/index.js\n\nimport { ReactNode, ReactElement } from \"react\";\nimport interpolate from \"interpolate-components\";\nimport * as wpi18n from \"@wordpress/i18n\";\nimport wp from \"wp\";\n\n/**\n * Create multiple functions for a specific plugin so they can be localized.\n *\n * @param slug The slug which you have registered your i18n assets\n * @returns\n */\nfunction createLocalizationFactory(slug: string) {\n const { wpi18nLazy } = window as any;\n if (wpi18nLazy && wpi18nLazy[slug] && wp && wp.i18n) {\n for (const localeData of wpi18nLazy[slug]) {\n wp.i18n.setLocaleData(localeData, slug);\n }\n }\n\n /**\n * Translates and retrieves the singular or plural form based on the supplied number.\n * For arguments sprintf is used, see http://www.diveintojavascript.com/projects/javascript-sprintf for\n * specification and usage.\n *\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#_n\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#sprintf\n */\n function _n(single: string, plural: string, count: number, ...args: any[]): string {\n return wpi18n.sprintf(wpi18n._n(single, plural, count, slug), ...args) as string;\n }\n\n /**\n * Translates and retrieves the singular or plural form based on the supplied number, with gettext context.\n * For arguments sprintf is used, see http://www.diveintojavascript.com/projects/javascript-sprintf for\n * specification and usage.\n *\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#_n\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#sprintf\n */\n function _nx(single: string, plural: string, count: number, context: string, ...args: any[]): string {\n return wpi18n.sprintf(wpi18n._nx(single, plural, count, context, slug), ...args) as string;\n }\n\n /**\n * Retrieve translated string with gettext context.\n * For arguments sprintf is used, see http://www.diveintojavascript.com/projects/javascript-sprintf for\n * specification and usage.\n *\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#_n\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#sprintf\n */\n function _x(single: string, context: string, ...args: any[]): string {\n return wpi18n.sprintf(wpi18n._x(single, context, slug), ...args) as string;\n }\n\n /**\n * Retrieve the translation of text.\n * For arguments sprintf is used, see http://www.diveintojavascript.com/projects/javascript-sprintf for\n * specification and usage.\n *\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#_n\n * @see https://github.com/WordPress/gutenberg/tree/master/packages/i18n#sprintf\n */\n function __(single: string, ...args: any[]): string {\n return wpi18n.sprintf(wpi18n.__(single, slug), ...args) as string;\n }\n\n /**\n * This function allows you to interpolate react components to your translations.\n * You have to pass an already translated string as argument! For this you can use the other\n * i18n functions like _n() or __().\n *\n * A translation can look like this: \"Hello {{a}}click me{{/a}}.\" and you have to pass\n * a component with key \"a\".\n */\n function _i(translation: string, components?: { [placeholder: string]: ReactElement }): any {\n return interpolate({\n mixedString: translation,\n components\n }) as ReactNode;\n }\n\n return { _n, _nx, _x, __, _i };\n}\n\nexport { createLocalizationFactory };\n","import {\n RouteLocationInterface,\n RouteHttpVerb,\n RouteResponseInterface,\n RouteRequestInterface,\n RouteParamsInterface\n} from \"../factory\";\n\nexport const locationRestPluginGet: RouteLocationInterface = {\n path: \"/plugin\",\n method: RouteHttpVerb.GET\n};\n\nexport type RequestRoutePluginGet = RouteRequestInterface;\n\nexport type ParamsRoutePluginGet = RouteParamsInterface;\n\nexport interface ResponseRoutePluginGet extends RouteResponseInterface {\n Name: string;\n PluginURI: string;\n Version: string;\n Description: string;\n Author: string;\n AuthorURI: string;\n TextDomain: string;\n DomainPath: string;\n Network: boolean;\n Title: string;\n AuthorName: string;\n}\n","import React from \"react\";\nimport { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\n\nenum ButtonType {\n Primary,\n Secondary\n}\n\ninterface ButtonProps {\n [key: string]: any;\n className?: string;\n type?: ButtonType;\n children: ReactNode;\n}\n\nconst Button: FC = ({ className, type, children, ...rest }) => {\n const buttonClassName = classNames(className, {\n \"button-primary\": type === ButtonType.Primary,\n \"button-secondary\": type === ButtonType.Secondary || !type\n });\n return (\n \n );\n};\n\nexport { Button, ButtonType };\n","import React from \"react\";\nimport { ReactNode, FC } from \"react\";\nimport classNames from \"classnames\";\n\nenum NoticeType {\n Error = \"Error\",\n Info = \"Info\",\n Success = \"Success\"\n}\n\ninterface NoticeProps {\n type?: NoticeType;\n children: ReactNode;\n}\n\nconst Notice: FC = ({ type, children }) => {\n const classes = classNames({\n notice: true,\n \"notice-error\": type === NoticeType.Error,\n \"notice-info\": type === NoticeType.Info,\n \"notice-success\": type === NoticeType.Success\n });\n\n return (\n
\n

{children}

\n
\n );\n};\n\nexport { Notice, NoticeType };\n","module.exports = wp;"],"sourceRoot":""}