(function(t,e){"use strict";function n(t){if(typeof t!=="string")return"";return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function a(t,e,n){return t.split(n?"":" ").slice(0,e).join(n?"":" ")+"..."}function i(t,e){const n=t.find(".deensimc-contents");const a=t.find(".deensimc-toggle").first();const i=t.attr("data-full-text");const c=t.attr("data-truncated-text");if(!i||!c||!a.length||!n.length){return}n.html(e?i:c);t.attr("data-is-expanded",e?"true":"false");a.find(".fold-text").toggle(!e);a.find(".unfold-text").toggle(e)}function c(e){const c=e.find(".contents-wrapper");if(c.length){c.each(function(){const e=t(this);const c=e.find(".deensimc-contents");const r=e.find(".deensimc-toggle").first();if(!c.length||!r.length){return}const s=parseInt(e.data("visible-length"),10);const d=e.data("limit-by")==="characters";const o=n(String(e.attr("data-full-text")||c.text()).trim());if(!s||!o){return}e.attr("data-full-text",o);e.attr("data-truncated-text",a(o,s,d));if(typeof e.attr("data-is-expanded")==="undefined"){e.attr("data-is-expanded","false")}i(e,e.attr("data-is-expanded")==="true");r.off("click.deensimcTextToggle").on("click.deensimcTextToggle",function(){const e=t(this).closest(".contents-wrapper");const n=e.attr("data-is-expanded")==="true";i(e,!n)})})}}window.initTextLengthToggle=c})(jQuery,window._);