/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunkwoocommerce_rtm_custom_emails"] = self["webpackChunkwoocommerce_rtm_custom_emails"] || []).push([["defaultVendors-1011-14f08062bf568f1a056c5c23015e4bf5-index.js"],{

/***/ 16941:
/*!*****************************************************!*\
  !*** ./node_modules/react-sortablejs/dist/index.js ***!
  \*****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("var $8zHUo$sortablejs = __webpack_require__(/*! sortablejs */ 51474);\nvar $8zHUo$classnames = __webpack_require__(/*! classnames */ 64045);\nvar $8zHUo$react = __webpack_require__(/*! react */ 99196);\nvar $8zHUo$tinyinvariant = __webpack_require__(/*! tiny-invariant */ 2177);\n\nfunction $parcel$interopDefault(a) {\n  return a && a.__esModule ? a.default : a;\n}\nfunction $parcel$export(e, n, v, s) {\n  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nfunction $parcel$exportWildcard(dest, source) {\n  Object.keys(source).forEach(function(key) {\n    if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {\n      return;\n    }\n\n    Object.defineProperty(dest, key, {\n      enumerable: true,\n      get: function get() {\n        return source[key];\n      }\n    });\n  });\n\n  return dest;\n}\n\n$parcel$export(module.exports, \"Sortable\", () => $882b6d93070905b3$re_export$Sortable);\n$parcel$export(module.exports, \"Direction\", () => $882b6d93070905b3$re_export$Direction);\n$parcel$export(module.exports, \"DOMRect\", () => $882b6d93070905b3$re_export$DOMRect);\n$parcel$export(module.exports, \"GroupOptions\", () => $882b6d93070905b3$re_export$GroupOptions);\n$parcel$export(module.exports, \"MoveEvent\", () => $882b6d93070905b3$re_export$MoveEvent);\n$parcel$export(module.exports, \"Options\", () => $882b6d93070905b3$re_export$Options);\n$parcel$export(module.exports, \"PullResult\", () => $882b6d93070905b3$re_export$PullResult);\n$parcel$export(module.exports, \"PutResult\", () => $882b6d93070905b3$re_export$PutResult);\n$parcel$export(module.exports, \"SortableEvent\", () => $882b6d93070905b3$re_export$SortableEvent);\n$parcel$export(module.exports, \"SortableOptions\", () => $882b6d93070905b3$re_export$SortableOptions);\n$parcel$export(module.exports, \"Utils\", () => $882b6d93070905b3$re_export$Utils);\n$parcel$export(module.exports, \"ReactSortable\", () => $7fe8e3ea572bda7a$export$11bbed9ee0012c13);\n\n\n\n\n\nfunction $eb03e74f8f7db1f3$export$1d0aa160432dfea5(node) {\n    if (node.parentElement !== null) node.parentElement.removeChild(node);\n}\nfunction $eb03e74f8f7db1f3$export$6d240faa51aa562f(parent, newChild, index) {\n    const refChild = parent.children[index] || null;\n    parent.insertBefore(newChild, refChild);\n}\nfunction $eb03e74f8f7db1f3$export$d7d742816c28cf91(customs) {\n    $eb03e74f8f7db1f3$export$77f49a256021c8de(customs);\n    $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);\n}\nfunction $eb03e74f8f7db1f3$export$77f49a256021c8de(customs) {\n    customs.forEach((curr)=>$eb03e74f8f7db1f3$export$1d0aa160432dfea5(curr.element));\n}\nfunction $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs) {\n    customs.forEach((curr)=>{\n        $eb03e74f8f7db1f3$export$6d240faa51aa562f(curr.parentElement, curr.element, curr.oldIndex);\n    });\n}\nfunction $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list) {\n    const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);\n    const parentElement = {\n        parentElement: evt.from\n    };\n    let custom = [];\n    switch(mode){\n        case \"normal\":\n            /* eslint-disable */ const item = {\n                element: evt.item,\n                newIndex: evt.newIndex,\n                oldIndex: evt.oldIndex,\n                parentElement: evt.from\n            };\n            custom = [\n                item\n            ];\n            break;\n        case \"swap\":\n            const drag = {\n                element: evt.item,\n                oldIndex: evt.oldIndex,\n                newIndex: evt.newIndex,\n                ...parentElement\n            };\n            const swap = {\n                element: evt.swapItem,\n                oldIndex: evt.newIndex,\n                newIndex: evt.oldIndex,\n                ...parentElement\n            };\n            custom = [\n                drag,\n                swap\n            ];\n            break;\n        case \"multidrag\":\n            custom = evt.oldIndicies.map((curr, index)=>({\n                    element: curr.multiDragElement,\n                    oldIndex: curr.index,\n                    newIndex: evt.newIndicies[index].index,\n                    ...parentElement\n                }));\n            break;\n    }\n    /* eslint-enable */ const customs = $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(custom, list);\n    return customs;\n}\nfunction $eb03e74f8f7db1f3$export$c25cf8080bd305ec(normalized, list) {\n    const a = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list);\n    const b = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, a);\n    return b;\n}\nfunction $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list) {\n    const newList = [\n        ...list\n    ];\n    normalized.concat().reverse().forEach((curr)=>newList.splice(curr.oldIndex, 1));\n    return newList;\n}\nfunction $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, list, evt, clone) {\n    const newList = [\n        ...list\n    ];\n    normalized.forEach((curr)=>{\n        const newItem = clone && evt && clone(curr.item, evt);\n        newList.splice(curr.newIndex, 0, newItem || curr.item);\n    });\n    return newList;\n}\nfunction $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt) {\n    if (evt.oldIndicies && evt.oldIndicies.length > 0) return \"multidrag\";\n    if (evt.swapItem) return \"swap\";\n    return \"normal\";\n}\nfunction $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(inputs, list) {\n    const normalized = inputs.map((curr)=>({\n            ...curr,\n            item: list[curr.oldIndex]\n        })).sort((a, b)=>a.oldIndex - b.oldIndex);\n    return normalized;\n}\nfunction $eb03e74f8f7db1f3$export$7553c81e62e31b7e(props) {\n    /* eslint-disable */ const { list: // react sortable props\n    list , setList: setList , children: children , tag: tag , style: style , className: className , clone: clone , onAdd: // sortable options that have methods we want to overwrite\n    onAdd , onChange: onChange , onChoose: onChoose , onClone: onClone , onEnd: onEnd , onFilter: onFilter , onRemove: onRemove , onSort: onSort , onStart: onStart , onUnchoose: onUnchoose , onUpdate: onUpdate , onMove: onMove , onSpill: onSpill , onSelect: onSelect , onDeselect: onDeselect , ...options } = props;\n    /* eslint-enable */ return options;\n}\n\n\n/** Holds a global reference for which react element is being dragged */ // @todo - use context to manage this. How does one use 2 different providers?\nconst $7fe8e3ea572bda7a$var$store = {\n    dragging: null\n};\nclass $7fe8e3ea572bda7a$export$11bbed9ee0012c13 extends (0, $8zHUo$react.Component) {\n    /* eslint-disable-next-line */ static defaultProps = {\n        clone: (item)=>item\n    };\n    constructor(props){\n        super(props);\n        // @todo forward ref this component\n        this.ref = /*#__PURE__*/ (0, $8zHUo$react.createRef)();\n        // make all state false because we can't change sortable unless a mouse gesture is made.\n        const newList = [\n            ...props.list\n        ].map((item)=>Object.assign(item, {\n                chosen: false,\n                selected: false\n            }));\n        props.setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n        (0, ($parcel$interopDefault($8zHUo$tinyinvariant)))(//@ts-expect-error: Doesn't exist. Will deprecate soon.\n        !props.plugins, `\nPlugins prop is no longer supported.\nInstead, mount it with \"Sortable.mount(new MultiDrag())\"\nPlease read the updated README.md at https://github.com/SortableJS/react-sortablejs.\n      `);\n    }\n    componentDidMount() {\n        if (this.ref.current === null) return;\n        const newOptions = this.makeOptions();\n        (0, ($parcel$interopDefault($8zHUo$sortablejs))).create(this.ref.current, newOptions);\n    }\n    componentDidUpdate(prevProps) {\n        if (prevProps.disabled !== this.props.disabled && this.sortable) this.sortable.option(\"disabled\", this.props.disabled);\n    }\n    render() {\n        const { tag: tag , style: style , className: className , id: id  } = this.props;\n        const classicProps = {\n            style: style,\n            className: className,\n            id: id\n        };\n        // if no tag, default to a `div` element.\n        const newTag = !tag || tag === null ? \"div\" : tag;\n        return /*#__PURE__*/ (0, $8zHUo$react.createElement)(newTag, {\n            // @todo - find a way (perhaps with the callback) to allow AntD components to work\n            ref: this.ref,\n            ...classicProps\n        }, this.getChildren());\n    }\n    getChildren() {\n        const { children: children , dataIdAttr: dataIdAttr , selectedClass: selectedClass = \"sortable-selected\" , chosenClass: chosenClass = \"sortable-chosen\" , dragClass: /* eslint-disable */ dragClass = \"sortable-drag\" , fallbackClass: fallbackClass = \"sortable-falback\" , ghostClass: ghostClass = \"sortable-ghost\" , swapClass: swapClass = \"sortable-swap-highlight\" , filter: /* eslint-enable */ filter = \"sortable-filter\" , list: list ,  } = this.props;\n        // if no children, don't do anything.\n        if (!children || children == null) return null;\n        const dataid = dataIdAttr || \"data-id\";\n        /* eslint-disable-next-line */ return (0, $8zHUo$react.Children).map(children, (child, index)=>{\n            if (child === undefined) return undefined;\n            const item = list[index] || {};\n            const { className: prevClassName  } = child.props;\n            // @todo - handle the function if avalable. I don't think anyone will be doing this soon.\n            const filtered = typeof filter === \"string\" && {\n                [filter.replace(\".\", \"\")]: !!item.filtered\n            };\n            const className = (0, ($parcel$interopDefault($8zHUo$classnames)))(prevClassName, {\n                [selectedClass]: item.selected,\n                [chosenClass]: item.chosen,\n                ...filtered\n            });\n            return /*#__PURE__*/ (0, $8zHUo$react.cloneElement)(child, {\n                [dataid]: child.key,\n                className: className\n            });\n        });\n    }\n    /** Appends the `sortable` property to this component */ get sortable() {\n        const el = this.ref.current;\n        if (el === null) return null;\n        const key = Object.keys(el).find((k)=>k.includes(\"Sortable\"));\n        if (!key) return null;\n        //@ts-expect-error: fix me.\n        return el[key];\n    }\n    /** Converts all the props from `ReactSortable` into the `options` object that `Sortable.create(el, [options])` can use. */ makeOptions() {\n        const DOMHandlers = [\n            \"onAdd\",\n            \"onChoose\",\n            \"onDeselect\",\n            \"onEnd\",\n            \"onRemove\",\n            \"onSelect\",\n            \"onSpill\",\n            \"onStart\",\n            \"onUnchoose\",\n            \"onUpdate\", \n        ];\n        const NonDOMHandlers = [\n            \"onChange\",\n            \"onClone\",\n            \"onFilter\",\n            \"onSort\", \n        ];\n        const newOptions = (0, $eb03e74f8f7db1f3$export$7553c81e62e31b7e)(this.props);\n        DOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerPropAndDOM(name));\n        NonDOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerProp(name));\n        /** onMove has 2 arguments and needs to be handled seperately. */ const onMove1 = (evt, originalEvt)=>{\n            const { onMove: onMove  } = this.props;\n            const defaultValue = evt.willInsertAfter || -1;\n            if (!onMove) return defaultValue;\n            const result = onMove(evt, originalEvt, this.sortable, $7fe8e3ea572bda7a$var$store);\n            if (typeof result === \"undefined\") return false;\n            return result;\n        };\n        return {\n            ...newOptions,\n            onMove: onMove1\n        };\n    }\n    /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop & an `on[Handler]` ReactSortable method.  */ prepareOnHandlerPropAndDOM(evtName) {\n        return (evt)=>{\n            // call the component prop\n            this.callOnHandlerProp(evt, evtName);\n            // calls state change\n            //@ts-expect-error: until @types multidrag item is in\n            this[evtName](evt);\n        };\n    }\n    /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop */ prepareOnHandlerProp(evtName) {\n        return (evt)=>{\n            // call the component prop\n            this.callOnHandlerProp(evt, evtName);\n        };\n    }\n    /** Calls the `props.on[Handler]` function */ callOnHandlerProp(evt, evtName) {\n        const propEvent = this.props[evtName];\n        if (propEvent) propEvent(evt, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    // SORTABLE DOM HANDLING\n    onAdd(evt) {\n        const { list: list , setList: setList , clone: clone  } = this.props;\n        /* eslint-disable-next-line */ const otherList = [\n            ...$7fe8e3ea572bda7a$var$store.dragging.props.list\n        ];\n        const customs = (0, $eb03e74f8f7db1f3$export$4655efe700f887a)(evt, otherList);\n        (0, $eb03e74f8f7db1f3$export$77f49a256021c8de)(customs);\n        const newList = (0, $eb03e74f8f7db1f3$export$eca851ee65ae17e4)(customs, list, evt, clone).map((item)=>Object.assign(item, {\n                selected: false\n            }));\n        setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    onRemove(evt) {\n        const { list: list , setList: setList  } = this.props;\n        const mode = (0, $eb03e74f8f7db1f3$export$1fc0f6205829e19c)(evt);\n        const customs = (0, $eb03e74f8f7db1f3$export$4655efe700f887a)(evt, list);\n        (0, $eb03e74f8f7db1f3$export$a6177d5829f70ebc)(customs);\n        let newList = [\n            ...list\n        ];\n        // remove state if not in clone mode. otherwise, keep.\n        if (evt.pullMode !== \"clone\") newList = (0, $eb03e74f8f7db1f3$export$be2da95e6167b0bd)(customs, newList);\n        else {\n            // switch used to get the clone\n            let customClones = customs;\n            switch(mode){\n                case \"multidrag\":\n                    customClones = customs.map((item, index)=>({\n                            ...item,\n                            element: evt.clones[index]\n                        }));\n                    break;\n                case \"normal\":\n                    customClones = customs.map((item)=>({\n                            ...item,\n                            element: evt.clone\n                        }));\n                    break;\n                case \"swap\":\n                default:\n                    (0, ($parcel$interopDefault($8zHUo$tinyinvariant)))(true, `mode \"${mode}\" cannot clone. Please remove \"props.clone\" from <ReactSortable/> when using the \"${mode}\" plugin`);\n            }\n            (0, $eb03e74f8f7db1f3$export$77f49a256021c8de)(customClones);\n            // replace selected items with cloned items\n            customs.forEach((curr)=>{\n                const index = curr.oldIndex;\n                /* eslint-disable-next-line */ const newItem = this.props.clone(curr.item, evt);\n                newList.splice(index, 1, newItem);\n            });\n        }\n        // remove item.selected from list\n        newList = newList.map((item)=>Object.assign(item, {\n                selected: false\n            }));\n        setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    onUpdate(evt) {\n        const { list: list , setList: setList  } = this.props;\n        const customs = (0, $eb03e74f8f7db1f3$export$4655efe700f887a)(evt, list);\n        (0, $eb03e74f8f7db1f3$export$77f49a256021c8de)(customs);\n        (0, $eb03e74f8f7db1f3$export$a6177d5829f70ebc)(customs);\n        const newList = (0, $eb03e74f8f7db1f3$export$c25cf8080bd305ec)(customs, list);\n        return setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    onStart() {\n        $7fe8e3ea572bda7a$var$store.dragging = this;\n    }\n    onEnd() {\n        $7fe8e3ea572bda7a$var$store.dragging = null;\n    }\n    onChoose(evt) {\n        const { list: list , setList: setList  } = this.props;\n        const newList = list.map((item, index)=>{\n            let newItem = item;\n            if (index === evt.oldIndex) newItem = Object.assign(item, {\n                chosen: true\n            });\n            return newItem;\n        });\n        setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    onUnchoose(evt) {\n        const { list: list , setList: setList  } = this.props;\n        const newList = list.map((item, index)=>{\n            let newItem = item;\n            if (index === evt.oldIndex) newItem = Object.assign(newItem, {\n                chosen: false\n            });\n            return newItem;\n        });\n        setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    onSpill(evt) {\n        const { removeOnSpill: removeOnSpill , revertOnSpill: revertOnSpill  } = this.props;\n        if (removeOnSpill && !revertOnSpill) (0, $eb03e74f8f7db1f3$export$1d0aa160432dfea5)(evt.item);\n    }\n    onSelect(evt) {\n        const { list: list , setList: setList  } = this.props;\n        const newList = list.map((item)=>Object.assign(item, {\n                selected: false\n            }));\n        evt.newIndicies.forEach((curr)=>{\n            const index = curr.index;\n            if (index === -1) {\n                console.log(`\"${evt.type}\" had indice of \"${curr.index}\", which is probably -1 and doesn't usually happen here.`);\n                console.log(evt);\n                return;\n            }\n            newList[index].selected = true;\n        });\n        setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n    onDeselect(evt) {\n        const { list: list , setList: setList  } = this.props;\n        const newList = list.map((item)=>Object.assign(item, {\n                selected: false\n            }));\n        evt.newIndicies.forEach((curr)=>{\n            const index = curr.index;\n            if (index === -1) return;\n            newList[index].selected = true;\n        });\n        setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);\n    }\n}\n\n\nvar $faefaad95e5fcca0$exports = {};\n\n\n$parcel$exportWildcard(module.exports, $faefaad95e5fcca0$exports);\n\n\n//# sourceMappingURL=index.js.map\n\n\n//# sourceURL=webpack://woocommerce-rtm-custom-emails/./node_modules/react-sortablejs/dist/index.js?");

/***/ })

}]);