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AR,EARY,CAAhB;AAYA,iEAAerN,KAAf;;;;;;;;;;;;;;;AChba;;AAEb;AACA;AACA;AAEAsN,2DAAS,CACR,kBADQ,EAER,gBAFQ,EAGRC,iEAHQ,CAAT;;;;;;;;;;;ACNA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEnDA;UACA;UACA;UACA;UACA","sources":["webpack://aikit/./src/components/aiKitControls.js","webpack://aikit/./src/icons.js","webpack://aikit/./src/index.js","webpack://aikit/./src/style.scss?f778","webpack://aikit/external window [\"wp\",\"blockEditor\"]","webpack://aikit/external window [\"wp\",\"components\"]","webpack://aikit/external window [\"wp\",\"compose\"]","webpack://aikit/external window [\"wp\",\"element\"]","webpack://aikit/external window [\"wp\",\"hooks\"]","webpack://aikit/external window [\"wp\",\"i18n\"]","webpack://aikit/webpack/bootstrap","webpack://aikit/webpack/runtime/chunk loaded","webpack://aikit/webpack/runtime/compat get default export","webpack://aikit/webpack/runtime/define property getters","webpack://aikit/webpack/runtime/hasOwnProperty shorthand","webpack://aikit/webpack/runtime/make namespace object","webpack://aikit/webpack/runtime/jsonp chunk loading","webpack://aikit/webpack/before-startup","webpack://aikit/webpack/startup","webpack://aikit/webpack/after-startup"],"sourcesContent":["\"use strict\";\n\nimport { BlockControls } from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {Fragment, useState} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport icons from '../icons.js'\nimport { Button, Modal } from '@wordpress/components';\n\nconst allowedBlockTypes = [\n 'core/code',\n 'core/freeform',\n 'core/heading',\n 'core/list',\n 'core/list-item',\n 'core/paragraph',\n 'core/preformatted',\n];\n\n\nasync function createBlockForAutocompletion(placement = 'below') {\n let selectedBlockClientIds = getSelectedBlockClientIds();\n let [selectionStart, selectionEnd] = getAdjustedSelections(selectedBlockClientIds);\n let lastBlockClientId = selectionEnd.clientId;\n let firstBlockClientId = selectionStart.clientId;\n let lastBlock = wp.data.select('core/block-editor').getBlock(lastBlockClientId);\n let loadingSpinner = createLoadingSpinner();\n\n if (placement === 'above') {\n let autoCompleteBlock = wp.blocks.createBlock('core/paragraph', {content: loadingSpinner});\n\n // get index of first block\n let index = wp.data.select('core/block-editor').getBlockIndex(firstBlockClientId);\n // get parent client id of first block\n let parentClientId = wp.data.select('core/block-editor').getBlockRootClientId(firstBlockClientId);\n\n // insert autocomplete block before the selected block\n await wp.data.dispatch('core/block-editor').insertBlock(\n autoCompleteBlock,\n index,\n parentClientId\n );\n\n return autoCompleteBlock;\n }\n\n // if there is more than one block selected or the last block is not a paragraph, add a new autocomplete block at the end.\n if (selectedBlockClientIds.length > 1 || lastBlock.name !== 'core/paragraph' ) { // add a new block after the selected block\n let autoCompleteBlock = wp.blocks.createBlock('core/paragraph', {content: loadingSpinner});\n let parentBlockClientId = wp.data.select('core/block-editor').getBlockRootClientId(lastBlockClientId);\n let indexToInsertAt = wp.data.select('core/block-editor').getBlockIndex(lastBlockClientId) + 1;\n\n if (!wp.data.select('core/block-editor').canInsertBlockType('core/paragraph', parentBlockClientId)) {\n while (parentBlockClientId) {\n indexToInsertAt = wp.data.select('core/block-editor').getBlockIndex(parentBlockClientId) + 1;\n parentBlockClientId = wp.data.select('core/block-editor').getBlockRootClientId(parentBlockClientId);\n if (wp.data.select('core/block-editor').canInsertBlockType('core/paragraph', parentBlockClientId)) {\n break;\n }\n }\n }\n\n // insert after the last block\n await wp.data.dispatch('core/block-editor').insertBlock(\n autoCompleteBlock,\n indexToInsertAt,\n parentBlockClientId\n );\n\n return autoCompleteBlock;\n }\n\n let parentBlockClientId = wp.data.select('core/block-editor').getBlockRootClientId(lastBlockClientId);\n if (!wp.data.select('core/block-editor').canInsertBlockType('core/paragraph', parentBlockClientId)) {\n // try to insert the block with every parent block until we find one that works\n while (parentBlockClientId) {\n parentBlockClientId = wp.data.select('core/block-editor').getBlockRootClientId(parentBlockClientId);\n if (wp.data.select('core/block-editor').canInsertBlockType('core/paragraph', parentBlockClientId)) {\n break;\n }\n }\n\n let autoCompleteBlock = wp.blocks.createBlock('core/paragraph', {content: loadingSpinner});\n\n // insert the block at the end of the parent block\n await wp.data.dispatch('core/block-editor').insertBlock(autoCompleteBlock, undefined, parentBlockClientId);\n\n return autoCompleteBlock;\n }\n\n let lastBlockContent = extractBlockContent(lastBlock);\n let richText = wp.richText.create({html: lastBlockContent});\n\n let start = 0;\n let end = lastBlockContent.length;\n\n if ('offset' in selectionEnd) {\n end = selectionEnd.offset;\n }\n\n let firstPart = wp.richText.slice(richText, start, end);\n let secondPart = wp.richText.slice(richText, end, richText.text.length);\n\n let firstPartContent = wp.richText.toHTMLString({value: firstPart});\n let secondPartContent = wp.richText.toHTMLString({value: secondPart});\n\n let inheritedAttributes = lastBlock.attributes;\n\n // create block with first part\n const key = selectionEnd.attributeKey\n let firstBlockAttributes = inheritedAttributes;\n firstBlockAttributes[key] = firstPartContent;\n const firstPartBlock = wp.blocks.createBlock(lastBlock.name, firstBlockAttributes);\n\n // create autocomplete block\n let autoCompleteAttributes = inheritedAttributes;\n autoCompleteAttributes[key] = loadingSpinner;\n let autoCompleteBlock = wp.blocks.createBlock('core/paragraph', autoCompleteAttributes);\n\n // create block with second part\n let secondBlockAttributes = inheritedAttributes;\n secondBlockAttributes[key] = secondPartContent;\n const secondPartBlock = wp.blocks.createBlock(lastBlock.name, secondBlockAttributes);\n\n let replacementBlocks = [\n firstPartBlock,\n autoCompleteBlock,\n secondPartBlock,\n ];\n\n if (secondPart.text.trim().length === 0) {\n replacementBlocks = [\n firstPartBlock,\n autoCompleteBlock,\n ];\n }\n\n // replace the last block with the first part and the second part as a new block\n await wp.data.dispatch('core/block-editor').replaceBlock(lastBlockClientId, replacementBlocks);\n\n return autoCompleteBlock;\n}\n\nfunction createLoadingSpinner() {\n // generate random id for loading spinner\n const loadingSpinnerId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);\n return '';\n}\n\nfunction getSelectedBlockClientIds() {\n let selectedBlockClientIds = wp.data.select('core/block-editor').getMultiSelectedBlockClientIds();\n\n if (selectedBlockClientIds.length === 0) {\n selectedBlockClientIds = [wp.data.select('core/block-editor').getSelectedBlockClientId()];\n }\n\n return selectedBlockClientIds;\n}\n\nfunction getAdjustedSelections(selectedBlockClientIds) {\n const selectionStart = wp.data.select( 'core/block-editor' ).getSelectionStart();\n const selectionEnd = wp.data.select( 'core/block-editor' ).getSelectionEnd();\n\n if (selectionStart.clientId === selectionEnd.clientId) {\n return [selectionStart, selectionEnd];\n }\n\n let adjustedSelectionStart = selectionStart;\n let adjustedSelectionEnd = selectionEnd;\n if (selectedBlockClientIds.length > 0 && selectedBlockClientIds[0] === selectionEnd.clientId) {\n adjustedSelectionStart = selectionEnd;\n adjustedSelectionEnd = selectionStart;\n }\n\n return [adjustedSelectionStart, adjustedSelectionEnd];\n}\n\nfunction extractBlockContent(block) {\n let content = '';\n if ('content' in block.attributes) {\n content = block.attributes.content;\n } else if ('citation' in block.attributes) {\n content = block.attributes.citation;\n } else if ('value' in block.attributes) {\n content = block.attributes.value;\n } else if ('values' in block.attributes) {\n content = block.attributes.values;\n } else if ('text' in block.attributes) {\n content = block.attributes.text;\n }\n\n return content;\n}\n\n\nfunction getSelectedBlockContents() {\n let multiSelectedBlockClientIds = getSelectedBlockClientIds();\n let [selectionStart, selectionEnd] = getAdjustedSelections(multiSelectedBlockClientIds);\n\n let allContent = getAllBlockContentsRecursively(\n multiSelectedBlockClientIds,\n selectionStart,\n selectionEnd\n );\n\n return allContent.trim();\n}\n\n// a function that takes a set of block client ids and returns the content of all of them and all their children recursively as a string\nfunction getAllBlockContentsRecursively(blockClientIds, selectionStart, selectionEnd) {\n let content = '';\n blockClientIds.forEach(blockClientId => {\n const block = wp.data.select( 'core/block-editor' ).getBlock(blockClientId);\n let contentOfBlock = extractBlockContent(block);\n\n const richText = wp.richText.create( { html: contentOfBlock } );\n\n let plainText = richText.text;\n let start = 0;\n let end = plainText.length;\n\n if (selectionStart.clientId === blockClientId && 'offset' in selectionStart) {\n start = selectionStart.offset;\n }\n\n if (selectionEnd.clientId === blockClientId && 'offset' in selectionEnd) {\n end = selectionEnd.offset;\n }\n\n plainText = plainText.substring(start, end);\n\n content += \"\\n\" + plainText;\n if (block.innerBlocks.length > 0) {\n content += getAllBlockContentsRecursively(block.innerBlocks.map(block => block.clientId));\n }\n });\n\n return content;\n}\n\nasync function doAutocompleteRequest(requestType, text, selectedLanguage) {\n const siteUrl = aikit.siteUrl\n const nonce = aikit.nonce\n const response = await fetch(siteUrl + \"/?rest_route=/aikit/openai/v1/autocomplete&type=\" + requestType, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-WP-Nonce': nonce,\n },\n body: JSON.stringify({\n text: text,\n language: selectedLanguage,\n })\n }).catch(async error => {\n throw new Error(await error.text());\n })\n\n if (!response.ok) {\n throw new Error(await response.text());\n }\n\n const data = await response.json()\n // Todo: handle errors\n\n return data.text\n}\n\nasync function doImageGenerationRequest(imageCount, imageSize, text, selectedLanguage) {\n const siteUrl = aikit.siteUrl\n const nonce = aikit.nonce\n const response = await fetch(siteUrl + \"/?rest_route=/aikit/openai/v1/generate-images&count=\" + imageCount + \"&size=\" + imageSize, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-WP-Nonce': nonce,\n },\n body: JSON.stringify({\n text: text,\n language: selectedLanguage,\n })\n }).catch(async error => {\n throw new Error(await error.text());\n })\n\n if (!response.ok) {\n throw new Error(await response.text());\n }\n\n const data = await response.json()\n // Todo: handle errors\n\n return data\n}\n\n\nasync function autocomplete(requestType, autocompleteBlock, selectedText) {\n let autocompletedText = '';\n let selectedLanguage = aikit.selectedLanguage;\n try {\n autocompletedText = await doAutocompleteRequest(requestType, selectedText, selectedLanguage);\n } catch (error) {\n // remove the block\n await wp.data.dispatch('core/block-editor').removeBlocks(autocompleteBlock.clientId);\n\n alert('An API error occurred with the following response body: \\n\\n' + error.message);\n return;\n }\n const autocompletedTextWithLineBreaks = autocompletedText.replace(/\\n/g, '');\n\n let attributes = autocompleteBlock.attributes;\n attributes.content = autocompletedTextWithLineBreaks;\n\n if (aikit.autocompletedTextBackgroundColor !== '') {\n let style = attributes.style || {};\n style.color = style.color || {};\n style.color.background = aikit.autocompletedTextBackgroundColor;\n attributes.style = style;\n }\n\n wp.data.dispatch('core/block-editor').updateBlock(autocompleteBlock.clientId, attributes);\n}\n\nasync function generateImages(imageCount, imageSize, autocompleteBlock, selectedText) {\n let selectedLanguage = aikit.selectedLanguage;\n let result = {\n images: [],\n };\n try {\n result = await doImageGenerationRequest(imageCount, imageSize, selectedText, selectedLanguage);\n } catch (error) {\n // remove the block\n await wp.data.dispatch('core/block-editor').removeBlocks(autocompleteBlock.clientId);\n\n alert('An API error occurred with the following response body: \\n\\n' + error.message);\n return;\n }\n\n if (!Array.isArray(result.images)) {\n await wp.data.dispatch('core/block-editor').removeBlocks(autocompleteBlock.clientId);\n alert('An API error occurred with the following response body: \\n\\n' + result.images);\n return;\n }\n\n // create a gallery block\n const galleryBlock = wp.blocks.createBlock('core/gallery', {});\n\n let imageIds = [];\n let imageObjects = [];\n // add images to the gallery block\n result.images.forEach(image => {\n galleryBlock.innerBlocks.push(wp.blocks.createBlock('core/image', {\n url: image.url,\n id: image.id,\n }));\n imageIds.push(image.id);\n imageObjects.push({\n id: image.id,\n fullUrl: image.url,\n url: image.url,\n sizeSlug: 'full',\n });\n });\n\n // add the image ids to the gallery block attributes\n galleryBlock.attributes.ids = imageIds;\n galleryBlock.attributes.images = imageObjects;\n\n // replace the autocomplete block with the gallery block\n wp.data.dispatch('core/block-editor').replaceBlocks(autocompleteBlock.clientId, galleryBlock);\n}\n\nexport default createHigherOrderComponent( ( BlockEdit ) => {\n return ( props ) => {\n\n // if it's not a text block, return the original block\n if (!allowedBlockTypes.includes(props.name)) {\n return ;\n }\n\n const [ isSelectionModalOpen, setSelectionModalState ] = useState( false );\n const openSelectionModal = () => setSelectionModalState( true );\n const closeSelectionModal = () => setSelectionModalState( false );\n\n const [ isSettingsModalOpen, setSettingsModalState ] = useState( false );\n const openSettingsModal = () => setSettingsModalState( true );\n const closeSettingsModal = () => setSettingsModalState( false );\n\n function getSelectedText() {\n let selectedText = getSelectedBlockContents();\n\n if (selectedText.length > 0) {\n return selectedText;\n }\n\n openSelectionModal();\n\n return false;\n }\n\n function isProperlyConfigured() {\n if (aikit.isOpenAIKeyValid === undefined || aikit.isOpenAIKeyValid === \"0\" || aikit.isOpenAIKeyValid === \"\" || aikit.isOpenAIKeyValid === false) {\n return false;\n }\n\n return true;\n }\n\n function goToSettingsPage() {\n window.location.href = '/wp-admin/options-general.php?page=aikit';\n }\n\n let autocompleteTypes = [];\n Object.keys(aikit.prompts).forEach(function(operationId, index) {\n autocompleteTypes.push({\n label: aikit.prompts[operationId].menuTitle,\n requiresTextSelection: aikit.prompts[operationId].requiresTextSelection,\n operationId: operationId,\n icon: aikit.prompts[operationId].icon,\n generatedTextPlacement: aikit.prompts[operationId].generatedTextPlacement,\n });\n });\n\n // just to that these are included in the translations\n let smallImageTitle = __(\"small image(s)\", \"aikit\");\n let mediumImageTitle = __(\"medium image(s)\", \"aikit\");\n let largeImageTitle = __(\"large image(s)\", \"aikit\");\n\n let imageGenerationOptions = [];\n for (let size in aikit.imageGenerationOptions.sizes) {\n let resolution = aikit.imageGenerationOptions.sizes[size];\n for (let count of aikit.imageGenerationOptions.counts) {\n imageGenerationOptions.push({\n title: count + ' x ' + __(size + \" image(s)\", \"aikit\") + ' (' + resolution + ')',\n count: count,\n size: size,\n });\n }\n }\n\n return (\n \n \n \n \n {\n return {\n title: autocompleteType.label,\n icon: icons[autocompleteType.icon],\n onClick: async () => {\n\n if (!isProperlyConfigured()) {\n openSettingsModal();\n return;\n }\n\n const placement = autocompleteType.generatedTextPlacement || 'below';\n\n if (autocompleteType.requiresTextSelection) {\n const selectedText = getSelectedText();\n if (selectedText) {\n const block = await createBlockForAutocompletion(placement);\n await autocomplete( autocompleteType.operationId, block, selectedText);\n }\n } else {\n const block = await createBlockForAutocompletion(placement);\n await autocomplete( autocompleteType.operationId, block, '');\n }\n },\n };\n },)\n }\n />\n \n \n {\n return {\n title: imageGenerationOption.title,\n icon: icons[imageGenerationOption.size + \"Image\"],\n onClick: async () => {\n\n if (!isProperlyConfigured()) {\n openSettingsModal();\n return;\n }\n\n const placement = 'above';\n\n const selectedText = getSelectedText();\n if (selectedText) {\n const block = await createBlockForAutocompletion(placement);\n await generateImages( imageGenerationOption.count, imageGenerationOption.size, block, selectedText);\n }\n },\n };\n },)\n }\n />\n \n { isSelectionModalOpen && (\n \n \n {__('Please make sure to select the text you want to use for AIKit to edit (or operate on).', 'aikit')}\n \n \n \n {__('Ok', 'aikitt')}\n \n \n \n ) }\n { isSettingsModalOpen && (\n \n \n {__('It seems that AIKit is not configured correctly. Please make sure to enter a valid API key in the settings.', 'aikit')}\n \n \n \n {__('Go to settings', 'aikit')}\n \n \n \n ) }\n \n \n );\n };\n}, 'aiKitControls' );\n","\"use strict\";\n\nconst icons = {};\n\nicons.aiEdit = \n \n \n \n \n \n \n \n \n \n \n \n\n\nicons.aiKitImage = \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\nicons.smallImage = \n \n \n\n\nicons.mediumImage = \n \n \n\n\nicons.largeImage = \n \n \n\n\n\nicons.troll = \n \n \n \n \n\n\nicons.baby = \n \n \n\n\nicons.idea = \n \n\n\nicons.summary = \n \n \n\n\nicons.zip = \n \n \n\n\nicons.laugh = \n \n\n\nicons.megaphone = \n \n \n\n\nicons.tongue = \n \n\n\nicons.funnel = \n \n \n\n\nicons.paraphrase = \n \n \n\n\nicons.summaryConcise = \n \n \n \n\n\nicons.paragraph = \n \n\n\n\nicons.pencil = \n \n\n\nicons.title = \n \n\n\nicons.summarize = \n \n\n\nicons.image = \n \n \n\n\nicons.bulletPoints = \n \n\n\nicons.quote = \n \n \n \n\n\n\nicons.custom = \n \n \n\n\nicons.article = \n \n \n\n\n\nexport default icons;\n","\"use strict\";\n\nimport { addFilter } from '@wordpress/hooks';\nimport './style.scss';\nimport aiKitControls from \"./components/aiKitControls\";\n\naddFilter(\n\t'editor.BlockEdit',\n\t'aikit/controls',\n\taiKitControls,\n);\n\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"compose\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"hooks\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkaikit\"] = self[\"webpackChunkaikit\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["BlockControls","ToolbarGroup","ToolbarDropdownMenu","createHigherOrderComponent","Fragment","useState","__","icons","Button","Modal","allowedBlockTypes","createBlockForAutocompletion","placement","selectedBlockClientIds","getSelectedBlockClientIds","selectionStart","selectionEnd","getAdjustedSelections","lastBlockClientId","clientId","firstBlockClientId","lastBlock","wp","data","select","getBlock","loadingSpinner","createLoadingSpinner","autoCompleteBlock","blocks","createBlock","content","index","getBlockIndex","parentClientId","getBlockRootClientId","dispatch","insertBlock","length","name","parentBlockClientId","indexToInsertAt","canInsertBlockType","undefined","lastBlockContent","extractBlockContent","richText","create","html","start","end","offset","firstPart","slice","secondPart","text","firstPartContent","toHTMLString","value","secondPartContent","inheritedAttributes","attributes","key","attributeKey","firstBlockAttributes","firstPartBlock","autoCompleteAttributes","secondBlockAttributes","secondPartBlock","replacementBlocks","trim","replaceBlock","loadingSpinnerId","Math","random","toString","substring","getMultiSelectedBlockClientIds","getSelectedBlockClientId","getSelectionStart","getSelectionEnd","adjustedSelectionStart","adjustedSelectionEnd","block","citation","values","getSelectedBlockContents","multiSelectedBlockClientIds","allContent","getAllBlockContentsRecursively","blockClientIds","forEach","blockClientId","contentOfBlock","plainText","innerBlocks","map","doAutocompleteRequest","requestType","selectedLanguage","siteUrl","aikit","nonce","response","fetch","method","headers","body","JSON","stringify","language","catch","error","Error","ok","json","doImageGenerationRequest","imageCount","imageSize","autocomplete","autocompleteBlock","selectedText","autocompletedText","removeBlocks","alert","message","autocompletedTextWithLineBreaks","replace","autocompletedTextBackgroundColor","style","color","background","updateBlock","generateImages","result","images","Array","isArray","galleryBlock","imageIds","imageObjects","image","push","url","id","fullUrl","sizeSlug","ids","replaceBlocks","BlockEdit","props","includes","isSelectionModalOpen","setSelectionModalState","openSelectionModal","closeSelectionModal","isSettingsModalOpen","setSettingsModalState","openSettingsModal","closeSettingsModal","getSelectedText","isProperlyConfigured","isOpenAIKeyValid","goToSettingsPage","window","location","href","autocompleteTypes","Object","keys","prompts","operationId","label","menuTitle","requiresTextSelection","icon","generatedTextPlacement","smallImageTitle","mediumImageTitle","largeImageTitle","imageGenerationOptions","size","sizes","resolution","count","counts","title","aiEdit","autocompleteType","onClick","aiKitImage","imageGenerationOption","display","justifyContent","float","fillRule","clipRule","strokeLinejoin","strokeMiterlimit","smallImage","mediumImage","largeImage","troll","baby","enableBackground","idea","summary","zip","laugh","megaphone","tongue","funnel","paraphrase","summaryConcise","paragraph","pencil","summarize","bulletPoints","quote","custom","article","addFilter","aiKitControls"],"sourceRoot":""}
\n {__('Please make sure to select the text you want to use for AIKit to edit (or operate on).', 'aikit')}\n
\n {__('It seems that AIKit is not configured correctly. Please make sure to enter a valid API key in the settings.', 'aikit')}\n