(()=>{"use strict";var t,e={83152:function(t,e,o){var r=this&&this.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var r,n,a=o.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return i},n=this&&this.__spreadArray||function(t,e){for(var o=0,r=e.length,n=t.length;o<r;o++,n++)t[n]=e[o];return t},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var i=a(o(73609));function l(t,e,o){var r=document.createElement("input");r.type="hidden",r.name=e,r.value=o,t.appendChild(r)}window._addHiddenInput=l,window.ActivateWorkflowActionsForDashboard=function(t){var e=document.querySelectorAll("[data-workflow-action-url]");n([],r(e)).forEach((function(e){e.addEventListener("click",(function(o){if(o.preventDefault(),o.stopPropagation(),"launchModal"in e.dataset)ModalWorkflow({url:e.dataset.workflowActionUrl,onload:{action:function(t){var e=document.createElement("input");e.type="hidden",e.name="next",e.value=window.location,i.default("form",t.body).append(e),t.ajaxifyForm(i.default("form",t.body))},success:function(t,e){window.location.href=e.redirect}}});else{var r=document.createElement("form");r.action=e.dataset.workflowActionUrl,r.method="POST",l(r,"csrfmiddlewaretoken",t),l(r,"next",window.location),document.body.appendChild(r),r.submit()}}),{capture:!0})}))},window.ActivateWorkflowActionsForEditView=function(t){var e=i.default(t).get(0),o=document.querySelectorAll("[data-workflow-action-name]");n([],r(o)).forEach((function(t){t.addEventListener("click",(function(o){"workflowActionModalUrl"in t.dataset?(o.preventDefault(),o.stopPropagation(),ModalWorkflow({url:t.dataset.workflowActionModalUrl,onload:{action:function(t){t.ajaxifyForm(i.default("form",t.body))},success:function(o,r){l(e,"action-workflow-action","true"),l(e,"workflow-action-name",t.dataset.workflowActionName),l(e,"workflow-action-extra-data",JSON.stringify(r.cleaned_data)),i.default(e).submit()}}})):(l(e,"action-workflow-action","true"),l(e,"workflow-action-name",t.dataset.workflowActionName))}),{capture:!0})}))}},73609:t=>{t.exports=jQuery}},o={};function r(t){var n=o[t];if(void 0!==n)return n.exports;var a=o[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=e,t=[],r.O=(e,o,n,a)=>{if(!o){var i=1/0;for(c=0;c<t.length;c++){for(var[o,n,a]=t[c],l=!0,d=0;d<o.length;d++)(!1&a||i>=a)&&Object.keys(r.O).every((t=>r.O[t](o[d])))?o.splice(d--,1):(l=!1,a<i&&(i=a));l&&(t.splice(c--,1),e=n())}return e}a=a||0;for(var c=t.length;c>0&&t[c-1][2]>a;c--)t[c]=t[c-1];t[c]=[o,n,a]},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.j=477,(()=>{var t={477:0};r.O.j=e=>0===t[e];var e=(e,o)=>{var n,a,[i,l,d]=o,c=0;for(n in l)r.o(l,n)&&(r.m[n]=l[n]);if(d)var u=d(r);for(e&&e(o);c<i.length;c++)a=i[c],r.o(t,a)&&t[a]&&t[a][0](),t[i[c]]=0;return r.O(u)},o=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),r.O(void 0,[876],(()=>r(83152)));var n=r.O(void 0,[876],(()=>r(90971)));n=r.O(n)})();
//# sourceMappingURL=workflow-action.js.map