@brightspot/ui 6.7.0 → 6.7.1-pr.405.2026.10.26
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/storybook/project.json +1 -1
- package/package.json +1 -1
- package/src/legacy/tool-ui/src/ListManager.css +22 -1
- package/src/legacy/tool-ui/src/SkipLinks.css +3 -3
- package/src/legacy/tool-ui/src/SkipLinks.ts +93 -84
- package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.54b4c735cf930827fa7c.js → RTEProseMirror.e4f881c67b2f3865776b.js} +6 -6
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.b1cc13348e098860f3f2.js → v4.94878a2d8b5c7787df69.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.c39ee07e5ec4ce2be423.css → v5.367effd3850ba2b3ccb2.css} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.a627e1a0e699d6dc16d2.js → v5.de9169aefaf9fc4323ff.js} +3 -3
- /package/src/legacy/tool-ui/src/main/webapp/dist/{RTEProseMirror.54b4c735cf930827fa7c.js.LICENSE.txt → RTEProseMirror.e4f881c67b2f3865776b.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.b1cc13348e098860f3f2.js.LICENSE.txt → v4.94878a2d8b5c7787df69.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.a627e1a0e699d6dc16d2.js.LICENSE.txt → v5.de9169aefaf9fc4323ff.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! For license information please see RTEProseMirror.
|
|
1
|
+
/*! For license information please see RTEProseMirror.e4f881c67b2f3865776b.js.LICENSE.txt */
|
|
2
2
|
(self.webpackChunkbrightspot_cms=self.webpackChunkbrightspot_cms||[]).push([[1386],{20429(e,t,a){var n={"./af":24832,"./af.js":24832,"./ar":61860,"./ar-dz":84546,"./ar-dz.js":84546,"./ar-kw":38853,"./ar-kw.js":38853,"./ar-ly":44370,"./ar-ly.js":44370,"./ar-ma":8053,"./ar-ma.js":8053,"./ar-sa":52783,"./ar-sa.js":52783,"./ar-tn":65425,"./ar-tn.js":65425,"./ar.js":61860,"./az":39980,"./az.js":39980,"./be":61878,"./be.js":61878,"./bg":70936,"./bg.js":70936,"./bm":50734,"./bm.js":50734,"./bn":47337,"./bn-bd":44906,"./bn-bd.js":44906,"./bn.js":47337,"./bo":13328,"./bo.js":13328,"./br":28901,"./br.js":28901,"./bs":91196,"./bs.js":91196,"./ca":26693,"./ca.js":26693,"./cs":93035,"./cs.js":93035,"./cv":81750,"./cv.js":81750,"./cy":717,"./cy.js":717,"./da":94772,"./da.js":94772,"./de":29568,"./de-at":22864,"./de-at.js":22864,"./de-ch":30706,"./de-ch.js":30706,"./de.js":29568,"./dv":29023,"./dv.js":29023,"./el":26818,"./el.js":26818,"./en-au":42741,"./en-au.js":42741,"./en-ca":47887,"./en-ca.js":47887,"./en-gb":85900,"./en-gb.js":85900,"./en-ie":45997,"./en-ie.js":45997,"./en-il":84716,"./en-il.js":84716,"./en-in":50394,"./en-in.js":50394,"./en-nz":40471,"./en-nz.js":40471,"./en-sg":1709,"./en-sg.js":1709,"./eo":85341,"./eo.js":85341,"./es":70097,"./es-do":19495,"./es-do.js":19495,"./es-mx":71043,"./es-mx.js":71043,"./es-us":12820,"./es-us.js":12820,"./es.js":70097,"./et":19418,"./et.js":19418,"./eu":65067,"./eu.js":65067,"./fa":38782,"./fa.js":38782,"./fi":5446,"./fi.js":5446,"./fil":73988,"./fil.js":73988,"./fo":11260,"./fo.js":11260,"./fr":6025,"./fr-ca":80628,"./fr-ca.js":80628,"./fr-ch":41509,"./fr-ch.js":41509,"./fr.js":6025,"./fy":51094,"./fy.js":51094,"./ga":23337,"./ga.js":23337,"./gd":11236,"./gd.js":11236,"./gl":73004,"./gl.js":73004,"./gom-deva":3879,"./gom-deva.js":3879,"./gom-latn":31678,"./gom-latn.js":31678,"./gu":23677,"./gu.js":23677,"./he":52444,"./he.js":52444,"./hi":59552,"./hi.js":59552,"./hr":15271,"./hr.js":15271,"./hu":55148,"./hu.js":55148,"./hy-am":75505,"./hy-am.js":75505,"./id":14774,"./id.js":14774,"./is":59717,"./is.js":59717,"./it":42950,"./it-ch":95832,"./it-ch.js":95832,"./it.js":42950,"./ja":85938,"./ja.js":85938,"./jv":90425,"./jv.js":90425,"./ka":18365,"./ka.js":18365,"./kk":15387,"./kk.js":15387,"./km":417,"./km.js":417,"./kn":67142,"./kn.js":67142,"./ko":78679,"./ko.js":78679,"./ku":79401,"./ku.js":79401,"./ky":30037,"./ky.js":30037,"./lb":30795,"./lb.js":30795,"./lo":42446,"./lo.js":42446,"./lt":76193,"./lt.js":76193,"./lv":66359,"./lv.js":66359,"./me":80499,"./me.js":80499,"./mi":74583,"./mi.js":74583,"./mk":29601,"./mk.js":29601,"./ml":85034,"./ml.js":85034,"./mn":59068,"./mn.js":59068,"./mr":88176,"./mr.js":88176,"./ms":85161,"./ms-my":80522,"./ms-my.js":80522,"./ms.js":85161,"./mt":68626,"./mt.js":68626,"./my":64423,"./my.js":64423,"./nb":52081,"./nb.js":52081,"./ne":57178,"./ne.js":57178,"./nl":86851,"./nl-be":61773,"./nl-be.js":61773,"./nl.js":86851,"./nn":65805,"./nn.js":65805,"./oc-lnc":32941,"./oc-lnc.js":32941,"./pa-in":2942,"./pa-in.js":2942,"./pl":93029,"./pl.js":93029,"./pt":80109,"./pt-br":4444,"./pt-br.js":4444,"./pt.js":80109,"./ro":93696,"./ro.js":93696,"./ru":5526,"./ru.js":5526,"./sd":31179,"./sd.js":31179,"./se":11633,"./se.js":11633,"./si":55981,"./si.js":55981,"./sk":93379,"./sk.js":93379,"./sl":21200,"./sl.js":21200,"./sq":93861,"./sq.js":93861,"./sr":18058,"./sr-cyrl":44579,"./sr-cyrl.js":44579,"./sr.js":18058,"./ss":26747,"./ss.js":26747,"./sv":91590,"./sv.js":91590,"./sw":7607,"./sw.js":7607,"./ta":36452,"./ta.js":36452,"./te":64048,"./te.js":64048,"./tet":65018,"./tet.js":65018,"./tg":75278,"./tg.js":75278,"./th":16053,"./th.js":16053,"./tk":6554,"./tk.js":6554,"./tl-ph":6432,"./tl-ph.js":6432,"./tlh":40941,"./tlh.js":40941,"./tr":44595,"./tr.js":44595,"./tzl":19351,"./tzl.js":19351,"./tzm":7814,"./tzm-latn":94126,"./tzm-latn.js":94126,"./tzm.js":7814,"./ug-cn":85675,"./ug-cn.js":85675,"./uk":71113,"./uk.js":71113,"./ur":34344,"./ur.js":34344,"./uz":21984,"./uz-latn":4872,"./uz-latn.js":4872,"./uz.js":21984,"./vi":59030,"./vi.js":59030,"./x-pseudo":62154,"./x-pseudo.js":62154,"./yo":35929,"./yo.js":35929,"./zh-cn":21197,"./zh-cn.js":21197,"./zh-hk":38073,"./zh-hk.js":38073,"./zh-mo":20346,"./zh-mo.js":20346,"./zh-tw":20126,"./zh-tw.js":20126};function s(e){var t=i(e);return a(t)}function i(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}s.keys=function(){return Object.keys(n)},s.resolve=i,e.exports=s,s.id=20429},7620(e,t,a){var n={"./af":89225,"./af.js":89225,"./ar":26253,"./ar-dz":97772,"./ar-dz.js":97772,"./ar-kw":26044,"./ar-kw.js":26044,"./ar-ly":57179,"./ar-ly.js":57179,"./ar-ma":95244,"./ar-ma.js":95244,"./ar-sa":39974,"./ar-sa.js":39974,"./ar-tn":52616,"./ar-tn.js":52616,"./ar.js":26253,"./az":52789,"./az.js":52789,"./be":74687,"./be.js":74687,"./bg":83745,"./bg.js":83745,"./bm":63543,"./bm.js":63543,"./bn":82944,"./bn-bd":73907,"./bn-bd.js":73907,"./bn.js":82944,"./bo":26137,"./bo.js":26137,"./br":16092,"./br.js":16092,"./bs":4005,"./bs.js":4005,"./ca":13884,"./ca.js":13884,"./cs":80226,"./cs.js":80226,"./cv":94559,"./cv.js":94559,"./cy":71556,"./cy.js":71556,"./da":7581,"./da.js":7581,"./de":42377,"./de-at":35673,"./de-at.js":35673,"./de-ch":95099,"./de-ch.js":95099,"./de.js":42377,"./dv":16214,"./dv.js":16214,"./el":39627,"./el.js":39627,"./en-au":29932,"./en-au.js":29932,"./en-ca":83494,"./en-ca.js":83494,"./en-gb":66645,"./en-gb.js":66645,"./en-ie":81604,"./en-ie.js":81604,"./en-il":97525,"./en-il.js":97525,"./en-in":30979,"./en-in.js":30979,"./en-nz":27662,"./en-nz.js":27662,"./en-sg":88900,"./en-sg.js":88900,"./eo":72532,"./eo.js":72532,"./es":57288,"./es-do":6686,"./es-do.js":6686,"./es-mx":68077,"./es-mx.js":68077,"./es-us":25629,"./es-us.js":25629,"./es.js":57288,"./et":3,"./et.js":3,"./eu":52258,"./eu.js":52258,"./fa":3175,"./fa.js":3175,"./fi":18255,"./fi.js":18255,"./fil":86797,"./fil.js":86797,"./fo":24069,"./fo.js":24069,"./fr":41632,"./fr-ca":9789,"./fr-ca.js":9789,"./fr-ch":28700,"./fr-ch.js":28700,"./fr.js":41632,"./fy":63903,"./fy.js":63903,"./ga":58944,"./ga.js":58944,"./gd":75629,"./gd.js":75629,"./gl":85813,"./gl.js":85813,"./gom-deva":91070,"./gom-deva.js":91070,"./gom-latn":96071,"./gom-latn.js":96071,"./gu":10868,"./gu.js":10868,"./he":65253,"./he.js":65253,"./hi":72361,"./hi.js":72361,"./hr":2462,"./hr.js":2462,"./hu":19541,"./hu.js":19541,"./hy-am":62696,"./hy-am.js":62696,"./id":27583,"./id.js":27583,"./is":46908,"./is.js":46908,"./it":7343,"./it-ch":60225,"./it-ch.js":60225,"./it.js":7343,"./ja":50331,"./ja.js":50331,"./jv":77616,"./jv.js":77616,"./ka":5556,"./ka.js":5556,"./kk":2578,"./kk.js":2578,"./km":36024,"./km.js":36024,"./kn":79951,"./kn.js":79951,"./ko":65870,"./ko.js":65870,"./ku":15008,"./ku.js":15008,"./ky":17228,"./ky.js":17228,"./lb":17986,"./lb.js":17986,"./lo":55255,"./lo.js":55255,"./lt":11800,"./lt.js":11800,"./lv":53550,"./lv.js":53550,"./me":67850,"./me.js":67850,"./mi":61774,"./mi.js":61774,"./mk":16792,"./mk.js":16792,"./ml":14035,"./ml.js":14035,"./mn":71877,"./mn.js":71877,"./mr":985,"./mr.js":985,"./ms":72352,"./ms-my":9523,"./ms-my.js":9523,"./ms.js":72352,"./mt":33019,"./mt.js":33019,"./my":35262,"./my.js":35262,"./nb":39272,"./nb.js":39272,"./ne":86179,"./ne.js":86179,"./nl":57850,"./nl-be":97380,"./nl-be.js":97380,"./nl.js":57850,"./nn":52996,"./nn.js":52996,"./oc-lnc":20132,"./oc-lnc.js":20132,"./pa-in":67335,"./pa-in.js":67335,"./pl":80220,"./pl.js":80220,"./pt":15716,"./pt-br":17253,"./pt-br.js":17253,"./pt.js":15716,"./ro":6505,"./ro.js":6505,"./ru":18335,"./ru.js":18335,"./sd":40334,"./sd.js":40334,"./se":98824,"./se.js":98824,"./si":43172,"./si.js":43172,"./sk":64378,"./sk.js":64378,"./sl":34009,"./sl.js":34009,"./sq":64700,"./sq.js":64700,"./sr":47059,"./sr-cyrl":63994,"./sr-cyrl.js":63994,"./sr.js":47059,"./ss":62354,"./ss.js":62354,"./sv":55983,"./sv.js":55983,"./sw":94798,"./sw.js":94798,"./ta":49261,"./ta.js":49261,"./te":76857,"./te.js":76857,"./tet":45603,"./tet.js":45603,"./tg":88087,"./tg.js":88087,"./th":51660,"./th.js":51660,"./tk":19203,"./tk.js":19203,"./tl-ph":70825,"./tl-ph.js":70825,"./tlh":60196,"./tlh.js":60196,"./tr":15594,"./tr.js":15594,"./tzl":6542,"./tzl.js":6542,"./tzm":20623,"./tzm-latn":6935,"./tzm-latn.js":6935,"./tzm.js":20623,"./ug-cn":72866,"./ug-cn.js":72866,"./uk":6720,"./uk.js":6720,"./ur":47153,"./ur.js":47153,"./uz":86377,"./uz-latn":17681,"./uz-latn.js":17681,"./uz.js":86377,"./vi":71839,"./vi.js":71839,"./x-pseudo":91155,"./x-pseudo.js":91155,"./yo":23120,"./yo.js":23120,"./zh-cn":56804,"./zh-cn.js":56804,"./zh-hk":25264,"./zh-hk.js":25264,"./zh-mo":84579,"./zh-mo.js":84579,"./zh-tw":68584,"./zh-tw.js":68584};function s(e){var t=i(e);return a(t)}function i(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}s.keys=function(){return Object.keys(n)},s.resolve=i,e.exports=s,s.id=7620},1359(e,t,a){"use strict";a.d(t,{A:()=>x}),a(50144);var n=a(38745),s=a(26594),i=a(56155),r=a(88903),o=(a(44764),a(84978),a(25809),a(91672),a(29171)),l=a(17319),c=a(80133),d=a(66556);function u(){u=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(a){t.forEach(function(t){t.kind===a&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var a=e.prototype;["method","field"].forEach(function(n){t.forEach(function(t){var s=t.placement;if(t.kind===n&&("static"===s||"prototype"===s)){var i="static"===s?e:a;this.defineClassElement(i,t)}},this)},this)},defineClassElement:function(e,t){var a=t.descriptor;if("field"===t.kind){var n=t.initializer;a={enumerable:a.enumerable,writable:a.writable,configurable:a.configurable,value:void 0===n?void 0:n.call(e)}}Object.defineProperty(e,t.key,a)},decorateClass:function(e,t){var a=[],n=[],s={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,s)},this),e.forEach(function(e){if(!m(e))return a.push(e);var t=this.decorateElement(e,s);a.push(t.element),a.push.apply(a,t.extras),n.push.apply(n,t.finishers)},this),!t)return{elements:a,finishers:n};var i=this.decorateConstructor(a,t);return n.push.apply(n,i.finishers),i.finishers=n,i},addElementPlacement:function(e,t,a){var n=t[e.placement];if(!a&&-1!==n.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");n.push(e.key)},decorateElement:function(e,t){for(var a=[],n=[],s=e.decorators,i=s.length-1;i>=0;i--){var r=t[e.placement];r.splice(r.indexOf(e.key),1);var o=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,s[i])(o)||o);e=l.element,this.addElementPlacement(e,t),l.finisher&&n.push(l.finisher);var c=l.extras;if(c){for(var d=0;d<c.length;d++)this.addElementPlacement(c[d],t);a.push.apply(a,c)}}return{element:e,finishers:n,extras:a}},decorateConstructor:function(e,t){for(var a=[],n=t.length-1;n>=0;n--){var s=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[n])(s)||s);if(void 0!==i.finisher&&a.push(i.finisher),void 0!==i.elements){e=i.elements;for(var r=0;r<e.length-1;r++)for(var o=r+1;o<e.length;o++)if(e[r].key===e[o].key&&e[r].placement===e[o].placement)throw new TypeError("Duplicated element ("+e[r].key+")")}}return{elements:e,finishers:a}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?b(e,t):void 0}}(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.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var a=v(e.key),n=e.placement+"";if("static"!==n&&"prototype"!==n&&"own"!==n)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+n+'"');var s=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:a,placement:n,descriptor:Object.assign({},s)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(s,"get","The property descriptor of a field descriptor"),this.disallowProperty(s,"set","The property descriptor of a field descriptor"),this.disallowProperty(s,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:g(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var a=g(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:a}},runClassFinishers:function(e,t){for(var a=0;a<t.length;a++){var n=(0,t[a])(e);if(void 0!==n){if("function"!=typeof n)throw new TypeError("Finishers must return a constructor.");e=n}}return e},disallowProperty:function(e,t,a){if(void 0!==e[t])throw new TypeError(a+" can't have a ."+t+" property.")}};return e}function p(e){var t,a=v(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var n={kind:"field"===e.kind?"field":"method",key:a,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(n.decorators=e.decorators),"field"===e.kind&&(n.initializer=e.value),n}function h(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function m(e){return e.decorators&&e.decorators.length}function f(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function g(e,t){var a=e[t];if(void 0!==a&&"function"!=typeof a)throw new TypeError("Expected '"+t+"' to be a function");return a}function v(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function y(e,t,a,n){var s=C(w(1&n?e.prototype:e),t,a);return 2&n&&"function"==typeof s?function(e){return s.apply(a,e)}:s}function C(){return C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,a){var n=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}(e,t);if(n){var s=Object.getOwnPropertyDescriptor(n,t);return s.get?s.get.call(arguments.length<3?e:a):s.value}},C.apply(null,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}let A=(E=[(0,l.EM)("btu-legacy-dropdown")],S=(0,c.m)(o.WF),I=u(),T=function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,l.nJ)(".Dropdown-container")],key:"_dropdownContainer",value:void 0},{kind:"field",decorators:[(0,l.MZ)({type:Boolean})],key:"isEmpty",value:()=>!1},{kind:"method",key:"connectedCallback",value:function(){y(a,"connectedCallback",this,3)([]),this._dropdownContainer?.then(e=>{if(!e)return;const t=e.querySelector(".Dropdown-button"),a=e.querySelector(".Dropdown"),n=window.BRIGHTSPOT?.ui.cms.enableV5UI;n&&a?.setAttribute("popover",""),t?.addEventListener("click",()=>{(0,d.AM)(a,t),(0,d.D1)(a,t),n&&a?.togglePopover()})})}},{kind:"method",key:"disconnectedCallback",value:function(){y(a,"disconnectedCallback",this,3)([]),this._dropdownContainer?.then(e=>{if(!e)return;const t=e.querySelector(".Dropdown-button"),a=e.querySelector(".Dropdown");t?.removeEventListener("click",()=>{(0,d.AM)(a,t),(0,d.D1)(a,t)})})}},{kind:"method",key:"firstUpdated",value:function(){this._dropdownContainer?.then(e=>{this.querySelectorAll(":scope > li").forEach(e=>{this._addDropdownItem(e)});const t=e.querySelector(".Dropdown");this.isEmpty=0===t?.children.length})}},{kind:"method",key:"_addDropdownItem",value:function(e){e?.childNodes.length&&this._dropdownContainer?.then(t=>{const a=t.querySelector(".Dropdown"),n=e.querySelector(":scope > a, :scope > button");n?.classList.add("Dropdown-item"),n?.setAttribute("role","menuitem"),a?.appendChild(e)})}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.isEmpty?o.s6:o.qy`<div class="Dropdown-container">
|
|
3
3
|
<button
|
|
4
4
|
class="Dropdown-button"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
aria-orientation="vertical"
|
|
30
30
|
aria-label=${window.BRIGHTSPOT?.ui.tooltips.actions?.actions}
|
|
31
31
|
></ul>
|
|
32
|
-
</div>`}}]}}(function(e){I.initializeInstanceElements(e,k.elements)},S),k=I.decorateClass(function(e){for(var t=[],a=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},n=0;n<e.length;n++){var s,i=e[n];if("method"===i.kind&&(s=t.find(a)))if(f(i.descriptor)||f(s.descriptor)){if(m(i)||m(s))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");s.descriptor=i.descriptor}else{if(m(i)){if(m(s))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");s.decorators=i.decorators}h(i,s)}else t.push(i)}return t}(T.d.map(p)),E),I.initializeClassElements(T.F,k.elements),I.runClassFinishers(T.F,k.finishers));var E,S,I,T,k,M=a(55408),L=a(88630);class x{constructor(e,t){this._element=void 0,this._options=void 0,this._loadableTypes=void 0,this._node=void 0,this._editorView=void 0,this._element=e,this._options=t,this._loadableTypes=t.loadableTypes,this._node=t.node,this._editorView=t.editorView,this._update=(0,s.A)(this._update.bind(this)),this._update()}_update(){if(!this._element||this._element.closest(".is-gridItem")||this._element.closest(".is-listItem"))return;const e=new A;if(this._node){const e=(0,n.A)("ul",{className:"Dropdown",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.actions?.contentSelector,"aria-orientation":"vertical"});if(this._element.addEventListener("click",()=>{const t=this._element.nextSibling;t instanceof HTMLElement&&M.A.toggle(this._element,t,()=>(this._element.classList.toggle("is-active",t.classList.toggle("is-open")),e.setAttribute("aria-expanded",t.classList.contains("is-open").valueOf().toString()),!0))}),this._loadableTypes){const t=JSON.parse(this._loadableTypes);for(const a in t){const t=(0,n.A)("li",{className:"Dropdown-item","aria-label":a,role:"menuitem"},a);e.appendChild(t),t.addEventListener("click",()=>{const e=new CustomEvent("interchange",{detail:this._options});if(this._loadableTypes){const t=JSON.parse(this._loadableTypes);this._node&&(this._node.attrs.attributes["data-convert-target"]=t[a]),this._editorView?.dispatchEvent(e)}})}}return void this._element.after(e)}const t=this._element.parentElement,a=t?.parentElement;if(!t||!a)return;const s=P(t,".objectId-edit"),r=P(t,".objectId-clear"),o=P(t,".RCIG-swap")||P(t,".EIG-swap"),l=P(t,".removeButton"),c=P(t,".MultiSortable-buttonToggle"),d=P(t,".convertButton"),u=P(t,".copyButton"),p=t.closest("form"),h=this._element.dataset.objectId,m=a.closest("[data-name]")?.dataset.name,f=a.dataset.fieldName,g=a.dataset.containerId,v=a.dataset.typeId,b=a.dataset.recordTypeId,y=a.dataset.sortableValidItemTypes,C=a.dataset.isSwappable,w=new FormData;m&&w.set("inputName",m),f&&w.set("fieldName",f),g&&w.set("containerId",g),v&&w.set("containerTypeId",v),b&&w.set("recordTypeId",b),y&&w.set("validTypes",y),C&&w.set("isSwappable",C);const E=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});if(s||r||o||l){if((c||t.classList.contains("Sortable-item")&&t.classList.contains("RCIG-item"))&&t.classList.add("toggleVisible"),this._element.after(e),s.length&&e._addDropdownItem((0,n.A)("li",s)),r.length&&e._addDropdownItem((0,n.A)("li",r)),o.length&&(e._addDropdownItem((0,n.A)("li",o)),o[0].ariaLabel=o[0].textContent),u.length&&(e._addDropdownItem((0,n.A)("li",u)),u[0].ariaLabel=u[0].textContent),d.length)for(const s of d)e._addDropdownItem((0,n.A)("li",s)),s.ariaLabel=s.textContent,s.addEventListener("click",()=>{if(p&&h){const e=_(t,p,h);if(e){const n=JSON.parse(e)._type,r=s.dataset.targetType,o=t.cloneNode(!1);n&&w.append("typeId",n),r&&w.append("targetTypeId",r),w.append("itemState",e),w.append("isConvert","true"),D(w,"/cms/drawer/item-interchange").then(e=>{o.innerHTML=e;const n=t.closest(".plugin-repeatable");n&&L(n).data("repeatable").itemLoad(t).then(()=>{L(n).data("repeatable").initItem(o),L(o).trigger("create"),a?.replaceChild(o,t),(0,i.A)(o,":scope > .repeatableLabel",e=>{o.classList.contains("is-collapsed")&&e.dispatchEvent(E),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{e.classList.contains("RCIG-title")&&e.focus()})})})})})}}});u.length&&u[0].addEventListener("click",()=>{if(p&&h){const e=_(t,p,h);if(e){const t=JSON.parse(e)._type;t&&w.append("typeId",t),w.append("itemState",e),D(w,"/cms/copy-record").then(e=>{const t=(new DOMParser).parseFromString(e,"text/html").body.firstChild;if(t){a?.appendChild(t);const e=t.closest(".plugin-repeatable");e&&L(e).data("repeatable").itemLoad(t).then(()=>{L(e).data("repeatable").initItem(t),(0,i.A)(t,":scope > .repeatableLabel",e=>{t.classList.contains("is-collapsed")&&e.dispatchEvent(E),t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),window.requestAnimationFrame(()=>{e.classList.contains("RCIG-title")&&e.focus()})})})}})}}})}}}const P=(e,t)=>{const a=Array.prototype.filter.call(e.children,function(e){return e.matches(t)});return a.length>0?a:[]},D=async(e,t)=>{const a=new Headers,n=r.A.get("bsp.csrf");n&&a.append("Brightspot-CSRF",n);const s=await fetch(t,{method:"POST",credentials:"include",body:e,headers:a});return await s.text()},_=(e,t,a)=>{const n=L(t).data("brightspot-content-state");if(n){const e=JSON.parse(n),t=O(e,a);if(t)return JSON.stringify(t)}return e.dataset.state},O=(e,t)=>{if(e._id===t)return e;{const a=Object.keys(e);for(const n of a){const a=e[n];if(a&&"object"==typeof a){const e=O(a,t);if(e)return e}}}}},80133(e,t,a){"use strict";a.d(t,{m:()=>n});const n=e=>class extends e{connectedCallback(){super.connectedCallback(),Promise.resolve().then(()=>this.emit("btu-brightspot-element-connected",{}),e=>this.emit("btu-brightspot-element-error",{error:e}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("btu-brightspot-element-disconnected")}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:t}))}}},67324(e,t,a){"use strict";a.d(t,{m:()=>n});const n=e=>class extends e{connectedCallback(){super.connectedCallback(),Promise.resolve().then(()=>this.emit("btu-brightspot-element-connected",{}),e=>this.emit("btu-brightspot-element-error",{error:e}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("btu-brightspot-element-disconnected")}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:t}))}}},1607(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(38745);if(7717==a.j)var s=a(68243);class i{static onFindFunction(e,t){return a=>{const n=new i(e,t,parseInt(a.style.getPropertyValue("--progress")));(0,s.A)(n.getElement(),a),a.hidden=!0}}constructor(e,t,a=0){this._circumference=void 0,this._element=void 0,this._value=0;const s=(0,n.A)("div"),i=e/2,r=i-t/2;if(this._circumference=2*Math.PI*r,s.innerHTML=`\n <svg class="RPB" viewBox="0 0 ${e} ${e}">\n <circle\n class="RPB-bg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t-1}"\n />\n <circle\n class="RPB-fg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t}"\n stroke-dasharray="${this._circumference}"\n stroke-dashoffset="${this._circumference}"\n />\n </svg>\n `,!(s.firstElementChild instanceof SVGElement))throw new Error("SVG not found");this._element=s.firstElementChild,this.setValue(a)}getElement(){return this._element}getValue(){return this._value}setValue(e){this._value=e,this._element.querySelector(":scope > .RPB-fg")?.setAttribute("stroke-dashoffset",""+this._circumference*(1-e/100))}}},88798(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(25936);if(3324==a.j)var s=a(39242);class i{static onFindFunction(e,t){return a=>{const n=new i(e,t,parseInt(a.style.getPropertyValue("--progress")));(0,s.A)(n.getElement(),a),a.hidden=!0}}constructor(e,t,a=0){this._circumference=void 0,this._element=void 0,this._value=0;const s=(0,n.A)("div"),i=e/2,r=i-t/2;if(this._circumference=2*Math.PI*r,s.innerHTML=`\n <svg class="RPB" viewBox="0 0 ${e} ${e}">\n <circle\n class="RPB-bg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t-1}"\n />\n <circle\n class="RPB-fg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t}"\n stroke-dasharray="${this._circumference}"\n stroke-dashoffset="${this._circumference}"\n />\n </svg>\n `,!(s.firstElementChild instanceof SVGElement))throw new Error("SVG not found");this._element=s.firstElementChild,this.setValue(a)}getElement(){return this._element}getValue(){return this._value}setValue(e){this._value=e,this._element.querySelector(":scope > .RPB-fg")?.setAttribute("stroke-dashoffset",""+this._circumference*(1-e/100))}}},25734(e,t,a){"use strict";a.d(t,{iP:()=>o,tK:()=>c,wC:()=>r}),a(44764);var n=a(56155);if(7717==a.j)var s=a(27170);var i=a(33582);function r(e,t){return e.replace(/_{3}/g,(a=0,e=>t[a++]));var a}function o(e,t){let a=document.getElementById("aria-live-container");a||(a=document.createElement("div"),a.setAttribute("id","aria-live-container"),document.body.appendChild(a));const n=document.createElement("div"),s="speak-"+Date.now();n.setAttribute("id",s),n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.classList.add("screen-reader-only"),t&&t.length&&(e=r(`${e}`,t)),a.appendChild(n),setTimeout(()=>{const t=document.getElementById(s);t&&(t.innerHTML=e)},150),!0===window.BRIGHTSPOT?.ariaDebug&&console.log(`ARIA Announced: "${e}"`),setTimeout(()=>{document.getElementById(s)?.remove()},2e3)}document.addEventListener("DOMContentLoaded",()=>{document.body.addEventListener("btu-announce",e=>{e instanceof CustomEvent&&o(e.detail)})});const l=[];(0,n.A)("[data-aria-announce]",e=>{l.push(e),setTimeout(()=>{if(l.length>0){const e=l.map(e=>"true"===e.dataset.ariaAnnounce?e.textContent:e.dataset.ariaAnnounce).join(", ");l.length=0,o(e)}},2500)}),(0,i.A)([".addButton",".Workflow-addState",".Workflow-addTransition",".calendarButton",".ComboInput"],e=>{const t=e.closest(".CIG-row");if(!t)return;const a=t.querySelector(".Message.is-error");if(!a)return;const n=a.getAttribute("id");n&&(e.setAttribute("aria-describedby",n),e.setAttribute("aria-invalid","true"))}),(0,i.A)('a[role="button"]',e=>{e.addEventListener("keydown",t=>{"Space"===t.code&&(t.preventDefault(),e.click())})});const c=e=>{(0,s.A)(1e3,()=>o(e))}},90127(e,t,a){"use strict";a.d(t,{iP:()=>o,tK:()=>c,wC:()=>r}),a(57573);var n=a(91762);if(3324==a.j)var s=a(39979);var i=a(46391);function r(e,t){return e.replace(/_{3}/g,(a=0,e=>t[a++]));var a}function o(e,t){let a=document.getElementById("aria-live-container");a||(a=document.createElement("div"),a.setAttribute("id","aria-live-container"),document.body.appendChild(a));const n=document.createElement("div"),s="speak-"+Date.now();n.setAttribute("id",s),n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.classList.add("screen-reader-only"),t&&t.length&&(e=r(`${e}`,t)),a.appendChild(n),setTimeout(()=>{const t=document.getElementById(s);t&&(t.innerHTML=e)},150),!0===window.BRIGHTSPOT?.ariaDebug&&console.log(`ARIA Announced: "${e}"`),setTimeout(()=>{document.getElementById(s)?.remove()},2e3)}document.addEventListener("DOMContentLoaded",()=>{document.body.addEventListener("btu-announce",e=>{e instanceof CustomEvent&&o(e.detail)})});const l=[];(0,n.A)("[data-aria-announce]",e=>{l.push(e),setTimeout(()=>{if(l.length>0){const e=l.map(e=>"true"===e.dataset.ariaAnnounce?e.textContent:e.dataset.ariaAnnounce).join(", ");l.length=0,o(e)}},2500)}),(0,i.A)([".addButton",".Workflow-addState",".Workflow-addTransition",".calendarButton",".ComboInput"],e=>{const t=e.closest(".CIG-row");if(!t)return;const a=t.querySelector(".Message.is-error");if(!a)return;const n=a.getAttribute("id");n&&(e.setAttribute("aria-describedby",n),e.setAttribute("aria-invalid","true"))}),(0,i.A)('a[role="button"]',e=>{e.addEventListener("keydown",t=>{"Space"===t.code&&(t.preventDefault(),e.click())})});const c=e=>{(0,s.A)(1e3,()=>o(e))}},68243(e,t,a){"use strict";function n(e,t){return t?.parentNode?.insertBefore(e,t),e}a.d(t,{A:()=>n})},39242(e,t,a){"use strict";function n(e,t){return t?.parentNode?.insertBefore(e,t),e}a.d(t,{A:()=>n})},33582(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(56155);let s=0;function i(e,t){const a="_ovc"+s++,i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){const e=n.target,s=e.classList;s.contains(a)||(s.add(a),i.unobserve(e),t(e))}});(0,n.A)(e,e=>{i.observe(e)})}},46391(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(91762);let s=0;function i(e,t){const a="_ovc"+s++,i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){const e=n.target,s=e.classList;s.contains(a)||(s.add(a),i.unobserve(e),t(e))}});(0,n.A)(e,e=>{i.observe(e)})}},89561(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(83394)},76752(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(96203)},10013(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(33582)},97204(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(46391)},3315(e,t,a){"use strict";if(a.d(t,{K:()=>s}),7717==a.j)var n=a(83043);function s(e,t){if(e&&t)try{const a=(window.BRIGHTSPOT?.icons?.materialToLucide||{})[e]??e,s=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=n[s];i?.encodedCode&&t.style.setProperty("--compat-icon",`'${i.encodedCode}'`),document.dispatchEvent(new CustomEvent("btu-resolve-icon",{detail:{name:a,element:t}}))}catch(t){console.error(`[resolveIconCompat] Failed to resolve icon "${e}":`,t)}}},22730(e,t,a){"use strict";if(a.d(t,{K:()=>s}),3324==a.j)var n=a(54042);function s(e,t){if(e&&t)try{const a=(window.BRIGHTSPOT?.icons?.materialToLucide||{})[e]??e,s=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=n[s];i?.encodedCode&&t.style.setProperty("--compat-icon",`'${i.encodedCode}'`),document.dispatchEvent(new CustomEvent("btu-resolve-icon",{detail:{name:a,element:t}}))}catch(t){console.error(`[resolveIconCompat] Failed to resolve icon "${e}":`,t)}}},52215(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>n.A});var n=a(26791)},23054(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>n.A});var n=a(75230)},73061(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{RTE:()=>C}),a(44764),a(50144),a(84978),a(13722),a(25809),a(91672),a(92280);var s=a(27791),i=a(26173);if(7717==a.j)var r=a(17283);var o=a(46929),l=a(90458),c=a(55053),d=a(77281),u=a(52215);if(7717==a.j)var p=a(24455);if(7717==a.j)var h=a(40320);if(7717==a.j)var m=a(13333);if(a(22628),7717==a.j)var f=a(36500);a(65210);var g=a(92),v=a(25734),b=a(1439),y=e([s,i,l,c,d]);[s,i,l,c,d]=y.then?(await y)():y,window.BRIGHTSPOT?.ui.cms.enableV5UI?await a.e(2111).then(a.bind(a,92111)):(await Promise.resolve().then(a.bind(a,65210)),await a.e(9576).then(a.bind(a,99576)),await a.e(7863).then(a.bind(a,77863)));class C{constructor(e,t,a,n,r,c,d,h,y,C){this.setValue=e=>{const{state:t,dispatch:a}=this.view;(0,i.y6)(t,e,this.compliantTagNameMap,a,!0,!0,!1)},this.setMinHeight=()=>{this.view.dom.style.setProperty("--ProseMirror-numLines",this.numLines)},this.hideLoader=()=>{const e=this.view.dom.parentElement.previousSibling;e&&(e.classList.add("hide"),e.style.minHeight=0),this.view.dom.parentElement.classList.remove("hide")},this.handlePlaceholderUpdate=e=>{const{state:t,dispatch:a,dom:n}=this.view,r=this.ctx.getAttribute("placeholder"),o=l.wM.serialize(t.doc.content,this.compliantTagNameMap);e?.clearOnChange||n.parentElement.classList.contains(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)||""===o&&o!==r?((0,i.y6)(t,r,this.compliantTagNameMap,a,!1,!0),this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):o===r&&this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)},this.getInitialContent=()=>{let e=this.ctx.value;!e&&this.ctx.hasAttribute("placeholder")&&(e=this.ctx.getAttribute("placeholder"));const t="com.psddev.conversation.Post"===this.ctx.closest(".CIG")?.dataset?.type,a=document.createElement("div");return a.innerHTML=(0,o.n)(e,this.schema,this.compliantTagNameMap,!1,t),m.S4.fromSchema(this.schema).parse(a,{preserveWhitespace:"full"})},this.buildView=(e,t,a,n,r)=>{const o=(0,i.Gu)(e,this.menuItems,s.eu,this.schema,this.userId,this.userLabel,t,a,n,r,this.isCollab,this.ctx,this.compliantTagNameMap);if(this.view=this.getView(o),ENABLE_PROSE_MIRROR_SPELL_CHECK&&(this.view.dom.spellcheck=!1),this.setMinHeight(),this.hideLoader(),this.view.submenu=document.createElement("div"),this.view.submenu.className="ProsemirrorEnhancementMenuContainer",this.view.dom.parentNode.append(this.view.submenu),this.initialPayload){const e=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);this.ctx.value=e;const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.ctx.dispatchEvent(t)}this.loaded=!0,this.ctx.getAttributeNames().filter(e=>e.startsWith("aria-")).forEach(e=>{this.view.dom.setAttribute(e,this.ctx.getAttribute(e))});const c=this.view.dom.closest(".CIG-row");if(c){const e=c.querySelector(".Message.is-error");if(e){const t=e.getAttribute("id");t&&(this.view.dom.setAttribute("aria-describedby",t),this.view.dom.setAttribute("aria-invalid","true"))}}!this.ctx.hasAttribute("placeholder")||this.ctx.getAttribute("placeholder")!==this.ctx.value&&this.ctx.value||this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT),this.$ctx.on("placeholderUpdate",(e,t)=>{this.handlePlaceholderUpdate(t)}),new ResizeObserver(()=>{this.view&&this.view.props&&this.view.props.props&&this.view.props.props.resizeCallbacks&&this.view.props.props.resizeCallbacks.forEach(e=>{e.callback&&e.callback()})}).observe(this.view.dom),PubSub.publish("rteLoaded",this)},this.createLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"lockOnly",clientId:this.userId,lockedId:e})},this.removeLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"unlockOnly",clientId:this.userId,lockedId:e})},this.createNewRecord=e=>{this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"create",rangeList:JSON.stringify([]),requestId:this.pendingRequest,doc:JSON.stringify(e.toJSON())})},this.createRecord=(e,t)=>{if(this.pendingRequest)return void(this.hasQueuedRequest=!0);if(!e||!t)return void(this.hasCursorState&&(this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!1));this.pendingRequest=(0,f.A)();const a=(0,p._X)(t),{anchor:n,ranges:s,empty:i}=t.selection;if(a){const e=JSON.stringify(t.doc.toJSON());u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,stepsList:JSON.stringify(a.steps),doc:e,version:a.version,clientId:this.userId,anchor:JSON.stringify({[this.userId]:n}),type:"steps",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0}else if(i)u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0;else{const e=[];s.forEach(t=>{const{$from:a,$to:n}=t,s=a.pos,i=n.pos;e.push({from:s,to:i,clientId:this.userId,requestId:this.pendingRequest})}),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"range",rangeList:JSON.stringify(e),requestId:this.pendingRequest}),this.hasCursorState=!0}},this.setUpWordCount=()=>{this.view.wordCount=document.createElement("div");const e=this.view.wordCount;e.className="CIG-wordCount",e.setAttribute("role","status"),e.setAttribute("aria-live","off"),this.toolbarWrapper.appendChild(e);const t=this.toolbarWrapper.querySelectorAll("[data-rte-style='rte2-toolbar-find'], [data-rte-style='rte2-toolbar-fullscreen'], [data-rte-style='rte2-toolbar-ai-inline']").length;this.toolbarWrapper.dataset.sidebarIconCount=t,3===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithThreeIcons)":2===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithTwoIcons)":1===t&&(e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithOneIcon)")},this.handleWordCount=()=>{this.view.wordCount&&(this.wordCountScheduled||(this.wordCountScheduled=!0,requestAnimationFrame(()=>{this.wordCountScheduled=!1,this.calculateWordCount()})))},this.calculateWordCount=()=>{if(!this.view.wordCount)return;const e=/[0-9_'-\u0027\u2019\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+/g;let t=0,a=0;const n=new Set(["del","comment","html"]);this.parentElement.classList.contains("isPlaceholderContent")&&!this.ctx.hasAttribute("data-editable-placeholder")||this.view.state.doc.descendants((s,i)=>{if(s.isText&&!s.marks.some(e=>n.has(e.type.name))){t+=s.text.length;const n=s.text.match(e);n&&(a+=n.length)}}),this.updateWordCountDisplay(a,t)},this.updateWordCountDisplay=(e,t)=>{const a=+this.ctx.dataset.suggestedMinimum,n=+this.ctx.dataset.suggestedMaximum,s=t<a?this.ctx.dataset.suggestedMinimumMessage:t>n?this.ctx.dataset.suggestedMaximumMessage:"",i=s||`${e}w ${t}c`;i!==this.lastDisplayText&&(this.lastDisplayText=i,this.view.wordCount.innerText=i,this.view.wordCount.setAttribute("aria-label",(0,g.QX)(e,t,s)),requestAnimationFrame(()=>{const e=this.view.wordCount.clientWidth;e!==this.lastMeasuredWidth&&(this.lastMeasuredWidth=e,this.toolbarWrapper.style.setProperty("--ProseMirror-wordCount",`${e}px`))}),(0,v.tK)((0,g.y)(e,t,a,n,this.ctx.dataset.suggestedMinimumMessage,this.ctx.dataset.suggestedMaximumMessage)))},e.setAttribute("style",s.AA.STYLES.DISPLAY_NONE),this.ctx=e,this.$ctx=b(e),this.schema=(0,s.e$)(t,c,y),this.pendingRequest=null,this.userId=r,this.userLabel=n,this.compliantTagNameMap=y,this.menuItems=(0,s.OF)(t,this.schema,a,n,r,c);const w=document.createElement("div");if(w.className="ProseMirrorContainer hide",this.ctx.parentNode.appendChild(w),h){const e=document.createElement("div");e.className=s.AA.CLASSES.PM_AVATAR_WRAPPER,w.appendChild(e)}this.toolbarWrapper=document.createElement("div"),this.toolbarWrapper.className="ProseMirrorToolbar",w.appendChild(this.toolbarWrapper),this.numLines=C,this.fieldName=d,this.isCollab=h,this.loaded=!1,this.hasCursorState=!1,this.parentElement=w,this.wordCountScheduled=!1,this.lastDisplayText="",this.lastMeasuredWidth=0,w.addEventListener("click",e=>{"A"!==e.target.tagName&&"LI"!==e.target.tagName||e.target.setAttribute("data-leave-popup-open","true")}),w.addEventListener("dragstart",e=>{e.preventDefault()}),w.addEventListener("com.psddev.cms.rte.clear",()=>{const{state:e,dispatch:t}=this.view;(0,i.y6)(e,"",this.compliantTagNameMap,t,!1,!0)}),this.isCollab&&(u.default.execute("com.psddev.cms.rte.RichTextCollabUserAction",{fieldName:this.fieldName}),window.addEventListener("click",e=>{if(!this.view||!this.view.dom)return;let t=e.target,a=!1;for(;t;){if(this.view.dom.parentNode===t){a=!0;break}t=t.parentElement}a||this.createRecord()}),window.addEventListener("unload",e=>{this.createRecord()}),PubSub.subscribe("collabLock",e=>{const{id:t}=e;this.createLockRecord(t)}),PubSub.subscribe("collabUnlock",e=>{const{id:t}=e;this.removeLockRecord(t)}))}init(){if(this.isCollab)u.default.initialize("com.psddev.cms.rte.RichTextCollabItemState",{fieldName:this.fieldName},()=>{if(this.loaded)return;let e,t=0,a={},n=[],s=this.lockedList={};this.initialPayload?(t=parseInt(this.initialPayload.version),e=this.schema.nodeFromJSON(JSON.parse(this.initialPayload.doc)),a=this.initialPayload.anchorMap,n=this.initialPayload.rangeList,s=this.initialPayload.lockedList||{},0===t&&this.ctx.value&&""===l.wM.serialize(e.content,this.compliantTagNameMap)&&(e=this.getInitialContent(),a={},n=[],s=this.lockedList={})):(e=this.getInitialContent(),this.createNewRecord(e)),this.buildView(e,t,a,n,s),this.setUpWordCount(),this.handleWordCount()}),u.default.receive("com.psddev.cms.rte.RichTextCollabItemBroadcast",e=>{if(e.fieldName!==this.fieldName)return;if(!this.loaded)return void(this.initialPayload=e);(e.resolvedRequestIds[this.pendingRequest]||0===e.version)&&(this.pendingRequest=null);const t=(0,p.HF)(this.view.state);e.wasRejected&&this.createRecord(this.view.state.tr,this.view.state);const a=e.stepsList,n=e.clientList,s=a.slice(t),i=n.slice(t);try{let t=(0,p.kq)(this.view.state,s.map(e=>h.pn.fromJSON(this.schema,e)),i,{mapSelectionBackward:!0});t.type="received",t.setMeta("collabManager$",{anchorMap:e.anchorMap,rangeList:e.rangeList,lockedList:e.lockedList||{}}),this.dispatchAction(t),this.hasQueuedRequest&&(this.hasQueuedRequest=!1,this.createRecord(this.view.state.tr,this.view.state))}catch(e){console.log(e)}});else{const e=this.getInitialContent();let t=0,a={},n=[];this.buildView(e,t,a,n),this.setUpWordCount(),this.handleWordCount()}}dispatchAction(e){const t=this.view.state.apply(e);if(this.view.updateState(t),"received"!==e.type&&this.isCollab&&this.createRecord(e,t),e.docChanged){const t=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);if(this.ctx.getAttribute("placeholder")&&t===this.ctx.getAttribute("placeholder")?(this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):(this.ctx.value=t,this.parentElement.classList.remove(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)),this.handleWordCount(),!e.getMeta("disableNativeEvent")){const e=document.createEvent("HTMLEvents");e.initEvent("input",!0,!1),this.ctx.dispatchEvent(e)}}}getView(e){const t={};RICH_TEXT_ELEMENTS_PM.filter(e=>e.popup&&"table"!==e.tag&&"tr"!==e.tag&&"td"!==e.tag&&"ul"!==e.tag&&"ol"!==e.tag).forEach(e=>{t[e.tag]=(e,t,a)=>new c.G(e,t,a,this.lockedList,this.isCollab)});const a=m.ZF.fromSchema(e.config.schema),n=new m.ZF(Object.assign({},a.nodes,{line:function(e){return["p",e.attrs,0]}}),a.marks),s=!this.ctx.closest(".is-readOnly");return new r.Lz(this.parentElement,{state:e,editable:()=>s,attributes:{tabIndex:"0"},dispatchTransaction:this.dispatchAction.bind(this),nodeViews:{inlineEnhancement:(e,t,a)=>new c.G(e,t,a),blockEnhancement:(e,t,a)=>new c.G(e,t,a),table:(e,t,a)=>new d.Q(e,t,a),...t},clipboardSerializer:n,clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,"\n"),props:{ctx:this.ctx,isFullScreen:!1,resizeCallbacks:[]}})}}n()}catch(e){n(e)}},1)},60252(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{RTE:()=>C}),a(57573),a(62953),a(49371),a(42723),a(96648),a(56065),a(56673);var s=a(14982),i=a(13364);if(3324==a.j)var r=a(88282);var o=a(34120),l=a(19459),c=a(42244),d=a(64472),u=a(23054);if(3324==a.j)var p=a(11646);if(3324==a.j)var h=a(53129);if(3324==a.j)var m=a(48940);if(a(87021),3324==a.j)var f=a(49309);a(61685);var g=a(88420),v=a(90127),b=a(88630),y=e([s,i,l,c,d]);[s,i,l,c,d]=y.then?(await y)():y,window.BRIGHTSPOT?.ui.cms.enableV5UI?await a.e(7718).then(a.bind(a,27718)):(await Promise.resolve().then(a.bind(a,61685)),await a.e(7923).then(a.bind(a,77923)),await a.e(4168).then(a.bind(a,64168)));class C{constructor(e,t,a,n,r,c,d,h,y,C){this.setValue=e=>{const{state:t,dispatch:a}=this.view;(0,i.y6)(t,e,this.compliantTagNameMap,a,!0,!0,!1)},this.setMinHeight=()=>{this.view.dom.style.setProperty("--ProseMirror-numLines",this.numLines)},this.hideLoader=()=>{const e=this.view.dom.parentElement.previousSibling;e&&(e.classList.add("hide"),e.style.minHeight=0),this.view.dom.parentElement.classList.remove("hide")},this.handlePlaceholderUpdate=e=>{const{state:t,dispatch:a,dom:n}=this.view,r=this.ctx.getAttribute("placeholder"),o=l.wM.serialize(t.doc.content,this.compliantTagNameMap);e?.clearOnChange||n.parentElement.classList.contains(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)||""===o&&o!==r?((0,i.y6)(t,r,this.compliantTagNameMap,a,!1,!0),this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):o===r&&this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)},this.getInitialContent=()=>{let e=this.ctx.value;!e&&this.ctx.hasAttribute("placeholder")&&(e=this.ctx.getAttribute("placeholder"));const t="com.psddev.conversation.Post"===this.ctx.closest(".CIG")?.dataset?.type,a=document.createElement("div");return a.innerHTML=(0,o.n)(e,this.schema,this.compliantTagNameMap,!1,t),m.S4.fromSchema(this.schema).parse(a,{preserveWhitespace:"full"})},this.buildView=(e,t,a,n,r)=>{const o=(0,i.Gu)(e,this.menuItems,s.eu,this.schema,this.userId,this.userLabel,t,a,n,r,this.isCollab,this.ctx,this.compliantTagNameMap);if(this.view=this.getView(o),ENABLE_PROSE_MIRROR_SPELL_CHECK&&(this.view.dom.spellcheck=!1),this.setMinHeight(),this.hideLoader(),this.view.submenu=document.createElement("div"),this.view.submenu.className="ProsemirrorEnhancementMenuContainer",this.view.dom.parentNode.append(this.view.submenu),this.initialPayload){const e=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);this.ctx.value=e;const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.ctx.dispatchEvent(t)}this.loaded=!0,this.ctx.getAttributeNames().filter(e=>e.startsWith("aria-")).forEach(e=>{this.view.dom.setAttribute(e,this.ctx.getAttribute(e))});const c=this.view.dom.closest(".CIG-row");if(c){const e=c.querySelector(".Message.is-error");if(e){const t=e.getAttribute("id");t&&(this.view.dom.setAttribute("aria-describedby",t),this.view.dom.setAttribute("aria-invalid","true"))}}!this.ctx.hasAttribute("placeholder")||this.ctx.getAttribute("placeholder")!==this.ctx.value&&this.ctx.value||this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT),this.$ctx.on("placeholderUpdate",(e,t)=>{this.handlePlaceholderUpdate(t)}),new ResizeObserver(()=>{this.view&&this.view.props&&this.view.props.props&&this.view.props.props.resizeCallbacks&&this.view.props.props.resizeCallbacks.forEach(e=>{e.callback&&e.callback()})}).observe(this.view.dom),PubSub.publish("rteLoaded",this)},this.createLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"lockOnly",clientId:this.userId,lockedId:e})},this.removeLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"unlockOnly",clientId:this.userId,lockedId:e})},this.createNewRecord=e=>{this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"create",rangeList:JSON.stringify([]),requestId:this.pendingRequest,doc:JSON.stringify(e.toJSON())})},this.createRecord=(e,t)=>{if(this.pendingRequest)return void(this.hasQueuedRequest=!0);if(!e||!t)return void(this.hasCursorState&&(this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!1));this.pendingRequest=(0,f.A)();const a=(0,p._X)(t),{anchor:n,ranges:s,empty:i}=t.selection;if(a){const e=JSON.stringify(t.doc.toJSON());u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,stepsList:JSON.stringify(a.steps),doc:e,version:a.version,clientId:this.userId,anchor:JSON.stringify({[this.userId]:n}),type:"steps",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0}else if(i)u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0;else{const e=[];s.forEach(t=>{const{$from:a,$to:n}=t,s=a.pos,i=n.pos;e.push({from:s,to:i,clientId:this.userId,requestId:this.pendingRequest})}),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"range",rangeList:JSON.stringify(e),requestId:this.pendingRequest}),this.hasCursorState=!0}},this.setUpWordCount=()=>{this.view.wordCount=document.createElement("div");const e=this.view.wordCount;e.className="CIG-wordCount",e.setAttribute("role","status"),e.setAttribute("aria-live","off"),this.toolbarWrapper.appendChild(e);const t=this.toolbarWrapper.querySelectorAll("[data-rte-style='rte2-toolbar-find'], [data-rte-style='rte2-toolbar-fullscreen'], [data-rte-style='rte2-toolbar-ai-inline']").length;this.toolbarWrapper.dataset.sidebarIconCount=t,3===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithThreeIcons)":2===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithTwoIcons)":1===t&&(e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithOneIcon)")},this.handleWordCount=()=>{this.view.wordCount&&(this.wordCountScheduled||(this.wordCountScheduled=!0,requestAnimationFrame(()=>{this.wordCountScheduled=!1,this.calculateWordCount()})))},this.calculateWordCount=()=>{if(!this.view.wordCount)return;const e=/[0-9_'-\u0027\u2019\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+/g;let t=0,a=0;const n=new Set(["del","comment","html"]);this.parentElement.classList.contains("isPlaceholderContent")&&!this.ctx.hasAttribute("data-editable-placeholder")||this.view.state.doc.descendants((s,i)=>{if(s.isText&&!s.marks.some(e=>n.has(e.type.name))){t+=s.text.length;const n=s.text.match(e);n&&(a+=n.length)}}),this.updateWordCountDisplay(a,t)},this.updateWordCountDisplay=(e,t)=>{const a=+this.ctx.dataset.suggestedMinimum,n=+this.ctx.dataset.suggestedMaximum,s=t<a?this.ctx.dataset.suggestedMinimumMessage:t>n?this.ctx.dataset.suggestedMaximumMessage:"",i=s||`${e}w ${t}c`;i!==this.lastDisplayText&&(this.lastDisplayText=i,this.view.wordCount.innerText=i,this.view.wordCount.setAttribute("aria-label",(0,g.QX)(e,t,s)),requestAnimationFrame(()=>{const e=this.view.wordCount.clientWidth;e!==this.lastMeasuredWidth&&(this.lastMeasuredWidth=e,this.toolbarWrapper.style.setProperty("--ProseMirror-wordCount",`${e}px`))}),(0,v.tK)((0,g.y)(e,t,a,n,this.ctx.dataset.suggestedMinimumMessage,this.ctx.dataset.suggestedMaximumMessage)))},e.setAttribute("style",s.AA.STYLES.DISPLAY_NONE),this.ctx=e,this.$ctx=b(e),this.schema=(0,s.e$)(t,c,y),this.pendingRequest=null,this.userId=r,this.userLabel=n,this.compliantTagNameMap=y,this.menuItems=(0,s.OF)(t,this.schema,a,n,r,c);const w=document.createElement("div");if(w.className="ProseMirrorContainer hide",this.ctx.parentNode.appendChild(w),h){const e=document.createElement("div");e.className=s.AA.CLASSES.PM_AVATAR_WRAPPER,w.appendChild(e)}this.toolbarWrapper=document.createElement("div"),this.toolbarWrapper.className="ProseMirrorToolbar",w.appendChild(this.toolbarWrapper),this.numLines=C,this.fieldName=d,this.isCollab=h,this.loaded=!1,this.hasCursorState=!1,this.parentElement=w,this.wordCountScheduled=!1,this.lastDisplayText="",this.lastMeasuredWidth=0,w.addEventListener("click",e=>{"A"!==e.target.tagName&&"LI"!==e.target.tagName||e.target.setAttribute("data-leave-popup-open","true")}),w.addEventListener("dragstart",e=>{e.preventDefault()}),w.addEventListener("com.psddev.cms.rte.clear",()=>{const{state:e,dispatch:t}=this.view;(0,i.y6)(e,"",this.compliantTagNameMap,t,!1,!0)}),this.isCollab&&(u.default.execute("com.psddev.cms.rte.RichTextCollabUserAction",{fieldName:this.fieldName}),window.addEventListener("click",e=>{if(!this.view||!this.view.dom)return;let t=e.target,a=!1;for(;t;){if(this.view.dom.parentNode===t){a=!0;break}t=t.parentElement}a||this.createRecord()}),window.addEventListener("unload",e=>{this.createRecord()}),PubSub.subscribe("collabLock",e=>{const{id:t}=e;this.createLockRecord(t)}),PubSub.subscribe("collabUnlock",e=>{const{id:t}=e;this.removeLockRecord(t)}))}init(){if(this.isCollab)u.default.initialize("com.psddev.cms.rte.RichTextCollabItemState",{fieldName:this.fieldName},()=>{if(this.loaded)return;let e,t=0,a={},n=[],s=this.lockedList={};this.initialPayload?(t=parseInt(this.initialPayload.version),e=this.schema.nodeFromJSON(JSON.parse(this.initialPayload.doc)),a=this.initialPayload.anchorMap,n=this.initialPayload.rangeList,s=this.initialPayload.lockedList||{},0===t&&this.ctx.value&&""===l.wM.serialize(e.content,this.compliantTagNameMap)&&(e=this.getInitialContent(),a={},n=[],s=this.lockedList={})):(e=this.getInitialContent(),this.createNewRecord(e)),this.buildView(e,t,a,n,s),this.setUpWordCount(),this.handleWordCount()}),u.default.receive("com.psddev.cms.rte.RichTextCollabItemBroadcast",e=>{if(e.fieldName!==this.fieldName)return;if(!this.loaded)return void(this.initialPayload=e);(e.resolvedRequestIds[this.pendingRequest]||0===e.version)&&(this.pendingRequest=null);const t=(0,p.HF)(this.view.state);e.wasRejected&&this.createRecord(this.view.state.tr,this.view.state);const a=e.stepsList,n=e.clientList,s=a.slice(t),i=n.slice(t);try{let t=(0,p.kq)(this.view.state,s.map(e=>h.pn.fromJSON(this.schema,e)),i,{mapSelectionBackward:!0});t.type="received",t.setMeta("collabManager$",{anchorMap:e.anchorMap,rangeList:e.rangeList,lockedList:e.lockedList||{}}),this.dispatchAction(t),this.hasQueuedRequest&&(this.hasQueuedRequest=!1,this.createRecord(this.view.state.tr,this.view.state))}catch(e){console.log(e)}});else{const e=this.getInitialContent();let t=0,a={},n=[];this.buildView(e,t,a,n),this.setUpWordCount(),this.handleWordCount()}}dispatchAction(e){const t=this.view.state.apply(e);if(this.view.updateState(t),"received"!==e.type&&this.isCollab&&this.createRecord(e,t),e.docChanged){const t=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);if(this.ctx.getAttribute("placeholder")&&t===this.ctx.getAttribute("placeholder")?(this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):(this.ctx.value=t,this.parentElement.classList.remove(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)),this.handleWordCount(),!e.getMeta("disableNativeEvent")){const e=document.createEvent("HTMLEvents");e.initEvent("input",!0,!1),this.ctx.dispatchEvent(e)}}}getView(e){const t={};RICH_TEXT_ELEMENTS_PM.filter(e=>e.popup&&"table"!==e.tag&&"tr"!==e.tag&&"td"!==e.tag&&"ul"!==e.tag&&"ol"!==e.tag).forEach(e=>{t[e.tag]=(e,t,a)=>new c.G(e,t,a,this.lockedList,this.isCollab)});const a=m.ZF.fromSchema(e.config.schema),n=new m.ZF(Object.assign({},a.nodes,{line:function(e){return["p",e.attrs,0]}}),a.marks),s=!this.ctx.closest(".is-readOnly");return new r.Lz(this.parentElement,{state:e,editable:()=>s,attributes:{tabIndex:"0"},dispatchTransaction:this.dispatchAction.bind(this),nodeViews:{inlineEnhancement:(e,t,a)=>new c.G(e,t,a),blockEnhancement:(e,t,a)=>new c.G(e,t,a),table:(e,t,a)=>new d.Q(e,t,a),...t},clipboardSerializer:n,clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,"\n"),props:{ctx:this.ctx,isFullScreen:!1,resizeCallbacks:[]}})}}n()}catch(e){n(e)}},1)},46929(e,t,a){"use strict";a.d(t,{n:()=>i}),a(44764),a(84978),a(25809),a(92280);var n=a(22628),s=a(5292);const i=(e,t,a,i,l)=>{const c=new Set,d=new Set,u=new Set;a.forEach((t,a)=>{const n=new RegExp(a,"g");e=e.replace(n,t)}),Object.keys(t.nodes).forEach(e=>{const a=t.nodes[e].isBlock;t.nodes[e].spec.hasOwnProperty("parseDOM")&&t.nodes[e].spec.parseDOM.forEach(n=>{u.add(n.tag),a&&"br"!==n.tag&&(c.add(n.tag),t.nodes[e].inlineContent&&d.add(n.tag))})}),Object.keys(t.marks).forEach(e=>{t.marks[e].spec.hasOwnProperty("parseDOM")&&t.marks[e].spec.parseDOM.forEach(e=>{u.add(e.tag)})});const p=document.createElement("div");p.innerHTML=l?n.A.sanitize(e,{CUSTOM_ELEMENT_HANDLING:{tagNameCheck:()=>!0,attributeNameCheck:/^user-id$/,allowCustomizedBuiltInElements:!0}}):e,function(e,t,a){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){const n=(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`));return t.has(e.nodeName.toLowerCase())||n||a?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;i.nextNode();)n.push(i.currentNode);n.forEach(e=>{const t=e.parentNode,a=(0,s.A)("code",e.outerHTML.slice(0,e.outerHTML.indexOf(">")+1)),n=(0,s.A)("code",`</${e.nodeName.toLowerCase()}>`);for(t.insertBefore(a,e);e.firstChild;)t.insertBefore(e.firstChild,e);t.insertBefore(n,e),t.removeChild(e)})}(p,u,i);const h=r([...p.childNodes],c);return o(h,c,d).innerHTML},r=(e,t)=>{let a=null;const n=[];let s=-1;return e.forEach((i,r)=>{const o=i.nodeName.toLowerCase();if("#comment"===o)return;if("#text"===o&&0===i.wholeText.trim().length){const n=e[r+1]?.nodeName.toLowerCase();if(t.has(a)||null===a&&t.has(n))return}const l=i.className?i.className.split(" "):[];let c=l.some(e=>t.has(`.${e}`));if(-1!==l.indexOf("rte2-style-ins-delete")||-1!==l.indexOf("rte2-style-ins-insert")||-1!==l.indexOf("rte2-style-ins-ai")||"ai"===o||"del"===o||"ins"===o){const e=i.children;if([...e].some(e=>{const a=e.nodeName.toLowerCase();return t.has(a)||"br"===a})&&(c=!0,i.childNodes.length>1))for(let t of e)"br"===t.nodeName.toLowerCase()&&t.remove()}t.has(o)||c?(s++,n[s]=[],n[s].push(i),n[s].isBlock=!0):"br"===o||null!==a&&"br"!==a&&!t.has(a)?"br"!==o&&"br"!==a?(n[s].isBlock&&(s++,n[s]=[]),n[s].push(i)):"br"===o&&null===a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0,n[s].isFirst=!0):"br"===o&&"br"!==a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0):"br"===o&&"br"===a&&n[s].push(i):(s++,n[s]=[],n[s].push(i)),a=o}),n},o=(e,t,a)=>{const n=document.createElement("div");let s=!1;return e.forEach((i,l)=>{if(i.isBreaks&&i.isFirst)i.forEach((e,t)=>{if(0===t&&e.length>1)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBreaks&&l===e.length-1){const e=document.createElement("bsp-line");n.appendChild(e)}else if(i.isBreaks)i.forEach((e,t)=>{if(0===t&&!s)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBlock)i.forEach(e=>{if(((e,t)=>!!t.has(e.nodeName.toLowerCase())||(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`)))(e,a))return void n.appendChild(e);const s=r([...e.childNodes],t);let i=o(s,t,a);e.innerHTML="",[...i.childNodes].forEach(t=>{e.appendChild(t)}),n.appendChild(e)}),s=!0;else{const e=document.createElement("bsp-line");i.forEach(t=>{e.appendChild(t)}),n.appendChild(e),s=!1}}),n}},34120(e,t,a){"use strict";a.d(t,{n:()=>i}),a(57573),a(49371),a(96648),a(56673);var n=a(87021),s=a(18101);const i=(e,t,a,i,l)=>{const c=new Set,d=new Set,u=new Set;a.forEach((t,a)=>{const n=new RegExp(a,"g");e=e.replace(n,t)}),Object.keys(t.nodes).forEach(e=>{const a=t.nodes[e].isBlock;t.nodes[e].spec.hasOwnProperty("parseDOM")&&t.nodes[e].spec.parseDOM.forEach(n=>{u.add(n.tag),a&&"br"!==n.tag&&(c.add(n.tag),t.nodes[e].inlineContent&&d.add(n.tag))})}),Object.keys(t.marks).forEach(e=>{t.marks[e].spec.hasOwnProperty("parseDOM")&&t.marks[e].spec.parseDOM.forEach(e=>{u.add(e.tag)})});const p=document.createElement("div");p.innerHTML=l?n.A.sanitize(e,{CUSTOM_ELEMENT_HANDLING:{tagNameCheck:()=>!0,attributeNameCheck:/^user-id$/,allowCustomizedBuiltInElements:!0}}):e,function(e,t,a){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){const n=(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`));return t.has(e.nodeName.toLowerCase())||n||a?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;i.nextNode();)n.push(i.currentNode);n.forEach(e=>{const t=e.parentNode,a=(0,s.A)("code",e.outerHTML.slice(0,e.outerHTML.indexOf(">")+1)),n=(0,s.A)("code",`</${e.nodeName.toLowerCase()}>`);for(t.insertBefore(a,e);e.firstChild;)t.insertBefore(e.firstChild,e);t.insertBefore(n,e),t.removeChild(e)})}(p,u,i);const h=r([...p.childNodes],c);return o(h,c,d).innerHTML},r=(e,t)=>{let a=null;const n=[];let s=-1;return e.forEach((i,r)=>{const o=i.nodeName.toLowerCase();if("#comment"===o)return;if("#text"===o&&0===i.wholeText.trim().length){const n=e[r+1]?.nodeName.toLowerCase();if(t.has(a)||null===a&&t.has(n))return}const l=i.className?i.className.split(" "):[];let c=l.some(e=>t.has(`.${e}`));if(-1!==l.indexOf("rte2-style-ins-delete")||-1!==l.indexOf("rte2-style-ins-insert")||-1!==l.indexOf("rte2-style-ins-ai")||"ai"===o||"del"===o||"ins"===o){const e=i.children;if([...e].some(e=>{const a=e.nodeName.toLowerCase();return t.has(a)||"br"===a})&&(c=!0,i.childNodes.length>1))for(let t of e)"br"===t.nodeName.toLowerCase()&&t.remove()}t.has(o)||c?(s++,n[s]=[],n[s].push(i),n[s].isBlock=!0):"br"===o||null!==a&&"br"!==a&&!t.has(a)?"br"!==o&&"br"!==a?(n[s].isBlock&&(s++,n[s]=[]),n[s].push(i)):"br"===o&&null===a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0,n[s].isFirst=!0):"br"===o&&"br"!==a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0):"br"===o&&"br"===a&&n[s].push(i):(s++,n[s]=[],n[s].push(i)),a=o}),n},o=(e,t,a)=>{const n=document.createElement("div");let s=!1;return e.forEach((i,l)=>{if(i.isBreaks&&i.isFirst)i.forEach((e,t)=>{if(0===t&&e.length>1)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBreaks&&l===e.length-1){const e=document.createElement("bsp-line");n.appendChild(e)}else if(i.isBreaks)i.forEach((e,t)=>{if(0===t&&!s)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBlock)i.forEach(e=>{if(((e,t)=>!!t.has(e.nodeName.toLowerCase())||(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`)))(e,a))return void n.appendChild(e);const s=r([...e.childNodes],t);let i=o(s,t,a);e.innerHTML="",[...i.childNodes].forEach(t=>{e.appendChild(t)}),n.appendChild(e)}),s=!0;else{const e=document.createElement("bsp-line");i.forEach(t=>{e.appendChild(t)}),n.appendChild(e),s=!1}}),n}},15281(e,t,a){"use strict";if(a.d(t,{d:()=>o}),a(67219),a(84978),a(39589),7717==a.j)var n=a(13333);var s=a(88903);if(7717==a.j)var i=a(72065);var r=a(22176);const o=e=>new i.k_({key:new i.hs("interchangeable"),props:{handleDOMEvents:{interchange:(t,a)=>{const o="/cms/drawer/item-interchange",l=a.detail;if(l.loadableTypes){const e=l.node,a=e.attrs.meta,n=e.attrs.attributes,i=t.state.tr,r=new URLSearchParams;r.set("typeId",a.typeId),r.set("targetTypeId",n["data-convert-target"]),r.set("itemState",n["data-state"]),r.set("isRte","true"),r.set("isConvert","true");const c=new Headers,d=s.A.get("bsp.csrf");return d&&c.append("Brightspot-CSRF",d),void fetch(`${o}`,{method:"POST",credentials:"include",body:r,headers:c}).then(s=>{s.text().then(s=>{const r={...JSON.parse(s)};n["data-state"]=r["data-state"],n["data-loadable-types"]=r["data-loadable-types"];const o=e.type.create({attributes:r,typeId:n["data-convert-target"],meta:a,id:e.attrs.id});i.replaceSelectionWith(o),t.dispatch(i)})})}const c=a.detail.to.dataset.sortableValidItemTypes.split(" "),d=a.detail.items.length>0?a.detail.items:[a.detail.item];!async function(e,t,a,o,l){for(const c in a){const d=a[c];let u;const p=d.dataset.sortableLoadTypes?.split(" ")||[],h=d.dataset.id,m=p.find(e=>l.includes(e)),f=new URLSearchParams;f.set("id",h||""),f.set("targetTypeId",m||""),f.set("isRte","true");const g=new Headers,v=s.A.get("bsp.csrf");v&&g.append("Brightspot-CSRF",v),await fetch(`${o}`,{method:"POST",credentials:"include",body:f,headers:g}).then(async s=>{const o=await s.text(),l={...JSON.parse(o)},c=l.label,d=window.RICH_TEXT_ELEMENTS;if(d instanceof Array&&(u=d.find(e=>e.tag===l.tagName)),u){let s,o;const d=e.state.selection,p=d.ranges[0].$to.pos;let f=p;const g=e.state.tr;if(!d.empty){const e=g.doc.resolve(p);g.setSelection(i.U3.near(e))}if("a"===u.tag){s=t.marks[u.tag],o=s.create({label:c,attributes:l,typeId:m,meta:u,id:h});const e=document.createElement("div");e.innerHTML=c||"",a.length>1&&e.append(document.createElement("br"));const r=n.S4.fromSchema(t).parseSlice(e,{preserveWhitespace:"full"});f=p+r.size,g.replaceSelection(r).addMark(p,f,o);const d=g.doc.resolve(f);g.setSelection(i.U3.near(d))}else{s=t.nodes[u.tag],o=s.create({label:"bsp-module"!==u.tag?c:null,attributes:l,typeId:m,meta:u,id:h});const e=g.doc.resolve(p),a=e.parent,n=a.isTextblock&&e.parentOffset===a.content.size;let r;if(a.isTextblock&&n){const a=e.depth>1?e.depth-1:e.depth,n=e.after(a);g.insert(n,o);const s=n+o.nodeSize;if(s>=g.doc.content.size){const e=t.nodes.line;e?(g.insert(s,e.create()),r=s+1):r=s}else r=s}else g.replaceSelectionWith(o),r=p+o.nodeSize;const d=g.doc.resolve(r);g.setSelection(i.U3.near(d,1))}g.setMeta("enhancementManager$",{remove:{id:h}}),e.dom.parentElement?.classList.contains(r.A.CLASSES.IS_PLACEHOLDER_CONTENT)&&e.dom.parentElement?.classList.remove(r.A.CLASSES.IS_PLACEHOLDER_CONTENT);try{e.dispatch(g)}catch(e){}}}).catch(()=>{})}}(t,e,d,o,c)}}}})},2472(e,t,a){"use strict";if(a.d(t,{d:()=>o}),a(86634),a(49371),a(26780),3324==a.j)var n=a(48940);var s=a(24510);if(3324==a.j)var i=a(59256);var r=a(34985);const o=e=>new i.k_({key:new i.hs("interchangeable"),props:{handleDOMEvents:{interchange:(t,a)=>{const o="/cms/drawer/item-interchange",l=a.detail;if(l.loadableTypes){const e=l.node,a=e.attrs.meta,n=e.attrs.attributes,i=t.state.tr,r=new URLSearchParams;r.set("typeId",a.typeId),r.set("targetTypeId",n["data-convert-target"]),r.set("itemState",n["data-state"]),r.set("isRte","true"),r.set("isConvert","true");const c=new Headers,d=s.A.get("bsp.csrf");return d&&c.append("Brightspot-CSRF",d),void fetch(`${o}`,{method:"POST",credentials:"include",body:r,headers:c}).then(s=>{s.text().then(s=>{const r={...JSON.parse(s)};n["data-state"]=r["data-state"],n["data-loadable-types"]=r["data-loadable-types"];const o=e.type.create({attributes:r,typeId:n["data-convert-target"],meta:a,id:e.attrs.id});i.replaceSelectionWith(o),t.dispatch(i)})})}const c=a.detail.to.dataset.sortableValidItemTypes.split(" "),d=a.detail.items.length>0?a.detail.items:[a.detail.item];!async function(e,t,a,o,l){for(const c in a){const d=a[c];let u;const p=d.dataset.sortableLoadTypes?.split(" ")||[],h=d.dataset.id,m=p.find(e=>l.includes(e)),f=new URLSearchParams;f.set("id",h||""),f.set("targetTypeId",m||""),f.set("isRte","true");const g=new Headers,v=s.A.get("bsp.csrf");v&&g.append("Brightspot-CSRF",v),await fetch(`${o}`,{method:"POST",credentials:"include",body:f,headers:g}).then(async s=>{const o=await s.text(),l={...JSON.parse(o)},c=l.label,d=window.RICH_TEXT_ELEMENTS;if(d instanceof Array&&(u=d.find(e=>e.tag===l.tagName)),u){let s,o;const d=e.state.selection,p=d.ranges[0].$to.pos;let f=p;const g=e.state.tr;if(!d.empty){const e=g.doc.resolve(p);g.setSelection(i.U3.near(e))}if("a"===u.tag){s=t.marks[u.tag],o=s.create({label:c,attributes:l,typeId:m,meta:u,id:h});const e=document.createElement("div");e.innerHTML=c||"",a.length>1&&e.append(document.createElement("br"));const r=n.S4.fromSchema(t).parseSlice(e,{preserveWhitespace:"full"});f=p+r.size,g.replaceSelection(r).addMark(p,f,o);const d=g.doc.resolve(f);g.setSelection(i.U3.near(d))}else{s=t.nodes[u.tag],o=s.create({label:"bsp-module"!==u.tag?c:null,attributes:l,typeId:m,meta:u,id:h});const e=g.doc.resolve(p),a=e.parent,n=a.isTextblock&&e.parentOffset===a.content.size;let r;if(a.isTextblock&&n){const a=e.depth>1?e.depth-1:e.depth,n=e.after(a);g.insert(n,o);const s=n+o.nodeSize;if(s>=g.doc.content.size){const e=t.nodes.line;e?(g.insert(s,e.create()),r=s+1):r=s}else r=s}else g.replaceSelectionWith(o),r=p+o.nodeSize;const d=g.doc.resolve(r);g.setSelection(i.U3.near(d,1))}g.setMeta("enhancementManager$",{remove:{id:h}}),e.dom.parentElement?.classList.contains(r.A.CLASSES.IS_PLACEHOLDER_CONTENT)&&e.dom.parentElement?.classList.remove(r.A.CLASSES.IS_PLACEHOLDER_CONTENT);try{e.dispatch(g)}catch(e){}}}).catch(()=>{})}}(t,e,d,o,c)}}}})},6087(e,t,a){"use strict";if(a.d(t,{l:()=>p}),a(84978),a(91672),7717==a.j)var n=a(68243);var s=a(1439),i=a.n(s);if(7717==a.j)var r=a(13333);var o=a(72065);if(7717==a.j)var l=a(17283);if(7717==a.j)var c=a(15483);const d=document.createElement("canvas").getContext("2d"),u=new o.hs("bsp-mention"),p=e=>{const t=document.querySelector("template#rte-mention-input");let a;return t&&(a=document.createElement("form"),a.className="Mention",a.style.overflow="clip",a.appendChild(t.content.cloneNode(!0)),(0,n.A)(a,e),i()(a).trigger("create")),new o.k_({key:u,state:{init:()=>l.zF.empty,apply:(e,t)=>{const a=e.getMeta(u);return"remove"===a?l.zF.empty:a?l.zF.create(e.doc,[l.NZ.widget(a.pos,a.spacer)]):t.map(e.mapping,e.doc)}},props:{decorations:e=>u.getState(e),handleTextInput:(e,t,n,s)=>{if(!a)return!1;if("@"!==s)return!1;if(1!==t){let a=e.state.doc.textBetween(t-1,n);if(!/\s/.test(a)&&""!==a)return!1}return queueMicrotask(()=>((e,t,n)=>{const s=e.state.doc;if(t+1>s.content.size)return;if("@"!==s.textBetween(t,t+1))return;const i=a.querySelector(".ContentSelector-select");if(!i)return;const o=a.querySelector(".ComboInput-filter");i.value="",i.dispatchEvent(new CustomEvent("change",{bubbles:!0}));const l=a.offsetParent;if(!l)return;const p=e.coordsAtPos(t+1),h=document.createElement("span");h.style.display="inline-block",h.style.height=p.bottom-p.top+"px",h.style.verticalAlign="text-bottom",e.dispatch(e.state.tr.setMeta(u,{pos:t+1,spacer:h}));const m=()=>{let t=0;if(o){const e=window.getComputedStyle(o);d.font=`${e.fontWeight} ${e.fontSize} ${e.fontFamily}`,t=Math.max(d.measureText(o.value).width,d.measureText(o.placeholder||"").width)}const n=l.getBoundingClientRect(),s=n.left+l.clientLeft,i=n.top+l.clientTop,r=e.dom.getBoundingClientRect(),c=window.getComputedStyle(e.dom),u=r.right-parseFloat(c.paddingRight),p=u-r.left-parseFloat(c.paddingLeft);h.style.width=`${Math.min(Math.ceil(t)+4,p)}px`;const m=h.getBoundingClientRect(),f=m.top-i;if(a.style.left=m.left-s+"px",a.style.top=`${f}px`,a.style.maxWidth=`${Math.max(0,u-m.left)}px`,o){const e=o.getBoundingClientRect();e.height>0&&(a.style.top=f+(m.top+m.bottom)/2-(e.top+e.bottom)/2+"px",o.style.width=`${Math.max(24,m.right-e.left)}px`)}};m(),a.style.visibility="visible";const f=(0,c.Kr)(a)[0];if(!f)return e.dispatch(e.state.tr.setMeta(u,"remove")),void(a.style.visibility="hidden");f.focus(),f.click(),m();const g=()=>{i.removeEventListener("combo-input:hide",b),o?.removeEventListener("input",m)},v=()=>{i.removeEventListener("change",v),g();const a=i.value;if(!a)return;const s=document.createElement("bsp-mention");s.setAttribute("user-id",a),s.innerText="@"+Array.prototype.filter.call(i,e=>e.value===a)[0].label;const o=document.createElement("div");o.appendChild(s),o.appendChild(document.createTextNode(" "));const l=e.state;e.dispatch(l.tr.replaceRange(t,n+1,r.S4.fromSchema(l.config.schema).parseSlice(o,{preserveWhitespace:!0})).setMeta(u,"remove"))},b=()=>{g(),e.dispatch(e.state.tr.setMeta(u,"remove")),e.focus(),a.style.visibility="hidden"};i.addEventListener("change",v),i.addEventListener("combo-input:hide",b),o?.addEventListener("input",m)})(e,t,n)),!1}}})}},41694(e,t,a){"use strict";if(a.d(t,{l:()=>p}),a(49371),a(56065),3324==a.j)var n=a(39242);var s=a(88630),i=a.n(s);if(3324==a.j)var r=a(48940);var o=a(59256);if(3324==a.j)var l=a(88282);if(3324==a.j)var c=a(2674);const d=document.createElement("canvas").getContext("2d"),u=new o.hs("bsp-mention"),p=e=>{const t=document.querySelector("template#rte-mention-input");let a;return t&&(a=document.createElement("form"),a.className="Mention",a.style.overflow="clip",a.appendChild(t.content.cloneNode(!0)),(0,n.A)(a,e),i()(a).trigger("create")),new o.k_({key:u,state:{init:()=>l.zF.empty,apply:(e,t)=>{const a=e.getMeta(u);return"remove"===a?l.zF.empty:a?l.zF.create(e.doc,[l.NZ.widget(a.pos,a.spacer)]):t.map(e.mapping,e.doc)}},props:{decorations:e=>u.getState(e),handleTextInput:(e,t,n,s)=>{if(!a)return!1;if("@"!==s)return!1;if(1!==t){let a=e.state.doc.textBetween(t-1,n);if(!/\s/.test(a)&&""!==a)return!1}return queueMicrotask(()=>((e,t,n)=>{const s=e.state.doc;if(t+1>s.content.size)return;if("@"!==s.textBetween(t,t+1))return;const i=a.querySelector(".ContentSelector-select");if(!i)return;const o=a.querySelector(".ComboInput-filter");i.value="",i.dispatchEvent(new CustomEvent("change",{bubbles:!0}));const l=a.offsetParent;if(!l)return;const p=e.coordsAtPos(t+1),h=document.createElement("span");h.style.display="inline-block",h.style.height=p.bottom-p.top+"px",h.style.verticalAlign="text-bottom",e.dispatch(e.state.tr.setMeta(u,{pos:t+1,spacer:h}));const m=()=>{let t=0;if(o){const e=window.getComputedStyle(o);d.font=`${e.fontWeight} ${e.fontSize} ${e.fontFamily}`,t=Math.max(d.measureText(o.value).width,d.measureText(o.placeholder||"").width)}const n=l.getBoundingClientRect(),s=n.left+l.clientLeft,i=n.top+l.clientTop,r=e.dom.getBoundingClientRect(),c=window.getComputedStyle(e.dom),u=r.right-parseFloat(c.paddingRight),p=u-r.left-parseFloat(c.paddingLeft);h.style.width=`${Math.min(Math.ceil(t)+4,p)}px`;const m=h.getBoundingClientRect(),f=m.top-i;if(a.style.left=m.left-s+"px",a.style.top=`${f}px`,a.style.maxWidth=`${Math.max(0,u-m.left)}px`,o){const e=o.getBoundingClientRect();e.height>0&&(a.style.top=f+(m.top+m.bottom)/2-(e.top+e.bottom)/2+"px",o.style.width=`${Math.max(24,m.right-e.left)}px`)}};m(),a.style.visibility="visible";const f=(0,c.Kr)(a)[0];if(!f)return e.dispatch(e.state.tr.setMeta(u,"remove")),void(a.style.visibility="hidden");f.focus(),f.click(),m();const g=()=>{i.removeEventListener("combo-input:hide",b),o?.removeEventListener("input",m)},v=()=>{i.removeEventListener("change",v),g();const a=i.value;if(!a)return;const s=document.createElement("bsp-mention");s.setAttribute("user-id",a),s.innerText="@"+Array.prototype.filter.call(i,e=>e.value===a)[0].label;const o=document.createElement("div");o.appendChild(s),o.appendChild(document.createTextNode(" "));const l=e.state;e.dispatch(l.tr.replaceRange(t,n+1,r.S4.fromSchema(l.config.schema).parseSlice(o,{preserveWhitespace:!0})).setMeta(u,"remove"))},b=()=>{g(),e.dispatch(e.state.tr.setMeta(u,"remove")),e.focus(),a.style.visibility="hidden"};i.addEventListener("change",v),i.addEventListener("combo-input:hide",b),o?.addEventListener("input",m)})(e,t,n)),!1}}})}},50844(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{x:()=>$}),a(67219),a(44764),7717==a.j)var s=a(72065);if(7717==a.j)var i=a(46388);if(7717==a.j)var r=a(17755);var o=a(341),l=a(38607),c=a(2583),d=a(55864),u=a(51369),p=a(831);if(7717==a.j)var h=a(47401);var m=a(10968),f=a(21932),g=a(34375),v=a(19552);if(7717==a.j)var b=a(75869);if(7717==a.j)var y=a(93970);var C=a(70434);if(7717==a.j)var w=a(24455);var A=a(12536),E=a(35140),S=a(63511),I=a(47045);if(7717==a.j)var T=a(22377);var k=a(27808),M=a(6087),L=a(15281),x=a(46052),P=a(61827),D=e([o,l,c,d,u,f,C,A,E,S,I,k,P]);[o,l,c,d,u,f,C,A,E,S,I,k,P]=D.then?(await D)():D;const _=e=>(0,g.D8)(e),O=()=>{const e=[T.P8];return(0,T.sM)({rules:e})};function $(e){let t=[(0,I.e)(e.compliantTagNameMap),(0,E.o)(e.ctx,e.compliantTagNameMap),(0,h.b6)(),(0,d.s)(),(0,c.bS)(e.schema),(0,f.N_)(e.schema,e.userLabel,e.userId),(0,m.lt)(e.schema,e.userLabel,e.ctx),(0,b.A)(),(0,y.z)(),(0,g.LF)(),(0,v.J)(),(0,l.XC)(e.ctx,e.compliantTagNameMap),(0,C.F)(),(0,r.w)({Tab:_(1),"Shift-Tab":(0,g.D8)(-1)}),(0,r.w)(e.buildKeymap(e)),(0,r.w)(i.RV),(0,k.i)(e.ctx,e.compliantTagNameMap),(0,p.G)(),(0,S.hI)(),O(),(0,o.B)(e.menuItems),(0,L.d)(e.schema)];window.BRIGHTSPOT?.ai?.AI_CHAT_ENABLED&&t.unshift((0,x.M)(e.schema,e.userLabel,e.userId,e.compliantTagNameMap),(0,P.t)(e.userLabel,e.userId,e.compliantTagNameMap));try{const a=e.ctx.dataset.rteTags;a&&JSON.parse(a).includes("bsp-mention")&&t.push((0,M.l)(e.ctx))}catch{}return ENABLE_PROSE_MIRROR_SPELL_CHECK&&t.push((0,u.k)()),e.isCollab&&(t.push((0,w.Qr)({version:e.version,clientID:e.userId})),t.push((0,A.H)(e.schema,e.userId,e.anchorMap,e.rangeList,e.lockedList))),t.concat(new s.k_({key:new s.hs("pluginProvider"),props:{attributes:{class:"ProseMirror-setup-style",role:"textbox","aria-multiline":"true"}}}))}n()}catch(N){n(N)}})},63653(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{x:()=>$}),a(86634),a(57573),3324==a.j)var s=a(59256);if(3324==a.j)var i=a(59197);if(3324==a.j)var r=a(3743);var o=a(87532),l=a(74214),c=a(89774),d=a(68673),u=a(38560),p=a(88022);if(3324==a.j)var h=a(70112);var m=a(75361),f=a(86325),g=a(21566),v=a(83945);if(3324==a.j)var b=a(63060);if(3324==a.j)var y=a(58363);var C=a(83243);if(3324==a.j)var w=a(11646);var A=a(25345),E=a(99533),S=a(50702),I=a(34236);if(3324==a.j)var T=a(9568);var k=a(40617),M=a(41694),L=a(2472),x=a(10445),P=a(32826),D=e([o,l,c,d,u,f,C,A,E,S,I,k,P]);[o,l,c,d,u,f,C,A,E,S,I,k,P]=D.then?(await D)():D;const _=e=>(0,g.D8)(e),O=()=>{const e=[T.P8];return(0,T.sM)({rules:e})};function $(e){let t=[(0,I.e)(e.compliantTagNameMap),(0,E.o)(e.ctx,e.compliantTagNameMap),(0,h.b6)(),(0,d.s)(),(0,c.bS)(e.schema),(0,f.N_)(e.schema,e.userLabel,e.userId),(0,m.lt)(e.schema,e.userLabel,e.ctx),(0,b.A)(),(0,y.z)(),(0,g.LF)(),(0,v.J)(),(0,l.XC)(e.ctx,e.compliantTagNameMap),(0,C.F)(),(0,r.w)({Tab:_(1),"Shift-Tab":(0,g.D8)(-1)}),(0,r.w)(e.buildKeymap(e)),(0,r.w)(i.RV),(0,k.i)(e.ctx,e.compliantTagNameMap),(0,p.G)(),(0,S.hI)(),O(),(0,o.B)(e.menuItems),(0,L.d)(e.schema)];window.BRIGHTSPOT?.ai?.AI_CHAT_ENABLED&&t.unshift((0,x.M)(e.schema,e.userLabel,e.userId,e.compliantTagNameMap),(0,P.t)(e.userLabel,e.userId,e.compliantTagNameMap));try{const a=e.ctx.dataset.rteTags;a&&JSON.parse(a).includes("bsp-mention")&&t.push((0,M.l)(e.ctx))}catch{}return ENABLE_PROSE_MIRROR_SPELL_CHECK&&t.push((0,u.k)()),e.isCollab&&(t.push((0,w.Qr)({version:e.version,clientID:e.userId})),t.push((0,A.H)(e.schema,e.userId,e.anchorMap,e.rangeList,e.lockedList))),t.concat(new s.k_({key:new s.hs("pluginProvider"),props:{attributes:{class:"ProseMirror-setup-style",role:"textbox","aria-multiline":"true"}}}))}n()}catch(N){n(N)}})},61827(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,t:()=>d});var s=a(72065),i=a(96410);if(7717==a.j)var r=a(17283);var o=e([i]),l=o.then?(await o)():o;i=l[0];const c=new s.hs("aiInline"),d=(e,t,a)=>new s.k_({key:c,view(n){const s=new i.F(n,c.get(n.state).key,e,t,a),r=n.dom.parentNode?.querySelector(".ProseMirrorToolbar");if(r){const e=s.dom;e&&r.appendChild(e)}return s},state:{init(e){const t=new Map,a=new Map,n=new Map,s=new Map;return a.set("toggleAIInline",!1),t.set("activeStates",a),t.set("disabledStates",n),t.set("metaData",s),t},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i?.toggleAIInline){const e=s.get("activeStates"),t=e.get("toggleAIInline");e.set("toggleAIInline",!t)}return s}},props:{decorations(e){const t=this.getState(e);if(!t)return r.zF.empty;if(!t.get("activeStates").get("toggleAIInline"))return r.zF.empty;const{from:a,to:n}=e.selection;if(a===n)return r.zF.empty;const s=r.NZ.inline(a,n,{class:"rte2-style-ai-inline-highlight"});return r.zF.create(e.doc,[s])}}}),u=()=>function(e,t,a){return t(e.tr.setMeta(c,{toggleAIInline:!0})),a?.dom.classList.toggle("ProseMirror-aiInlinePreviewMode"),!0};n()}catch(e){n(e)}})},32826(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,t:()=>d});var s=a(59256),i=a(76995);if(3324==a.j)var r=a(88282);var o=e([i]),l=o.then?(await o)():o;i=l[0];const c=new s.hs("aiInline"),d=(e,t,a)=>new s.k_({key:c,view(n){const s=new i.F(n,c.get(n.state).key,e,t,a),r=n.dom.parentNode?.querySelector(".ProseMirrorToolbar");if(r){const e=s.dom;e&&r.appendChild(e)}return s},state:{init(e){const t=new Map,a=new Map,n=new Map,s=new Map;return a.set("toggleAIInline",!1),t.set("activeStates",a),t.set("disabledStates",n),t.set("metaData",s),t},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i?.toggleAIInline){const e=s.get("activeStates"),t=e.get("toggleAIInline");e.set("toggleAIInline",!t)}return s}},props:{decorations(e){const t=this.getState(e);if(!t)return r.zF.empty;if(!t.get("activeStates").get("toggleAIInline"))return r.zF.empty;const{from:a,to:n}=e.selection;if(a===n)return r.zF.empty;const s=r.NZ.inline(a,n,{class:"rte2-style-ai-inline-highlight"});return r.zF.create(e.doc,[s])}}}),u=()=>function(e,t,a){return t(e.tr.setMeta(c,{toggleAIInline:!0})),a?.dom.classList.toggle("ProseMirror-aiInlinePreviewMode"),!0};n()}catch(e){n(e)}})},96410(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{F:()=>M}),a(44764),a(84978),a(13722),a(25809),a(91672),a(92280);var s=a(26173),i=a(99666);if(7717==a.j)var r=a(13333);var o=a(46929),l=a(38745),c=a(99022),d=a(63110),u=a.n(d),p=a(88903),h=a(22628),m=e([s]),f=m.then?(await m)():m;s=f[0],window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(2456).then(a.bind(a,42456));const g=window.BRIGHTSPOT?.ui.cms.enableV5UI,v="ProseMirrorAIInline-container",b=window.RTE_PROMPT_PLACEHOLDER,y=window.RTE_PROMPT_PREFIX,C=window.RTE_PROMPT_RETRY,w=window.RTE_WORKING_ON_IT,A=window.RTE_ACCEPT,E=window.RTE_DISCARD,S=window.RTE_TRY_AGAIN,I="collapsed",T=window.BRIGHTSPOT?.web?.pagePaths?.["com.psddev.ai.chat.ChatPageResponses"],k=window.BRIGHTSPOT?.web?.pagePaths?.["com.psddev.ai.chat.PromptPage"];class M{constructor(e,t,a,n,s){this.focused=!1,this.isLoading=!1,this.retry=!1,this.suggestionsFetched=!1,this.editorView=void 0,this.myKey=void 0,this.userLabel=void 0,this.userId=void 0,this.compliantTagNameMap=void 0,this.dom=void 0,this.field=void 0,this.textArea=void 0,this.loadingOverlay=void 0,this.loadingPromptEle=void 0,this.objectId=void 0,this.typeId=void 0,this.contentState=void 0,this.inputEle=void 0,this.submitButtonEle=void 0,this.acceptRejectContainerEle=void 0,this.tether=void 0,this.toolbarEl=void 0,this.resizeObserver=void 0,this.suggestionsContainer=null,this.sendTrackingEvent=void 0,this.chatId=void 0,this.responseId=void 0,this.lastPrompt=void 0,this.lastSelectedContent=void 0,this.lastSelectionFrom=void 0,this.lastSelectionTo=void 0,this.template=()=>i.qy`
|
|
32
|
+
</div>`}}]}}(function(e){I.initializeInstanceElements(e,k.elements)},S),k=I.decorateClass(function(e){for(var t=[],a=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},n=0;n<e.length;n++){var s,i=e[n];if("method"===i.kind&&(s=t.find(a)))if(f(i.descriptor)||f(s.descriptor)){if(m(i)||m(s))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");s.descriptor=i.descriptor}else{if(m(i)){if(m(s))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");s.decorators=i.decorators}h(i,s)}else t.push(i)}return t}(T.d.map(p)),E),I.initializeClassElements(T.F,k.elements),I.runClassFinishers(T.F,k.finishers));var E,S,I,T,k,M=a(55408),L=a(88630);class x{constructor(e,t){this._element=void 0,this._options=void 0,this._loadableTypes=void 0,this._node=void 0,this._editorView=void 0,this._element=e,this._options=t,this._loadableTypes=t.loadableTypes,this._node=t.node,this._editorView=t.editorView,this._update=(0,s.A)(this._update.bind(this)),this._update()}_update(){if(!this._element||this._element.closest(".is-gridItem")||this._element.closest(".is-listItem"))return;const e=new A;if(this._node){const e=(0,n.A)("ul",{className:"Dropdown",role:"menu","aria-label":window.BRIGHTSPOT?.ui.tooltips.actions?.contentSelector,"aria-orientation":"vertical"});if(this._element.addEventListener("click",()=>{const t=this._element.nextSibling;t instanceof HTMLElement&&M.A.toggle(this._element,t,()=>(this._element.classList.toggle("is-active",t.classList.toggle("is-open")),e.setAttribute("aria-expanded",t.classList.contains("is-open").valueOf().toString()),!0))}),this._loadableTypes){const t=JSON.parse(this._loadableTypes);for(const a in t){const t=(0,n.A)("li",{className:"Dropdown-item","aria-label":a,role:"menuitem"},a);e.appendChild(t),t.addEventListener("click",()=>{const e=new CustomEvent("interchange",{detail:this._options});if(this._loadableTypes){const t=JSON.parse(this._loadableTypes);this._node&&(this._node.attrs.attributes["data-convert-target"]=t[a]),this._editorView?.dispatchEvent(e)}})}}return void this._element.after(e)}const t=this._element.parentElement,a=t?.parentElement;if(!t||!a)return;const s=P(t,".objectId-edit"),r=P(t,".objectId-clear"),o=P(t,".RCIG-swap")||P(t,".EIG-swap"),l=P(t,".removeButton"),c=P(t,".MultiSortable-buttonToggle"),d=P(t,".convertButton"),u=P(t,".copyButton"),p=t.closest("form"),h=this._element.dataset.objectId,m=a.closest("[data-name]")?.dataset.name,f=a.dataset.fieldName,g=a.dataset.containerId,v=a.dataset.typeId,b=a.dataset.recordTypeId,y=a.dataset.sortableValidItemTypes,C=a.dataset.isSwappable,w=new FormData;m&&w.set("inputName",m),f&&w.set("fieldName",f),g&&w.set("containerId",g),v&&w.set("containerTypeId",v),b&&w.set("recordTypeId",b),y&&w.set("validTypes",y),C&&w.set("isSwappable",C);const E=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});if(s||r||o||l){if((c||t.classList.contains("Sortable-item")&&t.classList.contains("RCIG-item"))&&t.classList.add("toggleVisible"),this._element.after(e),s.length&&e._addDropdownItem((0,n.A)("li",s)),r.length&&e._addDropdownItem((0,n.A)("li",r)),o.length&&(e._addDropdownItem((0,n.A)("li",o)),o[0].ariaLabel=o[0].textContent),u.length&&(e._addDropdownItem((0,n.A)("li",u)),u[0].ariaLabel=u[0].textContent),d.length)for(const s of d)e._addDropdownItem((0,n.A)("li",s)),s.ariaLabel=s.textContent,s.addEventListener("click",()=>{if(p&&h){const e=_(t,p,h);if(e){const n=JSON.parse(e)._type,r=s.dataset.targetType,o=t.cloneNode(!1);n&&w.append("typeId",n),r&&w.append("targetTypeId",r),w.append("itemState",e),w.append("isConvert","true"),D(w,"/cms/drawer/item-interchange").then(e=>{o.innerHTML=e;const n=t.closest(".plugin-repeatable");n&&L(n).data("repeatable").itemLoad(t).then(()=>{L(n).data("repeatable").initItem(o),L(o).trigger("create"),a?.replaceChild(o,t),(0,i.A)(o,":scope > .repeatableLabel",e=>{o.classList.contains("is-collapsed")&&e.dispatchEvent(E),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{e.classList.contains("RCIG-title")&&e.focus()})})})})})}}});u.length&&u[0].addEventListener("click",()=>{if(p&&h){const e=_(t,p,h);if(e){const t=JSON.parse(e)._type;t&&w.append("typeId",t),w.append("itemState",e),D(w,"/cms/copy-record").then(e=>{const t=(new DOMParser).parseFromString(e,"text/html").body.firstChild;if(t){a?.appendChild(t);const e=t.closest(".plugin-repeatable");e&&L(e).data("repeatable").itemLoad(t).then(()=>{L(e).data("repeatable").initItem(t),(0,i.A)(t,":scope > .repeatableLabel",e=>{t.classList.contains("is-collapsed")&&e.dispatchEvent(E),t.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),window.requestAnimationFrame(()=>{e.classList.contains("RCIG-title")&&e.focus()})})})}})}}})}}}const P=(e,t)=>{const a=Array.prototype.filter.call(e.children,function(e){return e.matches(t)});return a.length>0?a:[]},D=async(e,t)=>{const a=new Headers,n=r.A.get("bsp.csrf");n&&a.append("Brightspot-CSRF",n);const s=await fetch(t,{method:"POST",credentials:"include",body:e,headers:a});return await s.text()},_=(e,t,a)=>{const n=L(t).data("brightspot-content-state");if(n){const e=JSON.parse(n),t=O(e,a);if(t)return JSON.stringify(t)}return e.dataset.state},O=(e,t)=>{if(e._id===t)return e;{const a=Object.keys(e);for(const n of a){const a=e[n];if(a&&"object"==typeof a){const e=O(a,t);if(e)return e}}}}},80133(e,t,a){"use strict";a.d(t,{m:()=>n});const n=e=>class extends e{connectedCallback(){super.connectedCallback(),Promise.resolve().then(()=>this.emit("btu-brightspot-element-connected",{}),e=>this.emit("btu-brightspot-element-error",{error:e}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("btu-brightspot-element-disconnected")}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:t}))}}},67324(e,t,a){"use strict";a.d(t,{m:()=>n});const n=e=>class extends e{connectedCallback(){super.connectedCallback(),Promise.resolve().then(()=>this.emit("btu-brightspot-element-connected",{}),e=>this.emit("btu-brightspot-element-error",{error:e}))}disconnectedCallback(){super.disconnectedCallback(),this.emit("btu-brightspot-element-disconnected")}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!1,composed:!0,detail:t}))}}},1607(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(38745);if(7717==a.j)var s=a(68243);class i{static onFindFunction(e,t){return a=>{const n=new i(e,t,parseInt(a.style.getPropertyValue("--progress")));(0,s.A)(n.getElement(),a),a.hidden=!0}}constructor(e,t,a=0){this._circumference=void 0,this._element=void 0,this._value=0;const s=(0,n.A)("div"),i=e/2,r=i-t/2;if(this._circumference=2*Math.PI*r,s.innerHTML=`\n <svg class="RPB" viewBox="0 0 ${e} ${e}">\n <circle\n class="RPB-bg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t-1}"\n />\n <circle\n class="RPB-fg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t}"\n stroke-dasharray="${this._circumference}"\n stroke-dashoffset="${this._circumference}"\n />\n </svg>\n `,!(s.firstElementChild instanceof SVGElement))throw new Error("SVG not found");this._element=s.firstElementChild,this.setValue(a)}getElement(){return this._element}getValue(){return this._value}setValue(e){this._value=e,this._element.querySelector(":scope > .RPB-fg")?.setAttribute("stroke-dashoffset",""+this._circumference*(1-e/100))}}},88798(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(25936);if(3324==a.j)var s=a(39242);class i{static onFindFunction(e,t){return a=>{const n=new i(e,t,parseInt(a.style.getPropertyValue("--progress")));(0,s.A)(n.getElement(),a),a.hidden=!0}}constructor(e,t,a=0){this._circumference=void 0,this._element=void 0,this._value=0;const s=(0,n.A)("div"),i=e/2,r=i-t/2;if(this._circumference=2*Math.PI*r,s.innerHTML=`\n <svg class="RPB" viewBox="0 0 ${e} ${e}">\n <circle\n class="RPB-bg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t-1}"\n />\n <circle\n class="RPB-fg"\n cx="${i}"\n cy="${i}"\n r="${r}"\n stroke-width="${t}"\n stroke-dasharray="${this._circumference}"\n stroke-dashoffset="${this._circumference}"\n />\n </svg>\n `,!(s.firstElementChild instanceof SVGElement))throw new Error("SVG not found");this._element=s.firstElementChild,this.setValue(a)}getElement(){return this._element}getValue(){return this._value}setValue(e){this._value=e,this._element.querySelector(":scope > .RPB-fg")?.setAttribute("stroke-dashoffset",""+this._circumference*(1-e/100))}}},25734(e,t,a){"use strict";a.d(t,{iP:()=>o,tK:()=>c,wC:()=>r}),a(44764);var n=a(56155);if(7717==a.j)var s=a(27170);var i=a(33582);function r(e,t){return e.replace(/_{3}/g,(a=0,e=>t[a++]));var a}function o(e,t){let a=document.getElementById("aria-live-container");a||(a=document.createElement("div"),a.setAttribute("id","aria-live-container"),document.body.appendChild(a));const n=document.createElement("div"),s="speak-"+Date.now();n.setAttribute("id",s),n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.classList.add("screen-reader-only"),t&&t.length&&(e=r(`${e}`,t)),a.appendChild(n),setTimeout(()=>{const t=document.getElementById(s);t&&(t.innerHTML=e)},150),!0===window.BRIGHTSPOT?.ariaDebug&&console.log(`ARIA Announced: "${e}"`),setTimeout(()=>{document.getElementById(s)?.remove()},2e3)}document.addEventListener("DOMContentLoaded",()=>{document.body.addEventListener("btu-announce",e=>{e instanceof CustomEvent&&o(e.detail)})});const l=[];(0,n.A)("[data-aria-announce]",e=>{l.push(e),setTimeout(()=>{if(l.length>0){const e=l.map(e=>"true"===e.dataset.ariaAnnounce?e.textContent:e.dataset.ariaAnnounce).join(", ");l.length=0,o(e)}},2500)}),(0,i.A)([".addButton",".Workflow-addState",".Workflow-addTransition",".calendarButton",".ComboInput"],e=>{const t=e.closest(".CIG-row");if(!t)return;const a=t.querySelector(".Message.is-error");if(!a)return;const n=a.getAttribute("id");n&&(e.setAttribute("aria-describedby",n),e.setAttribute("aria-invalid","true"))}),(0,i.A)('a[role="button"]',e=>{e.addEventListener("keydown",t=>{"Space"===t.code&&(t.preventDefault(),e.click())})});const c=e=>{(0,s.A)(1e3,()=>o(e))}},90127(e,t,a){"use strict";a.d(t,{iP:()=>o,tK:()=>c,wC:()=>r}),a(57573);var n=a(91762);if(3324==a.j)var s=a(39979);var i=a(46391);function r(e,t){return e.replace(/_{3}/g,(a=0,e=>t[a++]));var a}function o(e,t){let a=document.getElementById("aria-live-container");a||(a=document.createElement("div"),a.setAttribute("id","aria-live-container"),document.body.appendChild(a));const n=document.createElement("div"),s="speak-"+Date.now();n.setAttribute("id",s),n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.classList.add("screen-reader-only"),t&&t.length&&(e=r(`${e}`,t)),a.appendChild(n),setTimeout(()=>{const t=document.getElementById(s);t&&(t.innerHTML=e)},150),!0===window.BRIGHTSPOT?.ariaDebug&&console.log(`ARIA Announced: "${e}"`),setTimeout(()=>{document.getElementById(s)?.remove()},2e3)}document.addEventListener("DOMContentLoaded",()=>{document.body.addEventListener("btu-announce",e=>{e instanceof CustomEvent&&o(e.detail)})});const l=[];(0,n.A)("[data-aria-announce]",e=>{l.push(e),setTimeout(()=>{if(l.length>0){const e=l.map(e=>"true"===e.dataset.ariaAnnounce?e.textContent:e.dataset.ariaAnnounce).join(", ");l.length=0,o(e)}},2500)}),(0,i.A)([".addButton",".Workflow-addState",".Workflow-addTransition",".calendarButton",".ComboInput"],e=>{const t=e.closest(".CIG-row");if(!t)return;const a=t.querySelector(".Message.is-error");if(!a)return;const n=a.getAttribute("id");n&&(e.setAttribute("aria-describedby",n),e.setAttribute("aria-invalid","true"))}),(0,i.A)('a[role="button"]',e=>{e.addEventListener("keydown",t=>{"Space"===t.code&&(t.preventDefault(),e.click())})});const c=e=>{(0,s.A)(1e3,()=>o(e))}},68243(e,t,a){"use strict";function n(e,t){return t?.parentNode?.insertBefore(e,t),e}a.d(t,{A:()=>n})},39242(e,t,a){"use strict";function n(e,t){return t?.parentNode?.insertBefore(e,t),e}a.d(t,{A:()=>n})},33582(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(56155);let s=0;function i(e,t){const a="_ovc"+s++,i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){const e=n.target,s=e.classList;s.contains(a)||(s.add(a),i.unobserve(e),t(e))}});(0,n.A)(e,e=>{i.observe(e)})}},46391(e,t,a){"use strict";a.d(t,{A:()=>i});var n=a(91762);let s=0;function i(e,t){const a="_ovc"+s++,i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){const e=n.target,s=e.classList;s.contains(a)||(s.add(a),i.unobserve(e),t(e))}});(0,n.A)(e,e=>{i.observe(e)})}},89561(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(83394)},76752(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(96203)},10013(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(33582)},97204(e,t,a){"use strict";a.d(t,{A:()=>n.A});var n=a(46391)},3315(e,t,a){"use strict";if(a.d(t,{K:()=>s}),7717==a.j)var n=a(83043);function s(e,t){if(e&&t)try{const a=(window.BRIGHTSPOT?.icons?.materialToLucide||{})[e]??e,s=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=n[s];i?.encodedCode&&t.style.setProperty("--compat-icon",`'${i.encodedCode}'`),document.dispatchEvent(new CustomEvent("btu-resolve-icon",{detail:{name:a,element:t}}))}catch(t){console.error(`[resolveIconCompat] Failed to resolve icon "${e}":`,t)}}},22730(e,t,a){"use strict";if(a.d(t,{K:()=>s}),3324==a.j)var n=a(54042);function s(e,t){if(e&&t)try{const a=(window.BRIGHTSPOT?.icons?.materialToLucide||{})[e]??e,s=a.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=n[s];i?.encodedCode&&t.style.setProperty("--compat-icon",`'${i.encodedCode}'`),document.dispatchEvent(new CustomEvent("btu-resolve-icon",{detail:{name:a,element:t}}))}catch(t){console.error(`[resolveIconCompat] Failed to resolve icon "${e}":`,t)}}},52215(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>n.A});var n=a(26791)},23054(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>n.A});var n=a(75230)},73061(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{RTE:()=>C}),a(44764),a(50144),a(84978),a(13722),a(25809),a(91672),a(92280);var s=a(27791),i=a(26173);if(7717==a.j)var r=a(17283);var o=a(46929),l=a(90458),c=a(55053),d=a(77281),u=a(52215);if(7717==a.j)var p=a(24455);if(7717==a.j)var h=a(40320);if(7717==a.j)var m=a(13333);if(a(22628),7717==a.j)var f=a(36500);a(65210);var g=a(92),v=a(25734),b=a(1439),y=e([s,i,l,c,d]);[s,i,l,c,d]=y.then?(await y)():y,window.BRIGHTSPOT?.ui.cms.enableV5UI?await a.e(2111).then(a.bind(a,92111)):(await Promise.resolve().then(a.bind(a,65210)),await a.e(9576).then(a.bind(a,99576)),await a.e(7863).then(a.bind(a,77863)));class C{constructor(e,t,a,n,r,c,d,h,y,C){this.setValue=e=>{const{state:t,dispatch:a}=this.view;(0,i.y6)(t,e,this.compliantTagNameMap,a,!0,!0,!1)},this.setMinHeight=()=>{this.view.dom.style.setProperty("--ProseMirror-numLines",this.numLines)},this.hideLoader=()=>{const e=this.view.dom.parentElement.previousSibling;e&&(e.classList.add("hide"),e.style.minHeight=0),this.view.dom.parentElement.classList.remove("hide")},this.handlePlaceholderUpdate=e=>{const{state:t,dispatch:a,dom:n}=this.view,r=this.ctx.getAttribute("placeholder"),o=l.wM.serialize(t.doc.content,this.compliantTagNameMap);e?.clearOnChange||n.parentElement.classList.contains(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)||""===o&&o!==r?((0,i.y6)(t,r,this.compliantTagNameMap,a,!1,!0),this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):o===r&&this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)},this.getInitialContent=()=>{let e=this.ctx.value;!e&&this.ctx.hasAttribute("placeholder")&&(e=this.ctx.getAttribute("placeholder"));const t="com.psddev.conversation.Post"===this.ctx.closest(".CIG")?.dataset?.type,a=document.createElement("div");return a.innerHTML=(0,o.n)(e,this.schema,this.compliantTagNameMap,!1,t),m.S4.fromSchema(this.schema).parse(a,{preserveWhitespace:"full"})},this.buildView=(e,t,a,n,r)=>{const o=(0,i.Gu)(e,this.menuItems,s.eu,this.schema,this.userId,this.userLabel,t,a,n,r,this.isCollab,this.ctx,this.compliantTagNameMap);if(this.view=this.getView(o),ENABLE_PROSE_MIRROR_SPELL_CHECK&&(this.view.dom.spellcheck=!1),this.setMinHeight(),this.hideLoader(),this.view.submenu=document.createElement("div"),this.view.submenu.className="ProsemirrorEnhancementMenuContainer",this.view.dom.parentNode.append(this.view.submenu),this.initialPayload){const e=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);this.ctx.value=e;const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.ctx.dispatchEvent(t)}this.loaded=!0,this.ctx.getAttributeNames().filter(e=>e.startsWith("aria-")).forEach(e=>{this.view.dom.setAttribute(e,this.ctx.getAttribute(e))});const c=this.view.dom.closest(".CIG-row");if(c){const e=c.querySelector(".Message.is-error");if(e){const t=e.getAttribute("id");t&&(this.view.dom.setAttribute("aria-describedby",t),this.view.dom.setAttribute("aria-invalid","true"))}}!this.ctx.hasAttribute("placeholder")||this.ctx.getAttribute("placeholder")!==this.ctx.value&&this.ctx.value||this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT),this.$ctx.on("placeholderUpdate",(e,t)=>{this.handlePlaceholderUpdate(t)}),new ResizeObserver(()=>{this.view&&this.view.props&&this.view.props.props&&this.view.props.props.resizeCallbacks&&this.view.props.props.resizeCallbacks.forEach(e=>{e.callback&&e.callback()})}).observe(this.view.dom),PubSub.publish("rteLoaded",this)},this.createLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"lockOnly",clientId:this.userId,lockedId:e})},this.removeLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"unlockOnly",clientId:this.userId,lockedId:e})},this.createNewRecord=e=>{this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"create",rangeList:JSON.stringify([]),requestId:this.pendingRequest,doc:JSON.stringify(e.toJSON())})},this.createRecord=(e,t)=>{if(this.pendingRequest)return void(this.hasQueuedRequest=!0);if(!e||!t)return void(this.hasCursorState&&(this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!1));this.pendingRequest=(0,f.A)();const a=(0,p._X)(t),{anchor:n,ranges:s,empty:i}=t.selection;if(a){const e=JSON.stringify(t.doc.toJSON());u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,stepsList:JSON.stringify(a.steps),doc:e,version:a.version,clientId:this.userId,anchor:JSON.stringify({[this.userId]:n}),type:"steps",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0}else if(i)u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0;else{const e=[];s.forEach(t=>{const{$from:a,$to:n}=t,s=a.pos,i=n.pos;e.push({from:s,to:i,clientId:this.userId,requestId:this.pendingRequest})}),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"range",rangeList:JSON.stringify(e),requestId:this.pendingRequest}),this.hasCursorState=!0}},this.setUpWordCount=()=>{this.view.wordCount=document.createElement("div");const e=this.view.wordCount;e.className="CIG-wordCount",e.setAttribute("role","status"),e.setAttribute("aria-live","off"),this.toolbarWrapper.appendChild(e);const t=this.toolbarWrapper.querySelectorAll("[data-rte-style='rte2-toolbar-find'], [data-rte-style='rte2-toolbar-fullscreen'], [data-rte-style='rte2-toolbar-ai-inline']").length;this.toolbarWrapper.dataset.sidebarIconCount=t,3===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithThreeIcons)":2===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithTwoIcons)":1===t&&(e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithOneIcon)")},this.handleWordCount=()=>{this.view.wordCount&&(this.wordCountScheduled||(this.wordCountScheduled=!0,requestAnimationFrame(()=>{this.wordCountScheduled=!1,this.calculateWordCount()})))},this.calculateWordCount=()=>{if(!this.view.wordCount)return;const e=/[0-9_'-\u0027\u2019\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+/g;let t=0,a=0;const n=new Set(["del","comment","html"]);this.parentElement.classList.contains("isPlaceholderContent")&&!this.ctx.hasAttribute("data-editable-placeholder")||this.view.state.doc.descendants((s,i)=>{if(s.isText&&!s.marks.some(e=>n.has(e.type.name))){t+=s.text.length;const n=s.text.match(e);n&&(a+=n.length)}}),this.updateWordCountDisplay(a,t)},this.updateWordCountDisplay=(e,t)=>{const a=+this.ctx.dataset.suggestedMinimum,n=+this.ctx.dataset.suggestedMaximum,s=t<a?this.ctx.dataset.suggestedMinimumMessage:t>n?this.ctx.dataset.suggestedMaximumMessage:"",i=s||`${e}w ${t}c`;i!==this.lastDisplayText&&(this.lastDisplayText=i,this.view.wordCount.innerText=i,this.view.wordCount.setAttribute("aria-label",(0,g.QX)(e,t,s)),requestAnimationFrame(()=>{const e=this.view.wordCount.clientWidth;e!==this.lastMeasuredWidth&&(this.lastMeasuredWidth=e,this.toolbarWrapper.style.setProperty("--ProseMirror-wordCount",`${e}px`))}),(0,v.tK)((0,g.y)(e,t,a,n,this.ctx.dataset.suggestedMinimumMessage,this.ctx.dataset.suggestedMaximumMessage)))},e.setAttribute("style",s.AA.STYLES.DISPLAY_NONE),this.ctx=e,this.$ctx=b(e),this.schema=(0,s.e$)(t,c,y),this.pendingRequest=null,this.userId=r,this.userLabel=n,this.compliantTagNameMap=y,this.menuItems=(0,s.OF)(t,this.schema,a,n,r,c);const w=document.createElement("div");if(w.className="ProseMirrorContainer hide",this.ctx.parentNode.appendChild(w),h){const e=document.createElement("div");e.className=s.AA.CLASSES.PM_AVATAR_WRAPPER,w.appendChild(e)}this.toolbarWrapper=document.createElement("div"),this.toolbarWrapper.className="ProseMirrorToolbar",w.appendChild(this.toolbarWrapper),this.numLines=C,this.fieldName=d,this.isCollab=h,this.loaded=!1,this.hasCursorState=!1,this.parentElement=w,this.wordCountScheduled=!1,this.lastDisplayText="",this.lastMeasuredWidth=0,w.addEventListener("click",e=>{"A"!==e.target.tagName&&"LI"!==e.target.tagName||e.target.setAttribute("data-leave-popup-open","true")}),w.addEventListener("dragstart",e=>{e.preventDefault()}),w.addEventListener("com.psddev.cms.rte.clear",()=>{const{state:e,dispatch:t}=this.view;(0,i.y6)(e,"",this.compliantTagNameMap,t,!1,!0)}),this.isCollab&&(u.default.execute("com.psddev.cms.rte.RichTextCollabUserAction",{fieldName:this.fieldName}),window.addEventListener("click",e=>{if(!this.view||!this.view.dom)return;let t=e.target,a=!1;for(;t;){if(this.view.dom.parentNode===t){a=!0;break}t=t.parentElement}a||this.createRecord()}),window.addEventListener("unload",e=>{this.createRecord()}),PubSub.subscribe("collabLock",e=>{const{id:t}=e;this.createLockRecord(t)}),PubSub.subscribe("collabUnlock",e=>{const{id:t}=e;this.removeLockRecord(t)}))}init(){if(this.isCollab)u.default.initialize("com.psddev.cms.rte.RichTextCollabItemState",{fieldName:this.fieldName},()=>{if(this.loaded)return;let e,t=0,a={},n=[],s=this.lockedList={};this.initialPayload?(t=parseInt(this.initialPayload.version),e=this.schema.nodeFromJSON(JSON.parse(this.initialPayload.doc)),a=this.initialPayload.anchorMap,n=this.initialPayload.rangeList,s=this.initialPayload.lockedList||{},0===t&&this.ctx.value&&""===l.wM.serialize(e.content,this.compliantTagNameMap)&&(e=this.getInitialContent(),a={},n=[],s=this.lockedList={})):(e=this.getInitialContent(),this.createNewRecord(e)),this.buildView(e,t,a,n,s),this.setUpWordCount(),this.handleWordCount()}),u.default.receive("com.psddev.cms.rte.RichTextCollabItemBroadcast",e=>{if(e.fieldName!==this.fieldName)return;if(!this.loaded)return void(this.initialPayload=e);(e.resolvedRequestIds[this.pendingRequest]||0===e.version)&&(this.pendingRequest=null);const t=(0,p.HF)(this.view.state);e.wasRejected&&this.createRecord(this.view.state.tr,this.view.state);const a=e.stepsList,n=e.clientList,s=a.slice(t),i=n.slice(t);try{let t=(0,p.kq)(this.view.state,s.map(e=>h.pn.fromJSON(this.schema,e)),i,{mapSelectionBackward:!0});t.type="received",t.setMeta("collabManager$",{anchorMap:e.anchorMap,rangeList:e.rangeList,lockedList:e.lockedList||{}}),this.dispatchAction(t),this.hasQueuedRequest&&(this.hasQueuedRequest=!1,this.createRecord(this.view.state.tr,this.view.state))}catch(e){console.log(e)}});else{const e=this.getInitialContent();let t=0,a={},n=[];this.buildView(e,t,a,n),this.setUpWordCount(),this.handleWordCount()}}dispatchAction(e){const t=this.view.state.apply(e);if(this.view.updateState(t),"received"!==e.type&&this.isCollab&&this.createRecord(e,t),e.docChanged){const t=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);if(this.ctx.getAttribute("placeholder")&&t===this.ctx.getAttribute("placeholder")?(this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):(this.ctx.value=t,this.parentElement.classList.remove(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)),this.handleWordCount(),!e.getMeta("disableNativeEvent")){const e=document.createEvent("HTMLEvents");e.initEvent("input",!0,!1),this.ctx.dispatchEvent(e)}}}getView(e){const t={};RICH_TEXT_ELEMENTS_PM.filter(e=>e.popup&&"table"!==e.tag&&"tr"!==e.tag&&"td"!==e.tag&&"ul"!==e.tag&&"ol"!==e.tag).forEach(e=>{t[e.tag]=(e,t,a)=>new c.G(e,t,a,this.lockedList,this.isCollab)});const a=m.ZF.fromSchema(e.config.schema),n=new m.ZF(Object.assign({},a.nodes,{line:function(e){return["p",e.attrs,0]}}),a.marks),s=!this.ctx.closest(".is-readOnly");return new r.Lz(this.parentElement,{state:e,editable:()=>s,attributes:{tabIndex:"0"},dispatchTransaction:this.dispatchAction.bind(this),nodeViews:{inlineEnhancement:(e,t,a)=>new c.G(e,t,a),blockEnhancement:(e,t,a)=>new c.G(e,t,a),table:(e,t,a)=>new d.Q(e,t,a),...t},clipboardSerializer:n,clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,"\n"),props:{ctx:this.ctx,isFullScreen:!1,resizeCallbacks:[]}})}}n()}catch(e){n(e)}},1)},60252(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{RTE:()=>C}),a(57573),a(62953),a(49371),a(42723),a(96648),a(56065),a(56673);var s=a(14982),i=a(13364);if(3324==a.j)var r=a(88282);var o=a(34120),l=a(19459),c=a(42244),d=a(64472),u=a(23054);if(3324==a.j)var p=a(11646);if(3324==a.j)var h=a(53129);if(3324==a.j)var m=a(48940);if(a(87021),3324==a.j)var f=a(49309);a(61685);var g=a(88420),v=a(90127),b=a(88630),y=e([s,i,l,c,d]);[s,i,l,c,d]=y.then?(await y)():y,window.BRIGHTSPOT?.ui.cms.enableV5UI?await a.e(7718).then(a.bind(a,27718)):(await Promise.resolve().then(a.bind(a,61685)),await a.e(7923).then(a.bind(a,77923)),await a.e(4168).then(a.bind(a,64168)));class C{constructor(e,t,a,n,r,c,d,h,y,C){this.setValue=e=>{const{state:t,dispatch:a}=this.view;(0,i.y6)(t,e,this.compliantTagNameMap,a,!0,!0,!1)},this.setMinHeight=()=>{this.view.dom.style.setProperty("--ProseMirror-numLines",this.numLines)},this.hideLoader=()=>{const e=this.view.dom.parentElement.previousSibling;e&&(e.classList.add("hide"),e.style.minHeight=0),this.view.dom.parentElement.classList.remove("hide")},this.handlePlaceholderUpdate=e=>{const{state:t,dispatch:a,dom:n}=this.view,r=this.ctx.getAttribute("placeholder"),o=l.wM.serialize(t.doc.content,this.compliantTagNameMap);e?.clearOnChange||n.parentElement.classList.contains(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)||""===o&&o!==r?((0,i.y6)(t,r,this.compliantTagNameMap,a,!1,!0),this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):o===r&&this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)},this.getInitialContent=()=>{let e=this.ctx.value;!e&&this.ctx.hasAttribute("placeholder")&&(e=this.ctx.getAttribute("placeholder"));const t="com.psddev.conversation.Post"===this.ctx.closest(".CIG")?.dataset?.type,a=document.createElement("div");return a.innerHTML=(0,o.n)(e,this.schema,this.compliantTagNameMap,!1,t),m.S4.fromSchema(this.schema).parse(a,{preserveWhitespace:"full"})},this.buildView=(e,t,a,n,r)=>{const o=(0,i.Gu)(e,this.menuItems,s.eu,this.schema,this.userId,this.userLabel,t,a,n,r,this.isCollab,this.ctx,this.compliantTagNameMap);if(this.view=this.getView(o),ENABLE_PROSE_MIRROR_SPELL_CHECK&&(this.view.dom.spellcheck=!1),this.setMinHeight(),this.hideLoader(),this.view.submenu=document.createElement("div"),this.view.submenu.className="ProsemirrorEnhancementMenuContainer",this.view.dom.parentNode.append(this.view.submenu),this.initialPayload){const e=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);this.ctx.value=e;const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.ctx.dispatchEvent(t)}this.loaded=!0,this.ctx.getAttributeNames().filter(e=>e.startsWith("aria-")).forEach(e=>{this.view.dom.setAttribute(e,this.ctx.getAttribute(e))});const c=this.view.dom.closest(".CIG-row");if(c){const e=c.querySelector(".Message.is-error");if(e){const t=e.getAttribute("id");t&&(this.view.dom.setAttribute("aria-describedby",t),this.view.dom.setAttribute("aria-invalid","true"))}}!this.ctx.hasAttribute("placeholder")||this.ctx.getAttribute("placeholder")!==this.ctx.value&&this.ctx.value||this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT),this.$ctx.on("placeholderUpdate",(e,t)=>{this.handlePlaceholderUpdate(t)}),new ResizeObserver(()=>{this.view&&this.view.props&&this.view.props.props&&this.view.props.props.resizeCallbacks&&this.view.props.props.resizeCallbacks.forEach(e=>{e.callback&&e.callback()})}).observe(this.view.dom),PubSub.publish("rteLoaded",this)},this.createLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"lockOnly",clientId:this.userId,lockedId:e})},this.removeLockRecord=e=>{u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,type:"unlockOnly",clientId:this.userId,lockedId:e})},this.createNewRecord=e=>{this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"create",rangeList:JSON.stringify([]),requestId:this.pendingRequest,doc:JSON.stringify(e.toJSON())})},this.createRecord=(e,t)=>{if(this.pendingRequest)return void(this.hasQueuedRequest=!0);if(!e||!t)return void(this.hasCursorState&&(this.pendingRequest=(0,f.A)(),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:null}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!1));this.pendingRequest=(0,f.A)();const a=(0,p._X)(t),{anchor:n,ranges:s,empty:i}=t.selection;if(a){const e=JSON.stringify(t.doc.toJSON());u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,stepsList:JSON.stringify(a.steps),doc:e,version:a.version,clientId:this.userId,anchor:JSON.stringify({[this.userId]:n}),type:"steps",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0}else if(i)u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"anchorOnly",rangeList:JSON.stringify([]),requestId:this.pendingRequest}),this.hasCursorState=!0;else{const e=[];s.forEach(t=>{const{$from:a,$to:n}=t,s=a.pos,i=n.pos;e.push({from:s,to:i,clientId:this.userId,requestId:this.pendingRequest})}),u.default.execute("com.psddev.cms.rte.RichTextCollabItemAction",{fieldName:this.fieldName,anchor:JSON.stringify({[this.userId]:n}),type:"range",rangeList:JSON.stringify(e),requestId:this.pendingRequest}),this.hasCursorState=!0}},this.setUpWordCount=()=>{this.view.wordCount=document.createElement("div");const e=this.view.wordCount;e.className="CIG-wordCount",e.setAttribute("role","status"),e.setAttribute("aria-live","off"),this.toolbarWrapper.appendChild(e);const t=this.toolbarWrapper.querySelectorAll("[data-rte-style='rte2-toolbar-find'], [data-rte-style='rte2-toolbar-fullscreen'], [data-rte-style='rte2-toolbar-ai-inline']").length;this.toolbarWrapper.dataset.sidebarIconCount=t,3===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithThreeIcons)":2===t?e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithTwoIcons)":1===t&&(e.style["inset-inline-end"]="var(--ProseMirror-wordCountSpacingWithOneIcon)")},this.handleWordCount=()=>{this.view.wordCount&&(this.wordCountScheduled||(this.wordCountScheduled=!0,requestAnimationFrame(()=>{this.wordCountScheduled=!1,this.calculateWordCount()})))},this.calculateWordCount=()=>{if(!this.view.wordCount)return;const e=/[0-9_'-\u0027\u2019\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+/g;let t=0,a=0;const n=new Set(["del","comment","html"]);this.parentElement.classList.contains("isPlaceholderContent")&&!this.ctx.hasAttribute("data-editable-placeholder")||this.view.state.doc.descendants((s,i)=>{if(s.isText&&!s.marks.some(e=>n.has(e.type.name))){t+=s.text.length;const n=s.text.match(e);n&&(a+=n.length)}}),this.updateWordCountDisplay(a,t)},this.updateWordCountDisplay=(e,t)=>{const a=+this.ctx.dataset.suggestedMinimum,n=+this.ctx.dataset.suggestedMaximum,s=t<a?this.ctx.dataset.suggestedMinimumMessage:t>n?this.ctx.dataset.suggestedMaximumMessage:"",i=s||`${e}w ${t}c`;i!==this.lastDisplayText&&(this.lastDisplayText=i,this.view.wordCount.innerText=i,this.view.wordCount.setAttribute("aria-label",(0,g.QX)(e,t,s)),requestAnimationFrame(()=>{const e=this.view.wordCount.clientWidth;e!==this.lastMeasuredWidth&&(this.lastMeasuredWidth=e,this.toolbarWrapper.style.setProperty("--ProseMirror-wordCount",`${e}px`))}),(0,v.tK)((0,g.y)(e,t,a,n,this.ctx.dataset.suggestedMinimumMessage,this.ctx.dataset.suggestedMaximumMessage)))},e.setAttribute("style",s.AA.STYLES.DISPLAY_NONE),this.ctx=e,this.$ctx=b(e),this.schema=(0,s.e$)(t,c,y),this.pendingRequest=null,this.userId=r,this.userLabel=n,this.compliantTagNameMap=y,this.menuItems=(0,s.OF)(t,this.schema,a,n,r,c);const w=document.createElement("div");if(w.className="ProseMirrorContainer hide",this.ctx.parentNode.appendChild(w),h){const e=document.createElement("div");e.className=s.AA.CLASSES.PM_AVATAR_WRAPPER,w.appendChild(e)}this.toolbarWrapper=document.createElement("div"),this.toolbarWrapper.className="ProseMirrorToolbar",w.appendChild(this.toolbarWrapper),this.numLines=C,this.fieldName=d,this.isCollab=h,this.loaded=!1,this.hasCursorState=!1,this.parentElement=w,this.wordCountScheduled=!1,this.lastDisplayText="",this.lastMeasuredWidth=0,w.addEventListener("click",e=>{"A"!==e.target.tagName&&"LI"!==e.target.tagName||e.target.setAttribute("data-leave-popup-open","true")}),w.addEventListener("dragstart",e=>{e.preventDefault()}),w.addEventListener("com.psddev.cms.rte.clear",()=>{const{state:e,dispatch:t}=this.view;(0,i.y6)(e,"",this.compliantTagNameMap,t,!1,!0)}),this.isCollab&&(u.default.execute("com.psddev.cms.rte.RichTextCollabUserAction",{fieldName:this.fieldName}),window.addEventListener("click",e=>{if(!this.view||!this.view.dom)return;let t=e.target,a=!1;for(;t;){if(this.view.dom.parentNode===t){a=!0;break}t=t.parentElement}a||this.createRecord()}),window.addEventListener("unload",e=>{this.createRecord()}),PubSub.subscribe("collabLock",e=>{const{id:t}=e;this.createLockRecord(t)}),PubSub.subscribe("collabUnlock",e=>{const{id:t}=e;this.removeLockRecord(t)}))}init(){if(this.isCollab)u.default.initialize("com.psddev.cms.rte.RichTextCollabItemState",{fieldName:this.fieldName},()=>{if(this.loaded)return;let e,t=0,a={},n=[],s=this.lockedList={};this.initialPayload?(t=parseInt(this.initialPayload.version),e=this.schema.nodeFromJSON(JSON.parse(this.initialPayload.doc)),a=this.initialPayload.anchorMap,n=this.initialPayload.rangeList,s=this.initialPayload.lockedList||{},0===t&&this.ctx.value&&""===l.wM.serialize(e.content,this.compliantTagNameMap)&&(e=this.getInitialContent(),a={},n=[],s=this.lockedList={})):(e=this.getInitialContent(),this.createNewRecord(e)),this.buildView(e,t,a,n,s),this.setUpWordCount(),this.handleWordCount()}),u.default.receive("com.psddev.cms.rte.RichTextCollabItemBroadcast",e=>{if(e.fieldName!==this.fieldName)return;if(!this.loaded)return void(this.initialPayload=e);(e.resolvedRequestIds[this.pendingRequest]||0===e.version)&&(this.pendingRequest=null);const t=(0,p.HF)(this.view.state);e.wasRejected&&this.createRecord(this.view.state.tr,this.view.state);const a=e.stepsList,n=e.clientList,s=a.slice(t),i=n.slice(t);try{let t=(0,p.kq)(this.view.state,s.map(e=>h.pn.fromJSON(this.schema,e)),i,{mapSelectionBackward:!0});t.type="received",t.setMeta("collabManager$",{anchorMap:e.anchorMap,rangeList:e.rangeList,lockedList:e.lockedList||{}}),this.dispatchAction(t),this.hasQueuedRequest&&(this.hasQueuedRequest=!1,this.createRecord(this.view.state.tr,this.view.state))}catch(e){console.log(e)}});else{const e=this.getInitialContent();let t=0,a={},n=[];this.buildView(e,t,a,n),this.setUpWordCount(),this.handleWordCount()}}dispatchAction(e){const t=this.view.state.apply(e);if(this.view.updateState(t),"received"!==e.type&&this.isCollab&&this.createRecord(e,t),e.docChanged){const t=l.wM.serialize(this.view.state.doc.content,this.compliantTagNameMap);if(this.ctx.getAttribute("placeholder")&&t===this.ctx.getAttribute("placeholder")?(this.ctx.value="",this.parentElement.classList.add(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)):(this.ctx.value=t,this.parentElement.classList.remove(s.AA.CLASSES.IS_PLACEHOLDER_CONTENT)),this.handleWordCount(),!e.getMeta("disableNativeEvent")){const e=document.createEvent("HTMLEvents");e.initEvent("input",!0,!1),this.ctx.dispatchEvent(e)}}}getView(e){const t={};RICH_TEXT_ELEMENTS_PM.filter(e=>e.popup&&"table"!==e.tag&&"tr"!==e.tag&&"td"!==e.tag&&"ul"!==e.tag&&"ol"!==e.tag).forEach(e=>{t[e.tag]=(e,t,a)=>new c.G(e,t,a,this.lockedList,this.isCollab)});const a=m.ZF.fromSchema(e.config.schema),n=new m.ZF(Object.assign({},a.nodes,{line:function(e){return["p",e.attrs,0]}}),a.marks),s=!this.ctx.closest(".is-readOnly");return new r.Lz(this.parentElement,{state:e,editable:()=>s,attributes:{tabIndex:"0"},dispatchTransaction:this.dispatchAction.bind(this),nodeViews:{inlineEnhancement:(e,t,a)=>new c.G(e,t,a),blockEnhancement:(e,t,a)=>new c.G(e,t,a),table:(e,t,a)=>new d.Q(e,t,a),...t},clipboardSerializer:n,clipboardTextSerializer:e=>e.content.textBetween(0,e.content.size,"\n"),props:{ctx:this.ctx,isFullScreen:!1,resizeCallbacks:[]}})}}n()}catch(e){n(e)}},1)},46929(e,t,a){"use strict";a.d(t,{n:()=>i}),a(44764),a(84978),a(19723),a(25809),a(75178),a(92280);var n=a(22628),s=a(5292);const i=(e,t,a,i,r)=>{const c=new Set,d=new Set,u=new Set;a.forEach((t,a)=>{const n=new RegExp(a,"g");e=e.replace(n,t)}),Object.keys(t.nodes).forEach(e=>{const a=t.nodes[e].isBlock;t.nodes[e].spec.hasOwnProperty("parseDOM")&&t.nodes[e].spec.parseDOM.forEach(n=>{u.add(n.tag),a&&"br"!==n.tag&&(c.add(n.tag),t.nodes[e].inlineContent&&d.add(n.tag))})}),Object.keys(t.marks).forEach(e=>{t.marks[e].spec.hasOwnProperty("parseDOM")&&t.marks[e].spec.parseDOM.forEach(e=>{u.add(e.tag)})});const p=document.createElement("div");p.innerHTML=r?n.A.sanitize(e,{CUSTOM_ELEMENT_HANDLING:{tagNameCheck:()=>!0,attributeNameCheck:/^user-id$/,allowCustomizedBuiltInElements:!0}}):e,function(e,t,a){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){const n=(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`));return t.has(e.nodeName.toLowerCase())||n||a?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;i.nextNode();)n.push(i.currentNode);n.forEach(e=>{const t=e.parentNode,a=(0,s.A)("code",e.outerHTML.slice(0,e.outerHTML.indexOf(">")+1)),n=(0,s.A)("code",`</${e.nodeName.toLowerCase()}>`);for(t.insertBefore(a,e);e.firstChild;)t.insertBefore(e.firstChild,e);t.insertBefore(n,e),t.removeChild(e)})}(p,u,i);const h=o([...p.childNodes],c);return l(h,c,d).innerHTML},r=e=>""===e.textContent.replace(/\u00a0/g," ").trim()&&[...e.querySelectorAll("*")].every(e=>e.matches("a, b, br, em, font, i, s, span, strike, strong, sub, sup, u")),o=(e,t)=>{let a=null;const n=[];let s=-1;return e.forEach((i,r)=>{const o=i.nodeName.toLowerCase();if("#comment"===o)return;if("#text"===o&&0===i.wholeText.trim().length){const n=e[r+1]?.nodeName.toLowerCase();if(t.has(a)||null===a&&t.has(n))return}const l=i.className?i.className.split(" "):[];let c=l.some(e=>t.has(`.${e}`));if(-1!==l.indexOf("rte2-style-ins-delete")||-1!==l.indexOf("rte2-style-ins-insert")||-1!==l.indexOf("rte2-style-ins-ai")||"ai"===o||"del"===o||"ins"===o){const e=i.children;if([...e].some(e=>{const a=e.nodeName.toLowerCase();return t.has(a)||"br"===a})&&(c=!0,i.childNodes.length>1))for(let t of e)"br"===t.nodeName.toLowerCase()&&t.remove()}t.has(o)||c?(s++,n[s]=[],n[s].push(i),n[s].isBlock=!0):"br"===o||null!==a&&"br"!==a&&!t.has(a)?"br"!==o&&"br"!==a?(n[s].isBlock&&(s++,n[s]=[]),n[s].push(i)):"br"===o&&null===a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0,n[s].isFirst=!0):"br"===o&&"br"!==a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0):"br"===o&&"br"===a&&n[s].push(i):(s++,n[s]=[],n[s].push(i)),a=o}),n},l=(e,t,a)=>{const n=document.createElement("div");let s=!1;return e.forEach((i,c)=>{if(i.isBreaks&&i.isFirst)i.forEach((e,t)=>{if(0===t&&e.length>1)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBreaks&&c===e.length-1){const e=document.createElement("bsp-line");n.appendChild(e)}else if(i.isBreaks)i.forEach((e,t)=>{if(0===t&&!s)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBlock)i.forEach(s=>{if((e=>"p"===e.nodeName.toLowerCase()&&null!==e.querySelector("br"))(s)){const t=(e=>{const t=[document.createElement("bsp-line")];let a=[t[0]];const n=e=>{[...e.childNodes].forEach(e=>{if("br"===e.nodeName.toLowerCase())a=a.reduce((e,a,n)=>{const s=a.cloneNode(!1);return 0===n?t.push(s):e[n-1].appendChild(s),e.push(s),e},[]);else if(e.nodeType===Node.ELEMENT_NODE){const t=e.cloneNode(!1);a[a.length-1].appendChild(t),a.push(t),n(e),a.pop()}else a[a.length-1].appendChild(e.cloneNode(!0))})};for(n(e);t.length>1&&r(t[t.length-1]);)t.pop();return t})(s);return t.every(r)?void n.appendChild(document.createElement("bsp-line")):(t.forEach(e=>n.appendChild(e)),void(c<e.length-1&&n.appendChild(document.createElement("bsp-line"))))}if(((e,t)=>!!t.has(e.nodeName.toLowerCase())||(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`)))(s,a))return void n.appendChild(s);const i=o([...s.childNodes],t);let d=l(i,t,a);s.innerHTML="",[...d.childNodes].forEach(e=>{s.appendChild(e)}),n.appendChild(s)}),s=!0;else{const e=document.createElement("bsp-line");i.forEach(t=>{e.appendChild(t)}),n.appendChild(e),s=!1}}),n}},34120(e,t,a){"use strict";a.d(t,{n:()=>i}),a(57573),a(49371),a(6914),a(96648),a(55763),a(56673);var n=a(87021),s=a(18101);const i=(e,t,a,i,r)=>{const c=new Set,d=new Set,u=new Set;a.forEach((t,a)=>{const n=new RegExp(a,"g");e=e.replace(n,t)}),Object.keys(t.nodes).forEach(e=>{const a=t.nodes[e].isBlock;t.nodes[e].spec.hasOwnProperty("parseDOM")&&t.nodes[e].spec.parseDOM.forEach(n=>{u.add(n.tag),a&&"br"!==n.tag&&(c.add(n.tag),t.nodes[e].inlineContent&&d.add(n.tag))})}),Object.keys(t.marks).forEach(e=>{t.marks[e].spec.hasOwnProperty("parseDOM")&&t.marks[e].spec.parseDOM.forEach(e=>{u.add(e.tag)})});const p=document.createElement("div");p.innerHTML=r?n.A.sanitize(e,{CUSTOM_ELEMENT_HANDLING:{tagNameCheck:()=>!0,attributeNameCheck:/^user-id$/,allowCustomizedBuiltInElements:!0}}):e,function(e,t,a){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){const n=(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`));return t.has(e.nodeName.toLowerCase())||n||a?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;i.nextNode();)n.push(i.currentNode);n.forEach(e=>{const t=e.parentNode,a=(0,s.A)("code",e.outerHTML.slice(0,e.outerHTML.indexOf(">")+1)),n=(0,s.A)("code",`</${e.nodeName.toLowerCase()}>`);for(t.insertBefore(a,e);e.firstChild;)t.insertBefore(e.firstChild,e);t.insertBefore(n,e),t.removeChild(e)})}(p,u,i);const h=o([...p.childNodes],c);return l(h,c,d).innerHTML},r=e=>""===e.textContent.replace(/\u00a0/g," ").trim()&&[...e.querySelectorAll("*")].every(e=>e.matches("a, b, br, em, font, i, s, span, strike, strong, sub, sup, u")),o=(e,t)=>{let a=null;const n=[];let s=-1;return e.forEach((i,r)=>{const o=i.nodeName.toLowerCase();if("#comment"===o)return;if("#text"===o&&0===i.wholeText.trim().length){const n=e[r+1]?.nodeName.toLowerCase();if(t.has(a)||null===a&&t.has(n))return}const l=i.className?i.className.split(" "):[];let c=l.some(e=>t.has(`.${e}`));if(-1!==l.indexOf("rte2-style-ins-delete")||-1!==l.indexOf("rte2-style-ins-insert")||-1!==l.indexOf("rte2-style-ins-ai")||"ai"===o||"del"===o||"ins"===o){const e=i.children;if([...e].some(e=>{const a=e.nodeName.toLowerCase();return t.has(a)||"br"===a})&&(c=!0,i.childNodes.length>1))for(let t of e)"br"===t.nodeName.toLowerCase()&&t.remove()}t.has(o)||c?(s++,n[s]=[],n[s].push(i),n[s].isBlock=!0):"br"===o||null!==a&&"br"!==a&&!t.has(a)?"br"!==o&&"br"!==a?(n[s].isBlock&&(s++,n[s]=[]),n[s].push(i)):"br"===o&&null===a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0,n[s].isFirst=!0):"br"===o&&"br"!==a?(s++,n[s]=[],n[s].push(i),n[s].isBreaks=!0):"br"===o&&"br"===a&&n[s].push(i):(s++,n[s]=[],n[s].push(i)),a=o}),n},l=(e,t,a)=>{const n=document.createElement("div");let s=!1;return e.forEach((i,c)=>{if(i.isBreaks&&i.isFirst)i.forEach((e,t)=>{if(0===t&&e.length>1)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBreaks&&c===e.length-1){const e=document.createElement("bsp-line");n.appendChild(e)}else if(i.isBreaks)i.forEach((e,t)=>{if(0===t&&!s)return;const a=document.createElement("bsp-line");n.appendChild(a)}),s=!1;else if(i.isBlock)i.forEach(s=>{if((e=>"p"===e.nodeName.toLowerCase()&&null!==e.querySelector("br"))(s)){const t=(e=>{const t=[document.createElement("bsp-line")];let a=[t[0]];const n=e=>{[...e.childNodes].forEach(e=>{if("br"===e.nodeName.toLowerCase())a=a.reduce((e,a,n)=>{const s=a.cloneNode(!1);return 0===n?t.push(s):e[n-1].appendChild(s),e.push(s),e},[]);else if(e.nodeType===Node.ELEMENT_NODE){const t=e.cloneNode(!1);a[a.length-1].appendChild(t),a.push(t),n(e),a.pop()}else a[a.length-1].appendChild(e.cloneNode(!0))})};for(n(e);t.length>1&&r(t[t.length-1]);)t.pop();return t})(s);return t.every(r)?void n.appendChild(document.createElement("bsp-line")):(t.forEach(e=>n.appendChild(e)),void(c<e.length-1&&n.appendChild(document.createElement("bsp-line"))))}if(((e,t)=>!!t.has(e.nodeName.toLowerCase())||(e.className?e.className.toString().split(" "):[]).some(e=>t.has(`.${e}`)))(s,a))return void n.appendChild(s);const i=o([...s.childNodes],t);let d=l(i,t,a);s.innerHTML="",[...d.childNodes].forEach(e=>{s.appendChild(e)}),n.appendChild(s)}),s=!0;else{const e=document.createElement("bsp-line");i.forEach(t=>{e.appendChild(t)}),n.appendChild(e),s=!1}}),n}},15281(e,t,a){"use strict";if(a.d(t,{d:()=>o}),a(67219),a(84978),a(39589),7717==a.j)var n=a(13333);var s=a(88903);if(7717==a.j)var i=a(72065);var r=a(22176);const o=e=>new i.k_({key:new i.hs("interchangeable"),props:{handleDOMEvents:{interchange:(t,a)=>{const o="/cms/drawer/item-interchange",l=a.detail;if(l.loadableTypes){const e=l.node,a=e.attrs.meta,n=e.attrs.attributes,i=t.state.tr,r=new URLSearchParams;r.set("typeId",a.typeId),r.set("targetTypeId",n["data-convert-target"]),r.set("itemState",n["data-state"]),r.set("isRte","true"),r.set("isConvert","true");const c=new Headers,d=s.A.get("bsp.csrf");return d&&c.append("Brightspot-CSRF",d),void fetch(`${o}`,{method:"POST",credentials:"include",body:r,headers:c}).then(s=>{s.text().then(s=>{const r={...JSON.parse(s)};n["data-state"]=r["data-state"],n["data-loadable-types"]=r["data-loadable-types"];const o=e.type.create({attributes:r,typeId:n["data-convert-target"],meta:a,id:e.attrs.id});i.replaceSelectionWith(o),t.dispatch(i)})})}const c=a.detail.to.dataset.sortableValidItemTypes.split(" "),d=a.detail.items.length>0?a.detail.items:[a.detail.item];!async function(e,t,a,o,l){for(const c in a){const d=a[c];let u;const p=d.dataset.sortableLoadTypes?.split(" ")||[],h=d.dataset.id,m=p.find(e=>l.includes(e)),f=new URLSearchParams;f.set("id",h||""),f.set("targetTypeId",m||""),f.set("isRte","true");const g=new Headers,v=s.A.get("bsp.csrf");v&&g.append("Brightspot-CSRF",v),await fetch(`${o}`,{method:"POST",credentials:"include",body:f,headers:g}).then(async s=>{const o=await s.text(),l={...JSON.parse(o)},c=l.label,d=window.RICH_TEXT_ELEMENTS;if(d instanceof Array&&(u=d.find(e=>e.tag===l.tagName)),u){let s,o;const d=e.state.selection,p=d.ranges[0].$to.pos;let f=p;const g=e.state.tr;if(!d.empty){const e=g.doc.resolve(p);g.setSelection(i.U3.near(e))}if("a"===u.tag){s=t.marks[u.tag],o=s.create({label:c,attributes:l,typeId:m,meta:u,id:h});const e=document.createElement("div");e.innerHTML=c||"",a.length>1&&e.append(document.createElement("br"));const r=n.S4.fromSchema(t).parseSlice(e,{preserveWhitespace:"full"});f=p+r.size,g.replaceSelection(r).addMark(p,f,o);const d=g.doc.resolve(f);g.setSelection(i.U3.near(d))}else{s=t.nodes[u.tag],o=s.create({label:"bsp-module"!==u.tag?c:null,attributes:l,typeId:m,meta:u,id:h});const e=g.doc.resolve(p),a=e.parent,n=a.isTextblock&&e.parentOffset===a.content.size;let r;if(a.isTextblock&&n){const a=e.depth>1?e.depth-1:e.depth,n=e.after(a);g.insert(n,o);const s=n+o.nodeSize;if(s>=g.doc.content.size){const e=t.nodes.line;e?(g.insert(s,e.create()),r=s+1):r=s}else r=s}else g.replaceSelectionWith(o),r=p+o.nodeSize;const d=g.doc.resolve(r);g.setSelection(i.U3.near(d,1))}g.setMeta("enhancementManager$",{remove:{id:h}}),e.dom.parentElement?.classList.contains(r.A.CLASSES.IS_PLACEHOLDER_CONTENT)&&e.dom.parentElement?.classList.remove(r.A.CLASSES.IS_PLACEHOLDER_CONTENT);try{e.dispatch(g)}catch(e){}}}).catch(()=>{})}}(t,e,d,o,c)}}}})},2472(e,t,a){"use strict";if(a.d(t,{d:()=>o}),a(86634),a(49371),a(26780),3324==a.j)var n=a(48940);var s=a(24510);if(3324==a.j)var i=a(59256);var r=a(34985);const o=e=>new i.k_({key:new i.hs("interchangeable"),props:{handleDOMEvents:{interchange:(t,a)=>{const o="/cms/drawer/item-interchange",l=a.detail;if(l.loadableTypes){const e=l.node,a=e.attrs.meta,n=e.attrs.attributes,i=t.state.tr,r=new URLSearchParams;r.set("typeId",a.typeId),r.set("targetTypeId",n["data-convert-target"]),r.set("itemState",n["data-state"]),r.set("isRte","true"),r.set("isConvert","true");const c=new Headers,d=s.A.get("bsp.csrf");return d&&c.append("Brightspot-CSRF",d),void fetch(`${o}`,{method:"POST",credentials:"include",body:r,headers:c}).then(s=>{s.text().then(s=>{const r={...JSON.parse(s)};n["data-state"]=r["data-state"],n["data-loadable-types"]=r["data-loadable-types"];const o=e.type.create({attributes:r,typeId:n["data-convert-target"],meta:a,id:e.attrs.id});i.replaceSelectionWith(o),t.dispatch(i)})})}const c=a.detail.to.dataset.sortableValidItemTypes.split(" "),d=a.detail.items.length>0?a.detail.items:[a.detail.item];!async function(e,t,a,o,l){for(const c in a){const d=a[c];let u;const p=d.dataset.sortableLoadTypes?.split(" ")||[],h=d.dataset.id,m=p.find(e=>l.includes(e)),f=new URLSearchParams;f.set("id",h||""),f.set("targetTypeId",m||""),f.set("isRte","true");const g=new Headers,v=s.A.get("bsp.csrf");v&&g.append("Brightspot-CSRF",v),await fetch(`${o}`,{method:"POST",credentials:"include",body:f,headers:g}).then(async s=>{const o=await s.text(),l={...JSON.parse(o)},c=l.label,d=window.RICH_TEXT_ELEMENTS;if(d instanceof Array&&(u=d.find(e=>e.tag===l.tagName)),u){let s,o;const d=e.state.selection,p=d.ranges[0].$to.pos;let f=p;const g=e.state.tr;if(!d.empty){const e=g.doc.resolve(p);g.setSelection(i.U3.near(e))}if("a"===u.tag){s=t.marks[u.tag],o=s.create({label:c,attributes:l,typeId:m,meta:u,id:h});const e=document.createElement("div");e.innerHTML=c||"",a.length>1&&e.append(document.createElement("br"));const r=n.S4.fromSchema(t).parseSlice(e,{preserveWhitespace:"full"});f=p+r.size,g.replaceSelection(r).addMark(p,f,o);const d=g.doc.resolve(f);g.setSelection(i.U3.near(d))}else{s=t.nodes[u.tag],o=s.create({label:"bsp-module"!==u.tag?c:null,attributes:l,typeId:m,meta:u,id:h});const e=g.doc.resolve(p),a=e.parent,n=a.isTextblock&&e.parentOffset===a.content.size;let r;if(a.isTextblock&&n){const a=e.depth>1?e.depth-1:e.depth,n=e.after(a);g.insert(n,o);const s=n+o.nodeSize;if(s>=g.doc.content.size){const e=t.nodes.line;e?(g.insert(s,e.create()),r=s+1):r=s}else r=s}else g.replaceSelectionWith(o),r=p+o.nodeSize;const d=g.doc.resolve(r);g.setSelection(i.U3.near(d,1))}g.setMeta("enhancementManager$",{remove:{id:h}}),e.dom.parentElement?.classList.contains(r.A.CLASSES.IS_PLACEHOLDER_CONTENT)&&e.dom.parentElement?.classList.remove(r.A.CLASSES.IS_PLACEHOLDER_CONTENT);try{e.dispatch(g)}catch(e){}}}).catch(()=>{})}}(t,e,d,o,c)}}}})},6087(e,t,a){"use strict";if(a.d(t,{l:()=>p}),a(84978),a(91672),7717==a.j)var n=a(68243);var s=a(1439),i=a.n(s);if(7717==a.j)var r=a(13333);var o=a(72065);if(7717==a.j)var l=a(17283);if(7717==a.j)var c=a(15483);const d=document.createElement("canvas").getContext("2d"),u=new o.hs("bsp-mention"),p=e=>{const t=document.querySelector("template#rte-mention-input");let a;return t&&(a=document.createElement("form"),a.className="Mention",a.style.overflow="clip",a.appendChild(t.content.cloneNode(!0)),(0,n.A)(a,e),i()(a).trigger("create")),new o.k_({key:u,state:{init:()=>l.zF.empty,apply:(e,t)=>{const a=e.getMeta(u);return"remove"===a?l.zF.empty:a?l.zF.create(e.doc,[l.NZ.widget(a.pos,a.spacer)]):t.map(e.mapping,e.doc)}},props:{decorations:e=>u.getState(e),handleTextInput:(e,t,n,s)=>{if(!a)return!1;if("@"!==s)return!1;if(1!==t){let a=e.state.doc.textBetween(t-1,n);if(!/\s/.test(a)&&""!==a)return!1}return queueMicrotask(()=>((e,t,n)=>{const s=e.state.doc;if(t+1>s.content.size)return;if("@"!==s.textBetween(t,t+1))return;const i=a.querySelector(".ContentSelector-select");if(!i)return;const o=a.querySelector(".ComboInput-filter");i.value="",i.dispatchEvent(new CustomEvent("change",{bubbles:!0}));const l=a.offsetParent;if(!l)return;const p=e.coordsAtPos(t+1),h=document.createElement("span");h.style.display="inline-block",h.style.height=p.bottom-p.top+"px",h.style.verticalAlign="text-bottom",e.dispatch(e.state.tr.setMeta(u,{pos:t+1,spacer:h}));const m=()=>{let t=0;if(o){const e=window.getComputedStyle(o);d.font=`${e.fontWeight} ${e.fontSize} ${e.fontFamily}`,t=Math.max(d.measureText(o.value).width,d.measureText(o.placeholder||"").width)}const n=l.getBoundingClientRect(),s=n.left+l.clientLeft,i=n.top+l.clientTop,r=e.dom.getBoundingClientRect(),c=window.getComputedStyle(e.dom),u=r.right-parseFloat(c.paddingRight),p=u-r.left-parseFloat(c.paddingLeft);h.style.width=`${Math.min(Math.ceil(t)+4,p)}px`;const m=h.getBoundingClientRect(),f=m.top-i;if(a.style.left=m.left-s+"px",a.style.top=`${f}px`,a.style.maxWidth=`${Math.max(0,u-m.left)}px`,o){const e=o.getBoundingClientRect();e.height>0&&(a.style.top=f+(m.top+m.bottom)/2-(e.top+e.bottom)/2+"px",o.style.width=`${Math.max(24,m.right-e.left)}px`)}};m(),a.style.visibility="visible";const f=(0,c.Kr)(a)[0];if(!f)return e.dispatch(e.state.tr.setMeta(u,"remove")),void(a.style.visibility="hidden");f.focus(),f.click(),m();const g=()=>{i.removeEventListener("combo-input:hide",b),o?.removeEventListener("input",m)},v=()=>{i.removeEventListener("change",v),g();const a=i.value;if(!a)return;const s=document.createElement("bsp-mention");s.setAttribute("user-id",a),s.innerText="@"+Array.prototype.filter.call(i,e=>e.value===a)[0].label;const o=document.createElement("div");o.appendChild(s),o.appendChild(document.createTextNode(" "));const l=e.state;e.dispatch(l.tr.replaceRange(t,n+1,r.S4.fromSchema(l.config.schema).parseSlice(o,{preserveWhitespace:!0})).setMeta(u,"remove"))},b=()=>{g(),e.dispatch(e.state.tr.setMeta(u,"remove")),e.focus(),a.style.visibility="hidden"};i.addEventListener("change",v),i.addEventListener("combo-input:hide",b),o?.addEventListener("input",m)})(e,t,n)),!1}}})}},41694(e,t,a){"use strict";if(a.d(t,{l:()=>p}),a(49371),a(56065),3324==a.j)var n=a(39242);var s=a(88630),i=a.n(s);if(3324==a.j)var r=a(48940);var o=a(59256);if(3324==a.j)var l=a(88282);if(3324==a.j)var c=a(2674);const d=document.createElement("canvas").getContext("2d"),u=new o.hs("bsp-mention"),p=e=>{const t=document.querySelector("template#rte-mention-input");let a;return t&&(a=document.createElement("form"),a.className="Mention",a.style.overflow="clip",a.appendChild(t.content.cloneNode(!0)),(0,n.A)(a,e),i()(a).trigger("create")),new o.k_({key:u,state:{init:()=>l.zF.empty,apply:(e,t)=>{const a=e.getMeta(u);return"remove"===a?l.zF.empty:a?l.zF.create(e.doc,[l.NZ.widget(a.pos,a.spacer)]):t.map(e.mapping,e.doc)}},props:{decorations:e=>u.getState(e),handleTextInput:(e,t,n,s)=>{if(!a)return!1;if("@"!==s)return!1;if(1!==t){let a=e.state.doc.textBetween(t-1,n);if(!/\s/.test(a)&&""!==a)return!1}return queueMicrotask(()=>((e,t,n)=>{const s=e.state.doc;if(t+1>s.content.size)return;if("@"!==s.textBetween(t,t+1))return;const i=a.querySelector(".ContentSelector-select");if(!i)return;const o=a.querySelector(".ComboInput-filter");i.value="",i.dispatchEvent(new CustomEvent("change",{bubbles:!0}));const l=a.offsetParent;if(!l)return;const p=e.coordsAtPos(t+1),h=document.createElement("span");h.style.display="inline-block",h.style.height=p.bottom-p.top+"px",h.style.verticalAlign="text-bottom",e.dispatch(e.state.tr.setMeta(u,{pos:t+1,spacer:h}));const m=()=>{let t=0;if(o){const e=window.getComputedStyle(o);d.font=`${e.fontWeight} ${e.fontSize} ${e.fontFamily}`,t=Math.max(d.measureText(o.value).width,d.measureText(o.placeholder||"").width)}const n=l.getBoundingClientRect(),s=n.left+l.clientLeft,i=n.top+l.clientTop,r=e.dom.getBoundingClientRect(),c=window.getComputedStyle(e.dom),u=r.right-parseFloat(c.paddingRight),p=u-r.left-parseFloat(c.paddingLeft);h.style.width=`${Math.min(Math.ceil(t)+4,p)}px`;const m=h.getBoundingClientRect(),f=m.top-i;if(a.style.left=m.left-s+"px",a.style.top=`${f}px`,a.style.maxWidth=`${Math.max(0,u-m.left)}px`,o){const e=o.getBoundingClientRect();e.height>0&&(a.style.top=f+(m.top+m.bottom)/2-(e.top+e.bottom)/2+"px",o.style.width=`${Math.max(24,m.right-e.left)}px`)}};m(),a.style.visibility="visible";const f=(0,c.Kr)(a)[0];if(!f)return e.dispatch(e.state.tr.setMeta(u,"remove")),void(a.style.visibility="hidden");f.focus(),f.click(),m();const g=()=>{i.removeEventListener("combo-input:hide",b),o?.removeEventListener("input",m)},v=()=>{i.removeEventListener("change",v),g();const a=i.value;if(!a)return;const s=document.createElement("bsp-mention");s.setAttribute("user-id",a),s.innerText="@"+Array.prototype.filter.call(i,e=>e.value===a)[0].label;const o=document.createElement("div");o.appendChild(s),o.appendChild(document.createTextNode(" "));const l=e.state;e.dispatch(l.tr.replaceRange(t,n+1,r.S4.fromSchema(l.config.schema).parseSlice(o,{preserveWhitespace:!0})).setMeta(u,"remove"))},b=()=>{g(),e.dispatch(e.state.tr.setMeta(u,"remove")),e.focus(),a.style.visibility="hidden"};i.addEventListener("change",v),i.addEventListener("combo-input:hide",b),o?.addEventListener("input",m)})(e,t,n)),!1}}})}},50844(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{x:()=>$}),a(67219),a(44764),7717==a.j)var s=a(72065);if(7717==a.j)var i=a(46388);if(7717==a.j)var r=a(17755);var o=a(341),l=a(38607),c=a(2583),d=a(55864),u=a(51369),p=a(831);if(7717==a.j)var h=a(47401);var m=a(10968),f=a(21932),g=a(34375),v=a(19552);if(7717==a.j)var b=a(75869);if(7717==a.j)var y=a(93970);var C=a(70434);if(7717==a.j)var w=a(24455);var A=a(12536),E=a(35140),S=a(63511),I=a(47045);if(7717==a.j)var T=a(22377);var k=a(27808),M=a(6087),L=a(15281),x=a(46052),P=a(61827),D=e([o,l,c,d,u,f,C,A,E,S,I,k,P]);[o,l,c,d,u,f,C,A,E,S,I,k,P]=D.then?(await D)():D;const _=e=>(0,g.D8)(e),O=()=>{const e=[T.P8];return(0,T.sM)({rules:e})};function $(e){let t=[(0,I.e)(e.compliantTagNameMap),(0,E.o)(e.ctx,e.compliantTagNameMap),(0,h.b6)(),(0,d.s)(),(0,c.bS)(e.schema),(0,f.N_)(e.schema,e.userLabel,e.userId),(0,m.lt)(e.schema,e.userLabel,e.ctx),(0,b.A)(),(0,y.z)(),(0,g.LF)(),(0,v.J)(),(0,l.XC)(e.ctx,e.compliantTagNameMap),(0,C.F)(),(0,r.w)({Tab:_(1),"Shift-Tab":(0,g.D8)(-1)}),(0,r.w)(e.buildKeymap(e)),(0,r.w)(i.RV),(0,k.i)(e.ctx,e.compliantTagNameMap),(0,p.G)(),(0,S.hI)(),O(),(0,o.B)(e.menuItems),(0,L.d)(e.schema)];window.BRIGHTSPOT?.ai?.AI_CHAT_ENABLED&&t.unshift((0,x.M)(e.schema,e.userLabel,e.userId,e.compliantTagNameMap),(0,P.t)(e.userLabel,e.userId,e.compliantTagNameMap));try{const a=e.ctx.dataset.rteTags;a&&JSON.parse(a).includes("bsp-mention")&&t.push((0,M.l)(e.ctx))}catch{}return ENABLE_PROSE_MIRROR_SPELL_CHECK&&t.push((0,u.k)()),e.isCollab&&(t.push((0,w.Qr)({version:e.version,clientID:e.userId})),t.push((0,A.H)(e.schema,e.userId,e.anchorMap,e.rangeList,e.lockedList))),t.concat(new s.k_({key:new s.hs("pluginProvider"),props:{attributes:{class:"ProseMirror-setup-style",role:"textbox","aria-multiline":"true"}}}))}n()}catch(N){n(N)}})},63653(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{x:()=>$}),a(86634),a(57573),3324==a.j)var s=a(59256);if(3324==a.j)var i=a(59197);if(3324==a.j)var r=a(3743);var o=a(87532),l=a(74214),c=a(89774),d=a(68673),u=a(38560),p=a(88022);if(3324==a.j)var h=a(70112);var m=a(75361),f=a(86325),g=a(21566),v=a(83945);if(3324==a.j)var b=a(63060);if(3324==a.j)var y=a(58363);var C=a(83243);if(3324==a.j)var w=a(11646);var A=a(25345),E=a(99533),S=a(50702),I=a(34236);if(3324==a.j)var T=a(9568);var k=a(40617),M=a(41694),L=a(2472),x=a(10445),P=a(32826),D=e([o,l,c,d,u,f,C,A,E,S,I,k,P]);[o,l,c,d,u,f,C,A,E,S,I,k,P]=D.then?(await D)():D;const _=e=>(0,g.D8)(e),O=()=>{const e=[T.P8];return(0,T.sM)({rules:e})};function $(e){let t=[(0,I.e)(e.compliantTagNameMap),(0,E.o)(e.ctx,e.compliantTagNameMap),(0,h.b6)(),(0,d.s)(),(0,c.bS)(e.schema),(0,f.N_)(e.schema,e.userLabel,e.userId),(0,m.lt)(e.schema,e.userLabel,e.ctx),(0,b.A)(),(0,y.z)(),(0,g.LF)(),(0,v.J)(),(0,l.XC)(e.ctx,e.compliantTagNameMap),(0,C.F)(),(0,r.w)({Tab:_(1),"Shift-Tab":(0,g.D8)(-1)}),(0,r.w)(e.buildKeymap(e)),(0,r.w)(i.RV),(0,k.i)(e.ctx,e.compliantTagNameMap),(0,p.G)(),(0,S.hI)(),O(),(0,o.B)(e.menuItems),(0,L.d)(e.schema)];window.BRIGHTSPOT?.ai?.AI_CHAT_ENABLED&&t.unshift((0,x.M)(e.schema,e.userLabel,e.userId,e.compliantTagNameMap),(0,P.t)(e.userLabel,e.userId,e.compliantTagNameMap));try{const a=e.ctx.dataset.rteTags;a&&JSON.parse(a).includes("bsp-mention")&&t.push((0,M.l)(e.ctx))}catch{}return ENABLE_PROSE_MIRROR_SPELL_CHECK&&t.push((0,u.k)()),e.isCollab&&(t.push((0,w.Qr)({version:e.version,clientID:e.userId})),t.push((0,A.H)(e.schema,e.userId,e.anchorMap,e.rangeList,e.lockedList))),t.concat(new s.k_({key:new s.hs("pluginProvider"),props:{attributes:{class:"ProseMirror-setup-style",role:"textbox","aria-multiline":"true"}}}))}n()}catch(N){n(N)}})},61827(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,t:()=>d});var s=a(72065),i=a(96410);if(7717==a.j)var r=a(17283);var o=e([i]),l=o.then?(await o)():o;i=l[0];const c=new s.hs("aiInline"),d=(e,t,a)=>new s.k_({key:c,view(n){const s=new i.F(n,c.get(n.state).key,e,t,a),r=n.dom.parentNode?.querySelector(".ProseMirrorToolbar");if(r){const e=s.dom;e&&r.appendChild(e)}return s},state:{init(e){const t=new Map,a=new Map,n=new Map,s=new Map;return a.set("toggleAIInline",!1),t.set("activeStates",a),t.set("disabledStates",n),t.set("metaData",s),t},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i?.toggleAIInline){const e=s.get("activeStates"),t=e.get("toggleAIInline");e.set("toggleAIInline",!t)}return s}},props:{decorations(e){const t=this.getState(e);if(!t)return r.zF.empty;if(!t.get("activeStates").get("toggleAIInline"))return r.zF.empty;const{from:a,to:n}=e.selection;if(a===n)return r.zF.empty;const s=r.NZ.inline(a,n,{class:"rte2-style-ai-inline-highlight"});return r.zF.create(e.doc,[s])}}}),u=()=>function(e,t,a){return t(e.tr.setMeta(c,{toggleAIInline:!0})),a?.dom.classList.toggle("ProseMirror-aiInlinePreviewMode"),!0};n()}catch(e){n(e)}})},32826(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,t:()=>d});var s=a(59256),i=a(76995);if(3324==a.j)var r=a(88282);var o=e([i]),l=o.then?(await o)():o;i=l[0];const c=new s.hs("aiInline"),d=(e,t,a)=>new s.k_({key:c,view(n){const s=new i.F(n,c.get(n.state).key,e,t,a),r=n.dom.parentNode?.querySelector(".ProseMirrorToolbar");if(r){const e=s.dom;e&&r.appendChild(e)}return s},state:{init(e){const t=new Map,a=new Map,n=new Map,s=new Map;return a.set("toggleAIInline",!1),t.set("activeStates",a),t.set("disabledStates",n),t.set("metaData",s),t},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i?.toggleAIInline){const e=s.get("activeStates"),t=e.get("toggleAIInline");e.set("toggleAIInline",!t)}return s}},props:{decorations(e){const t=this.getState(e);if(!t)return r.zF.empty;if(!t.get("activeStates").get("toggleAIInline"))return r.zF.empty;const{from:a,to:n}=e.selection;if(a===n)return r.zF.empty;const s=r.NZ.inline(a,n,{class:"rte2-style-ai-inline-highlight"});return r.zF.create(e.doc,[s])}}}),u=()=>function(e,t,a){return t(e.tr.setMeta(c,{toggleAIInline:!0})),a?.dom.classList.toggle("ProseMirror-aiInlinePreviewMode"),!0};n()}catch(e){n(e)}})},96410(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{F:()=>M}),a(44764),a(84978),a(13722),a(25809),a(91672),a(92280);var s=a(26173),i=a(99666);if(7717==a.j)var r=a(13333);var o=a(46929),l=a(38745),c=a(99022),d=a(63110),u=a.n(d),p=a(88903),h=a(22628),m=e([s]),f=m.then?(await m)():m;s=f[0],window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(2456).then(a.bind(a,42456));const g=window.BRIGHTSPOT?.ui.cms.enableV5UI,v="ProseMirrorAIInline-container",b=window.RTE_PROMPT_PLACEHOLDER,y=window.RTE_PROMPT_PREFIX,C=window.RTE_PROMPT_RETRY,w=window.RTE_WORKING_ON_IT,A=window.RTE_ACCEPT,E=window.RTE_DISCARD,S=window.RTE_TRY_AGAIN,I="collapsed",T=window.BRIGHTSPOT?.web?.pagePaths?.["com.psddev.ai.chat.ChatPageResponses"],k=window.BRIGHTSPOT?.web?.pagePaths?.["com.psddev.ai.chat.PromptPage"];class M{constructor(e,t,a,n,s){this.focused=!1,this.isLoading=!1,this.retry=!1,this.suggestionsFetched=!1,this.editorView=void 0,this.myKey=void 0,this.userLabel=void 0,this.userId=void 0,this.compliantTagNameMap=void 0,this.dom=void 0,this.field=void 0,this.textArea=void 0,this.loadingOverlay=void 0,this.loadingPromptEle=void 0,this.objectId=void 0,this.typeId=void 0,this.contentState=void 0,this.inputEle=void 0,this.submitButtonEle=void 0,this.acceptRejectContainerEle=void 0,this.tether=void 0,this.toolbarEl=void 0,this.resizeObserver=void 0,this.suggestionsContainer=null,this.sendTrackingEvent=void 0,this.chatId=void 0,this.responseId=void 0,this.lastPrompt=void 0,this.lastSelectedContent=void 0,this.lastSelectionFrom=void 0,this.lastSelectionTo=void 0,this.template=()=>i.qy`
|
|
33
33
|
<div class="${v}-inputContainer">
|
|
34
34
|
<input
|
|
35
35
|
class="${v}-inputContainer-input"
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
></button>
|
|
280
280
|
</div>
|
|
281
281
|
${this.replaceTemplate(e)}
|
|
282
|
-
`,(0,r.XX)(this.template({current:0,total:0,findInputVal:"",replaceInputVal:""}),this.dom),this.matchCase=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-options-matchCase"),this.matchWholeWord=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-options-matchWholeWord"),this.findInputEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-input"),this.replaceInputEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-replace-input"),this.moreButtonEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-more"),this.replaceContainerEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-replaceContainer"),this.findInputEle.addEventListener("keyup",e=>{this.handleFind(e.target.value),this.scroll()}),this.findInputEle.addEventListener("focus",e=>{e.preventDefault(),this.handleFind(e.target.value)}),this.replaceInputEle.addEventListener("input",e=>{e.preventDefault(),(0,r.XX)(this.template({current:this.current,total:this.total,findInputVal:this.findInputEle.value,replaceInputVal:this.replaceInputEle.value}),this.dom)}),this.matchCase.addEventListener("change",e=>{e.preventDefault(),this.handleFind(this.findInputEle.value)}),this.matchWholeWord.addEventListener("change",e=>{e.preventDefault(),this.handleFind(this.findInputEle.value)}),new ResizeObserver(()=>{this.render()}).observe(this.editorView.dom),PubSub.subscribe("findAdded",e=>{this.updateCurrentValue("added",e),this.updateTotalValue(e)}),PubSub.subscribe("findRemoved",e=>{this.updateCurrentValue("removed",e),this.updateTotalValue(e)}),PubSub.subscribe("findReset",e=>{this.updateCurrentValue("reset",e),this.updateTotalValue(e)}),this.render()}render(){(0,s.dO)(this.editorView,this.myKey).get("activeStates").get("find")?(this.dom.classList.remove(g),this.focused||(this.findInputEle.focus(),this.focused=!0)):(this.dom.classList.add(g),this.focused=!1)}update(){this.render()}}n()}catch(e){n(e)}},1)},57144(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{J:()=>c,s:()=>u});var s=a(72065),i=a(76459);if(7717==a.j)var r=a(17755);var o=a(64989),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("fullScreenManager"),d={};d[(0,o.rd)("fullscreen")]=(0,o.Kt)("rte2-toolbar-fullscreen");const u=e=>new s.k_({key:c,view(e){return this.view=new i.f(e,this.key.key),this.view},state:{init(e,t){const a=new Map,n=new Map;return n.set("fullscreen",!1),a.set("activeStates",n),a.set("hasToggle",!1),a},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i&&i.hasOwnProperty("toggleFullScreen")){const e=!s.get("activeStates").get("fullscreen");s.get("activeStates").set("fullscreen",e),s.set("hasToggle",!0),this.spec.view.update()}else s.set("hasToggle",!1);return s}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},21537(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{J:()=>c,s:()=>u});var s=a(59256),i=a(63650);if(3324==a.j)var r=a(3743);var o=a(52180),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("fullScreenManager"),d={};d[(0,o.rd)("fullscreen")]=(0,o.Kt)("rte2-toolbar-fullscreen");const u=e=>new s.k_({key:c,view(e){return this.view=new i.f(e,this.key.key),this.view},state:{init(e,t){const a=new Map,n=new Map;return n.set("fullscreen",!1),a.set("activeStates",n),a.set("hasToggle",!1),a},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i&&i.hasOwnProperty("toggleFullScreen")){const e=!s.get("activeStates").get("fullscreen");s.get("activeStates").set("fullscreen",e),s.set("hasToggle",!0),this.spec.view.update()}else s.set("hasToggle",!1);return s}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},49208(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>o});var s=a(57144),i=e([s]),r=i.then?(await i)():i;s=r[0];const o=()=>function(e,t,a){return t(e.tr.setMeta(s.J,{toggleFullScreen:!0})),!0};n()}catch(e){n(e)}})},13601(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>o});var s=a(21537),i=e([s]),r=i.then?(await i)():i;s=r[0];const o=()=>function(e,t,a){return t(e.tr.setMeta(s.J,{toggleFullScreen:!0})),!0};n()}catch(e){n(e)}})},55864(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>i._,s:()=>s.s});var s=a(57144),i=a(49208),r=e([s,i]);[s,i]=r.then?(await r)():r,n()}catch(e){n(e)}})},68673(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>i._,s:()=>s.s});var s=a(21537),i=a(13601),r=e([s,i]);[s,i]=r.then?(await r)():r,n()}catch(e){n(e)}})},76459(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{f:()=>p}),a(44764),a(50144),a(84978),a(13722),a(39589),a(25809),a(91672);var s=a(99666),i=a(63110),r=a.n(i);if(7717==a.j)var o=a(72065);var l=a(27791),c=a(10968),d=a(26173),u=e([l,d]);[l,d]=u.then?(await u)():u,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(7202).then(a.bind(a,67202));class p{constructor(e,t){this.editorView=e,this.myKey=t,this.editorDOM=this.editorView.dom,this.editorDOMParent=this.editorDOM.parentNode,this.editorDOMGrandParent=this.editorDOMParent.parentNode,this.fullScreenContainer=document.createElement("div"),this.fullScreenContainer.className="ProseMirror-fullscreen-container",this.header=document.createElement("div"),this.header.className="ProseMirror-fullscreen-container-header",this.fullScreenContainer.appendChild(this.header),this.footer=document.createElement("div"),this.footer.className="ProseMirror-fullscreen-container-footer",this.fullScreenContainer.appendChild(this.footer);const a=this.editorDOM.closest("dialog");if(a?a.appendChild(this.fullScreenContainer):document.body.appendChild(this.fullScreenContainer),this.fullScreenContainer.classList.add("hide"),this.headerAside=document.createElement("div"),this.headerAside.className="ProseMirror-fullscreen-container-header-aside",this.header.appendChild(this.headerAside),this.form=this.editorDOM.closest(".ContentEdit"),this.comments=document.createElement("div"),this.comments.className="ProseMirror-comments",this.editorDOMParent.appendChild(this.comments),this.form&&this.form.hasAttribute("data-rte-title-field")&&(this.titleField=this.form.querySelector(`[name="${this.form.getAttribute("data-rte-title-field")}"]`),this.titleField)){this.titleInput=document.createElement("input"),this.titleInput.type="text",this.titleInput.addEventListener("input",e=>{this.titleField.value=this.titleInput.value;const t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),this.titleField.dispatchEvent(t)});const e=document.createElement("div");e.className="InputWrapper",e.appendChild(this.titleInput),this.header.prepend(e)}}render(){const e=(0,d.dO)(this.editorView,this.myKey);if(e.get("activeStates")&&e.get("activeStates").get("fullscreen")){const e=this.editorDOM.closest(".Popup.is-visible");if(e){const t=e.style.zIndex;this.fullScreenContainer.style.zIndex=`${parseInt(t)+1}`}this.fullScreenContainer.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.remove("hide"),window.BRIGHTSPOT?.ui.cms.enableV5UI&&(this.fullScreenContainer.setAttribute("popover","manual"),this.fullScreenContainer.showPopover());const t=this.editorDOMParent.querySelector(".ProsemirrorWordCount");t&&this.footer.appendChild(t);const a=this.form?.querySelector(".widget-publishing .icon-action-publish .WorkInProgressSaveStatus");if(a&&this.headerAside.appendChild(a),this.titleInput){this.titleInput.placeholder="Untitled",this.titleInput.title="Click to Edit";const e=this.titleField.closest(".CIG-row"),t=["is-pending","is-updated","is-readOnly"];this.titleField.readOnly||e&&t.some(t=>e.classList.contains(t))?this.titleInput.readOnly=!0:this.titleInput.removeAttribute("readonly"),this.titleField.value?this.titleInput.value=this.titleField.value:this.titleInput.value=""}else{const e=document.querySelector(".ContentEdit-title .ContentLabel[data-previous-text]");this.header.innerText=e?e.innerText:"Untitled"}const n=this.editorDOMParent.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`),s=this.fullScreenContainer.querySelector(".ProseMirror-fullscreen-container-header-aside"),i=this.fullScreenContainer.querySelector(".WorkInProgressSaveStatus");n&&s&&i&&s.insertBefore(n,i)}else{this.editorDOMGrandParent.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.add("hide");const e=this.headerAside.querySelector(".WorkInProgressSaveStatus");e&&this.form?.querySelector(".widget-publishing .icon-action-publish")?.appendChild(e);const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.editorView.props.props.ctx.dispatchEvent(t);const a=this.footer.querySelector(".ProsemirrorWordCount");a&&this.editorDOMParent.appendChild(a);const n=this.fullScreenContainer.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`);n&&this.editorDOMParent.appendChild(n)}this.editorDOMParent.querySelector(".ProseMirror").focus()}update(){const e=this.editorView,t=(0,d.dO)(e,this.myKey);t.get("hasToggle")&&this.render();const a=t.get("activeStates")?.get("fullscreen");if(!a)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);const n=e.state.doc,i=[],l=new Map;if(n.descendants((e,t)=>{e.marks.forEach(a=>{const{name:n}=a.type,s=a.attrs;if("comment"===n||"del"===n||"ins"===n){const r=s["data-replies"],o=e.isText?l.get(`${n}:${t}`):null;if(o&&o.mark.eq(a))return l.delete(`${n}:${t}`),o.end=t+e.nodeSize,o.text+=e.textContent,o.marks=o.marks.filter(t=>t.isInSet(e.marks)),void l.set(`${n}:${o.end}`,o);const c={pos:t,end:t+e.nodeSize,isText:e.isText,mark:a,marks:e.marks,type:n,userId:s["data-user-id"],user:s["data-user-label"],time:s["data-time"],text:e.attrs.meta?`${e.attrs.meta?.displayName}: ${e.attrs.label}`:e.textContent,replies:r?JSON.parse(r):null};i.push(c),e.isText&&l.set(`${n}:${c.end}`,c)}})}),0===i.length)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);this.fullScreenContainer.classList.add("is-comments");const u=t=>{if(t&&t.closest(".ProseMirror-comment")){const a=t.closest(".ProseMirror-comment"),n=a.dataset.type,s=this.editorView.state.doc.nodeAt(a.pos),i=s.marks.find(e=>n===e.type.name),r=Object.assign({},i.attrs);a.classList.contains("is-active")?r.class=r.class.replace(" is-active",""):(r.class=`${r.class} is-active`,u(this.comments.querySelector(".is-active")));const l=i.type.create(r);let c,d=e.state.tr;s.isText?(d=d.removeMark(a.pos,a.end,i),d=d.addMark(a.pos,a.end,l),c=new o.U3(d.doc.resolve(a.pos),d.doc.resolve(a.end))):(d=d.setNodeMarkup(a.pos,s.type,s.attrs,s.marks.map(e=>e.type.name===l.type.name?l:e)),c=new o.nh(d.doc.resolve(a.pos))),d.setSelection(c),e.dispatch(d),a.classList.toggle("is-active"),e.nodeDOM(a.pos).parentElement.scrollIntoView({behavior:"smooth"})}},p=(t,a)=>{const{pos:s,end:i}=t.closest(".ProseMirror-comment"),r=s,o=i,l=n.nodeAt(s).marks.filter(e=>"comment"===e.type.name)[0];if(l){const t=Object.assign({},l.attrs);let n=t["data-replies"];n=n?JSON.parse(n):[],a(n),t["data-replies"]=JSON.stringify(n),e.dispatch(e.state.tr.addMark(r,o,l.type.create(t)))}};(0,s.XX)(s.qy`
|
|
282
|
+
`,(0,r.XX)(this.template({current:0,total:0,findInputVal:"",replaceInputVal:""}),this.dom),this.matchCase=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-options-matchCase"),this.matchWholeWord=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-options-matchWholeWord"),this.findInputEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-input"),this.replaceInputEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-replace-input"),this.moreButtonEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-more"),this.replaceContainerEle=this.dom.querySelector(".ProseMirrorFindReplace-findContainer-replaceContainer"),this.findInputEle.addEventListener("keyup",e=>{this.handleFind(e.target.value),this.scroll()}),this.findInputEle.addEventListener("focus",e=>{e.preventDefault(),this.handleFind(e.target.value)}),this.replaceInputEle.addEventListener("input",e=>{e.preventDefault(),(0,r.XX)(this.template({current:this.current,total:this.total,findInputVal:this.findInputEle.value,replaceInputVal:this.replaceInputEle.value}),this.dom)}),this.matchCase.addEventListener("change",e=>{e.preventDefault(),this.handleFind(this.findInputEle.value)}),this.matchWholeWord.addEventListener("change",e=>{e.preventDefault(),this.handleFind(this.findInputEle.value)}),new ResizeObserver(()=>{this.render()}).observe(this.editorView.dom),PubSub.subscribe("findAdded",e=>{this.updateCurrentValue("added",e),this.updateTotalValue(e)}),PubSub.subscribe("findRemoved",e=>{this.updateCurrentValue("removed",e),this.updateTotalValue(e)}),PubSub.subscribe("findReset",e=>{this.updateCurrentValue("reset",e),this.updateTotalValue(e)}),this.render()}render(){(0,s.dO)(this.editorView,this.myKey).get("activeStates").get("find")?(this.dom.classList.remove(g),this.focused||(this.findInputEle.focus(),this.focused=!0)):(this.dom.classList.add(g),this.focused=!1)}update(){this.render()}}n()}catch(e){n(e)}},1)},57144(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{J:()=>c,s:()=>u});var s=a(72065),i=a(76459);if(7717==a.j)var r=a(17755);var o=a(64989),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("fullScreenManager"),d={};d[(0,o.rd)("fullscreen")]=(0,o.Kt)("rte2-toolbar-fullscreen");const u=e=>new s.k_({key:c,view(e){return this.view=new i.f(e,this.key.key),this.view},state:{init(e,t){const a=new Map,n=new Map;return n.set("fullscreen",!1),a.set("activeStates",n),a.set("hasToggle",!1),a},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i&&i.hasOwnProperty("toggleFullScreen")){const e=!s.get("activeStates").get("fullscreen");s.get("activeStates").set("fullscreen",e),s.set("hasToggle",!0),this.spec.view.update()}else s.set("hasToggle",!1);return s}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},21537(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{J:()=>c,s:()=>u});var s=a(59256),i=a(63650);if(3324==a.j)var r=a(3743);var o=a(52180),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("fullScreenManager"),d={};d[(0,o.rd)("fullscreen")]=(0,o.Kt)("rte2-toolbar-fullscreen");const u=e=>new s.k_({key:c,view(e){return this.view=new i.f(e,this.key.key),this.view},state:{init(e,t){const a=new Map,n=new Map;return n.set("fullscreen",!1),a.set("activeStates",n),a.set("hasToggle",!1),a},apply(e,t,a,n){const s=t,i=e.getMeta(c);if(i&&i.hasOwnProperty("toggleFullScreen")){const e=!s.get("activeStates").get("fullscreen");s.get("activeStates").set("fullscreen",e),s.set("hasToggle",!0),this.spec.view.update()}else s.set("hasToggle",!1);return s}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},49208(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>o});var s=a(57144),i=e([s]),r=i.then?(await i)():i;s=r[0];const o=()=>function(e,t,a){return t(e.tr.setMeta(s.J,{toggleFullScreen:!0})),!0};n()}catch(e){n(e)}})},13601(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>o});var s=a(21537),i=e([s]),r=i.then?(await i)():i;s=r[0];const o=()=>function(e,t,a){return t(e.tr.setMeta(s.J,{toggleFullScreen:!0})),!0};n()}catch(e){n(e)}})},55864(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>i._,s:()=>s.s});var s=a(57144),i=a(49208),r=e([s,i]);[s,i]=r.then?(await r)():r,n()}catch(e){n(e)}})},68673(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{_:()=>i._,s:()=>s.s});var s=a(21537),i=a(13601),r=e([s,i]);[s,i]=r.then?(await r)():r,n()}catch(e){n(e)}})},76459(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{f:()=>p}),a(44764),a(50144),a(84978),a(13722),a(39589),a(25809),a(91672);var s=a(99666),i=a(63110),r=a.n(i);if(7717==a.j)var o=a(72065);var l=a(27791),c=a(10968),d=a(26173),u=e([l,d]);[l,d]=u.then?(await u)():u,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(7202).then(a.bind(a,67202));class p{constructor(e,t){this.editorView=e,this.myKey=t,this.editorDOM=this.editorView.dom,this.editorDOMParent=this.editorDOM.parentNode,this.editorDOMGrandParent=this.editorDOMParent.parentNode,this.fullScreenContainer=document.createElement("div"),this.fullScreenContainer.className="ProseMirror-fullscreen-container",this.header=document.createElement("div"),this.header.className="ProseMirror-fullscreen-container-header",this.fullScreenContainer.appendChild(this.header),this.footer=document.createElement("div"),this.footer.className="ProseMirror-fullscreen-container-footer",this.fullScreenContainer.appendChild(this.footer);const a=this.editorDOM.closest("dialog");if(a?a.appendChild(this.fullScreenContainer):document.body.appendChild(this.fullScreenContainer),this.fullScreenContainer.classList.add("hide"),this.fullScreenContainer.inert=!0,this.headerAside=document.createElement("div"),this.headerAside.className="ProseMirror-fullscreen-container-header-aside",this.header.appendChild(this.headerAside),this.form=this.editorDOM.closest(".ContentEdit"),this.comments=document.createElement("div"),this.comments.className="ProseMirror-comments",this.editorDOMParent.appendChild(this.comments),this.form&&this.form.hasAttribute("data-rte-title-field")&&(this.titleField=this.form.querySelector(`[name="${this.form.getAttribute("data-rte-title-field")}"]`),this.titleField)){this.titleInput=document.createElement("input"),this.titleInput.type="text",this.titleInput.addEventListener("input",e=>{this.titleField.value=this.titleInput.value;const t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),this.titleField.dispatchEvent(t)});const e=document.createElement("div");e.className="InputWrapper",e.appendChild(this.titleInput),this.header.prepend(e)}}render(){const e=(0,d.dO)(this.editorView,this.myKey);if(e.get("activeStates")&&e.get("activeStates").get("fullscreen")){const e=this.editorDOM.closest(".Popup.is-visible");if(e){const t=e.style.zIndex;this.fullScreenContainer.style.zIndex=`${parseInt(t)+1}`}this.fullScreenContainer.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.remove("hide"),this.fullScreenContainer.inert=!1,window.BRIGHTSPOT?.ui.cms.enableV5UI&&(this.fullScreenContainer.setAttribute("popover","manual"),this.fullScreenContainer.showPopover());const t=this.editorDOMParent.querySelector(".ProsemirrorWordCount");t&&this.footer.appendChild(t);const a=this.form?.querySelector(".widget-publishing .icon-action-publish .WorkInProgressSaveStatus");if(a&&this.headerAside.appendChild(a),this.titleInput){this.titleInput.placeholder="Untitled",this.titleInput.title="Click to Edit";const e=this.titleField.closest(".CIG-row"),t=["is-pending","is-updated","is-readOnly"];this.titleField.readOnly||e&&t.some(t=>e.classList.contains(t))?this.titleInput.readOnly=!0:this.titleInput.removeAttribute("readonly"),this.titleField.value?this.titleInput.value=this.titleField.value:this.titleInput.value=""}else{const e=document.querySelector(".ContentEdit-title .ContentLabel[data-previous-text]");this.header.innerText=e?e.innerText:"Untitled"}const n=this.editorDOMParent.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`),s=this.fullScreenContainer.querySelector(".ProseMirror-fullscreen-container-header-aside"),i=this.fullScreenContainer.querySelector(".WorkInProgressSaveStatus");n&&s&&i&&s.insertBefore(n,i)}else{this.editorDOMGrandParent.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.add("hide"),this.fullScreenContainer.inert=!0;const e=this.headerAside.querySelector(".WorkInProgressSaveStatus");e&&this.form?.querySelector(".widget-publishing .icon-action-publish")?.appendChild(e);const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.editorView.props.props.ctx.dispatchEvent(t);const a=this.footer.querySelector(".ProsemirrorWordCount");a&&this.editorDOMParent.appendChild(a);const n=this.fullScreenContainer.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`);n&&this.editorDOMParent.appendChild(n)}this.editorDOMParent.querySelector(".ProseMirror").focus()}update(){const e=this.editorView,t=(0,d.dO)(e,this.myKey);t.get("hasToggle")&&this.render();const a=t.get("activeStates")?.get("fullscreen");if(!a)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);const n=e.state.doc,i=[],l=new Map;if(n.descendants((e,t)=>{e.marks.forEach(a=>{const{name:n}=a.type,s=a.attrs;if("comment"===n||"del"===n||"ins"===n){const r=s["data-replies"],o=e.isText?l.get(`${n}:${t}`):null;if(o&&o.mark.eq(a))return l.delete(`${n}:${t}`),o.end=t+e.nodeSize,o.text+=e.textContent,o.marks=o.marks.filter(t=>t.isInSet(e.marks)),void l.set(`${n}:${o.end}`,o);const c={pos:t,end:t+e.nodeSize,isText:e.isText,mark:a,marks:e.marks,type:n,userId:s["data-user-id"],user:s["data-user-label"],time:s["data-time"],text:e.attrs.meta?`${e.attrs.meta?.displayName}: ${e.attrs.label}`:e.textContent,replies:r?JSON.parse(r):null};i.push(c),e.isText&&l.set(`${n}:${c.end}`,c)}})}),0===i.length)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);this.fullScreenContainer.classList.add("is-comments");const u=t=>{if(t&&t.closest(".ProseMirror-comment")){const a=t.closest(".ProseMirror-comment"),n=a.dataset.type,s=this.editorView.state.doc.nodeAt(a.pos),i=s.marks.find(e=>n===e.type.name),r=Object.assign({},i.attrs);a.classList.contains("is-active")?r.class=r.class.replace(" is-active",""):(r.class=`${r.class} is-active`,u(this.comments.querySelector(".is-active")));const l=i.type.create(r);let c,d=e.state.tr;s.isText?(d=d.removeMark(a.pos,a.end,i),d=d.addMark(a.pos,a.end,l),c=new o.U3(d.doc.resolve(a.pos),d.doc.resolve(a.end))):(d=d.setNodeMarkup(a.pos,s.type,s.attrs,s.marks.map(e=>e.type.name===l.type.name?l:e)),c=new o.nh(d.doc.resolve(a.pos))),d.setSelection(c),e.dispatch(d),a.classList.toggle("is-active"),e.nodeDOM(a.pos).parentElement.scrollIntoView({behavior:"smooth"})}},p=(t,a)=>{const{pos:s,end:i}=t.closest(".ProseMirror-comment"),r=s,o=i,l=n.nodeAt(s).marks.filter(e=>"comment"===e.type.name)[0];if(l){const t=Object.assign({},l.attrs);let n=t["data-replies"];n=n?JSON.parse(n):[],a(n),t["data-replies"]=JSON.stringify(n),e.dispatch(e.state.tr.addMark(r,o,l.type.create(t)))}};(0,s.XX)(s.qy`
|
|
283
283
|
${i.map(t=>{const a=t.type;return s.qy`
|
|
284
284
|
<div
|
|
285
285
|
class="ProseMirror-comment is-${a}"
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
</div>
|
|
352
352
|
</div>
|
|
353
353
|
`})}
|
|
354
|
-
`,this.comments)}}n()}catch(e){n(e)}},1)},63650(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{f:()=>p}),a(57573),a(62953),a(49371),a(42723),a(26780),a(96648),a(56065);var s=a(12475),i=a(43855),r=a.n(i);if(3324==a.j)var o=a(59256);var l=a(14982),c=a(75361),d=a(13364),u=e([l,d]);[l,d]=u.then?(await u)():u,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(2565).then(a.bind(a,82565));class p{constructor(e,t){this.editorView=e,this.myKey=t,this.editorDOM=this.editorView.dom,this.editorDOMParent=this.editorDOM.parentNode,this.editorDOMGrandParent=this.editorDOMParent.parentNode,this.fullScreenContainer=document.createElement("div"),this.fullScreenContainer.className="ProseMirror-fullscreen-container",this.header=document.createElement("div"),this.header.className="ProseMirror-fullscreen-container-header",this.fullScreenContainer.appendChild(this.header),this.footer=document.createElement("div"),this.footer.className="ProseMirror-fullscreen-container-footer",this.fullScreenContainer.appendChild(this.footer);const a=this.editorDOM.closest("dialog");if(a?a.appendChild(this.fullScreenContainer):document.body.appendChild(this.fullScreenContainer),this.fullScreenContainer.classList.add("hide"),this.headerAside=document.createElement("div"),this.headerAside.className="ProseMirror-fullscreen-container-header-aside",this.header.appendChild(this.headerAside),this.form=this.editorDOM.closest(".ContentEdit"),this.comments=document.createElement("div"),this.comments.className="ProseMirror-comments",this.editorDOMParent.appendChild(this.comments),this.form&&this.form.hasAttribute("data-rte-title-field")&&(this.titleField=this.form.querySelector(`[name="${this.form.getAttribute("data-rte-title-field")}"]`),this.titleField)){this.titleInput=document.createElement("input"),this.titleInput.type="text",this.titleInput.addEventListener("input",e=>{this.titleField.value=this.titleInput.value;const t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),this.titleField.dispatchEvent(t)});const e=document.createElement("div");e.className="InputWrapper",e.appendChild(this.titleInput),this.header.prepend(e)}}render(){const e=(0,d.dO)(this.editorView,this.myKey);if(e.get("activeStates")&&e.get("activeStates").get("fullscreen")){const e=this.editorDOM.closest(".Popup.is-visible");if(e){const t=e.style.zIndex;this.fullScreenContainer.style.zIndex=`${parseInt(t)+1}`}this.fullScreenContainer.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.remove("hide"),window.BRIGHTSPOT?.ui.cms.enableV5UI&&(this.fullScreenContainer.setAttribute("popover","manual"),this.fullScreenContainer.showPopover());const t=this.editorDOMParent.querySelector(".ProsemirrorWordCount");t&&this.footer.appendChild(t);const a=this.form?.querySelector(".widget-publishing .icon-action-publish .WorkInProgressSaveStatus");if(a&&this.headerAside.appendChild(a),this.titleInput){this.titleInput.placeholder="Untitled",this.titleInput.title="Click to Edit";const e=this.titleField.closest(".CIG-row"),t=["is-pending","is-updated","is-readOnly"];this.titleField.readOnly||e&&t.some(t=>e.classList.contains(t))?this.titleInput.readOnly=!0:this.titleInput.removeAttribute("readonly"),this.titleField.value?this.titleInput.value=this.titleField.value:this.titleInput.value=""}else{const e=document.querySelector(".ContentEdit-title .ContentLabel[data-previous-text]");this.header.innerText=e?e.innerText:"Untitled"}const n=this.editorDOMParent.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`),s=this.fullScreenContainer.querySelector(".ProseMirror-fullscreen-container-header-aside"),i=this.fullScreenContainer.querySelector(".WorkInProgressSaveStatus");n&&s&&i&&s.insertBefore(n,i)}else{this.editorDOMGrandParent.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.add("hide");const e=this.headerAside.querySelector(".WorkInProgressSaveStatus");e&&this.form?.querySelector(".widget-publishing .icon-action-publish")?.appendChild(e);const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.editorView.props.props.ctx.dispatchEvent(t);const a=this.footer.querySelector(".ProsemirrorWordCount");a&&this.editorDOMParent.appendChild(a);const n=this.fullScreenContainer.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`);n&&this.editorDOMParent.appendChild(n)}this.editorDOMParent.querySelector(".ProseMirror").focus()}update(){const e=this.editorView,t=(0,d.dO)(e,this.myKey);t.get("hasToggle")&&this.render();const a=t.get("activeStates")?.get("fullscreen");if(!a)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);const n=e.state.doc,i=[],l=new Map;if(n.descendants((e,t)=>{e.marks.forEach(a=>{const{name:n}=a.type,s=a.attrs;if("comment"===n||"del"===n||"ins"===n){const r=s["data-replies"],o=e.isText?l.get(`${n}:${t}`):null;if(o&&o.mark.eq(a))return l.delete(`${n}:${t}`),o.end=t+e.nodeSize,o.text+=e.textContent,o.marks=o.marks.filter(t=>t.isInSet(e.marks)),void l.set(`${n}:${o.end}`,o);const c={pos:t,end:t+e.nodeSize,isText:e.isText,mark:a,marks:e.marks,type:n,userId:s["data-user-id"],user:s["data-user-label"],time:s["data-time"],text:e.attrs.meta?`${e.attrs.meta?.displayName}: ${e.attrs.label}`:e.textContent,replies:r?JSON.parse(r):null};i.push(c),e.isText&&l.set(`${n}:${c.end}`,c)}})}),0===i.length)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);this.fullScreenContainer.classList.add("is-comments");const u=t=>{if(t&&t.closest(".ProseMirror-comment")){const a=t.closest(".ProseMirror-comment"),n=a.dataset.type,s=this.editorView.state.doc.nodeAt(a.pos),i=s.marks.find(e=>n===e.type.name),r=Object.assign({},i.attrs);a.classList.contains("is-active")?r.class=r.class.replace(" is-active",""):(r.class=`${r.class} is-active`,u(this.comments.querySelector(".is-active")));const l=i.type.create(r);let c,d=e.state.tr;s.isText?(d=d.removeMark(a.pos,a.end,i),d=d.addMark(a.pos,a.end,l),c=new o.U3(d.doc.resolve(a.pos),d.doc.resolve(a.end))):(d=d.setNodeMarkup(a.pos,s.type,s.attrs,s.marks.map(e=>e.type.name===l.type.name?l:e)),c=new o.nh(d.doc.resolve(a.pos))),d.setSelection(c),e.dispatch(d),a.classList.toggle("is-active"),e.nodeDOM(a.pos).parentElement.scrollIntoView({behavior:"smooth"})}},p=(t,a)=>{const{pos:s,end:i}=t.closest(".ProseMirror-comment"),r=s,o=i,l=n.nodeAt(s).marks.filter(e=>"comment"===e.type.name)[0];if(l){const t=Object.assign({},l.attrs);let n=t["data-replies"];n=n?JSON.parse(n):[],a(n),t["data-replies"]=JSON.stringify(n),e.dispatch(e.state.tr.addMark(r,o,l.type.create(t)))}};(0,s.XX)(s.qy`
|
|
354
|
+
`,this.comments)}}n()}catch(e){n(e)}},1)},63650(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{f:()=>p}),a(57573),a(62953),a(49371),a(42723),a(26780),a(96648),a(56065);var s=a(12475),i=a(43855),r=a.n(i);if(3324==a.j)var o=a(59256);var l=a(14982),c=a(75361),d=a(13364),u=e([l,d]);[l,d]=u.then?(await u)():u,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(2565).then(a.bind(a,82565));class p{constructor(e,t){this.editorView=e,this.myKey=t,this.editorDOM=this.editorView.dom,this.editorDOMParent=this.editorDOM.parentNode,this.editorDOMGrandParent=this.editorDOMParent.parentNode,this.fullScreenContainer=document.createElement("div"),this.fullScreenContainer.className="ProseMirror-fullscreen-container",this.header=document.createElement("div"),this.header.className="ProseMirror-fullscreen-container-header",this.fullScreenContainer.appendChild(this.header),this.footer=document.createElement("div"),this.footer.className="ProseMirror-fullscreen-container-footer",this.fullScreenContainer.appendChild(this.footer);const a=this.editorDOM.closest("dialog");if(a?a.appendChild(this.fullScreenContainer):document.body.appendChild(this.fullScreenContainer),this.fullScreenContainer.classList.add("hide"),this.fullScreenContainer.inert=!0,this.headerAside=document.createElement("div"),this.headerAside.className="ProseMirror-fullscreen-container-header-aside",this.header.appendChild(this.headerAside),this.form=this.editorDOM.closest(".ContentEdit"),this.comments=document.createElement("div"),this.comments.className="ProseMirror-comments",this.editorDOMParent.appendChild(this.comments),this.form&&this.form.hasAttribute("data-rte-title-field")&&(this.titleField=this.form.querySelector(`[name="${this.form.getAttribute("data-rte-title-field")}"]`),this.titleField)){this.titleInput=document.createElement("input"),this.titleInput.type="text",this.titleInput.addEventListener("input",e=>{this.titleField.value=this.titleInput.value;const t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),this.titleField.dispatchEvent(t)});const e=document.createElement("div");e.className="InputWrapper",e.appendChild(this.titleInput),this.header.prepend(e)}}render(){const e=(0,d.dO)(this.editorView,this.myKey);if(e.get("activeStates")&&e.get("activeStates").get("fullscreen")){const e=this.editorDOM.closest(".Popup.is-visible");if(e){const t=e.style.zIndex;this.fullScreenContainer.style.zIndex=`${parseInt(t)+1}`}this.fullScreenContainer.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.remove("hide"),this.fullScreenContainer.inert=!1,window.BRIGHTSPOT?.ui.cms.enableV5UI&&(this.fullScreenContainer.setAttribute("popover","manual"),this.fullScreenContainer.showPopover());const t=this.editorDOMParent.querySelector(".ProsemirrorWordCount");t&&this.footer.appendChild(t);const a=this.form?.querySelector(".widget-publishing .icon-action-publish .WorkInProgressSaveStatus");if(a&&this.headerAside.appendChild(a),this.titleInput){this.titleInput.placeholder="Untitled",this.titleInput.title="Click to Edit";const e=this.titleField.closest(".CIG-row"),t=["is-pending","is-updated","is-readOnly"];this.titleField.readOnly||e&&t.some(t=>e.classList.contains(t))?this.titleInput.readOnly=!0:this.titleInput.removeAttribute("readonly"),this.titleField.value?this.titleInput.value=this.titleField.value:this.titleInput.value=""}else{const e=document.querySelector(".ContentEdit-title .ContentLabel[data-previous-text]");this.header.innerText=e?e.innerText:"Untitled"}const n=this.editorDOMParent.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`),s=this.fullScreenContainer.querySelector(".ProseMirror-fullscreen-container-header-aside"),i=this.fullScreenContainer.querySelector(".WorkInProgressSaveStatus");n&&s&&i&&s.insertBefore(n,i)}else{this.editorDOMGrandParent.appendChild(this.editorDOMParent),this.fullScreenContainer.classList.add("hide"),this.fullScreenContainer.inert=!0;const e=this.headerAside.querySelector(".WorkInProgressSaveStatus");e&&this.form?.querySelector(".widget-publishing .icon-action-publish")?.appendChild(e);const t=document.createEvent("HTMLEvents");t.initEvent("input",!0,!1),this.editorView.props.props.ctx.dispatchEvent(t);const a=this.footer.querySelector(".ProsemirrorWordCount");a&&this.editorDOMParent.appendChild(a);const n=this.fullScreenContainer.querySelector(`.${l.AA.CLASSES.PM_AVATAR_WRAPPER}`);n&&this.editorDOMParent.appendChild(n)}this.editorDOMParent.querySelector(".ProseMirror").focus()}update(){const e=this.editorView,t=(0,d.dO)(e,this.myKey);t.get("hasToggle")&&this.render();const a=t.get("activeStates")?.get("fullscreen");if(!a)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);const n=e.state.doc,i=[],l=new Map;if(n.descendants((e,t)=>{e.marks.forEach(a=>{const{name:n}=a.type,s=a.attrs;if("comment"===n||"del"===n||"ins"===n){const r=s["data-replies"],o=e.isText?l.get(`${n}:${t}`):null;if(o&&o.mark.eq(a))return l.delete(`${n}:${t}`),o.end=t+e.nodeSize,o.text+=e.textContent,o.marks=o.marks.filter(t=>t.isInSet(e.marks)),void l.set(`${n}:${o.end}`,o);const c={pos:t,end:t+e.nodeSize,isText:e.isText,mark:a,marks:e.marks,type:n,userId:s["data-user-id"],user:s["data-user-label"],time:s["data-time"],text:e.attrs.meta?`${e.attrs.meta?.displayName}: ${e.attrs.label}`:e.textContent,replies:r?JSON.parse(r):null};i.push(c),e.isText&&l.set(`${n}:${c.end}`,c)}})}),0===i.length)return this.fullScreenContainer.classList.remove("is-comments"),void(0,s.XX)("",this.comments);this.fullScreenContainer.classList.add("is-comments");const u=t=>{if(t&&t.closest(".ProseMirror-comment")){const a=t.closest(".ProseMirror-comment"),n=a.dataset.type,s=this.editorView.state.doc.nodeAt(a.pos),i=s.marks.find(e=>n===e.type.name),r=Object.assign({},i.attrs);a.classList.contains("is-active")?r.class=r.class.replace(" is-active",""):(r.class=`${r.class} is-active`,u(this.comments.querySelector(".is-active")));const l=i.type.create(r);let c,d=e.state.tr;s.isText?(d=d.removeMark(a.pos,a.end,i),d=d.addMark(a.pos,a.end,l),c=new o.U3(d.doc.resolve(a.pos),d.doc.resolve(a.end))):(d=d.setNodeMarkup(a.pos,s.type,s.attrs,s.marks.map(e=>e.type.name===l.type.name?l:e)),c=new o.nh(d.doc.resolve(a.pos))),d.setSelection(c),e.dispatch(d),a.classList.toggle("is-active"),e.nodeDOM(a.pos).parentElement.scrollIntoView({behavior:"smooth"})}},p=(t,a)=>{const{pos:s,end:i}=t.closest(".ProseMirror-comment"),r=s,o=i,l=n.nodeAt(s).marks.filter(e=>"comment"===e.type.name)[0];if(l){const t=Object.assign({},l.attrs);let n=t["data-replies"];n=n?JSON.parse(n):[],a(n),t["data-replies"]=JSON.stringify(n),e.dispatch(e.state.tr.addMark(r,o,l.type.create(t)))}};(0,s.XX)(s.qy`
|
|
355
355
|
${i.map(t=>{const a=t.type;return s.qy`
|
|
356
356
|
<div
|
|
357
357
|
class="ProseMirror-comment is-${a}"
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
</div>
|
|
424
424
|
</div>
|
|
425
425
|
`})}
|
|
426
|
-
`,this.comments)}}n()}catch(e){n(e)}},1)},47045(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,e:()=>p});var s=a(72065),i=a(40348);if(7717==a.j)var r=a(17755);var o=a(64989),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("htmlEditor"),d={};d[(0,o.rd)("html")]=(0,o.Kt)("rte2-toolbar-html");const u=()=>function(e,t){return t(e.tr.setMeta(c,{toggleHTMLEditor:!0})),!0},p=e=>new s.k_({key:c,view(t){return this.view=new i.E(c.key,e),t.dom.parentElement.appendChild(this.view.dom),this.view},state:{init(e,t){const a=new Map,n=new Map;return a.set("activeStates",n),a.set("isEditorVisible",!1),a},apply(e,t){const a=t,n=new Map(a),s=new Map,i=e.getMeta(c);return i&&i.hasOwnProperty("toggleHTMLEditor")&&n.set("isEditorVisible",!a.get("isEditorVisible")),n.set("activeStates",s),n}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},34236(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,e:()=>p});var s=a(59256),i=a(53157);if(3324==a.j)var r=a(3743);var o=a(52180),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("htmlEditor"),d={};d[(0,o.rd)("html")]=(0,o.Kt)("rte2-toolbar-html");const u=()=>function(e,t){return t(e.tr.setMeta(c,{toggleHTMLEditor:!0})),!0},p=e=>new s.k_({key:c,view(t){return this.view=new i.E(c.key,e),t.dom.parentElement.appendChild(this.view.dom),this.view},state:{init(e,t){const a=new Map,n=new Map;return a.set("activeStates",n),a.set("isEditorVisible",!1),a},apply(e,t){const a=t,n=new Map(a),s=new Map,i=e.getMeta(c);return i&&i.hasOwnProperty("toggleHTMLEditor")&&n.set("isEditorVisible",!a.get("isEditorVisible")),n.set("activeStates",s),n}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},40348(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{E:()=>e}),7717==a.j)var s=a(72065);if(7717==a.j)var i=a(13333);var r=a(46929),o=a(21058),l=a.n(o);a(21529),window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(5098).then(a.bind(a,65098));class e{constructor(e,t){this.myKey=e,this.compliantTagNameMap=t,this.dom=document.createElement("textarea"),this.dom.dataset.hideWordCount=!0,this.dom.className="Prosemirror-html-editor",this.dom.style.display="none"}update(e){const{state:t}=e,a=t[this.myKey];if(a.get("isEditorVisible")||this.editor)if(a.get("isEditorVisible")){const t=e.props.props.ctx;this.dom.value=t.value,this.editor=l().fromTextArea(this.dom,{lineNumbers:!0,mode:"htmlmixed",lineWrapping:!0}),this.editor.getWrapperElement().querySelector("textarea").dataset.hideWordCount=!0,e.dom.style.display="none",e.dom.parentElement.classList.add("is-htmlMode");const a=e.dom.closest(".ProseMirror-fullscreen-container");a&&a.classList.add("is-htmlMode")}else this._toProseMirror(e)}_toProseMirror(e){const{state:t,dispatch:a}=e;if(!this.editor)return;this.editor.toTextArea(),this.editor=null,this.dom.style.display="none",e.dom.style.display="block",e.dom.parentElement.classList.remove("is-htmlMode");const n=e.dom.closest(".ProseMirror-fullscreen-container");n&&n.classList.remove("is-htmlMode");const o=document.createElement("div"),l=(0,r.n)(this.dom.value,t.config.schema,this.compliantTagNameMap);o.innerHTML=l;const c=i.S4.fromSchema(t.config.schema).parse(o),d=new s.i5(t.doc);a(t.tr.setSelection(d).replaceSelectionWith(c))}}n()}catch(e){n(e)}},1)},53157(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{E:()=>e}),3324==a.j)var s=a(59256);if(3324==a.j)var i=a(48940);var r=a(34120),o=a(50219),l=a.n(o);a(8720),window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(4017).then(a.bind(a,74017));class e{constructor(e,t){this.myKey=e,this.compliantTagNameMap=t,this.dom=document.createElement("textarea"),this.dom.dataset.hideWordCount=!0,this.dom.className="Prosemirror-html-editor",this.dom.style.display="none"}update(e){const{state:t}=e,a=t[this.myKey];if(a.get("isEditorVisible")||this.editor)if(a.get("isEditorVisible")){const t=e.props.props.ctx;this.dom.value=t.value,this.editor=l().fromTextArea(this.dom,{lineNumbers:!0,mode:"htmlmixed",lineWrapping:!0}),this.editor.getWrapperElement().querySelector("textarea").dataset.hideWordCount=!0,e.dom.style.display="none",e.dom.parentElement.classList.add("is-htmlMode");const a=e.dom.closest(".ProseMirror-fullscreen-container");a&&a.classList.add("is-htmlMode")}else this._toProseMirror(e)}_toProseMirror(e){const{state:t,dispatch:a}=e;if(!this.editor)return;this.editor.toTextArea(),this.editor=null,this.dom.style.display="none",e.dom.style.display="block",e.dom.parentElement.classList.remove("is-htmlMode");const n=e.dom.closest(".ProseMirror-fullscreen-container");n&&n.classList.remove("is-htmlMode");const o=document.createElement("div"),l=(0,r.n)(this.dom.value,t.config.schema,this.compliantTagNameMap);o.innerHTML=l;const c=i.S4.fromSchema(t.config.schema).parse(o),d=new s.i5(t.doc);a(t.tr.setSelection(d).replaceSelectionWith(c))}}n()}catch(e){n(e)}},1)},9542(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{b:()=>w}),a(50144),a(84978),a(39589),a(91672);var s=a(72065);if(7717==a.j)var i=a(17283);if(7717==a.j)var r=a(17755);var o=a(27791),l=a(28072),c=a(16276),d=a(26173),u=a(64989),p=a(99666);if(7717==a.j)var h=a(36500);var m=a(5292),f=e([o,c,d,u]);[o,c,d,u]=f.then?(await f)():f,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(5617).then(a.bind(a,65617));const g=new s.hs("listManager"),v={};v[(0,u.rd)("ul")]=(0,u.Kt)("rte2-toolbar-ul"),v[(0,u.rd)("ol")]=(0,u.Kt)("rte2-toolbar-ol");const b=(e,t,a)=>{if(t||a&&a.parent.type.name===o.AA.NODES.LISTS.listItem){const t=l.gV;return 0===e.index(a.depth-t)}return 0===e.index(a.depth)},y=e=>{const{$from:t,$to:a,empty:n}=e.selection,s=t.blockRange(a),i=l.kl.map(e=>{if(!(0,d.Jz)(s))return[e,!1];switch(e){case"indent":return b(t,n,s)?[e,!1]:[e,!0];case"outdent":return[e,!0];default:return[e,!1]}});return new Map(i)},C=(e,t)=>{const a=new Map;return a.set("compatibleActions",e),a.set("decos",t),a},w=e=>new s.k_({key:g,state:{init(e,t){const a=new Map;return C(a)},apply(e,t,a,n){const s=y(n),r=C(s),o=n.selection;let l=o.$from.depth;for(let e=1;e<l;e++){const t=o.$from.node(e);if(t&&("ol"===t.type.name||"ul"===t.type.name)){const a=RICH_TEXT_ELEMENTS_PM.find(e=>e.tag===t.type.name);if(!a)break;const s=o.$from.before(e);return r.set("decos",i.zF.create(n.doc,[i.NZ.widget(s,(e,n)=>{const i=(0,m.A)("div",{class:"ListManager-edit"});return(0,p.XX)(A(e,s,t,a),i),i},{ignoreSelection:!0})])),r}}return r}},props:{handleKeyDown:(0,r.K)(v),handleDoubleClickOn:(e,t,a,n,s,r)=>"ol"===a.type.name&&"li"===s.target.nodeName.toLowerCase()
|
|
426
|
+
`,this.comments)}}n()}catch(e){n(e)}},1)},47045(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,e:()=>p});var s=a(72065),i=a(40348);if(7717==a.j)var r=a(17755);var o=a(64989),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("htmlEditor"),d={};d[(0,o.rd)("html")]=(0,o.Kt)("rte2-toolbar-html");const u=()=>function(e,t){return t(e.tr.setMeta(c,{toggleHTMLEditor:!0})),!0},p=e=>new s.k_({key:c,view(t){return this.view=new i.E(c.key,e),t.dom.parentElement.appendChild(this.view.dom),this.view},state:{init(e,t){const a=new Map,n=new Map;return a.set("activeStates",n),a.set("isEditorVisible",!1),a},apply(e,t){const a=t,n=new Map(a),s=new Map,i=e.getMeta(c);return i&&i.hasOwnProperty("toggleHTMLEditor")&&n.set("isEditorVisible",!a.get("isEditorVisible")),n.set("activeStates",s),n}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},34236(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{E:()=>u,e:()=>p});var s=a(59256),i=a(53157);if(3324==a.j)var r=a(3743);var o=a(52180),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=new s.hs("htmlEditor"),d={};d[(0,o.rd)("html")]=(0,o.Kt)("rte2-toolbar-html");const u=()=>function(e,t){return t(e.tr.setMeta(c,{toggleHTMLEditor:!0})),!0},p=e=>new s.k_({key:c,view(t){return this.view=new i.E(c.key,e),t.dom.parentElement.appendChild(this.view.dom),this.view},state:{init(e,t){const a=new Map,n=new Map;return a.set("activeStates",n),a.set("isEditorVisible",!1),a},apply(e,t){const a=t,n=new Map(a),s=new Map,i=e.getMeta(c);return i&&i.hasOwnProperty("toggleHTMLEditor")&&n.set("isEditorVisible",!a.get("isEditorVisible")),n.set("activeStates",s),n}},props:{handleKeyDown:(0,r.K)(d)}});n()}catch(e){n(e)}})},40348(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{E:()=>e}),7717==a.j)var s=a(72065);if(7717==a.j)var i=a(13333);var r=a(46929),o=a(21058),l=a.n(o);a(21529),window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(5098).then(a.bind(a,65098));class e{constructor(e,t){this.myKey=e,this.compliantTagNameMap=t,this.dom=document.createElement("textarea"),this.dom.dataset.hideWordCount=!0,this.dom.className="Prosemirror-html-editor",this.dom.style.display="none"}update(e){const{state:t}=e,a=t[this.myKey];if(a.get("isEditorVisible")||this.editor)if(a.get("isEditorVisible")){const t=e.props.props.ctx;this.dom.value=t.value,this.editor=l().fromTextArea(this.dom,{lineNumbers:!0,mode:"htmlmixed",lineWrapping:!0}),this.editor.getWrapperElement().querySelector("textarea").dataset.hideWordCount=!0,e.dom.style.display="none",e.dom.parentElement.classList.add("is-htmlMode");const a=e.dom.closest(".ProseMirror-fullscreen-container");a&&a.classList.add("is-htmlMode")}else this._toProseMirror(e)}_toProseMirror(e){const{state:t,dispatch:a}=e;if(!this.editor)return;this.editor.toTextArea(),this.editor=null,this.dom.style.display="none",e.dom.style.display="block",e.dom.parentElement.classList.remove("is-htmlMode");const n=e.dom.closest(".ProseMirror-fullscreen-container");n&&n.classList.remove("is-htmlMode");const o=document.createElement("div"),l=(0,r.n)(this.dom.value,t.config.schema,this.compliantTagNameMap);o.innerHTML=l;const c=i.S4.fromSchema(t.config.schema).parse(o),d=new s.i5(t.doc);a(t.tr.setSelection(d).replaceSelectionWith(c))}}n()}catch(e){n(e)}},1)},53157(e,t,a){"use strict";a.a(e,async(e,n)=>{try{if(a.d(t,{E:()=>e}),3324==a.j)var s=a(59256);if(3324==a.j)var i=a(48940);var r=a(34120),o=a(50219),l=a.n(o);a(8720),window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(4017).then(a.bind(a,74017));class e{constructor(e,t){this.myKey=e,this.compliantTagNameMap=t,this.dom=document.createElement("textarea"),this.dom.dataset.hideWordCount=!0,this.dom.className="Prosemirror-html-editor",this.dom.style.display="none"}update(e){const{state:t}=e,a=t[this.myKey];if(a.get("isEditorVisible")||this.editor)if(a.get("isEditorVisible")){const t=e.props.props.ctx;this.dom.value=t.value,this.editor=l().fromTextArea(this.dom,{lineNumbers:!0,mode:"htmlmixed",lineWrapping:!0}),this.editor.getWrapperElement().querySelector("textarea").dataset.hideWordCount=!0,e.dom.style.display="none",e.dom.parentElement.classList.add("is-htmlMode");const a=e.dom.closest(".ProseMirror-fullscreen-container");a&&a.classList.add("is-htmlMode")}else this._toProseMirror(e)}_toProseMirror(e){const{state:t,dispatch:a}=e;if(!this.editor)return;this.editor.toTextArea(),this.editor=null,this.dom.style.display="none",e.dom.style.display="block",e.dom.parentElement.classList.remove("is-htmlMode");const n=e.dom.closest(".ProseMirror-fullscreen-container");n&&n.classList.remove("is-htmlMode");const o=document.createElement("div"),l=(0,r.n)(this.dom.value,t.config.schema,this.compliantTagNameMap);o.innerHTML=l;const c=i.S4.fromSchema(t.config.schema).parse(o),d=new s.i5(t.doc);a(t.tr.setSelection(d).replaceSelectionWith(c))}}n()}catch(e){n(e)}},1)},9542(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{b:()=>w}),a(50144),a(84978),a(39589),a(91672);var s=a(72065);if(7717==a.j)var i=a(17283);if(7717==a.j)var r=a(17755);var o=a(27791),l=a(28072),c=a(16276),d=a(26173),u=a(64989),p=a(99666);if(7717==a.j)var h=a(36500);var m=a(5292),f=e([o,c,d,u]);[o,c,d,u]=f.then?(await f)():f,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(5617).then(a.bind(a,65617));const g=new s.hs("listManager"),v={};v[(0,u.rd)("ul")]=(0,u.Kt)("rte2-toolbar-ul"),v[(0,u.rd)("ol")]=(0,u.Kt)("rte2-toolbar-ol");const b=(e,t,a)=>{if(t||a&&a.parent.type.name===o.AA.NODES.LISTS.listItem){const t=l.gV;return 0===e.index(a.depth-t)}return 0===e.index(a.depth)},y=e=>{const{$from:t,$to:a,empty:n}=e.selection,s=t.blockRange(a),i=l.kl.map(e=>{if(!(0,d.Jz)(s))return[e,!1];switch(e){case"indent":return b(t,n,s)?[e,!1]:[e,!0];case"outdent":return[e,!0];default:return[e,!1]}});return new Map(i)},C=(e,t)=>{const a=new Map;return a.set("compatibleActions",e),a.set("decos",t),a},w=e=>new s.k_({key:g,state:{init(e,t){const a=new Map;return C(a)},apply(e,t,a,n){const s=y(n),r=C(s),o=n.selection;let l=o.$from.depth;for(let e=1;e<l;e++){const t=o.$from.node(e);if(t&&("ol"===t.type.name||"ul"===t.type.name)){const a=RICH_TEXT_ELEMENTS_PM.find(e=>e.tag===t.type.name);if(!a)break;const s=o.$from.before(e);return r.set("decos",i.zF.create(n.doc,[i.NZ.widget(s,(e,n)=>{const i=(0,m.A)("div",{class:"ListManager-edit"});return(0,p.XX)(A(e,s,t,a),i),i},{ignoreSelection:!0})])),r}}return r}},props:{handleKeyDown:(0,r.K)(v),handleDoubleClickOn:(e,t,a,n,s,r)=>{if("ol"===a.type.name&&"li"===s.target.nodeName.toLowerCase()){const s=e.state[g.key],r=a.firstChild,o=r?n+1+r.nodeSize:t;return s.set("decos",i.zF.create(e.state.doc,[i.NZ.widget(o,(e,n)=>{const s=(0,m.A)("div",{class:"ListManager-widget"});return(0,p.XX)(T(e,t,a),s),setTimeout(()=>{s.scrollIntoView({behavior:"smooth",block:"center"})},300),s},{stopEvent:e=>!0,ignoreSelection:!0})])),!0}return!1},decorations:e=>{const t=e[g.key];return t?t.get("decos"):null}}});function A(e,t,a,n){let s=(0,c.Cx)(n.typeId,e.dom);s+=`&attributes=${encodeURIComponent(JSON.stringify(a.attrs.attributes))}`;const i=(0,h.A)();return p.qy`<div class="ProsemirrorEnhancementMenu-container">
|
|
427
427
|
<span class="ProsemirrorEnhancementMenu-container-label"
|
|
428
428
|
>${n.displayName}</span
|
|
429
429
|
><a
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
${window.BRIGHTSPOT?.ui?.rte?.buttonCancel||"Cancel"}
|
|
463
463
|
</button>
|
|
464
464
|
</div>
|
|
465
|
-
</div>`}n()}catch(k){n(k)}},1)},73935(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{b:()=>w}),a(62953),a(49371),a(26780),a(56065);var s=a(59256);if(3324==a.j)var i=a(88282);if(3324==a.j)var r=a(3743);var o=a(14982),l=a(40881),c=a(29085),d=a(13364),u=a(52180),p=a(12475);if(3324==a.j)var h=a(49309);var m=a(18101),f=e([o,c,d,u]);[o,c,d,u]=f.then?(await f)():f,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(4850).then(a.bind(a,64850));const g=new s.hs("listManager"),v={};v[(0,u.rd)("ul")]=(0,u.Kt)("rte2-toolbar-ul"),v[(0,u.rd)("ol")]=(0,u.Kt)("rte2-toolbar-ol");const b=(e,t,a)=>{if(t||a&&a.parent.type.name===o.AA.NODES.LISTS.listItem){const t=l.gV;return 0===e.index(a.depth-t)}return 0===e.index(a.depth)},y=e=>{const{$from:t,$to:a,empty:n}=e.selection,s=t.blockRange(a),i=l.kl.map(e=>{if(!(0,d.Jz)(s))return[e,!1];switch(e){case"indent":return b(t,n,s)?[e,!1]:[e,!0];case"outdent":return[e,!0];default:return[e,!1]}});return new Map(i)},C=(e,t)=>{const a=new Map;return a.set("compatibleActions",e),a.set("decos",t),a},w=e=>new s.k_({key:g,state:{init(e,t){const a=new Map;return C(a)},apply(e,t,a,n){const s=y(n),r=C(s),o=n.selection;let l=o.$from.depth;for(let e=1;e<l;e++){const t=o.$from.node(e);if(t&&("ol"===t.type.name||"ul"===t.type.name)){const a=RICH_TEXT_ELEMENTS_PM.find(e=>e.tag===t.type.name);if(!a)break;const s=o.$from.before(e);return r.set("decos",i.zF.create(n.doc,[i.NZ.widget(s,(e,n)=>{const i=(0,m.A)("div",{class:"ListManager-edit"});return(0,p.XX)(A(e,s,t,a),i),i},{ignoreSelection:!0})])),r}}return r}},props:{handleKeyDown:(0,r.K)(v),handleDoubleClickOn:(e,t,a,n,s,r)=>"ol"===a.type.name&&"li"===s.target.nodeName.toLowerCase()
|
|
465
|
+
</div>`}n()}catch(k){n(k)}},1)},73935(e,t,a){"use strict";a.a(e,async(e,n)=>{try{a.d(t,{b:()=>w}),a(62953),a(49371),a(26780),a(56065);var s=a(59256);if(3324==a.j)var i=a(88282);if(3324==a.j)var r=a(3743);var o=a(14982),l=a(40881),c=a(29085),d=a(13364),u=a(52180),p=a(12475);if(3324==a.j)var h=a(49309);var m=a(18101),f=e([o,c,d,u]);[o,c,d,u]=f.then?(await f)():f,window.BRIGHTSPOT?.ui.cms.enableV5UI||await a.e(4850).then(a.bind(a,64850));const g=new s.hs("listManager"),v={};v[(0,u.rd)("ul")]=(0,u.Kt)("rte2-toolbar-ul"),v[(0,u.rd)("ol")]=(0,u.Kt)("rte2-toolbar-ol");const b=(e,t,a)=>{if(t||a&&a.parent.type.name===o.AA.NODES.LISTS.listItem){const t=l.gV;return 0===e.index(a.depth-t)}return 0===e.index(a.depth)},y=e=>{const{$from:t,$to:a,empty:n}=e.selection,s=t.blockRange(a),i=l.kl.map(e=>{if(!(0,d.Jz)(s))return[e,!1];switch(e){case"indent":return b(t,n,s)?[e,!1]:[e,!0];case"outdent":return[e,!0];default:return[e,!1]}});return new Map(i)},C=(e,t)=>{const a=new Map;return a.set("compatibleActions",e),a.set("decos",t),a},w=e=>new s.k_({key:g,state:{init(e,t){const a=new Map;return C(a)},apply(e,t,a,n){const s=y(n),r=C(s),o=n.selection;let l=o.$from.depth;for(let e=1;e<l;e++){const t=o.$from.node(e);if(t&&("ol"===t.type.name||"ul"===t.type.name)){const a=RICH_TEXT_ELEMENTS_PM.find(e=>e.tag===t.type.name);if(!a)break;const s=o.$from.before(e);return r.set("decos",i.zF.create(n.doc,[i.NZ.widget(s,(e,n)=>{const i=(0,m.A)("div",{class:"ListManager-edit"});return(0,p.XX)(A(e,s,t,a),i),i},{ignoreSelection:!0})])),r}}return r}},props:{handleKeyDown:(0,r.K)(v),handleDoubleClickOn:(e,t,a,n,s,r)=>{if("ol"===a.type.name&&"li"===s.target.nodeName.toLowerCase()){const s=e.state[g.key],r=a.firstChild,o=r?n+1+r.nodeSize:t;return s.set("decos",i.zF.create(e.state.doc,[i.NZ.widget(o,(e,n)=>{const s=(0,m.A)("div",{class:"ListManager-widget"});return(0,p.XX)(T(e,t,a),s),setTimeout(()=>{s.scrollIntoView({behavior:"smooth",block:"center"})},300),s},{stopEvent:e=>!0,ignoreSelection:!0})])),!0}return!1},decorations:e=>{const t=e[g.key];return t?t.get("decos"):null}}});function A(e,t,a,n){let s=(0,c.Cx)(n.typeId,e.dom);s+=`&attributes=${encodeURIComponent(JSON.stringify(a.attrs.attributes))}`;const i=(0,h.A)();return p.qy`<div class="ProsemirrorEnhancementMenu-container">
|
|
466
466
|
<span class="ProsemirrorEnhancementMenu-container-label"
|
|
467
467
|
>${n.displayName}</span
|
|
468
468
|
><a
|