@clickview/lite 0.28.0-rc.0 → 0.28.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundles.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "appBundle": "bundle-5e4e5c117f.min.js",
2
+ "appBundle": "bundle-a8c6e031cf.min.js",
3
3
  "cssBundle": "lite-app-c1541c263e.css",
4
4
  "polyfillBundle": "polyfills-2cc10e11a0.min.js"
5
5
  }
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[7891],{38365:(e,t,n)=>{n.d(t,{n:()=>E,W:()=>w});var a=n(1024),r=n(92802),o=n(99910),i=n(1048),l=n(79014),c=n(73814),s=n(36848),u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};function m(e){var t=e.label,n=e.checkboxLabelClassName,r=e.checkboxLabelFontWeight,i=e.className,l=u(e,["label","checkboxLabelClassName","checkboxLabelFontWeight","className"]);return a.createElement(o.Form.Group,null,a.createElement("div",{className:"custom-control custom-checkbox ".concat(i)},a.createElement(E,Object.assign({className:"custom-control-input"},l)),a.createElement(o.Form.Label,{className:"custom-control-label cursor-pointer ".concat("normal"===r?"font-weight-normal":""," \n ").concat(n),htmlFor:l.id},t),e.checkboxAppLink&&e.checkboxAppLinkText&&a.createElement(a.Fragment,null,a.createElement("span",null," "),a.createElement(s.F,{appLink:e.checkboxAppLink,className:"info-link"},e.checkboxAppLinkText))))}var d=n(83914),p=n(58130),b=n(83345);function v(e){var t=(0,r.u6)().values[e.fieldName];return"string"!=typeof t?a.createElement(a.Fragment,null):a.createElement("div",{className:"float-right text-muted font-weight-normal"},t.length,"/",e.limit," characters")}const f={revealPassword:"jCfI0",passwordInput:"RBJnf",passwordContainer:"d78lK",passwordContainerDisabled:"asbVo",infoTooltip:"wzyOG"};function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var g=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n},y="shared.formField";function E(e){var t,n,o=e.children,c=g(e,["children"]),s=(t=a.useState(e.type),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=o.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw r}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],m=s[1],b=l.q.isFunction(o)?function(e){return o(e)}:a.Children.count(o)?o:null;if("password"!==c.type)return a.createElement(r.gN,Object.assign({},i.t.omit(c,["formSize"])),b);var v="position-relative ".concat(f.passwordContainer);return c.className&&(v+=" ".concat(c.className)),c.disabled&&(v+=" ".concat(f.passwordContainerDisabled)),a.createElement("div",{className:v},a.createElement(r.gN,Object.assign({},i.t.omit(c,["formSize","type","className"]),{type:u,className:"".concat(f.passwordInput," border-0 w-100 h-100 outline-none rounded")}),b),"password"===c.type&&a.createElement(d.x,{svgName:"password"===u?p.vn.VisibleOn:p.vn.VisibleOff,className:"svg-container cursor-pointer ".concat(f.revealPassword),onClick:function(){m("password"===u?"text":"password")}}))}function w(e){var t=e.label,n=e.className,l=e.showCharacterCounter,s=e.showRequiredStar,u=e.infoTooltip,h=e.infoTooltipPlacement,w=e.infoText,C=e.formSize,k=e.showOptionalLabel,S=g(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","infoTooltipPlacement","infoText","formSize","showOptionalLabel"]),O=(0,r.u6)(),x=O.errors,N=O.touched,F=function(){};if("checkbox"===S.type){var I=i.t.omit(e,["formSize"]);return e.disabled&&(I.onChange=F),a.createElement(m,Object.assign({},I))}var R=Object.assign(Object.assign({},S),{className:c.w.getCustomFormControlClassName(x,N,S.name,C,n)});return e.disabled&&(R.onChange=F),a.createElement(o.Form.Group,null,!!t&&a.createElement(o.Form.Label,{htmlFor:S.id,className:"d-flex align-items-center"},t,s&&a.createElement("span",{className:"text-danger"},"*"),u&&a.createElement(d.x,{className:"svg-container text-muted ".concat(f.infoTooltip),svgName:p.vn.Info,title:u,tooltipPlacement:h,tooltipSpanHack:!0}),k&&a.createElement("span",{className:"text-muted"}," ",a.createElement(b.x,{namespace:y,phrase:"optional"})),!!l&&!!S.maxLength&&a.createElement("div",{className:"ml-auto"},a.createElement(v,{fieldName:S.name,limit:S.maxLength}))),a.createElement(E,Object.assign({},R)),!!w&&a.createElement(o.Form.Text,{className:"text-muted"},w),a.createElement(r.Bc,{name:S.name},(function(e){return a.createElement(o.Form.Control.Feedback,{type:"invalid"},e)})))}E.defaultProps={autoComplete:"off"},w.defaultProps={autoComplete:"off",infoTooltipPlacement:"top"}},82644:(e,t,n)=>{n.d(t,{b:()=>u,n:()=>s});var a=n(1024),r=n(92802),o=n(79014),i=n(1048);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};function s(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,s=e.initialValues,u=e.onSubmit,m=c(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),d=t&&e.validationSchema?e.validationSchema.cast(function(e){if(!e)return{};var t=i.t.deepClone(e);return function e(n){Object.keys(t).forEach((function(a){t.hasOwnProperty(a)&&(i.t.isObject(n[a])?e(n[a]):null===t[a]&&delete t[a])}))}(t),t}(s)):s,p={allowInitialSubmit:e.allowInitialSubmit};return a.createElement(r.J9,Object.assign({enableReinitialize:!0},m,{initialValues:d,onSubmit:function(t,a){var r=a.setSubmitting,o=a.resetForm,i=a.setFieldError,c=n&&e.validationSchema?e.validationSchema.cast(t):t;u(c,(function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.reset&&o(),n.errors)for(var a=0,c=Object.entries(n.errors);a<c.length;a++){var s=(e=c[a],t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,l=[],c=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=o.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],m=s[1];i(u,m)}r(!1)}))},initialStatus:p}),o.q.isFunction(e.children)?function(t){return e.children(t)}:a.Children.count(e.children)?e.children:null)}function u(){return(0,r.u6)()}s.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0}},73814:(e,t,n)=>{n.d(t,{w:()=>r});var a=n(92802),r={getCustomFormControlClassName:function(e,t,n,r,o){var i="form-control";return"sm"===r&&(i+=" form-control-sm"),"lg"===r&&(i+=" form-control-lg"),(0,a.u9)(t,n)&&(0,a.u9)(e,n)&&(i+=" is-invalid"),o&&(i+=" ".concat(o)),i}}},4948:(e,t,n)=>{function a(e){var t;return e?null===(t=null==e?void 0:e._parentVideo)||void 0===t?void 0:t.id:null}n.d(t,{B:()=>a})},9064:(e,t,n)=>{function a(e){var t,n,a,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;var i=Object.assign(Object.assign(Object.assign({},e),o),{id:e.id,interactiveId:e.interactiveId,name:e.name});return(null===(t=null==e?void 0:e._parentClip)||void 0===t?void 0:t.id)&&(i.clip={id:null===(n=null==e?void 0:e._parentClip)||void 0===n?void 0:n.id}),(null===(a=null==e?void 0:e._parentVideo)||void 0===a?void 0:a.id)&&(i.video={id:null===(r=null==e?void 0:e._parentVideo)||void 0===r?void 0:r.id}),i}n.d(t,{T:()=>a})},25050:(e,t,n)=>{n.r(t),n.d(t,{EditInteractiveDetailsView:()=>_});var a=n(1024),r=n.n(a),o=n(58566),i=n(23481),l=n(20354),c=n(81886),s=n(28400),u=n(9111),m=n(69883),d=n(4948),p=n(20768),b=n(1575),v=n(5960),f=n(5173),h=n(92802),g=n(99910),y=n(82644),E=n(58564),w=n(54610),C=n(68626),k=n(38365),S=n(13876),O=n(83345),x=n(89965),N=n(27022);const F={dropdownMenu:"eDHti"};function I(e){function t(t){return e.selectedContentRegions.some((function(e){return e.id.toString()===t.id.toString()}))}var n,a=e.options.find((function(e){return e.systemName===N.t.GLOBAL})),o=t(a),i=e.options.filter((function(e){return e.systemName!==N.t.GLOBAL}));return r().createElement(g.Dropdown,null,r().createElement(g.Dropdown.Toggle,{id:e.id,variant:"outline-dark"},(null===(n=e.selectedContentRegions)||void 0===n?void 0:n.length)?e.selectedContentRegions.length>1?"".concat(e.selectedContentRegions.length," content regions"):e.selectedContentRegions[0].name:"None"),r().createElement(g.Dropdown.Menu,{className:"".concat(F.dropdownMenu," px-2")},r().createElement(x.X,{key:a.id,label:a.name,name:a.id,id:a.id,onChange:function(){return function(t,n){n?e.onUpdateContentRegions([]):e.onUpdateContentRegions([t])}(a,o)},checked:o,className:"my-1"}),r().createElement(g.Dropdown.Divider,null),i.map((function(n){return r().createElement(x.X,{key:n.id,label:n.name,name:n.id,id:n.id,onChange:function(){return a=n,void(t(n)?e.onUpdateContentRegions(e.selectedContentRegions.filter((function(e){return e.id.toString()!==a.id.toString()}))):e.onUpdateContentRegions(e.selectedContentRegions.concat(a)));var a},checked:t(n),className:"my-1 ".concat(o?"disabled":""),disabled:o})}))))}var R="interactives.editInteractiveDetails",j=i.T.encloseNamespace(R);function P(e){var t,n=e.interactiveMetadata,a=e.onClickCancel,o=(0,y.b)();return r().createElement(h.l0,null,r().createElement("div",{className:"row form-group"},r().createElement("div",{className:"col-5"},r().createElement(E.u,{video:n,type:"cosmetic",imageOptions:{size:w.h2.Small},textPosition:C.z.Independent,preload:!0})),r().createElement("div",{className:"col-7"},r().createElement("h2",{className:"h6"},o.values.name))),r().createElement(k.W,{label:j("nameLabel"),type:"text",name:"name",id:"name",placeholder:j("namePlaceholder"),autoFocus:!0,value:o.values.name}),r().createElement(k.W,{label:j("descriptionLabel"),component:"textarea",name:"description",id:"description",placeholder:j("descriptionPlaceholder"),value:o.values.description}),!!(null===(t=e.contentRegions)||void 0===t?void 0:t.length)&&r().createElement("div",{className:"pb-2"},r().createElement(k.W,{label:j("contentRegions"),name:"contentRegions",id:"contentRegions",value:o.values.contentRegions},(function(){return r().createElement(I,{id:e.interactiveMetadata.id,options:e.contentRegions,selectedContentRegions:o.values.contentRegions,onUpdateContentRegions:function(e){return o.setFieldValue("contentRegions",e)}})})),r().createElement(g.Form.Control.Feedback,{className:"d-block mt-n2",type:"invalid"},o.errors.contentRegions)),r().createElement(g.Form.Label,null,r().createElement(O.x,{namespace:R,phrase:"interactiveFeatures"})),r().createElement(g.Row,null,r().createElement(g.Col,null,r().createElement(g.Form.Group,null,r().createElement("div",{className:"custom-control custom-checkbox"},r().createElement(k.n,{className:"custom-control-input",label:j("preventScrubbingLabel"),name:"preventScrubbing",id:"preventScrubbing",type:"checkbox",checked:o.values.preventScrubbing}),r().createElement(g.Form.Label,{className:"custom-control-label",htmlFor:"preventScrubbing"},r().createElement(O.x,{namespace:R,phrase:"preventScrubbingLabel"})," "),r().createElement("div",{className:"text-secondary"},r().createElement(O.x,{namespace:R,phrase:"preventScrubbingExplain"}))))),r().createElement(g.Col,null,r().createElement(g.Form.Group,null,r().createElement("div",{className:"custom-control custom-checkbox"},r().createElement(k.n,{className:"custom-control-input",label:j("immediateFeedbackLabel"),name:"immediateFeedback",id:"immediateFeedback",type:"checkbox",checked:o.values.immediateFeedback}),r().createElement(g.Form.Label,{className:"custom-control-label",htmlFor:"immediateFeedback"},r().createElement(O.x,{namespace:R,phrase:"immediateFeedbackLabel"})," "),r().createElement("div",{className:"text-secondary"},r().createElement(O.x,{namespace:R,phrase:"immediateFeedbackExplain"})))))),r().createElement(S.u,null,r().createElement(S.u.Cancel,{onClick:a}),r().createElement(S.u.Submit,{variant:"dark",text:e.publish?j("publish"):j("save")})))}function L(e){var t,n,a,o,i,l,c=e.video,s=e.interactive,u=e.interactiveMetadata,m=e.onSubmit,d=e.onClickCancel,p=e.publish,b={name:u.name||"",description:u.description,immediateFeedback:s.immediateFeedback,preventScrubbing:s.preventScrubbing};return(null===(t=e.contentRegions)||void 0===t?void 0:t.length)&&(b.contentRegions=null!==(a=null===(n=u.contentRegions)||void 0===n?void 0:n.data)&&void 0!==a?a:[]),r().createElement(y.n,{initialValues:b,validationSchema:(i=!!(null===(o=e.contentRegions)||void 0===o?void 0:o.length),l={name:f.Z_().trim().max(255,(function(){return j("titleTooLong")})).required((function(){return j("titleRequired")})).default(""),description:f.Z_().max(16e3,(function(){return j("descriptionTooLong")})).default("")},i&&(l.contentRegions=f.IX().min(1,"Resources must have a content region").default([])),f.Ry().shape(l)),allowInitialSubmit:!0,onSubmit:m},r().createElement(P,{interactiveMetadata:u,video:c,onClickCancel:d,publish:p,contentRegions:e.contentRegions}))}var T=n(49985),A=n(65858),V=n(9064),D=n(97291),M=n(14070),U=i.T.encloseNamespace("interactives.editInteractiveDetailsView");function _(e){var t=e.interactiveMetadataId,n=e.publish,r=e.closePopup,i=(0,o.useDispatch)(),f=(0,m.Z)(),h=l.a.useBasicFetch(p.b.interactiveMetadata(t)),g=(0,d.B)(h.data),y=l.a.useBasicFetch(h.data?b.R.video(g):null),E=l.a.useBasicFetch(h.data?p.b.interactive(h.data.interactiveId):null);function w(){f.error(U("error")),r()}function C(){var e=(0,V.T)(h.data);T.k.logUserAction(e,{actionType:n?A.UserAction.Publish:A.UserAction.Edit,entity:A.EntityType.Interactive,location:A.LocationContext.EditInteractiveDetails,workflowPhase:A.WorkflowPhase.Discard,descriptor:n?A.PublishDescriptor.Publish:void 0}),r()}var k=!!y.data&&!!h.data&&!!E.data;return a.createElement(u.G,{title:U(n?"publishHeader":"editHeader"),closePopup:C,showLoadingSpinner:!k},a.createElement(L,{interactive:E.data,interactiveMetadata:h.data,video:y.data,onClickCancel:C,onSubmit:function(e){var a={id:E.data.id,name:e.name,duration:y.data.duration,immediateFeedback:!!e.immediateFeedback,preventScrubbing:!!e.preventScrubbing},o={name:e.name,description:e.description,status:n?v.X.Published:h.data.status},u=0,m=function(){u<1?u++:function(e){r(),f.success(U("success",{name:e,escapeText:!0}));var a=(0,V.T)(h.data);T.k.logUserAction(a,{actionType:n?A.UserAction.Publish:A.UserAction.Edit,entity:A.EntityType.Interactive,location:A.LocationContext.EditInteractiveDetails,workflowPhase:n?A.WorkflowPhase.Complete:A.WorkflowPhase.Save,descriptor:n?A.PublishDescriptor.Publish:void 0}),n&&c.Q.AppLinkHelper.trigger({application:D.O.INTERACTIVES,action:M.e.Interactives.VIEW_INTERACTIVE,args:[t,s.m.slugify(e)]})}(e.name)};l.a.fetch(i,p.b.updateInteractive(E.data.id,a,m,w)),l.a.fetch(i,p.b.updateInteractiveMetadata(h.data.id,o,m,w))},publish:n}))}}}]);
1
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[7891],{38365:(e,t,n)=>{n.d(t,{n:()=>E,W:()=>w});var a=n(1024),r=n(92802),i=n(99910),o=n(1048),l=n(79014),c=n(73814),s=n(36848),u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};function m(e){var t=e.label,n=e.checkboxLabelClassName,r=e.checkboxLabelFontWeight,o=e.className,l=u(e,["label","checkboxLabelClassName","checkboxLabelFontWeight","className"]);return a.createElement(i.Form.Group,null,a.createElement("div",{className:"custom-control custom-checkbox ".concat(o)},a.createElement(E,Object.assign({className:"custom-control-input"},l)),a.createElement(i.Form.Label,{className:"custom-control-label cursor-pointer ".concat("normal"===r?"font-weight-normal":""," \n ").concat(n),htmlFor:l.id},t),e.checkboxAppLink&&e.checkboxAppLinkText&&a.createElement(a.Fragment,null,a.createElement("span",null," "),a.createElement(s.F,{appLink:e.checkboxAppLink,className:"info-link"},e.checkboxAppLinkText))))}var d=n(83914),p=n(58130),b=n(83345);function v(e){var t=(0,r.u6)().values[e.fieldName];return"string"!=typeof t?a.createElement(a.Fragment,null):a.createElement("div",{className:"float-right text-muted font-weight-normal"},t.length,"/",e.limit," characters")}const f={revealPassword:"jCfI0",passwordInput:"RBJnf",passwordContainer:"d78lK",passwordContainerDisabled:"asbVo",infoTooltip:"wzyOG"};function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var g=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n},y="shared.formField";function E(e){var t,n,i=e.children,c=g(e,["children"]),s=(t=a.useState(e.type),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],m=s[1],b=l.q.isFunction(i)?function(e){return i(e)}:a.Children.count(i)?i:null;if("password"!==c.type)return a.createElement(r.gN,Object.assign({},o.t.omit(c,["formSize"])),b);var v="position-relative ".concat(f.passwordContainer);return c.className&&(v+=" ".concat(c.className)),c.disabled&&(v+=" ".concat(f.passwordContainerDisabled)),a.createElement("div",{className:v},a.createElement(r.gN,Object.assign({},o.t.omit(c,["formSize","type","className"]),{type:u,className:"".concat(f.passwordInput," border-0 w-100 h-100 outline-none rounded")}),b),"password"===c.type&&a.createElement(d.x,{svgName:"password"===u?p.vn.VisibleOn:p.vn.VisibleOff,className:"svg-container cursor-pointer ".concat(f.revealPassword),onClick:function(){m("password"===u?"text":"password")}}))}function w(e){var t=e.label,n=e.className,l=e.showCharacterCounter,s=e.showRequiredStar,u=e.infoTooltip,h=e.infoTooltipPlacement,w=e.infoText,C=e.formSize,k=e.showOptionalLabel,S=g(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","infoTooltipPlacement","infoText","formSize","showOptionalLabel"]),O=(0,r.u6)(),x=O.errors,N=O.touched,F=function(){};if("checkbox"===S.type){var I=o.t.omit(e,["formSize"]);return e.disabled&&(I.onChange=F),a.createElement(m,Object.assign({},I))}var R=Object.assign(Object.assign({},S),{className:c.w.getCustomFormControlClassName(x,N,S.name,C,n)});return e.disabled&&(R.onChange=F),a.createElement(i.Form.Group,null,!!t&&a.createElement(i.Form.Label,{htmlFor:S.id,className:"d-flex align-items-center"},t,s&&a.createElement("span",{className:"text-danger"},"*"),u&&a.createElement(d.x,{className:"svg-container text-muted ".concat(f.infoTooltip),svgName:p.vn.Info,title:u,tooltipPlacement:h,tooltipSpanHack:!0}),k&&a.createElement("span",{className:"text-muted"}," ",a.createElement(b.x,{namespace:y,phrase:"optional"})),!!l&&!!S.maxLength&&a.createElement("div",{className:"ml-auto"},a.createElement(v,{fieldName:S.name,limit:S.maxLength}))),a.createElement(E,Object.assign({},R)),!!w&&a.createElement(i.Form.Text,{className:"text-muted"},w),a.createElement(r.Bc,{name:S.name},(function(e){return a.createElement(i.Form.Control.Feedback,{type:"invalid"},e)})))}E.defaultProps={autoComplete:"off"},w.defaultProps={autoComplete:"off",infoTooltipPlacement:"top"}},82644:(e,t,n)=>{n.d(t,{b:()=>u,n:()=>s});var a=n(1024),r=n(92802),i=n(79014),o=n(1048);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]])}return n};function s(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,s=e.initialValues,u=e.onSubmit,m=c(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),d=t&&e.validationSchema?e.validationSchema.cast(function(e){if(!e)return{};var t=o.t.deepClone(e);return function e(n){Object.keys(t).forEach((function(a){t.hasOwnProperty(a)&&(o.t.isObject(n[a])?e(n[a]):null===t[a]&&delete t[a])}))}(t),t}(s)):s,p={allowInitialSubmit:e.allowInitialSubmit};return a.createElement(r.J9,Object.assign({enableReinitialize:!0},m,{initialValues:d,onSubmit:function(t,a){var r=a.setSubmitting,i=a.resetForm,o=a.setFieldError,c=n&&e.validationSchema?e.validationSchema.cast(t):t;u(c,(function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n.reset&&i(),n.errors)for(var a=0,c=Object.entries(n.errors);a<c.length;a++){var s=(e=c[a],t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i,o,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=i.call(n)).done)&&(l.push(a.value),l.length!==t);c=!0);}catch(e){s=!0,r=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],m=s[1];o(u,m)}r(!1)}))},initialStatus:p}),i.q.isFunction(e.children)?function(t){return e.children(t)}:a.Children.count(e.children)?e.children:null)}function u(){return(0,r.u6)()}s.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0}},73814:(e,t,n)=>{n.d(t,{w:()=>r});var a=n(92802),r={getCustomFormControlClassName:function(e,t,n,r,i){var o="form-control";return"sm"===r&&(o+=" form-control-sm"),"lg"===r&&(o+=" form-control-lg"),(0,a.u9)(t,n)&&(0,a.u9)(e,n)&&(o+=" is-invalid"),i&&(o+=" ".concat(i)),o}}},4948:(e,t,n)=>{function a(e){var t;return e?null===(t=null==e?void 0:e._parentVideo)||void 0===t?void 0:t.id:null}n.d(t,{B:()=>a})},9064:(e,t,n)=>{function a(e){var t,n,a,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;var o=Object.assign(Object.assign(Object.assign({},e),i),{id:e.id,interactiveId:e.interactiveId,name:e.name});return(null===(t=null==e?void 0:e._parentClip)||void 0===t?void 0:t.id)&&(o.clip={id:null===(n=null==e?void 0:e._parentClip)||void 0===n?void 0:n.id}),(null===(a=null==e?void 0:e._parentVideo)||void 0===a?void 0:a.id)&&(o.video={id:null===(r=null==e?void 0:e._parentVideo)||void 0===r?void 0:r.id}),o}n.d(t,{T:()=>a})},25050:(e,t,n)=>{n.r(t),n.d(t,{EditInteractiveDetailsView:()=>_});var a=n(1024),r=n.n(a),i=n(58566),o=n(23481),l=n(20354),c=n(81886),s=n(28400),u=n(9111),m=n(69883),d=n(4948),p=n(20768),b=n(1575),v=n(5960),f=n(5173),h=n(92802),g=n(99910),y=n(82644),E=n(58564),w=n(54610),C=n(68626),k=n(38365),S=n(13876),O=n(83345),x=n(89965),N=n(27022);const F={dropdownMenu:"eDHti"};function I(e){function t(t){return e.selectedContentRegions.some((function(e){return e.id.toString()===t.id.toString()}))}var n,a=e.options.find((function(e){return e.systemName===N.t.GLOBAL})),i=t(a),o=e.options.filter((function(e){return e.systemName!==N.t.GLOBAL}));return r().createElement(g.Dropdown,null,r().createElement(g.Dropdown.Toggle,{id:e.id,variant:"outline-dark"},(null===(n=e.selectedContentRegions)||void 0===n?void 0:n.length)?e.selectedContentRegions.length>1?"".concat(e.selectedContentRegions.length," content regions"):e.selectedContentRegions[0].name:"None"),r().createElement(g.Dropdown.Menu,{className:"".concat(F.dropdownMenu," px-2")},r().createElement(x.X,{key:a.id,label:a.name,name:a.id,id:a.id,onChange:function(){return function(t,n){n?e.onUpdateContentRegions([]):e.onUpdateContentRegions([t])}(a,i)},checked:i,className:"my-1"}),r().createElement(g.Dropdown.Divider,null),o.map((function(n){return r().createElement(x.X,{key:n.id,label:n.name,name:n.id,id:n.id,onChange:function(){return a=n,void(t(n)?e.onUpdateContentRegions(e.selectedContentRegions.filter((function(e){return e.id.toString()!==a.id.toString()}))):e.onUpdateContentRegions(e.selectedContentRegions.concat(a)));var a},checked:t(n),className:"my-1 ".concat(i?"disabled":""),disabled:i})}))))}var R="interactives.editInteractiveDetails",j=o.T.encloseNamespace(R);function P(e){var t,n=e.interactiveMetadata,a=e.onClickCancel,i=(0,y.b)();return r().createElement(h.l0,null,r().createElement("div",{className:"row form-group"},r().createElement("div",{className:"col-5"},r().createElement(E.u,{video:n,type:"cosmetic",imageOptions:{size:w.h2.Small},textPosition:C.z.Independent,preload:!0})),r().createElement("div",{className:"col-7"},r().createElement("h2",{className:"h6"},i.values.name))),r().createElement(k.W,{label:j("nameLabel"),type:"text",name:"name",id:"name",placeholder:j("namePlaceholder"),autoFocus:!0,value:i.values.name}),r().createElement(k.W,{label:j("descriptionLabel"),component:"textarea",name:"description",id:"description",placeholder:j("descriptionPlaceholder"),value:i.values.description}),!!(null===(t=e.contentRegions)||void 0===t?void 0:t.length)&&r().createElement("div",{className:"pb-2"},r().createElement(k.W,{label:j("contentRegions"),name:"contentRegions",id:"contentRegions",value:i.values.contentRegions},(function(){return r().createElement("div",{className:"w-50"},r().createElement(I,{id:e.interactiveMetadata.id,options:e.contentRegions,selectedContentRegions:i.values.contentRegions,onUpdateContentRegions:function(e){return i.setFieldValue("contentRegions",e)}}))})),r().createElement(g.Form.Control.Feedback,{className:"d-block mt-n2",type:"invalid"},i.errors.contentRegions)),r().createElement(g.Form.Label,null,r().createElement(O.x,{namespace:R,phrase:"interactiveFeatures"})),r().createElement(g.Row,null,r().createElement(g.Col,null,r().createElement(g.Form.Group,null,r().createElement("div",{className:"custom-control custom-checkbox"},r().createElement(k.n,{className:"custom-control-input",label:j("preventScrubbingLabel"),name:"preventScrubbing",id:"preventScrubbing",type:"checkbox",checked:i.values.preventScrubbing}),r().createElement(g.Form.Label,{className:"custom-control-label",htmlFor:"preventScrubbing"},r().createElement(O.x,{namespace:R,phrase:"preventScrubbingLabel"})," "),r().createElement("div",{className:"text-secondary"},r().createElement(O.x,{namespace:R,phrase:"preventScrubbingExplain"}))))),r().createElement(g.Col,null,r().createElement(g.Form.Group,null,r().createElement("div",{className:"custom-control custom-checkbox"},r().createElement(k.n,{className:"custom-control-input",label:j("immediateFeedbackLabel"),name:"immediateFeedback",id:"immediateFeedback",type:"checkbox",checked:i.values.immediateFeedback}),r().createElement(g.Form.Label,{className:"custom-control-label",htmlFor:"immediateFeedback"},r().createElement(O.x,{namespace:R,phrase:"immediateFeedbackLabel"})," "),r().createElement("div",{className:"text-secondary"},r().createElement(O.x,{namespace:R,phrase:"immediateFeedbackExplain"})))))),r().createElement(S.u,null,r().createElement(S.u.Cancel,{onClick:a}),r().createElement(S.u.Submit,{variant:"dark",text:e.publish?j("publish"):j("save")})))}function L(e){var t,n,a,i,o,l,c=e.video,s=e.interactive,u=e.interactiveMetadata,m=e.onSubmit,d=e.onClickCancel,p=e.publish,b={name:u.name||"",description:u.description,immediateFeedback:s.immediateFeedback,preventScrubbing:s.preventScrubbing};return(null===(t=e.contentRegions)||void 0===t?void 0:t.length)&&(b.contentRegions=null!==(a=null===(n=u.contentRegions)||void 0===n?void 0:n.data)&&void 0!==a?a:[]),r().createElement(y.n,{initialValues:b,validationSchema:(o=!!(null===(i=e.contentRegions)||void 0===i?void 0:i.length),l={name:f.Z_().trim().max(255,(function(){return j("titleTooLong")})).required((function(){return j("titleRequired")})).default(""),description:f.Z_().max(16e3,(function(){return j("descriptionTooLong")})).default("")},o&&(l.contentRegions=f.IX().min(1,"Resources must have a content region").default([])),f.Ry().shape(l)),allowInitialSubmit:!0,onSubmit:m},r().createElement(P,{interactiveMetadata:u,video:c,onClickCancel:d,publish:p,contentRegions:e.contentRegions}))}var T=n(49985),A=n(65858),V=n(9064),D=n(97291),M=n(14070),U=o.T.encloseNamespace("interactives.editInteractiveDetailsView");function _(e){var t=e.interactiveMetadataId,n=e.publish,r=e.closePopup,o=(0,i.useDispatch)(),f=(0,m.Z)(),h=l.a.useBasicFetch(p.b.interactiveMetadata(t)),g=(0,d.B)(h.data),y=l.a.useBasicFetch(h.data?b.R.video(g):null),E=l.a.useBasicFetch(h.data?p.b.interactive(h.data.interactiveId):null);function w(){f.error(U("error")),r()}function C(){var e=(0,V.T)(h.data);T.k.logUserAction(e,{actionType:n?A.UserAction.Publish:A.UserAction.Edit,entity:A.EntityType.Interactive,location:A.LocationContext.EditInteractiveDetails,workflowPhase:A.WorkflowPhase.Discard,descriptor:n?A.PublishDescriptor.Publish:void 0}),r()}var k=!!y.data&&!!h.data&&!!E.data;return a.createElement(u.G,{title:U(n?"publishHeader":"editHeader"),closePopup:C,showLoadingSpinner:!k},a.createElement(L,{interactive:E.data,interactiveMetadata:h.data,video:y.data,onClickCancel:C,onSubmit:function(e){var a={id:E.data.id,name:e.name,duration:y.data.duration,immediateFeedback:!!e.immediateFeedback,preventScrubbing:!!e.preventScrubbing},i={name:e.name,description:e.description,status:n?v.X.Published:h.data.status},u=0,m=function(){u<1?u++:function(e){r(),f.success(U("success",{name:e,escapeText:!0}));var a=(0,V.T)(h.data);T.k.logUserAction(a,{actionType:n?A.UserAction.Publish:A.UserAction.Edit,entity:A.EntityType.Interactive,location:A.LocationContext.EditInteractiveDetails,workflowPhase:n?A.WorkflowPhase.Complete:A.WorkflowPhase.Save,descriptor:n?A.PublishDescriptor.Publish:void 0}),n&&c.Q.AppLinkHelper.trigger({application:D.O.INTERACTIVES,action:M.e.Interactives.VIEW_INTERACTIVE,args:[t,s.m.slugify(e)]})}(e.name)};l.a.fetch(o,p.b.updateInteractive(E.data.id,a,m,w)),l.a.fetch(o,p.b.updateInteractiveMetadata(h.data.id,i,m,w))},publish:n}))}}}]);