;Array.prototype.indexOf=function(t){var i=this.length;for(var e=0;e<i;e++){if(this[e]===t)return e};return-1};if(!Array.prototype.filter){Array.prototype.filter=function(t){var a=this.length>>>0;if(typeof t!='function')throw new TypeError();var n=[],o=arguments[1];for(var e=0;e<a;e++){if(e in this){var i=this[e];if(t.call(o,i,e,this))n.push(i)}};return n}};bm={isMobile:/iPhone|iPod|iPad|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson|LG|SAMSUNG|Samsung/i.test(navigator.userAgent),__isWindowLoad:!1,__onLoad:[],__onLoadHandler:function(){this.isLoad=!0;var t=this.__onLoad.length;while(t--)this.__onLoad.pop()();this.__onLoad.length=0},isLoad:!1,onLoad:function(t){if(this.isLoad){t();return};this.__onLoad.push(t)},detectIpad:function(){var t=navigator.userAgent.toLowerCase();if(t.indexOf('safari')>-1){if(t.indexOf('opr')>-1){}
else if(t.indexOf('chrome')>-1){}
else{if(t.indexOf('ipad')!=-1||(navigator.platform==='MacIntel'&&navigator.maxTouchPoints>1)){$('body').attr('data-wv-agent','ipad');$('body').attr('data-wv-pc','mobile');$('body').attr('data-wv-os','ipad')}}}}};bm.membership={FREE:{SHOP_PRODUCT_MAX_CNT:5,SHOP_CATEGORY_MAX_CNT:1,SHOP_COUPON_AVAILABLE:!1,SHOP_NAVERPAY_AVAILABLE:!1},STANDARD:{SHOP_PRODUCT_MAX_CNT:12,SHOP_CATEGORY_MAX_CNT:5,SHOP_NAVERPAY_AVAILABLE:!1},BUSINESS:{},PREMIUM:{},ENTERPRISE:{}};var app={initList:[],readyList:[],resetList:[],init:function(t){this.initList.push(t)},ready:function(t){this.readyList.push(t)},reset:function(t){this.resetList.push(t)}};window.onload=function(){bm.__isWindowLoad=!0;bm.__onLoadHandler()};function openSNSWin(t){var e;e=window.open(t,'sendNewsWin','width=1024, height=800')};function snsSend(t,e,i){var n='';if(n!='')openSNSWin(n);switch(t){case'twitter':n='http://twitter.com/home?status='+encodeURIComponent(i)+'+'+encodeURIComponent(e);break;case'metoday':n='http://me2day.net/posts/new?new_post[body]='+encodeURIComponent(i)+':'+encodeURIComponent(e);break;case'naver':n='http://bookmark.naver.com/post?ns=1&title='+encodeURIComponent(i)+'&url='+encodeURIComponent(e);break;case'google':n='http://www.google.com/bookmarks/mark?op=add&title='+encodeURIComponent(i)+'&bkmk='+encodeURIComponent(e);break;case'facebook':n='http://www.facebook.com/sharer.php?u='+encodeURIComponent(e)+'&t='+encodeURIComponent(i);break;case'band':n='http://www.band.us/plugin/share?body='+encodeURIComponent(i+'\n'+e);break;case'kas':n='https://story.kakao.com/share?url='+e+'&text='+i+'\n';break};if(n!=''){openSNSWin(n)};return!1};var traceIndex=0;function trace(t){if(window.console){if(arguments.length>1)console.log('BluestreaM trace ['+traceIndex++ +'] =>   ',arguments);else console.log('BluestreaM trace ['+traceIndex++ +'] =>   ',arguments[0])}};var debugElement;function log(){if(!debugElement){$(window.document.body).prepend('<div id=\'debugElement\' style=\'width:500px; height:500px; background-color: #fff; border:2px solid #555; font-size:14px; color:#000; position:fixed; left:0; top:0; z-index: 100000000000000;\'></div>');debugElement=$('#debugElement')[0]};debugElement.innerHTML=Array.prototype.join.call(arguments,', ')+'<br/>'+debugElement.innerHTML};bm.sort={byProps:function(){function e(t){return function(e,i){return e[t]>i[t]?1:e[t]<i[t]?-1:0}};var t=arguments;return function(i,n){var o=0,a=0,s=t.length;while(a===0&&o<s){a=e(t[o])(i,n);o++};return a}},orderBy:function(){function e(t,e){return t>e?1:t<e?-1:0};var t=[];$.each(arguments,function(e,i){var n=i.split(/\s+/);t.push([n[0],n[1]=='asc'?1:-1])});return function(i,n){for(var a=0;a<t.length;a++){var o=t[a],s=e(i[o[0]],n[o[0]]);if(s)return s*o[1]};return 0}}};bm.string={numUtitToString:function(t,e){var i,n;i=t.toString(10);e=e||2;n=e-i.length;if(n>0)while(n--)i='0'+i;return i},comma:function(t){t=t+'';var n='';if(t.indexOf('.')>-1){n=t.substr(t.indexOf('.'));t=t.slice(0,t.indexOf('.'))};var o,e,i,a=!1;if(t.substr(0,1)=='-'){a=!0;t=t.substr(1)};e=t.length%3;o=t.length;i=t.substring(0,e);while(e<o){if(i!='')i+=',';i+=t.substring(e,e+3);e+=3};return(a?'-':'')+i+(n!=''?n:'')},removeComma:function(t){if(Object.prototype.toString.call(t)!=='[object String]')return t;return t.replace(/,/gi,'')},cutByte:function(t,byte,i){i=i||'...';var o=0;for(var n=0;n<t.length;n++){if(escape(t.charAt(n)).length>=4)o+=2;else if(escape(t.charAt(n))!='%0D')o++;if(o>byte){if(escape(t.charAt(n))=='%0A')n--;break}};return t.substring(0,n-3)+'...'},cutByteUtf8:function(t,byte,n){var o=0,r='',l='',d=!1;for(i=0;i<t.length;i++){var a=t.charCodeAt(i),s=t.substr(i,1).toUpperCase();l=t.substr(i,1);a=parseInt(a);if((s<'0'||s>'9')&&(s<'A'||s>'Z')&&((a>255)||(a<0))){o=o+3}
else{o=o+1};if(o>byte){d=!0;break}
else{r=r+l}};return r+(d?n:'')},substringWithByte:function(t,byte){if(t==null||t=='')return'';var a='',i,n,o;for(i=n=0;o=t.charCodeAt(n++);i+=o>>11?3:o>>7?2:1){if(i>=byte)break;a+=t.charAt(n-1)};return a},replaceList:function(t,e,i){var o=t.length;for(var n=0;n<o;n++){t[n]=t[n].replace(e,i)};return t},getByte:function(t,e){if(t==null||t=='')return 0;if(e&&e=='euc-kr'){t=t.replace(/\n/gi,' ');return t.split('').map(function(t){return t.charCodeAt(0)}).reduce(function(t,e){return t+(e===10?2:e>>7?2:1)},0)};var i,o,n;for(i=o=0;n=t.charCodeAt(o++);i+=n>>11?3:n>>7?2:1);return i},cutByteLength:function(t,e,i){if(t==null||t.length==0){return 0};var o=0,a=t.length;for(var n=0;n<t.length;n++){o+=this.getByte(t.charAt(n),i);if(o==e){a=n+1;break}
else if(o>e){a=n;break}};return t.substring(0,a)},focusEndOfContenteditable:function(t){var e,i;if(document.createRange){e=document.createRange();e.selectNodeContents(t);e.collapse(!1);i=window.getSelection();i.removeAllRanges();i.addRange(e)}
else if(document.selection){e=document.body.createTextRange();e.moveToElementText(t);e.collapse(!1);e.select()}},trimLeft:function(t){return t?t.replace(/^\s*/,''):t},trimRight:function(t){return t?t.replace(/\s*$/,''):t},trim:function(t){return t?t.replace(/(^\s*)|(\s*$)/g,''):t},trimList:function(t){var e=t.length;while(e--){t[e]=bm.string.trim(t[e])};return t},contains:function(t,e){if(t!==''&&!t){return!1}
else if(t.indexOf(e)>-1){return!0}
else{return!1}},append:function(t,e,i){if(t){return t+i+e}
else{return e}},formatPhone:function(t,e){var i='';if(t.length==11){if(e==0){i=t.replace(/(\d{3})(\d{4})(\d{4})/,'$1-****-$3')}
else{i=t.replace(/(\d{3})(\d{4})(\d{4})/,'$1-$2-$3')}}
else if(t.length==8){i=t.replace(/(\d{4})(\d{4})/,'$1-$2')}
else{if(t.indexOf('02')==0){if(e==0){i=t.replace(/(\d{2})(\d{4})(\d{4})/,'$1-****-$3')}
else{i=t.replace(/(\d{2})(\d{4})(\d{4})/,'$1-$2-$3')}}
else{if(e==0){i=t.replace(/(\d{3})(\d{3})(\d{4})/,'$1-***-$3')}
else{i=t.replace(/(\d{3})(\d{3})(\d{4})/,'$1-$2-$3')}}};return i},toUpperCaseFirstChar:function(t){return t.charAt(0).toUpperCase()+t.substr(1)},toggleUpperLowerCase:function(t){var e=t.toUpperCase();if(t===e){return t.toLowerCase()}
else{return e}},toUnitFromUpperCase:function(t,e){if(!e)e='-';if(typeof t=='number'){return t.toString()};var n=/[A-Z]/g,i=t.search(n),o,a;while(i>-1){o=t.slice(0,i);a=t.slice(i,i+1).toLowerCase()+t.slice(i+1);t=o+e+a;i=t.search(n)};return t},stringToFunction:function(t){if(t&&t!==''){var i=[];if(t.indexOf('(')>-1){var n=t.slice(0,t.indexOf('(')),o=t.slice(t.indexOf('(')+1,t.length-1);i=o.split(',');t=n};if(t.indexOf('.')>0){}
else{var e=window[t];if(typeof e==='function'){e.apply(i)}}}},toCssPropKey:function(t){var e=/[A-Z]/g;if(t.search(e)>-1){t=bm.string.toUnitFromUpperCase(t,'-')};return t},isValidParenthesis:function(t){var i=[];for(var e=0;e<t.length;e++){if(t[e]==='('){i.push('(')}
else if(t[e]===')'){if(i.length===0||i.pop()!=='('){return!1}}};return i.length===0},hasArithmeticOperators:function(t){return/[+\-*/]/.test(t)&&!/^[-+*/]/.test(t)&&!/[-+*/]$/.test(t)},addSpaceAroundOperators:function(t){var e=t.match(/[\+\-*/()]/g);if(e){t=t.replace(/([\+\-*/()])/g,' $1 ').replace(/\s+/g,' ');var n=t.indexOf(e[0]);if(e[0]==='('&&t[n-1]===' '){var i=t.split('');i.splice(n-1,1);t=i.join('')};t=t.trim()};return t},wrapStringInCalc:function(t){if(!/^calc\(.+\)$/.test(t)){t='calc('+t+')'};return t},unwrapStringInCalc:function(t){var e=t.match(/calc\((.+)\)/);return e?e[1].trim():t}};function decrypt(t,e){var i=t.split(' '),l=parseInt(i[0]),o=cryptoHelpers.toNumbers(i[1]),a=cryptoHelpers.toNumbers(i[2]),s=cryptoHelpers.toNumbers(bin2hex(e)),r=slowAES.decrypt(a,slowAES.modeOfOperation.CBC,s,o),n=hex2bin(cryptoHelpers.toHex(r));n=cryptoHelpers.decode_utf8(n);return n};function encrypt(t,e){t=cryptoHelpers.encode_utf8(t);var n=cryptoHelpers.convertStringToByteArray(t),o=cryptoHelpers.toNumbers(bin2hex(e)),i=cryptoHelpers.generateSharedKey(16),a=slowAES.encrypt(n,slowAES.modeOfOperation.CBC,o,i),s=t.length+' '+cryptoHelpers.toHex(i)+' '+cryptoHelpers.toHex(a);return s};function bin2hex(t){var e,i=0,n=[];t+='';i=t.length;for(e=0;e<i;e++){n[e]=t.charCodeAt(e).toString(16).replace(/^([\da-f])$/,'0$1')};return n.join('')};function hex2bin(t){var i='';for(var e=0;e<t.length;e+=2)i+=String.fromCharCode(parseInt(t.substr(e,2),16));return i};function fixedEncodeURI(t){return encodeURI(t).replace(/[!'()*]/g,function(t){return'%'+t.charCodeAt(0).toString(16)})};var cryptoHelpers={encode_utf8:function(t){try{return unescape(encodeURIComponent(t))}catch(e){throw'error during utf8 encoding: cryptoHelpers.encode_utf8.'}},decode_utf8:function(t){try{return decodeURIComponent(escape(t))}catch(e){throw('error during utf8 decoding: cryptoHelpers.decode_utf8.')}},toHex:function(){var t=[];if(arguments.length==1&&arguments[0].constructor==Array)t=arguments[0];else t=arguments;var i='';for(var e=0;e<t.length;e++)i+=(t[e]<16?'0':'')+t[e].toString(16);return i.toLowerCase()},toNumbers:function(t){var e=[];t.replace(/(..)/g,function(t){e.push(parseInt(t,16))});return e},getRandom:function(t,e){if(t===null)t=0;if(e===null)e=1;return Math.floor(Math.random()*(e+1))+t},generateSharedKey:function(t){if(t===null)t=16;var i=[];for(var e=0;e<t*2;e++)i.push(this.getRandom(0,255));return i},generatePrivateKey:function(t,e){var i=jsHash.sha2.arr_sha256(t);return i.slice(0,e)},convertStringToByteArray:function(t){var i=[];for(var e=0;e<t.length;e++){i.push(t.charCodeAt(e))};return i},convertByteArrayToString:function(t){var i='';for(var e=0;e<t.length;e++){i+=String.fromCharCode(t[e])};return i},base64:{chars:['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/','=',],encode_line:function(t){var i='';for(var e=0;e<t.length;e+=3){i+=this.chars[t[e]>>2];i+=this.chars[((t[e]&3)<<4)|(t[e+1]>>4)];if(!(t[e+1]==null)){i+=this.chars[((t[e+1]&15)<<2)|(t[e+2]>>6)]}
else{i+='='};if(!(t[e+2]==null)){i+=this.chars[t[e+2]&63]}
else{i+='='}};return i},encode:function(t){var i=this.encode_line(t),n=i.slice(0,64)+'\n';for(var e=1;e<(Math.ceil(i.length/64));e++){n+=i.slice(e*64,e*64+64)+(Math.ceil(i.length/64)==e+1?'':'\n')};return n},decode:function(t){t=t.replace(/[\r\n\t ]+/g,'')+'====';var n=[],e=[],o=[];for(var i=0;;i=i+4){e[0]=this.chars.indexOf(t.charAt(i));if(e[0]==64){return n};e[1]=this.chars.indexOf(t.charAt(i+1));e[2]=this.chars.indexOf(t.charAt(i+2));e[3]=this.chars.indexOf(t.charAt(i+3));if((e[0]<0)||(e[1]<0)||(e[1]==64)||(e[2]<0)||(e[3]<0)){throw'error during base64 decoding at pos '+i+': cryptoHelpers.base64.decode.'};n.push((e[0]<<2)|(e[1]>>4));if(e[2]>=0&&e[2]<64){n.push(((e[1]&15)<<4)|(e[2]>>2));if(e[3]>=0&&e[2]<64){n.push(((e[2]&3)<<6)|e[3])}}}},},};var slowAES={aes:{keySize:{SIZE_128:16,SIZE_192:24,SIZE_256:32},sbox:[0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76,0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0,0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15,0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a,0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75,0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0,0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84,0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b,0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf,0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85,0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8,0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5,0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2,0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17,0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73,0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88,0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb,0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c,0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79,0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9,0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08,0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6,0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a,0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e,0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e,0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94,0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf,0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16],rsbox:[0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38,0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb,0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87,0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb,0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d,0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e,0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2,0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25,0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16,0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92,0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda,0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84,0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a,0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06,0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02,0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b,0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea,0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73,0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85,0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e,0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89,0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b,0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20,0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4,0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31,0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f,0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d,0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef,0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0,0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61,0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26,0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d],rotate:function(t){var i=t[0];for(var e=0;e<3;e++)t[e]=t[e+1];t[3]=i;return t},Rcon:[0x8d,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36,0x6c,0xd8,0xab,0x4d,0x9a,0x2f,0x5e,0xbc,0x63,0xc6,0x97,0x35,0x6a,0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91,0x39,0x72,0xe4,0xd3,0xbd,0x61,0xc2,0x9f,0x25,0x4a,0x94,0x33,0x66,0xcc,0x83,0x1d,0x3a,0x74,0xe8,0xcb,0x8d,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36,0x6c,0xd8,0xab,0x4d,0x9a,0x2f,0x5e,0xbc,0x63,0xc6,0x97,0x35,0x6a,0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91,0x39,0x72,0xe4,0xd3,0xbd,0x61,0xc2,0x9f,0x25,0x4a,0x94,0x33,0x66,0xcc,0x83,0x1d,0x3a,0x74,0xe8,0xcb,0x8d,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36,0x6c,0xd8,0xab,0x4d,0x9a,0x2f,0x5e,0xbc,0x63,0xc6,0x97,0x35,0x6a,0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91,0x39,0x72,0xe4,0xd3,0xbd,0x61,0xc2,0x9f,0x25,0x4a,0x94,0x33,0x66,0xcc,0x83,0x1d,0x3a,0x74,0xe8,0xcb,0x8d,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36,0x6c,0xd8,0xab,0x4d,0x9a,0x2f,0x5e,0xbc,0x63,0xc6,0x97,0x35,0x6a,0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91,0x39,0x72,0xe4,0xd3,0xbd,0x61,0xc2,0x9f,0x25,0x4a,0x94,0x33,0x66,0xcc,0x83,0x1d,0x3a,0x74,0xe8,0xcb,0x8d,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1b,0x36,0x6c,0xd8,0xab,0x4d,0x9a,0x2f,0x5e,0xbc,0x63,0xc6,0x97,0x35,0x6a,0xd4,0xb3,0x7d,0xfa,0xef,0xc5,0x91,0x39,0x72,0xe4,0xd3,0xbd,0x61,0xc2,0x9f,0x25,0x4a,0x94,0x33,0x66,0xcc,0x83,0x1d,0x3a,0x74,0xe8,0xcb],G2X:[0x00,0x02,0x04,0x06,0x08,0x0a,0x0c,0x0e,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38,0x3a,0x3c,0x3e,0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4e,0x50,0x52,0x54,0x56,0x58,0x5a,0x5c,0x5e,0x60,0x62,0x64,0x66,0x68,0x6a,0x6c,0x6e,0x70,0x72,0x74,0x76,0x78,0x7a,0x7c,0x7e,0x80,0x82,0x84,0x86,0x88,0x8a,0x8c,0x8e,0x90,0x92,0x94,0x96,0x98,0x9a,0x9c,0x9e,0xa0,0xa2,0xa4,0xa6,0xa8,0xaa,0xac,0xae,0xb0,0xb2,0xb4,0xb6,0xb8,0xba,0xbc,0xbe,0xc0,0xc2,0xc4,0xc6,0xc8,0xca,0xcc,0xce,0xd0,0xd2,0xd4,0xd6,0xd8,0xda,0xdc,0xde,0xe0,0xe2,0xe4,0xe6,0xe8,0xea,0xec,0xee,0xf0,0xf2,0xf4,0xf6,0xf8,0xfa,0xfc,0xfe,0x1b,0x19,0x1f,0x1d,0x13,0x11,0x17,0x15,0x0b,0x09,0x0f,0x0d,0x03,0x01,0x07,0x05,0x3b,0x39,0x3f,0x3d,0x33,0x31,0x37,0x35,0x2b,0x29,0x2f,0x2d,0x23,0x21,0x27,0x25,0x5b,0x59,0x5f,0x5d,0x53,0x51,0x57,0x55,0x4b,0x49,0x4f,0x4d,0x43,0x41,0x47,0x45,0x7b,0x79,0x7f,0x7d,0x73,0x71,0x77,0x75,0x6b,0x69,0x6f,0x6d,0x63,0x61,0x67,0x65,0x9b,0x99,0x9f,0x9d,0x93,0x91,0x97,0x95,0x8b,0x89,0x8f,0x8d,0x83,0x81,0x87,0x85,0xbb,0xb9,0xbf,0xbd,0xb3,0xb1,0xb7,0xb5,0xab,0xa9,0xaf,0xad,0xa3,0xa1,0xa7,0xa5,0xdb,0xd9,0xdf,0xdd,0xd3,0xd1,0xd7,0xd5,0xcb,0xc9,0xcf,0xcd,0xc3,0xc1,0xc7,0xc5,0xfb,0xf9,0xff,0xfd,0xf3,0xf1,0xf7,0xf5,0xeb,0xe9,0xef,0xed,0xe3,0xe1,0xe7,0xe5],G3X:[0x00,0x03,0x06,0x05,0x0c,0x0f,0x0a,0x09,0x18,0x1b,0x1e,0x1d,0x14,0x17,0x12,0x11,0x30,0x33,0x36,0x35,0x3c,0x3f,0x3a,0x39,0x28,0x2b,0x2e,0x2d,0x24,0x27,0x22,0x21,0x60,0x63,0x66,0x65,0x6c,0x6f,0x6a,0x69,0x78,0x7b,0x7e,0x7d,0x74,0x77,0x72,0x71,0x50,0x53,0x56,0x55,0x5c,0x5f,0x5a,0x59,0x48,0x4b,0x4e,0x4d,0x44,0x47,0x42,0x41,0xc0,0xc3,0xc6,0xc5,0xcc,0xcf,0xca,0xc9,0xd8,0xdb,0xde,0xdd,0xd4,0xd7,0xd2,0xd1,0xf0,0xf3,0xf6,0xf5,0xfc,0xff,0xfa,0xf9,0xe8,0xeb,0xee,0xed,0xe4,0xe7,0xe2,0xe1,0xa0,0xa3,0xa6,0xa5,0xac,0xaf,0xaa,0xa9,0xb8,0xbb,0xbe,0xbd,0xb4,0xb7,0xb2,0xb1,0x90,0x93,0x96,0x95,0x9c,0x9f,0x9a,0x99,0x88,0x8b,0x8e,0x8d,0x84,0x87,0x82,0x81,0x9b,0x98,0x9d,0x9e,0x97,0x94,0x91,0x92,0x83,0x80,0x85,0x86,0x8f,0x8c,0x89,0x8a,0xab,0xa8,0xad,0xae,0xa7,0xa4,0xa1,0xa2,0xb3,0xb0,0xb5,0xb6,0xbf,0xbc,0xb9,0xba,0xfb,0xf8,0xfd,0xfe,0xf7,0xf4,0xf1,0xf2,0xe3,0xe0,0xe5,0xe6,0xef,0xec,0xe9,0xea,0xcb,0xc8,0xcd,0xce,0xc7,0xc4,0xc1,0xc2,0xd3,0xd0,0xd5,0xd6,0xdf,0xdc,0xd9,0xda,0x5b,0x58,0x5d,0x5e,0x57,0x54,0x51,0x52,0x43,0x40,0x45,0x46,0x4f,0x4c,0x49,0x4a,0x6b,0x68,0x6d,0x6e,0x67,0x64,0x61,0x62,0x73,0x70,0x75,0x76,0x7f,0x7c,0x79,0x7a,0x3b,0x38,0x3d,0x3e,0x37,0x34,0x31,0x32,0x23,0x20,0x25,0x26,0x2f,0x2c,0x29,0x2a,0x0b,0x08,0x0d,0x0e,0x07,0x04,0x01,0x02,0x13,0x10,0x15,0x16,0x1f,0x1c,0x19,0x1a],G9X:[0x00,0x09,0x12,0x1b,0x24,0x2d,0x36,0x3f,0x48,0x41,0x5a,0x53,0x6c,0x65,0x7e,0x77,0x90,0x99,0x82,0x8b,0xb4,0xbd,0xa6,0xaf,0xd8,0xd1,0xca,0xc3,0xfc,0xf5,0xee,0xe7,0x3b,0x32,0x29,0x20,0x1f,0x16,0x0d,0x04,0x73,0x7a,0x61,0x68,0x57,0x5e,0x45,0x4c,0xab,0xa2,0xb9,0xb0,0x8f,0x86,0x9d,0x94,0xe3,0xea,0xf1,0xf8,0xc7,0xce,0xd5,0xdc,0x76,0x7f,0x64,0x6d,0x52,0x5b,0x40,0x49,0x3e,0x37,0x2c,0x25,0x1a,0x13,0x08,0x01,0xe6,0xef,0xf4,0xfd,0xc2,0xcb,0xd0,0xd9,0xae,0xa7,0xbc,0xb5,0x8a,0x83,0x98,0x91,0x4d,0x44,0x5f,0x56,0x69,0x60,0x7b,0x72,0x05,0x0c,0x17,0x1e,0x21,0x28,0x33,0x3a,0xdd,0xd4,0xcf,0xc6,0xf9,0xf0,0xeb,0xe2,0x95,0x9c,0x87,0x8e,0xb1,0xb8,0xa3,0xaa,0xec,0xe5,0xfe,0xf7,0xc8,0xc1,0xda,0xd3,0xa4,0xad,0xb6,0xbf,0x80,0x89,0x92,0x9b,0x7c,0x75,0x6e,0x67,0x58,0x51,0x4a,0x43,0x34,0x3d,0x26,0x2f,0x10,0x19,0x02,0x0b,0xd7,0xde,0xc5,0xcc,0xf3,0xfa,0xe1,0xe8,0x9f,0x96,0x8d,0x84,0xbb,0xb2,0xa9,0xa0,0x47,0x4e,0x55,0x5c,0x63,0x6a,0x71,0x78,0x0f,0x06,0x1d,0x14,0x2b,0x22,0x39,0x30,0x9a,0x93,0x88,0x81,0xbe,0xb7,0xac,0xa5,0xd2,0xdb,0xc0,0xc9,0xf6,0xff,0xe4,0xed,0x0a,0x03,0x18,0x11,0x2e,0x27,0x3c,0x35,0x42,0x4b,0x50,0x59,0x66,0x6f,0x74,0x7d,0xa1,0xa8,0xb3,0xba,0x85,0x8c,0x97,0x9e,0xe9,0xe0,0xfb,0xf2,0xcd,0xc4,0xdf,0xd6,0x31,0x38,0x23,0x2a,0x15,0x1c,0x07,0x0e,0x79,0x70,0x6b,0x62,0x5d,0x54,0x4f,0x46],GBX:[0x00,0x0b,0x16,0x1d,0x2c,0x27,0x3a,0x31,0x58,0x53,0x4e,0x45,0x74,0x7f,0x62,0x69,0xb0,0xbb,0xa6,0xad,0x9c,0x97,0x8a,0x81,0xe8,0xe3,0xfe,0xf5,0xc4,0xcf,0xd2,0xd9,0x7b,0x70,0x6d,0x66,0x57,0x5c,0x41,0x4a,0x23,0x28,0x35,0x3e,0x0f,0x04,0x19,0x12,0xcb,0xc0,0xdd,0xd6,0xe7,0xec,0xf1,0xfa,0x93,0x98,0x85,0x8e,0xbf,0xb4,0xa9,0xa2,0xf6,0xfd,0xe0,0xeb,0xda,0xd1,0xcc,0xc7,0xae,0xa5,0xb8,0xb3,0x82,0x89,0x94,0x9f,0x46,0x4d,0x50,0x5b,0x6a,0x61,0x7c,0x77,0x1e,0x15,0x08,0x03,0x32,0x39,0x24,0x2f,0x8d,0x86,0x9b,0x90,0xa1,0xaa,0xb7,0xbc,0xd5,0xde,0xc3,0xc8,0xf9,0xf2,0xef,0xe4,0x3d,0x36,0x2b,0x20,0x11,0x1a,0x07,0x0c,0x65,0x6e,0x73,0x78,0x49,0x42,0x5f,0x54,0xf7,0xfc,0xe1,0xea,0xdb,0xd0,0xcd,0xc6,0xaf,0xa4,0xb9,0xb2,0x83,0x88,0x95,0x9e,0x47,0x4c,0x51,0x5a,0x6b,0x60,0x7d,0x76,0x1f,0x14,0x09,0x02,0x33,0x38,0x25,0x2e,0x8c,0x87,0x9a,0x91,0xa0,0xab,0xb6,0xbd,0xd4,0xdf,0xc2,0xc9,0xf8,0xf3,0xee,0xe5,0x3c,0x37,0x2a,0x21,0x10,0x1b,0x06,0x0d,0x64,0x6f,0x72,0x79,0x48,0x43,0x5e,0x55,0x01,0x0a,0x17,0x1c,0x2d,0x26,0x3b,0x30,0x59,0x52,0x4f,0x44,0x75,0x7e,0x63,0x68,0xb1,0xba,0xa7,0xac,0x9d,0x96,0x8b,0x80,0xe9,0xe2,0xff,0xf4,0xc5,0xce,0xd3,0xd8,0x7a,0x71,0x6c,0x67,0x56,0x5d,0x40,0x4b,0x22,0x29,0x34,0x3f,0x0e,0x05,0x18,0x13,0xca,0xc1,0xdc,0xd7,0xe6,0xed,0xf0,0xfb,0x92,0x99,0x84,0x8f,0xbe,0xb5,0xa8,0xa3],GDX:[0x00,0x0d,0x1a,0x17,0x34,0x39,0x2e,0x23,0x68,0x65,0x72,0x7f,0x5c,0x51,0x46,0x4b,0xd0,0xdd,0xca,0xc7,0xe4,0xe9,0xfe,0xf3,0xb8,0xb5,0xa2,0xaf,0x8c,0x81,0x96,0x9b,0xbb,0xb6,0xa1,0xac,0x8f,0x82,0x95,0x98,0xd3,0xde,0xc9,0xc4,0xe7,0xea,0xfd,0xf0,0x6b,0x66,0x71,0x7c,0x5f,0x52,0x45,0x48,0x03,0x0e,0x19,0x14,0x37,0x3a,0x2d,0x20,0x6d,0x60,0x77,0x7a,0x59,0x54,0x43,0x4e,0x05,0x08,0x1f,0x12,0x31,0x3c,0x2b,0x26,0xbd,0xb0,0xa7,0xaa,0x89,0x84,0x93,0x9e,0xd5,0xd8,0xcf,0xc2,0xe1,0xec,0xfb,0xf6,0xd6,0xdb,0xcc,0xc1,0xe2,0xef,0xf8,0xf5,0xbe,0xb3,0xa4,0xa9,0x8a,0x87,0x90,0x9d,0x06,0x0b,0x1c,0x11,0x32,0x3f,0x28,0x25,0x6e,0x63,0x74,0x79,0x5a,0x57,0x40,0x4d,0xda,0xd7,0xc0,0xcd,0xee,0xe3,0xf4,0xf9,0xb2,0xbf,0xa8,0xa5,0x86,0x8b,0x9c,0x91,0x0a,0x07,0x10,0x1d,0x3e,0x33,0x24,0x29,0x62,0x6f,0x78,0x75,0x56,0x5b,0x4c,0x41,0x61,0x6c,0x7b,0x76,0x55,0x58,0x4f,0x42,0x09,0x04,0x13,0x1e,0x3d,0x30,0x27,0x2a,0xb1,0xbc,0xab,0xa6,0x85,0x88,0x9f,0x92,0xd9,0xd4,0xc3,0xce,0xed,0xe0,0xf7,0xfa,0xb7,0xba,0xad,0xa0,0x83,0x8e,0x99,0x94,0xdf,0xd2,0xc5,0xc8,0xeb,0xe6,0xf1,0xfc,0x67,0x6a,0x7d,0x70,0x53,0x5e,0x49,0x44,0x0f,0x02,0x15,0x18,0x3b,0x36,0x21,0x2c,0x0c,0x01,0x16,0x1b,0x38,0x35,0x22,0x2f,0x64,0x69,0x7e,0x73,0x50,0x5d,0x4a,0x47,0xdc,0xd1,0xc6,0xcb,0xe8,0xe5,0xf2,0xff,0xb4,0xb9,0xae,0xa3,0x80,0x8d,0x9a,0x97],GEX:[0x00,0x0e,0x1c,0x12,0x38,0x36,0x24,0x2a,0x70,0x7e,0x6c,0x62,0x48,0x46,0x54,0x5a,0xe0,0xee,0xfc,0xf2,0xd8,0xd6,0xc4,0xca,0x90,0x9e,0x8c,0x82,0xa8,0xa6,0xb4,0xba,0xdb,0xd5,0xc7,0xc9,0xe3,0xed,0xff,0xf1,0xab,0xa5,0xb7,0xb9,0x93,0x9d,0x8f,0x81,0x3b,0x35,0x27,0x29,0x03,0x0d,0x1f,0x11,0x4b,0x45,0x57,0x59,0x73,0x7d,0x6f,0x61,0xad,0xa3,0xb1,0xbf,0x95,0x9b,0x89,0x87,0xdd,0xd3,0xc1,0xcf,0xe5,0xeb,0xf9,0xf7,0x4d,0x43,0x51,0x5f,0x75,0x7b,0x69,0x67,0x3d,0x33,0x21,0x2f,0x05,0x0b,0x19,0x17,0x76,0x78,0x6a,0x64,0x4e,0x40,0x52,0x5c,0x06,0x08,0x1a,0x14,0x3e,0x30,0x22,0x2c,0x96,0x98,0x8a,0x84,0xae,0xa0,0xb2,0xbc,0xe6,0xe8,0xfa,0xf4,0xde,0xd0,0xc2,0xcc,0x41,0x4f,0x5d,0x53,0x79,0x77,0x65,0x6b,0x31,0x3f,0x2d,0x23,0x09,0x07,0x15,0x1b,0xa1,0xaf,0xbd,0xb3,0x99,0x97,0x85,0x8b,0xd1,0xdf,0xcd,0xc3,0xe9,0xe7,0xf5,0xfb,0x9a,0x94,0x86,0x88,0xa2,0xac,0xbe,0xb0,0xea,0xe4,0xf6,0xf8,0xd2,0xdc,0xce,0xc0,0x7a,0x74,0x66,0x68,0x42,0x4c,0x5e,0x50,0x0a,0x04,0x16,0x18,0x32,0x3c,0x2e,0x20,0xec,0xe2,0xf0,0xfe,0xd4,0xda,0xc8,0xc6,0x9c,0x92,0x80,0x8e,0xa4,0xaa,0xb8,0xb6,0x0c,0x02,0x10,0x1e,0x34,0x3a,0x28,0x26,0x7c,0x72,0x60,0x6e,0x44,0x4a,0x58,0x56,0x37,0x39,0x2b,0x25,0x0f,0x01,0x13,0x1d,0x47,0x49,0x5b,0x55,0x7f,0x71,0x63,0x6d,0xd7,0xd9,0xcb,0xc5,0xef,0xe1,0xf3,0xfd,0xa7,0xa9,0xbb,0xb5,0x9f,0x91,0x83,0x8d],core:function(t,e){t=this.rotate(t);for(var i=0;i<4;++i)t[i]=this.sbox[t[i]];t[0]=t[0]^this.Rcon[e];return t},expandKey:function(t,e){var h=(16*(this.numberOfRounds(e)+1)),i=0,c=1,n=[],o=[];for(var d=0;d<h;d++)o[d]=0;for(var r=0;r<e;r++)o[r]=t[r];i+=e;while(i<h){for(var s=0;s<4;s++)n[s]=o[(i-4)+s];if(i%e==0)n=this.core(n,c++);if(e==this.keySize.SIZE_256&&((i%e)==16))for(var a=0;a<4;a++)n[a]=this.sbox[n[a]];for(var l=0;l<4;l++){o[i]=o[i-e]^n[l];i++}};return o},addRoundKey:function(t,e){for(var i=0;i<16;i++)t[i]^=e[i];return t},createRoundKey:function(t,e){var o=[];for(var n=0;n<4;n++)for(var i=0;i<4;i++)o[i*4+n]=t[e+n*4+i];return o},subBytes:function(t,e){for(var i=0;i<16;i++)t[i]=e?this.rsbox[t[i]]:this.sbox[t[i]];return t},shiftRows:function(t,e){for(var i=0;i<4;i++)t=this.shiftRow(t,i*4,i,e);return t},shiftRow:function(t,e,i,n){for(var s=0;s<i;s++){if(n){var a=t[e+3];for(var o=3;o>0;o--)t[e+o]=t[e+o-1];t[e]=a}
else{var a=t[e];for(var o=0;o<3;o++)t[e+o]=t[e+o+1];t[e+3]=a}};return t},galois_multiplication:function(t,e){var i=0;for(var n=0;n<8;n++){if((e&1)==1)i^=t;if(i>0x100)i^=0x100;var o=(t&0x80);t<<=1;if(t>0x100)t^=0x100;if(o==0x80)t^=0x1b;if(t>0x100)t^=0x100;e>>=1;if(e>0x100)e^=0x100};return i},mixColumns:function(t,e){var a=[];for(var o=0;o<4;o++){for(var n=0;n<4;n++)a[n]=t[(n*4)+o];a=this.mixColumn(a,e);for(var i=0;i<4;i++)t[(i*4)+o]=a[i]};return t},mixColumn:function(t,e){var i=[];if(e)i=[14,9,13,11];else i=[2,1,1,3];var n=[];for(var o=0;o<4;o++)n[o]=t[o];t[0]=this.galois_multiplication(n[0],i[0])^this.galois_multiplication(n[3],i[1])^this.galois_multiplication(n[2],i[2])^this.galois_multiplication(n[1],i[3]);t[1]=this.galois_multiplication(n[1],i[0])^this.galois_multiplication(n[0],i[1])^this.galois_multiplication(n[3],i[2])^this.galois_multiplication(n[2],i[3]);t[2]=this.galois_multiplication(n[2],i[0])^this.galois_multiplication(n[1],i[1])^this.galois_multiplication(n[0],i[2])^this.galois_multiplication(n[3],i[3]);t[3]=this.galois_multiplication(n[3],i[0])^this.galois_multiplication(n[2],i[1])^this.galois_multiplication(n[1],i[2])^this.galois_multiplication(n[0],i[3]);return t},round:function(t,e){t=this.subBytes(t,!1);t=this.shiftRows(t,!1);t=this.mixColumns(t,!1);t=this.addRoundKey(t,e);return t},invRound:function(t,e){t=this.shiftRows(t,!0);t=this.subBytes(t,!0);t=this.addRoundKey(t,e);t=this.mixColumns(t,!0);return t},main:function(t,e,i){t=this.addRoundKey(t,this.createRoundKey(e,0));for(var n=1;n<i;n++)t=this.round(t,this.createRoundKey(e,16*n));t=this.subBytes(t,!1);t=this.shiftRows(t,!1);t=this.addRoundKey(t,this.createRoundKey(e,16*i));return t},invMain:function(t,e,i){t=this.addRoundKey(t,this.createRoundKey(e,16*i));for(var n=i-1;n>0;n--)t=this.invRound(t,this.createRoundKey(e,16*n));t=this.shiftRows(t,!0);t=this.subBytes(t,!0);t=this.addRoundKey(t,this.createRoundKey(e,0));return t},numberOfRounds:function(t){var e;switch(t){case this.keySize.SIZE_128:e=10;break;case this.keySize.SIZE_192:e=12;break;case this.keySize.SIZE_256:e=14;break;default:return null;break};return e},encrypt:function(t,e,i){var l=[],r=[],h=this.numberOfRounds(i);for(var s=0;s<4;s++)for(var a=0;a<4;a++)r[(s+(a*4))]=t[(s*4)+a];var d=this.expandKey(e,i);r=this.main(r,d,h);for(var o=0;o<4;o++)for(var n=0;n<4;n++)l[(o*4)+n]=r[(o+(n*4))];return l},decrypt:function(t,e,i){var l=[],r=[],h=this.numberOfRounds(i);for(var s=0;s<4;s++)for(var a=0;a<4;a++)r[(s+(a*4))]=t[(s*4)+a];var d=this.expandKey(e,i);r=this.invMain(r,d,h);for(var o=0;o<4;o++)for(var n=0;n<4;n++)l[(o*4)+n]=r[(o+(n*4))];return l}},modeOfOperation:{OFB:0,CFB:1,CBC:2},getBlock:function(t,e,i,n){if(i-e>16)i=e+16;return t.slice(e,i)},encrypt:function(t,e,i,n){var c=i.length;if(n.length%16){throw'iv length must be 128 bits.'};var p=[],l=[],r=[],s=[],u=[],d=!0;if(e==this.modeOfOperation.CBC)this.padBytesIn(t);if(t!==null){for(var h=0;h<Math.ceil(t.length/16);h++){var g=h*16,f=h*16+16;if(h*16+16>t.length)f=t.length;p=this.getBlock(t,g,f,e);if(e==this.modeOfOperation.CFB){if(d){r=this.aes.encrypt(n,i,c);d=!1}
else r=this.aes.encrypt(l,i,c);for(var o=0;o<16;o++)s[o]=p[o]^r[o];for(var a=0;a<f-g;a++)u.push(s[a]);l=s}
else if(e==this.modeOfOperation.OFB){if(d){r=this.aes.encrypt(n,i,c);d=!1}
else r=this.aes.encrypt(l,i,c);for(var o=0;o<16;o++)s[o]=p[o]^r[o];for(var a=0;a<f-g;a++)u.push(s[a]);l=r}
else if(e==this.modeOfOperation.CBC){for(var o=0;o<16;o++)l[o]=p[o]^((d)?n[o]:s[o]);d=!1;s=this.aes.encrypt(l,i,c);for(var a=0;a<16;a++)u.push(s[a])}}};return u},decrypt:function(t,e,n,o){var u=n.length;if(o.length%16){throw'iv length must be 128 bits.'};var r=[],l=[],s=[],d=[],p=[],h=!0;if(t!==null){for(var f=0;f<Math.ceil(t.length/16);f++){var g=f*16,c=f*16+16;if(f*16+16>t.length)c=t.length;r=this.getBlock(t,g,c,e);if(e==this.modeOfOperation.CFB){if(h){s=this.aes.encrypt(o,n,u);h=!1}
else s=this.aes.encrypt(l,n,u);for(i=0;i<16;i++)d[i]=s[i]^r[i];for(var a=0;a<c-g;a++)p.push(d[a]);l=r}
else if(e==this.modeOfOperation.OFB){if(h){s=this.aes.encrypt(o,n,u);h=!1}
else s=this.aes.encrypt(l,n,u);for(i=0;i<16;i++)d[i]=s[i]^r[i];for(var a=0;a<c-g;a++)p.push(d[a]);l=s}
else if(e==this.modeOfOperation.CBC){s=this.aes.decrypt(r,n,u);for(i=0;i<16;i++)d[i]=((h)?o[i]:l[i])^s[i];h=!1;for(var a=0;a<c-g;a++)p.push(d[a]);l=r}};if(e==this.modeOfOperation.CBC)this.unpadBytesOut(p)};return p},padBytesIn:function(t){var n=t.length,i=16-(n%16);for(var e=0;e<i;e++){t.push(i)}},unpadBytesOut:function(t){var e=0,n=-1,o=16;for(var i=t.length-1;i>=t.length-1-o;i--){if(t[i]<=o){if(n==-1)n=t[i];if(t[i]!=n){e=0;break};e++}
else break;if(e==n)break};if(e>0)t.splice(t.length-e,e)}};bm.type={isString:function(t){return Object.prototype.toString.call(t)==='[object String]'},isArray:function(t){return Object.prototype.toString.call(t)==='[object Array]'},isObject:function(t){return Object.prototype.toString.call(t)==='[object Object]'},isFunction:function(t){return Object.prototype.toString.call(t)==='[object Function]'}};bm.number={increaseStatus:!1,isHex:function(t){if(typeof(t)!=='string'){console.warn('문자열이 아닙니다.');return};if(t.includes('#')){t=t.replaceAll('#','')};if(/^[0-9A-F]{6}$/i.test(t)===!0)return!0;else return!1},rgbToHex:function(t){function e(t,e){if(t.indexOf(e)===-1)return!0;else return!1};if(!t||e(t,'(')||e(t,')')||e(t,','))return t;else t=t.split('(')[1].split(')')[0];t=t.split(',');return'#'+this.hex(t[0])+this.hex(t[1])+this.hex(t[2])},rgbaToObj:function(t){if(this.isHex(t)===!0){return this.hexToRgb(t)};t=t.slice(t.indexOf('(')+1,t.lastIndexOf(')'));var e=t.split(','),i={r:$.trim(e[0]),g:$.trim(e[1]),b:$.trim(e[2]),a:e.length==4?$.trim(e[3]):1};return i},rgbaObjToStr:function(t){if(typeof(t)==='string'||!t)return t;return'rgba('+t.r+', '+t.g+', '+t.b+', '+(t['a']!==undefined?t['a']:1)+')'},hex:function(t){var e=parseInt(t).toString(16);if(e=='NaN')e='00';return e.length==1?'0'+e:e},hexToRgb:function(t){if(typeof(t)==='object')return t;if(typeof(t)==='string'&&t.includes('rgb')){return this.rgbaToObj(t)};t='#'+t.replaceAll('#','');var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16),a:1}:null},increseAnimate:function(t,e,i,n,o){var r=this,l=e*1000,s=$(t),a={var:0};s.html(0);TweenMax.to(a,e,{var:i,onUpdate:function(){if(i==539)$(t).text(a.var.toFixed(0));else if(n==!0)$(t).text(a.var.toFixed(1));else $(t).text(Math.ceil(a.var))},onComplete:function(){if(o!=null){o()}}})}};bm.array={spliceList:function(t,e){var o=t.length,n=[];for(var i=0;i<o;i++){if(e.indexOf(t[i])==-1)n.push(t[i])};return n},insertAt:function(t,e,i){if(!t[e]){t[e]=i}
else{var o=t,a=o.length;t=[];for(var n=0;n<a;n++){if(n==e){t.push(i)};t.push(o[n])}};return t},getListDataByKeyAtList:function(t,e){var o=t.length,n=[];for(var i=0;i<o;i++){n.push(t[i][e])};return n},isSameValueList:function(t,e,i){if(t.length!=e.length)return!1;if(i!==!1){t.sort();e.sort()};var o=t.length,a=[];for(var n=0;n<o;n++){if(t[n]!==e[n])return!1};return!0},isExistKey:function(t,e,i){var o=t.length;for(var n=0;n<o;n++){if(t[n][i]&&t[n][i]==e)return!0};return!1},getDifferenceList:function(t,e){var a=[],r=t.length,o;for(var i=0;i<r;i++){o=!1;var s=e.length;for(var n=0;n<s;n++){if(t[i]==e[n]){o=!0;break}};if(o==!1){a.push(t[i])}};return a},getSameList:function(t,e){var a=[],r=t.length,o;for(var i=0;i<r;i++){o=!1;var s=e.length;for(var n=0;n<s;n++){if(t[i]==e[n]){o=!0;break}};if(o==!0){a.push(t[i])}};return a},getIndexList:function(t,e){var i=[];t.forEach(function(t,n){if(t==e)i.push(n)});return i}};bm.object={getObjAtKeyList:function(t,e){if(!e)return t;var n=e.split('.'),o=n.length;for(var i=0;i<o;i++){if(!t[n[i]]){return null};t=t[n[i]]};return t},isSame:function(t,e){var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;var n=Object.keys(t),a=n.length,s=0,i;for(var o=0;o<a;o++){var i=n[o];if((e[i]!==undefined)&&e[i]==t[i]){s++}};if(a==s){return!0}
else{return!1}},isExistKey:function(t,e){var n=e.split('.'),o=n.length;for(var i=0;i<o;i++){if(!t[n[i]]){return!1};t=t[n[i]]};return!0},insertWrapKey:function(t,e,i){var s=e.split('.'),r=s.length,n=t;if(e&&s.length>0){for(var a=0;a<r;a++){if(!t[s[a]]){return t};n=n[s[a]]}};if(Object.prototype.toString.call(n)==='[object Array]'){if(!n[i]){n[i]=[]}}
else{if(!n[i]){n[i]={}}};for(var o in n){if(o!=i){n[i][o]=n[o];delete n[o]}};return t},toKeyUpperCaseList:function(t){var i=t.length;for(var e=0;e<i;e++){t[e]=this.toKeyUpperCase(t[e])};return t},toKeyLowerCaseList:function(t){var i=t.length;for(var e=0;e<i;e++){t[e]=this.toKeyLowerCase(t[e])};return t},toKeyUpperCase:function(t){var e,i=Object.keys(t),n=i.length,o={};while(n--){e=i[n];o[e.toUpperCase()]=t[e]};return o},toKeyLowerCase:function(t){var e,i=Object.keys(t),n=i.length,o={};while(n--){e=i[n];o[e.toLowerCase()]=t[e]};return o},toCssString:function(t){var e='';$.each(t,function(t,i){e+=t.toString()+' : '+i.toString()+'; '});return e},convertArray:function(t){var e=[];for(key in t){e.push(t[key])};return e},deepCopy:function(t){return JSON.parse(JSON.stringify(t))},copy:function(t,e){if(!e)e={};return Object.assign(e,t)}};bm.formUtil={placeHolderList:{},__registPlaceHolder:function(t){var e=this;t.onfocus=function(){e.placeHolderList[this]=this.value;this.value=''};t.onblur=function(){if(this.value=='')this.value=e.placeHolderList[this]}},registPlaceHolder:function(t){if(t.length){var i=t.length;for(var e=0;e<i;e++){this.__registPlaceHolder(t[e])}}
else this.__registPlaceHolder(t)},reset:function(t){var e=['[type=\'button\']','[type=\'submit\']','[type=\'image\']','[type=\'radio\']','[type=\'checkbox\']','[data-wv-key=\'searchKey[]\']','[data-wv-key=\'searchKeyLike[]\']'],i=e.join();$(t).find('input').not(i).val('');$(t).find('input[type=radio], input[type=checkbox]').prop('checked',!1);$(t).find('select').val('');$(t).find('textarea').val('');$(t).find('[data-formrenderer-file] .download_file').hide();$(t).find('[data-formrenderer-file] .download_file').text('');$(t).find('[data-formrenderer-file] .download_file').attr('href','');$(t).find('[data-wv-nocheck-value]').not('input[type=checkbox]').each(function(){if($(this).attr('data-wv-nocheck-value')!==undefined){$(this).val($(this).attr('data-wv-nocheck-value'))}})},setDefaultValue:function(t){$(t).find('input[type=radio][data-wv-nocheck-value], input[type=checkbox][data-wv-nocheck-value]').prop('checked',!0);$(t).find('select option[data-wv-nocheck-value]').attr('selected','selected');$(t).find('input[type=checkbox][data-wv-nocheck-value]').each(function(){if(this.classList.value.includes('toggle')&&$(this).attr('data-wv-nocheck-value')!==undefined&&$(this).attr('data-wv-nocheck-value')==0){$(this).prop('checked',!1)}});$(t).find('[data-wv-nocheck-value]').not('input[type=checkbox]').each(function(){if($(this).attr('data-wv-nocheck-value')!==undefined){$(this).val($(this).attr('data-wv-nocheck-value'))}})}};bm.dmImg=function(t,e){if(t){return new Promise((resolve,reject)=>{const img=new Image();img.crossOrigin='Anonymous';img.onload=function(){const canvas=document.createElement('canvas');const ctx=canvas.getContext('2d');canvas.width=img.width;canvas.height=img.height;ctx.drawImage(img,0,0);const imageData=ctx.getImageData(0,0,canvas.width,canvas.height);const data=imageData.data;let r,g,b,avg;let colorSum=0;for(let i=0;i<data.length;i+=4){r=data[i];g=data[i+1];b=data[i+2];avg=(r+g+b)/3;colorSum+=avg};const brightness=colorSum/(img.width*img.height);const result=brightness>127.5?'white':'black';resolve(result)};img.src=t})};if(e){const bgColor=window.getComputedStyle(e).backgroundColor;if(bgColor.includes('rgb')){const rgb=bgColor.match(/\d+/g);if(rgb[3]*1<0.5){return'light'};const brightness=(0.299*rgb[0])+(0.587*rgb[1])+(0.114*rgb[2]);return brightness>=255/2?'light':'dark'};return'light'}};bm.cdn={setImageSelectPath:function(t,e,i){if(t.indexOf('/weven_data/')===0){t=(parent.IMAGE_URL2?parent.IMAGE_URL2:IMAGE_URL2)+t}
else{t=t.substring(0,t.indexOf('?'))};if(t.indexOf('/__thumb__/')>-1)t=t.replace('/__thumb__/','/');if(t.indexOf('?ver=')>-1){t=t.replace(t.slice(t.indexOf('?ver='),t.length),'')};if(t.indexOf('gif')>-1){t=t.replace('image.','cdn.');return t};var n='?type=w';if(e){if(e>=1920){n+='&w=1920'}
else if(e>=1440){n+='&w=1920'}
else if(e>=1280){n+='&w=1440'}
else if(e>=960){n+='&w=1280'}
else if(e>=768){n+='&w=960'}
else if(e>=480){n+='&w=768'}
else if(e>=320){n+='&w=480'}
else if(e>229){n+='&w=320'}
else if(e==229){n+='&w=229'}
else{t=this.setImageReplacePath(t)};n+='&quality=80'}
else{t=this.setImageReplacePath(t);n+='&quality=80'};t=t+n;if(e>=1440){t+='&ttype=jpg'};if(i){var o=i/1024/1024;if(o<0.3){t=t.replace('image.','cdn.')}};return t},setImageReplacePath:function(t){if(t.indexOf('image-studio.')>-1){t=t.replace('image-studio.','cdn.')}
else{t=t.replace('image.','cdn.')};return t}};bm.toast=function(t,e,i,n,o,a,s,r,l){if(!bm.appToast)bm.appToast=new bm.ToastClass();bm.appToast.show(t,e,i,n,o,a,s,r,l)};bm.ToastClass=function(){};bm.ToastClass.prototype={toastElementList:[],toastElementGCList:[],defaultInfo:{posH:'center',posV:'top',delay:2500,duration:600,type:'admin'},toastWrapEl:null,getToastWrapper:function(){if(this.toastWrapEl==null){this.toastWrapEl=$('<div id="toastWrap"></div>').appendTo('body')};return this.toastWrapEl},getToastBox:function(){var t;if(this.toastElementGCList.length>0){t=this.toastElementGCList.pop()}
else{var e='<div class="toast" style="opacity: 0; display: none;">';e+='<div class="title" style="display: none;"></div>';e+='<div class="content"></div></div>';t=$(e)};this.toastElementList.push(t);return t},show:function(t,e,i,n,o,a,s,l,h){var r={};r.posH=n||this.defaultInfo.posH;r.posV=o||this.defaultInfo.posV;r.delay=a||this.defaultInfo.delay;r.duration=s||this.defaultInfo.duration;r.top=l||this.defaultInfo.top;r.bgcolor=h||this.defaultInfo.bgcolor;r.type=i||this.defaultInfo.type;var c=this.getToastWrapper();if(r.posH=='center'){$(c).css('left','50%').css('transform','translateX(-50%)')}
else if(r.posH=='left'){$(c).css('left','30px').css('transform','translateX(0)')}
else if(r.posH=='right'){$(c).css('right','30px').css('left','auto').css('transform','translateX(0)')};if(r.posV=='bottom'){$(c).css('bottom','30px').css('top','auto')}
else{$(c).css('top','30px').css('bottom','auto')};var d=this.getToastBox();d.find('.toast').attr('class','toast '+r.type);if(r.posV=='bottom'){d.appendTo('#toastWrap')}
else{d.prependTo('#toastWrap')};if(r.top){$(c).css('top',r.top+'px')};if(r.bgcolor){$(d).css({backgroundColor:r.bgcolor})}
else{$(d).css({backgroundColor:''})};if(e&&e!=''){d.find('.title').show().text(e)}
else{d.find('.title').hide().text('')};d.find('.content').html(t);var f=this;f.remove(d);TweenMax.killTweensOf(d[0]);TweenMax.fromTo(d[0],r.duration/1000,{display:'block',opacity:0,top:0},{opacity:1,onComplete:function(t){TweenMax.to(d[0],r.duration/1000,{display:'none',top:0,opacity:0,delay:r.delay/1000,onComplete:function(t){f.remove(d)}})}})},remove:function(t){this.toastElementList.splice(this.toastElementList.indexOf(t),1);this.toastElementGCList.push(t)},clean:function(){var t=this.toastElementList.length;while(t--){this.toastElementGCList.push(this.toastElementList.pop())};this.toastElementList.length=0}};bm.appToast=null;bm.sns={isInit:!1,shareTypeList:['line','band','naver','facebook','twitter','email'],snsItemObj:{},init:function(){if(!this.isInit)this.setSnsInfo()},setSnsInfo:function(){for(var i=0;i<this.shareTypeList.length;i++){var t=this.shareTypeList[i],e=new bm.snsItem();switch(t){case'line':e.setSnsItemInfo('라인 공유하기',t);break;case'band':e.setSnsItemInfo('밴드 공유하기',t);break;case'naver':e.setSnsItemInfo('네이버 공유하기',t);break;case'facebook':e.setSnsItemInfo('페이스북 공유하기',t);break;case'twitter':e.setSnsItemInfo('트위터 공유하기',t);break;case'email':e.setSnsItemInfo('이메일 공유하기',t);break};this.snsItemObj[t]=e}},getSnsItem:function(t){return this.snsItemObj[t]},getSnsFn:function(t){return this.snsItemObj[t].shareFn},copyShareLink:function(t,e){if(t&&$(t).length>0){var i=$(t).val();e=e?e:'주소가 복사되었습니다.<br/>원하는 곳에 붙여넣기 해주세요.';bm.clipboard.copy(i);bm.toast(e)}}};bm.snsItem=function(){this.name='';this.type='';this.subject='';this.url='';this.shareFn=null};bm.snsItem.prototype={setSnsItemInfo:function(t,e){this.name=t;this.type=e;this.shareFn=this.getSnsFn(e)},setSubject:function(t){this.subject=t},getSubject:function(){return this.subject},setUrl:function(t){this.url=t},getUrl:function(){return this.url?this.url:location.href},getSnsFn:function(t){var e=this;switch(t){case'line':return function(){e.shareLine()};case'band':return function(){e.shareBand()};case'naver':return function(){e.shareNaver()};case'facebook':return function(){e.shareFacebook()};case'twitter':return function(){e.shareTwitter()};case'email':return function(){e.shareEmail()}}},shareLine:function(){window.open('https://social-plugins.line.me/lineit/share?text='+encodeURIComponent(this.getSubject()+'\n')+' '+encodeURIComponent(this.getUrl()))},shareBand:function(){var t=encodeURIComponent(this.getSubject()+'\n')+encodeURIComponent(this.getUrl());window.open('http://band.us/plugin/share?body='+t+'&route='+encodeURIComponent(this.getUrl()))},shareNaver:function(){window.open('http://share.naver.com/web/shareView.nhn?url='+encodeURI(encodeURIComponent(this.getUrl()))+'&title='+encodeURI(encodeURIComponent(this.getSubject())))},shareFacebook:function(){window.open('http://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(this.getUrl()))},shareTwitter:function(){window.open('https://twitter.com/intent/tweet?text='+encodeURIComponent(this.getSubject())+'&url='+encodeURIComponent(this.getUrl()))},shareEmail:function(){window.open('mailto:?subject='+encodeURIComponent(this.getSubject())+'&body='+encodeURIComponent(this.getUrl()))},shareKakaoTalk:function(){var e=$('.product_img').attr('style').replace(/^background-image: url\(['"](.+)['"]\)/,'$1'),t=location.href.indexOf('com')==-1?location.href:location.href.replace('com','biz');Kakao.cleanup();Kakao.init('65b2531d27aecd8c4ae4e79936343a8d');Kakao.Share.sendDefault({objectType:'feed',content:{title:this.subject,imageUrl:e,link:{mobileWebUrl:t,webUrl:t,},},buttons:[{title:'자세히 보기',link:{mobileWebUrl:t,webUrl:t,},},],})}};bm.extend=function(t,e){e.prototype=new t();e.prototype.constructor=e};bm.url=window.location.href;bm.__applicationUrl='';bm.__domain='';bm.__actionKey='';bm.getDomain=function(){if(this.__domain==''){var t=this.url;this.__domain=t.substring(0,t.indexOf('/',t.indexOf('/',t.indexOf('/')+1)+1)+1)};return this.__domain};bm.getApplicationUrl=function(){if(this.__applicationUrl==''){var t=this.url;if(t.indexOf('?')>0)t=t.slice(0,t.indexOf('?'));this.__applicationUrl=t.slice(0,t.lastIndexOf('/')+1)};return this.__applicationUrl};bm.getActionKey=function(){if(this.__actionKey==''){var t=this.url.length,i=this.url.indexOf('#');if(i!=-1&&i<t)t=i;var e=this.url.indexOf('?');if(e!=-1&&e<t)t=e;this.__actionKey=this.url.slice(this.getApplicationUrl().length,t);if(this.__actionKey==''&&this.url[t-1]=='/'&&this.url.lastIndexOf('/',this.url[t-1])>10){this.__actionKey=this.url.slice(this.url.lastIndexOf('/',t-2)+1,t-1)}};return this.__actionKey};bm.__params=null;bm.__getParams=function(t){var a={};var e,n=window.location.href,o=n.indexOf('?');if(o==-1){bm.__params={};return}
else{o=o+1};if(t){n=decodeURIComponent(n)};var s=n.slice(o).split('&'),r=s.length;for(var i=0;i<r;i++){e=s[i].split('=');a[e[0]]=e[1];if(i==r-1&&e.length>1&&e[1].indexOf('#')>-1)a[e[0]]=e[1].substring(0,e[1].indexOf('#'))};this.__params=a};bm.getParamList=function(){if(this.__params==null)this.__getParams();var t=$.extend({},this.__params);return t};bm.getParamListOnDecode=function(){if(this.__paramsOnDecode==null)this.__getParams(!0);return this.__params};bm.getQueryString=function(){if(this.__params==null)this.__getParams();return this.makeQueryString(this.__params)};bm.getParam=function(t){if(this.__params==null)this.__getParams();if(t){if(this.__params[t]&&this.__params[t].indexOf('#')==-1)return this.__params[t];else if(this.__params[t]&&this.__params[t].indexOf('#')!=-1){return this.__params[t].slice(0,this.__params[t].indexOf('#'))};return''}
else return this.__params};bm.makeQueryString=function(t,e){var n='';for(var i in t){if(t[i]instanceof Array){for(var o in t[i]){if(e){}
else{n+=i+'='+t[i][o]+'&'}}}
else{if(e){n+=i+'='+t[i]+'&'}
else{n+=i+'='+encodeURIComponent(t[i])+'&'}}};return n.substr(0,n.length-1)};bm.getObjectFromQueryString=function(t,e){var o,r;e=e?e:!1;o={};var l=t.split('&'),d=l.length,n={};var i,s;for(var a=0;a<d;a++){r=l[a].split('=');i=decodeURIComponent(r[0]);s=decodeURIComponent(r[1]);if(e==!1&&i.indexOf('[]')>-1){if(!n[i])n[i]=[];n[i].push(s)}
else{o[i]=s}};Object.assign(o,n);return o};bm.__fooInput=document.createElement('input');bm.clipboard={copy:function(t){bm.__fooInput.value=t;document.body.appendChild(bm.__fooInput);bm.__fooInput.select();bm.__fooInput.setSelectionRange(0,99999);document.execCommand('copy');document.body.removeChild(bm.__fooInput)}};bm.__foo=document.createElement('div');bm.html=function(t){this.__foo.innerHTML=t;var e=this.__foo.children[0].cloneNode(!0);this.__foo.removeChild(this.__foo.children[0]);return e};bm.addChild=function(t,e){e.insertBefore(t,e.childNodes[0])};bm.addChildAt=function(t,e,i){e.insertBefore(t,e.childNodes[i])};bm.dom={listInterpreter:function(t,e,i,n){var s=t.length;for(var o=0;o<s;o++){var a=$(this.convertVariables(t[o],e));this.checkAutoForm(t[o],a);if(a.length>0)a.appendTo(i).show()}},singleInterpreter:function(t,e,i,n,o){if(!e)return null;var a=$(this.convertVariables(t,e,o));if(a.length&&a.length>0){this.checkAutoForm(t,a);a.appendTo(i).show();if(o!=undefined&&o>-1){a.insertBefore(i.children().eq(o))}
else{a.appendTo(i).show()}}
else if(n){a=$(this.convertVariables({},e,o));if(o!=undefined&&o>-1){a.insertBefore(i.children().eq(o))}
else{a.appendTo(i).show()}};return a},checkAutoForm:function(t,e){e.find('[binding]').each(function(){var i=$(this).attr('binding'),n;if(t[i]===0||t[i]){if(this.type.indexOf('text')>-1){$(this).val(t[i])}
else if(this.type.indexOf('radio')>-1){n=$(this).attr('name');$(e).find('input[name='+n+']:radio[value=\''+t[i]+'\']').attr('checked','checked')}
else if(this.type.indexOf('checkbox')>-1){n=$(this).attr('name');$(e).find('input[name=\''+n+'\']:checkbox').each(function(){if(t[i].indexOf(this.value)>-1){$(this).attr('checked','checked')}
else{}})}
else if(this.type.indexOf('select')>-1){this.value=t[i]}}})},removeVariables:function(t){while(t.indexOf('{{')>-1){var e=t.indexOf('{{'),i=t.slice(e+2,t.indexOf('}}',e));t=t.replace('{{'+i+'}}','')};return t},convertVariables:function(t,e,i){var p=t;t=bm.object.toKeyLowerCase(t);while(e.indexOf('data-wv-print=')>-1){var d=e.indexOf('data-wv-print='),v=e.indexOf('"',d+15)+1,y=e.slice(d,v);e=e.replace(y,e.slice(d+15,v-1))};if(t==null)return;t.index=i;var E={};var S,x,B=0,m;m=1000;while(e.indexOf('{{')>-1){if(--m==0){throw new Error('최대 반복 횟수를 초과하였습니다.')};var d=e.indexOf('{{'),r=e.slice(d+2,e.indexOf('}}',d)),T,C,n,o=r;if(o.indexOf('::')>-1){o=bm.string.trim(o.slice(0,o.indexOf('::')))};if(o.indexOf('textarea:')==0){var a=o.slice(9,o.length);n=this.getWvParseValue(a,t);e=e.replace('{{'+r+'}}',n?n:'')}
else if(o.indexOf('src:')==0){var a=o.slice(4,o.length),u='',g='';if(a.indexOf('+')>0){u=bm.string.trim(a.slice(0,a.indexOf('+')));a=bm.string.trim(a.slice(u.length+1,a.length));if(a.indexOf('+')>0){g=bm.string.trim(a.slice(a.indexOf('+')+1,a.length));a=bm.string.trim(a.slice(0,a.indexOf('+')))}};n=this.getWvParseValue(a,t);e=e.replace('{{'+r+'}}',n?'src=\''+u+n+g+'\'':'')}
else if(o.indexOf('-&gt;')>-1||o.indexOf('->')>-1){e=e.replace('{{'+r+'}}',this.getWvParseValue(r,t))}
else if(o.indexOf('comma:')==0){var a=o.slice(6,o.length);n=this.getWvParseValue(a,t);n=n?bm.string.comma(n):'';e=e.replace('{{'+r+'}}',n)}
else if(o.indexOf('date:')==0){var a=o.slice(5,o.length),c=a.split('|');n=this.getWvParseValue(c[0],t);if(n){function w(t){var i=t,e=new Date(i);if(e.toString()=='Invalid Date'){i=i.split('.').join('-');e=new Date(i)};if(e.toString()=='Invalid Date'){var o=i.split(' '),a=o[0];e=new Date(a);if(o.length>1){var n=o[1].split(':');e.setHours(n[0]);e.setMinutes(n[1]);if(n.length>2){e.setSeconds(n[2])}}};return e};n=new Date(w(n));n=new Date(n);n=(function(t,e){var i={m:t.getMonth()+1,d:t.getDate(),H:t.getHours(),M:t.getMinutes(),S:t.getSeconds()};e=e.replace(/(m+|d+|H+|M+|S+)/g,function(t){return((t.length>1?'0':'')+i[t.slice(-1)]).slice(-2)});return e.replace(/(y+)/g,function(e){return t.getFullYear().toString().slice(-e.length)})})(n,c[1])}
else{n=''};e=e.replace('{{'+r+'}}',n)}
else if(o.indexOf('formatter:')==0){var a=o.slice(10,o.length),s=null;if(o.indexOf('|')>-1){var c=a.split('|');if(c[1])s=c[1];a=c[0];var f;n=this.getWvParseValue(a,t);if(s&&s!==''){if(s.indexOf('.')>0){if($.isFunction(new Function('return '+s))){var l=new Function('a','b','c','d','e','return '+s+'.call( window, a, b, c, d, e )');f=l(i,a,n,p,$(e)[0])}}
else{var l=window[s];if(typeof l==='function'){f=l.call(window,i,a,n,p,$(e)[0])}}};if(f!==null&&f!==undefined)n=f;e=e.replace('{{'+r+'}}',n)}
else{s=o.slice(10,o.length);n='';if(s&&s!==''){if(s.indexOf('.')>0){if($.isFunction(new Function('return '+s))){var l=new Function('a','b','c','return '+s+'.call( window, a, b, c )');n=l(i,p,$(e)[0])}}
else{var l=window[s];if(typeof l==='function'){n=l.call(window,i,p,$(e)[0])}}};e=e.replace('{{'+r+'}}',n)}}
else{if(t[o]){if(Object.prototype.toString.call(t[o])==='[object String]'){t[o]=t[o].replace(/(?:\r\n|\r|\n)/g,'<br/>')}};var h=this.getWvParseValue(r,t);if(window.version!=-1&&window.version<=8){var b=e.slice(d-6,d);if(b=='value='){h='"'+h+'"'}};h=h===undefined||h===null?'':h;e=e.replace('{{'+r+'}}',h)}};return e},getWvParseValue:function(t,e){var c=t;t=t.toLowerCase();var i,h=c,p=t,u=!1;if(t.indexOf('n2br:')==0){p=t=t.substring(5);h=c=h.substring(5);u=!0};if(t.indexOf('::')>-1){var o,r,d;t=bm.string.trim(p.slice(0,p.indexOf('::')));i=bm.string.trim(h.slice(h.indexOf('::')+2,h.length));d=i.split('?');o=d[0].split('|');r=d[1].split('|');o=bm.string.trimList(o);r=bm.string.trimList(r);var s=o.length;while(s--){if(!isNaN(parseFloat(o[s]))){o[s]=parseFloat(o[s])}};var n;if(t.indexOf('-&gt;')>-1||t.indexOf('->')>-1){var l=t.indexOf('-&gt;')>-1?t.split('-&gt;'):t.split('->'),v=c.indexOf('-&gt;')>-1?c.split('-&gt;'):c.split('->'),s=l.length;n=e;for(var a=0;a<s;a++){var m=n;n=n[bm.string.trim(l[a])];if(!n){n=m[bm.string.trim(v[a])];if(!n)break}};if(u&&n){if(Object.prototype.toString.call(n)==='[object String]'){n=n.replace(/(?:\r\n|\r|\n)/g,'<br/>')}}}
else{n=e[t]};if(Object.prototype.toString.call(n)==='[object Boolean]'){if(n)n='true';else n='false'}
else if(n===null){n='null'};var f=o.indexOf(n);if(n&&f<0){if(typeof n==='string'){var g=n.toLowerCase();f=o.indexOf(g)}};i=r[f];if(i!==0&&!i){if(i==undefined&&!isNaN(parseFloat(n))){i=r[o.indexOf(parseFloat(n))]};if(i==undefined&&o.indexOf('~')>-1&&n!==undefined){i=r[o.indexOf('~')]};if(i==undefined&&d[2]){if(n)i=n;else i=d[2]};if(i==undefined&&o.indexOf('~')>-1){i=r[o.indexOf('~')]};if(i==undefined){i=n;if(i==undefined)i=''}}}
else if(t.indexOf('-&gt;')>-1||t.indexOf('->')>-1){var l=t.indexOf('-&gt;')>-1?t.split('-&gt;'):t.split('->'),s=l.length;i=e;for(var a=0;a<s;a++){i=i[bm.string.trim(l[a])];if(!i)break};if(u&&i){if(Object.prototype.toString.call(i)==='[object String]'){i=i.replace(/(?:\r\n|\r|\n)/g,'<br/>')}}}
else{i=e[$.trim(t)]};return(i==undefined||i==null)?'':i},getOuterPosition:function(t,e){if(t.length&&t.length>0)t=t[0];var i;switch(e){case'left':i='marginLeft';e='left';break;case'right':i='marginRight';e='right';break;case'top':i='marginTop';e='top';break;case'bottom':i='marginBottom';e='bottom';break;case'innerLeft':i='paddingLeft';e='left';break;case'innerRight':i='paddingRight';e='right';break;case'innerTop':i='paddingLeft';e='top';break;case'innerBottom':i='paddingRight';e='bottom';break};var n;if(e=='left'){var d=bm.getStyleInt(t,'marginLeft');n=$(t).offset()['left']-d}
else if(e=='right'){var r=bm.getStyleInt(t,'paddingRight')||0,l=bm.getStyleInt(t,'marginRight')||0;n=$(t).offset()['left']+$(t).width()+r+l}
else if(e=='top'){var s=bm.getStyleInt(t,'marginTop');n=$(t).offset()['top']-s}
else if(e=='bottom'){var o=bm.getStyleInt(t,'paddingBottom')||0,a=bm.getStyleInt(t,'marginBottom')||0;n=$(t).offset()['top']+$(t).height()+o+a};return n},getValueByFormElement:function(t,e){var i,n;t=t instanceof jQuery&&t.length>0?t[0]:t;if(t.type.indexOf('text')>-1||t.type.indexOf('number')>-1||t.type.indexOf('hidden')>-1){i=$(t).val()}
else if(t.type.indexOf('radio')>-1){n=$(t).attr('name');i=$(e).find('input[name=\''+n+'\']:checked').val()}
else if(t.type.indexOf('select')>-1){i=$(t).val()}
else if(t.type.indexOf('checkbox')>-1){n=$(t).attr('name');if($('[name=\''+n+'\']:checked').length>0){i='';$('[name=\''+n+'\']:checked').each(function(){if(i!='')i+=',';i+=$(this).val()})}
else{if($(t).attr('data-wv-nocheck-value')!==undefined){i=$(t).attr('data-wv-nocheck-value')}}};return i},__blockSchema:null,getBlockSchema:function(){if(this.__blockSchema==null){this.__blockSchema=('center dir isindex noframes address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul li dt dd table td article aside details dialog figure header footer hgroup section nav').split(' ')};return this.__blockSchema},__inlineSchema:null,getInlineSchema:function(){if(this.__inlineSchema==null){this.__inlineSchema=('a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen font').split(' ')};return this.__inlineSchema},isBlock:function(t){var e;if(bm.type.isString(t))e=t;else e=t.nodeName;e=e.toLocaleLowerCase();var i=this.getBlockSchema();if(i.indexOf(e)==-1){return!1}
else{return!0}},isInline:function(t){var e;if(bm.type.isString(t))e=t;else e=t.nodeName;e=e.toLocaleLowerCase();var i=this.getInlineSchema();if(i.indexOf(e)==-1){return!1}
else{return!0}},isElement:function(t){if(t.nodeType!==1){return!1}
else{return!0}},isEmptyNode:function(t){var e=t.nodeType;return(t.nodeType==3&&$.trim(t.data)=='')||e==4||e==8},checkEmptyThenRemove:function(t){var e=t.nodeType==3?t:t.firstChild;if(this.isEmptyNode(e))$(t).remove()},deleteData:function(t,e,i){var o=t.nodeType==3?this:t.firstChild;if(!o||!o.nodeValue)return;var n=o.nodeValue;n=n.substr(0,e)+n.substr(i,n.length);o.nodeValue=n},splitNodeAt:function(t,e){var n=$(t).clone()[0];this.deleteData(n,0,e);var i=t.nodeType==3?this:t.firstChild;if(i&&i.nodeValue){this.deleteData(t,e,i.nodeValue.length)};$(t).after(n);return[t,n]},getParent:function(t){if(t.parentNode)return t.parentNode;else{return t.ownerDocument.activeElement}},findParentUntilElement:function(t){return this.findParentUntil('element',t)},findParentUntilInline:function(t){return this.findParentUntil('inline',t)},findParentUntilBlock:function(t){return this.findParentUntil('block',t)},findParentUntil:function(t,e){var o=document.body,i=e,n;switch(t){case'block':n=this.isBlock;break;case'inline':n=this.isInline;break;case'element':n=this.isElement;break}
while(n.call(this,i)==!1){i=i.parentNode;if(i===o){i=o;break}};return i},replaceTag:function(t,e,i){if(i===undefined)i=!0;var n=bm.html('<'+e+'></'+e+'>');$(t).contents().each(function(){n.append(this)});if(i===undefined||i){this.copyAttribute(t,n)};$(t).before(n);$(t).remove();return n},unWrap:function(t,e){var i;if(e){i=$(t).find(e)}
else{i=$(t)};i.children().each(function(){i.after(this)});i.remove();return t},wrapOuter:function(t,e){var i=$(e).insertBefore(t);i.prepend(t);return i[0]},removeTagOnChild:function(t,e){var i=$(t).find(e);i.each(function(){var e=this.children,i=e.length;for(var t=0;t<i;t++){$(this).before(e[0])};$(this).remove()})},removeTagOnParent:function(t,e){var i=$(t).closest(e)[0],n,a;if(i){n=i.children;a=n.length;for(var o=0;o<a;o++){$(i).before(n[0])}};$(i).remove()},copyAttribute:function(t,e){$.each(t.attributes,function(){$(e).attr(this.name,this.value)})},replaceScriptNode:function(t,e){for(var a in e){var o=t.find('[data-script-position=\''+a+'\']')[0];if(o==null)continue;var i=e[a];i=i.substring(i.indexOf('>')+1,i.lastIndexOf('</script'));var n=document.createElement('script');n.setAttribute('type','text/javascript');n.text=i;var s=o.parentElement;s.replaceChild(n,o)}},getScriptContent:function(t){var o=[],a=[],i,s,n,e,r;while(1){i=t.indexOf('<script');if(i>-1){e=t.slice(i,t.indexOf('>',i));if(e.indexOf('src')>-1){e=e.replace(/ /g,'');if(e.indexOf('src="')>-1){}
else if(e.indexOf('src=\'')>-1){};n=e.slice()}}
else{break}}},insertScript:function(t,e,i){i=i||window;var o=i.document.getElementsByTagName('head')[0],n=i.document.createElement('script');n.setAttribute('type','text/javascript');if(e){n.src=e};if(t){n.text=t};o.appendChild(n);o.removeChild(n)},getRelativeCoordinates:(standardEl,targetEl)=>{var rect1=standardEl.getBoundingClientRect(),rect2=targetEl.getBoundingClientRect(),scrollLeft=window.pageXOffset||document.documentElement.scrollLeft,scrollTop=window.pageYOffset||document.documentElement.scrollTop;return{top:rect2.top-rect1.top+scrollTop,left:rect2.left-rect1.left+scrollLeft}}};bm.htmlTable=function(t,e){var a=/^<([-A-Za-z0-9_]+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,s=/^<\/([-A-Za-z0-9_]+)[^>]*>/,r=/([-A-Za-z0-9_]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function l(t,e){var o=e.length;for(var i=1;i<o;i++){var n=e[i].split('=');t.setAttribute(n[0],n[1].replace(/'|"/gi,''))}};var n,i=t,d=0;while(e){e=e.replace(/^\s*/,'');if(e.indexOf('</')==0){n=e.match(s)[0];i=i.parentNode}
else if(e.indexOf('<')==0){n=e.match(a)[0];if(/tr/.test(n)){i=i.insertRow(-1)}
else if(/td|th/.test(n)){i=i.insertCell(-1)};l(i,n.match(r))}
else{var o=e.indexOf('</'+i.tagName.toLowerCase());n=e.substring(0,o);i.innerHTML=n};e=e.substring(n.length,e.length)}};bm.table={merge:function(t,e){if(e.length<2){bm.toast('병합하려는 2개 이상의 셀을 선택해주세요.');return!1};var a=this,s=0,o=0,r=null,i=null,l=-1,n='',h=!1,f=[],c=this.getRectPoint(e);if(this.isRectangle(c)==!1){alert('선택영역이 사각형이어야 병합이 가능합니다.');return};if(!confirm('선택된 셀들의 값이 모두 합쳐집니다.\n병합하시겠습니까?')){return!1};a.cellEditBefore(this,e,'MERGE');bm.each(e,function(t,e){if(h)return;if(t==0){r=e.parentNode;o+=e.colSpan}
else if(r==e.parentNode){o+=e.colSpan};if(!i){i={};i[e.parentNode.rowIndex]=e;l=e.offsetLeft}
else if(!i[e.parentNode.rowIndex]&&e.offsetLeft<=l){i[e.parentNode.rowIndex]=e};var a=$.trim(e.innerHTML);if(a!='<br>'&&a!='<br/>'){if($.trim(n)!=''&&a!=''){n+='<br/>'};n+=a}});for(var d in i){s+=i[d].rowSpan};bm.each(e,function(t,e){if(t==0){if(n=='')n='<br>';e.colSpan=o;e.rowSpan=s;e.innerHTML=n}
else{$(e).remove()}});a.cellEditAfter(this,e,'MERGE');return e[0]},cleanEmptyTr:function(t){function e(e){var i=$(t).find('tr'),n=i.index(e),o=1,a;while(n--){o++;a=i[n];$(a).find('th, td').each(function(){if(this.rowSpan>=o){this.rowSpan=this.rowSpan-1}})};$(e).remove()};var i=[];$(t).find('tr').each(function(){if($(this).find('th, td').length==0){e(this)}})},mergeCancelCell:function(t,e,i){var n,a,o;if(e=='left'||e=='right'){n=this.clonePureNode(t,e);e=='left'?$(t).before(n):$(t).after(n)}
else if(e=='bottom'||e=='top'){if(i&&e=='bottom'&&t.rowSpan!=1){o=$(t.parentNode).nextAll('tr')[t.rowSpan-1]}
else{if(e=='bottom'){o=$(t.parentNode).next()[0]}
else if(e=='top'){o=$(t.parentNode).prev()[0]}};n=t.cloneNode();n.innerHTML='<br>';n.colSpan=1;n.rowSpan=1;if($(o).find('td, th').eq(t.cellIndex).length==1){$(o).find('td, th').eq(t.cellIndex).before(n)}
else{$(o).append(n)}};return n},checkAppliedStyleAll:function(t,e){var o=t.length,n;for(var i=0;i<o;i++){for(n in e){if(t[i].style[n]!=e[n]){return!1}}};return!0},setCellStyle:function(t,e,i){var a=this,s=t.length;if(bm.bmEditorManager.registedBoardEditor===!1){if(e&&e!='BORDER'){a.cellEditBefore(this,t,e,i)};var o=WVAdminResourceManager.getEmbededStyleObject('block');for(var n=0;n<s;n++){o.applyResourceStyle($(t[n]),i,!1,!0)};if(o)o.refreshStyleElementText();if(e&&e!='BORDER'){a.cellEditAfter(this,t,e,i)}}
else{for(var n=0;n<s;n++){$(t[n]).css(i)}}},cellEditBefore:function(t,e,i,n){var r=e[0],a={};var o=i.toLowerCase();a[o]=bm.getStyle(r,o);var s='EDITOR_TABLE_'+i;this.colResizerDeActive();bm.toolManager.toolBtnEditBefore(t,$(e),HistoryType[s],a)},cellEditAfter:function(t,e,i,n){var r=e[0],a={};var o=i.toLowerCase();a[o]=bm.getStyle(r,o);var s='EDITOR_TABLE_'+i;bm.toolManager.toolBtnEditAfter(t,$(e),HistoryType[s],a);this.colResizerActive($(e).closest('table')[0]);bm.toolManager.kitReposition()},getCellListStyle:function(t,e){var o=t.length,n=!1;for(var i=0;i<o;i++){if(n===!1){n=$(t[i]).css(e)}
else if(n!==$(t[i]).css(e)){return''}};return n},setCellAllBorderStyle:function(t,e){var i,r=this.getRectPoint(t);if(this.isRectangle(r)==!1){alert('다중 선택시, 선택영역이 사각형이어야 스타일 적용이 가능합니다.');return};i={'borderTop':e,'borderRight':e,'borderBottom':e,'borderLeft':e};var n=this.getSiblingCell(t,null,'left'),o=this.getSiblingCell(t,null,'top'),a=this.getSiblingCell(t,null,'right'),s=this.getSiblingCell(t,null,'bottom');if(bm.bmEditorManager.registedBoardEditor===!1){this.cellEditBefore(this,t,'BORDER',i)};this.setCellStyle(t,'BORDER',i);this.setCellStyle(o,'BORDER',{'borderBottom':e});this.setCellStyle(n,'BORDER',{'borderRight':e});this.setCellStyle(a,'BORDER',{'borderLeft':e});this.setCellStyle(s,'BORDER',{'borderTop':e});if(bm.bmEditorManager.registedBoardEditor===!1){this.cellEditAfter(this,t,'BORDER',i)}},setCellBorderOuterStyle:function(t,e,i){var n=this.getRectPoint(t);if(this.isRectangle(n)==!1){alert('다중 선택시, 선택영역이 사각형이어야 스타일 적용이 가능합니다.');return};var o,a,s,r,l=this.getOuterCell(t,n,'left'),d=this.getOuterCell(t,n,'top'),h=this.getOuterCell(t,n,'right'),c=this.getOuterCell(t,n,'bottom'),f=this.getSiblingCell(t,n,'left'),p=this.getSiblingCell(t,n,'top'),u=this.getSiblingCell(t,n,'right'),g=this.getSiblingCell(t,n,'bottom');if(bm.bmEditorManager.registedBoardEditor===!1){this.cellEditBefore(this,t,'BORDER',e)};if(i=='top'||i=='all'){o=bm.table.checkAppliedStyleAll(d,{'borderTop':e});if(i!='all'){this.setCellStyle(d,'BORDER',{'borderTop':(o?'':e)});this.setCellStyle(p,'BORDER',{'borderBottom':(o?'':e)})}};if(i=='bottom'||i=='all'){a=bm.table.checkAppliedStyleAll(c,{'borderBottom':e});if(i!='all'){this.setCellStyle(c,'BORDER',{'borderBottom':(a?'':e)});this.setCellStyle(g,'BORDER',{'borderTop':(a?'':e)})}};if(i=='left'||i=='all'){s=bm.table.checkAppliedStyleAll(l,{'borderLeft':e});if(i!='all'){this.setCellStyle(l,'BORDER',{'borderLeft':(s?'':e)});this.setCellStyle(f,'BORDER',{'borderRight':(s?'':e)})}};if(i=='right'||i=='all'){r=bm.table.checkAppliedStyleAll(h,{'borderRight':e});if(i!='all'){this.setCellStyle(h,'BORDER',{'borderRight':(r?'':e)});this.setCellStyle(u,'BORDER',{'borderLeft':(r?'':e)})}};if(i=='all'){if(o&&a&&s&&r){e=''};this.setCellStyle(d,'BORDER',{'borderTop':e});this.setCellStyle(c,'BORDER',{'borderBottom':e});this.setCellStyle(l,'BORDER',{'borderLeft':e});this.setCellStyle(h,'BORDER',{'borderRight':e});this.setCellStyle(p,'BORDER',{'borderBottom':(e)});this.setCellStyle(f,'BORDER',{'borderRight':(e)});this.setCellStyle(u,'BORDER',{'borderLeft':(e)});this.setCellStyle(g,'BORDER',{'borderTop':(e)})};if(bm.bmEditorManager.registedBoardEditor===!1){this.cellEditAfter(this,t,'BORDER',e)}},setCellBorderInnerStyle:function(t,e,i){var l=this.getRectPoint(t);if(this.isRectangle(l)==!1){alert('다중 선택시, 선택영역이 사각형이어야 스타일 적용이 가능합니다.');return};var n,s,r,o,a;if(bm.bmEditorManager.registedBoardEditor===!1){this.cellEditBefore(this,t,'BORDER',e)};if(i=='all'||i=='horizontal'){n=this.getOuterCell(t,l,'bottom');o=bm.array.spliceList(t,n);s=bm.table.checkAppliedStyleAll(o,{'borderBottom':e});if(i!='all')this.setCellStyle(o,'BORDER',{'borderBottom':(s?'':e)})};if(i=='all'||i=='vertical'){n=this.getOuterCell(t,l,'right');a=bm.array.spliceList(t,n);r=bm.table.checkAppliedStyleAll(a,'BORDER',{'borderRight':e});if(i!='all')this.setCellStyle(a,'BORDER',{'borderRight':(r?'':e)})};if(i=='all'){if(s&&r){e=''};this.setCellStyle(o,'BORDER',{'borderBottom':e});this.setCellStyle(a,'BORDER',{'borderRight':e})};if(bm.bmEditorManager.registedBoardEditor===!1){this.cellEditAfter(this,t,'BORDER',e)}},getOuterCell:function(t,e,i){var n=[];bm.each(t,function(t,o){if(i=='top'){if(e.lt.y==o.offsetTop){n.push(o)}}
else if(i=='right'){if(e.rb.x==o.offsetLeft+o.offsetWidth){n.push(o)}}
else if(i=='bottom'){if(e.rb.y==o.offsetTop+o.offsetHeight){n.push(o)}}
else if(i=='left'){if(e.lt.x==o.offsetLeft){n.push(o)}}});return n},getSiblingCell:function(t,e,i){var o=[],e=e?e:this.getRectPoint(t),n=bm.tableSelectionManager.scanning(bm.tableSelectionManager.targetTable);bm.each(t,function(t,a){var r=bm.tableSelectionManager.getIndex(a,n),d=n[r.rowIndex][r.cellIndex],l,h=1,c=1;if(i=='top'){if(e.lt.y==a.offsetTop){if(r.rowIndex>0){if(d.status=='merged')h=a.colSpan;for(var s=0;s<h;s++){l=n[r.rowIndex-1][r.cellIndex+s];o.push(l.cell)}}}}
else if(i=='left'){if(e.lt.x==a.offsetLeft){if(r.cellIndex>0){if(d.status=='merged')c=a.rowSpan;for(var s=0;s<c;s++){l=n[r.rowIndex+s][r.cellIndex-1];o.push(l.cell)}}}}
else if(i=='right'){if(e.rt.x==a.offsetLeft+a.offsetWidth){if(r.cellIndex+1<n[0].length){if(d.status=='merged')c=a.rowSpan;for(var s=0;s<c;s++){l=n[r.rowIndex+s][r.cellIndex+1];o.push(l.cell)}}}}
else if(i=='bottom'){if(e.lb.y==a.offsetTop+a.offsetHeight){if(r.rowIndex+1<n.length){if(d.status=='merged')h=a.colSpan;for(var s=0;s<h;s++){l=n[r.rowIndex+1][r.cellIndex+s];o.push(l.cell)}}}}});return o},isRectangle:function(t){if(t.lt&&t.lb&&t.rt&&t.rb){if(t.lt.x!=t.lb.x||t.lt.y!=t.rt.y||t.lb.y!=t.rb.y||t.rt.x!=t.rb.x){return!1}}
else{return!1};return!0},getRectPoint:function(t){var a,s,r,l,e,i,n,o;bm.each(t,function(t,d){if(t==0){e={x:d.offsetLeft,y:d.offsetTop};i={x:d.offsetLeft+d.offsetWidth,y:d.offsetTop};n={x:d.offsetLeft,y:d.offsetTop+d.offsetHeight};o={x:d.offsetLeft+d.offsetWidth,y:d.offsetTop+d.offsetHeight}}
else{a={x:d.offsetLeft,y:d.offsetTop};s={x:d.offsetLeft+d.offsetWidth,y:d.offsetTop};r={x:d.offsetLeft,y:d.offsetTop+d.offsetHeight};l={x:d.offsetLeft+d.offsetWidth,y:d.offsetTop+d.offsetHeight};if(a.x<=e.x&&a.y<=e.y)e=a;if(s.x>=i.x&&s.y<=i.y)i=s;if(r.x<=n.x&&r.y>=n.y)n=r;if(l.x>=o.x&&l.y>=o.y)o=l}});return{lt:e,rt:i,lb:n,rb:o}},clonePureNode:function(t,e){var i=t.cloneNode();i.innerHTML='<br>';i.colSpan=1;i.rowSpan=1;$(i).removeClass('active');return i},getRealCellAtScanning:function(t,e,i,n){var a=i[0].length,o=i[t][e];if(o.mergeX==0&&o.mergeY==0){return o.cell}
else{if(n=='left'&&e==0){return null}
else if(n=='right'&&e==a-1){return null}
else{e=n=='left'?e-1:e+1;return this.getRealCellAtScanning(t,e,i,n)}}},getCloneTarget:function(t,e,i,n){if(n=='left'||n=='right'){var r=i.rows.length,a=t,o;for(var s=0;s<r;s++){o=e-s;if(o<0)o=r+o;if(i.rows[a].cells[o]!==undefined){if(o>0&&o<i.rows[a].cells.length-1&&i.rows[a].cells[o-1]!==undefined){if(i.rows[a].cells[o-1].colSpan>1){return i.rows[a].cells[o-1]}};return i.rows[a].cells[o]}};return null}
else{var a,o=e;if(n=='top')a=t+1;else if(n=='bottom')a=t;var r=i.rows[a].cells.length;if(i.rows[a].cells[o]!==undefined){if(o>0&&i.rows[a].cells[o-1]!==undefined){if(i.rows[a].cells[o-1].rowSpan>1){return i.rows[a].cells[o-1]}};return i.rows[a].cells[o]}
else{if(o>=r){for(var s=1;s<o;s++){if(i.rows[a].cells[o-s]!==undefined){return i.rows[a].cells[o-s]}}}};return null}},addLine:function(t,e,i){var C=this,r=bm.tableSelectionManager.scanning(t),a=bm.tableSelectionManager.getIndex(e,r),d,S,w=$(t).find('colgroup');if(w.length>0){S=w.find('col')};var s,o,m,v,l,p,b,y;C.cellEditBefore(this,$(e),'ADD');if(w.length>0&&(i=='left'||i=='right')){p=S[a.cellIndex];y=this.getWidthUnit(p);this.colWidthChange(p,y.width/2,y.unit);b=p.cloneNode();if(i=='left'){$(p).before(b)}
else if(i=='right'){$(p).after(b)}};if(i=='left'){m=r.length;for(var n=0;n<m;n++){s=r[n];o=s[a.cellIndex];if(o.status=='merged'&&(a.cellIndex>0&&s[a.cellIndex-1].status=='merged'&&(o.cell===s[a.cellIndex-1].cell))){o.cell.colSpan=o.cell.colSpan+1;n=n+o.cell.rowSpan-1;continue}
else{d=this.getCloneTarget(n,a.cellIndex,t,'left');if(!d)continue;l=this.clonePureNode(d,i);if(a.cellIndex>0){var g=this.getRealCellAtScanning(n,a.cellIndex-1,r,'left');if(g){$(g).after(l)}
else{$(t.rows[n]).prepend(l)}}
else{$(t.rows[n]).prepend(l)}}}}
else if(i=='right'){m=r.length;var f=a.cellIndex+e.colSpan-1;for(var n=0;n<m;n++){s=r[n];o=s[f];if(o.status=='merged'&&(f<s.length-1&&s[f+1].status=='merged'&&(o.cell===s[a.cellIndex+1].cell))){o.cell.colSpan=o.cell.colSpan+1;n=n+o.cell.rowSpan-1;continue}
else{var T=f;if(o.status=='merged'){T=f-o.mergeX};d=this.getCloneTarget(n,T,t,'right');if(!d)continue;l=this.clonePureNode(d,i);if(f<s.length-1){var g=this.getRealCellAtScanning(n,f+1,r,'right');if(g){$(g).before(l)}
else{$(t.rows[n]).append(l)}}
else{$(t.rows[n]).append(l)}}}}
else if(i=='top'){v=r[0].length;s=t.rows[a.rowIndex];$(s).before('<tr></tr>');s=t.rows[a.rowIndex];for(var n=0;n<v;n++){o=r[a.rowIndex][n];if(o.status=='merged'&&(a.rowIndex>0&&r[a.rowIndex-1][n].status=='merged'&&(o.cell===r[a.rowIndex-1][n].cell))){o.cell.rowSpan=o.cell.rowSpan+1;n=n+o.cell.colSpan-1;continue}
else{var h=a.rowIndex,c=n;if(o.status=='merged'){h=h-o.mergeY;c=c-o.mergeX};d=this.getCloneTarget(h,c,t,'top');if(!d)continue;l=this.clonePureNode(d,i);s.append(l)}}}
else if(i=='bottom'){v=r[0].length;var u=a.rowIndex+e.rowSpan-1;s=t.rows[u];$(s).after('<tr></tr>');s=t.rows[u+1];for(var n=0;n<v;n++){o=r[u][n];if(o.status=='merged'&&(u<r.length-1&&r[u+1][n].status=='merged'&&(o.cell===r[a.rowIndex+1][n].cell))){o.cell.rowSpan=o.cell.rowSpan+1;n=n+o.cell.colSpan-1;continue}
else{var h=a.rowIndex,c=n;if(o.status=='merged'){h=h-o.mergeY;c=c-o.mergeX};d=this.getCloneTarget(h,c,t,'bottom');if(!d)continue;l=this.clonePureNode(d,i);s.append(l)}}};C.cellEditAfter(this,$(e),'ADD');bm.tableSelectionManager.refreshListener()},getWidthUnit:function(t){var e=$(t).attr('width');if(e){$(t).removeAttr('width');$(t).css('width',e)}
else{e=$(t).css('width')};if(e.indexOf('px')>-1){return{width:parseFloat(e),unit:'px'}}
else if(e.indexOf('%')>-1){return{width:parseFloat(e),unit:'%'}}
else{return{width:0,unit:'auto'}}},colWidthChange:function(t,e,i){if(i=='auto'){$(t).css('width','auto')}
else{$(t).css('width',e+i)}},transformWidth:function(t,e,i){var n=this.getWidthUnit(e),s=$(t).width();if(n.unit!=i&&n.unit!='auto'){if(i=='px'){return s*n.width/100};if(i=='%'){return n.width/s*100}}
else if(n.unit=='auto'){var l=$(t).find('col').index(e),r=bm.tableSelectionManager.scanning(t),d=r.length;for(var a=0;a<d;a++){var o=r[a][l];if(o.status=='origin'){if(i=='px'){return Math.round($(o.cell).outerWidth())};if(i=='%'){return Math.round($(o.cell).outerWidth()/s*100)}}};return 0}
else{return n.width}},removeLine:function(t,e,i){var m=this,l=bm.tableSelectionManager.scanning(t),a=bm.tableSelectionManager.getIndex(e,l),c,u=$(t).find('colgroup');if(u.length>0){c=u.find('col')};var f,n,d,h,v,r,s,p;m.cellEditBefore(this,$(e),'REMOVE');if(u.length>0&&i=='vertical'){if(a.cellIndex==0){r=c[1]}
else{r=c[a.cellIndex-1]};h=c[a.cellIndex];p=this.getWidthUnit(h);s=this.getWidthUnit(r);if(s.unit!='auto'){if(p.unit==s.unit){this.colWidthChange(r,p.width+s.width,s.unit)}
else{this.colWidthChange(r,s.width+this.transformWidth(t,h,s.unit),s.unit)}};$(h).remove()};if(i=='horizontal'){f=l[a.rowIndex];d=f.length;for(var o=0;o<d;o++){n=f[o];if(n.status=='merged'&&n.cell.rowSpan>1){n.cell.rowSpan=n.cell.rowSpan-1;if(n.mergeX==0&&n.mergeY==0){if(o==0){$(t.rows[a.rowIndex+1]).prepend(n.cell)}
else{var g=this.getRealCellAtScanning(a.rowIndex+1,o-1,l,'left');if(g){$(g).after(n.cell)}
else{$(t.rows[a.rowIndex+1]).prepend(n.cell)}}};o=o+n.cell.colSpan-1}
else if(n.status=='merged'&&n.cell.colSpan>1){o=o+n.cell.colSpan-1}};$(t.rows[a.rowIndex]).remove()}
else if(i=='vertical'){d=l.length;for(var o=0;o<d;o++){n=l[o][a.cellIndex];if(!n)continue;if(n.status=='merged'&&n.cell.colSpan>1){n.cell.colSpan=n.cell.colSpan-1;o=o+n.cell.rowSpan-1}
else if(n.status=='merged'&&n.cell.rowSpan>1){$(n.cell).remove();o=o+n.cell.rowSpan-1}
else{$(n.cell).remove()}}};m.cellEditAfter(this,$(e),'REMOVE')},removeCellNode:function(t){var o=this,i=t?t:bm.tableSelectionManager.getRange(),n;for(var e=0;e<i.length;e++){n=$(i[e]);n.html('<br>')}},getPreviousCellAtRow:function(t,e){var o=null,a=null,i=null,n=t.offsetLeft;if(e=='bottom'){o=$(t.parentNode).next()[0]}
else if(e=='top'){o=$(t.parentNode).prev()[0]};$(o).find('th, td').each(function(){if(this.offsetLeft<n){if(i===null){i=n-this.offsetLeft;a=this}
else if(n-this.offsetLeft<i){i=n-this.offsetLeft;a=this}}});return a},mergeCancel:function(t,e){var s=this,l=e.rowSpan,d=e.colSpan;e.colSpan=1;e.rowSpan=1;var n=[e],o=l-1,r=d-1;s.cellEditBefore(this,$(e),'MERGE_CANCEL');for(var i=0;i<o;i++){e=this.mergeCancelCell(e,'bottom');n.push(e)};o=n.length;for(var i=0;i<o;i++){e=n[i];for(var a=0;a<r;a++){e=this.mergeCancelCell(e,'right');n.push(e)}};s.cellEditAfter(this,$(e),'MERGE_CANCEL');return n},getMaxColCount:function(t){var a=t.rows,n,s=0,o=0;for(var i=0;i<a.length;i++){n=a[i].cells;o=0;for(var e=0;e<n.length;e++){o+=n[e].colSpan};s=Math.max(s,o)}},resizerList:[],resizerGarbageList:[],colResizerWidth:10,getColResizer:function(){var t=this.resizerGarbageList.length==0?bm.html('<div class="col_resizer" contenteditable="false" style="position: absolute; caret-color:transparent;  height:100%; cursor: e-resize; z-index: 3; width: '+this.colResizerWidth+'px; right: '+(-this.colResizerWidth/2)+'px; top: 0;"></div>'):this.resizerGarbageList.pop();this.resizerList.push(t);return t},colResizerActive:function(t,e,i,n){if(this.resizerList.length>0){this.colResizerDeActive()};var h=this,f=t.rows,r,s,d,c,u=t.offsetLeft+t.offsetWidth;for(var l=0;l<f.length;l++){r=f[l].cells;c=0;for(var a=0;a<r.length;a++){s=r[a];if(a!=r.length-1||(a==r.length-1&&(s.offsetLeft+s.offsetWidth)!=u)){d=this.getColResizer();$(s).prepend(d);$(d).attr('row-index',l).attr('cell-index',a).attr('col-index',(c+s.colSpan-1));mouseAdapter(d).onDrag(m,v,g)};c+=s.colSpan}};var o={table:t,startX:0,currentX:0,rowIndex:0,cellIndex:0,colIndex:0,sizeType:'',leftCell:null,rightCell:null,leftColData:null,rightColData:null};function p(e){var i=0;$(t).find('th, td').each(function(){if(e==$(this).index()){i=$(this).outerWidth();return!1}});return i};function g(i){i.stopImmediatePropagation();i.preventDefault();o.table=t;o.startX=i.clientX;o.currentX=i.clientX;o.rowIndex=parseInt($(i.target).attr('row-index'));o.cellIndex=parseInt($(i.target).attr('cell-index'));o.colIndex=parseInt($(i.target).attr('col-index'));o.colList=$(t).find('colgroup col');o.leftCell=i.currentTarget.parentElement;o.rightCell=i.currentTarget.parentElement.nextElementSibling;o.leftColData={col:o.colList[o.colIndex],width:p(o.colIndex),originUnit:h.getWidthUnit($(t).find('colgroup col')[o.colIndex]).unit,limitWidth:parseInt($(o.leftCell).css('paddingLeft'))+parseInt($(o.leftCell).css('paddingRight'))+parseInt($(o.leftCell).css('minWidth')),padding:parseInt($(o.leftCell).css('paddingLeft'))+parseInt($(o.leftCell).css('paddingRight'))};o.rightColData={col:o.colList[o.colIndex+1],width:p(o.colIndex+1),originUnit:h.getWidthUnit($(t).find('colgroup col')[o.colIndex+1]).unit,limitWidth:parseInt($(o.rightCell).css('paddingLeft'))+parseInt($(o.rightCell).css('paddingRight'))+parseInt($(o.rightCell).css('minWidth')),padding:parseInt($(o.rightCell).css('paddingLeft'))+parseInt($(o.rightCell).css('paddingRight'))};if(e)e(o);else if(!e&&bm.toolManager.toolList['ToolTable'].status===1)bm.toolManager.toolList['ToolTable'].onTableColResizeStart(o)};function m(t){t.stopImmediatePropagation();t.preventDefault();o.currentX=t.clientX;if(o.currentX<=o.startX){o.sizeType='down'}
else{o.sizeType='up'};h.setColSize(o);if(i)i(o);else if(!i&&bm.toolManager.toolList['ToolTable'].status===1)bm.toolManager.toolList['ToolTable'].onTableColResizeUpdate(o)};function v(t){t.stopImmediatePropagation();t.preventDefault();if(n)n(o);else if(!n&&bm.toolManager.toolList['ToolTable'].status===1)bm.toolManager.toolList['ToolTable'].onTableColResizeEnd(o)}},colResizerDeActive:function(){if(this.resizerList.length==0)return;var t=this;bm.each(this.resizerList,function(){t.resizerGarbageList.push(this);mouseAdapter(this).offDrag();$(this).remove()});this.resizerList.length=0},setColSize:function(t){var e=Math.abs(t.currentX-t.startX),i=t.sizeType=='up'?t.leftColData.width+e:t.leftColData.width-e,n=t.sizeType=='down'?t.rightColData.width+e:t.rightColData.width-e;if((t.sizeType=='down'&&i<=t.leftColData.limitWidth)||(t.sizeType=='up'&&n<=t.rightColData.limitWidth)){return};this.colWidthChange(t.leftColData.col,i,'px');this.colWidthChange(t.rightColData.col,n,'px');var o=this.transformWidth(t.table,t.leftColData.col,'%'),a=this.transformWidth(t.table,t.rightColData.col,'%');this.colWidthChange(t.leftColData.col,o,'%');this.colWidthChange(t.rightColData.col,a,'%')}};$.fn.serializeObject=function(){var t={};var e=this.serializeArray();$.each(e,function(){if(t[this.name]){if(!t[this.name].push){t[this.name]=[t[this.name]]};t[this.name].push(this.value||'')}
else{t[this.name]=this.value||''}});return t};bm.formHandler={bindReadonlyList:{},bindReadonly:function(t,e){var i=e.target,n=e.attr?e.attr:'readonly',o=e.defaultValue?e.defaultValue:'';this.bindReadonlyDefaultControl(t,i,n,o);if(!this.bindReadonlyList[i]){this.bindReadonlyList[i]=[]};this.bindReadonlyList[i].push(t);var a=this,s=$(i).attr('type')?$(i).attr('type'):'';if(s=='checkbox'){$(i).off('change');$(i).on('change',function(e){a.bindReadonlyHandler(t,i,n,o)})}
else{$('[name=\''+$(i).attr('name')+'\']').off('change');$('[name=\''+$(i).attr('name')+'\']').on('change',{element:t,target:i},function(t){a.bindReadonlyHandler(t.data.element,t.data.target,n,o)})}},bindReadonlyDefaultControl:function(t,e,i,n){var o=$(e).attr('type')?$(e).attr('type'):'';if(o=='checkbox'){if($(e).is(':checked')){if(i=='readonly'){$(t).removeAttr('readonly')}
else if(i=='disabled'){$(t).removeAttr('disabled')};$(t).removeClass('disabled')}
else{if(i=='readonly'){$(t).attr('readonly','readonly')}
else if(i=='disabled'){$(t).attr('disabled','disabled')};$(t).addClass('disabled')}}
else{if($(e).val()==n){if(i=='readonly'){$(t).attr('readonly','readonly')}
else if(i=='disabled'){$(t).attr('disabled','disabled')};$(t).addClass('disabled')}
else{if(i=='readonly'){$(t).removeAttr('readonly')}
else if(i=='disabled'){$(t).removeAttr('disabled')};$(t).removeClass('disabled')}}},bindReadonlyHandler:function(t,e,i,n){var o=this.bindReadonlyList[e],a=$(e).attr('type')?$(e).attr('type'):'';bm.each(o,function(o,s){if(a=='checkbox'){if($(e).is(':checked')){if(i=='readonly'){$(t).removeAttr('readonly')}
else if(i=='disabled'){$(t).removeAttr('disabled')};$(t).removeClass('disabled')}
else{if(i=='readonly'){$(t).attr('readonly','readonly')}
else if(i=='disabled'){$(t).attr('disabled','disabled')};$(t).addClass('disabled')}}
else{if($(e).val()==n){if(i=='readonly'){$(t).attr('readonly','readonly')}
else if(i=='disabled'){$(t).attr('disabled','disabled')};$(t).addClass('disabled')}
else{if(i=='readonly'){$(t).removeAttr('readonly')}
else if(i=='disabled'){$(t).removeAttr('disabled')};$(t).removeClass('disabled')}}})},bindReadonlyNum:function(t,e){var i=this;i.bindReadonly(t,e);i.onlyNum(t)},bindEmailList:{},bindEmailPostField:function(t,e){var i=e.target;this.bindEmailPostHandler(t,i,!0);if(!this.bindEmailList[i]){this.bindEmailList[i]=[]};this.bindEmailList[i].push(t);var n=this;$('[name=\''+$(i).attr('name')+'\']').off('change');$('[name=\''+$(i).attr('name')+'\']').on('change',{element:t,target:i},function(t){n.bindEmailPostHandler(t.data.element,t.data.target)})},bindEmailPostHandler:function(t,e,i){if($(e).val()==''){$(t).removeAttr('readonly');$(t).removeClass('disabled');$(t).val('');if(!i){$(t).focus()}}
else{$(t).attr('readonly','readonly');$(t).addClass('disabled');$(t).val($(e).val())}},validAvoidOne:function(t){var e=$(t).attr('data-wv-valid');$(t).attr('data-wv-valid-save',e);$(t).removeAttr('data-wv-valid')},validRestoreOne:function(t){var e=$(t).attr('data-wv-valid-save');$(t).attr('data-wv-valid',e);$(t).removeAttr('data-wv-valid-save')},validAvoid:function(t){$(t).find('[data-wv-valid]').each(function(){var t=$(this).attr('data-wv-valid');$(this).attr('data-wv-valid-save',t);$(this).removeAttr('data-wv-valid')})},validRestore:function(t){$(t).find('[data-wv-valid-save]').each(function(){var t=$(this).attr('data-wv-valid-save');$(this).attr('data-wv-valid',t);$(this).removeAttr('data-wv-valid-save')})},selectValue:function(t,e){$(t).val(e.value)},addLineHandler:{},addLine:function(t,e){var i=$(e.container).find(e.target)[0].outerHTML;if(this.addLineHandler[t]){$(t).off('click',this.addLineHandler[t])};this.addLineHandler[t]=function(t){var o=/{delimiter}/gi,a=bm.getDelimiter(),s=i.replace(o,a),n=$(s).appendTo(e.container);$(n).show();bm.formUtil.reset(n);app.wvHandlerCrawling(n);app.additionalCrawling(n)};$(t).on('click',this.addLineHandler[t]);if(e.removeTemplate===!0||e.removeTemplate==='true'){$(e.container).find(e.target).remove()}},minusLineHandler:{},minusLine:function(t,e){if(this.minusLineHandler[t]){$(t).off('click',this.minusLineHandler[t])};this.minusLineHandler[t]=function(t){$(this).closest(e.target).remove()};$(t).on('click',this.minusLineHandler[t])},onlyKrHandler:{},onlyKr:function(t){if(this.onlyKrHandler[t]){$(t).off('keyup',this.onlyKrHandler[t]);$(t).off('blur',this.onlyKrHandler[t])};this.onlyKrHandler[t]=function(e){if(bm.valid.isOnlyKr(t.value)==!1){var i='한글만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyKrRegex,'')}};$(t).on('keyup',this.onlyKrHandler[t]);$(t).blur(this.onlyKrHandler[t])},onlyNotKrHandler:{},onlyNotKr:function(t){if(this.onlyKrHandler[t]){$(t).off('keyup',this.onlyNotKrHandler[t]);$(t).off('blur',this.onlyNotKrHandler[t])};this.onlyNotKrHandler[t]=function(e){if(bm.valid.isOnlyNotKr(t.value)==!1){var i='한글을 제외하고 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNotKrRegex,'')}};$(t).on('keyup',this.onlyNotKrHandler[t]);$(t).blur(this.onlyNotKrHandler[t])},onlyEnHandler:{},onlyEn:function(t){if(this.onlyEnHandler[t]){$(t).off('keyup',this.onlyEnHandler[t]);$(t).off('blur',this.onlyEnHandler[t])};this.onlyEnHandler[t]=function(e){if(bm.valid.isOnlyEn(t.value)==!1){var i='영문만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyEnRegex,'')}};$(t).on('keyup',this.onlyEnHandler[t]);$(t).blur(this.onlyEnHandler[t])},onlyNotEnHandler:{},onlyNotEn:function(t){if(this.onlyEnHandler[t]){$(t).off('keyup',this.onlyNotEnHandler[t]);$(t).off('blur',this.onlyNotEnHandler[t])};this.onlyNotEnHandler[t]=function(e){if(bm.valid.isOnlyNotEn(t.value)==!1){var i='한글을 제외하고 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNotEnRegex,'')}};$(t).on('keyup',this.onlyNotEnHandler[t]);$(t).blur(this.onlyNotEnHandler[t])},onlyNumHandler:{},onlyNum:function(t){if(this.onlyNumHandler[t]){$(t).off('keyup',this.onlyNumHandler[t]);$(t).off('blur',this.onlyNumHandler[t])};this.onlyNumHandler[t]=function(e){if(bm.valid.isOnlyNum(t.value)==!1){var i='숫자만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNumRegex,'')}};$(t).on('keyup',this.onlyNumHandler[t]);$(t).blur(this.onlyNumHandler[t])},onlyNumDotHandler:{},onlyNumDot:function(t){if(this.onlyNumDotHandler[t]){$(t).off('keyup',this.onlyNumDotHandler[t]);$(t).off('blur',this.onlyNumDotHandler[t])};this.onlyNumDotHandler[t]=function(e){if(bm.valid.isOnlyNumDot(t.value)==!1){var i='숫자와 소수점까지만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNumDotRegex,'')}};$(t).on('keyup',this.onlyNumDotHandler[t]);$(t).blur(this.onlyNumDotHandler[t])},onlyNumCommaHandler:{},onlyNumComma:function(t){if(this.onlyNumHandler[t]){$(t).off('keyup',this.onlyNumCommaHandler[t]);$(t).off('blur',this.onlyNumCommaHandler[t])};this.onlyNumCommaHandler[t]=function(e){var i=t.value.replace(/,/g,'');if(i.length>1&&i.indexOf('0')===0){i=i.slice(1,i.length)};if(bm.valid.isOnlyNum(i)==!1){var n='숫자만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(n);else alert(n);i=i.replace(bm.valid.onlyNumRegex,'')};t.value=bm.valid.addComma(i)};$(t).on('keyup',this.onlyNumCommaHandler[t]);$(t).blur(this.onlyNumCommaHandler[t])},onlyTextHandler:{},onlyText:function(t){if(this.onlyTextHandler[t]){$(t).off('keyup',this.onlyTextHandler[t]);$(t).off('blur',this.onlyTextHandler[t])};this.onlyTextHandler[t]=function(e){if(bm.valid.isOnlyText(t.value)==!1){var i='문자만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyTextRegex,'')}};$(t).on('keyup',this.onlyTextHandler[t]);$(t).blur(this.onlyTextHandler[t])},onlyNumAndEnHandler:{},onlyNumAndEn:function(t){if(this.onlyNumAndEnHandler[t]){$(t).off('keyup',this.onlyNumAndEnHandler[t]);$(t).off('blur',this.onlyNumAndEnHandler[t])};this.onlyNumAndEnHandler[t]=function(e){if(bm.valid.isOnlyNumAndEn(t.value)==!1){var i='영문, 숫자만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNumAndEnRegex,'')}};$(t).on('keyup',this.onlyNumAndEnHandler[t]);$(t).blur(this.onlyNumAndEnHandler[t])},onlyNumAndEnAndHyphenHandler:{},onlyNumAndEnAndHyphen:function(t){if(this.onlyNumAndEnAndHyphenHandler[t]){$(t).off('keyup',this.onlyNumAndEnAndHyphenHandler[t]);$(t).off('blur',this.onlyNumAndEnAndHyphenHandler[t])};this.onlyNumAndEnAndHyphenHandler[t]=function(e){if(bm.valid.isOnlyNumAndEnAndHyphen(t.value)==!1){var i='영문, 숫자, 하이픈만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNumAndEnAnHyphenRegex,'')}};$(t).on('keyup',this.onlyNumAndEnAndHyphenHandler[t]);$(t).blur(this.onlyNumAndEnAndHyphenHandler[t])},onlyNumAndKrHandler:{},onlyNumAndKr:function(t){if(this.onlyNumAndKrHandler[t]){$(t).off('keyup',this.onlyNumAndKrHandler[t]);$(t).off('blur',this.onlyNumAndKrHandler[t])};this.onlyNumAndKrHandler[t]=function(e){if(bm.valid.isOnlyNumAndKr(t.value)==!1){var i='한글, 숫자만 입력할 수 있습니다.';if(bm&&bm.toast)bm.toast(i);else alert(i);t.value=t.value.replace(bm.valid.onlyNumAndKrRegex,'')}};$(t).on('keyup',this.onlyNumAndKrHandler[t]);$(t).blur(this.onlyNumAndKrHandler[t])},maxbyteHandler:{},maxbyte:function(t,e){if(this.maxbyteHandler[t]){$(t).off('keyup',this.maxbyteHandler[t]);$(t).off('blur',this.maxbyteHandler[t])};this.maxbyteHandler[t]=function(i){if(parseInt(e)<bm.string.getByte(t.value)){t.value=bm.string.cutByteUtf8(t.value,parseInt(e),'')}};$(t).on('keyup',this.maxbyteHandler[t]);$(t).blur(this.maxbyteHandler[t])}};bm.httpSendFormPostByElemnt=function(t,e,i,n,o){bm.formHandler.deleteForm(t);var a=document.createElement('form');a.setAttribute('action',t);if(n){a.setAttribute('target',o?o:'_blank');if(!o){a.setAttribute('method','post')}}
else{if(o)a.setAttribute('target',o);a.setAttribute('method','post')};if(i){if(typeof i==='array'){var c=i.length,l,d,h;for(var r=0;r<c;r++){l=i[r];d=l.name;h=l.value;a=bm.formHandler.addParam(a,d,h)}}
else if(typeof i==='object'){for(var s in i){a=bm.formHandler.addParam(a,s,i[s])}}};for(var s in e){a=bm.formHandler.addParam(a,s,e[s])};document.body.appendChild(a);a.submit()};bm.formHandler.deleteForm=function(t){var n=document.body.getElementsByTagName('form'),o=n.length,e;for(var i=0;i<o;i++){e=n[i];if(e.action&&e.action==t){e.parentNode.removeChild(e)}}};bm.formHandler.addParam=function(t,e,i){var n=document.createElement('input');n.setAttribute('type','hidden');n.setAttribute('name',e);if(typeof i=='object'){i=JSON.stringify(i)};n.setAttribute('value',i);$(t).append(n);return t};bm.httpSendJsonPost=function(t,e,i,n,o){var a=n?'jsonp':'json';bm.httpSend(t,e,i,a,'post',1000000,!1,!1,null,o)};bm.httpSend=function(t,e,i,n,o,a,s,r,l,d){a=a===undefined?9000000:a;n=e.dataType?e.dataType:'json';o=o===undefined?'get':o;r=r===undefined?!0:r;e=e||{};var c=bm.makeQueryString(e);s=s?s:!1;Progress.ON();var h={url:t,dataType:n,data:c,type:o,timeout:a,success:function(t){Progress.OFF();if(i)i(t);else{if(t.result===!0||t.result==='true'){if(r){if(l)alert(l);else alert('정상적으로 처리되었습니다.')};if(s===!0||s==='true')window.location.reload()}
else{if(r)alert('처리되지 않았습니다. 다시 시도해주세요.')}}},error:function(t,e){Progress.OFF();var i=location.href;if(i.indexOf('weven.com')>-1||i.indexOf('weven.test')>-1){console.log(arguments)};if(e==='timeout'){alert('접속량이 많아 데이터를 불러오지 못했습니다. 다시 시도해주세요.')}
else{alert('일시적으로 데이터를 불러오지 못했습니다. 새로고침 후 다시 시도해주세요.')}}};if(d){h['beforeSend']=function(t){var e;for(e in d){t.setRequestHeader(e,d[e])}}};$.ajax(h)};bm.httpGet=function(t,e,i,n,o,a,s,r,l){a=a===undefined?9000000:a;n=n===undefined?'text':n;o=o===undefined?'get':o;s=s===undefined?!1:s;var h=null;if(e){h=bm.makeQueryString(e)};Progress.ON();var d={url:t,dataType:n,data:h,type:o,timeout:a,success:function(t){Progress.OFF();if(i)i(t);else{if(t.result===!0||t.result==='true'){if(s){if(r)alert(r);else alert('로딩이 완료되었습니다.')}}
else{if(s)alert('로딩에 실패하였습니다. 다시 시도해주세요.')}}},error:function(t,e){Progress.OFF();if(e==='timeout'){alert('접속량이 많아 데이터를 불러오지 못했습니다. 다시 시도해주세요.')}
else{alert('일시적으로 데이터를 불러오지 못했습니다. 새로고침 후 다시 시도해주세요.')}}};if(l){d['beforeSend']=function(t){var e;for(e in l){t.setRequestHeader(e,l[e])}}};$.ajax(d)};bm.form=function(t,e,i,n,o,a,s,r){useFormCheck=i&&i.length>0?!0:!1;return new Form(t,i,n,e,o,useFormCheck,a,s,r)};bm.formMultipart=function(t,e,i,n,o,a,s,r){useFormCheck=i&&i.length>0?!0:!1;return new FormMultipart(t,i,n,e,o,useFormCheck,a,s,r)};Form=function(t,e,i,n,o,s,r,l,d){this.extraData=n;this.onSubmit=r;this.onSubmitComplete=l;this.async=!0;this.confirmReturnValue='true';this.confirmUrl='';this.confirmMsg='';this.useFormCheck=s===undefined?!0:s;this.failMsg='';this.invalidMsgList=[];this.defaultInvalidMsg='';this.onSubmitMsg='';this.status=!0;this.autoEventBind=d===undefined?!0:d;e=e||[];var a=this;this.resetForm=function(t){if(a.form){$(a.form).find('input[type="submit"], input[type="image"], button[type="submit"]').off('click')};a.form=document[t];if(a.autoEventBind){$(a.form).find('input[type="submit"], input[type="image"], button[type="submit"]').on('click',function(){if(a.onSubmitMsg){if(confirm(a.onSubmitMsg))return a.start();else return!1}
else return a.start()})}};this.resetForm(t);this.cancelSubmit=function(){a.status=!1};if(this.autoEventBind){$(a.form).find('input[type="submit"], input[type="image"], button[type="submit"]').on('click',function(){if(a.onSubmitMsg){if(confirm(a.onSubmitMsg))return a.start();else return!1}
else return a.start()})};this.start=function(n){if(!n){a.status=!0;if(a.onSubmit)a.onSubmit();if(a.status==!1)return!1};Progress.ON();var c=a.useFormCheck===!1?!0:bm.formCheck(t,e,i,a.invalidMsgList,a.defaultInvalidMsg);if(c&&a.async){var l={};var r=$(a.form).find('input, textarea, select').not('input[type="radio"], input[type="checkbox"]'),d=r.length,o;for(var s=0;s<d;s++){o=r[s];if(/submit|image/i.test(o.type))continue;l[o.name]=o.value};r=$(a.form).find('input[type="radio"], input[type="checkbox"]');d=r.length;for(s=0;s<d;s++){o=r[s];if(o.checked)l[o.name]=o.value};if(a.extraData){for(var h in a.extraData)l[h]=a.extraData[h]};a.extraData=bm.radioAndCheckboxDefaultValueCheck(f,l);$.ajax({url:a.form.action,type:'POST',dataType:'json',data:l,success:function(t){Progress.OFF();if(a.onSubmitComplete)a.onSubmitComplete(t);if((Object.prototype.toString.call(t)=='[object String]'&&t.indexOf(a.confirmReturnValue)>-1)||t.result==a.confirmReturnValue){a.confirmMsg&&alert(a.confirmMsg);if(a.confirmUrl)window.location.href=a.confirmUrl}
else{a.failMsg&&alert(a.failMsg)}},error:function(t){Progress.OFF();alert('전송에러 입니다 \n statusCode : '+err.status+'\n statusText : '+err.statusText);trace(t)}});return!1}
else{Progress.OFF();return c}}};FormMultipart=function(t,e,i,n,o,s,r,l,d){this.extraData=n;this.onSubmit=r;this.onSubmitComplete=l;this.onProgress=null;this.async=!0;this.confirmReturnValue='true';this.confirmUrl='';this.confirmMsg='';this.useFormCheck=s===undefined?!0:s;this.failMsg='';this.invalidMsgList=o||[];this.defaultInvalidMsg='';this.onSubmitMsg='';this.status=!0;this.isReady=!0;this.autoEventBind=d===undefined?!0:d;e=e||[];this.tempList=[];this.tempNameList=[];this.addedExtraData=null;var a=this;this.resetForm=function(t){if(a.form){$(a.form).find('input[type="submit"], input[type="image"], button[type="submit"]').off('click')};a.form=document[t];if(a.autoEventBind){$(a.form).find('input[type="submit"], input[type="image"], button[type="submit"]').on('click',function(){if(a.onSubmitMsg){if(confirm(a.onSubmitMsg))return a.start();else return!1}
else return a.start()})}};this.resetForm(t);this.cancelSubmit=function(){a.status=!1};this.start=function(n){if(!n){a.status=!0;if(a.onSubmit)a.onSubmit();if(a.status==!1)return!1;if(a.isReady==!1)return!1};a.isReady=!1;a.tempList=[];a.tempNameList=[];Progress.ON();var r=a.useFormCheck===!1?!0:bm.formCheck(t,e,i,a.invalidMsgList,a.defaultInvalidMsg);if(r&&a.async){if(a.form.async&&a.form.async.value=='false')a.form.async.value='true';var s={};if(a.extraData){if(a.addedExtraData){$.extend(a.extraData,a.addedExtraData)};for(var o in a.extraData)s[o]=a.extraData[o]}
else if(a.addedExtraData){a.extraData=a.addedExtraData;for(var o in a.extraData)s[o]=a.extraData[o]};a.extraData=bm.radioAndCheckboxDefaultValueCheck(a.form,s);$(a.form).ajaxForm({data:s,dataType:'json',uploadProgress:function(t,e,i,n){if(a.onProgress)a.onProgress({event:t,position:e,total:i,percentComplete:n})},complete:function(t){Progress.OFF();t=t.responseText;if(t.indexOf('{')==0){t=$.parseJSON(t)};var i=a.tempList.length;for(var e=0;e<i;e++){$(a.tempList[e]).attr('name',a.tempNameList[e])};a.isReady=!0;if(a.onSubmitComplete)a.onSubmitComplete(t);if((Object.prototype.toString.call(t)=='[object String]'&&t.indexOf(a.confirmReturnValue)>-1)||t.result==a.confirmReturnValue){a.confirmMsg&&alert(a.confirmMsg);if(a.confirmUrl)window.location.href=a.confirmUrl}
else{a.failMsg&&alert(a.failMsg)};return!1},error:function(t){Progress.OFF();a.isReady=!0;alert('전송에러 입니다 \n statusCode : '+t.status+'\n statusText : '+t.statusText)}});$(a.form).submit();return!1}
else{a.isReady=!0;Progress.OFF();return r}}};bm.setStyles=function(t,e){var n;for(var i in e){if(i=='float'){n=(typeof t.style.cssFloat=='undefined')?((typeof t.style.styleFloat=='undefined')?'float':'styleFloat'):'cssFloat'}
else n=i;t.style[n]=e[i]}};bm.getStyles=function(t,e){var i,a,n,o;o={};a=e.length;for(i=0;i<a;i++){n=e[i];o[n]=bm.getStyle(t,n)};return o};bm.getStylesByObjectKeys=function(t,e){return bm.getStyles(t,Object.keys(e))};bm.getStyle=function(t,e,i){e=bm.__getCssUnitText(e);if(i===undefined||i===null){i=!1};if(t==null)return;t=t[0]?t[0]:t;if(i==!0&&t.style[e]=='auto')return t.style[e];else if(t.currentStyle!=null)return t.currentStyle[e];else if(document.WEVEN_IFRAME){return document.WEVEN_IFRAME.document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}
else return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)};bm.getStyleInt=function(t,e){var i=bm.getStyle(t,e);i=parseInt(i);i=isNaN(i)?0:i;return i};bm.getStyleTransformValues=function(t){var n=bm.getStyle(t,'transform');if(n==='none')return[1,0,0,1,0,0];var i=n.slice('matrix('.length,n.lastIndexOf(')')).split(','),e,o=i.length;for(e=0;e<o;e++){i[e]=parseFloat(i[e])};return i};bm.getStyleTransformValue=function(t,e){var i=bm.getStyleTransformValues(t);if(e.toLowerCase()=='scalex')return i[0];else if(e.toLowerCase()=='scaley')return i[3];else if(e.toLowerCase()=='skewx')return i[1];else if(e.toLowerCase()=='skewy')return i[2];else if(e.toLowerCase()=='translatex')return i[4];else if(e.toLowerCase()=='translatey')return i[5];return null};bm.getMatrixValue=function(t,e){if(e.toLowerCase()=='scalex')return t[0];else if(e.toLowerCase()=='scaley')return t[3];else if(e.toLowerCase()=='skewx')return t[1];else if(e.toLowerCase()=='skewy')return t[2];else if(e.toLowerCase()=='translatex')return t[4];else if(e.toLowerCase()=='translatey')return t[5];return null};bm.getStyleCalcValueAtPx=function(t,e,i){var h=!1,a=$(t).parent(),c;if(e.toLowerCase().indexOf('width')>-1){c=a.outerWidth()-parseFloat((a).css('padding-left'))-parseFloat((a).css('padding-right'))}
else{c=a.outerHeight()-parseFloat((a).css('padding-top'))-parseFloat((a).css('padding-bottom'))};var n=bm.getStyle(t,e);if(i)n=i;n=n.replace('calc(','');n=n.slice(0,n.lastIndexOf(')'));if(!isNaN(parseFloat(n)))h=!0;var o=n.split(' + '),l='+',d=1;if(!h){if(o.length==1){o=n.split(' - ');l='-';d++};if(o.length==1){o=n.split(' * ');l='*';d++};if(o.length==1){o=n.split(' / ');l='/';d++}};if(d>1){if(e.toLowerCase().indexOf('width')>-1){n=t.offsetWidth}
else{n=t.offsetHeight}}
else{var s=0,r=0;s=f(o[0]);if(!h)r=f(o[1]);switch(l){case'+':n=s+r;break;case'-':n=s-r;break;case'*':n=s*r;break;case'/':n=s/r;break}};return n;function f(t){if(t.indexOf('%')>-1){t=parseFloat(t.replace('%',''));return c*t/100}
else if(t.indexOf('px')>-1){t=parseFloat(t.replace('px',''));return t}}};bm.addClass=function(t,e){var i=t.getAttribute('class');if(!i){t.setAttribute('class',e);return this}
else{if(i.indexOf(e)>-1)return this;else{i=i+' '+e;t.setAttribute('class',e);return this}}};bm.removeClass=function(t,e){var i=t.getAttribute('class');if(!i)return this;else{if(i.indexOf(e)>-1){i=i.replace(e,'');t.setAttribute('class',e);return this}
else{return this}}};bm.removeInlineStyleProp=function(t,e){var i=$(t).attr('style'),n='';if(bm.type.isObject(e)){e=Object.keys(e)};if(i){var a;if(e['length']){var o,s,r=e.length;for(o=0;o<r;o++){s=bm.__getCssUnitText(e[o]);a=new RegExp('((?!-).)'+s+'[^;]+;?','g');n=i.replace(a,'');if(n==i)n=i.replace(new RegExp('(^)'+s+'[^;]+;?','g'),'');i=n}}
else{a=new RegExp('((?!-).)'+e+'[^;]+;?','g');n=i.replace(a,'');if(n==i)n=i.replace(new RegExp('(^)'+e+'[^;]+;?','g'),'');i=n}};$(t).attr('style',i)};bm.__getCssUnitText=function(t){var e=/[A-Z]/g;if(t.search(e)>-1){t=bm.string.toUnitFromUpperCase(t,'-')};return t};bm.getResponsivePrefixListTemp=function(t){return[(t=='col'?t+'-':t),t+'-xs-',t+'-sm-',t+'-md-',t+'-lg-',t+'-xl-']};bm.getResponsivePrefixList=function(t){return[(t=='col'?t+'-':t),t+'-sm-',t+'-md-',t+'-lg-',t+'-xl-']};bm.getSelectorByCssText=function(t){return t.slice(0,t.indexOf('{'))};bm.getBodyByCssText=function(t){return t.slice(t.indexOf('{')+1,t.lastIndexOf('}'))};var ROSPONSIVE_SIZE={};ROSPONSIVE_SIZE.UP_768_TEXT='sm';ROSPONSIVE_SIZE.UP_992_TEXT='md';ROSPONSIVE_SIZE.UP_1200_TEXT='lg';ROSPONSIVE_SIZE.UP_1600_TEXT='xl';bm.getAllResponsiveSizeTextBySize=function(){return[ROSPONSIVE_SIZE.UP_1600_TEXT,ROSPONSIVE_SIZE.UP_1200_TEXT,ROSPONSIVE_SIZE.UP_992_TEXT,ROSPONSIVE_SIZE.UP_768_TEXT,'']};bm.getResponsiveSizeTextBySize=function(t){var e='';if(t>=768&&t<992){e+='sm'}
else if(t>=992&&t<1200){e+='md'}
else if(t>=1200&&t<1600){e+='lg'}
else if(t>=1600){e+='xl'};return e};bm.getResponsiveSizeText=function(t){if(!t)t=window;var e=$(t).width();if(t.scrollbars.visible){e+=17};return bm.getResponsiveSizeTextBySize(e)};bm.getResponsivePrefix=function(t,e){var i;switch(t){case'margin-top':i='mt';break;case'margin-bottom':i='mb';break;case'margin-left':i='ml';break;case'margin-right':i='mr';break;case'padding-top':i='pt';break;case'padding-bottom':i='pb';break;case'padding-left':i='pl';break;case'padding-right':i='pr';break;case'width':i='col';break};var n=bm.getResponsiveSizeText(e);if(n!=''){i=i+'-'+n+'-'}
else{i=i+'-'};return i};bm.getAllPrefix=function(t){var o=bm.getAllResponsiveSizeTextBySize(),a=[];for(var i=0;i<o.length;i++){var e='';switch(t){case'margin-top':e='mt';break;case'margin-bottom':e='mb';break;case'margin-left':e='ml';break;case'margin-right':e='mr';break;case'padding-top':e='pt';break;case'padding-bottom':e='pb';break;case'padding-left':e='pl';break;case'padding-right':e='pr';break;case'width':e='col';break};var n=o[i];if(n!=''){e=e+'-'+n+'-'}
else{e=e+'-'};a.push(e)};return a};bm.getResponsiveSpaceByResponsiveText=function(t,e){var i;switch(t){case'margin-top':i='mt';break;case'margin-bottom':i='mb';break;case'margin-left':i='ml';break;case'margin-right':i='mr';break;case'padding-top':i='pt';break;case'padding-bottom':i='pb';break;case'padding-left':i='pl';break;case'padding-right':i='pr';break;case'width':i='col';break};if(e!=''){i=i+'-'+e+'-'}
else if(e==''&&i=='col'){i=i+'-'}
else{i=i};return i};bm.removeClassAtPrefix=function(t,e){if($(t).attr('class')){var a=$(t).attr('class').split(' '),r=a.length,i,o,s;for(var n=0;n<r;n++){i=a[n];if(i.indexOf(e)==0){o=i.slice(e.length,i.length);s=parseInt(o);if(o.indexOf('per')==0||isNaN(s)==!1){$(t).removeClass(i)}}}}};bm.checkDirectSpacePrefixClass=function(t,e){switch(e){case'margin-top':e='mt';break;case'margin-bottom':e='mb';break;case'margin-left':e='ml';break;case'margin-right':e='mr';break;case'padding-top':e='pt';break;case'padding-bottom':e='pb';break;case'padding-left':e='pl';break;case'padding-right':e='pr';break;case'width':e='col';break};var f=$(t).attr('data-wv-direct-space-prefix-'+e);if(f===undefined){if($(t).attr('class')){var n=bm.getResponsivePrefixList(e),r=$(t).attr('class').split(' '),l=[],c=r.length,a,s,d;for(var o=0;o<c;o++){a=r[o];var h=n.length;for(var i=0;i<h;i++){if(a.indexOf(n[i])==0){s=a.slice(n[i].length);d=parseInt(s);if(s.indexOf('per')==0||isNaN(d)==!1){l.push(n[i]);break}}}};$(t).attr('data-wv-direct-space-prefix-'+e,l.join(','))}
else{$(t).attr('data-wv-direct-space-prefix-'+e,'')}}};bm.getNotAppliedSpacePrefixClass=function(t,e,i){switch(i){case'margin-top':i='mt';break;case'margin-bottom':i='mb';break;case'margin-left':i='ml';break;case'margin-right':i='mr';break;case'padding-top':i='pt';break;case'padding-bottom':i='pb';break;case'padding-left':i='pl';break;case'padding-right':i='pr';break;case'width':i='col';break};var l=bm.getResponsivePrefixList(i),o=l.concat(),a=o.indexOf(e);if(a!=-1){o=o.slice(0,a)};var n=$(t).attr('data-wv-direct-space-prefix-'+i);if(n!=''){n=n.split(',');var r=n.length;for(var s=0;s<r;s++){a=o.indexOf(n[s]);if(a>-1){o=o.slice(a+1)}};if(n.indexOf(e)==-1){n.push(e);$(t).attr('data-wv-direct-space-prefix-'+i,n.join(','))}}
else{$(t).attr('data-wv-direct-space-prefix-'+i,e)};return o};bm.getAppliedSpaceClass=function(t,e){var r='';if($(t).attr('class')&&$(t).attr('class').match(e)){var a=$(t).attr('class').split(' '),l=a.length,i,o,s;for(var n=0;n<l;n++){i=a[n];if(i.indexOf(e)==0){o=i.slice(e.length);s=parseInt(o);if(o.indexOf('per')==0||isNaN(s)==!1){r=i;break}}}};return r};bm.getAppliedSpaceValueAt=function(t,e,i,n){var o=null;if(i!=''){o=parseInt(i.substr(n.length))};if(o===null){o=bm.getStyle($(e)[0],t,!0)};if(!o)o=0;else if(o=='auto')o='auto';else o=parseInt(o);return o};bm.replaceInsetAndPrefixCss=function(t){if(!t)return;$(bm.styleSheetManager.insetBlockResId).each(function(e,i){if(t.includes(i)){var d=i,a=i.indexOf('inset'),s=i.substring(a,i.indexOf(';',a)),r=s.split(':'),n=r[r.length-1].replace(/^\s+/,'').split(' '),o='';switch(n.length){case 1:o='top: '+n[0]+'; right: '+n[0]+'; bottom: '+n[0]+'; left: '+n[0];break;case 2:o='top: '+n[0]+'; right: '+n[1]+'; bottom: '+n[0]+'; left: '+n[1];break;case 3:o='top: '+n[0]+'; right: '+n[1]+'; bottom: '+n[2]+'; left: '+n[1];break;case 4:o='top: '+n[0]+'; right: '+n[1]+'; bottom: '+n[2]+'; left: '+n[3];break;default:break};var l=i.replace(s,o);t=t.replace(d,l)}});$(bm.styleSheetManager.prefixBlockResId).each(function(e,i){if(t.includes(i)){var r=i;if(i.indexOf('appearance')==-1)return;var a=i.indexOf('appearance'),n=i.substring(a,i.indexOf(';',a)),o=n+';';o+='-webkit-'+n+';';o+='-moz-'+n+';';o+='-ms-'+n+';';o+='-o-'+n+';';var s=i.replace(n,o);t=t.replace(r,s)}});return t};bm.__isEnterPlay=!1;bm.__enterFnList=[];bm.enterFPS=20;bm.onEnter=function(){if(this.__isEnterPlay==!1)return;var e=this.__enterFnList.length;while(e--)this.__enterFnList[e]();var t=this;setTimeout(function(){t.onEnter()},1000/t.enterFPS)};bm.onEnterRegist=function(t,e){if(this.__enterFnList.indexOf(t)>-1)return;this.__enterFnList.push(t);if(this.__isEnterPlay==!1){this.__isEnterPlay=!0;this.onEnter(e)}};bm.onEnterRemove=function(t){var e=this.__enterFnList.indexOf(t);if(e==-1)return;this.__enterFnList.splice(e,1);if(this.__enterFnList.length==0&&this.__isEnterPlay==!0)this.__isEnterPlay=!1};bm.cookie={setCookie:function(t,e,i){var n=new Date();n.setDate(n.getDate()+i);var o=escape(e)+((i==null)?'':'; expires='+n.toGMTString());document.cookie=t+'='+o},deleteCookie:function(t){var e=new Date();e.setDate(e.getDate()-1);document.cookie=t+'= ; expires='+e.toGMTString()},getCookie:function(t){t=t+'=';var e=document.cookie,i=e.indexOf(t),o='';if(i!=-1){i+=t.length;var n=e.indexOf(';',i);if(n==-1)n=e.length;o=e.substring(i,n)};return unescape(o)}};bm.image={srcChange:function(t,e,i){var n;if(t.length){bm.each(t,function(t,o){n=o.getAttribute('src');o.setAttribute('src',n.replace(e,i))})}
else{n=t.getAttribute('src');t.setAttribute('src',n.replace(e,i))}}};bm.input={placeHolderList:{},__registPlaceHolder:function(t){var e=this;t.onfocus=function(){e.placeHolderList[this]=this.value;this.value=''};t.onblur=function(){if(this.value=='')this.value=e.placeHolderList[this]}},registPlaceHolder:function(t){if(t.length){var i=t.length;for(var e=0;e<i;e++){this.__registPlaceHolder(t[e])}}
else this.__registPlaceHolder(t)}};bm.each=function(t,e){var n,i=0;if(!t||t.length==0)return;if(t.length)while(i<t.length)e.call(t[i],i,t[i],i++);else for(n in t){e.call(t[i],n,t[n],i++)}};bm.indexOf=function(t,e){var i=t.length;while(i--)if(t[i]===e)return i;return-1};bm.parsing={cutStr:function(t,e,i){i=(t.length>i)?i:t.length;return t.substring(0,e)+t.substring(i,t.length)},parseStrToObj:function(t,e,i,n){i=i?i:!1;n=n?n:!1;t=bm.string.trim(t);if(!e){t=$.trim(t);e={};t=t.substr(1,t.length-2)};var v=/\s+[:]\s+|\s+[:]|[:]\s+/g,b=/\s+[,]\s+|\s+[,]|[,]\s+/g,y=/\s+[{]\s+|\s+[{]|[{]\s+/g,w=/\s+[}]\s+|\s+[}]|[}]\s+/g;t=t.replace(v,':');t=t.replace(b,',');t=t.replace(y,'{');t=t.replace(w,'}');t=$.trim(t);while(t.indexOf('{')>-1){var l=t.indexOf('{'),a=t.indexOf('}'),c=t.slice(t.indexOf('{')+1,a),f=-1,r=a;while(1){f=c.indexOf('{',f+1);if(f==-1){r=r+1;break}
else{r=t.indexOf('}',r+1);c=t.slice(l+1,r)}};a=r;var g={};bm.parsing.parseStrToObj(c,g);t=bm.parsing.cutStr(t,l,a);a=(t.charAt(t.length-1)==':')?t.length-1:t.indexOf(':,');l=t.lastIndexOf(',',a)==-1?0:t.lastIndexOf(',',a)+1;var m=t.slice(l,a);t=bm.parsing.cutStr(t,l,a+2);e[m]=g};t=t.replace(/[,]$/,'');var d=t.split(','),h=d.length,p,s,o,u=/^['|"]|['|"]$/g;while(h--){p=d[h].split(':');s=bm.string.trim(p[0]);o=d[h].slice(s.length+1,d[h].length);if(i){s=s.replace(/"/g,'')};if(n){o=o.replace(u,'');e[s]=bm.string.trim(o)}
else{if(isNaN(parseFloat(o))){o=o.replace(u,'');e[s]=bm.string.trim(o)}
else{const formerV=o;o=parseFloat(o);if(formerV['length']===String(o)['length']){e[s]=o}
else{e[s]=formerV}}}};return e},removeObjKeyQuot:function(t){var i={};for(var e in t){var n=t[e];e=e.replace(/"/g,'');i[e]=n};return i},getVideoInfo:function(t){t.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);var e;if(RegExp.$3.indexOf('youtu')>-1){e='youtube'}
else if(RegExp.$3.indexOf('vimeo')>-1){e='vimeo'};return{type:e,id:RegExp.$6}}};bm.popup={open:function(t,e,i,n,o,a,s,r,d,h,c,f,p){var l='';l+=s?'scrollbars='+s:'';l+=r?',resizable='+r:'';l+=i?',width='+i:'';l+=n?',height='+n:'';l+=o?',left='+o:'';l+=a?',top='+a:'';l+=d?',toolbar='+d:'';l+=h?',location='+h:'';l+=c?',directories='+c:'';l+=f?',status='+f:'';l+=p?',menubar='+p:'';window.open(t,e,l)}};bm.eventTrigger={eventList:[],list:[],get:function(t){var e=this.list.indexOf(t);if(e>-1)return this.eventList[e];else return this.make(t)},make:function(t){this.list.push(t);this.eventList.push(new bm.Events());return this.eventList[this.eventList.length-1]}};function listener(t){return new __listener(t)};function __listener(t){var e='',i='',n='',o=function(){if(e==''||i==''){if(typeof window.addEventListener!='undefined'){e='addEventListener';i='removeEventListener'}
else{e='attachEvent';n='on';i='detachEvent'}}};this.add=function(i,a){if(!a)return;if(t.length){t=t[0]};o();try{t[e](n+i,a)}catch(s){}};this.remove=function(e,a){if(!a)return;o();if(t.length){t=t[0]};try{t[i](n+e,a)}catch(s){}}};var events=function(t){return bm.eventTrigger.get(t)};bm.Events=function(){this.trigger={}};bm.Events.prototype={addListener:function(t,e){if(!this.trigger[t])this.trigger[t]=[];this.trigger[t].push(e)},removeListener:function(t,e){if(e){if(this.hasListener(t,e)==!1)return;var i=this.trigger[t].indexOf(e);this.trigger[t].splice(i,1);if(this.trigger[t].length==0)delete this.trigger[t]}
else{this.trigger[t].length=0}},hasListener:function(t,e){if(this.trigger[t]&&this.trigger[t].indexOf(e)>-1)return!0;else return!1},dispatch:function(t,e){if(t===''){throw new Error('Error [bm.Events.Event]:dispatch() ==> type is not defined');return};var i={};i.type=t;i.data=e;if(this.trigger[t]){var o=this.trigger[t].length;while(o--){var n=this.trigger[t][o];n.call(n,i)}}}};var __mouseAdapter={keyList:[],valueList:{},is:function(t){return this.keyList.indexOf(t)==-1?!1:!0},add:function(t,e){if(this.is(t)==!1){this.valueList[this.keyList.length]=e;this.keyList.push(t)}},get:function(t){var e=this.keyList.indexOf(t);return this.valueList[e]}};mouseAdapter=function(t,e){if(t&&t.length)t=t[0];if(__mouseAdapter.is(t)==!1){__mouseAdapter.add(t,new bm.MouseAdapter(t,e))};return __mouseAdapter.get(t)};bm.MouseAdapter=function(t){if(!t){throw new Error('Error [bm.MouseAdapter]:MouseAdapter() ==> 타겟이 없습니다. ');return};if(t.length)t=t[0];this.container=null;this.getContainer=function(){if(!this.container){this.container=document.body};return this.container};this.target=t;this.fnList={};this.__draggingStop=!1;this.__dragEnable=!1;this.isPrevent=!1;this.onDragStartFn=null;this.onDraggingFn=null;this.onDragUpFn=null;var a=bm.isMobile?'touchstart':'mousedown',n=bm.isMobile?'touchmove':'mousemove',i=bm.isMobile?'touchend':'mouseup',o=bm.isMobile?'touchend':'mouseleave',e=this;this.__start=function(t){if(t.button==2)return;if(e.onDragStartFn)e.onDragStartFn.call(e,t);var a=e.getContainer();listener(a).add(n,e.__move);listener(a).add(i,e.__unbind);listener(a).add(o,e.__unbind);listener(window).add(i,e.__unbind)};this.__move=function(t){if(!e.isPrevent){t.preventDefault()};if(e.__draggingStop==!0){e.__unbind(t);return};if(e.__dragEnable==!1){e.__unbind(t);return};if(bm.isMobile){t.clientX=t.targetTouches[0].clientX;t.clientY=t.targetTouches[0].clientY};e.onDraggingFn.call(e,t)};this.__unbind=function(t){if(t&&e.onDragUpFn){if(bm.isMobile&&t.changedTouches){t.clientX=t.changedTouches[0].clientX;t.clientY=t.changedTouches[0].clientY};e.onDragUpFn.call(e,t)};var a=e.getContainer();listener(a).remove(n,e.__move);listener(a).remove(i,e.__unbind);listener(a).remove(o,e.__unbind);listener(window).remove(i,e.__unbind);if(e.__draggingStop==!0){e.__draggingStop=!1}};return this};bm.MouseAdapter.prototype={onOrientaion:function(t){function e(e){var i=parseFloat(event.alpha),n=parseFloat(event.beta),o=parseFloat(event.gamma);i=isNaN(i)?0:i/360;n=isNaN(n)?0:n/180;o=isNaN(o)?0:o/100;e.x=i;e.y=n;e.z=o;if(t)t(e)};this.target.addEventListener('deviceorientation',e)},onDown:function(t){var n=this.target,e=this;function i(i){if(bm.isMobile){i.clientX=i.targetTouches[0].clientX;i.clientY=i.targetTouches[0].clientY};t.call(e,i)};this.fnList.ondown=i;listener(n).add(bm.isMobile?'touchstart':'mousedown',i);return e},offDown:function(){if(this.fnList.ondown){listener(this.target).remove(bm.isMobile?'touchstart':'mousedown',this.fnList.ondown);delete this.fnList.ondown}},onUp:function(t){var n=this.target,e=this;function i(i){t.call(e,i)};this.fnList.onup=i;listener(n).add(bm.isMobile?'touchend':'mouseup',i);return e},offUp:function(){if(this.fnList.onup){listener(this.target).remove(bm.isMobile?'touchend':'mouseup',this.fnList.onup);delete this.fnList.onup}},__dragStart:function(t){var i=this.target;this.__dragEnable=!0;function e(e){if(bm.isMobile){e.clientX=e.targetTouches[0].clientX;e.clientY=e.targetTouches[0].clientY};t(e)};this.fnList.drag=e;listener(i).add(bm.isMobile?'touchstart':'mousedown',e)},onDrag:function(t,e,i,n,o){var a=this;this.onDraggingFn=t;this.onDragStartFn=i;this.onDragUpFn=e;this.isPrevent=n;this.container=o;this.__dragStart(this.__start);return a},draggingStop:function(){this.__draggingStop=!0;this.__unbind()},offDrag:function(){this.__dragEnable=!1;if(this.fnList.drag){listener(this.target).remove(bm.isMobile?'touchstart':'mousedown',this.fnList.drag);delete this.fnList.drag}},onWheel:function(t){var n=this.target,o=this;if(bm.isMobile)return;function e(e){var i=window.event||e,n=i.detail?i.detail*(-120):i.wheelDelta;e.delta=(n<0)?-1:1;t.call(o,e)};this.fnList.onwheel=e;var i=(/Firefox/i.test(navigator.userAgent))?'DOMMouseScroll':'mousewheel';if(window['addEventListener'])n.addEventListener(i,e);else n.attachEvent('on'+i,e);return o},offWheel:function(){if(bm.isMobile)return;if(this.fnList.onwheel){var t=(/Firefox/i.test(navigator.userAgent))?'DOMMouseScroll':'mousewheel';if(window['addEventListener'])this.target.removeEventListener(t,this.fnList.onwheel);else this.target.detachEvent('on'+t,this.fnList.onwheel);delete this.fnList.onwheel}},dragStop:function(){this.offDrag()},dragStart:function(t){var s=bm.getStyle(this.target,'position');this.onDrag(l,d,r,!1,t);var i,n,o,a,e;function r(t){e=t.target;i=t.clientX;n=t.clientY;if(s!='absolute'){e.style.position='absolute'}};function l(t){o=t.clientX-i;a=t.clientY-n;e.style.left=e.offsetLeft+o+'px';e.style.top=e.offsetTop+a+'px';i=t.clientX;n=t.clientY};function d(t){}}};bm.scriptLoader=function(t,e,i){var n;n=o();document.getElementsByTagName('head')[0].appendChild(n);n.src=e;function o(){var e;e=document.createElement('script');e.type='text/javascript';e.charset=i||'utf-8';if(window['addEventListener']){e.onload=function(){e.onload=null;if(t)t(e)}}
else{e.onreadystatechange=function(){var i;e.onreadystatechange=null;i=e.readyState;if(t&&i=='loaded'||i=='complete')t(e)}};return e}};bm.multiScriptLoader=function(t){var e,n,i,o;e={length:0};n=0;i=1,o=arguments.length;while(i<o)e[e.length++]=s(arguments[i++]);function a(){(++n==e.length&&t)&&t(e)};function s(e){var i;i=n();document.getElementsByTagName('head')[0].appendChild(i);i.src=e;function n(){var e;e=document.createElement('script');e.type='text/javascript';e.charset='utf-8';if(window['addEventListener']){e.onload=function(){e.onload=null;a()}}
else{e.onreadystatechange=function(){var i;e.onreadystatechange=null;i=e.readyState;if(t&&i=='loaded'||i=='complete')a()}};return e};return i}};bm.imageLoader=function(t){var e,n,i,o;e={length:0};n=0;i=1,o=arguments.length;while(i<o)e[e.length++]=s(arguments[i++]);function a(){if(++n==e.length)t(e)};function s(t){var e,i;e=new Image;if(window['HTMLCanvasElement']){e.onload=a}
else{(i=function(){e.complete?a():setTimeout(i,10)})()};e.src=t;return e}};bm.ajaxLoader=function(t,e,i,n,o){if(!bm.ajaxLoader.xhr){if(window['XMLHttpRequest']){bm.ajaxLoader.xhr=function(){return new XMLHttpRequest}}
else{bm.ajaxLoader.xhr=(function(){var e,i,n;e=['Microsoft.XMLHTTP','MSXML2.XMLHTTP','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP.4.0','MSXML2.XMLHTTP.5.0'];i=e.length;while(i--){try{n=e[i];new ActiveXObject(n)}catch(t){continue};break};return function(){return new ActiveXObject(n)}})()}};i=i||'GET';e+=i=='GET'&&n?'?'+n:'';o=o?!0:!1;var a;a=s();a.open(i,e,o);a.send(i=='POST'&&n?n:'');if(o&&t)t(a);function s(){var e,i;e=bm.ajaxLoader.xhr();if(o)return e;e.onreadystatechange=function(){if(e.readyState!=4||i<0)return;clearTimeout(i),i=-1;if(t){if(e.status==200||e.status==0){t(e.responseText)}
else{t('error:'+e.status)}}};i=setTimeout(function(){if(i<0)return;i=-1;if(t)t('timeout')},5000);return e}};!function(t,e,i){function s(t,i){var o=e.createElement(t||'div'),n;for(n in i)o[n]=i[n];return o};function o(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t};function g(t,e,i,n){var o=['opacity',e,~~(t*100),i,n].join('-'),a=.01+i/n*100,s=Math.max(1-(1-t)/e*(100-a),t),d=r.substring(0,r.indexOf('Animation')).toLowerCase(),h=d&&'-'+d+'-'||'';return c[o]||(l.insertRule('@'+h+'keyframes '+o+'{0%{opacity:'+s+'}'+a+'%{opacity:'+t+'}'+(a+.01)+'%{opacity:1}'+(a+e)%100+'%{opacity:'+t+'}100%{opacity:'+s+'}}',l.cssRules.length),c[o]=1),o};function d(t,e){var a=t.style,o,n;if(a[e]!==i)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(n=0;n<h.length;n++){o=h[n]+e;if(a[o]!==i)return o}};function n(t,e){for(var i in e)t.style[d(t,i)||i]=e[i];return t};function f(t){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var e in o)t[e]===i&&(t[e]=o[e])};return t};function p(t){var e={x:t.offsetLeft,y:t.offsetTop};while(t=t.offsetParent)e.x+=t.offsetLeft,e.y+=t.offsetTop;return e};var h=['webkit','Moz','ms','O'],c={},r,l=function(){var t=s('style',{type:'text/css'});return o(e.getElementsByTagName('head')[0],t),t.sheet||t.styleSheet}(),u={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:'#000',speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:'spinner',top:'auto',left:'auto'},a=function m(t){if(!this.spin)return new m(t);this.opts=f(t||{},m.defaults,u)};a.defaults={},f(a.prototype,{spin:function(t){this.stop();var i=this,e=i.opts,o=i.el=n(s(0,{className:e.className}),{position:'relative',width:0,zIndex:e.zIndex}),f=e.radius+e.length+e.width,l,d;t&&(t.insertBefore(o,t.firstChild||null),d=p(t),l=p(o),n(o,{left:(e.left=='auto'?d.x-l.x+(t.offsetWidth>>1):parseInt(e.left,10)+f)+'px',top:(e.top=='auto'?d.y-l.y+(t.offsetHeight>>1):parseInt(e.top,10)+f)+'px'})),o.setAttribute('aria-role','progressbar'),i.lines(o,i.opts);if(!r){var h=0,c=e.fps,a=c/e.speed,u=(1-e.opacity)/(a*e.trail/100),g=a/e.lines;(function m(){h++;for(var t=e.lines;t;t--){var n=Math.max(1-(h+t*g)%a*u,e.opacity);i.opacity(o,e.lines-t,n,e)};i.timeout=i.el&&setTimeout(m,~~(1e3/c))})()};return i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=i),this},lines:function(t,e){function l(t,o){return n(s(),{position:'absolute',width:e.length+e.width+'px',height:e.width+'px',background:t,boxShadow:o,transformOrigin:'left',transform:'rotate('+~~(360/e.lines*i+e.rotate)+'deg) translate('+e.radius+'px,0)',borderRadius:(e.corners*e.width>>1)+'px'})};var i=0,a;for(;i<e.lines;i++)a=n(s(),{position:'absolute',top:1+~(e.width/2)+'px',transform:e.hwaccel?'translate3d(0,0,0)':'',opacity:e.opacity,animation:r&&g(e.opacity,e.trail,i,e.lines)+' '+1/e.speed+'s linear infinite'}),e.shadow&&o(a,n(l('#000','0 0 4px #000'),{top:'2px'})),o(t,o(a,l(e.color,'0 0 1px rgba(0,0,0,.1)')));return t},opacity:function(t,e,i){e<t.childNodes.length&&(t.childNodes[e].style.opacity=i)}}),function(){function t(t,e){return s('<'+t+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',e)};var e=n(s('group'),{behavior:'url(#default#VML)'});!d(e,'transform')&&e.adj?(l.addRule('.spin-vml','behavior:url(#default#VML)'),a.prototype.lines=function(e,i){function h(){return n(t('group',{coordsize:r+' '+r,coordorigin:-s+' '+-s}),{width:r,height:r})};function c(e,a,r){o(d,o(n(h(),{rotation:360/i.lines*e+'deg',left:~~a}),o(n(t('roundrect',{arcsize:i.corners}),{width:s,height:i.width,left:i.radius,top:-i.width>>1,filter:r}),t('fill',{color:i.color,opacity:i.opacity}),t('stroke',{opacity:0}))))};var s=i.length+i.width,r=2*s,l=-(i.width+i.length)*2+'px',d=n(h(),{position:'absolute',top:l,left:l}),a;if(i.shadow)for(a=1;a<=i.lines;a++)c(a,-2,'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');for(a=1;a<=i.lines;a++)c(a);return o(e,d)},a.prototype.opacity=function(t,e,i,n){var o=t.firstChild;n=n.shadow&&n.lines||0,o&&e+n<o.childNodes.length&&(o=o.childNodes[e+n],o=o&&o.firstChild,o=o&&o.firstChild,o&&(o.opacity=i))}):r=d(e,'animation')}(),typeof define=='function'&&define.amd?define(function(){return a}):t.Spinner=a}(window,document);var opts={lines:15,length:15,width:2,radius:10,corners:0.6,rotate:28,color:'#777',speed:0.4,trail:32,shadow:!0,hwaccel:!0,className:'spinner',zIndex:2e9,top:'50%',left:'50%'};var spinner=new Spinner(opts),Progress={con:null,bar:null,status:0,progressCnt:0,forcedeSetting:!1,progressTimer:null,use:!0,disable:function(){this.use=!1},enable:function(){this.use=!0},forcedeON:function(){if(this.use==!1)return;this.forcedeSetting=!0;this.progressCnt=0;this.status=1;this.bar.style.height=document.body.scrollHeight+'px';bm.addChild(this.bar,window.document.body)},forcedeOFF:function(){if(this.use==!1)return;this.forcedeSetting=!1;this.progressCnt=0;this.status=0;spinner.stop();window.document.body.removeChild(this.bar)},ON:function(){if(this.use==!1)return;if(this.forcedeSetting)return;this.progressCnt++;if(this.status==1)return;this.status=1;this.bar.style.height=document.body.scrollHeight+'px';bm.addChild(this.bar,window.document.body);var t=this;clearInterval(this.progressTimer);this.progressTimer=setInterval(function(){if(this.progressCnt>0){alert('정상처리되지 않았습니다. 다시 시도해주세요.');t.forcedeOFF()}},30000)},OFF:function(){if(this.progressUse==!1)return;if(this.forcedeSetting)return;this.progressCnt--;if(this.progressCnt>0)return;if(this.status==0)return;this.status=0;spinner.stop();window.document.body.removeChild(this.bar);setTimeout(function(){if($('#loading-center')['length']>0){Progress.forcedeOFF()}},5000)}};Progress.con=bm.html('<div id="loading-center"> <div id="loading-center-absolute"> <div class="object" id="object_one"></div> <div class="object" id="object_two"></div> <div class="object" id="object_three"></div> <div class="object" id="object_four"></div> </div> </div>');Progress.bar=bm.html('<div id="loader"></div>');Progress.bar.appendChild(Progress.con);var BmSelectBoxOption=function(){this.label;this.value;this.dom},BMSelectBox=function(t,e,i){this.container=$(t).parent();if($(this.container).find('.bm_select_box').length>0)$(this.container).find('.bm_select_box').remove();this.target=t;this.index=(BMSelectBox.prototype.index--);if(e!=null){this.index=e};if(i!=null){this.height=i};this.class=$(this.target).attr('class')?$(this.target).attr('class'):'select_style_0';this.template='<div class="selected_item_con bm_select_box" tabindex="0" style="z-index : '+this.index+'">\n    <div class="selected_item">{{SELECTED_OPTION_LABEL}}</div>\n    <div class="'+this.class+'_con"  style="max-height : '+this.height+'">\n        <ul class="'+this.class+'"></ul>\n    </div>\n</div>';this.optionTemplate='<li data-value="{{VALUE}}"><a href="javascript:void(0)">{{LABEL}}</a></li>';this.dom;this.id=$(t).attr('id');this.selectedValue='';this.selectedIndex=0;this.optionList=[];this.isActive=!1;this.onChangeStart=null;this.onChangeComplete=null;this.onClickStart=null;this.init();this.registEvent();if(!bm.selectBoxList)bm.selectBoxList=[];bm.selectBoxList.push(this)};BMSelectBox.prototype={index:9999,init:function(){var i=this,t=$(this.target).find('option:selected').text(),e=bm.dom.convertVariables({SELECTED_OPTION_LABEL:t},this.template);this.dom=$(e).appendTo(this.container);this.renderOption();$(this.target).hide()},registEvent:function(){var t=this;$(this.container).on('change','#'+this.id,function(e){t.val($(this).val())});$(this.container).on('click','.selected_item_con',function(e){e.stopImmediatePropagation();var n=$(t.target).attr('readonly'),o=$(t.target).attr('disabled');if(n&&(n!==!1||n!=='false')){return!1};if(o&&(o!==!1||o!=='false')){return!1};if(t.onClickStart){if(t.onClickStart.call(t.target)===!1)return};var i=bm.selectBoxList.length;while(i--){if(bm.selectBoxList[i]!==t&&bm.selectBoxList[i].isActive){bm.selectBoxList[i].close()}};if(t.isActive){t.close()}
else{t.open()}});$(this.container).on('keyup','.selected_item_con',function(t){t.stopImmediatePropagation();if(t.keyCode!==13)return!1;$(this).trigger('click')});$(this.container).on('click','li',function(e){e.stopImmediatePropagation();if(t.onChangeStart&&t.onChangeStart!=null){if(t.onChangeStart.call(this)===!1)return};var i=$(t.dom).find('li').index(this);t.setSelectedIndex(i);if(t.onChangeComplete&&t.onChangeComplete!=null)t.onChangeComplete.call(t);t.close()})},open:function(){if(this.isActive)return;this.isActive=!0;if(!this.dom[0].isConnected){this.dom=$(this.target).siblings('.bm_select_box')};$(this.dom).find('.selected_item').addClass('active');$(this.dom).find('.'+this.class+'_con').show();$(window).on('click',{object:this},this.forcedClose);if($(window.document.body).find('#WEVEN_IFRAME').length>0){if(wvAdminIFrameBridge&&wvAdminIFrameBridge.iframeWindow){$(wvAdminIFrameBridge.iframeWindow).on('click',{object:this},this.forcedClose)}}},forcedClose:function(t){t.data.object.close()},close:function(){if(this.isActive==!1)return;this.isActive=!1;$(window).off('click',this.forcedClose);if($(window.document.body).find('#WEVEN_IFRAME').length>0){if(wvAdminIFrameBridge&&wvAdminIFrameBridge.iframeWindow){$(wvAdminIFrameBridge.iframeWindow).off('click',this.forcedClose)}};if(!this.dom[0].isConnected){this.dom=$(this.target).siblings('.bm_select_box')};$(this.dom).find('.selected_item').removeClass('active');$(this.dom).find('.'+this.class+'_con').hide()},val:function(t){if(t===undefined){return this.selectedValue}
else{this.setSelectedIndexAtValue(t)}},setLabel:function(t){$(this.dom).find('.selected_item').text(t)},getLabel:function(){var t=this.getSelectedIndex(),e=this.optionList[t].label;return e},setSelectedIndexAtValue:function(t){this.selectedValue=t;var i=this.optionList.length;for(var e=0;e<i;e++){if(this.optionList[e].value==t){$(this.optionList[e].dom).siblings().removeClass('active');$(this.optionList[e].dom).addClass('active');this.selectedIndex=e;this.setLabel(this.optionList[e].label);break}};$(this.target).val(this.selectedValue)},setSelectedIndex:function(t){this.selectedIndex=t;this.selectedValue=this.optionList[t].value;this.setLabel(this.optionList[t].label);$(this.target).val(this.selectedValue).trigger('change')},getSelectedIndex:function(){return this.selectedIndex},getSelectedValue:function(){return this.selectedValue},renderOption:function(){var s=$(this.dom).find('ul'),n=this,o,t;if(this.optionList&&this.optionList.length>0){var a=this.optionList.length;for(var i=0;i<a;i++){$(this.optionList[i].dom).remove()};this.optionList.length=0};$(this.target).find('option').each(function(){t=new BmSelectBoxOption();if($(this).attr('data-wv-lang')){t.language=$(this).attr('data-wv-lang');t.label=LANGUAGE_PACK[t.language];if(!t.label)t.label=$(this).text()}
else if($(this).attr('data-wv-image')){var e=$(this).attr('data-wv-image');if(e.indexOf('/')>-1)t.path=e;else if(e.indexOf('#')>-1)t.color=e;t.label=$(this).text()}
else t.label=$(this).text();t.value=$(this).attr('value');var a={LABEL:t.label,VALUE:t.value};o=bm.dom.convertVariables(a,n.optionTemplate);t.dom=$(o).appendTo(s);if($(this).parent('optgroup').length>0){var i=$(this).parent('optgroup');if(i.attr('disabled')==='disabled'||i.attr('disabled')==!0){t.dom.hide()}};if(t.language!==undefined){$(t.dom).find('>a').attr('data-wv-lang',t.language);t.dom=$(t.dom)}
else if(t.path!==undefined||t.color!==undefined){if(t.path){$(t.dom).find('>a').attr('data-wv-image',t.path);$(t.dom).find('>a').html('<span style=\'background-image: url('+t.path+');background-size: cover;\'></span> <label>'+t.label+'</label>')}
else if(t.color){$(t.dom).find('>a').attr('data-wv-image',t.color);$(t.dom).find('>a').html('<span style=\'background-color: '+t.color+';\'></span> <label>'+t.label+'</label>')}};n.optionList.push(t)});var e=$(this.target).val();if(e!=null&&e!=''){this.val(e)}},destroy:function(){$(this.container).off('change');$(this.container).off('click','.selected_item_con');$(this.container).off('click','li')}};var BMTag=function(t,e,i){this.maxLen=15;this.charLen=20;this.id=t;this.wrap=$('[name=\''+e+'\']').closest('[data-wv-type]').length>0?$('[name=\''+e+'\']').closest('[data-wv-type]'):$(document.body);this.inputName=e;if(i){this.btnTagSelector=i;this.btnTagList=this.wrap.find(i)};this.init()};BMTag.prototype={tagList:[],tagElementList:[],btnTagSelector:null,btnTagList:null,isMultiCheck:!0,exceptButtonList:['!','@','#','$','%','^','&','*','(',')','-','_','+','End','Home','PageUp','PageDown','`','~','.','/','<','>','?','/','',';',':','"','\'','HanjaMode','Control','ContextMenu'],onEnterEvent:null,onBtnTagEvent:null,onRemoveEvent:null,isRemoved:!1,removeIdx:-1,init:function(){this.inputField=this.wrap.find('[name=\''+this.inputName+'\']');this.inputFieldParent=this.inputField.parent();if(this.btnTagSelector){this.btnTagList=this.wrap.find(this.btnTagSelector)};var t=this.inputField.attr('class');if(t.indexOf('tagbox')===-1)t+=' tagbox';var e='<div id=\''+this.id+'\' class=\''+t+'\'></div>';this.dom=$(e).appendTo(this.inputFieldParent);this.inputField.hide().attr('readonly',!0);$('#tagElement').attr('placeholder','#을 이용하여 태그를 사용하세요');this.registEvent()},registEvent:function(){var t=this;if(this.btnTagList){this.btnTagList.off('click');this.btnTagList.on('click',function(e){e.preventDefault();var i=$(this).text().trim();if(t.tagElementList.length>0){t.isRemoved=!0;t.dom.trigger('focusout')};t.isRemoved=!1;if(t.tagList.indexOf(i)>-1){t.removeTag(i)}
else{if(!t.isMultiCheck){t.resetTagList(!0)};if(t.tagElementList.length>=t.maxLen){bm.toast('태그는 최대 '+t.maxLen+'개까지 등록가능합니다.');return!1};t.val(i)};t.inputField.val('#'+t.tagList.join(' #'));t.setActiveMainTagList();if(t.onBtnTagEvent&&t.onBtnTagEvent.call(t)===!1){return!1}})};this.dom.off('click');this.dom.on('click',function(e){var n=$(this).text().trim(),i=t.tagElementList.length;if(n==''||i===0){t.renderTag('')}
else if(i>0){t.focusEnd(t.tagElementList[i-1])}});this.dom.off('focusout');this.dom.on('focusout',function(e){var s=t.tagElementList.length;t.tagList=[];if(e.target.nodeName.toLowerCase()=='span'){var i=t.tagElementList.indexOf(e.target);if(i>-1&&t.isRemoved==!1&&($(t.tagElementList[i]).text()=='#'||$(t.tagElementList[i]).text()=='')){t.removeTagByIndex(i,!0)}};for(var n=0;n<s;n++){var a=t.tagElementList[n],o=$(a).text().substr(1);if(o!='')t.tagList.push(o)};if(t.tagList.length===0){t.inputField.val('')}
else{t.inputField.val('#'+t.tagList.join(' #'))};t.setActiveMainTagList(t.tagList)})},renderTagList:function(t){var i=this.tagList.length;if(i>0){for(var e=0;e<i;e++){var n=this.tagList[e];this.renderTag(n,t?!0:!1)}}},focusEnd:function(t){t.focus();if(typeof window.getSelection!='undefined'&&typeof document.createRange!='undefined'){var i=document.createRange();i.selectNodeContents(t);i.collapse(!1);var n=window.getSelection();n.removeAllRanges();n.addRange(i)}
else if(typeof document.body.createTextRange!='undefined'){var e=document.body.createTextRange();e.moveToElementText(t);e.collapse(!1);e.select()}},renderTag:function(t,e){var s=this,o=$('<p></p>')[0],i=$('<span></span>')[0],n=this.tagElementList.length,a=$(this.tagElementList[n-1]).text();if(n>0&&t!=''&&(a===''||a==='#')){$(this.tagElementList[n-1]).text('#'+t);t=''};$(o).append(i);$(this.dom).append(o);$(i).text('#'+t);$(i).attr('contentEditable',!0);$(i).attr('oncontextmenu','return false');if(!e)this.focusEnd(i);this.spanEvent(i);this.tagElementList.push(i)},spanEvent:function(t){var e=this;$(t).on('keydown',function(t){var o=$(this).text().trim(),n=!1;t.stopImmediatePropagation();if(t.metaKey){n=!0}
else if(e.exceptButtonList.indexOf(t.key)>-1){n=!0}
else if((t.keyCode>=91&&t.keyCode<=93)||t.keyCode==25||t.keyCode==190||(t.keyCode>=37&&t.keyCode<=40)){n=!0};if(n){t.preventDefault();t.returnValue=!1;e.focusEnd(this);return!1};var i=e.tagElementList.indexOf(this);if(t.key=='Backspace'||t.keyCode==27){if($(this).text().indexOf('#')===-1||$(this).text()===''||$(this).text()==='#'){e.isRemoved=!1;if(i===0)t.preventDefault();else if(i>0){e.isRemoved=!0;e.removeTagByIndex(i);t.preventDefault()}}
else if(i===0&&$(this).text().indexOf('#')===0&&$(this).text().length===2){e.resetTagList();e.renderTag('');t.preventDefault()}}
else if(o.trim().length>=e.charLen+1){$(this).text(o.trim().substr(0,e.charLen));e.focusEnd(this);return!1}
else if(t.key==' '||t.key=='Enter'||t.key=='Tab'||t.key==','){t.preventDefault()}});$(t).on('keyup',function(t){t.preventDefault();t.stopImmediatePropagation();var i=$(this).text().trim();if(t.key=='Backspace'||t.keyCode==27||t.key=='Delete'||t.keyCode==46){if(i.indexOf('#')===-1||i===''||i==='#'){$(this).text('#');e.focusEnd(this)}}
else if(t.key==' '||t.key=='Enter'||t.key=='Tab'||t.key==','){if(i.indexOf(',')>-1){i=i.replace(/,/g,'')};$(this).text(i);if(t.key=='Enter'&&e.onEnterEvent&&e.onEnterEvent.call(this)===!1){e.focusEnd(this);return!1};if(i.trim()==='#'){e.focusEnd(this);return!1};if(e.tagElementList.length>=e.maxLen){bm.toast('태그는 최대 '+e.maxLen+'개까지 등록가능합니다.');e.focusEnd(this);return!1};if(bm.valid.isEmoji(i)){bm.toast('이모지는 등록이 불가능합니다.');$(this).text('#');e.focusEnd(this);return!1};if(e.exceptButtonList.indexOf(i)>-1){bm.toast('특수문자는 등록이 불가능합니다.');$(this).text('#');e.focusEnd(this);return!1};if(e.tagList.indexOf(i.substring(1))>-1){var s=e.tagElementList.length,o=0;for(var n=0;n<s;n++){var a=$(e.tagElementList[n]).text().trim();if(a==i){o++;if(o>1){e.focusEnd(this);bm.toast('이미 입력한 태그명이 존재합니다.');return!1}}}};e.renderTag('');t.preventDefault()}});$(t).on('paste',function(t){var i=t.originalEvent.clipboardData.items;if(i.length>0&&i[0].type.indexOf('image')>-1){e.focusEnd(this);return!1}});$(t).parent('p').on('mouseover',function(){var t=$(this).text();if(t.indexOf('#')!==-1&&t!==''&&t!=='#'){if($(this).find('.tag_remove_btn').length==0){var i=bm.html('<a href="javascript:void(0);" class="tag_remove_btn" contentEditable="false" spellcheck="false"></a>');$(this).append(i);$(this).find('.tag_remove_btn').on('click',function(t){t.preventDefault();var i=$($(this).closest('p').find('span'))[0],o=e.tagElementList.indexOf(i);$(this).find('.tag_remove_btn').off('click');$(this).off('mouseover');$(this).off('mouseleave');e.isRemoved=!0;var n=$(i).text().trim().substring(1);e.removeTag(n);if($('#WEVEN_IFRAME').length>0&&e.tagElementList.length===0){wvAdminIFrameBridge._WVAdminBlockBar.resetTagList();wvAdminIFrameBridge._WVAdminBlockBar.searchEvent(!1,null)}})};$(this).addClass('hover')}});$(t).parent('p').on('mouseleave',function(){$(this).removeClass('hover')})},emptyRender:function(){this.tagList=[];this.dom.empty()},makeTag:function(){var e=this.tagList.length;for(var t=0;t<e;t++){var i=this.tagList[t]}},removeTag:function(t){var i=this.tagList.indexOf(t);if(i>-1){this.tagList.splice(i,1);var e='';if(this.tagList.length>0)e='#'+this.tagList.join(' #');else e='#';this.inputField.val(e);this.removeTagByIndex(i);if(this.tagElementList.length>0)this.focusEnd(this.tagElementList[this.tagElementList.length-1])}},removeTagByIndex:function(t,e){var i=this;if(i.tagElementList[t]){$(i.tagElementList[t]).parent('p').remove();i.tagElementList.splice(t,1);var n=t-1;if(!e&&n>-1)i.focusEnd(i.tagElementList[n]);if(e===!1&&this.onRemoveEvent)this.onRemoveEvent.call(this)}},resetTagList:function(t){var e=t===!0?!0:!1;this.tagElementList=[];this.tagList=[];this.inputField.val('');this.dom.empty();if(e===!1&&this.onRemoveEvent){this.onRemoveEvent.call(this)};this.setActiveMainTagList()},setActiveMainTagList:function(){var t=this;if(this.btnTagList){this.btnTagList.removeClass('active');this.btnTagList.each(function(e,i){var n=$(i).text().trim();if(t.tagList.indexOf(n)>-1){$(i).addClass('active')}})}},getTagList:function(){return this.tagList},setTagList:function(t){this.tagList=t},index:function(t){return this.tagList.indexOf(t)},setTagListByString:function(t,e){if(this.wrap.find(this.dom).length===0){this.init()};if(!e)e='#';var i;if(e==='#'){i=t.split(' '+e);i[0]=i[0].substring(1)}
else{i=t.split(e)};this.inputField.val('#'+i.join(' #'));this.setTagList(i);this.setActiveMainTagList();this.renderTagList(!0)},setTagListByList:function(t){if(this.wrap.find(this.dom).length===0){this.init()};this.tagList=[];var n=t.length;if(n>0){for(var i=0;i<n;i++){var e=t[i];if(this.tagList.indexOf(e)===-1){this.tagList.push(e);this.val(e)}};this.inputField.val('#'+this.tagList.join(' #'));this.setActiveMainTagList();this.renderTagList(!0)}},val:function(t){if(t&&t!=''){if(this.tagList.indexOf(t)===-1){this.tagList.push(t);this.renderTag(t);this.inputField.val('#'+this.tagList.join(' #'))}}
else{return this.inputField.val()}}};BMTag.prototype.btnTagList=null;BMTag.prototype.dom=null;var Calendar=function(){var t=new Date();this.LANG_KR='kr';this.LANG_EN='en';this.lang=this.LANG_KR;this.container=document.body;this.year=t.getFullYear();this.month=t.getMonth()+1;this.date=t.getDate();this.selectedYear=this.year;this.selectedMonth=this.month;this.selectedDate=this.date;this.currentYearSelector=null;this.currentMonthSelector=null;this.currentDateSelector=null;this.currentDaySelector=null;this.goTodayBtnSelector=null;this.prevDateBtnSelector=null;this.nextDateBtnSelector=null;this.prevMonthBtnSelector=null;this.nextMonthBtnSelector=null;this.prevYearBtnSelector=null;this.nextYearBtnSelector=null;this.parentSelector=null;this.weekTrTemplateSelector=null;this.weekTrTemplate=null;this.dateNumSelector=null;this.todayClass=null;this.renderCallBack=null;this.renderCompleteCallBack=null;this.selectCallBack=null;this.renderData=null;this.onPrevMonth=null;this.onNextMonth=null;this.onPrevDate=null;this.onNextDate=null};Calendar.prototype={selecteDate:function(t,e,i){this.date=this.selectedDate=t;if(e){this.month=this.selectedMonth=e};if(i){this.year=this.selectedYear=i};if(t===0)this.selectedDate=0;if(e===0)this.selectedMonth=0;if(i===0)this.selectedYear=0},getYear:function(){return this.year},getMonth:function(){return bm.string.numUtitToString(this.month)},getDate:function(){return bm.string.numUtitToString(this.date)},getYYYYMMDD:function(t){t=t===undefined?'-':t;return this.getYear()+t+this.getMonth()+t+this.getDate()},getSelectedYear:function(){return this.year},getSelectedMonth:function(){return bm.string.numUtitToString(this.selectedMonth)},getSelectedDate:function(){return bm.string.numUtitToString(this.selectedDate)},getSelectedYYYYMMDD:function(t){t=t===undefined?'-':t;return this.getSelectedYear()+t+this.getSelectedMonth()+t+this.getSelectedDate()},getDay:function(){var t=new Date(this.year,this.month-1,this.date),e=['일','월','화','수','목','금','토'];return e[t.getDay()]},getDayString:function(t,e){t=t!=undefined?t:new Date(this.year,this.month-1,this.date).getDay();e=e||this.lang;var i;if(e==this.LANG_KR){i=['일','월','화','수','목','금','토']}
else if(e==this.LANG_EN){i=['SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY']};return i[t]},getLastDate:function(t,e){var i=0;if(e==3||e==5||e==8||e==10){i=30}
else{i=31;if(e==1){if(t%4!=0)i=28;else i=29}};return i},setBtnDate:function(t,e,i){var n=this;if(this.nextDateBtnSelector)$(this.container).find(this.nextDateBtnSelector).off('click');if(this.prevDateBtnSelector)$(this.container).find(this.prevDateBtnSelector).off('click');this.nextDateBtnSelector=e;this.prevDateBtnSelector=t;if(this.nextDateBtnSelector){$(this.container).find(this.nextDateBtnSelector).off('click');$(this.container).find(this.nextDateBtnSelector).on('click',function(){n.nextDate();if(n.onNextDate&&n.onNextDate()==!1)return;n.render();if(i)i()})};if(this.prevDateBtnSelector){$(this.container).find(this.prevDateBtnSelector).off('click');$(this.container).find(this.prevDateBtnSelector).on('click',function(){n.prevDate();if(n.onPrevDate&&n.onPrevDate()==!1)return;n.render();if(i)i()})}},setBtnMonth:function(t,e,i){var n=this;if(this.nextMonthBtnSelector)$(this.container).find(this.nextMonthBtnSelector).off('click');if(this.prevMonthBtnSelector)$(this.container).find(this.prevMonthBtnSelector).off('click');this.nextMonthBtnSelector=e;this.prevMonthBtnSelector=t;if(this.nextMonthBtnSelector){$(this.container).find(this.nextMonthBtnSelector).off('click');$(this.container).find(this.nextMonthBtnSelector).on('click',function(){n.nextMonth();if(n.onNextMonth&&n.onNextMonth()==!1)return;n.render();if(i)i()})};if(this.prevMonthBtnSelector){$(this.container).find(this.prevMonthBtnSelector).off('click');$(this.container).find(this.prevMonthBtnSelector).on('click',function(){n.prevMonth();if(n.onPrevMonth&&n.onPrevMonth()==!1)return;n.render();if(i)i()})}},setBtnYear:function(t,e){var i=this;if(this.nextYearBtnSelector)$(this.container).find(this.nextYearBtnSelector).off('click');if(this.prevYearBtnSelector)$(this.container).find(this.prevYearBtnSelector).off('click');this.nextYearBtnSelector=e;this.prevYearBtnSelector=t;if(this.nextYearBtnSelector){$(this.container).find(this.nextYearBtnSelector).off('click');$(this.container).find(this.nextYearBtnSelector).on('click',function(){i.nextYear();i.render()})};if(this.prevYearBtnSelector){$(this.container).find(this.prevYearBtnSelector).off('click');$(this.container).find(this.prevYearBtnSelector).on('click',function(){i.prevYear();i.render()})}},setBtnToday:function(t){var e=this;if(this.goTodayBtnSelector)$(this.container).find(this.goTodayBtnSelector).off('click');this.goTodayBtnSelector=t;if(this.goTodayBtnSelector){$(this.container).find(this.goTodayBtnSelector).off('click');$(this.container).find(this.goTodayBtnSelector).on('click',function(){e.goToday();e.render()})}},nextDate:function(){if(this.date>=this.getLastDate(this.year,this.month-1)){this.nextMonth();this.date=1}
else{this.date++}},prevDate:function(){if(this.date<=1){this.prevMonth();this.date=this.getLastDate(this.year,this.month-1)}
else{this.date--}},nextMonth:function(){if(this.month>=12){this.month=1;this.year+=1}
else this.month++},prevMonth:function(){if(this.month<=1){this.month=12;this.year-=1}
else this.month--},holidayData:null,setHolidayData:function(){this.holidayData=HOLIDAY_DATA},nextYear:function(){this.year++},prevYear:function(){this.year--},goToday:function(){var t=new Date();this.selectedYear=this.year=t.getFullYear();this.selectedMonth=this.month=t.getMonth()+1;this.selectedDate=this.date=t.getDate()},getRender:function(){return this.getRenderAt(this.year,this.month,this.date)},getRenderAt:function(t,e,i){var r=this.getLastDate(t,e-1),h=new Date(t,e-1,i),l=[],o,a=1,d=new Date(t,e-1,1),n=d.getDay();for(var s=0;s<6;s++){o=[];while(n<7){o[n]=a++;n++;if(a>r)break};l.push(o);if(a>r)break;n=0};return l},setRenderSelector:function(t,e,i,n){this.parentSelector=i;this.weekTrTemplateSelector=t;this.weekTrTemplate=$(this.container).find(t)[0].outerHTML;$(this.container).find(t).remove();this.dateNumSelector=e;this.todayClass=n;this.setHolidayData()},renderCurrentDate:function(){if(this.currentYearSelector){$(this.container).find(this.currentYearSelector).text(this.year)};if(this.currentMonthSelector){$(this.container).find(this.currentMonthSelector).text(this.getMonth())};if(this.currentDateSelector){$(this.container).find(this.currentDateSelector).text(this.getDate())};if(this.currentDaySelector){$(this.container).find(this.currentDaySelector).text(this.getDayString())}},onSelect:function(t){this.selectCallBack=t},render:function(t){if(t){this.renderCallBack=t};this.renderCurrentDate();if(!this.weekTrTemplateSelector)return;$(this.weekTrTemplateSelector).find(this.dateNumSelector).off('click');$(this.container).find(this.weekTrTemplateSelector).remove();this.renderData=this.getRender();var o,i,a,u=this.renderData.length,l,h,n=1,s,e=this;for(o=0;o<u;o++){a=$(this.weekTrTemplate);$(this.container).find(this.parentSelector).append(a[0]);l=this.renderData[o];h=l.length;for(i=0;i<h;i++){s=a.find(this.dateNumSelector)[i];if(l[i]){var d=!1,p=this.year.toString()+this.month.toString().padStart(2,'0')+n.toString().padStart(2,'0');if(this.holidayData[p])d=!0;$(s).closest('td').removeClass('empty past');$(s).html(n);if(this.renderCallBack)this.renderCallBack(s,n,o,i,this.getDayString(i),d);if(this.todayClass&&n==this.selectedDate&&this.year==this.selectedYear&&this.month==this.selectedMonth){$(a.find('td')[i]).addClass(this.todayClass)};if(this.isPastDisabled){var r=new Date(),c=new Date(''+r.getFullYear()+bm.datepicker.delimiter+(r.getMonth()+1)+bm.datepicker.delimiter+r.getDate()),f=new Date(''+this.year+bm.datepicker.delimiter+this.month+bm.datepicker.delimiter+n);if(c>f)$(a.find('td')[i]).addClass('past').attr('disabled','')};n++}
else{$(s).closest('td').addClass('empty')}}};$(this.container).find(this.weekTrTemplateSelector).find('td').on('click',function(){var i=$(this).find(e.dateNumSelector)[0],t;if(i){t=i.innerHTML};if(!t)return;e.date=parseInt(t);e.selecteDate(e.date,e.month,e.year);if(e.todayClass){$(e.container).find(e.weekTrTemplateSelector).find('td').removeClass(e.todayClass);$(this).addClass(e.todayClass)}});$(this.container).find(this.weekTrTemplateSelector).find(this.dateNumSelector).on('click',function(){if($(this).closest('td').attr('disabled')==!0||$(this).closest('td').attr('disabled')=='disabled'){return!1};if(!this.innerHTML)return;e.date=parseInt(this.innerHTML);e.selecteDate(e.date,e.month,e.year);if(e.selectCallBack)e.selectCallBack(e.year,e.month,this.innerHTML,this)});if(this.renderCompleteCallBack)this.renderCompleteCallBack(this.year,this.month,this.date)}};var Schedule=function(){};bm.extend(Calendar,Schedule);bm.datepicker={EVENT_DATEPICKER_SELECT:'datepickerselect',onShow:null,onHide:null,syncDatePicker:function(){var t=[],e={};$('[datepicker]').each(function(){var t=$(this).attr('datepicker');if(t==''||t=='this')t=this;$(this).on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('readonly')?$(this).attr('readonly'):!1,n=$(this).attr('disabled')?$(this).attr('disabled'):!1;if((i&&(i==!0||i=='readonly'))||(n||(n==!0||n=='disabled'))){return!1};bm.datepicker.show(t)});this.addEventListener('blur',bm.datepicker.__onFocusOut,!0)})},registDatePicker:function(t,e,i,n,o){$(t).attr('autocomplete','off');$(t).on('click',{callback:i},function(t){if(bm.timepicker.isShow)bm.timepicker.hide();t.stopImmediatePropagation();if(e===undefined||e==''||e=='this'||e===null)e=this;var i=$(this).attr('readonly')?$(this).attr('readonly'):!1,a=$(this).attr('disabled')?$(this).attr('disabled'):!1;if((i&&(i==!0||i=='readonly'))||(a||(a==!0||a=='disabled'))){return!1};bm.datepicker.show(e,t.data.callback,n,o)});if(t.length>0)t=t[0];t.addEventListener('blur',bm.datepicker.__onFocusOut,!0)},__onFocusOut:function(t){var n=bm.datepicker,e=t.target;if(!e.value||e.value===''){return};var a=e.value.indexOf(n.delimiter),i=!1;if(a==-1){if(e.value.length==8){var d=e.value.slice(0,4),o=e.value.slice(4,6),r=e.value.slice(6,8);if(isNaN(parseInt(o))||parseInt(o)<=0||parseInt(o)>12){i=!0}
else if(isNaN(parseInt(o))||parseInt(r)<=0||parseInt(r)>31){i=!0}
else{e.value=d+n.delimiter+o+n.delimiter+r}}
else{i=!0}};a=e.value.indexOf(n.delimiter,a+1);if(a==-1){i=!0};if(e.value.length!=10){i=!0};var s=e.value,l=new RegExp(n.delimiter,'gi');s=s.replace(l,'');if(bm.valid.isOnlyNum(s)==!1){i=!0};if(bm.valid.isYYYYMMDD(e.value)==!1){i=!0};if(i){bm.toast('날짜 입력 형식이 잘못되었습니다. \n ex : 2000'+n.delimiter+'01'+n.delimiter+'01 ');e.value='';return}},templateSelector:'.cal_tb_con > table .cal_row',datepickerBase:'<div class="cal_wrap view_by_date_hidden_calendar" id="datePicker"><div class="calendar_style_1_wrap type_2"><div class="cal_top calendar_style_1_month_con"><div class="calendar_style_1_month_inner"><a href="javascript:void(0);" id="datePickerTodayBtn" class="today_box ">Today</a><a href="javascript:void(0);" id="datePickerLeftYearBtn" class="arrow_box prev mr5"></a><a href="javascript:void(0);" id="datePickerLeftBtn" class="arrow_box left"></a><div class="calendar_month_text" style="display:inline-block;"><span class="year_text" id="bmCalYear">2017</span>년 <span class="month_text" id="bmCalMonth">09</span>월</div><a href="javascript:void(0);" id="datePickerRightBtn" class="arrow_box right"></a><a href="javascript:void(0);" id="datePickerRightYearBtn" class="arrow_box next ml5"></a></div></div><div class="cal_tb_con"><table class="cal_tb calendar_style_1 type_2" summary="공통달력 테이블입니다."><colgroup> <col width="14.28%"> <col width="14.28%"> <col width="14.28%"> <col width="14.28%"> <col width="14.28%"> <col width="14.28%"> <col width="14.28%"> </colgroup><tr><th class="sunday">Su</th><th>Mo</th><th>Tu</th><th>We</th><th>Th</th><th>Fr</th><th class="saturday">Sa</th></tr><tr class="cal_row"><td class="sunday"><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td><td><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td><td><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td><td><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td><td><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td><td><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td><td class="saturday"><a href="javascript:void(0)" class="calendar_date"><span class="dp_date"></span></a></td></tr></table></div></div></div>',template:null,datepickerEl:null,delimiter:'-',calendar:null,isCreated:!1,getCalendar:function(){if(this.datepickerEl==null){this.setCalendar()};return this.datepickerEl},setCalendar:function(){var i=$(this.datepickerBase),o=new Date(),s=o.getFullYear()-60,r=o.getFullYear()+5,a=i.find('#bmCalYear').empty();a.on('change',{_this:this},this.onUpdateCalendar);for(var e=r;e>s;e--){a.append('<option value=\''+e+'\'>'+e+'</option>')};var n=i.find('#bmCalMonth').empty();n.on('change',{_this:this},this.onUpdateCalendar);for(var t=1;t<=12;t++){n.append('<option value=\''+t+'\'>'+t+'</option>')};this.datepickerEl=i[0]},setTemplate:function(t,e){this.datepickerBase=t;this.templateSelector=e;this.setCalendar()},hide:function(){$(this.datepickerEl).hide();this.isShow=!1;if(this.onHide)this.onHide()},show:function(t,e,i,n){this.isShow=!0;var T=this.getCalendar(),s=this;if(this.calendar==null){this.calendar=new Calendar();this.calendar.container=this.datepickerEl;this.calendar.currentYearSelector='#bmCalYear';this.calendar.currentMonthSelector='#bmCalMonth';this.calendar.isPastDisabled=n?Boolean(n):null;this.calendar.setBtnToday('#datePickerTodayBtn');this.calendar.setBtnMonth('#datePickerLeftBtn','#datePickerRightBtn');this.calendar.setBtnYear('#datePickerLeftYearBtn','#datePickerRightYearBtn');this.calendar.setRenderSelector(this.templateSelector,'.dp_date','.cal_tb_con > table','datepicker_today')}
else{if(typeof t==='string'||typeof t==='object')t=$(t);if(!t.val()){this.calendar.goToday()}};this.calendar.onSelect(function(n,o,a){if(!a)return;if(o<10)o='0'+o;if(a<10)a='0'+a;var r=''+n+s.delimiter+o+s.delimiter+a;if(e)e(n,o,a);if(t)$(t).val(r);if(i){$(t).parent().find('[data-formrenderer-datepicker-btn-clear]').show().on('click',function(){$(this).hide().off('click');$(t).val('')})};$(t).trigger(bm.datepicker.EVENT_DATEPICKER_SELECT);s.hide()});var p=0,l=0,o;if(t&&$(t).length>0){var a=$(t).val().split(this.delimiter);if(a.length==3){var b=parseInt(a[0]),y=parseInt(a[1]),w=parseInt(a[2]);this.calendar.selecteDate(w,y,b)};o=$(t).offset();l=o.top+$(t).height();p=o.left};this.calendar.render(this.onShow);if(this.isCreated){$(this.datepickerEl).show()}
else{$(document.body).append(this.datepickerEl);this.isCreated=!0;$(this.datepickerEl).on('click',function(t){t.stopImmediatePropagation()})};var u=$(this.datepickerEl).outerWidth(),r=$(this.datepickerEl).outerHeight(),g=window.pageXOffset,d=window.pageYOffset,m=window.innerWidth,h=window.innerHeight,c=40,v=Math.min(p,m-u+g-c),f=Math.min(l,h-r+d-c);if((l-d+r>h)&&o){f=o.top-r};$(this.datepickerEl).css({'position':'absolute','top':f,'left':v,'zIndex':1000000,'display':'block'});$(document.body).off('click');$(document.body).on('click',function(t){s.hide()})},onUpdateCalendar:function(t){var e=t.data._this,i=$(e.calendar.currentYearSelector).val(),n=$(e.calendar.currentMonthSelector).val();e.calendar.year=i;e.calendar.month=n;e.calendar.date=1;e.calendar.render()},getDateString:function(){var t=new Date(),e=t.getFullYear(),i=('0'+(t.getMonth()+1)).slice(-2),n=('0'+t.getDate()).slice(-2),o=('0'+t.getHours()).slice(-2),a=('0'+t.getMinutes()).slice(-2),s=('0'+t.getSeconds()).slice(-2);return e+'-'+i+'-'+n+' '+o+':'+a+':'+s}};bm.timepicker={EVENT_TIMEPICKER_SELECT:'timepickerselect',TIMEPICKER_FORMAT_HH:'hh',TIMEPICKER_FORMAT_MM:'mm',TIMEPICKER_FORMAT_SS:'ss',TIMEPICKER_FORMAT_HHMM:'hhmm',TIMEPICKER_FORMAT_MMSS:'mmss',TIMEPICKER_FORMAT_HHMMSS:'hhmmss',template:null,timepickerEl:null,delimiter:':',isCreated:!1,hourBtnSelector:'#timePickerHour > li',minuteBtnSelector:'#timePickerMinute > li',secondBtnSelector:'#timePickerSecond > li',confirmBtnSelector:'#timepickerConfirm',timepickerBase:'<div class="timepicker_wrap" id="timePicker">    <div class="timepicker_con">       <div class="timepicker_box">           <ul id="timePickerHour">               <li>00</li><li>01</li><li>02</li><li>03</li><li>04</li><li>05</li><li>06</li><li>07</li><li>08</li><li>09</li><li>10</li><li>11</li>               <li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li>           </ul>           <ul id="timePickerMinute" role="listbox">               <li>00</li><li>01</li><li>02</li><li>03</li><li>04</li><li>05</li><li>06</li><li>07</li><li>08</li><li>09</li><li>10</li><li>11</li>               <li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li>               <li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li>               <li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li>               <li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li><li>58</li><li>59</li>           </ul>           <ul id="timePickerSecond" role="listbox">               <li>00</li><li>01</li><li>02</li><li>03</li><li>04</li><li>05</li><li>06</li><li>07</li><li>08</li><li>09</li><li>10</li><li>11</li>               <li>12</li><li>13</li><li>14</li><li>15</li><li>16</li><li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li>               <li>24</li><li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li><li>33</li><li>34</li><li>35</li>               <li>36</li><li>37</li><li>38</li><li>39</li><li>40</li><li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li>               <li>48</li><li>49</li><li>50</li><li>51</li><li>52</li><li>53</li><li>54</li><li>55</li><li>56</li><li>57</li><li>58</li><li>59</li>           </ul>       </div>       <div class="timepicker_btn_box">          <button type="button" id="timepickerConfirm" class="timepicker_btn">OK</button>       </div>    </div></div>',registTimePicker:function(t,e,i,n,o){$(t).attr('autocomplete','off');$(t).on('click',{callback:i},function(t){if(bm.datepicker.isShow)bm.datepicker.hide();t.stopImmediatePropagation();if(e===undefined||e==''||e=='this'||e===null)e=this;var i=$(this).attr('readonly')?$(this).attr('readonly'):!1,a=$(this).attr('disabled')?$(this).attr('disabled'):!1;if((i&&(i==!0||i=='readonly'))||(a||(a==!0||a=='disabled'))){return!1};bm.timepicker.show(e,t.data.callback,n,o)});if(t.length>0)t=t[0];t.addEventListener('blur',bm.timepicker.__onFocusOut,!0)},__onFocusOut:function(t){var e=bm.timepicker,a=t.target;if(!a.value||a.value===''){return};var l=!1;if(a.value.indexOf(e.delimiter)===-1){l=!0}
else{var r=0,n=0,o=0,d=0,i=a.value.split(e.delimiter);if(i.length===1){d=2;if(e.format===bm.timepicker.TIMEPICKER_FORMAT_HH)r=parseInt(i[0]);else if(e.format===bm.timepicker.TIMEPICKER_FORMAT_MM)n=parseInt(i[0]);else if(e.format===bm.timepicker.TIMEPICKER_FORMAT_SS)o=parseInt(i[0])}
else if(i.length===2){d=4+e.delimiter.length;if(e.format===bm.timepicker.TIMEPICKER_FORMAT_HHMM){r=parseInt(i[0]);n=parseInt(i[1])}
else if(e.format===bm.timepicker.TIMEPICKER_FORMAT_MMSS){n=parseInt(i[0]);o=parseInt(i[1])}}
else if(i.length===3&&e.format===bm.timepicker.TIMEPICKER_FORMAT_HHMMSS){d=6+e.delimiter.length*2;r=parseInt(i[0]);n=parseInt(i[1]);o=parseInt(i[2])};if(isNaN(r)||r<0||r>23){l=!0}
else if(isNaN(n)||n<0||n>59){l=!0}
else if(isNaN(o)||o<0||o>59){l=!0}
else{var s='';if(e.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HH)){s=bm.string.numUtitToString(r);if(e.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HHMM))s+=e.delimiter+bm.string.numUtitToString(n);if(e.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HHMMSS))s+=e.delimiter+bm.string.numUtitToString(o)}
else if(e.format.includes(bm.timepicker.TIMEPICKER_FORMAT_MM)){s=bm.string.numUtitToString(n);if(e.format.includes(bm.timepicker.TIMEPICKER_FORMAT_MMSS))s+=e.delimiter+bm.string.numUtitToString(o)}
else if(e.format.includes(bm.timepicker.TIMEPICKER_FORMAT_SS)){s=bm.string.numUtitToString(o)};a.value=s};if(a.value.length!==d){l=!0};var h=a.value,c=new RegExp(e.delimiter,'gi');h=h.replace(c,'');if(!bm.valid.isOnlyNum(h))l=!0};if(l){bm.toast('시간 입력 형식이 잘못되었습니다.<br/>예) 12'+e.delimiter+'01'+e.delimiter+'01');a.value=''}},getTemplate:function(){if(this.timepickerEl==null){this.timepickerEl=$(this.timepickerBase)[0]};return this.timepickerEl},setSelectedTime:function(t,e,i){t=t?t:'0';e=e?e:'0';i=i?i:'0';this.selectedHour=bm.string.numUtitToString(t);this.selectedMinute=bm.string.numUtitToString(e);this.selectedSecond=bm.string.numUtitToString(i)},getHour:function(){return new Date().getHours()},getMinute:function(){return new Date().getMinutes()},getSecond:function(){return new Date().getSeconds()},getHHMMSS:function(t){t=t===undefined?this.delimiter:t;return this.getHour()+t+this.getMinute()+t+this.getSecond()},getSelectedHour:function(){return this.selectedHour},getSelectedMinute:function(){return this.selectedMinute},getSelectedSecond:function(){return this.selectedSecond},getSelectedHHMMSS:function(t){t=t===undefined?this.delimiter:t;return this.getSelectedHour()+t+this.getSelectedMinute()+t+this.getSelectedSecond()},selectCallBack:function(t,e,i,n,o){if(!e&&!i&&!n)return;var a='';if(this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HH)){a=e;if(this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HHMM))a+=this.delimiter+i;if(this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HHMMSS))a+=this.delimiter+n}
else if(this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_MM)){a=i;if(this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_MMSS))a+=this.delimiter+n}
else if(this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_SS)){a=n};if(o)o(e,i,n);if(t)$(t).val(a);$(t).trigger(bm.timepicker.EVENT_TIMEPICKER_SELECT)},setFormat:function(t){if(!t){this.format=this.TIMEPICKER_FORMAT_HHMMSS}
else{var e=t.split(this.delimiter);switch(e.length){case 1:if(e[0]===bm.timepicker.TIMEPICKER_FORMAT_HH||e[0]===bm.timepicker.TIMEPICKER_FORMAT_MM||e[0]===bm.timepicker.TIMEPICKER_FORMAT_SS){this.format=e[0];break};case 2:if(e[0]===bm.timepicker.TIMEPICKER_FORMAT_HH&&e[1]===bm.timepicker.TIMEPICKER_FORMAT_MM){this.format=bm.timepicker.TIMEPICKER_FORMAT_HHMM;break}
else if(e[0]===bm.timepicker.TIMEPICKER_FORMAT_MM&&e[1]===bm.timepicker.TIMEPICKER_FORMAT_SS){this.format=bm.timepicker.TIMEPICKER_FORMAT_MMSS;break};case 3:if(e[0]===bm.timepicker.TIMEPICKER_FORMAT_HH&&e[1]===bm.timepicker.TIMEPICKER_FORMAT_MM&&e[2]===bm.timepicker.TIMEPICKER_FORMAT_SS){this.format=bm.timepicker.TIMEPICKER_FORMAT_HHMMSS;break};default:this.format=bm.timepicker.TIMEPICKER_FORMAT_HHMMSS}}},hide:function(){$(this.timepickerEl).find('#timePickerHour').scrollTop(0);$(this.timepickerEl).find('#timePickerMinute').scrollTop(0);$(this.timepickerEl).find('#timePickerSecond').scrollTop(0);$(this.timepickerEl).find('.selected').removeClass('selected');$(this.timepickerEl).hide();this.isShow=!1},show:function(t,e,i,n){var o=this;this.isShow=!0;this.getTemplate();this.setFormat(i);var m=0,c=0,r;if(t&&$(t).length>0){if($(t).val()){var a=$(t).val().split(this.delimiter),l,s,d;if(a.length===1){if(this.format===bm.timepicker.TIMEPICKER_FORMAT_HH)l=parseInt(a[0]);else if(this.format===bm.timepicker.TIMEPICKER_FORMAT_MM)s=parseInt(a[0]);else if(this.format===bm.timepicker.TIMEPICKER_FORMAT_SS)d=parseInt(a[0])}
else if(a.length===2){if(this.format===bm.timepicker.TIMEPICKER_FORMAT_HHMM){l=parseInt(a[0]);s=parseInt(a[1])}
else if(this.format===bm.timepicker.TIMEPICKER_FORMAT_MMSS){s=parseInt(a[0]);d=parseInt(a[1])}}
else if(a.length===3&&this.format===bm.timepicker.TIMEPICKER_FORMAT_HHMMSS){l=parseInt(a[0]);s=parseInt(a[1]);d=parseInt(a[2])};this.setSelectedTime(l,s,d)}
else{this.setSelectedTime();$(this.timepickerEl).find('.selected').removeClass('selected')};r=$(t).offset();c=r.top+$(t).height();m=r.left};$(this.timepickerEl).find('#timePickerHour').scrollTop(0).removeClass('hidden');$(this.timepickerEl).find('#timePickerMinute').scrollTop(0).removeClass('hidden');$(this.timepickerEl).find('#timePickerSecond').scrollTop(0).removeClass('hidden');if(!this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_HH)){$(this.timepickerEl).find('#timePickerHour').addClass('hidden')};if(!this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_MM)){$(this.timepickerEl).find('#timePickerMinute').addClass('hidden')};if(!this.format.includes(bm.timepicker.TIMEPICKER_FORMAT_SS)){$(this.timepickerEl).find('#timePickerSecond').addClass('hidden')};$(this.timepickerEl).find('ul').not('.hidden').each(function(){var t;if($(this).attr('id')==='timePickerHour'&&o.selectedHour){t=$(this).find('> li:contains('+o.selectedHour+')');t.addClass('selected')}
else if($(this).attr('id')==='timePickerMinute'&&o.selectedMinute){t=$(this).find('> li:contains('+o.selectedMinute+')');t.addClass('selected')}
else if($(this).attr('id')==='timePickerSecond'&&o.selectedSecond){t=$(this).find('> li:contains('+o.selectedSecond+')');t.addClass('selected')}});if(this.onShow)this.onShow(o.selectedHour,o.selectedMinute,o.selectedSecond);if(this.isCreated){$(this.timepickerEl).show()}
else{$(document.body).append(this.timepickerEl);this.isCreated=!0;$(this.timepickerEl).on('click',function(t){t.stopImmediatePropagation()})};var v=$(this.timepickerEl).outerWidth(),h=$(this.timepickerEl).outerHeight(),b=window.pageXOffset,f=window.pageYOffset,y=window.innerWidth,p=window.innerHeight,u=40,w=Math.min(m,y-v+b-u),g=Math.min(c,p-h+f-u);if((c-f+h>p)&&r){g=r.top-h};$(this.timepickerEl).css({'position':'absolute','top':g,'left':w,'zIndex':1000000,'display':'block'});$(document.body).off('click');$(document.body).on('click',function(t){o.hide()});$(this.hourBtnSelector).off('click').on('click',function(){$(this).siblings().removeClass('selected');$(this).addClass('selected');o.selectedHour=parseInt(this.innerHTML);o.setSelectedTime(o.selectedHour,o.selectedMinute,o.selectedSecond);if(o.selectCallBack)o.selectCallBack(t,o.selectedHour,o.selectedMinute,o.selectedSecond,e,this)});$(this.minuteBtnSelector).off('click').on('click',function(){$(this).siblings().removeClass('selected');$(this).addClass('selected');o.selectedMinute=parseInt(this.innerHTML);o.setSelectedTime(o.selectedHour,o.selectedMinute,o.selectedSecond);if(o.selectCallBack)o.selectCallBack(t,o.selectedHour,o.selectedMinute,o.selectedSecond,e,this)});$(this.secondBtnSelector).off('click').on('click',function(){$(this).siblings().removeClass('selected');$(this).addClass('selected');o.selectedSecond=parseInt(this.innerHTML);o.setSelectedTime(o.selectedHour,o.selectedMinute,o.selectedSecond);if(o.selectCallBack)o.selectCallBack(t,o.selectedHour,o.selectedMinute,o.selectedSecond,e,this)});$(this.confirmBtnSelector).off('click').on('click',function(){o.setSelectedTime(o.selectedHour,o.selectedMinute,o.selectedSecond);if(o.selectCallBack)o.selectCallBack(t,o.selectedHour,o.selectedMinute,o.selectedSecond,e,this);o.hide()})}};var ToolTip=function(t,e){this.target=t;this.value=e;this.template='<div class="tooltip_con"><span></span></div>';this.tooltipCon=ToolTip.prototype['tooltipCon'];this.titleValue=null;this.position='bottom';this.gap=8;this.extraClass='';this.init()};ToolTip.prototype={tooltipCon:'.tooltip_con',init:function(){if($(this.tooltipCon).length<1){$(this.template).appendTo(document.body)};var t=$(this.target).attr('data-wv-tooltip-option');if(t){t=bm.parsing.parseStrToObj(t);if(t.position!==undefined)this.position=t.position;if(t.gap!==undefined)this.gap=t.gap;if(t.extraClass!==undefined)this.extraClass=t.extraClass};this.registEvent()},registEvent:function(){var t=this;$(t.target).on('mouseenter',function(){const setting=function(e,i){t.setClass();t.setText();t.setPosition(i);if($(e).attr('title'))t.removeTitleValue()};if($(t.target).closest('[data-wv-design-mode]').length>0){if(window['name']==='WEVEN_IFRAME'){setting(this,'iframe')}
else if($(t.target).closest('.layoutOptBtn').length>0){setting(this,'outer')}
else{}}
else{setting(this)}});$(t.target).on('mouseleave',function(){t.hideTooltip();t.addTitleValue()})},setClass:function(){$(this.tooltipCon).attr('class','').addClass('tooltip_con '+this.extraClass)},setText:function(){var t='';if(this.value){t=this.value}
else{if($(this.target).attr('title')){t=$(this.target).attr('title')}
else{return}};$(this.tooltipCon).find('span').html(t)},setPosition:function(t){var i=0,e=0;$(this.tooltipCon).removeClass('pos_top');this.showTooltip();const targetRect=this.target.getBoundingClientRect();const targetOffset=$(this.target).offset();const toolTipRect=$(this.tooltipCon)[0].getBoundingClientRect();const windowRect=window['document']['body'].getBoundingClientRect();let GapBetweenIframeAndtopMenu=0;if($('#WEVEN_IFRAME').length>0){if(t==='iframe'){GapBetweenIframeAndtopMenu=0}
else if(t==='outer'){GapBetweenIframeAndtopMenu=$('#WEVEN_IFRAME')[0].getBoundingClientRect()['top']}};if(this.position==='top'){i=targetRect.top-$(this.tooltipCon).outerHeight(!0)-this.gap+GapBetweenIframeAndtopMenu;$(this.tooltipCon).addClass('pos_top')}
else if(this.position==='bottom'){i=targetRect.top+$(this.target).outerHeight(!0)+this.gap+GapBetweenIframeAndtopMenu};if($('#WEVEN_IFRAME')['length']>0){if($(this.target).closest('body[data-wv-design-mode]').length>0){e=targetRect['left']+$('#WEVEN_IFRAME')[0].getBoundingClientRect()['left']+targetRect['width']/2-toolTipRect['width']/2}
else{e=targetRect['left']+targetRect['width']/2-toolTipRect['width']/2}}
else{e=$(this.target).offset().left+$(this.target).outerWidth(!0)/2-$(this.tooltipCon).outerWidth(!0)/2};if(i<0){i=0};if(e<0){e=0;$(this.tooltipCon).addClass('left_pushed')}
else{$(this.tooltipCon).removeClass('left_pushed')};if(toolTipRect['width']+e>windowRect['right']){e=windowRect['right']-toolTipRect['width'];$(this.tooltipCon).addClass('right_pushed')}
else{$(this.tooltipCon).removeClass('right_pushed')};var n={'top':i,'left':e,};$(this.tooltipCon).css(n);if(i<0||i>$(window).height()-$(this.tooltipCon).outerHeight(!0))this.reposition()},reposition:function(){if(this.position==='top'){this.position='bottom'}
else if(this.position==='bottom'){this.position='top'}},showTooltip:function(){if(this.tooltipCon){$(this.tooltipCon).show();$(this.tooltipCon).addClass('active')}
else{$(this.prototype['tooltipCon']).show();$(this.prototype['tooltipCon']).addClass('active')}},hideTooltip:function(){if(this.tooltipCon){$(this.tooltipCon).hide();$(this.tooltipCon).removeClass('active')}
else{$(this.prototype['tooltipCon']).hide();$(this.prototype['tooltipCon']).removeClass('active')}},removeTitleValue:function(){this.titleValue=$(this.target).attr('title');$(this.target).attr('title','')},addTitleValue:function(){$(this.target).attr('title',this.titleValue)}};bm.fileUploader={uploadFormEl:null,target:null,url:'',option:null,uploadType:'file',insertBtn:null,cancelBtn:null,onInsert:null,onCancel:null,getTitle:function(){var t='';switch(this.uploadType){case'file':t='파일업로드';break;case'excel':t='엑셀업로드';break;default:t='파일업로드';break};return t},defaultSetting:function(t){this.url=t.url;this.target=t.target?t.target:document.body;this.uploadType=t.uploadType?t.uploadType:this.uploadType},removeFileUploader:function(){$(this.uploadFormEl).remove();this.uploadFormEl=null},registFileUploader:function(t,e){this.option=e;this.defaultSetting(e);var i=this;$(t).on('click',function(){if(i.target===undefined||i.target==null||i.target==''){i.target=document.body};if(i.uploadFormEl==null){$(i.target).append(i.baseUploadForm());i.uploadFormEl=$(i.target).find('.upload_form');var t=$(i.uploadFormEl).outerWidth()/2,e=$(i.uploadFormEl).outerHeight()/2;i.insertBtn=$(i.uploadFormEl).find('#uploadFormFileInsert');i.cancelBtn=$(i.uploadFormEl).find('#uploadFormFileCancel');$(i.uploadFormEl).css({'margin-left':-t,'margin-top':-e});i.btnEventRegist(i.option)}})},getUploadTypeForm:function(){var t='';if(this.uploadType=='excel'){t+='<div class="option_box"><div class="checkbox_con"><input type="checkbox" id="option0" name="title_line" value="1" class="check_style0 blue" checked /><label for="option0" class="">제목줄 삭제</label></div></div>'};return t},baseUploadForm:function(){return'<div class="upload_form"><p class="title">'+this.getTitle()+'</p><form name="upload" action="'+this.url+'" method="post" enctype="multipart/form-data">'+this.getUploadTypeForm()+'<div class="admin_file_con" style="width:100%;"><input type="text" class="file_text" readonly=""><input type="button" class="file_button btn_small red icon_attach btn_mobile" value="파일첨부" style="right: 0;"><input type="file" class="file_input" name="file" onchange="$(this).parent().find(\'input[type=text]\').val(this.value)"></div><div class="btn_area"><input type="button" class="btn_small blue icon_confirm btn_mobile" id="uploadFormFileInsert" value="등록"><input type="button" class="btn_small black icon_close btn_mobile" id="uploadFormFileCancel" value="취소"></div></form></div>'},btnEventRegist:function(t){var e=this;$(this.insertBtn).off('click');$(this.cancelBtn).off('click');$(this.insertBtn).on('click',function(t){var o=$(e.uploadFormEl).find('input[type=\'file\']').val();if(o==''){alert('파일을 등록해 주세요.');return!1};var n=[];$.each($(e.uploadFormEl).find('input[type=\'checkbox\']:checked'),function(t,e){var i=$(e).attr('name'),o=$(e).val();n.push(i)});e.option.option=n;delete e.option.target;Progress.ON();var i=bm.formMultipart($(e.uploadFormEl).find('form[name=\'upload\']').attr('name'));i.extraData=e.option;i.useFormCheck=!1;i.onSubmitComplete=function(t){t=$.parseJSON(t);e.removeFileUploader();Progress.OFF();alert('데이터 파싱 완료!');trace(t)};i.start()});$(this.cancelBtn).on('click',function(t){t.stopPropagation();e.removeFileUploader()})}};bm.zipcode={opener:null,zipcodeName:null,sidoName:null,addressName:null,dim:null,zIndex:99999,isMakeDim:!1,_id:null,onSelect:null,popupHeight:500,defaultSetting:function(t){},jusoCallBack:function(t,e,i){console.log(t);console.log(e);console.log(i)},registZipcode:function(t,e){var i=this;$(t).on('click',function(){var n=e['callbackFunction'];i.opener=window.open(WEB_ROOT+'zipcode?callbackName='+n,'우편번호찾기','width=430, height=600, resizable=no, scrollbars=no, status=no;');var t=setInterval(function(){if(i.opener.closed){clearInterval(t);i.opener=null;return}},1000)})},closePostCode:function(){var t=this;this.removeZipcode()},themeObj:{bgColor:'#FFFFFF',searchBgColor:'#FFFFFF',contentBgColor:'#FFFFFF',pageBgColor:'#FFFFFF',queryTextColor:'#000000',outlineColor:'#f1f5f7'},getLayerPost:function(){var t=$('<div class="col-0 hidden juso_wrap" id="'+this._id+'"><div class="col-0 col-center juso_con"><div class="col-12 contents"><div class="table_style_0_con" id="'+this._id+'jusoCodeCon"></div><div class="tc fontsize0 btn_style_00_con"><a href="javascript:bm.zipcode.closePostCode();" class="mypage_btn_style_3 white">닫기</a></div></div></div></div>');return t},openPostCode:function(t,e,i,n,o,a,s,r){var l=this;l._id=t;var f=this.getLayerPost();if($('[data-wv-pc="mobile"]').length>0){this.popupHeight=700};this.makeDim();$('body').append(this.dim);if($('#'+l._id).length==0){$('body').append(f)};var h=document.getElementById(l._id+'jusoCodeCon'),c=$('input[name="'+e+'"]'),d=$('input[name="'+i+'"]');new daum.Postcode({theme:this.themeObj,height:this.popupHeight,oncomplete:function(t){if(bm.zipcode.onSelect)bm.zipcode.onSelect();c.val(t.zonecode);if(t.userSelectedType==='R'){if(t.buildingName)d.val(t.roadAddress+' ('+t.buildingName+')');else d.val(t.roadAddress)}
else{d.val(t.jibunAddress)};if(n)$('input[name="'+n+'"]').focus();if(o){var h=$('input[name="'+o+'"]');if(t.userSelectedType==='R'){var m=t.roadAddressEnglish,i=m.split(','),v=i[0]+', '+i[1];h.val(v)}
else{var u=t.jibunAddressEnglish,e=u.split(','),g=e[0]+', '+e[1];h.val(g)}};if(a){var p=$('input[name="'+a+'"]');p.val(t.sigunguEnglish)};if(s){var f=$('input[name="'+s+'"]');f.val(t.sidoEnglish)};if(r)r.call();l.removeZipcode()},onresize:function(t){}}).embed(h);$('#'+l._id).show();this.resize()},resize:function(){var t='#'+this._id,e=($(t)[0].offsetWidth==$(window).width()&&$(t)[0].offsetHeight>=$(window).height());if(e){$(t).css({'position':'fixed','top':'0','left':'0'})}
else{$(t).css({'position':'fixed','top':'50%','left':'50%'})};var i=-($(t)[0].offsetWidth/2),n=-($(t)[0].offsetHeight/2),o={'margin-top':n,'margin-left':i,'background-color':'#fff','z-index':this.zIndex+3};if(e){$(t).css({'background-color':'#fff','margin-top':'','margin-left':'','z-index':this.zIndex+3})}
else{$(t).css(o)}},makeDim:function(){var t=this;if(this.isMakeDim==!1){if(this.zIndex==bm.popupManager.defaultZindex&&bm.popupManager.zIndexList.length>0)this.zIndex=bm.popupManager.zIndexList[bm.popupManager.zIndexList.length-1]+1;this.dim=$('<div style="width: 100%; height: 100%; position: fixed; left:0; top:0; background-color: #000; opacity: '+bm.popupManager.defaultDimOpacity+'; filter:alpha(opacity='+bm.popupManager.defaultDimOpacity*100+'); z-index: '+this.zIndex+';"></div>');this.isMakeDim=!0;$(this.dim).on('click',function(){t.removeZipcode()})}},removeZipcode:function(){var t=this;$('#'+t._id).hide();$(t.dim).detach()}};bm.zipcode.defaultSetting();ScrollContainer=function(t,e,i,n,o,s,r){this.width=e;this.height=i;this.target=t;this.isResponsiveSize=!1;this.container=s||bm.html('<div></div>');this.isAutoUpdate=!0;this.preventMouseDown=!1;this.wheelInterval=30;this.useVirtualSize=!1;this.virtualSize={width:0,height:0};this.useScroll=r?!0:!1;this.userWidth=!1;this.scrollHeight=0;this.scrollableContentHeight=0;this.scrollBar=document.createElement('div');this.scrollBtn=document.createElement('div');this.scrollRect=document.createElement('div');this.scrollBar.setAttribute('class','scrollBar');bm.addChild(this.scrollBar,this.container);this.scrollBar.appendChild(this.scrollBtn);this.scrollBtn.appendChild(this.scrollRect);this.__posPrevLeft=n||0;this.__posPrevTop=o||0;this.__posLeft=n||0;this.__posTop=o||0;this.__isScrollBtnDragging=!1;if(!s){bm.setStyles(this.container,{width:this.width-1+'px',height:this.height+'px',clear:'both'})};if(this.useScroll){t&&bm.setStyles(t,{width:this.container.offsetWidth-9+'px'})};bm.setStyles(this.scrollBar,{position:'absolute',right:'0',zIndex:'1',width:'8px',height:this.height+'px'});bm.setStyles(this.scrollBtn,{width:'6px',height:this.height+'px',background:'#1aa5d9'});bm.setStyles(this.scrollRect,{width:'35px',height:this.height+'px',marginLeft:-27+'px'});if(!this.container.parentNode){var w=t.parentNode};var l=[],c=3,d=0,f=10,a=this;this.eventRegistered=!1;this.eventRegistration=function(t){if(a.eventRegistered==t)return;if(t){a.eventRegistered=!0;mouseAdapter(this.container).onDown(p);mouseAdapter(this.container).onDrag(u,g);mouseAdapter(this.container).onWheel(m)}
else{a.eventRegistered=!1;mouseAdapter(this.container).offDown(p);mouseAdapter(this.container).offDrag(u,g);mouseAdapter(this.container).offWheel(m)}};this.eventRegistration(!0);mouseAdapter(this.scrollBtn).onDown(v);mouseAdapter(this.scrollBtn).onDrag(b,y);function v(e){if(a.useScroll==!1)return;(e.preventDefault)?e.preventDefault():(e.returnValue=!1);if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=!0;if(a.userWidth==!1){bm.setStyles(t,{width:a.container.offsetWidth-25+'px'})};bm.setStyles(a.scrollBar,{width:'24px'});bm.setStyles(a.scrollBtn,{width:'20px',left:a.scrollBar.offsetLeft+1+'px'});TweenMax.killTweensOf(a);h=e.clientY};var h=0;function b(e){if(a.useScroll==!1)return;(e.preventDefault)?e.preventDefault():(e.returnValue=!1);if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=!0;a.__isScrollBtnDragging=!0;var i=Math.min(Math.max(0,parseInt(a.scrollBtn.style.marginTop)+e.clientY-h),a.scrollHeight);a.scrollBtn.style.marginTop=i+'px';a.__posTop=(a.scrollHeight==0?0:i/a.scrollHeight)*-a.scrollableContentHeight;a.moveContent(t,0,a.__posTop);h=e.clientY;a.__isScrollBtnDragging=!1};function y(e){if(a.useScroll==!1)return;(e.preventDefault)?e.preventDefault():(e.returnValue=!1);if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=!0;a.__isScrollBtnDragging=!1;if(!a.useScroll){bm.setStyles(t,{width:a.container.offsetWidth-9+'px'})};bm.setStyles(a.scrollBar,{width:'8px'});bm.setStyles(a.scrollBtn,{width:'6px',left:a.scrollBar.offsetLeft+1+'px'});a.scrollBarRefresh()};function p(t){if(a.useScroll==!1)return;if(a.preventMouseDown)(t.preventDefault)?t.preventDefault():(t.returnValue=!1);TweenMax.killTweensOf(a);h=0;var e=c;while(e--)l[e]=t.clientY};function u(e){if(a.useScroll==!1)return;d=e.clientY-l[0];l[0]=e.clientY;var i=c;while(i)l[i]=l[--i];a.__posTop+=d;a.moveContent(t,0,a.__posTop)};function g(e){if(a.useScroll==!1)return;var i;d=l[0]-l[c-1];i=Math.max(0.5,Math.abs(d/f/f));destination=a.__posTop+d*f;TweenMax.to(a,i,{__posTop:destination,onUpdate:function(){a.moveContent(t,0,a.__posTop)}})};function m(e){if(a.useScroll==!1)return;(e.preventDefault)?e.preventDefault():(e.returnValue=!1);var i,n;n=a.__posTop;if(e.delta<0)i=n-a.wheelInterval;else i=n+a.wheelInterval;a.moveContent(t,0,i)};this.refresh()};ScrollContainer.prototype={destroy:function(){},setUserWidth:function(t){this.userWidth=t;bm.setStyles(this.scrollBar,{background:'rgb(241, 241, 241)'});bm.setStyles(this.scrollBtn,{background:'rgb(136, 136, 136)'})},moveContent:function(t,e,i){e=Math.min(e,this.__limit.startX);e=Math.max(e,this.__limit.endX);i=Math.min(i,this.__limit.startY);i=Math.max(i,this.__limit.endY);this.__posLeft=e;this.__posTop=i;var n=this.__posLeft-this.__posPrevLeft,o=this.__posTop-this.__posPrevTop;events(this).dispatch('scrollChange',{left:e,top:i,moveLeft:n,moveTop:o});this.__posPrevLeft=e;this.__posPrevTop=i;this.refreshLimit();this.scrollBarRefresh();if(this.isAutoUpdate){t.style.left=e+'px';t.style.top=i+'px'}},scrollable:function(t){this.useScroll=t;if(this.useScroll){bm.setStyles(this.scrollBar,{display:'block'});if(this.isResponsiveSize==!1){bm.setStyles(this.target,{width:this.container.offsetWidth-9})};this.eventRegistration(!0)}
else{bm.setStyles(this.scrollBar,{display:'none'});if(this.isResponsiveSize==!1){bm.setStyles(this.target,{width:this.container.offsetWidth-1})};this.eventRegistration(!1)}},refresh:function(){this.__limit={startX:0,startY:0,endX:-Math.max(((this.useVirtualSize||!this.target)?this.virtualSize.width:this.target.offsetWidth)-this.width,0),endY:-Math.max(((this.useVirtualSize||!this.target)?this.virtualSize.height:this.target.offsetHeight)-this.height,0)};this.refreshLimit();this.scrollBarRefresh()},refreshLimit:function(){this.__posPrevLeft=Math.min(this.__posPrevLeft,this.__limit.startX);this.__posPrevLeft=Math.max(this.__posPrevLeft,this.__limit.endX);this.__posPrevTop=Math.min(this.__posPrevTop,this.__limit.startY);this.__posPrevTop=Math.max(this.__posPrevTop,this.__limit.endY)},btnMinHeight:30,scrollBarRefresh:function(){if(this.useScroll==!1)return;var t=this.container.offsetHeight||this.height||0;this.scrollableContentHeight=((this.useVirtualSize||!this.target)?this.virtualSize.height:this.target.offsetHeight)-this.height;var e=Math.min(t,Math.max(this.btnMinHeight,t/(this.scrollableContentHeight+this.height)*t))||0;this.scrollHeight=t-e;this.scrollBtn.style.height=e+'px';this.scrollRect.style.height=this.scrollBtn.style.height;this.scrollBar.style.height=t+'px';if(t==e){this.scrollBar.style.display='none';this.scrollBtn.style.display='none';this.scrollRect.style.display='none';this.eventRegistration(!1)}
else if(this.scrollBtn.style.display=='none'){this.scrollBar.style.display='block';this.scrollBtn.style.display='block';this.scrollRect.style.display='block';this.eventRegistration(!0)};this.calBtnPos()},calBtnPos:function(){var t=-this.__posPrevTop/this.scrollableContentHeight||0,e=this.scrollHeight*t||0;if(!this.__isScrollBtnDragging)this.scrollBtn.style.marginTop=e+'px'},scrollBtnReset:function(){this.__posTop=0;this.__posPrevTop=0;this.scrollBarRefresh()},getLimit:function(){return{startX:this.__limit.startX,startY:this.__limit.startY,endX:this.__limit.endX,endY:this.__limit.endY}},setSize:function(t,e){this.width=t-1;this.height=e}};BMSlider=function(t){this.type=t?t:'btn';this.con;this.bar;this.btn;this.limitX;this.per;this.onChangeHandler;var i,n,o=0,e=this;this.onDown=function(t){t.preventDefault();t.stopImmediatePropagation();i=n=t.clientX;if(e.type=='fill'){var o=i-$(e.con).offset().left;e.calCurrentPer(o/e.con.offsetWidth);if(e.onChangeHandler)e.onChangeHandler(e.per)}};this.onMove=function(t){t.preventDefault();t.stopImmediatePropagation();n=t.clientX;o+=n-i;var a;if(e.type=='btn'){a=Math.max(0,a);a=Math.min(a,e.limitX);e.calCurrentPer(a/e.limitX)}
else if(e.type=='fill'){a=i-$(e.con).offset().left;e.calCurrentPer(a/e.con.offsetWidth)};i=n;if(e.onChangeHandler)e.onChangeHandler(e.per)};this.onUp=function(t){t.preventDefault();t.stopImmediatePropagation()};this.calCurrentPer=function(t){this.per=Math.min(Math.max(0,t),this.limitX);var e,i;if(this.type=='btn'){e='margin-left';i=left}
else if(this.type=='fill'){e='width';i=(this.per*100)+'%'};$(this.btn).css(e,i)}};BMSlider.prototype={init:function(t,e,i){this.con=$(t)[0];this.bar=$(this.con).find(i)[0];this.btn=$(this.con).find(e)[0];var n;if(this.type=='btn'){this.limitX=this.bar.offsetWidth-this.btn.offsetWidth;n=parseInt(bm.getStyle(this.btn,'margin-left'))}
else if(this.type=='fill'){this.limitX=1;n=this.btn.offsetWidth/this.bar.offsetWidth};this.calCurrentPer(n);this.registEvent()},registEvent:function(){if(this.type=='btn'){mouseAdapter(this.btn).onDrag(this.onMove,this.onUp,this.onDown,!0)}
else if(this.type=='fill'){mouseAdapter(this.con).onDrag(this.onMove,this.onUp,this.onDown,!0)}},removeEvent:function(){if(this.type=='btn'){mouseAdapter(this.btn).offDrag()}
else if(this.type=='fill'){mouseAdapter(this.con).offDrag()}},setValue:function(t){this.per=t;var e=this.limitX*t;this.calCurrentPer(e)},active:function(){},deActive:function(){},destroy:function(){}};ListContainer=function(t,e,i,n,o){this.left=n;this.top=o;this.width=e;this.height=i;this.limit;this.scrollContainer=new ScrollContainer(null,e,i,n,o,t);this.scrollContainer.isAutoUpdate=!1;this.scrollContainer.useVirtualSize=!0;this.itemContainer=t;this.itemList=[];this.item=function(){return bm.html('<li></li>')};this.itemIndex=0;this.data=[];var a=this;this.refreshScrollContainer();events(this.scrollContainer).addListener('scrollChange',s);function s(t){var n,e,s,o,p,u,f,d,r,i,h,g;f=a.scaleToExtraHeight;d=t.moveTop>0?1:-1;p=-(a.height*f-a.height)/2;u=a.height+(a.height*f-a.height)/2;i=[];n=a.itemList;o=n.length;g=a.data.length-o;h=a.itemIndex;for(s=0;s<o;s++){e=n[s];e.top+=t.moveTop;e.style.top=e.top+'px';if(d>0){if(h>0&&e.top>u){i.push(e);h--}}
else if(d<0){if(h<g&&e.top<p){i.push(e);h++};r=e.top+parseInt(e.offsetHeight)}};o=i.length;if(o==0)return;var l,c=a.scrollContainer.virtualSize.height;if(d==1){l=a.itemIndex-1;r=n[0].top;while(o--){e=i[o];e.style.top=r-parseInt(e.offsetHeight)+'px';e.top=r-parseInt(e.offsetHeight);a.setItemAt(e,l);r=e.top;c-=parseInt(e.offsetHeight);l--;a.itemIndex--};if(i.length>0)a.itemList=i.concat(n.slice(0,n.length-i.length))}
else if(d==-1){l=a.itemIndex+n.length;for(s=0;s<o;s++){e=i[s];e.style.top=r+'px';e.top=r;a.setItemAt(e,l);r=e.top+parseInt(e.offsetHeight);c+=parseInt(e.offsetHeight);l++;a.itemIndex++};if(o>0)a.itemList=n.slice(i.length,n.length).concat(i)};if(a.scrollContainer.virtualSize.height!=c){a.scrollContainer.virtualSize.height=c;a.refreshScrollContainer()}}};ListContainer.prototype={scaleToExtraHeight:1.5,setData:function(t){var i,o,e,n;this.data=t;o=t.length;e=0;for(i=0;i<o;i++){n=this.setDataAt(t[i],i);n.style.top=e+'px';n.top=e;e+=n.offsetHeight;if(e>this.height*this.scaleToExtraHeight)break};this.scrollContainer.virtualSize.height=e;this.refreshScrollContainer()},setItemAt:function(t,e){t.innerHTML=this.data[e];return t},setDataAt:function(t,e){var i=this.getItem(e);i.innerHTML=t+'';return i},getItem:function(t){if(this.itemList[t])return this.itemList[t];var e=this.item();this.itemList[t]=e;this.itemContainer.appendChild(e);bm.setStyles(e,{position:'absolute'});return e},refreshListContainer:function(){var i,t,e;e=this.itemList.length;for(t=0;t<e;t++)this.setDataAt(this.data[this.itemIndex+t],t)},refreshScrollContainer:function(){this.scrollContainer.refresh();this.limit=this.scrollContainer.getLimit()}};Grid=function(t,e,i,n,o){var a=this;this.isSetStyle=!1;var u='background: #888 !important; color: #fff !important;';this.getSelectStyle=function(){var t=document.createElement('style');t.setAttribute('type','text/css');var e='.onGridItemSelect td, .onGridItemSelect th{ '+u+' }';if(t.styleSheet&&!t.sheet)t.styleSheet.cssText=e;else t.appendChild(document.createTextNode(e));return t};this.setSelectStyle=function(t){u=t};this.defaultItemHeight=i;this.viewNum=n;this.viewNumOrigin=n;this.table=t;this.thead=t.tHead;this.tbody=t.tBodies[0];this.width=e;this.height=i*n+(this.thead?this.thead.offsetHeight:0)+1;this.virtualHeight=0;this.prevTotalHeight=0;this.moveDirection=0;this.scaleToExtraHeight=2;this.dummyRow;this.labelFieldList;this.limit;this.scrollContainer=new ScrollContainer(t,this.width,this.height,0,0,o);this.scrollContainer.useVirtualSize=!0;this.scrollContainer.wheelInterval=i-1;this.scrollContainer.isAutoUpdate=!1;this.itemContainer=this.tbody;this.itemList=[];this.nodataRow=(function(){var e=a.__fooTable.insertRow(0).cloneNode(!0);a.__fooTable.deleteRow(0);var t=e.insertCell(0);t.innerHTML='표시할 내용이 없습니다.';t.style.height=100+'px';bm.setStyles(t,{textAlign:'center',verticalAlign:'middle'});var i=a.thead.querySelectorAll('td').length+a.thead.querySelectorAll('th').length;t.setAttribute('colspan',i.toString());return e})();this.item=function(){return this.dummyRow.cloneNode(!0)};this.itemIndex=0;this.itemSumMovement=0;this.data=[];this.option=[];this.refreshScrollContainer();this.__selectable=!1;this.searchBox;if(this.thead){var p=!1,s=-1,r=$(this.thead).find('[arrange]'),l=[],d=[],c=(function(){var t=[];if(r.length>0){bm.each(r,function(e,i){t.push(i.getAttribute('arrange'))})};return t})(),f=r.length;while(f--){r[f].style.cursor='pointer';r[f].innerHTML=r[f].innerText+' <span class=\'arrange\' style=\'color: #0178a4; font-size: 10px;\'>-</span>'};this.searchBox=bm.html('<div id=\'searchBox\' style=\'width: 190px; background: #fff; border: 1px solid #d2d2d2; padding: 7px; position: absolute; display: none; margin-top: '+(this.thead?this.thead.offsetHeight+1:0)+'px; \'><div style=\'border: 3px solid #d2d2d2; margin: 0; padding:0;\'><input class=\'grid_search_input_box\' type=\'text\' style=\'border: none; width: 130px;\' /><span class=\'grid_search_input_btn\' style=\'cursor: pointer; color: #999999;\'>검색</span></div><div style=\'float:left;\'><p class=\'grid_search_arr_up\' style=\'padding: 5px 0 0 0; margin: 0; cursor: pointer;\'>오름차순 정렬 <span style=\'color: #b3b3b3;\'>▲</span></p><p class=\'grid_search_arr_down\' style=\'padding: 2px 0; margin: 0; cursor: pointer;\'>내림차순 정렬 <span style=\'color: #b3b3b3;\'>▼</span></p></div><div class=\'grid_init_btn\' style=\'float: right; height: 37px; width: 65px; margin-top: 5px; background: #f0f0f0; border: 1px solid #bebebe; color: #555555; padding-top: 13px; text-align: center; cursor: pointer; margin-right: 1px; \'>초기화</div></div>');bm.addChild(this.searchBox,o);$(this.searchBox).find('.grid_init_btn').on('click',function(t){$(this.searchBox).find('.grid_search_input_box').val('');l[s]='';d[s]='';r[s].querySelector('.arrange').innerText='-';a.filterListData(c,l,d);h()});$(this.searchBox).find('.grid_search_input_box').on('focus',function(t){this.value=''});$(this.searchBox).find('.grid_search_input_box').keypress(function(t){if(t.which==13){var e=$(a.searchBox).find('.grid_search_input_box').val();l[s]=e;a.filterListData(c,l,d);h()}});$(this.searchBox).find('.grid_search_input_btn').on('click',function(t){var e=$(a.searchBox).find('.grid_search_input_box').val();l[s]=e;a.filterListData(c,l,d);h()});$(this.searchBox).find('.grid_search_arr_up').on('click',function(t){d[s]='asc';r[s].querySelector('.arrange').innerText='▲';a.filterListData(c,l,d);h()});$(this.searchBox).find('.grid_search_arr_down').on('click',function(t){d[s]='desc';r[s].querySelector('.arrange').innerText='▼';a.filterListData(c,l,d);h()});r.on(bm.isMobile?'touchstart':'mousedown',v);function v(e){e.stopPropagation();var i=bm.indexOf(r,this);if(i==s&&p){h();return};p=!0;s=i;var n=Math.min(this.offsetLeft,t.offsetWidth-$(a.searchBox).outerWidth());b(n)};function b(t){a.searchBox.querySelector('.grid_search_input_box').value=l[s]||'검색어 입력';bm.setStyles(a.searchBox,{'left':a.table.offsetLeft+t+'px','top':a.table.offsetTop-50+'px','display':'block',opacity:'0',alpha:'0'});TweenMax.to(a.searchBox,0.3,{top:a.table.offsetTop,opacity:1,alpha:1,ease:Back.easeOut});$(a.searchBox).on(bm.isMobile?'touchstart':'mousedown',g);$(window).on(bm.isMobile?'touchstart':'mousedown',m)};function h(){s=-1;p=!1;a.searchBox.style.display='none';$(a.searchBox).off(bm.isMobile?'touchstart':'mousedown',g);$(window).off(bm.isMobile?'touchstart':'mousedown',m)};function g(t){t.stopPropagation()};function m(t){h()}};events(this.scrollContainer).addListener('scrollChange',y);function y(t){if(t.moveTop==0)return;a.moveDirection=t.moveTop<0?-1:1;var n=(a.thead?a.thead.offsetHeight:0),i=0;bm.each(a.itemList,function(t,e){i+=e.offsetHeight});a.prevTotalHeight=i;a.itemSumMovement+=t.moveTop;var e=Math.abs(Math.ceil(a.itemSumMovement/((i-1)/a.viewNum)));if(e==a.itemIndex)return;if(t.moveTop<0&&e<a.itemIndex)return;if(t.moveTop>0&&e>a.itemIndex)return;a.itemIndex=Math.min(Math.max(e,0),a.data.length-a.viewNum);a.indexControl()};this.selectedIndex=-1;this.onItemSelect=function(t){var i=$(a.itemContainer).find('tr');i.removeClass('onGridItemSelect');var e=t.currentTarget;a.selectedIndex=a.itemIndex+bm.indexOf(i,e);$(e).addClass('onGridItemSelect');events(a).dispatch(Grid.SELECTION_CHANGE,{target:t.target,currentTarget:a,tr:e,data:a.data[a.selectedIndex]})}};Grid.SELECTION_CHANGE='gridSelectionChange';Grid.DOUBLE_CLICK='gridDoubleClick';Grid.prototype={__fooTable:document.createElement('table'),selectable:function(t){this.__selectable=t;if(t){if(this.isSetStyle==!1){this.isSetStyle=!0;document.querySelector('head').appendChild(this.getSelectStyle())};$(this.tbody).find('tr').on('click',this.onItemSelect)}
else{$(this.tbody).find('tr').off('click').removeClass('onGridItemSelect');this.selectedIndex=-1}},filterListData:function(t,e,i){var s=this.originData,n=e.length,a,l;while(n--){if(!e[n])continue;a=t[n];l=e[n];s=s.filter(function(t,e){return(t[a])?(t[a].toString().indexOf(l)>-1):!1})};var r=[];n=t.length;for(var o=0;o<n;o++){if(i[o]){a=t[o]+' '+i[o];r.push(a)}};s.sort(bm.sort.orderBy.apply(bm.sort,r));this.setData(s,!0)},setLabels:function(t){this.labelFieldList=t;this.resetDummy()},resetDummy:function(){var t=this.__fooTable.insertRow(0),e=[];bm.each(this.labelFieldList,function(i,n){e.push(t.insertCell(i))});this.dummyRow=t.cloneNode(!0);this.__fooTable.deleteRow(0)},setOption:function(t,e){if(!e)this.originOption=t;this.option=t},setData:function(t,e){this.itemIndex=0;this.viewNum=Math.min(this.viewNumOrigin,t.length);this.resetItemContainer();this.itemSumMovement=0;this.scrollContainer.scrollBtnReset();if(!e)this.originData=t;this.data=t;var i,o,a,n;a=this.itemIndex;t=this.data;o=t.length;for(i=0;i<this.viewNum;i++){n=this.getItem(i);this.itemContainer.appendChild(n);this.itemList[i]=n};if(this.__selectable)$(this.itemContainer).find('tr').on('click',this.onItemSelect);if(o){this.indexControl()}
else{this.tbody.appendChild(this.nodataRow);this.itemList[0]=this.nodataRow;this.refreshScrollContainer()}},resetItemContainer:function(){if(this.__selectable){$(this.itemContainer).find('tr').off('click')};this.itemList=[];var t=this.itemContainer.querySelectorAll('tr'),e=t.length;while(e--){this.itemContainer.removeChild(t[e])}},indexControl:function(){var t,a,e,i,o;o=this.option;e=this.itemIndex;i=this.data;a=i.length;for(t=0;t<this.viewNum;t++)this.setDataAt(i[t+e],o[t+e],t);if(this.__selectable){var n=$(this.itemContainer).find('tr');n.removeClass('onGridItemSelect');if(e<=this.selectedIndex&&e+this.viewNum>this.selectedIndex)$(n[this.selectedIndex-e]).addClass('onGridItemSelect')};this.refreshScrollContainer()},setItemAt:function(t,e){t.innerHTML=this.data[e];return t},setDataAt:function(t,e,i){var n=this.getItem(i),o=this.labelFieldList;bm.each(n.cells,function(e,i){i.innerHTML=t[o[e]]});if(e){bm.each(n.cells,function(t,i){var n=e[o[t]];if(n!=''){i.setAttribute('class',n)}})};return n},getItem:function(t){if(this.itemList[t])return this.itemList[t];var e=this.item();this.itemList[t]=e;return e},refreshListContainer:function(){var i,t,e;e=this.itemList.length;for(t=0;t<e;t++)this.setDataAt(this.data[this.itemIndex+t],this.option[this.itemIndex+t],t)},refreshScrollContainer:function(){var i=(this.thead?this.thead.offsetHeight:0),t=0;bm.each(this.itemList,function(e,i){t+=i.offsetHeight});if(this.prevTotalHeight!=t){if(this.prevTotalHeight==0)this.prevTotalHeight=t;else{this.prevTotalHeight=t;var e=Math.abs(Math.ceil(this.itemSumMovement/((t-1)/this.viewNum)));if((this.moveDirection<0&&e<this.itemIndex)||(this.moveDirection>0&&e>this.itemIndex)){}
else{this.itemIndex=Math.min(Math.max(e,0),this.data.length-this.viewNum);this.indexControl();return}}};t=t||0;this.virtualHeight=t/this.viewNum*this.data.length+i;this.scrollContainer.virtualSize.height=this.virtualHeight;t+=i;this.scrollContainer.setSize(this.width,t+1);this.scrollContainer.refresh();this.limit=this.scrollContainer.getLimit()}};GridAdvance=function(t,e,i,n,o,s){var a=this;this.isSetStyle=!1;var c='background: #efefef !important;';this.getSelectStyle=function(){var t=document.createElement('style');t.setAttribute('type','text/css');var i=a.table.getAttribute('id'),e=' .onGridItemSelect td, .onGridItemSelect th{ '+c+' }';e+=' #'+i+' tbody tr{ cursor:pointer; }';if(t.styleSheet&&!t.sheet)t.styleSheet.cssText=e;else t.appendChild(document.createTextNode(e));return t};this.setSelectStyle=function(t){c=t};this.container=o;this.defaultItemHeight=i;this.viewNumOrigin=n;this.viewNum=n;this.table=t;this.thead=t.tHead;this.tbody=t.tBodies[0];this.width=e;this.height=i*n+(this.thead?this.thead.offsetHeight:0)+1;this.virtualHeight=0;this.userWidth=!1;this.prevTotalHeight=0;this.moveDirection=0;this.scaleToExtraHeight=2;this.dummyRow;this.labelFieldList;this.limit;this.render;this.formatter;this.template;this.colDataList;this.useScroll=s?!0:!1;this.scrollContainer=new ScrollContainer(t,this.width,this.height,0,0,o,this.useScroll);this.scrollContainer.useVirtualSize=!0;this.scrollContainer.wheelInterval=i-1;this.scrollContainer.isAutoUpdate=!1;this.itemContainer=this.tbody;this.itemList=[];this.prevLeft=0;this.nodataRow=(function(){var e=a.__fooTable.insertRow(0).cloneNode(!0);a.__fooTable.deleteRow(0);var t=e.insertCell(0);t.innerHTML='표시할 내용이 없습니다.';t.style.height=100+'px';bm.setStyles(t,{textAlign:'center',verticalAlign:'middle',cursor:'auto'});return e})();this.item=function(){return this.dummyRow.cloneNode(!0)};this.itemIndex=0;this.itemSumMovement=0;this.data=[];this.originData=[];this.refreshScrollContainer();this.searchBox;var l=[],d=[],h;this.getSearchKeywordList=function(){return l};this.getSortList=function(){return d};this.getArrangeLabelList=function(){return h};var r=this;this.setHeaderSortOn=function(){if(r.thead){var c=!1,e=-1,i=$(r.thead).find('[data-grid-sort]');h=(function(){var t=[];if(i.length>0){bm.each(i,function(e,i){t.push(i.getAttribute('data-grid-sort'))})};return t})();var s=i.length;while(s--){i[s].style.cursor='pointer';i[s].innerHTML=i[s].innerText+' <span class=\'data-grid-sort\' style=\'color: #0178a4; font-size: 10px;\'>-</span>'};r.searchBox=bm.html('<div class=\'searchBox\' style=\'width: 190px; background: #fff; border: 1px solid #d2d2d2; padding: 7px; position: absolute; display: none; margin-top: '+(r.thead?r.thead.offsetHeight+1:0)+'px; \'><div style=\'border: 3px solid #d2d2d2; margin: 0; padding:0;\'><input class=\'grid_search_input_box\' placeholder=\'검색어 입력\' type=\'text\' style=\'border: none; width: 130px; text-align:left;\' /><span class=\'grid_search_input_btn\' style=\'cursor: pointer; color: #999999;\'>검색</span></div><div style=\'float:left;\'><p class=\'grid_search_arr_up\' style=\'padding: 5px 0 0 0; margin: 0; cursor: pointer;\'>오름차순 정렬 <span style=\'color: #b3b3b3;\'>▲</span></p><p class=\'grid_search_arr_down\' style=\'padding: 2px 0; margin: 0; cursor: pointer;\'>내림차순 정렬 <span style=\'color: #b3b3b3;\'>▼</span></p></div><div class=\'grid_init_btn\' style=\'float: right; height: 37px; width: 65px; margin-top: 5px; background: #f0f0f0; border: 1px solid #bebebe; color: #555555; padding-top: 13px; text-align: center; cursor: pointer; margin-right: 1px; \'>초기화</div></div>');bm.addChild(r.searchBox,o);$(r.searchBox).find('.grid_init_btn').on('click',function(t){$(r.searchBox).find('.grid_search_input_box').val('');l[e]='';d[e]='';i[e].querySelector('.data-grid-sort').innerText='-';a.filterListData(h,l,d);n()});$(r.searchBox).find('.grid_search_input_box').on('focus',function(t){r.value=''});$(r.searchBox).find('.grid_search_input_box').keypress(function(t){if(t.which==13){var i=$(a.searchBox).find('.grid_search_input_box').val();l[e]=i;a.filterListData(h,l,d);n()}});$(r.searchBox).find('.grid_search_input_btn').on('click',function(t){var i=$(a.searchBox).find('.grid_search_input_box').val();l[e]=i;a.filterListData(h,l,d);n()});$(r.searchBox).find('.grid_search_arr_up').on('click',function(t){d[e]='asc';i[e].querySelector('.data-grid-sort').innerText='▲';a.filterListData(h,l,d);n()});$(r.searchBox).find('.grid_search_arr_down').on('click',function(t){d[e]='desc';i[e].querySelector('.data-grid-sort').innerText='▼';a.filterListData(h,l,d);n()});i.on(bm.isMobile?'touchstart':'mousedown',u);function u(o){o.stopPropagation();var s=bm.indexOf(i,this);if(s==e&&c){n();return};c=!0;e=s;var r=Math.min(this.offsetLeft,t.offsetWidth-$(a.searchBox).outerWidth());g(r,this)};function g(t,i){a.searchBox.querySelector('.grid_search_input_box').value=l[e]?l[e]:'';if(a.userWidth){a.searchBox.style.position='absolute';bm.setStyles(a.searchBox,{'position':'absolute','top':'0','marginTop':'0px','marginLeft':'0px','display':'block',opacity:'0',alpha:'0'});var s=a.container.offsetWidth-a.searchBox.offsetWidth>>1,t=$(i).offset().left-($(a.searchBox).width()/2),n=$(i).width()+$(i).offset().left,o=$(a.searchBox).offset().left+$(a.searchBox).width();t=t+'px';if(n>o){if($(i).parent().find('th').last()[0]==$(i)[0]){bm.setStyles(a.searchBox,{'right':0,'left':'auto'})}
else{bm.setStyles(a.searchBox,{'left':t})}}
else{bm.setStyles(a.searchBox,{'left':t})};r.prevLeft=t;TweenMax.to(a.searchBox,0.3,{top:a.table.offsetTop,marginTop:i.offsetHeight,opacity:1,alpha:1,ease:Back.easeOut})}
else{bm.setStyles(a.searchBox,{'left':a.table.offsetLeft+t+'px','top':a.table.offsetTop-50+'px','display':'block',opacity:'0',alpha:'0'});TweenMax.to(a.searchBox,0.3,{top:a.table.offsetTop,opacity:1,alpha:1,ease:Back.easeOut})};$(a.searchBox).on(bm.isMobile?'touchstart':'mousedown',f);$(window).on(bm.isMobile?'touchstart':'mousedown',p)};function n(){e=-1;c=!1;a.searchBox.style.display='none';$(a.searchBox).off(bm.isMobile?'touchstart':'mousedown',f);$(window).off(bm.isMobile?'touchstart':'mousedown',p)};function f(t){t.stopPropagation()};function p(t){n()}}};events(this.scrollContainer).addListener('scrollChange',f);function f(t){var e=t.data.moveTop;if(!e)return;a.moveDirection=e<0?-1:1;var o=(a.thead?a.thead.offsetHeight:0),n=0;bm.each(a.itemList,function(t,e){n+=e.offsetHeight});a.prevTotalHeight=n;a.itemSumMovement+=e;var i=Math.abs(Math.ceil(a.itemSumMovement/((n-1)/a.viewNum)));if(i==a.itemIndex)return;if(e<0&&i<a.itemIndex)return;if(e>0&&i>a.itemIndex)return;a.itemIndex=Math.min(Math.max(i,0),a.data.length-a.viewNum);a.indexControl()};this.selectedIndex=-1;this.onItemSelect=function(t){var i=$(a.itemContainer).find('tr');i.removeClass('onGridItemSelect');var e=t.currentTarget;a.selectedIndex=a.itemIndex+bm.indexOf(i,e);$(e).addClass('onGridItemSelect');events(a).dispatch(Grid.SELECTION_CHANGE,{target:t.target,currentTarget:a,tr:e,data:a.data[a.selectedIndex],index:a.selectedIndex})};this.onItemDbClick=function(t){var n=$(a.itemContainer).find('tr'),e=t.currentTarget,i=a.itemIndex+bm.indexOf(n,e);events(a).dispatch(Grid.DOUBLE_CLICK,{target:t.target,currentTarget:a,tr:e,data:a.data[i],index:i})}};GridAdvance.prototype={__fooTable:document.createElement('table'),scrollable:function(t){this.useScroll=t;this.scrollContainer.scrollable(this.useScroll)},setUserWidth:function(t){this.userWidth=t;this.scrollContainer.setUserWidth(t)},setResponsiveWidth:function(t){this.scrollContainer.isResponsiveSize=!0;bm.setStyles(this.table,{width:t})},selectable:function(t){this.__selectable=t;if(t){if(this.isSetStyle==!1){this.isSetStyle=!0;document.querySelector('head').appendChild(this.getSelectStyle())};$(this.tbody).off('click','tr');$(this.tbody).on('click','tr',this.onItemSelect)}
else{$(this.tbody).off('click','tr').removeClass('onGridItemSelect');this.selectedIndex=-1}},filterListData:function(t,e,i){var s=this.originData,n=e.length,a,l;while(n--){if(!e[n])continue;a=t[n];l=e[n];s=s.filter(function(t,e){return(t[a])?(t[a].toString().indexOf(l)>-1):!1})};var r=[];n=t.length;for(var o=0;o<n;o++){if(i[o]){a=t[o]+' '+i[o];r.push(a)}};s.sort(bm.sort.orderBy.apply(bm.sort,r));this.setData(s,!0)},setLabels:function(t){this.labelFieldList=t},setRow:function(t){this.dummyRow=$.parseHTML(t)[0]},setViewNum:function(t){this.viewNumOrigin=t},setData:function(t,e){t=t||[];this.selectedIndex=-1;this.itemIndex=0;if(this.useScroll){this.viewNum=Math.min(this.viewNumOrigin,t.length)}
else{this.viewNum=t.length};this.resetItemContainer();this.itemSumMovement=0;this.scrollContainer.scrollBtnReset();if(!e)this.originData=t;this.data=t;var i,o;o=t.length;for(i=0;i<this.viewNum;i++){var n=this.getItem(i);this.itemContainer.appendChild(n);this.itemList[i]=n};if(this.__selectable){$(this.tbody).off('click','tr');$(this.tbody).on('click','tr',this.onItemSelect);$(this.tbody).off('dblclick','tr');$(this.tbody).on('dblclick','tr',this.onItemDbClick)};if(o){this.indexControl()}
else{this.noDataShow()}},noDataShow:function(){this.tbody.appendChild(this.nodataRow);this.itemList[0]=this.nodataRow;var t=0;if(this.thead.querySelector('tr')){bm.each(this.thead.querySelector('tr').querySelectorAll('td'),function(){if($(this).css('display')!=='none'){t+=this.colSpan}});bm.each(this.thead.querySelector('tr').querySelectorAll('th'),function(){if($(this).css('display')!=='none'){t+=this.colSpan}})};if(t>0){this.nodataRow.querySelector('td').setAttribute('colspan',t);var e=this;$(window).on('resize',function(){e.noDataColspanRefresh()})};this.refreshScrollContainer()},noDataColspanRefresh:function(){var t=0;if(this.thead.querySelector('tr')){bm.each(this.thead.querySelector('tr').querySelectorAll('td'),function(){if($(this).css('display')!=='none'){t+=this.colSpan}});bm.each(this.thead.querySelector('tr').querySelectorAll('th'),function(){if($(this).css('display')!=='none'){t+=this.colSpan}})};if(t>0){this.nodataRow.querySelector('td').setAttribute('colspan',t)}},indexControl:function(){var t,o,e,i;e=this.itemIndex;i=this.data;o=i.length;for(t=0;t<this.viewNum;t++)this.setDataAt(i[t+e],t);if(this.__selectable){var n=$(this.itemContainer).find('tr');n.removeClass('onGridItemSelect');if(e<=this.selectedIndex&&e+this.viewNum>this.selectedIndex)$(n[this.selectedIndex-e]).addClass('onGridItemSelect')};this.refreshScrollContainer()},resetItemContainer:function(){if(this.__selectable){$(this.itemContainer).find('tr').off('click')};this.itemList=[];var t=this.itemContainer.querySelectorAll('tr'),e=t.length;while(e--){this.itemContainer.removeChild(t[e])}},setItemAt:function(t,e){t.innerHTML=this.data[e];return t},setColumnData:function(t){this.colDataList=t;this.noDataShow()},getColumnDataById:function(t,e){if(e==null)return null;for(var i=0;i<e.length;i++){if(e[i]['id']==t)return e[i];var n=this.getColumnDataById(e[i]['columns']);if(n!=null)return n};return null},setDataAt:function(t,e){var n=this.getItem(e),a=this.labelFieldList,i,s=a.length,r,l,o=this;while(s--){i=a[s];if(i!==undefined&&t[i]!==undefined){r=t[i];$(n).find('[data-grid-field='+i+']').html(t[i])}};if(this.template||this.formatter){var o=this;bm.each(this.template,function(e,i){if(i){$(n).find('[data-grid-id='+e+']').html(bm.dom.convertVariables(t,i))}});bm.each(this.formatter,function(i,a){if(a){var s=$(n).find('[data-grid-id='+i+']')[0],r=$(s).attr('data-grid-field'),l=o.getColumnDataById.call(o,i,o.colDataList),d=a(e,s,t[r],l,t);$(s).html(d)}})};if(this.render)this.render(n,t,e+this.itemIndex);return n},getItem:function(t){if(this.itemList[t])return this.itemList[t];var e=this.item();this.itemList[t]=e;return e},refreshListContainer:function(){var t,e;e=this.itemList.length;for(t=0;t<e;t++)this.setDataAt(this.data[this.itemIndex+t],t)},refreshScrollContainer:function(){var i=(this.thead?this.thead.offsetHeight:0),t=0;bm.each(this.itemList,function(e,i){t+=i.offsetHeight});if(this.prevTotalHeight!=t){if(this.prevTotalHeight==0)this.prevTotalHeight=t;else{this.prevTotalHeight=t;var e=Math.abs(Math.ceil(this.itemSumMovement/((t-1)/this.viewNum)));if((this.moveDirection<0&&e<this.itemIndex)||(this.moveDirection>0&&e>this.itemIndex)){}
else{this.itemIndex=Math.min(Math.max(e,0),this.data.length-this.viewNum);this.indexControl();return}}};t=t||0;this.virtualHeight=t/this.viewNum*this.data.length+i;this.scrollContainer.virtualSize.height=this.virtualHeight;t+=i;this.scrollContainer.setSize(this.width,t);this.scrollContainer.refresh();this.limit=this.scrollContainer.getLimit()}};TabNavigator=function(t,e,i){this.selectedIndex=0;this.btns=t;this.childs=e;this.btnOnClass=i;this.active()};TabNavigator.TAB_INDEX_CHANGE='TAB_INDEX_CHANGE';TabNavigator.prototype={active:function(){var t=this;t.indexControl();$(this.btns).on('click',function(){t.selectedIndex=bm.indexOf(t.btns,this);t.indexControl()})},deActive:function(){$(this.btns).off('click')},indexControl:function(){var t=this.btns.length;while(t--){if(this.selectedIndex==t){$(this.btns[t]).addClass(this.btnOnClass);$(this.childs[t]).show()}
else{$(this.btns[t]).removeClass(this.btnOnClass);$(this.childs[t]).hide()}};events(this).dispatch(TabNavigator.TAB_INDEX_CHANGE,{selectedIndex:this.selectedIndex})}};var RadioGroup=function(t){this.elementList=t;this.selectedIndex=-1;this.init()};RadioGroup.prototype={init:function(){this.ON()},destroy:function(){this.OFF()},ON:function(){var t=this;$(this.elementList).on('click',function(){var e=bm.indexOf(t.elementList,this);t.setSelectedIndex(e);events(t).dispatch(RadioGroup.SELECTION_CHANGE,{selectedIndex:e,target:this,currentTarget:t})})},OFF:function(){$(this.elementList).off('click')},setSelectedIndex:function(t){this.removeChecked();this.selectedIndex=t;this.elementList[t].checked=!0;this.elementList[t].setAttribute('checked','true')},removeChecked:function(){bm.each(this.elementList,function(t,e){e.checked=!1;e.removeAttribute('checked')})}};RadioGroup.SELECTION_CHANGE='selectionChange';var MovieClip=function(t,e,i){var r,p,n,o,h,a,c,u,l,f;r=t.length;n=1;p=1000/i;o=!1;h={};l=!1;a=0;c=t.length;while(a<c){if(typeof t[a]==='string')t[a]=bm.html(t[a]);++a};a=0;c=t.length;while(a<c){e.appendChild(t[a]);t[a].style.position='absolute';t[a].style.visibility='hidden';++a};t[0].style.visibility='visible';this.reverse=function(t){l=t};this.getCurrentFrame=function(){return n};this.getTotalFrame=function(){return r};this.prevFrame=function(){o=!1;s(n-1);return n};this.nextFrame=function(){o=!1;s(n+1);return n};this.gotoAndStop=function(t){o=!1;s(t)};this.gotoAndPlay=function(t){s(t-1);if(o==!1){o=!0;d()}};this.playTo=function(t){if(t==n)return;f=t;if(o==!1){o=!0;d()}};this.play=function(){if(o==!1){o=!0;d()}};this.isPlay=function(){return o};this.stop=function(){o=!1};this.addFrameScript=function(t,e){h[t]=e};this.setSize=function(t,i){e.width=t;e.height=i};var d=function(){if(o==!1)return;if(l){if(n==1)s(r);else s(n-1)}
else{if(n==r)s(1);else s(n+1)};if(f&&n==f){o=!1}
else{setTimeout(d,p)}},s=function(e){if(bm.isMobile){t[n-1].style.visibility='hidden';n=e;if(n>r)n=r;else if(n<1)n=1;t[n-1].style.visibility='visible'}
else{if(l){t[n+1].style.visibility='hidden'}
else{t[n-1].style.visibility='hidden'};n=e;if(n>r)n=r;else if(n<1)n=1;if(!l){t[n-1].style.visibility='visible'}};if(typeof h[e]!=='undefined'){h[e]()}}},SheetClip=function(t,e,i,n,o,a){if(a===undefined)a=!1;var r=!0,c=e/i,s=1,d=null;this.onComplete=function(t){d=t};this.play=function(){if(r==!1){r=!0};h();return this};this.stop=function(){r=!1};this.gotoAndStop=function(t){if(r==!1)l(t)};this.prevFrame=function(){r=!1;l(s-1);return s};this.nextFrame=function(){r=!1;l(s+1);return s};var h=function(){if(r==!1)return;if(s==i&&a)l(1);else if(s==i&&!a){l(1);if(d)d();return}
else l(s+1);setTimeout(h,c)},l=function(e){s=e;if(s>i)s=i;else if(s<1)s=1;var a=-(e-1)*n+'px',r=-(e-1)*o+'px',l=a+' '+r;t.style.backgroundPosition=l}},TreeVO=function(t,e,i,n,o){this.key=t;this.label=e;this.seq=i;this.parentKey=n;this.data=o;this.depth;this.childList=[];this.accessGroupList;this.notEditableList=[];this.editorMode=bm.getParam('editormode')?bm.getParam('editormode'):null;var a=this;this.getData=function(){return{key:a.key,label:a.label,seq:a.seq,parentKey:a.parentKey,parent_id:a.parentKey,data:a.data,depth:a.depth,level:a.depth+1}}},TreeItemOption=function(t){this.element;this.targetItem;this.renderer=null;this.isTranslateWord=!1;this.activeEvent=null;this.uriKeyupEvent=null;this.nameKeyupEvent=null;this.removeEvent=null;this.menuMaxLength=127;this.editorMode=bm.getParam('editormode')?bm.getParam('editormode'):null;this.setOption=function(e){if(Object.prototype.toString.call(e)==='[object String]'){this.element=bm.html(e)}
else{this.element=t};$(this.element).hide()};if(t){this.setOption(t)};var e=this;this.active=function(t){if(this.targetItem){var i=this.getDataToObj();events(this).dispatch(TreeItemOption.CHANGE,{item:this.targetItem,data:i})};$(this.element).on('mousedown',function(t){t.stopImmediatePropagation()});$(this.element).find('.tree_item_delete_btn').on('click',function(){e.targetItem.remove()});this.targetItem=t;$(this.targetItem.element).find('.label > span').off('keypress');$(this.targetItem.element).find('.label > span').on('keypress',function(t){if(t.keyCode==13)t.preventDefault()});function n(t){if(typeof t.selectionStart=='number'){t.selectionStart=t.selectionEnd=t.value.length}
else if(typeof t.createTextRange!='undefined'){t.focus();var e=t.createTextRange();e.collapse(!1);e.select()}};$(this.targetItem.element).find('.label > span').off('paste');$(this.targetItem.element).find('.label > span').on('paste',function(t){var e=t.originalEvent.clipboardData.items;if(e.length>0&&e[0].type.indexOf('image')>-1){return!1}});$(this.targetItem.element).find('.label > span').off('keyup');$(this.targetItem.element).find('.label > span').on('keyup',function(t){var i=$(this).text();if(i.length>e.menuMaxLength){bm.toast('메뉴명은 최대 '+e.menuMaxLength+'자까지 입력할 수 있습니다.');$(this).text(i.substring(0,e.menuMaxLength));bm.string.focusEndOfContenteditable(this)}
else if(!bm.valid.checkHtmlTag(i)){$(this).text('');i=$(this).text();bm.string.focusEndOfContenteditable(this)};$(e.element).find('input[name=\'name\']').val(i.substring(0,e.menuMaxLength));e.menuNameValid(t,i);e.isTranslateWord=!1});$(this.targetItem.element).find('.label > span').off('keydown');$(this.targetItem.element).find('.label > span').on('keydown',function(t){var i=$(this).text();if(i.length>e.menuMaxLength){bm.toast('메뉴명은 최대 '+e.menuMaxLength+'자까지 입력할 수 있습니다.');$(this).text($(this).text().substring(0,e.menuMaxLength));bm.string.focusEndOfContenteditable(this)}
else if(!bm.valid.checkHtmlTag(i)){$(this).text('');bm.string.focusEndOfContenteditable(this)}});$(this.element).find('input[name=\'name\'], input[name=\'label\']').val(this.targetItem.vo.label);$(this.element).find('input[name=\'name\'], input[name=\'label\']').on('keyup',function(t){var i=this.value;if(i.length>e.menuMaxLength){bm.toast('메뉴명은 최대 '+e.menuMaxLength+'자까지 입력할 수 있습니다.');$(e.element).find('input[name=\'name\']').val(i.substring(0,e.menuMaxLength))}
else if(!bm.valid.checkHtmlTag(i)){$(e.element).find('input[name=\'name\']').val('');i=this.value};e.targetItem.setLabel(i.substring(0,e.menuMaxLength));if(e.nameKeyupEvent)e.nameKeyupEvent.call(e,t,this)});$(this.element).find('input[name=\'name\'], input[name=\'label\']').off('keydown');$(this.element).find('input[name=\'name\'], input[name=\'label\']').on('keydown',function(t){var i=this.value;if(i.length>e.menuMaxLength){bm.toast('메뉴명은 최대 '+e.menuMaxLength+'자까지 입력할 수 있습니다.');$(e.element).find('input[name=\'name\']').val(i.substring(0,e.menuMaxLength))}
else if(!bm.valid.checkHtmlTag(i)){$(e.element).find('input[name=\'name\']').val('')}});$(this.element).find('input[name=\'uri\'], input[name=\'uri_custom\']').on('keyup',function(t){var i=this.value;if(/([가-힣ㄱ-ㅎㅏ-ㅣ\x20])/ig.test(i)){i=i.replace(/([가-힣ㄱ-ㅎㅏ-ㅣ\x20])/g,'');$(this).val(i)}
else if(/_/g.test(i)){i=i.replace(/_/g,'');$(this).val(i)};if(e.uriKeyupEvent)e.uriKeyupEvent.call(e,t,this);e.setMenuUriText(i)});$(this.targetItem.element).find('.label > span').off('focusout');$(this.targetItem.element).find('.label > span').on('focusout',function(t){$(e.element).find('input[name=\'name\']').trigger('focusout')});if(this.renderer){this.renderer(this.element,this.targetItem)};if(this.targetItem.tree.exceptList){if(this.targetItem.vo.depth>0||this.targetItem.tree.exceptList.indexOf(this.targetItem.vo.data.page_id)>-1){$(this.element).find('#linkToSubmenu').hide()}
else{$(this.element).find('#linkToSubmenu').show()}};$(e.element).show()};this.remove=function(){if(this.targetItem){var t=this.getDataToObj();events(this).dispatch(TreeItemOption.CHANGE,{item:this.targetItem,data:t})};$(this.element).find('.tree_item_delete_btn').off();$(this.element).off();if(this.targetItem)$(this.targetItem.element).find('.label > span').off();$(this.element).find('input[name=\'name\'], input[name=\'label\']').off('keyup');$(this.element).find('input[name=\'uri\'], input[name=\'uri_custom\']').off('keyup');this.targetItem=null;this.reset()};this.menuNameValid=function(t,i){var n=!0;if(i==''){$('#nameWrap .caution').show();n=!1}
else{$('#nameWrap .caution').hide();if(t!==null&&this.menuUriValid(null,$(this.element).find('input[name=\'uri\']').val())){$(e.targetItem.element).removeClass('defect')}};return n};this.menuUriValid=function(t,i){var o=/^[0-9a-zA-Z-@]+$/g,n=!0;if(i!=''&&o.test(i)==!1&&bm.valid.isValidUrlRequireProtocol(i)==!1){$('#uriWrap .caution').show();n=!1}
else{$('#uriWrap .caution').hide();if(t!==null&&this.menuNameValid(null,$(this.element).find('input[name=\'name\']').val())){$(e.targetItem.element).removeClass('defect')}};return n};this.setMenuUriText=function(t){var e='____';if(t&&t!=''&&t.indexOf('http')===-1){e=t};$('#menuUri').text(e)};this.getDataToObj=function(){var i=$(this.element).find('form'),e={};var t,n;i.find('input[type=\'radio\']').each(function(){t=$(this).attr('name');if(e[t]===undefined)e[t]=$(this).is(':checked')?$(this).val():'';else if($(this).is(':checked')){e[t]=$(this).val()}});i.find('input[type=\'checkbox\']').each(function(){t=$(this).attr('name');if(e[t]===undefined){e[t]=$(this).is(':checked')?[$(this).val()]:''}
else{if($(this).is(':checked')){e[t]==''?e[t]=[$(this).val()]:e[t].push($(this).val())}}});i.find('textarea, input, select').not('input[type=\'checkbox\'], input[type=\'radio\'], input[type=\'reset\'], input[type=\'button\'], input[type=\'submit\'], input[type=\'image\']').each(function(){t=$(this).attr('name');e[t]=$(this).val()});i.find('.selected_item + input[type=\'hidden\']').each(function(){t=$(this).attr('name');e[t]=$(this).val()});return e};this.reset=function(){if(this.element){$(this.element).find('input').not('input[type=checkbox], input[type=radio]').val('');$(this.element).find('textarea').val('');$(this.element).find('select').prop('selectedIndex',0)}}};TreeItemOption.CHANGE='TREE_ITEM_OPTION_CHANGE';var TreeItem=function(){this.container;this.vo;this.element;this.option;this.childList=[];this.status=0;this.seq=0;this.tree;this.needEditItem=!1;this.addEvent=null;this.removeEvent=null;this.isRemoved=!1;var t=this;this.bodyclickHandler=function(){};this.onChangeOption=function(e){for(var i in e.data){t.vo.data[i]=e.data[i]};events(e.data.item).dispatch(TreeItemOption.CHANGE,{item:e.data.item,data:e.data.data})}};TreeItem.ADD='TREE_ITEM_ADD';TreeItem.DELETE='TREE_ITEM_DELETE';TreeItem.prototype={setVo:function(t){this.vo=t;this.seq=t.seq;if(!this.vo.depth)this.vo.depth=0},getData:function(){var o=this.childList.length,i,t,n;t=this.vo.getData();t.childList=[];for(var e=0;e<o;e++){i=this.childList[e];n=i.getData();t.childList.push(n)};return t},setLabel:function(t){this.vo.label=t;$(this.element).find('.label > span').text(t)},createNode:function(t,e){if(this.element)return;if(!this.vo){alert('vo가 정의되지 않았습니다.');return};var o=null;if(this.vo.data.page_id){o=this.vo.data.page_id};var n=null;if(this.vo.data.is_manual_uri==!1||this.vo.data.is_manual_uri=='0'){n=this.vo.data.uri}
else{n=this.vo.data.uri_custom};var i='<li class="depth_'+this.vo.depth;if(e==='WVMultiLingual'){i+='" data-tree-depth="'+this.vo.depth+'" data-tree-key="'+this.vo.key+'" data-tree-parentKey="'+this.vo.parentKey;i+='">';i+='<div class="label"><span>'+this.vo.label+'</span>';i+='</div></li>'}
else{if(bm.getParam('editormode')==='expert'){if(this['vo']['data']['is_main']===1){i+=' mainpage fixed'}};i+='" data-tree-depth="'+this.vo.depth+'" data-tree-key="'+this.vo.key+'" data-tree-parentKey="'+this.vo.parentKey;if(this.tree.exceptList&&this.tree.uriExceptList){if(this.tree.exceptList.indexOf(o)>-1||this.tree.uriExceptList.indexOf(n)>-1){i+='" data-tree-except>'}
else i+='">'}
else{i+='">'};if(bm.getParam('editormode')==='expert'&&this['vo']['data']['is_main']!==1){i+='<div class="label"><span>'+this.vo.label+'</span><div class="tree_item_config"></div><div class="tree_item_control">'}
else if(bm.getParam('filemanager')=='1'){i+='<div class="label"><span>'+this.vo.label+'</span>'}
else{i+='<div class="label"><span>'+this.vo.label+'</span><div class="tree_item_control">'};if(bm.getParam('editormode')==='expert'&&this['vo']['data']['is_main']==1){i+='<div class="tree_item_add menu_add_btn"></div>'}
else if(bm.getParam('filemanager')=='1'){i=i}
else if(this.tree.exceptList&&this.tree.uriExceptList){if(this.tree.exceptList.indexOf(o)===-1&&this.tree.uriExceptList.indexOf(n)===-1){i+='<div class="tree_item_add">+</div> <div class="tree_item_del">-</div>'}}
else{i+='<div class="tree_item_add">+</div> <div class="tree_item_del">-</div>'};i+='</div></div></li>'};this.element=bm.html(i);var a=this;a.registEvent();return this.element},registEvent:function(){var t=this;$(this.element).find('.tree_item_add').off('click').on('click',function(){events(t).dispatch(TreeItem.ADD,{item:t,copy:!0})});$(this.element).find('.tree_item_del').off('click').on('click',function(){t.remove()});$(this.element).find('.menu_add_btn').off('click').on('click',function(){events(t).dispatch(TreeItem.ADD,{item:t,copy:!1})});$(this.element).find('.tree_item_config').off('click').on('click',function(e){$(window.top.parent.document).find('#themeMenuTree').css({width:$(window.top.parent.document).find('#themeMenuTree').attr('openedwidth')});$('.board_contents.right').addClass('open');var o=$(e.target).closest('[data-tree-key]');const getItemByElement=(item)=>{var n=parseInt($(item).attr('data-tree-key'));return t.tree.dicItem[n]};var i=getItemByElement(o);t.tree.targetItem=i;t.tree.activeItem=t.tree.targetItem;t.tree.targetItem.active(t.tree.itemOption)})},appendTo:function(t){if(t){this.container=t};if(!this.container){alert('container 가 정의되지 않았습니다.');return};if(!this.element){this.create()};this.container.append(this.element)},remove:function(){if(this.isRemoved==!1){if(this.vo.depth==0&&this.checkRemainMenu()==1){alert('최소 1개의 메뉴는 존재해야 합니다.');return};if(this.childList.length>0){if(this.removeEvent&&this.removeEvent.call(this)===!1)return!1;if(confirm('하위 메뉴가 존재합니다. 함께 삭제하시겠습니까?')){function t(e){$(e).each(function(e,i){if(i.childList.length>0)t(i.childList);i.isRemoved=!0;events(this).dispatch(TreeItem.DELETE,{item:i,parentKey:i.vo.parentKey})})};t(this.childList);this.isRemoved=!0;events(this).dispatch(TreeItem.DELETE,{item:this,parentKey:this.vo.parentKey})}}
else{if(this.removeEvent&&this.removeEvent.call(this)===!1)return!1;if(confirm('선택하신 메뉴를 삭제하시겠습니까?')){this.isRemoved=!0;events(this).dispatch(TreeItem.DELETE,{item:this,parentKey:this.vo.parentKey})}}}
else{$(this.element).remove();this.deactive()}},checkRemainMenu:function(){var e=0;for(var t=0;t<this.tree.itemList.length;t++){var i=this.tree.itemList[t].vo.data.page_id,n=this.tree.itemList[t].vo.data.uri;if(this.tree.exceptList.indexOf(i)>-1||this.tree.uriExceptList.indexOf(n)>-1){continue};e+=1};return e},addChild:function(t){this.addChildAt(t,this.childList.length)},addChildAt:function(t,e){var i=this.childList.indexOf(t);if(i>-1)this.removeChild(t);this.childList.splice(e,0,t)},removeChild:function(t){var e=this.childList.indexOf(t);this.removeChildAt(e)},removeChildAt:function(t){if(t!=-1){this.childList.splice(t,1)}},setParentKey:function(t){$(this.element).attr('data-tree-parentKey',t);this.vo.parentKey=t},setDepth:function(t){var e=!1;if($(this.element).hasClass('fixed'))e=!0;this.vo.depth=t;$(this.element).attr('class','depth_'+t);$(this.element).attr('data-tree-depth',t);if(e)$(this.element).addClass('fixed')},setAccessGroup:function(t){this.vo.accessGroupList=t;this.vo.data.access_group_list=t},getAccessGroup:function(){return this.vo.accessGroupList},setTree:function(t){this.tree=t},setNeedEditItem:function(t){this.needEditItem=t},reBuildParentAccessGroup:function(t){var l=t.tree.getParentKey(t.element),i=t.getAccessGroup();if(l!=0){var r=this.tree.dicItem[l];if(r){var e=r.getAccessGroup();if(e&&e.length===0){t.setAccessGroup(i)}
else{if(i&&i.length){var f=i.length,s=[];for(var o=0;o<f;o++){var a=i[o].group_id,c={group_id:a};var h=e.length;for(var n=0;n<h;n++){var d=e[n].group_id;if(a==d)s.push(c)}};t.setAccessGroup(s)}
else{t.setAccessGroup(e)}}}}},reBuildingChildList:function(t,e){var o=this.childList.length,n=this.vo.depth+1;if(this.tree&&this.tree.isPromotion==1){if(n>this.tree.maxLimitDepth-1)n=1};if(o>0){var i;while(o--){i=this.childList[o];if(!i.element)i.createNode(t,e);else i.registEvent();if(n>=this.tree.maxLimitDepth&&t!=!0){i.setDepth(this.tree.maxLimitDepth-1)}
else{i.setDepth(n)};$(this.element).after(i.element);this.reBuildParentAccessGroup(i);if(i.childList.length>0)i.reBuildingChildList(t,e)}}},editable:function(){$(this.element).find('.label > span').attr('contenteditable','true');$(this.element).find('.label > span').attr('spellcheck','false')},editdisable:function(){$(this.element).find('.label > span').attr('contenteditable','false')},active:function(t,e){this.option=t;this.option.active(this);if(this.status==1)return;this.status=1;events(this.option).addListener(TreeItemOption.CHANGE,this.onChangeOption);if(this.tree.isEdit)this.editable();var i=this;$(window).on('mousedown',this.bodyclickHandler);$(this.element).on('mousedown',function(t){t.stopImmediatePropagation()});$(this.element).on('keyup',function(){i.vo.label=$(this).find('.label > span').text()})},deactive:function(){if(this.status==0)return;this.status=0;this.editdisable();$(window).off('mousedown',this.bodyclickHandler);$(this.element).off();this.option.remove();events(this.option).removeListener(TreeItemOption.CHANGE,this.onChangeOption)},destory:function(){this.remove()}};var Tree=function(){this.container;this.containerX=0;this.containerY=0;this.treeWrap;this.voList;this.itemList;this.dicItem={};this.targetItem;this.targetItemCon;this.temp;this.menuType='default';this.resultData;this.isEdit=!1;this.isDragging=!1;this.isDragEvent=!0;this.onItemOptionChange=null;this.editPageSeq=null;this.addItemReady=null;this.removeItemReady=null;this.addItemComplete=null;this.removeItemComplete=null;this.itemOptionRenderer=null;this.itemOptionUriKeyupEvent=null;this.itemOptionMenuNameKeyupEvent=null;this.itemAddEvent=null;this.itemRemoveEvent=null;this.isPromotion=0;try{if(i['seq']==='-1'){this.maxLimitDepth=3;bm.toast('콘솔확인바람');console.warn('관리자계정에서만 뎁스3으로 설정함\n일반사용자는 2임')}
else{this.maxLimitDepth=2}}catch(t){var i={seq:'-1'};this.maxLimitDepth=2;console.warn('loginSessionInfo가 선언되지 않았습니다.')};this.exceptList=null;this.uriExceptList=null;var e=this;this.onItemOptionChangeHandler=function(t){if(e.onItemOptionChange){e.onItemOptionChange(t.data.item,t.data.data)}};this.onItemAddHandler=function(t){e.optionChangeValid=!0;var o=t.data.item,i={};if(e.addItemReady&&e.addItemReady(t)===!1)return!1;if(o.vo&&o.vo.data){var n=o.vo.data;i.language=n.language;i.layout_seq=n.layout_seq;i.page_seq=n.page_seq;i['label']=''};if(t.data['copy']===!0){i['name']=n['name'];i['uri']=n['uri'];i['label']=o['vo']['label'];i['is_display']=n['is_display'];i['is_move_sub']=n['is_move_sub'];i['is_newtab']=n['is_newtab'];i['is_auto_uri']=n['is_auto_uri'];i['is_manual_uri']=n['is_manual_uri']}
else{i.is_auto_uri=1;i.is_manual_uri=0};var a;if(o.childList.length==0&&o.vo.depth>=e.maxLimitDepth-1){a=new TreeVO(e.createMaxKey(),i['label'],0,o.vo.parentKey,i)}
else{a=new TreeVO(e.createMaxKey(),i['label'],0,o.vo.key,i)};e.voList.push(a);e.addItemAt(a,0,o);if(e.addItemComplete&&e.addItemComplete(t)===!1)return!1};this.onItemDeleteHandler=function(t){e.optionChangeValid=!0;if(e.removeItemReady&&e.removeItemReady(t)===!1)return!1;e.removeItem(t.data.item);if(e.removeItemComplete&&e.removeItemComplete(t)===!1)return!1};this.itemOption};Tree.DRAG_START='TREE_DRAG_START';Tree.DRAG_STOP='TREE_DRAG_STOP';Tree.TREE_ITEM_CLICK='TREE_ITEM_CLICK';Tree.prototype={activeItem:null,optionChangeValid:!0,newItem:{},saveInitialItemInfo:function(){var n=this.voList.length;this.initialDicItem=[];var i=Object.keys(this.dicItem);for(var e=0;e<i.length;e++){this.initialDicItem[i[e]]=this.dicItem[i[e]]};var o,t;for(var e=0;e<n;e++){t=this.voList[e];t.initialParentKey=t.parentKey;t.initialDepth=t.depth;t.initialKey=t.key;t.initialSeq=t.seq}},resetToInitial:function(){var n=[],o=this.voList.length,a,t,e={};for(var i=0;i<o;i++){t=this.voList[i];if(t.initialKey){e[t.initialKey]=this.initialDicItem[t.key];t.depth=t.initialDepth;t.seq=t.initialSeq;t.key=t.initialKey;t.parentKey=t.initialParentKey;e[t.initialKey].setDepth(t.initialDepth);e[t.initialKey].setParentKey(t.initialParentKey);e[t.initialKey]['depth']=t['initialDepth'];e[t.initialKey]['seq']=t['initialSeq'];e[t.initialKey]['key']=t['initialKey'];e[t.initialKey]['parentKey']=t['initialParentKey'];if(e[t.initialKey]['childList']){e[t.initialKey]['childList']=[]};delete t['initialDepth'];delete t['initialSeq'];delete t['initialKey'];delete t['initialParentKey'];n.push(t)}};delete this['initialDicItem'];this.voList=n;this.dicItem=e;this.voList.sort(bm.sort.orderBy('parentKey asc','seq asc'));this.setHierarchyAndDepth();this.redraw()},redraw:function(){$(this.treeWrap).empty();var i=this.itemList.length,t;for(var e=0;e<i;e++){t=this.itemList[e];t.appendTo(this.treeWrap);t.registEvent();if(t.childList.length>0)t.reBuildingChildList()}},setData:function(t,e){this.voList=t;this.voList.sort(bm.sort.orderBy('parentKey asc','seq asc'));var a=this.voList.length,i,n;for(var o=0;o<a;o++){n=this.voList[o];i=new TreeItem();if(this.itemAddEvent){i.addEvent=this.itemAddEvent};if(this.itemRemoveEvent){i.removeEvent=this.itemRemoveEvent};events(i).addListener(TreeItemOption.CHANGE,this.onItemOptionChangeHandler);events(i).addListener(TreeItem.ADD,this.onItemAddHandler);events(i).addListener(TreeItem.DELETE,this.onItemDeleteHandler);i.setVo(n);i.setTree(this);if(n.data&&n.data.access_group_list){i.setAccessGroup(n.data.access_group_list)};this.dicItem[n.key]=i};this.setHierarchyAndDepth()},setMaxLimitDepth:function(t){this.maxLimitDepth=t},setPromotion:function(){this.isPromotion=1;this.maxLimitDepth=1},setMenuType:function(t){this.menuType=t},createMaxKey:function(){var i=this.voList.length,e=0;for(var t=0;t<i;t++){vo=this.voList[t];e=Math.max(e,vo.key)};return e+1},setExceptList:function(t){this.exceptList=t},setUriExceptList:function(t){this.uriExceptList=t},getData:function(){var n,t,i;if(this.activeItem&&this.activeItem.option){this.activeItem.option.remove()};i=[];const newItemList=this.itemList.filter((t)=>{if(t.getData()['data']['is_main']!==1){return!0}});n=newItemList.length;for(var e=0;e<n;e++){t=newItemList[e];i.push(t.getData())};return i},setHierarchyAndDepth:function(){this.itemList=[];var t,o,i,n;o=this.voList.length;for(var e=0;e<o;e++){t=this.voList[e];n=this.dicItem[t.key];if(t.parentKey==0){t.depth=0;this.itemList.push(n)}
else{i=this.dicItem[t.parentKey];t.depth=i.vo.depth+1;i.childList.push(n)}};function a(t){t.sort(bm.sort.orderBy('seq asc'));var i=t.length;for(var e=0;e<i;e++){if(t[e].childList.length>0){a(t[e].childList)}}};a(this.itemList)},setItemOption:function(t,e){if(this.itemOption){this.itemOption.setOption(t)}
else{this.itemOption=new TreeItemOption(t)};if(this.itemOptionUriKeyupEvent){this.itemOption.uriKeyupEvent=this.itemOptionUriKeyupEvent};if(this.itemOptionMenuNameKeyupEvent){this.itemOption.nameKeyupEvent=this.itemOptionMenuNameKeyupEvent};if(e)this.itemOption.renderer=e;else this.itemOption.renderer=null},setContainerOffset:function(){if(this.container){this.containerX=$(this.container).offset().left;this.containerY=$(this.container).offset().top}},draw:function(t,e,i,n){if(!this.container&&!t){alert('container 엘리먼트가 필요합니다.');return}
else if(t){this.container=$(t)[0];this.containerX=$(t).offset().left;this.containerY=$(t).offset().top};this.isEdit=!1;$(this.container).empty();$(this.container).html('<ul class=\'bm_tree_con\'></ul>');this.treeWrap=$(this.container).find('.bm_tree_con');var s=this.itemList.length,o;for(var a=0;a<s;a++){o=this.itemList[a];o.createNode(i,n);o.appendTo(this.treeWrap);if(o.childList.length>0)o.reBuildingChildList(i,n);if(a==s-1&&e)e()}},addItemAt:function(t,e,i){var r=Object.keys(this.newItem).length,n=new TreeItem();events(n).addListener(TreeItemOption.CHANGE,this.onItemOptionChangeHandler);events(n).addListener(TreeItem.ADD,this.onItemAddHandler);events(n).addListener(TreeItem.DELETE,this.onItemDeleteHandler);n.setVo(t);n.setAccessGroup([]);n.setTree(this);n.setNeedEditItem(!0);if(this.itemAddEvent){n.addEvent=this.itemAddEvent};if(this.itemRemoveEvent){n.removeEvent=this.itemRemoveEvent};var a;if(n.vo.parentKey!=0){var o=this.dicItem[n.vo.parentKey];if(i){a=i;if(o&&o.childList.length>0){var s=o.childList.indexOf(a);e=s>-1?s+1:e}}
else{if(o.childList.length>0){if(e!=0){a=o.childList[e-1]}
else{a=o}}
else{a=o}};n.setAccessGroup(o.getAccessGroup());o.childList.splice(e,0,n);n.vo.depth=o.vo.depth+1;if(n.vo.depth==this.maxLimitDepth)n.vo.depth=n.vo.depth-1}
else{if(e!=0){a=this.itemList.childList[e-1]}
else if(i){a=i};if(this.itemList.childList){this.itemList.childList.splice(e,0,n)}
else if(this.maxLimitDepth==1){this.itemList.splice(this.itemList.indexOf(a)+1,0,n)}};n.createNode();this.dicItem[n.vo.key]=n;if(a){$(a.element).after(n.element)}
else{if(this.itemList.childList){$(this.treeWrap).prepend(n.element)}
else{$(this.treeWrap).append(n.element)}};this.editOFF();this.editON();this.addNewItem(n,n.vo.key)},addItem:function(t){var e;if(t.parentKey!=0){var i=this.dicItem[t.parentKey];e=i.childList.length}
else{e=this.itemList.length};this.addItemAt(t,e)},removeItemAt:function(t,e){var i=this.dicItem[vo.parentKey],n=i.childList[e];this.removeItem(n)},removeItem:function(t){var n=t.vo;if(!t||!n){alert('삭제하려는 item 또는 vo가 존재하지 않습니다.');return};events(t).removeListener(TreeItemOption.CHANGE,this.onItemOptionChangeHandler);events(t).removeListener(TreeItem.ADD,this.onItemAddHandler);events(t).removeListener(TreeItem.DELETE,this.onItemDeleteHandler);var e;if(n.parentKey!=0){var i=this.dicItem[n.parentKey];if(!i){alert('vo에 있는 parentKey 와 매칭되는 TreeItem이 없습니다.');return};e=i.childList.indexOf(t);i.childList.splice(e,1)}
else{e=this.itemList.indexOf(t);this.itemList.splice(e,1)};this.editOFF();t.remove();delete this.dicItem[t.vo.key];this.targetItem=null;if(this.newItem[t.vo.key]){delete this.newItem[t.vo.key]};this.editON()},getItemByElement:function(t){var e=parseInt($(t).attr('data-tree-key'));return this.dicItem[e]},getParentKey:function(t){var i,e,n,o=-1;i=this.getItemByElement(t);if(i.vo.depth==0){return 0}
else{e=t;while(1){e=$(e).prev();if(e[0]==this.temp)continue;n=this.getItemByElement(e);if(n.vo.depth==i.vo.depth-1){return n.vo.key}}};return-1},moveItemToDownConatiner:function(t){$(this.targetItemCon).append(t.element);if(t.childList.length>0){var i=t.childList.length;for(var e=0;e<i;e++){this.moveItemToDownConatiner(t.childList[e])}}},moveItemToRealConatiner:function(t){$(this.targetItemCon).find('li').each(function(){$(t).after(this);t=this})},childDepthRefactoring:function(){if($(this.treeWrap).find('li').length<=1){return};var a=$(this.treeWrap).find('li')[0],o=$(this.treeWrap).find('li')[1],i=this.getItemByElement(a),t;this.itemList=[i];var n=[],s=i.vo.depth,e;n[0]=i;while(1){if(o){t=this.getItemByElement(o);if(!t)break}
else{break};if(t.vo.depth>i.vo.depth){t.setDepth(i.vo.depth+1)};if(t.vo.parentKey!=0){e=this.dicItem[t.vo.parentKey];e.removeChild(t)}
else{this.itemList.push(t)};t.childList=[];e=n[t.vo.depth-1];if(e){t.setParentKey(e.vo.key);e.addChild(t)}
else{t.setParentKey(0)};n[t.vo.depth]=t;i=t;o=$(t.element).next()}},addNewItem:function(t,e){if(!this.newItem[e]){this.newItem[e]=t}},removeNewItem:function(t){if(this.newItem[t])delete this.newItem[t]},editON:function(){if(this.isEdit)return;this.isEdit=!0;if(!this.temp){this.temp=bm.html('<li class="depth_0"><div class="label" style="background-color:white; opacity:0.5; border:1px dashed #000;">&nbsp;</div></li>');this.targetItemCon=bm.html('<ul class="bm_tree_con down_con" style="position:absolute; left:0; top:0; margin:0; padding:0;"></ul>')};var t=this,n,o,i={x:0,y:0},s=3,a=!1;var e;if($('body > div[data-wv-layout=layout]').length>0){if($('body > div[data-wv-layout=layout]').height()===0){e=window}
else{e=$('body > div[data-wv-layout=layout]')[0]}}
else{e=window};$(this.treeWrap).find('li').each(function(){var d=this;if(t.isDragEvent){if(!$(this).hasClass('fixed'))mouseAdapter(this).onDrag(h,l,r,!1);else{mouseAdapter(this).onDown(r);mouseAdapter(this).onUp(l)}}
else{mouseAdapter(this).onDown(r);mouseAdapter(this).onUp(l)};function r(i){t.optionChangeValid=!0;t.setContainerOffset();var s=i.currentTarget||d,a=t.getItemByElement(s);if(t.targetItem){var r,l,h,c,f,p,u,g;if(t.targetItem!=a){if(t.targetItem.seq==0&&t.targetItem.vo&&t.targetItem.vo.data){events(t.targetItem).dispatch(TreeItemOption.CHANGE,{item:t.targetItem,data:t.targetItem.vo.data});t.targetItem.setNeedEditItem(!1)};t.targetItem.deactive()}
else if(t.targetItem==a){t.targetItem.setNeedEditItem(!1)}};t.targetItem=a;t.isDragging=!1;if(t.exceptList&&t.targetItem.vo.data.page_id&&t.exceptList.indexOf(t.targetItem.vo.data.page_id)>-1){t.targetItem.editdisable()}
else if(t.uriExceptList&&((t.targetItem.vo.data.uri&&t.uriExceptList.indexOf(t.targetItem.vo.data.uri)>-1)||(t.targetItem.vo.data.uri_custom&&t.uriExceptList.indexOf(t.targetItem.vo.data.uri_custom)>-1))||!t.isEdit){t.targetItem.editdisable()}
else{t.targetItem.editable()};n=(i.clientX+$(e).scrollLeft())-t.targetItem.element.offsetLeft;o=(i.clientY+$(e).scrollTop())-t.targetItem.element.offsetTop;events(t).dispatch(Tree.DRAG_START,{element:s,item:t.targetItem,vo:t.targetItem.vo})};function h(r){if(t.optionChangeValid==!1){return!1};if(a==!1){i.x=Math.abs(n-((r.clientX+$(e).scrollLeft())-t.targetItem.element.offsetLeft));i.y=Math.abs(o-((r.clientY+$(e).scrollTop())-t.targetItem.element.offsetTop));if(i.x>s||i.y>s){a=!0;t.itemOption.remove();t.targetItem.editdisable()}}
else{if(t.isDragging==!1){$(t.targetItemCon).empty();$(t.treeWrap).after(t.targetItemCon);var d=bm.getStyle(t.targetItem.element,'margin-left');$(t.targetItemCon).css('marginLeft','-'+d);$(t.targetItem.element).before(t.temp);t.moveItemToDownConatiner(t.targetItem);t.targetItemCon.style.left=(r.clientX+$(e).scrollLeft())-n+'px';t.targetItemCon.style.top=(r.clientY+$(e).scrollTop())-o+'px';var l=parseInt(t.targetItemCon.style.left);t.defineDepthDestinationItem(l)};t.isDragging=!0;t.targetItemCon.style.left=(r.clientX+$(e).scrollLeft())-n+'px';t.targetItemCon.style.top=(r.clientY+$(e).scrollTop())-o+'px';t.hitTestItem((r.clientX+$(e).scrollLeft()),(r.clientY+$(e).scrollTop()))}};function l(e){if(t.optionChangeValid==!1){return!1};i={x:0,y:0};a=!1;if(t.isDragging==!1){if($(e.target).hasClass('tree_item_del')==!1&&$(e.target).hasClass('tree_item_add')==!1){if(t.itemOption){if($('body > div[data-wv-layout=layout]').length>0){if($('body > div[data-wv-layout=layout]').height()>0){$(document.body).append(t.itemOption.element);var h=t.targetItem.element.offsetLeft+$(t.container).offset().left+$(t.targetItem.element).find('.label').width(),c=t.targetItem.element.offsetTop+$(t.container).offset().top+$(t.targetItem.element).find('.label').height();$(t.itemOption.element).css({position:'absolute',left:h+'px',top:c+'px'})}};$(t.itemOption.element).closest('.board_contents_inner').show();$('#nodata_container').hide()};t.activeItem=t.targetItem;t.targetItem.active(t.itemOption);events(t).dispatch(Tree.TREE_ITEM_CLICK,{element:t.targetItem.element,item:t.targetItem,vo:t.targetItem.vo});t.targetItem.reBuildParentAccessGroup(t.targetItem);var l=$(e.target).closest('li');l.siblings('li').removeClass('active');l.addClass('active')};return};t.moveItemToRealConatiner(t.temp);$(t.targetItemCon).remove();var s=$(t.temp).attr('class'),r=parseInt(s.slice(6,s.length)),d=r-t.targetItem.vo.depth;if(d!=0){t.targetItem.setDepth(r);t.targetItem.reBuildingChildList()};$(t.temp).remove();var n=t.getParentKey(t.targetItem.element);if(t.targetItem.vo.parentKey!=n){if(t.targetItem.vo.parentKey!=0){var o=t.dicItem[t.targetItem.vo.parentKey];o.removeChild(t.targetItem)};t.targetItem.setParentKey(n);if(n!=0){o=t.dicItem[n];o.childList=[];$('[data-tree-parentKey="'+n+'"]').each(function(){o.childList.push(t.getItemByElement(this))})}};t.targetItem.reBuildParentAccessGroup(t.targetItem);t.childDepthRefactoring();t.isDragging=!1;t.activeItem=t.targetItem;t.targetItem.active(t.itemOption);events(t).dispatch(Tree.TREE_ITEM_CLICK,{element:t.targetItem.element,item:t.targetItem,vo:t.targetItem.vo})}});$(this.treeWrap).removeClass('uneditable')},hitTestItem:function(t,e){var s=$(this.treeWrap).find('li'),r=s.length,i,l,n,d,a,h=parseInt(this.targetItemCon.style.left);t-=this.containerX;e-=this.containerY;for(var o=0;o<r;o++){i=s[o];if(i==this.targetItem||i==this.temp)continue;l=i.offsetLeft;n=i.offsetTop;d=i.offsetWidth;a=i.offsetHeight;if(n<e&&n+a>e&&$(i).attr('data-tree-except')===undefined){if(n+a/2<e){$(i).before(this.temp)}
else{$(i).after(this.temp)}}};this.defineDepthDestinationItem(h)},defineDepthDestinationItem:function(t){t+=this.containerX;var o=$(this.temp).prev();if((o.length>0)&&(o[0]==this.targetItem))o=$(o).prev();var i=-1,n=$(o).attr('class');n=n?parseInt(n.slice(6,n.length))+1:0;$(this.temp).attr('class','');var r=$(this.treeWrap).offset().left,a=t-r,l=this.maxLimitDepth,s=50;for(var e=0;e<l;e++){if(a>=s*e&&a<s*(e+1)){i=e;break}
else if(a>=s*e&&a>s*(this.maxLimitDepth)){i=this.maxLimitDepth-1;break}};i=Math.max(0,Math.min(i,n));$(this.temp).addClass('depth_'+i)},editOFF:function(){if(this.isEdit==!1)return;this.isEdit=!1;$(this.treeWrap).find('li').each(function(){mouseAdapter(this).offDrag()});$(this.treeWrap).addClass('uneditable')}};var VR=function(t,e,i){this.mode=VR.MODE_USER_CONTROL;this.container=t;this.textureImg=e;this.createComplete=i;this.onBtnHandler=null;this.onReady=null;this.isBtnClicked=!1;this.latitude=-0;this.longitude=-180;this.canvasWidth;this.canvasHeight;this.scene;this.camera;this.sphere;this.sphereMaterial;this.raycaster;this.btnList=[];this.slider;this.controls;this.loader;this.isLandscape;this.currentZoomSize=0.5;this.touchZoomStatus=!1;var s={alpha:0,beta:0,gamma:0,orient:1};var o=WEVEN_JS_WEB_PATH?WEVEN_JS_WEB_PATH:'../../',n=this;if(VR.scriptLoaded==!1){bm.scriptLoader(function(){bm.scriptLoader(function(){VR.scriptLoaded=!0;n.init()},o+'libs/three/DeviceOrientationController.js')},o+'libs/three/three.js')};this.render=function(){a()};var n=this;function a(){if(n.mode==VR.MODE_USER_CONTROL){n.latitude=Math.max(-85,Math.min(85,n.latitude));var t=50*Math.sin(THREE.Math.degToRad(90-n.latitude))*Math.cos(THREE.Math.degToRad(n.longitude)),e=50*Math.cos(THREE.Math.degToRad(90-n.latitude)),i=50*Math.sin(THREE.Math.degToRad(90-n.latitude))*Math.sin(THREE.Math.degToRad(n.longitude));n.camera.target.x=t;n.camera.target.y=e;n.camera.target.z=i;n.camera.lookAt(n.camera.target)}
else{requestAnimationFrame(a);n.controls.update()};n.renderer.render(n.scene,n.camera)}};VR.MODE_USER_CONTROL='MODE_USER_CONTROL';VR.MODE_DEVICE_ORIENTATION='MODE_DEVICE_ORIENTATION';VR.scriptLoaded=!1;VR.prototype={init:function(){$(this.container).css('position','relative');this.renderer=new THREE.WebGLRenderer();this.renderer.setSize(this.container.offsetWidth,this.container.offsetHeight);this.canvasWidth=this.container.offsetWidth;this.canvasHeight=this.container.offsetHeight;this.container.appendChild(this.renderer.domElement);this.scene=new THREE.Scene();this.camera=new THREE.PerspectiveCamera(80,this.container.offsetWidth/this.container.offsetHeight,1,1000);this.camera.target=new THREE.Vector3(0,0,0);this.sphere=new THREE.SphereGeometry(100,100,50);this.sphere.applyMatrix(new THREE.Matrix4().makeScale(-1,1,1));this.sphereMaterial=new THREE.MeshBasicMaterial();this.raycaster=new THREE.Raycaster();this.loader=new THREE.TextureLoader();this.sphereMesh=new THREE.Mesh(this.sphere,this.sphereMaterial);this.scene.add(this.sphereMesh);this.onScreenOrientationChange();this.initLoadTexture();this.initSlider();if(this.createComplete)this.createComplete();this.registEvent();this.registMouseEventHandler();this.registTouchEventHandler()},initLoadTexture:function(){var t=this;Progress.ON();this.loader.load(this.textureImg,function(e){Progress.OFF();t.sphereMaterial.map=e;if(bm.isMobile){t.controls=new DeviceOrientationController(t.camera,t.renderer.domElement);events(t.controls).addListener('ZOOM_CHANGE',function(e){t.setZoom(t.currentZoomSize+e.data.changeZoomSize,!0)});t.changeMode(VR.MODE_DEVICE_ORIENTATION)}
else{t.changeMode(VR.MODE_USER_CONTROL)};if(t.onReady)t.onReady()})},initSlider:function(){var t=this;this.slider=new BMSlider('fill');this.slider.init($('#vrZoomBtnCon'),'#vrZoomBtn','#vrZoomBar');this.slider.onChangeHandler=function(e){t.zoomControl(e)}},registEvent:function(){var t=this;window.addEventListener('orientationchange',function(e){t.onScreenOrientationChange()});$(this.container).on('mousewheel',function(e){var i,n;if(e.originalEvent)e=e.originalEvent;if(e.wheelDelta)i=e.wheelDelta/120;else if(e.detail)i=-e.detail/3;if(i>0){t.setZoom(t.currentZoomSize+0.1)}
else{t.setZoom(t.currentZoomSize-0.1)}});if($('#vrModeBtn').length>0){mouseAdapter($('#vrModeBtn')[0]).onDown(function(e){e.preventDefault();e.stopImmediatePropagation();if(bm.isMobile==!1){alert('PC에서는 지원하지 않습니다.');return};if(t.mode==VR.MODE_USER_CONTROL){t.changeMode(VR.MODE_DEVICE_ORIENTATION)}
else{t.changeMode(VR.MODE_USER_CONTROL)}})}},registTouchEventHandler:function(){var t=this,e,i,n,o=0.004;document.addEventListener('touchstart',a);document.addEventListener('touchmove',s);document.addEventListener('touchend',r);function a(n){if(t.mode!=VR.MODE_DEVICE_ORIENTATION&&n.touches.length==2){n.preventDefault();n.stopImmediatePropagation();t.touchZoomStatus=!0;i=Math.sqrt(Math.pow((n.touches[1].clientX-n.touches[0].clientX),2)+Math.pow((n.touches[1].clientY-n.touches[0].clientY),2));e=t.currentZoomSize}};function s(a){if(t.mode!=VR.MODE_DEVICE_ORIENTATION&&a.touches.length==2){a.preventDefault();a.stopImmediatePropagation();t.touchZoomStatus=!0;n=Math.sqrt(Math.pow((a.touches[1].clientX-a.touches[0].clientX),2)+Math.pow((a.touches[1].clientY-a.touches[0].clientY),2));t.setZoom(e+(n-i)*o)}};function r(e){if(t.mode!=VR.MODE_DEVICE_ORIENTATION&&e.touches.length==2){e.preventDefault();e.stopImmediatePropagation()};t.touchZoomStatus=!1}},registMouseEventHandler:function(){var e=null,o=0.3,a=0.1,i,n,t=this;mouseAdapter(this.container).onDrag(r,l,s);window.addEventListener('mousemove',d);function s(o){if(t.touchZoomStatus)return;var r,l;r=$(t.container).offset().left;l=$(t.container).offset().top;var s=new THREE.Vector3(((o.clientX-r)/t.canvasWidth)*2-1,-((o.clientY-l)/t.canvasHeight)*2+1,0.5);s.unproject(t.camera);t.raycaster.set(t.camera.position,s.sub(t.camera.position).normalize());for(var a=0;a<t.btnList.length;a++){var d=t.raycaster.intersectObject(t.btnList[a]);if(d.length>0){e=t.btnList[a];t.isBtnClicked=!0}};if(!e){t.isBtnClicked=!1};if(t.mode!=VR.MODE_USER_CONTROL)return;o.preventDefault();i=o.clientX;n=o.clientY};function r(e){if(t.touchZoomStatus)return;if(t.mode!=VR.MODE_USER_CONTROL)return;t.isBtnClicked=!1;if(bm.isMobile){t.longitude=(i-e.clientX)*o+t.longitude;t.latitude=(e.clientY-n)*o+t.latitude}
else{t.longitude=(i-e.clientX)*a+t.longitude;t.latitude=(e.clientY-n)*a+t.latitude};t.render(1);i=e.clientX;n=e.clientY};function l(i){if(t.touchZoomStatus)return;if(e){var a,s;a=$(t.container).offset().left;s=$(t.container).offset().top;var o=new THREE.Vector3(((i.clientX-a)/t.canvasWidth)*2-1,-((i.clientY-s)/t.canvasHeight)*2+1,0.5);o.unproject(t.camera);t.raycaster.set(t.camera.position,o.sub(t.camera.position).normalize());for(var n=0;n<t.btnList.length;n++){var r=t.raycaster.intersectObject(t.btnList[n]);if(r.length>0&&e==t.btnList[n]){i.stopImmediatePropagation();if(t.onBtnHandler)t.onBtnHandler(t.btnList[n]);t.isBtnClicked=!1;return}};e=null};t.isBtnClicked=!1;if(t.mode!=VR.MODE_USER_CONTROL)return;requestAnimationFrame(t.render)};function d(e){var n=new THREE.Vector2();n.x=(e.clientX/window.innerWidth)*2-1;n.y=-(e.clientY/window.innerHeight)*2+1;t.raycaster.setFromCamera(n,t.camera);for(var i=0;i<t.btnList.length;i++){var o=t.raycaster.intersectObject(t.btnList[i]);if(o.length>0){$('body').addClass('pointer');break}
else{$('body').removeClass('pointer')}}}},changeImage:function(t){var e=this;Progress.ON();loader.load(t,function(t){Progress.OFF();e.sphereMaterial.map=t;e.render()})},onScreenOrientationChange:function(t){this.isLandscape=document.documentElement.clientHeight<document.documentElement.clientWidth},changeSize:function(t,e,i,n){var o=$(this.container).find('canvas');o.attr('width',t+'px').attr('height',e+'px').css({width:t,height:e});this.canvasWidth=t;this.canvasHeight=e;i=i||t;n=n||e;this.renderer.setViewport(0,0,i,n);this.camera.aspect=i/n;this.camera.updateProjectionMatrix();this.render();this.zoomControl(this.currentZoomSize)},changeMode:function(t){if(this.mode==t){this.render();return};this.mode=t;if(this.mode==VR.MODE_USER_CONTROL){$(this.container).find('#vrModeBtn').text('수동 회전 모드');if(this.controls){this.controls.disconnect()}}
else{$(this.container).find('#vrModeBtn').text('디바이스 회전 모드');this.controls.connect()};this.render()},setZoom:function(t,e){t=this.zoomControl(t,e);this.slider.setValue(t)},zoomControl:function(t,e){if(t>1)t=1;else if(t<0)t=0;this.currentZoomSize=t;$('#vrZoomSize').text(Math.floor(t*100)+'%');if($(window).width()>$(window).height()){this.camera.fov=55-20*t}
else{this.camera.fov=100-60*t};this.camera.updateProjectionMatrix();if(!e)this.render();return t},insertImg:function(t){t.opacity=t.opacity===undefined?1:t.opacity;var n=new THREE.TextureLoader(),i=new THREE.MeshBasicMaterial({map:n.load(t.imgUrl),opacity:t.opacity,transparent:t.opacity===1?!1:!0});i.map.needsUpdate=!0;t.width=t.width||3;t.height=t.height||3;t.depth=t.depth||1;var e=new THREE.Mesh(new THREE.PlaneGeometry(t.width,t.height,t.depth,1,0,0),i);e.position.x=t.x;e.position.y=t.y;e.position.z=t.z;e.rotation.x=t.rotationX*Math.PI/180;e.rotation.y=t.rotationY*Math.PI/180;this.scene.add(e);this.btnList.push(e);return e},getLatLongByXYZ:function(t,e,i){var n=new THREE.Vector3();n.x=t;n.y=e;n.z=i;var o=20,a=90-(Math.acos(n.y/o)*180)/Math.PI,s=((90+(Math.atan2(n.x,n.z)*180)/Math.PI)%360)-180;let latAndLongObj={latitude:a,longitude:s};return latAndLongObj},vector3toLonLat:function(t){t.normalize();var e=-Math.atan2(-t.z,-t.x)-Math.PI;if(e<-Math.PI)e+=Math.PI*2;if(e>Math.PI)e-=Math.PI*2;var n=new THREE.Vector3(t.x,0,t.z);n.normalize();var i=Math.acos(n.dot(t));if(t.y<0)i*=-1;return[e,i]},locateCamera:function(t,e,i,n){var a=new THREE.Vector3(0,1,0),r=t.clone().normalize(),o=Math.acos(a.dot(r));o+=i||0;if(o>Math.PI)a.y*=-1;if(o<0)o+=Math.PI;var l=a.crossVectors(a,r),s=new THREE.Vector3(0,1,0);s.applyAxisAngle(l,o);s.multiplyScalar(n).add(t);e.position.copy(s);e.lookAt(t)},getCoordinatesFromLatLng:function(t,e,i){let latitude_rad=t*Math.PI/180;let longitude_rad=e*Math.PI/180;let xPos=i*Math.cos(latitude_rad)*Math.cos(longitude_rad);let zPos=i*Math.cos(latitude_rad)*Math.sin(longitude_rad);let yPos=i*Math.sin(latitude_rad);return{x:xPos,y:yPos,z:zPos}},latLongToVector3:function(t,e,i,n){var o=(t)*Math.PI/180,a=(e-180)*Math.PI/180,s=-(i+n)*Math.cos(o)*Math.cos(a),r=(i+n)*Math.sin(o),l=(i+n)*Math.cos(o)*Math.sin(a);return new THREE.Vector3(s,r,l)}};var BmPlayer=function(t,e,i,n,o){this.container=Object.prototype.toString.call(t)==='[object String]'?$(t)[0]:t;this.playBtn=e;this.pauseBtn=i;this.stopBtn=n;$(this.playBtn).show();$(this.pauseBtn).hide();this.isReady=!1;this.isPlay=!1;this.player=null;this.onPlay=null;this.onPause=null;this.onStop=null;this.onProgress=null;this.onPlaying=null;this.isFullScreenMode=o;this.targetWidth=100;this.targetHeight=100;this.isBuffered=!1;this.bufferRate=0;this.targetWidth=0;var a=this;this.init=function(t,e,i,n){n=n||'myVideo';i=i?'controls':'';this.targetWidth=e;$(this.container).append('<video controlsList="nodownload" src="'+t+'" id="'+n+'" width="'+e+'" '+i+'></video>');this.player=document.getElementById(n);this.registEvent()};this.ready=function(){this.isReady=!0;this.setSize(this.targetWidth)};this.registEvent=function(){$(this.player).on('progress',s);$(this.player).on('timeupdate',s);$(this.player).on('play',function(){a.setStatus('play')});$(this.player).on('pause',function(){a.setStatus('pause')});$(this.playBtn).on('click',function(t){a.play()});$(this.pauseBtn).on('click',function(t){a.pause()});$(this.stopBtn).on('click',function(t){a.stop()})};function s(){if(!a.isReady){a.ready()};var i=a.player.currentTime,t=a.player.buffered,e=a.player.duration;a.bufferRate=t.end(0)/e*100;if(a.onProgress){a.onProgress({currentTime:i,bufferStart:t.start(0),bufferEnd:t.end(0),duration:e,bufferRate:a.bufferRate})};if(a.onPlaying){a.onPlaying({currentTime:i,bufferStart:t.start(0),bufferEnd:t.end(0),duration:e,bufferRate:a.bufferRate})}};this.removeEvent=function(){$(this.playBtn).off();$(this.pauseBtn).off();$(this.stopBtn).off()};this.setMaxSizeMode=function(t,e,i){this.targetWidth=e;this.targetHeight=i;this.mode=t;$(window).on('resize',function(){if(!a.isReady)return;var i=$(window).width(),n=$(window).height(),s=i/n,o=a.targetWidth/a.targetHeight;if(a.mode==a.MAINTAIN_ASPECT_RATIO){var t=$(a.player).width(),e=t/o;a.setSize('100%',e+'px')}})};this.fullSizeOn=function(){if(this.player.requestFullscreen){this.player.requestFullscreen()}
else if(this.player.mozRequestFullScreen){this.player.mozRequestFullScreen()}
else if(this.player.webkitRequestFullscreen){this.player.webkitRequestFullscreen()}
else if(this.player.msRequestFullscreen){this.player.msRequestFullscreen()}};this.fullSizeOff=function(){if(document.exitFullscreen){document.exitFullscreen()}
else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}
else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}
else if(document.msExitFullscreen){document.msExitFullscreen()}};this.setSize=function(t){this.targetWidth=t;var i=this.player.videoWidth,n=this.player.videoHeight,o=i/n,e=this.targetWidth/o;$(a.container).css({width:this.targetWidth,height:e});$(a.player).css({width:this.targetWidth,height:e})};this.setScale=function(t){var n=this.player.videoWidth,o=this.player.videoHeight,e=n*t,i=o*t;$(a.container).css({width:e,height:i});$(a.player).css({width:e,height:i})};this.buffering=function(){var i=a.player.currentTime,t=a.player.buffered,e=a.player.duration;a.bufferRate=t.end(0)/e*100;if(a.onProgress){a.onProgress({currentTime:i,bufferStart:t.start(0),bufferEnd:t.end(0),duration:e,bufferRate:a.bufferRate})};var n=4;if(t.end(0)-i<n){if(a.isBuffered==!1){Progress.forcedeON();a.isBuffered=!0;a.pause()}}
else{if(a.isBuffered==!0){Progress.forcedeOFF();a.isBuffered=!1;a.play()}};if(Math.floor(t.end(0))==Math.floor(e)){bm.onEnterRemove(a.buffering)}};this.setSize=function(t,e){a.player.setAttribute('width',t);a.player.setAttribute('height',e)};this.setVolume=function(t){if(isNaN(t)!=!1&&t>=0&&t<=1){this.player.volume=t}};this.setSpeed=function(t){this.player.playbackRate=t};this.preload=function(){this.player.load()};this.unload=function(){this.player.setAttribute('src','')};this.play=function(){this.setStatus('play');a.player.play()};this.pause=function(){this.setStatus('pause');a.player.pause()};this.stop=function(){this.setStatus('stop');this.pause();this.seek(0)};this.setStatus=function(t){if(t=='play'){if(this.isPlay)return;this.isPlay=!0;this.isPause=!1;this.isStop=!1;if(this.onPlay)this.onPlay();bm.onEnterRegist(this.buffering);$(this.playBtn).hide();$(this.pauseBtn).show()}
else if(t=='pause'){if(this.isPause)return;this.isPlay=!1;this.isPause=!0;this.isStop=!1;if(this.onPause)this.onPause();bm.onEnterRemove(this.buffering);$(this.playBtn).show();$(this.pauseBtn).hide()}
else if(t=='stop'){if(this.isStop)return;this.isPlay=!1;this.isPause=!1;this.isStop=!0;if(this.onStop)this.onStop();bm.onEnterRemove(this.buffering);$(this.playBtn).show();$(this.pauseBtn).hide();s()}};this.seek=function(t){this.player.currentTime=t};this.ended=function(t){console.log(t)}};bm.CreditItem=function(t,e,i,n,o,a){this.type=null;this.name=null;this.code=null;this.credit=0;this.rev=1;this.thumb=null;this.init(t,e,i,n,o,a)};bm.CreditItem.prototype={init:function(t,e,i,n,o,a){this.setType(t);this.setCode(i);this.setRev(o);this.setName(e);this.setCredit(n);this.setThumb(a)},setType:function(t){this.type=t},setCode:function(t){this.code=t},setRev:function(t){this.rev=t},setName:function(t){this.name=t},setCredit:function(t){this.credit=t},setThumb:function(t){this.thumb=t},getType:function(){return this.type},getCode:function(){return this.code},getName:function(){return this.name},getRev:function(){return this.rev},getThumb:function(){return this.thumb},getCredit:function(){return this.credit},getData:function(){return{'type':this.type,'name':this.name,'code':this.code,'credit':this.credit,'rev':this.rev,'thumb':this.thumb}}};bm.creditManager={itemList:[],showItemObj:{},totalCredit:0,getItem:function(t,e){var i=this.getKey(t,e);return this.showItemObj[i]},getItemIndex:function(t,e){var n=this.getKey(t,e),i=this.showItemObj[n];if(!i)return-1;return this.itemList.indexOf(i)},getKey:function(t,e){e=e||1;return t+'-'+e},makeCreditItem:function(t,e,i,n,o,a){var r=this.getKey(i,o);n=parseInt(n);var s=this.showItemObj[r];if(!s){s=new bm.CreditItem(t,e,i,n,o,a)};this.itemList.push(s);this.totalCredit+=n;return s},add:function(t,e,i,n,o,a,s){var l=this;n=n||0;o=o||1;var r=this.getItem(i,o);if(r)return r;if(t=='B'){this.findPurchaseProduct(t,i,o,function(d){if(d){r=l.makeCreditItem(t,e,i,n,o,a);var h=l.getKey(i,o);l.showItemObj[h]=r;if(s)s(r);return r}})}
else{r=l.makeCreditItem(t,e,i,n,o,a);var d=l.getKey(i,o);l.showItemObj[d]=r;return r}},remove:function(t,e){var o=this.getKey(t,e),i=this.showItemObj[o];if(i){this.totalCredit-=i.getCredit();var n=this.getItemIndex(t,e);if(n>-1){this.itemList.splice(n,1);delete this.showItemObj[o]};return i};return null},resetData:function(){this.itemList=[];this.showItemObj={};this.totalCredit=0},setJsonDataString:function(t){if(!t)return!1;var e=$.parseJSON(t),n=this;if(e){this.resetData();var i=e.list;i.forEach(function(t){n.add(t.type,t.name,t.code,t.credit,t.rev,t.thumb)})}},getCreditItemList:function(){return this.itemList},getDataList:function(){var t={};t.total_credit=this.getTotalCredit();t.list=[];this.itemList.forEach(function(e,i){t.list.push(e.getData())});return t},getJsonDataString:function(){if(this.itemList.length==0)return null;return JSON.stringify(this.getDataList())},getTotalCredit:function(){var t=0;this.itemList.forEach(function(e,i){t+=e.getCredit()});this.setTotalCredit(t);return t},setTotalCredit:function(t){this.totalCredit=t},getPurchaseList:function(){},findPurchaseProduct:function(t,e,i,n){var o={};o.product_type=t;o.product_code=e;o.product_rev=i?i:1;bm.httpSendJsonPost(WEB_ROOT+'credit/findPurchaseProduct',o,function(t){if(t.result){var e=t.data.result;if(n)n(e)}
else{bm.toast('조회 도중 오류가 발생하였습니다.')}})}};bm.LocalStorageSet=function(t,e,i,n,o,a,r){try{var l=new Date(),h=l.getFullYear(),c=String(l.getMonth()+1).padStart(2,'0'),f=String(l.getDate()).padStart(2,'0'),p=String(l.getHours()).padStart(2,'0'),u=String(l.getMinutes()).padStart(2,'0'),g=String(l.getSeconds()).padStart(2,'0'),d='zeditor-'+e;if(i)d+='-'+i;if(n)d+='-'+n;d+='_'+h+c+f+p+u+g;if(o===!0){bm.LocalStorageDel(i,n)};localStorage.setItem(d,t);if(r){r()};console.log(d)}catch(s){if(a===!0&&wvAdminIFrameBridge){clearInterval(wvAdminIFrameBridge.saveTmpInterval)}}};bm.LocalStorageDel=function(t,e){bm.LocalStorageSearch(t,e,function(t){localStorage.removeItem(t)})};bm.LocalStorageGet=function(t,e){let has=!1;let savedData;bm.LocalStorageSearch(t,e,function(t){has=!0;savedData=localStorage[t]});return{has:has,savedData:savedData}};bm.LocalStorageSearch=function(t,e,i){var o=Object.keys(localStorage);for(var n of o){if(e){if(n.indexOf('zeditor')>-1&&n.indexOf(e)>-1&&n.indexOf(t)>-1){i(n)}}
else{if(n.indexOf('zeditor')>-1&&n.indexOf(t)>-1){i(n)}}}};bm.saveTempEditor=function(t,e,n,o){const _this=wvAdminIFrameBridge;var a={};var r;if(!t){console.error('데이터 객체가 없습니다.');return!1};const target=t['target']?t['target']:_this._WVContentArea.$contentBody.find('[data-wv-layout-element="layout_screen"]')[0];const totalInfo=t['totalInfo'];const type=t['isTheme']===!0?'theme':'block';const id=totalInfo['info']?totalInfo['info']['id']:'';const pageId=type==='theme'?(totalInfo['page']?totalInfo['page']['id']:''):null;a['blockCss']=WVAdminResourceManager.getEmbededStyleElement('block').innerHTML;if($(_this.iframeWindow.document).find('[data-inc-css]')['length']>0){a['incCss']=$(_this.iframeWindow.document).find('[data-inc-css]')[0].innerHTML};WVAdminResourceManager.getEmbededStyleElement('block');a['blockHtml']=$(target)[0].innerHTML;var s=[];if($(target).attr('data-wv-res-id')!==undefined)s.push($(target).attr('data-wv-res-id'));$(target).find('[data-wv-res-id]').each(function(){if(!s.includes($(this).attr('data-wv-res-id')))s.push($(this).attr('data-wv-res-id'))});a['blockJs']=_this.getBlockJs(s);r=JSON.stringify(a);if(l(r)>=5242880){delete a['blockJs'];r=JSON.stringify(a)};function l(t){const str=t.toString();let byteSize=0;let char='';for(let i=0;!isNaN(str.charCodeAt(i));i++){char=str.charCodeAt(i);if(char>>11){byteSize+=3}
else if(char>>7){byteSize+=2}
else{byteSize+=1}};return byteSize};bm.LocalStorageSet(r,type,id,pageId,e,n,o)};bm.PopupItem=function(t){this.key=t;this.el=$(t)[0];this.dim;this.isDomClose=!0;this.isFullSize=!1;this.isIframe=!1;this.isLock=!0;this.isDim=!0;this.paddingTop=0;this.paddingRight=0;this.paddingBottom=0;this.paddingLeft=0;this.widthFixed=0;this.heightFixed=0;this.zIndex=9999;this.callbackFn=null};bm.PopupItem.prototype={append:function(){this.isIframe=!1;if(this.isDim){this.addDim()};this.el=$(this.el).appendTo(document.body)[0];if(this.isDim){this.setZIndex();$(this.dim).css('zIndex',this.zIndex)};$(this.el).css('zIndex',this.zIndex+1);$(this.el).show();this.resize();this.registEvent();return this.el},appendIframe:function(){this.isIframe=!0;if(this.isDim){this.addDim()};var t=this;this.el=$(this.el).appendTo(document.body)[0];if(this.isDim){this.setZIndex();$(this.dim).css('zIndex',this.zIndex)};$(this.el).css('zIndex',this.zIndex+1);if(this.widthFixed)$(this.el).css('width',this.widthFixed);if(this.heightFixed)$(this.el).css('height',this.heightFixed);$(this.el).on('load',function(){$(t.el).show();t.resize()});this.registEvent();return this.el},apply:function(t){if(this.callbackFn&&this.callbackFn(this)===!1)return!1;if($(this.el).parent().length>0){if(!isSaveEvent){$(this.el).remove()}
else{$(this.el).detach()}};this.removeEvent();if(this.isDim){this.removeDim()};$(this.el).css({'zIndex':'','top':'','left':'','background-color':'','position':''});return this.el},remove:function(t,e){if(this.callbackFn&&this.callbackFn(this,e)===!1)return!1;if(t===undefined)t=!0;if($(this.el).parent().length>0){if(!t){$(this.el).remove()}
else{$(this.el).detach()}};this.removeEvent();if(this.isDim){this.removeDim()};$(this.el).css({'zIndex':'','top':'','left':'','background-color':'','position':''});return this.el},registEvent:function(){var t=this;if(this.isDomClose){$(this.dim).on('click',function(e){e.stopPropagation();bm.popupManager.removePop(t.key,!0)})};$(this.el).find('.apply').off('click').on('click',function(e){e.stopPropagation();bm.popupManager.removePop(t.key,!0,!0)});if($(t.el).find('.apply').length>0){function e(e){if(e.keyCode===13&&$(t.el).find('.apply').length>0){$(t.el).find('.apply').trigger('click')}};$(this.el).find('input').off('keyup').on('keyup',e)}},removeEvent:function(){$(this.dim).off()},makeDim:function(t){if(t===undefined){t=bm['popupManager']['defaultDimOpacity']};if(this.zIndex==bm.popupManager.defaultZindex)this.zIndex=bm.popupManager.defaultZindex+((bm.popupManager.popList.length+1)*3);this.dim=$('<div style="width: 100%; height: 100%; position: fixed; left:0; top:0; background-color: #000; opacity: '+t+'; filter:alpha(opacity='+t*100+'); z-index: '+this.zIndex+';"></div>')},setZIndex:function(){if(this.isDim){var e=$(this.dim).css('zIndex');if(e>=this.zIndex)this.zIndex=parseInt(e)+1;if(bm.popupManager.zIndexList.length>0){var t=Math.max.apply(null,bm.popupManager.zIndexList);if(t>=this.zIndex)this.zIndex=t+1}}},addDim:function(t,e){if(!this.dim)this.makeDim(t);if(!e){e=document};$(e.body).append(this.dim)},removeDim:function(){$(this.dim).remove()},checkFullSize:function(){if($(this.el)[0].offsetWidth==$(window).width()&&$(this.el)[0].offsetHeight>=$(window).height()){return!0}
else{return!1}},addTransition:function(t,e,i,n){var o=this.el;if(o.length>0&&o.context)o=o[0];var a=parseInt($(o).css('marginTop'));a=a||0;if(!n&&n!==0)n=0.5;if(!e&&e!==null){e={opacity:0,marginTop:(a+50)+'px'}};if(!i){i={opacity:1,marginTop:a+'px','background-color':'#fff',ease:Cubic.easeInOut}};if(t){i['onComplete']=t};if(e){TweenMax.fromTo(o,n,e,i)}
else{TweenMax.to(o,n,i)}},removeTransition:function(t,e,i,n){var o=this.el;if(o.length>0&&o.context)o=this.el[0];if(!n&&n!==0)n=0.5;var a=(parseInt($(o).css('marginTop')))||0;if(!e){e={opacity:1,marginTop:a+'px'}};if(!i){i={opacity:0,marginTop:(a+50)+'px',ease:Cubic.easeInOut}};if(t){i['onComplete']=t};if(e){TweenMax.fromTo(o,n,e,i)}
else{TweenMax.to(o,n,i)}},resize:function(){this.isFullSize=this.checkFullSize();if(this.isFullSize){$(this.el).css({'position':'fixed','top':'0','left':'0'})}
else{$(this.el).css({'position':'fixed','top':'50%','left':'50%'})};if(!this.isIframe){var d=-($(this.el)[0].offsetWidth/2),h=-($(this.el)[0].offsetHeight/2),c={'margin-top':h,'margin-left':d,'background-color':'#fff'};if(this.isFullSize){$(this.el).css({'background-color':'#fff','margin-top':'','margin-left':''})}
else{$(this.el).css(c)}}
else{var i,n,t=0,e=0,a='',o=this.el.contentWindow.document.body,r=$(document.body).height();if($(o).find('.wrap').length>0){o=$(o).find('.wrap > div')[0]};if(this.widthFixed.toString().indexOf('calc')>-1){i=this.widthFixed;t=i}
else{i=parseInt(this.widthFixed);t=i>0?i:725+25*2;a='px'};if(this.heightFixed.toString().indexOf('calc')>-1){n=this.heightFixed;e=n}
else{n=parseInt(this.heightFixed);e=n>0?n:o.scrollHeight;a='px'};if(bm.isMobile){t=$(window).width();e=$(window).height()};if(e>r){t=t+20;e=r;var s={'overflow-y':'auto','height':r};$(o).css(s)};var s={'width':t+a,'height':e+a,'left':'50%','top':'50%'};$(this.el).css(s);var l={'marginLeft':-($(this.el).width()/2)+'px','marginTop':-($(this.el).height()/2)+'px'};$(this.el).css(l)}}};bm.popupManager={popList:[],showPopObj:{},isResizeRegistered:!1,defaultZindex:9999,defaultDimOpacity:0.7,isLock:!1,zIndexList:[],getPopupItem:function(t){return this.showPopObj[t]},getPopupIndex:function(t){var e=this.showPopObj[t];if(!e)return-1;return this.popList.indexOf(e)},makePopupItem:function(t,e,i,n,o){if(!e)e=[0,0,0,0];i=i===undefined?!0:i;n=n===undefined?!0:n;o=o===undefined?!0:o;var a=this.showPopObj[t];if(!a){a=new bm.PopupItem(t);if(a['el']===undefined){const instruction=' 팝업노드를 찾을 수 없습니다.\ndocument내부에 해당 노드가 있는지 확인하세요.';if(typeof(t)==='string'){if(t.includes('#')===!0){console.log(t.replace('#','')+'아이디를 가진'+instruction)}
else if(t.includes('.')===!0){console.log(t.replace('.','')+'클래스를 가진'+instruction)}
else{console.log(t+'에 해당하는'+instruction)}}
else{console.log(t+'은 문자열이어야 합니다.')};return!1};a.paddingTop=e[0];a.paddingRight=e[1];a.paddingBottom=e[2];a.paddingLeft=e[3];a.isLock=i;a.isDim=n;a.isDomClose=o};this.popList.push(a);return a},add:function(t,e,i,n,o,a,s,r){var l=this.makePopupItem(t,n,o,a,s);if(l===!1){return!1};l.callbackFn=i;this.showPopObj[t]=l;l.zIndex=r?r:this.defaultZindex;var d=l.append();this.zIndexList.push(l.zIndex);var h=this.getPopupIndex(t);this.popList[h].el=d;this.showPopObj[t].el=d;this.checkLockScroll();this.checkEvent();return d},addToIframe:function(t,e,i,n,o,a,s,r,l,h){var c='<iframe src="'+t+'" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="display:none;">';if(e)c=e;var d=this.makePopupItem(c,a,s,r,l);d.widthFixed=i?i:'';d.heightFixed=n?n:'';d.callbackFn=o;d.zIndex=h?h:this.defaultZindex;this.showPopObj[d.key]=d;var f=d.appendIframe();this.zIndexList.push(d.zIndex);this.checkLockScroll();this.checkEvent();return f},removePop:function(t,e,i){var a=this.showPopObj[t],n=a.remove(e,i);if(n===!1)return;var o=this.getPopupIndex(t);this.popList.splice(o,1);this.checkLockScroll();this.checkEvent();return n},checkLockScroll:function(){if(this.popList.length===0){if(this.isLock)this.unlockScroll();return};var t=this.popList[this.popList.length-1];if(t.isLock){this.lockScroll()}
else{this.unlockScroll()}},removePopLatest:function(t){if(this.popList.length>0){return this.removePop(this.popList[this.popList.length-1].key,t)};return null},getPopLatest:function(){if(this.popList.length>0)return this.popList[this.popList.length-1];else return null},registEvent:function(){if(this.isResizeRegistered==!0)return;$(window).on('resize',this.onWindowResizeForPopup)},onWindowResizeForPopup:function(t){var i=bm.popupManager,o=i.popList.length,n;for(var e=0;e<o;e++){n=i.popList[e];n.resize()}},removeEvent:function(){if(this.isResizeRegistered==!1)return;$(window).off('resize',this.onWindowResizeForPopup)},checkEvent:function(){if(this.popList.length==0){this.removeEvent()}
else{this.registEvent()}},lockScroll:function(){if(this.isLock)return;var i=$('html'),t=$('body'),a=t.outerWidth(),s=t.outerHeight(),e=[self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop];i.data('scroll-position',e);i.data('previous-overflow',i.css('overflow'));i.css('overflow','hidden');window.scrollTo(e[0],e[1]);var n=t.outerWidth()-a,o=t.outerHeight()-s;t.css({'margin-right':n,'margin-bottom':o});window.scrollTo(e[0],e[1]);this.isLock=!0},unlockScroll:function(){if(!this.isLock)return;var t=$('html'),i=$('body');t.css('overflow',t.data('previous-overflow'));var e=t.data('scroll-position');window.scrollTo(e[0],e[1]);i.css({'margin-right':0,'margin-bottom':0});this.isLock=!1},repositioning:function(t){var e=this.showPopObj[t];if(e){e.resize()}},repositioningLatestPop:function(t){var e=this.popList[this.popList.length-1];if(e&&e.key){var i=e.key;this.repositioning(i,t)}},addTransition:function(t,e,i,n,o){var a=this.showPopObj[t];if(a){a.addTransition(e,i,n,o)}},removeTransition:function(t,e,i,n,o){var a=this.showPopObj[t];if(a){a.removeTransition(e,i,n,o)}}};bm.selectionManager={selection:null,range:null,isActive:!1,customWindow:null,selectionTargetContainer:null,currentSelectedNodes:null,currentSelectedAllNodes:null,currentSelectedTextNodes:null,currentSelectedBlockNodes:null,currentSelectedElementNodes:null,isMouseDownHandlerActive:!1,isCtrl:!1,isShift:!1,active:function(t,e){this.customWindow=t;this.selectionTargetContainer=e;if(this.isActive==!0)return;this.isActive=!0;if(this.isMouseDownHandlerActive==!1){this.customWindow.document.addEventListener('mousedown',this.onMouseDownHandler,!0);this.isMouseDownHandlerActive=!0};$(this.customWindow.document).on('keyup',this.onKeyUpHandler);$(this.customWindow.document).on('keydown',this.onKeyDownHandler)},onKeyUpHandler:function(t){var e=bm.selectionManager,i=[37,38,39,40];e.isCtrl=t.ctrlKey;e.isShift=t.shiftKey;if(e.isCtrl==!0&&t.keyCode==65){e.checkInit()};if(e.isShift==!0){if(i.indexOf(t.keyCode)>-1){e.checkInit()}}},onKeyDownHandler:function(t){var e=bm.selectionManager;e.isCtrl=t.ctrlKey;e.isShift=t.shiftKey},onMouseDownHandler:function(t){$(bm.selectionManager.customWindow.document).one('mouseup',function(t){if($(t.target).parents('[data-wv-toolset]').length==0){bm.selectionManager.checkInit()}})},deactive:function(){if(this.isActive==!1)return;this.isActive=!1;data={};$(this.customWindow.document).off('mousedown',this.onMouseDownHandler);$(this.customWindow.document).off('keyup',this.onKeyUpHandler);$(this.customWindow.document).off('keydown',this.onKeyDownHandler);if(this.isMouseDownHandlerActive==!0){this.customWindow.document.removeEventListener('mousedown',this.onMouseDownHandler,!0);this.isMouseDownHandlerActive=!1}},checkInit:function(){var t=this.getSelection(),e=this.getRange();if(this.selection==t&&this.range==e){return!1}
else{this.selection=t;this.range=e;this.resetSavedNodeValue();return!0}},resetSavedNodeValue:function(){this.currentSelectedNodes=null;this.currentSelectedAllNodes=null;this.currentSelectedTextNodes=null;this.currentSelectedBlockNodes=null;this.currentSelectedElementNodes=null},savedRange:[],saveRange:function(){if(!this.selection||!this.range||(this.getRange()!=this.range))this.checkInit();this.savedRange.push(this.range)},flushSavedRange:function(){this.savedRange.length=0},setTempRange:function(t,e,i,n){if(!this.selection||!this.range||(this.getRange()!=this.range))this.checkInit();this.savedRange.push(this.range);return this.setRange(t,e,i,n)},setRange:function(t,e,i,n){var o=document.createRange?document.createRange():this.selection.createRange();o.setStart(t,e);o.setEnd(i,n);this.selection=this.getSelection();this.selection.removeAllRanges();this.selection.addRange(o);this.range=o;this.resetSavedNodeValue();return o},applyRange:function(t){this.selection.removeAllRanges();this.selection.addRange(t);this.range=t;this.resetSavedNodeValue()},restoreRange:function(t){if(this.savedRange.length==0)return;var e;if(t){e=this.savedRange[this.savedRange.length-1]}
else{e=this.savedRange.pop()};if(!e)return;this.setRange(e.startContainer,e.startOffset,e.endContainer,e.endOffset);this.resetSavedNodeValue()},checkRange:function(){var t=!1,e=this.getRange();if(!this.selection||!this.range){t=this.checkInit()}
else if(e!=this.range){if(bm.bmEditorManager.registedBoardEditor==!0){if($(e.startContainer).parents('#'+bm.bmEditorManager.activeBoardEditor.editorEl.getAttribute('id')).length>0){t=this.checkInit()}}
else{t=this.checkInit()}};return t},getSelection:function(){var t=this.customWindow?this.customWindow:window,e=t.getSelection?t.getSelection():t.document.selection;return e},getRange:function(){var t=this.getSelection(),e=null,i=this.customWindow?this.customWindow:window;if(i.getSelection){if(t.rangeCount){e=t.getRangeAt(0)}}
else if(i.document.selection){e=t.createRange()};return e},getSelectionContainer:function(){this.checkRange();var t=this.customWindow?this.customWindow:window;if(t.document.selection){return this.range.parentElement()};if(this.selection.rangeCount>0){return this.range.startContainer.parentNode}},isCollapsed:function(){this.checkRange();var t;if(this.selection.rangeCount>0){t=this.selection.getRangeAt(0)};if(!t||this.range.item){return!1};if(t.compareEndPoints){return t.compareEndPoints('StartToEnd',t)===0};if(this.selection){var e=this.selection.getRangeAt(0);if(e!=t){}};return!this.selection||t.collapsed},getNextNode:function(t){var e=t.firstChild;if(e){return e}
while(t){if((e=t.nextSibling)){return e};t=t.parentNode}},getStartNode:function(){var e=this.checkRange();if(!this.range)return;var t;if(this.range.startContainer.nodeValue){if(this.range.startContainer.nodeValue.length<this.range.startOffset){t=this.range.startContainer.parentElement.nextElementSibling;this.range.setStart(t,0)}
else{t=this.range.startContainer}}
else{t=this.range.startContainer};return t},getEndNode:function(){var i=this.checkRange();if(!this.range)return;var e=this.range.endOffset,t;if(this.range.endContainer.childNodes[this.range.endOffset]){e=Math.max(0,e-1);t=this.range.endContainer.childNodes[e]}
else if(this.range.endContainer.childNodes.length==1){t=this.range.endContainer.childNodes[0]}
else{t=this.range.endContainer};return t},getAllNode:function(t){var s=this.checkRange();if(s==!1&&this.currentSelectedAllNodes){return this.currentSelectedAllNodes};var n=this.getStartNode(),a=this.getEndNode();if(!n||!a){this.currentSelectedAllNodes=null;return null};var o=this.range.commonAncestorContainer,i=[],e;if(n==o){if(n.nodeType==3&&n.parentNode){e=n.parentNode;if(t){if(e.nodeType==1&&t.indexOf(e.tagName.toLowerCase())>-1)i.push(e)}
else{i.push(e)}};e=n;if(t){if(e.nodeType==1&&t.indexOf(e.tagName.toLowerCase())>-1)i.push(e)}
else{i.push(e)};this.currentSelectedAllNodes=i;return i};for(e=n.parentNode;e;e=e.parentNode){if(t){if(e.nodeType==1&&t.indexOf(e.tagName.toLowerCase())>-1)i.push(e)}
else{i.push(e)};if(e==o){break}};i.reverse();for(e=n;e;e=this.getNextNode(e)){if(!$(e.parentNode).closest(o)[0])break;if(t){if(e.nodeType==1&&t.indexOf(e.tagName.toLowerCase())>-1)i.push(e)}
else{i.push(e)};if(e==a){break}};this.currentSelectedAllNodes=i;return i},getAllTextNode:function(){var o=this.checkRange();if(o==!1&&this.currentSelectedTextNodes){return this.currentSelectedTextNodes};var n=this.getAllNode();if(!n){this.currentSelectedTextNodes=null;return null};var t,e=[];for(var i=0;i<n.length;i++){t=n[i];if(((t.nodeType==1&&(t.tagName.toLowerCase()=='img'||t.tagName.toLowerCase()=='br'))||t.nodeType==3)&&bm.dom.isEmptyNode(t)==!1){e.push(t)}};if(e.length==0){this.currentSelectedTextNodes=null;return null};this.currentSelectedTextNodes=e;return e},getAllBlockNode:function(){var s=this.checkRange();if(s==!1&&this.currentSelectedBlockNodes){return this.currentSelectedBlockNodes};var a=this.getAllNode();if(!a){this.currentSelectedBlockNodes=null;return null};var t,e=[],n;if($(this.range.startContainer).hasClass('wveditor_text')){n=this.range.startContainer}
else{n=$(this.range.startContainer).parents('.wveditor_text')[0]};var i;for(var o=0;o<a.length;o++){t=a[o];if(t!=n&&bm.dom.isBlock(t)){if(e.indexOf(t)==-1)e.push(t)}
else{i=bm.dom.findParentUntilBlock(t);if(i&&e.indexOf(i)==-1)e.push(i);if(t==n)break}};if(e.length==0){this.currentSelectedBlockNodes=null;return null};this.currentSelectedBlockNodes=e;return e},getAllElementNode:function(){var a=this.checkRange();if(a==!1&&this.currentSelectedElementNodes){return this.currentSelectedElementNodes};var o=this.getAllNode();if(!o){this.currentSelectedElementNodes=null;return null};var t,e=[],n;if($(this.range.startContainer).hasClass('wveditor_text')){n=this.range.startContainer}
else{n=$(this.range.startContainer).parents('.wveditor_text')[0]};for(var i=0;i<o.length;i++){t=o[i];if(t!=n&&t.nodeType==1){if(e.indexOf(t)==-1)e.push(t)}};if(e.length==0){this.currentSelectedElementNodes=null;return null};this.currentSelectedElementNodes=e;return e},getNode:function(){var r=this.checkRange();if(r===!1&&this.currentSelectedNodes){return this.currentSelectedNodes};if(!this.range){this.currentSelectedNodes=null;return null};var t,e=this.range.startContainer,i=this.range.endContainer,n=this.range.startOffset,o=this.range.endOffset,s=this;function a(t,e){var i=t;while(t&&t.nodeType===3&&t.length===0){t=e?t.nextSibling:t.previousSibling};t=t||i;s.currentSelectedNodes=t;return t};if(this.range.setStart){t=this.range.commonAncestorContainer;if(!this.range.collapsed){if(e==i){if(o-n<2){if(e.hasChildNodes()){t=e.childNodes[n]}}};if(e.nodeType===3&&i.nodeType===3){if(e.length===n){e=a(e.nextSibling,!0)}
else{e=e.parentNode};if(o===0){i=a(i.previousSibling,!1)}
else{i=i.parentNode};if(e&&e===i){t=e;this.currentSelectedNodes=t;return t}}};if(t&&t.nodeType==3){t=t.parentNode;this.currentSelectedNodes=t;return t};this.currentSelectedNodes=t;return t};t=this.range.item?this.range.item(0):this.range.parentElement();this.currentSelectedNodes=t;return t},getText:function(t){var i=this.checkRange(),e=this.isCollapsed()?'':(this.range.text||(this.selection.toString?this.selection.toString():''));if(e===''&&t)e=t.nodeValue.slice(this.range.startOffset,this.range.endOffset);return e},insertContent:function(t){var e=this.checkRange();this.range.insertNode(t)},replaceContent:function(t){var e=this.checkRange();this.range.deleteContents();this.range.insertNode(t)},getCloneContents:function(){var l=this.checkRange(),t=document.createElement('body'),n,o,a,i;n=o='';if(this.range.cloneContents){a=this.range.cloneContents();if(a){t.appendChild(a)}}
else if(this.range.item!==undefined||this.range.htmlText!==undefined){t.innerHTML='<br>'+(this.range.item?this.range.item(0).outerHTML:this.range.htmlText);t.removeChild(t.firstChild)}
else{t.innerHTML=this.range.toString()};if(/^\s/.test(t.innerHTML)){n=' '};if(/\s+$/.test(t.innerHTML)){o=' '};i=$.parseHTML(n+t.innerHTML+o);var r=i.length,s=[];for(var e=0;e<r;e++){if(bm.dom.isEmptyNode(i[e])){s.push(i[e])}};return s},getFirstElement:function(){var a=this.checkRange(),e,t,o,n,i;if(this.range.duplicate||this.range.item){if(this.range.item){e=this.range.item(0);return e};n=this.range.duplicate();n.collapse(1);t=n.parentElement();o=i=this.range.parentElement();while((i=i.parentNode)){if(i==t){t=o;break}};e=t;return e};t=this.range.startContainer;if(t.nodeType==1&&t.hasChildNodes()){if(!this.range.collapsed){t=t.childNodes[Math.min(t.childNodes.length-1,this.range.startOffset)]}};if(t&&t.nodeType==3){e=t.parentNode;return e};e=t;return e},getLastElement:function(){var n=this.checkRange(),e,t,i;if(this.range.duplicate||this.range.item){if(this.range.item){e=this.range.item(0);return e};this.range=this.range.duplicate();this.range.collapse(0);t=this.range.parentElement();if(t&&t.nodeName=='BODY'){e=t.lastChild||t;return e};e=t;return e};t=this.range.endContainer;i=this.range.endOffset;if(t.nodeType==1&&t.hasChildNodes()){if(!this.range.collapsed){t=t.childNodes[i>0?i-1:i]}};if(t&&t.nodeType==3){e=t.parentNode;return e};e=t;return e},getSelectionLine:function(t){var i=[],r=this.getSelection(),l=r.toString();if(l.length>0){var c=r.getRangeAt(0),n=c.commonAncestorContainer,e=n.parentNode,a=/\r\n|\r|\n/,s=l.split(a);if(s.length>1){s.forEach(function(e){var o=n.childNodes[0];if(!o)return;while(o.textContent.indexOf(e)===-1){o=o.nextSibling};if(t&&o.nodeType===3){var a=bm.dom.wrapOuter(o,'<div></div>');i.push(a)}
else{i.push(o)}})}
else{if(e.children.length>0){var h=Array.from(e.children),o=!1;h.forEach(function(t){if($(t).hasClass('clearBoth')){o=!0}});if(n.tagName==='DIV'&&!a.test(n.textContent)&&!o){i.push(n)}
else if(e.tagName==='DIV'&&!a.test(e.textContent)&&!o){i.push(e)}
else{var d=bm.dom.wrapOuter(n,'<div></div>');i.push(d)}}
else{i.push(e)}};if(t){$(e).find('.clearBoth').remove()};return i}},removeRange:function(){if(this.selection)this.selection.removeAllRanges()}};bm.tableSelectionManager={targetTable:null,activeClassName:'active',selection:null,isDown:!1,isEditing:!1,startCell:null,endCell:null,beforeStartCell:null,beforeEndCell:null,prevSelectedCell:null,currentSelectedCell:null,selectedCellList:[],startRect:null,endRect:null,handler:[],addChangeHandler:function(t){var i=this.handler.length;for(var e=0;e<i;e++){if(this.handler[e]===t)return};this.handler.push(t)},removeChangeHandler:function(t){var e=this.handler.indexOf(t);if(e>-1){this.handler.splice(e,1)}},callChangeHandler:function(){var e=this.handler.length;for(var t=0;t<e;t++){this.handler[t](this.selectedCellList)}},scanning:function(t){if(!t)return;var t=t;if(t.tagName!='TABLE'){if($(t).find('table').length==1){t=$(t).find('table')[0]}};var r=t.rows,c=r.length,e=[],a,n,l,d,g;function f(t,i){var o=e[t],a=0,n=0;if(e[t]){o=e[t].concat();while(1){if(o[n]===undefined){if(n>o.length)break;else{n++;continue}};if(o[n].cell.offsetLeft>=i.offsetLeft)break;a+=o[n].cell.colSpan;n=n+o[n].cell.colSpan-1;n++}};return a};var s;for(var i=0;i<c;i++){a=r[i];for(var o=0;o<a.cells.length;o++){n=a.cells[o];l=n.rowSpan;d=n.colSpan;s=f(i,n);p(n,l,d,i,s)}};function p(t,e,i,n,o){for(var s=0;s<e;s++){for(var a=0;a<i;a++){if(e==1&&i==1){h(n+s,o+a,{status:'origin',mergeX:a,mergeY:s,cell:t})}
else{h(n+s,o+a,{status:'merged',mergeX:a,mergeY:s,cell:t})}}}};function u(t){if(!e[t]){e[t]=[]};return e[t]};function m(t,e){var n=t.length;for(var i=e;i<n;i++){if(t[i])continue;else return i};return i};function h(t,e,i){var n=u(t);if(n[e]){bm.array.insertAt(n,e,i)}
else{n[e]=i}};return e},getIndex:function(t,e){if(!e){e=this.scanning(this.targetTable)};var a=e.length;for(var i=0;i<a;i++){var o=e[i].length;for(var n=0;n<o;n++){if(t===e[i][n].cell){return{rowIndex:i,cellIndex:n,scanningAry:e}}}}},setTarget:function(t,e,i){if(!t)return;if(this.targetTable){if(this.targetTable===t)return;this.removeListener()};this.targetTable=t;if(i)this.activeClassName=i;if(e)$(e).closest('th, td').addClass(this.activeClassName);this.calSelectedCellList();this.registListener()},calSelectedCellList:function(){var e=this.activeClassName;this.selectedCellList=[];var t=this;$(this.targetTable).find('th,td').each(function(){if($(this).hasClass(e)){t.selectedCellList.push(this)}})},setSelection:function(){var t=this.activeClassName;$(this.targetTable).find('th,td').removeClass(t);bm.each(this.selectedCellList,function(e,i){$(i).addClass(t)})},removeSelection:function(){$(this.targetTable).find('th,td').removeClass(this.activeClassName)},getCurrentCell:function(t){var e;if(bm.selectionManager.getRange()){e=$(bm.selectionManager.getRange().startContainer)[0]};if(e&&(!e['tagName']||e.tagName.toLowerCase()!='td')){e=$(e).parents('td')[0]};if(!t&&(!e||!e['tagName']||e.tagName.toLowerCase()!='td')){bm.selectionManager.restoreRange(!0);e=this.getCurrentCell(!0)};return e},registListener:function(){var t=this;t.currentSelectedCell=bm.tableSelectionManager.getCurrentCell();t.prevSelectedCell=t.currentSelectedCell;$(this.targetTable).find('th, td').on('mousedown',function(i){$(this).attr('contenteditable','true');t.isEditing=!0;t.isDown=!0;t.startCell=this;t.endCell=this;t.calRange();t.callChangeHandler();if(i.button==2)return;$(t.targetTable).find('th, td').on('mousemove',function(e){t.endCell=this;if(t.startCell!=t.endCell){if(t.isDown){e.preventDefault();t.isEditing=!1;$(this).attr('contenteditable','false');e.preventDefault();t.endCell=this;t.calRange();t.callChangeHandler()}
else{$(t.targetTable).find('th, td').off('mousemove')}};bm.selectionManager.flushSavedRange();bm.selectionManager.saveRange()});var n=bm.toolManager.iframeWindow?bm.toolManager.iframeWindow:window;$(n).on('mouseup',e)});function e(i){$(t.targetTable).find('th, td').off('mousemove');var n=bm.toolManager.iframeWindow?bm.toolManager.iframeWindow:window;$(n).off('mouseup',e);t.isDown=!1;if(i.target.tagName.toLowerCase()=='td'||$(i.target).closest('td').length>0){bm.selectionManager.flushSavedRange();bm.selectionManager.saveRange()}}},removeListener:function(){$(this.targetTable).find('th, td').attr('contenteditable','false');$(this.targetTable).closest('.wveditor_table').off('keydown');$(this.targetTable).closest('.wveditor_table').off('keyup');$(this.targetTable).find('th, td').off('mousedown')},refreshListener:function(){this.removeListener();this.registListener()},calRange:function(){if(!this.startCell||!this.endCell)return;var o=this,a=this.activeClassName;$(this.targetTable).find('th,td').removeClass(a);var e={x:this.startCell.getBoundingClientRect().left,y:this.startCell.getBoundingClientRect().top,width:this.startCell.getBoundingClientRect().width,height:this.startCell.getBoundingClientRect().height};var t={x:this.endCell.getBoundingClientRect().left,y:this.endCell.getBoundingClientRect().top,width:this.endCell.getBoundingClientRect().width,height:this.endCell.getBoundingClientRect().height};if(t.x<e.x){var i={x:t.x,width:t.width};t.x=e.x;t.width=e.width;e.x=i.x;e.width=i.width};if(t.y<e.y){var i={y:t.y,height:t.height};t.y=e.y;t.height=e.height;e.y=i.y;e.height=i.height};this.startRect=e;this.endRect=t;this.selectedCellList=[];var n=parseInt(bm.getStyle(this.endCell,'border-width'));if(isNaN(n))n=0;$(this.targetTable).find('th,td').each(function(){if((Math.round(this.getBoundingClientRect().left+this.getBoundingClientRect().width)>Math.round(e.x)&&Math.round(this.getBoundingClientRect().left)<Math.round(t.x+t.width))&&(Math.round(this.getBoundingClientRect().top)>=Math.round(e.y)&&Math.round(this.getBoundingClientRect().top)<Math.round(t.y+t.height))){o.selectedCellList.push(this)}});this.setRange()},getRange:function(t){if(this.selectedCellList.length==0){var i=bm.selectionManager.getAllElementNode();if(i==null)return[];if(i[0].tagName=='TH'||i[0].tagName=='TD')return i;else return[]};if(!t||t===''){return this.selectedCellList}
else{var l,d,h,c,o,a,s,r,f=this.selectedCellList.length,e;for(var n=0;n<f;n++){e=this.selectedCellList[n];if(o===undefined||e.offsetLeft<o){o=e.offsetLeft;l=e};if(a===undefined||e.offsetLeft>a){a=e.offsetLeft;d=e};if(s===undefined||e.offsetTop<s){s=e.offsetTop;h=e};if(r===undefined||e.offsetTop>r){r=e.offsetTop;c=e}};if(t=='left'){return l}
else if(t=='right'){return d}
else if(t=='top'){return h}
else if(t=='bottom'){return c}}},getSumWidthSelectedCell:function(){var o=bm.tableSelectionManager.getRange(),a=o.length,t,e,i;t=o[0];e=t.offsetLeft;i=t.offsetLeft+t.offsetWidth;for(var n=1;n<a;n++){t=o[n];if(e>t.offsetLeft)e=t.offsetLeft;if(i<t.offsetLeft+t.offsetWidth)i=t.offsetLeft+t.offsetWidth};return i-e},getColList:function(t){var e,i=$(t).find('colgroup');if(i.length>0){e=i.find('col')};return e},getColRange:function(t,e){var a=this.scanning(t),o=[],l,s=a.length;for(var i=0;i<s;i++){var h=a[i].length;for(var n=0;n<h;n++){l=a[i][n];if(e.indexOf(l.cell)>-1&&o.indexOf(n)==-1){o.push(n)}}};var d=this.getColList(t),r=[];s=o.length;for(i=0;i<s;i++){r.push(d[o[i]])};return r},setRange:function(t){if(t&&Object.prototype.toString.call(t)==='[object Array]'){this.selectedCellList=t};this.setSelection()},restoreRange:function(){if(this.targetTable){this.removeSelection();this.selectedCellList=[]}},removeRange:function(){if(this.targetTable){this.removeSelection();this.selectedCellList=[]}}};var ToolButtonEvent={CLICK:'ToolBtnClick',KEY_UP:'ToolBtnKeyUp',OP_CLICK:'ToolBtnOpClick',OP_KEYUP:'ToolBtnOpKeyUp',OP_MOUSEUP:'ToolBtnOpMouseup',OP_MOUSEDOWN:'ToolBtnOpMousedown',OP_MOUSEMOVE:'ToolBtnOpMousemove'};bm.toolManager={toolList:[],showToolList:[],extraToolList:[],targetElement:null,targetElementList:[],focusToolBtnType:'',isEventRegistered:!1,isMultiSelectMode:!1,isTabActiveStyle:!1,isMenuTarget:!1,isShopListTarget:!1,menuEditableToolList:['ToolBtnTextFont','ToolBtnTextSize','ToolBtnTextBold','ToolBtnTextColor','ToolBtnTextDecoration','ToolBtnTextLetterSpacing','ToolBtnTextLineHeight','ToolBtnDomSpace','ToolBtnDomAlignHorizontalDefault','ToolBtnDomBackgroundColor','ToolBtnHeaderFooterSetting'],shopListEditableToolList:['ToolBtnTextHistory','ToolBtnDomSpace','autoWidth','fullWidth','ToolBtnDomWidth','ToolBtnDomHeight','ToolBtnDomAlignHorizontalDefault','left','none','right','ToolBtnDomBackgroundBorder','ToolBtnDomBackgroundColor','ToolBtnDomBoxShadow','ToolBtnSwiperAuto','ToolBtnSwiperPagination','ToolBtnSwiperNavigation'],spaceBlockEditableToolList:['ToolBtnHistory','ToolBtnTextHistory','ToolBtnGridMaxWidth','ToolBtnHeaderFooterSetting'],toolMode:null,selectedClass:'edit_target_block',selectedAreaClass:'edit_target_block_area',activeStatus:0,onToolEditBefore:null,onToolEditAfter:null,iframeWindow:null,frameOutToolList:{normal:['ToolInsta','ToolGrid'],expert:['ToolInsta','ToolGrid','ToolThumb','ToolSwiper','ToolSwiper_ex','ToolSvg','ToolTable','ToolLine','ToolVideo','ToolMap','ToolImage']},noPrependToolList:{normal:[],expert:['ToolThumb','ToolSwiper']},getIframeWindow:function(){if(this.iframeWindow)return this.iframeWindow;else{if($('#WEVEN_IFRAME').length>0){this.iframeWindow=$('#WEVEN_IFRAME')[0].contentWindow};return this.iframeWindow}},init:function(){var t=this,e,i;let registTool=(toolset)=>{$(toolset).each(function(){e=$(this).attr('data-wv-toolset');i=$(this).attr('data-wv-reset-msg');if(window[e]){toolset=new window[e]();if(!toolset){};toolset.init(e,this,null,null,i);t.addToolSet(e,toolset)}})};if(t.toolMode==='side'){registTool('#contentTool [data-wv-toolset]')}
else{registTool('#defaultToolSetCon [data-wv-toolset]');registTool('#effectToolSetCon [data-wv-toolset]');registTool('#contentTool [data-wv-toolset]')};registTool('#admin_top_toolbar.board [data-wv-toolset]');if(t.toolMode==='side'){this.toolSide=$('#contentTool');this.targetToolProp=this.toolSide.find('#targetToolProp');this.targetElementType={text:'텍스트',image:'이미지',line:'선'};this.makeToolSet('ToolSvg');this.makeToolSet('ToolVideo')}
else{this.makeToolSet('ToolImage');this.makeToolSet('ToolThumb');this.makeToolSet('ToolSwiper');this.makeToolSet('ToolRecentBoard');this.makeToolSet('ToolTab');this.makeToolSet('ToolGrid');this.makeToolSet('ToolInsta');this.makeToolSet('ToolSvg');this.makeToolSet('ToolTable');this.makeToolSet('ToolLine');this.makeToolSet('ToolVideo');this.makeToolSet('ToolMap');if(t.toolMode==='design'){this.makeToolSet('ToolText')};if(t['toolMode']==='expert'){this.makeToolSet('ToolSwiper_ex')};if(isStudio){this.makeToolSet('ToolLabel')}}},addToolSet:function(t,e){this.toolList[t]=e;this.toolList.push(e)},makeToolSet:function(t){var i=this.getTool(t);if(!i){if(!window[t]){console.warn('등록된 Tool Type 객체가 없습니다 : '+t);return};i=new window[t]();var o=$('[data-wv-toolset='+t+']')[0];i.init(t,o);this.addToolSet(t,i);var n;const frameOutToolListSet=(t)=>{let key;try{isExpertMode===!0?key='expert':key='normal'}catch(e){key='expert';console.warn(e)};if(this['frameOutToolList'][key].indexOf(t)>-1){return!1}
else{return!0}};if(this.toolMode==='side'){if(frameOutToolListSet(t)){n=$('#WEVEN_IFRAME').contents()}
else{n=$(document)}}
else{if(this.getIframeWindow()&&frameOutToolListSet(t)){n=$('#WEVEN_IFRAME').contents()}
else{n=$(document)}};const noPrependToolListSet=(t)=>{let key;try{isExpertMode===!0?key='expert':key='normal'}catch(e){key='expert'};if(this['noPrependToolList'][key].indexOf(t)>-1){return!1}
else{return!0}};if(noPrependToolListSet(t)){n.find('body').prepend(o)}
else{};this.extraToolList.push(i)};return i},getTool:function(t){return this.toolList[t]},reset:function(){this.deactive();this.active()},active:function(){if(this.activeStatus==1)return;this.activeStatus=1;var a=this.toolList.length;for(var i=0;i<a;i++){var o=this.toolList[i];if(o.status==0){o.active(null,null,this.toolMode)}
else{console.warn('이미 액티브 되어있음')}};if(this.toolMode!=='side'&&this.toolMode!=='design'){}
else{if(this.toolMode==='design')this.toolList['ToolHeaderFooterSetting'].toolBtnList['ToolBtnHeaderFooterSetting'].active()};var t,e;if(this.getIframeWindow()){t=$('#WEVEN_IFRAME').contents();e=this.getIframeWindow()}
else{t=$(document);e=window};var n=t.find('.wveditor_text');n=n.filter(function(t,e){return $(e).parent('[data-wv-menu-depth]').length===0});bm.selectionManager.active(e);this.registEvent()},deactive:function(t){if(this.activeStatus==0)return;this.activeStatus=0;var n;if($('#WEVEN_IFRAME').length>0){n=$('#WEVEN_IFRAME').contents()}
else{n=$(document)};var i=n.find('.wveditor_text');if(i.length>0){i.attr('contentEditable','false').attr('spellcheck','false');i.find('[contentEditable]').attr('contentEditable','false').attr('spellcheck','false')};this.hideExtraTool();bm.selectionManager.deactive();var a=this.toolList.length,o;for(var e=0;e<a;e++){o=this.toolList[e];o.deactive(t)};this.showToolList.length=0;this.removeImageChangeHandler(this.targetElement);if(this.isMultiSelectMode){this.removeTargetElementMulti()}
else{this.removeTargetElementSingle(this.targetElement)};this.removeEvent()},extraToolHide:function(){this.hideExtraTool()},onBodyClick:function(t){bm.toolManager.setFocusToolBtn('');let target=$(t.target);if(bm.toolManager.toolMode==='side'){if(target.closest('[data-wv-design-area]').length===0&&target.closest('#contentTool').length===0&&target.closest('#wvSizeControlCon').length===0&&target.closest('.layoutControlBtn ').length===0){bm.toolManager.toolSide.hide()}
else{bm.toolManager.toolSide.show()}}
else if(isExpertMode){if(target.attr('type')==='color'){if(!wvAdminIFrameBridge.iframeWindow['dim']){wvAdminIFrameBridge.iframeWindow['dim']=new bm.PopupItem()};if(wvAdminIFrameBridge.iframeWindow['dim']['dim']&&wvAdminIFrameBridge.iframeWindow['dim']['dim'][0]['isConnected']){wvAdminIFrameBridge.iframeWindow['dim'].removeDim()};wvAdminIFrameBridge.iframeWindow['dim'].addDim(0,wvAdminIFrameBridge.iframeWindow.document)}
else{if(wvAdminIFrameBridge.iframeWindow['dim']&&wvAdminIFrameBridge.iframeWindow['dim']['dim']&&wvAdminIFrameBridge.iframeWindow['dim']['dim'][0]['isConnected']){wvAdminIFrameBridge.iframeWindow['dim'].removeDim()}}}},onKeyDown:function(t){if(t.keyCode==27){bm.toolManager.hideAllToolBtnOption()}},registEvent:function(){if(this.isEventRegistered)return;this.isEventRegistered=!0;$(window).on('click',this.onBodyClick);$(window).on('keydown',this.onKeyDown);var t=this.getIframeWindow();$(t).on('click',this.onBodyClick);$(t).on('keydown',this.onKeyDown)},removeEvent:function(t){if(this.isEventRegistered==!1)return;this.isEventRegistered=!1;$(window).off('click',this.onBodyClick);$(window).off('keydown',this.onKeyDown);var e=this.getIframeWindow();$(e).off('click',this.onBodyClick);$(e).off('keydown',this.onKeyDown)},quickEdit:function(t){var e=t.type,i=t.value,n=this.getTool(e);n.quickEdit(i)},toolBtnEditBefore:function(t,e,i,n){if(this.onToolEditBefore)this.onToolEditBefore(t,e,i,n)},toolBtnEditAfter:function(t,e,i,n){if(this.onToolEditAfter)this.onToolEditAfter(t,e,i,n)},onToolPrevHistory:function(){events(this).dispatch('historyUndo')},onToolNextHistory:function(){events(this).dispatch('historyRedo')},onChangeGridMaxWidth:function(t){events(this).dispatch('changeGridMaxWidth',{width:t})},repositionToolSet:function(){var i=this.toolList.length,e;for(var t=0;t<i;t++){e=this.toolList[t];e.reposition()}},repositionExtraToolSet:function(){var i=this.extraToolList.length,e;for(var t=0;t<i;t++){e=this.extraToolList[t];if(!$(e.element).hasClass('setting_wrap'))e.reposition()}},setFocusToolBtn:function(t){this.focusToolBtnType=t;this.hideAllToolBtnOption(t)},hideAllTool:function(){bm.each(this.toolList,function(t,e){e.hide()});this.toolList.length=0},hideExtraTool:function(){bm.each(this.extraToolList,function(t,e){if(isExpertMode){if(wvAdminIFrameBridge.iframeWindow.document.body===$(e.element).closest('body')[0]){e.hide()}}
else{e.hide()}})},hideAllToolBtnOption:function(t){bm.each(this.toolList,function(e,i){i.hideOptionAll(t)})},showExtraToolByTarget:function(t){var e,s=$(t).find(' > [data-wv-layout-element=block_inner]'),o=['wveditor_table','wveditor_svg','wveditor_line','wveditor_image','wveditor_thumb','wveditor_recentboard','wveditor_video'],i,n,a,r=o.length;for(i=0;i<r;i++){n=o[i];if($(t).hasClass(n)||$(s).hasClass(n)){a=n;break}};switch(a){case'wveditor_table':e=this.toolList['ToolTable'];e.show();e.reposition();break;case'wveditor_svg':e=this.toolList['ToolSvg'];e.show();e.reposition();break;case'wveditor_line':e=this.toolList['ToolLine'];e.show();e.reposition();break;case'wveditor_image':e=this.toolList['ToolImage'];if(e){e.show();e.reposition()};break;case'wveditor_thumb':e=this.toolList['ToolThumb','ToolSwiper'];e.show();e.reposition();break;case'wveditor_recentboard':e=this.toolList['ToolRecentBoard'];e.show();e.reposition();break;case'wveditor_video':e=this.toolList['ToolVideo'];e.show();e.reposition();break;case'wveditor_map':e=this.toolList['ToolMap'];e.show();e.reposition();break}},setModeChange:function(t){if(t=='multi'){this.isMultiSelectMode=!0;if(this.targetElement&&this.targetElementList.length==0){this.targetElementList.push(this.targetElement);this.targetElement=null}}
else{this.isMultiSelectMode=!1;if(this.targetElementList&&this.targetElementList.length>0){this.removeTargetElementMulti()}}},setIsMenuTarget:function(t){var e=this;if(!t||t.length===0)return;var i;if(t.length>1){e.isMenuTarget=!0;t.forEach(function(t){if($(t).closest('[data-wv-layout-element="menu"]').length===0){e.isMenuTarget=!1;return!1}
else{if(!i)i=$(t).closest('[data-wv-gnb]').attr('data-wv-res-id');if(i!==$(t).closest('[data-wv-gnb]').attr('data-wv-res-id')){e.isMenuTarget=!1;return!1}}})}
else{e.isMenuTarget=$(t).closest('[data-wv-layout-element="menu"]').length>0};if(e.isMenuTarget){e.menuTargetSelector='[data-wv-res-id="'+$(t).closest('[data-wv-gnb]').attr('data-wv-res-id')+'"] '+$(t)[0].nodeName.toLowerCase()+'[data-wv-menu-depth="'+$(t).attr('data-wv-menu-depth')+'"]'}
else{e.menuTargetSelector=''}},setIsShopListTarget:function(t){var e=this;if(!t||t.length===0)return;if($(t).attr('data-wv-layout-element-type')==='shop_list'){e.isShopListTarget=!0}
else{e.isShopListTarget=!1}},kitReposition:function(){events(this).dispatch('kitReposition')},resetHitTestBlock:function(){events(this).dispatch('resetHitTestBlock')},registBoardBlockHandler:function(t){if(!t)return;var n=this,a,o=['bbs_basic','bbs_gallery','bbs_faq'],i=$(t).attr('data-wv-block-option');if(i&&o.indexOf(i)!=-1){};if($(t).attr('data-wv-layout-element-type')=='bbs'&&i.indexOf('recent')>-1){var e=n.toolList['ToolRecentBoard'];e.show();e.active(t);n.showToolList.push(e)}},registTextChangeHandler:function(t){var e=this;if(!t||t.length==0)return;$(t).find('.wveditor_text').off('keyup').on('keyup',function(i){if(i.target!=t&&i.target.parentElement!=t){$(i.target).off('keyup');return};events(e).dispatch('kitReposition')})},removeTextChangeHandler:function(t){if(!t||t.length==0)return;$(t).find('.wveditor_text').off('keyup')},registIncEditHandler:function(t){var e=this;if(!t||t.length==0)return;$(t).off('dblclick').on('dblclick',function(e){wvAdminIFrameBridge._WVEditMasterBlock.init(t);$(window.top.document).find('.editor_master_block_name').show().text(wvAdminIFrameBridge._WVAdminBlockBar.blockNameObj[t.getAttribute('data-wv-inc')]?wvAdminIFrameBridge._WVAdminBlockBar.blockNameObj[t.getAttribute('data-wv-inc')]:$(t).attr('data-inc-title'));$(window.top.document).find('#saveMasterBlockEditBtn').show();$(window.top.document).find('#exitMasterBlockEditBtn').show();$(window.top.document).find('#saveAndExitMasterBlockEditBtn').show();$(window.top.document).find('#btnSaveContent').hide();$(window.top.document).find('.editor_current_page').addClass('clickable')})},removeIncEditHandler:function(t){$(t).off('dblclick')},targetImage:null,prevTargetElement:null,registImageChangeHandler:function(t){var e=this;if(!t||t.length==0)return;var i=$(t).css('backgroundImage');if(i!='none'&&i!=''&&i.indexOf('url(')>-1){$(t).off('dblclick').on('dblclick',function(i){if(i.target!=t&&i.target.parentElement!=t){$(i.target).off('dblclick');return};i.stopPropagation();var n=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php?filemanager=1&SITE_LANG='+SITE_LANG,null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(n).css('max-width','1600px');$(n).css('max-height','1200px');$(n).css('border-radius','8px');$(n).on('load',function(){n.contentWindow.fileManager.onSelectCallBack=function(t){if(isExpertMode){e.toolList['ToolDomBackground']['toolBtnList']['ToolBtnDomBackground'].onFileManagerFileSelected(t,e.targetImage)}
else{e.toolList['ToolDomBackgroundImage'].toolBtnList['ToolBtnDomBackgroundImage'].onFileManagerFileSelected(t,e.targetImage)}}})})}
else{$(t).find('> .wveditor_image').off('dblclick').on('dblclick',function(t){if(t.target.tagName.toLowerCase()!='img'&&($(t.target).hasClass('wveditor_image')==!1||$(t.target).find('img').length==0)){$(t.target).off('dblclick');return};t.stopPropagation();var n=t.target;if(n.tagName.toLowerCase()=='img'){e.targetImage=n;var o=!1;if($(n).closest('[data-wv-inc^=header]').length>0&&$(n).closest('[data-wv-layout-element="block"]').attr('data-wv-logo')!==undefined)o=!0;var i=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php?filemanager=1&SITE_LANG='+SITE_LANG,null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(i).css('max-width','1600px');$(i).css('max-height','1200px');$(i).on('load',function(){i.contentWindow.fileManager.onSelectCallBack=function(t){if(o){wvAdminIFrameBridge._WVHeaderFooter.onFileManagerFileSelected(t,e.targetImage)}
else{e.toolList['ToolText'].toolBtnList['ToolBtnTextImage'].onFileManagerFileSelected(t,e.targetImage)}}})}
else if(n.tagName.toLowerCase()=='div'&&$(n).children().length==1&&$(n).find('img').length==1){e.targetImage=$(n).find('img');var i=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php?filemanager=1&SITE_LANG='+SITE_LANG,null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(i).css('max-width','1600px');$(i).css('max-height','1200px');$(i).on('load',function(){i.contentWindow.fileManager.onSelectCallBack=function(t){e.toolList['ToolText'].toolBtnList['ToolBtnTextImage'].onFileManagerFileSelected(t,e.targetImage)}})}});$(t).find('> .wveditor_text').off('dblclick').on('dblclick','img',function(t){t.stopPropagation();var n=t.target;e.targetImage=n;var i=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php?filemanager=1&SITE_LANG='+SITE_LANG,null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(i).css('max-width','1600px');$(i).css('max-height','1200px');$(i).on('load',function(){i.contentWindow.fileManager.onSelectCallBack=function(t){e.toolList['ToolText'].toolBtnList['ToolBtnTextImage'].onFileManagerFileSelected(t,e.targetImage)}})})}},removeImageChangeHandler:function(t){if(!t||t.length==0)return;var e=$(t).css('backgroundImage');if(e!='none'&&e!=''&&e.indexOf('url(')>-1){$(t).off('dblclick')}
else{$(t).find('> .wveditor_image').off('dblclick')};$(t).find('> .wveditor_text').off('dblclick','img')},changeTargetElement:function(t,e){var d=!1,i=this;if(this.targetElementList&&this.targetElementList.length>0){this.removeTargetElementMulti()};if(!isPrdDetailInfo&&!isCustomEffect){if(t!==this.targetElement&&isExpertMode===!0){wvAdminIFrameBridge._WVHover.off(!0)}};if(!isPrdDetailInfo&&wvAdminIFrameBridge._WVEditMasterBlock.isMasterBlock(t)===!0&&wvAdminIFrameBridge._WVEditMasterBlock.isMasterBlockEdit!==!0&&$(t).attr('data-wv-layout-element-type')!=='image'){if(isMasterBlockUpdated===!0){this.registIncEditHandler(t)}}
else{this.registImageChangeHandler(t);this.registTextChangeHandler(t);this.registBoardBlockHandler(t)};if(i.toolMode==='side'){var a=wvAdminIFrameBridge._WVLayoutKit;if(t){if(this.editorMode==='product'){}
else{mouseAdapter(t).offDrag();if($(t).attr('data-wv-layout-element-restricted')===undefined&&$(t).attr('data-wv-layout-element-lock')===undefined){let dragEvent=bm.dragMove;dragEvent.settingReset();dragEvent.target=a.targetElementList.length>0?a.targetElementList:a.targetElement;mouseAdapter(t).onDrag(dragEvent.onFreeMove,dragEvent.onFreeMoveEnd,dragEvent.onFreeMoveStart);$(this.targetElement).css({cursor:'move'});$(t).css({cursor:'move'})}};var l=wvAdminIFrameBridge.iframeWindow.getSelection();$(this.targetElement).find('.wveditor_text').attr('contenteditable',!1);$(t).find('.wveditor_text').attr('contenteditable',!1);l.removeAllRanges();let type=this.targetElementType[$(t).attr('data-wv-layout-element-type')];if(!type){type=this.targetElementType[$(t).find('[data-wv-layout-element-type]').attr('data-wv-layout-element-type')];if(!type){type='일반블록'}};i.targetToolProp.text(type);i.toolSide.show();wvAdminIFrameBridge._WVToolbarLayerWindow.setLayerDefault()}};this.hideExtraTool();if($(t).attr('data-wv-layout-element')!='block'){t=$(t).closest('[data-wv-layout-element=block]')};if(t.hasOwnProperty('length'))t=t[0];if(this.targetElement!=t){var r=$(this.targetElement).attr('data-wv-layout-element-type');if(bm.string.contains(r,'table')){bm.tableSelectionManager.removeRange()};if(this.targetElement){if(!isPrdDetailInfo){if(isMasterBlockUpdated===!0){this.removeIncEditHandler(this.targetElement)}};this.removeImageChangeHandler(this.targetElement);this.removeTextChangeHandler(this.targetElement)};this.removeTargetElementSingle(this.targetElement);this.targetElement=t;$(this.targetElement).addClass(this.selectedClass);$(this.targetElement).closest('[data-wv-design-area]').addClass(this.selectedAreaClass);d=!0};this.setIsMenuTarget(t);this.setIsShopListTarget(t);function h(t){var e=!1;if($(t).closest('#wvPosDisplayCon').length!=0){e=!0}
else if($(t).closest('#wvSizeDisplayCon').length!=0){e=!0}
else if($(t).closest('#wvSizeControlCon').length!=0){e=!0}
else if($(t).closest('#layoutMoveBtn').length!=0){e=!0}
else if($(t).closest('.layoutElementFreeMove').length!=0){e=!0};return e};$(wvAdminIFrameBridge._WVContentArea.innerWindow).off('mouseup').on('mouseup',function(t){var e=h(t.target);if($(t.target).closest('[data-wv-layout-element="block"]').length==0&&!e)return;if(wvAdminIFrameBridge._WVLayoutKit.isMultiSelectMode&&i.targetElementList.length>0||!wvAdminIFrameBridge._WVLayoutKit.isMultiSelectMode&&i.targetElement){if(isCustomEffect){if(!wvAdminIFrameBridge._WVEffect.isRetarget)i.toolStyleSetting()}
else{i.toolStyleSetting()}};if(!isPrdDetailInfo&&!isCustomEffect){wvAdminIFrameBridge['_WVHover'].btnStyleSetting(i['targetElement'])}});var n,o,s=this.toolList.length;for(n=0;n<s;n++){o=this.toolList[n];if(o.status==0){o.active(t,e,this.toolMode)}
else{o.changeTarget(t,e,this.toolMode)}}},changeTargetElementList:function(t,e){if(this.targetElement){this.targetElement=null};bm.each(this.extraToolList,function(t,e){e.hide()});var i,a,n;if(e){this.removeTargetElementMulti()};if(!this.targetElementList)this.targetElementList=[];n=t.length;if(n){for(i=0;i<n;i++){a=t[i];this.targetElementList.push(a);$(a).addClass(this.selectedClass);$(a).closest('[data-wv-design-area]').addClass(this.selectedAreaClass);var s=wvAdminIFrameBridge._WVLayoutKit}}
else{this.targetElementList.push(t);$(t).addClass(this.selectedClass);$(t).closest('[data-wv-design-area]').addClass(this.selectedAreaClass);var s=wvAdminIFrameBridge._WVLayoutKit};this.setIsMenuTarget(this.targetElementList);this.setIsShopListTarget(this.targetElementList);var i,o,n=this.toolList.length;for(i=0;i<n;i++){o=this.toolList[i];if(o.status==0){o.active(this.targetElementList)}
else{o.changeTarget(this.targetElementList)}}},toolStyleSetting:function(t){var e,i;if(t){this.toolList[t].setStyleTool()}
else{var n=this.toolList.length;for(e=0;e<n;e++){i=this.toolList[e];i.setStyleTool()}}},toolShowHideSettingByBlock:function(t,e){var s,i,h=this.toolList.length;for(s=0;s<h;s++){i=this.toolList[s];if(i.type!='ToolText'&&i.isShow){i.hide();i.deactive()}};this.showToolList=[this.toolList['ToolText']];this.toolList['ToolText'].active(t);var l=$(t).find(' >[data-wv-layout-element=block_inner]'),r=['wveditor_image','wveditor_table','wveditor_video','wveditor_map','wveditor_file','wveditor_line','wveditor_thumb'],o,a,d=r.length,n='wveditor_dom';for(o=0;o<d;o++){a=r[o];if($(t).hasClass(a)||$(l).hasClass(a)){n=a;break}};if(n=='wveditor_dom'){i=this.toolList['ToolDomSpace'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolDomWidth'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolTextLink'];i.show();i.active(t);this.showToolList.push(i)}
else{i=this.toolList['ToolDomSpaceSizeSmall'];i.show();i.active(t);this.showToolList.push(i)};i=this.toolList['ToolDomAlignVertical'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolDomAlignHorizontal'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolDomBackground'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolMotionSource'];i.show();i.active(t);this.showToolList.push(i);if(n=='wveditor_thumb'){i=this.toolList['ToolThumb','ToolSwiper'];i.show();i.active(t);this.showToolList.push(i)}
else if(n=='wveditor_table'){i=this.toolList['ToolTable'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolTableSize'];i.show();i.active(t);this.showToolList.push(i);i=this.toolList['ToolTableAlign'];i.show();i.active(t);this.showToolList.push(i)}
else if(n=='wveditor_video'){i=this.toolList['ToolVideo'];i.show();i.active(t);this.showToolList.push(i)}
else if(n=='wveditor_file'){}
else if(n=='wveditor_map'){i=this.toolList['ToolMap'];i.show();i.active(t);this.showToolList.push(i)}
else if(n=='wveditor_line'){}
else if(n=='wveditor_image'){}},removeTargetElementSingle:function(t){$(t).removeClass(this.selectedClass);$(t).closest('[data-wv-design-area]').removeClass(this.selectedAreaClass);this.targetElement=null},removeTargetElementMulti:function(t){if(t){var e,i,n=t.length;if(n){for(e=0;e<n;e++){i=t[e];$(i).removeClass(this.selectedClass);$(i).closest('[data-wv-design-area]').removeClass(this.selectedAreaClass);this.targetElementList.splice(this.targetElementList.indexOf(i),1)}}
else{$(t).removeClass(this.selectedClass);$(t).closest('[data-wv-design-area]').removeClass(this.selectedAreaClass);this.targetElementList.splice(this.targetElementList.indexOf(t),1)}}
else{var n=this.targetElementList.length,i;for(var e=0;e<n;e++){i=this.targetElementList[e];$(i).removeClass(this.selectedClass);$(i).closest('[data-wv-design-area]').removeClass(this.selectedAreaClass);events(this).dispatch('kitReposition')};this.targetElementList.length=0}}};bm.wvFileManager={callBack:null,dummyInput:null,open:function(t){if(!this.dummyInput){this.dummyInput=bm.html('<input type=\'hidden\' id=\'wvFileField\'>');$(document.body).append(this.dummyInput)};this.callBack=t;var e=WEVEN_JS_WEB_PATH+'libs/filemanager/dialog.php?type=1&field_id=wvFileField&relative_url=0';bm.popupManager.addToIframe(e,'',880,570)},close:function(){bm.popupManager.removePopLatest()},onSelect:function(t){if(this.callBack){var e=$('#wvFileField').val();this.callBack(e);this.callBack=null};this.close()}};window.responsive_filemanager_callback=function(t){bm.wvFileManager.onSelect(t)};bm.sourceEditorMananger={dom:null,editor:null,currentSource:'',isActive:!1,target:null,callback:null,isDesignEditMode:!0,isCssMode:!1,createSourceEditor:function(t){if(this.dom==null){var e=this;bm.multiScriptLoader(function(){e.dom=bm.html('<div id="sourceEditorWrap"><div id="sourceEditorCon"><div id="sourceEditorTitleCon"><div id="sourceEditorExplain"></div><div id="sourceEditorTitle">소스코드 수정</div></div><pre id="sourceEditor"></pre><div id="sourceEditorBtnCon"><button id="sourceEditorSave">적용</button><button id="sourceEditorCancel">취소</button></div></div><div id="sourceEditorBg"></div></div>');t()},WEVEN_JS_WEB_PATH+'libs/jsbeautify/beautify-html.js',WEVEN_JS_WEB_PATH+'libs/ace-builds/src-min-noconflict/ace.js')}
else{t()}},setValue:function(t){if(this.editor){this.currentSource=t;this.editor.setValue(t)}},getValue:function(){if(this.editor){this.currentSource=this.editor.getValue();return this.currentSource}},active:function(t,e,i,n,o){this.target=t;this.callback=i;this.isCssMode=o;if(this.isActive)return;this.isActive=!0;var a=this,s=function(){$(document.body).prepend(a.dom);if(!a.editor){a.editor=ace.edit('sourceEditor');a.editor.setTheme('ace/theme/monokai');a.editor.session.setMode('ace/mode/html');a.editor.getSession().setUseWrapMode(!0);a.editor.$blockScrolling=Infinity;a.editor.setFontSize(14)};if(t){if(e){a.target=$(t).find(e).first()[0];if(!a.target)a.target=t}
else{a.target=t};if(a.target.value){a.editor.setValue(html_beautify(a.target.value))}
else{var i;if(a.isCssMode==!0||a.isDesignEditMode==!1){i=a.target.outerHTML}
else if($(a.target).attr('data-wv-layout-element')=='block_inner'){i=$(a.target).closest('[data-wv-layout-element="block"]')[0].outerHTML}
else{i=a.target.outerHTML};a.editor.setValue(html_beautify(i))};if(n){$(a.dom).find('#sourceEditorExplain').text(n)};a.registListener()}};if(this.dom){s()}
else{this.createSourceEditor(s)}},registListener:function(){var t=this;$(this.dom).find('#sourceEditorSave').on('click',function(e){t.currentSource=t.editor.getValue();if(t.callback){if(bm.sourceEditorMananger.isCssMode){t.callback(t.target,t.currentSource.split(/<[^\<\>]+>/)[1])}
else{t.callback(t.target,t.currentSource)}};t.deactive()});$(window).on('keyup',function(e){if(e.keyCode==27){if(confirm('편집중인 소스는 반영되지 않습니다.\n계속하시겠습니까?')){t.deactive(t.callback)}}});$(this.dom).find('#sourceEditorCancel').on('click',function(e){t.deactive()})},removeListener:function(){$(this.dom).find('#sourceEditorSave').off('click');$(this.dom).find('#sourceEditorCancel').off('click');$(window).off('keyup')},deactive:function(t){if(this.isActive==!1)return;this.isActive=!1;$('#sourceEditorExplain').empty();$(this.dom).remove();this.editor.setValue('');events(this).dispatch('deactive',this);bm.sourceEditorMananger.isCssMode=!1;this.removeListener()}};bm.styleSheetManager={sheetList:{},setSheet:function(t,e){this.list[t]=this.makeSheetObject(e)},makeSheetObject:function(t,e){return new bm.SheetObject(t,e)},refreshSheetObject:function(t,e){t.refreshStyleElement(e)},getSheet:function(t){return this.list[t]},getList:function(){return this.list},getBuildData:function(t){var e={};var n,i,o,a=t.length;for(n=0;n<a;n++){i=t[n];if(i['cssRules']&&i['cssRules'].length>0){o=bm.getSelectorByCssText(i.cssText);if(!e[o])e[o]='';if(i.type==CSSRule.MEDIA_RULE){e[o]+=bm.getBodyByCssText(i.cssText)}
else{if(!e['default'])e['default']='';e['default']+=i.cssText+'\n'}}
else{if(!e['default'])e['default']='';e['default']+=i.cssText+'\n'}};return e},getCssTextByData:function(t){var e='';if(t['default']){e+=t['default']};$.each(t,function(t,i){if(t!='default'){e+='\n\n';e+=t+' {\n\n';e+=i;e+='\n}'}});return e},getCssTextByRule:function(t){var e=this.getBuildData(t),i=this.getCssTextByData(e);return i},getCssTextBySheet:function(t){if(t.length&&t.length>0){t=t[0]};return this.getCssTextByRule(t.sheet.cssRules)},insetBlockResId:[],prefixBlockResId:[],mergeStyleSheetToText:function(t,e){var r=this,d=$('<style></style>');d[0].innerHTML=e;$(document.body).append(d);if(t.length&&t.length>0){t=t[0]};var l=t.sheet.cssRules,n={};var s;r.insetBlockResId=[];r.prefixBlockResId=[];var i,a=l.length;while(a--){i=l[a];if(i.type==CSSRule.MEDIA_RULE){var o=i.conditionText?i.conditionText:i.media[0];if(!n[o]){n[o]={size:parseInt(o.match(/\d+/g)[0]),rule:i}}
else{s=n[o].rule;$.each(i.cssRules,function(t,e){s.insertRule(e.cssText,s.cssRules.length)})};t.sheet.deleteRule(Array.prototype.indexOf.call(l,i))}};var c=d[0].sheet.cssRules;a=c.length;while(a--){i=c[a];if(i.type==CSSRule.MEDIA_RULE){var o=i.conditionText?i.conditionText:i.media[0];if(!n[o]){n[o]={size:parseInt(o.match(/\d+/g)[0]),rule:i}}
else{s=n[o].rule;$.each(i.cssRules,function(t,e){var i=e.cssText;if(i.indexOf('inset')>-1)r.insetBlockResId.push(i);if(i.indexOf('appearance')>-1)r.prefixBlockResId.push(i);s.insertRule(i,s.cssRules.length)})};d[0].sheet.deleteRule(Array.prototype.indexOf.call(c,i))}
else{if(i.cssText.indexOf('inset')>-1)r.insetBlockResId.push(i.cssText);if(i.cssText.indexOf('appearance')>-1)r.prefixBlockResId.push(i.cssText);t.sheet.insertRule(i.cssText,l.length)}};n=Object.values(n);n.sort(bm.sort.orderBy('size asc'));var a=n.length,i;for(var h=0;h<a;h++){i=n[h].rule;t.sheet.insertRule(i.cssText,l.length)};d.remove();var f=this.getCssTextByRule(t.sheet.cssRules);return f},deleteRule:function(){}};bm.SheetObject=function(t,e){if(t.length&&t.length>0){t=t[0]};this.styleElement=t;this.styleType=e;this.checkResponsiveMediaRules()};bm.SheetObject.prototype={styleElement:null,styleType:null,refreshStyleElement:function(t){if(t.length&&t.length>0){t=t[0]};this.styleElement=t;if(this.styleElement.innerHTML){this.checkResponsiveMediaRules()}},checkResponsiveMediaRules:function(){var a=['1600','1200','992','768'],t,e,o=this.styleElement.sheet.cssRules.length,s=[],i;for(t=0;t<o;t++){e=this.styleElement.sheet.cssRules[t];if(e.type==CSSRule.MEDIA_RULE){var n=e.conditionText?e.conditionText:e.media[0];if(!n||n==='undefined')continue;s.concat(a.filter((function(t){return n.indexOf(t)>-1})))}};i=a.filter((function(t){return!s.includes(t)}));if(i.length>0){o=i.length;for(t=0;t<o;t++){this.styleElement.sheet.insertRule('@media (min-width: '+i[t]+'px) { } ');e=this.styleElement.sheet.cssRules[0]}};this.orderMediaRule(this.styleElement.sheet)},orderMediaRule:function(t){var i={};var r,a=t.cssRules,e,o=a.length;while(o--){e=a[o];if(e.type==CSSRule.MEDIA_RULE){var n=e.conditionText?e.conditionText:e.media[0];if(!n||n==='undefined')continue;if(!i[n]){i[n]={size:parseInt(n.match(/\d+/g)[0]),rule:e}}
else{r=i[n].rule;$.each(e.cssRules,function(t,e){r.insertRule(e.cssText,r.cssRules.length)})};t.deleteRule(Array.prototype.indexOf.call(a,e))}};i=Object.values(i);i.sort(bm.sort.orderBy('size asc'));var o=i.length,e;for(var s=0;s<o;s++){e=i[s].rule;t.insertRule(e.cssText,a.length)}},getRulesBySelectorText:function(t,e,i,n,o){var s=!1,r=0,d;if(typeof(t)==='string')t=t.replace(/"|'/g,'');if(!e){e=this.styleElement.sheet;s=!0}
else if(this.styleElement.sheet==e){s=!0};d=e.cssRules;if(i===undefined||i===null){i=!0};if(o===undefined||o===null){o=['default']};if(n===undefined||n===null){n=!1};var a=[],l=this;Array.prototype.forEach.call(d,function(e,d){if(e.type==CSSRule.STYLE_RULE){var m=$.trim(e.selectorText).replace(/"|'/g,''),p=m.lastIndexOf(t);if(n){if(p>-1){if(s){if(o.indexOf('default')>-1){a.push(e);r++}}
else{a.push(e)}}}
else{if(p>-1&&(p+t.length)==m.length){if(s){if(o.indexOf('default')>-1){a.push(e);r++}}
else{a.push(e)}}}}
else if(e.type==CSSRule.MEDIA_RULE){var v=o.length,f,g=null;for(var c=0;c<v;c++){f=o[c];var h=e.conditionText?e.conditionText:e.media[0];if(!h||h==='undefined')continue;if(h.indexOf(f)>-1){g=f;break}};if(g){var u=l.getRulesBySelectorText(t,e,!0,n);if(u.length>0){a=a.concat(u)}
else{if(i){a.push(l.insertStyleRule(t+' {  }',null,e))}}}}});if(s&&r==0&&i&&o.indexOf('default')>-1){a.push(this.insertStyleRule(t+' {  }',null,e))};return a},getRulesBySelectorTextWithMediaRule:function(t,e,i,n){var T=this,r=$('<style></style>');$(document.body).append(r);if(n)var f=n;else var f=WVAdminResourceManager.getEmbededStyleElement('block');if(f.length&&f.length>0)f=f[0];var c=WVAdminResourceManager.getEmbededStyleElement('duplicated');if(c.length&&c.length>0)c=c[0];c.innerHTML=f.innerHTML;var v=c.sheet.cssRules,a={};var l,t='[data-wv-res-id="'+t+'"]',o,d=v.length;while(d--){o=v[d];if(o.type==CSSRule.MEDIA_RULE){var s=o.conditionText?o.conditionText:o.media[0];if(!a[s]){a[s]={size:parseInt(s.match(/\d+/g)[0]),rule:o}}
else{l=a[s].rule;$.each(o.cssRules,function(i,n){var a=$.trim(n.selectorText),o=a.lastIndexOf(t);if(e){if(o>-1){l.insertRule(n.cssText,l.cssRules.length)}}
else{if(o>-1&&(o+t.length)==a.length){l.insertRule(n.cssText,l.cssRules.length)}}})}}
else{var p=$.trim(o.selectorText),h=p.lastIndexOf(t);if(e){if(h>-1){r[0].sheet.insertRule(o.cssText,r[0].sheet.cssRules.length)}}
else{if(h>-1&&(h+t.length)==p.length){r[0].sheet.insertRule(o.cssText,r[0].sheet.cssRules.length)}}}};d=Object.keys(a).length;while(d--){var w=Object.keys(a)[d];o=a[w].rule;if(o.type==CSSRule.MEDIA_RULE){var s=o.conditionText?o.conditionText:o.media[0];if(!a[s]){a[s]={size:parseInt(s.match(/\d+/g)[0]),rule:o}}
else{l=a[s].rule;var y=o.cssRules.length;for(var m=y-1;m>=0;m--){var g=o.cssRules[m],p=$.trim(g.selectorText),h=p.lastIndexOf(t);if(e){if(h==-1){l.deleteRule(Array.prototype.indexOf.call(o.cssRules,g))}}
else{if(!(h>-1&&(h+t.length)==p.length)){l.deleteRule(Array.prototype.indexOf.call(o.cssRules,g))}}}}}};a=Object.values(a);a.sort(bm.sort.orderBy('size asc'));var d=a.length,o;for(var u=0;u<d;u++){o=a[u].rule;r[0].sheet.insertRule(o.cssText,r[0].sheet.cssRules.length)};var b=bm.styleSheetManager.getCssTextByRule(r[0].sheet.cssRules);r.remove();WVAdminResourceManager.removeEmbededStyleObject('duplicated');return b},getRule:function(t){return this.styleElement.sheet.cssRules[t]},mergeRule:function(t,e,i,n,o,a,r,s){this.deleteUnnecessaryMediaRules(null,this.styleElement.sheet,WVAdminTopBar.RESPONSIVE_CONDITION_LIST);if(isCustomEffect){o=!1;var l=wvAdminIFrameBridge._WVEffect;if(l.hasEffectAttr()&&(l.targetMode===WVEffect.prototype.ELEMENTMODE)){var s=s?s:0,m=l.getEffectElementArr(),w=l.getEffectType(),T=bm.effect.prototype.getTargetDiv(m[s]).attr('data-wv-res-id');t='[data-wv-res-id="'+T+'"]';if(l.isChangeTabActive()){if(e&&!(e.transitionDelay||e.transitionDelay||e.transitionProperty)){t+='['+l.getEffectState(m[s])+'-'+w+']'}}}};if(!isCustomEffect){var y=t,f=s;if($('#WEVEN_IFRAME')['length']>0&&isPrdDetailInfo!==!0&&wvAdminIFrameBridge['_WVHover'].isOn()&&!e['transition']){if(wvAdminIFrameBridge['_WVHover'].isOn()&&!e['transition']){if(f&&f['doubleMerge']===!0){t=f['hoverFormerSelector']+'['+wvAdminIFrameBridge['_WVHover']['hoverAttr']+']'}
else if(r===!0){t='[data-wv-layout-element-type="text"]:not(.wvelLayoutViewBorderPadding) '+t;t+=':not(.wvelLayoutViewBorderPadding):hover'}
else{t+=':not(.wvelLayoutViewBorderPadding):hover'};wvAdminIFrameBridge['_WVHover'].hasStyleOn()}}};n=n===undefined?!0:n;o=o===undefined?!1:o;var d=this.getRulesBySelectorText(t,this.styleElement.sheet,n,o,i),p,u,g=[],S=[],c,h,b=d.length;for(c=0;c<b;c++){h=d[c];g.push(h.selectorText);$.each(e,function(t,e){if(!e)h.style.removeProperty(t);if(bm.type.isString(e)&&e.indexOf('!important')>-1){t=bm.string.toUnitFromUpperCase(t,'-');e=e.slice(0,e.indexOf('!important'));h.style.setProperty(t,e,'important')}
else{h.style[t]=e};if(!p)p=bm.string.toCssPropKey(t);if(!u)u=e})};if(a&&a.length>0){var v=d[d.length-1].parentRule?d[d.length-1].parentRule:d[d.length-1].parentStyleSheet,C=a.filter(function(t){if(!g.includes(t)){var e=Array.prototype.indexOf.call(v.cssRules,t)+1,i=t+'{'+p+' : '+u+'}';v.insertRule(i,e);return t}})};if(isCustomEffect){var l=wvAdminIFrameBridge._WVEffect;if(l.hasEffectAttr()&&(l.targetMode===WVEffect.prototype.ELEMENTMODE)){if(s<m.length){s++;this.mergeRule(t,e,i,n,o,a,r,s)}}};if(!isCustomEffect){if($('#WEVEN_IFRAME')['length']>0&&isPrdDetailInfo!==!0&&wvAdminIFrameBridge['_WVHover'].isOn()&&!f){this.mergeRule(t,e,i,n,o,a,!1,{hoverFormerSelector:y,doubleMerge:!0})}};return g},applyResourceStyleExceptSize:function(t,e,i,n,o,a,s,r){if($('#WEVEN_IFRAME')['length']>0&&isPrdDetailInfo!==!0&&wvAdminIFrameBridge['_WVHover'].isOn()){return};var f=this,p=[];if(a.length>0){var l,d,h;if(typeof t=='string')d=wvAdminIFrameBridge._WVContentArea.innerWindow.$(t)[0];else d=t;if(e!=null)h='[data-wv-res-id="'+e+'"]';else h=t;var c=!1;Object.keys(i).forEach(function(t){for(var m=a.length-1;m>=0;m--){var g=a[m],b='',e=n.getRulesBySelectorText(h,null,!1,!0,[g]),i={};if(e.length==0){l=bm.getStyle(d,t);c=!1}
else{for(var u=0;u<e.length;u++){if(e[u].selectorText==h){l=e[u].style[t];c=!0;break}};if(!l){l=e[0].style[t];c=!1}};if(!l&&(e.length==0||e[0].style[t]=='')){if(t.indexOf('margin')>-1||t.indexOf('padding')>-1)l='0';else if(t.indexOf('maxWidth')>-1)l='none';else if(t.indexOf('height')>-1){if(!$(d)[0].hasAttribute('data-wv-swiper-pagination')){l='auto'}}
else if(t=='left'||t=='top'){if(!$(d)[0].hasAttribute('data-wv-swiper-navigation')){l='0'}}
else l=bm.getStyle(d,t);c=!1};i[t]=l;if(t.indexOf('width')>-1&&!c){i['width']='';var v=f.getColToWidth(d,g);if(v)i['width']=v};p=p.concat(f.mergeRule(h,i,[g],s,r));if(o){f.mergeRule(h+' > [data-wv-layout-element="block_inner"]',i,[g],s)}}})};return p},getColToWidth:function(t,e){var a='col-';if(e>=768&&e<992){a+='sm-'}
else if(e>=992&&e<1200){a+='md-'}
else if(e>=1200&&e<1600){a+='lg-'}
else if(e>=1600){a+='xl-'};var t=t.length?t[0]:t,f=['col-xl-','col-lg-','col-md-','col-sm-','col-'],g=f.indexOf(a),s=t.hasAttribute('class')?$(t).attr('class').split(' '):[],p=[],m=f.length,i=null,r='',l='',d='',v=-1,o;for(var n=0;n<s.length;n++){if(s[n].match('col-')){r=parseInt(s[n].slice(a.length));var u=s[n].replace(r,'');p.push(s[n]);if(u==a){l=s[n];i=r;if(i===0)o='auto';else if(i===20)o='20%';else o=Math.floor(i/12*10000)/100+'%';break}}};if(!l){for(var c=g;c<m;c++){if(i!==null)break;d=f[c];for(var h=0;h<p.length;h++){l=p[h];v=l.indexOf(d);r=parseInt(l.slice(d.length));if(l.indexOf(d)>-1&&!isNaN(r)){i=r;if(i===0)o='auto';else if(i===20)o='20%';else o=Math.floor(i/12*10000)/100+'%';break}}}};return o},setWidthToCol:function(t,e){if(!e){e=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList()};var r=WVAdminResourceManager.getResourceId(t,!0);if(!r)return;r='[data-wv-res-id="'+r+'"]';var d=this.getRulesBySelectorText(r,null,!1,!1,e);if(d.length>0){var a,h='',s,l,i,n;for(s=0;s<d.length;s++){l=d[s];i=l.style.width;if(i){a=l.parentRule;if(a&&a.conditionText)h=parseInt(a.conditionText.match(/\d+/g)[0]);var o=bm.getResponsiveSpaceByResponsiveText('width',bm.getResponsiveSizeTextBySize(h));bm.removeClassAtPrefix(t,o);if(i.indexOf('px')>-1){n=c(t,i,$(t).parent().outerWidth());$(t).addClass(o+n)}
else if(i.indexOf('%')>-1){if(i.indexOf('calc')>-1){i=i.replace('calc(','');i=i.slice(0,i.lastIndexOf(')'));n=c(t,i);$(t).addClass(o+n)}
else{n=Math.round(parseFloat(i)/100*12);$(t).addClass(o+n)}}}};function c(t,e,i){var o;if(e.indexOf('%')>-1){e=e.replace('%','');o=parseFloat(e)}
else{o=Math.floor(parseInt(e)/i*10000)/100};var r,s,a=[0,8.33,16.66,25,33.33,41.66,50,58.33,66.66,75,83.33,91.66,100];r=a.length-1;for(var n=0;n<r;n++){if(o>a[12]){s=12;break}
else if(a[n]<=o&&o<=a[n+1]){if((o-a[n])<(a[n+1]-o)){s=n}
else{s=n+1};break}};return s}}},applyResourceStyle:function(t,e,i,n,o,a,s,r,l){Progress.ON();if($('#WEVEN_IFRAME')['length']>0&&isPrdDetailInfo!==!0){const resCheckResult=wvAdminIFrameBridge._WVResponsiveCheck.responsiveInterCheck(t,e,i,n,o,a,s,r,l);let isIncCheckResult=!1;if($(t).length>0){isIncCheckResult=wvAdminIFrameBridge._WVEditMasterBlock.isMasterBlock(t)};if((resCheckResult===!1||isIncCheckResult===!0)&&wvAdminIFrameBridge._WVEditMasterBlock.isMasterBlockEdit==!1){if(isIncCheckResult===!0)wvAdminIFrameBridge._WVEditMasterBlock.rejectMsg();Progress.OFF();return!1}};var v=this,c,b=[],u=[];a=a===undefined||a?!0:!1;r=r===undefined||r==null?!1:r;l=l===undefined||l===null?!1:l;if($(t).length>0&&$(t).closest('[data-wv-layout-element-type="shop_list"]').length>0){var c=$(t).closest('[data-wv-layout-element-type="shop_list"]').parent().closest('[data-wv-res-id]').attr('data-wv-res-id');if(wvAdminIFrameBridge.iframeWindow){l=wvAdminIFrameBridge._WVContentArea.innerWindow.$('[data-wv-res-id="'+c+'"]')}
else{l=$('[data-wv-res-id="'+c+'"]')}};if(l){if(bm.type.isString(l)){t=l+' '+t}
else{if($(l).attr('id')!==undefined){t='#'+$(l).attr('id')+' [data-wv-res-id="'+$(t).attr('data-wv-res-id')+'"]'}
else if($(l).attr('data-wv-res-id')!==undefined){t='[data-wv-res-id="'+$(l).attr('data-wv-res-id')+'"] [data-wv-res-id="'+$(t).attr('data-wv-res-id')+'"]'}
else{return!1}}};if($(t).closest('[aria-controls]').length>0){let isSwiperNavi=!1;let bmSwiperList;let shopSwiperList;let navigationList=[];isSwiperNavi=!0;bmSwiperList=wvAdminIFrameBridge.iframeWindow.bm.swiper['list'];shopSwiperList=wvAdminIFrameBridge._WVShopConfig['shopSwiper'];function x(t,e,i){for(let d=0;d<t.length;d++){if($(i).closest('[aria-controls]')[0]===t[d]['navigation']['prevEl']||$(i).closest('[aria-controls]')[0]===t[d]['navigation']['nextEl']){e.push(t[d]['navigation']['prevEl']);e.push(t[d]['navigation']['nextEl'])}}};if(bmSwiperList){x(bmSwiperList,navigationList,t)};if(shopSwiperList){x(shopSwiperList,navigationList,t)};if($(t).closest('[data-wv-layout-element-type="svg"]').length>0){t=[];let blockList=$(navigationList).find('.wveditor_svg').closest('[data-wv-layout-element="block"]');for(let d=0;d<blockList.length;d++){t.push(blockList[d])}}
else{t=navigationList};e=[e,e]};if($('#WEVEN_IFRAME')['length']>0&&isPrdDetailInfo!==!0&&wvAdminIFrameBridge['_WVHover'].isOn()){wvAdminIFrameBridge['_WVHover'].addHoverAttr($(t)[0])};if(s===undefined||s.length===0){s=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList()};if(wvAdminIFrameBridge._WVAdminTopBar){b=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList().filter(function(t){return wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList().indexOf(t)==-1})};var p=null,w=[];if(bm.type.isString(t)){var m;if(typeof t=='string'){if(wvAdminIFrameBridge.iframeWindow){m=wvAdminIFrameBridge._WVContentArea.innerWindow.$(t)[0]}
else{m=$(t)[0]}}
else{m=t};if(bm.bmEditorManager.registedBoardEditor===!1){p=WVAdminResourceManager.getEmbededStyleObject(null,m)};w.push(t);if(l){u=v.applyResourceStyleExceptSize(t,null,e,p,i,b,!1,r)}
else{u=v.applyResourceStyleExceptSize(t,null,e,p,i,b,a,r)};v.mergeRule(t,e,s,a,r,u);if(n){$(t).each(function(){bm.removeInlineStyleProp(this,e)});if($(t).length==0&&wvAdminIFrameBridge._WVContentArea.innerWindow){wvAdminIFrameBridge._WVContentArea.innerWindow.$(t).each(function(){bm.removeInlineStyleProp(this,e)})}}}
else{if(bm.type.isArray(t)==!1)t=[t];if(bm.type.isArray(e)==!1)e=[e];var d,h,f,B=t.length;if(bm.bmEditorManager.registedBoardEditor===!1){p=WVAdminResourceManager.getEmbededStyleObject(null,t[0])};for(d=0;d<B;d++){h=t[d];if(wvAdminIFrameBridge._WVAdminTopBar){f=WVAdminResourceManager.checkNewResourceId(h)};if(f!=null){this.copyStyleBySelector('[data-wv-res-id="'+f.old+'"]','[data-wv-res-id="'+f.new+'"]');if($(h).closest('[data-wv-layout-element-type="thumb"]').length>0&&$(h).is('[data-wv-swiper-con]')){var T=$(h).closest('[data-wv-layout-element-type="thumb"]'),y=T.attr('data-wv-res-id'),C=$(h).closest('[data-wv-swiper-con]').attr('data-wv-res-id'),g=T.find('[data-wv-com="swiper"]'),S;if(y!==C){S='[data-wv-res-id='+y+'] [data-wv-res-id='+C+'] .swiper-container'}
else{S='[data-wv-res-id='+y+'] .swiper-container'};g.attr('data-wv-com-op',g.attr('data-wv-com-op').replace(new RegExp(f.old,'g'),f.new));bm.swiper.addNew(g,bm.parsing.parseStrToObj(g.attr('data-wv-com-op')))};c=f.new}
else{c=WVAdminResourceManager.getResourceId(h)};w.push(c);u=v.applyResourceStyleExceptSize(h,c,e[d],p,i,b,a,r);this.mergeRule('[data-wv-res-id="'+c+'"]',e[d],s,a,r,u);if(i){this.mergeRule('[data-wv-res-id="'+c+'"] > [data-wv-layout-element="block_inner"]',e[d],s,a,r)};if(n){bm.removeInlineStyleProp(h,e[d]);if(i){bm.removeInlineStyleProp($(h).find('> [data-wv-layout-element="block_inner"]'),e[d])}}}};Progress.OFF();return w},applyChildrenResourceStyle:function(t,e,i,n){var d=null,f=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList(),p=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList().filter(function(t){return wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList().indexOf(t)==-1});if(bm.bmEditorManager.registedBoardEditor===!1){d=WVAdminResourceManager.getEmbededStyleObject(null,t)};var l=$(t).find(' > *').find('[data-wv-res-id]');if(l.length>0){var s,h=this,r,o,c=l.length;for(r=0;r<c;r++){o=l[r];s=$.trim($(o).attr('data-wv-res-id'));var a=WVAdminResourceManager.checkNewResourceId(o);if(a!=null){d.copyStyleBySelector('[data-wv-res-id="'+a.old+'"]','[data-wv-res-id="'+a.new+'"]');s=a.new};if($('#WEVEN_IFRAME')['length']>0&&isPrdDetailInfo!==!0&&wvAdminIFrameBridge['_WVHover'].isOn()){wvAdminIFrameBridge['_WVHover'].addHoverAttr($(o)[0])};h.applyResourceStyleExceptSize(o,s,e,d,!1,p,!0);h.mergeRule('[data-wv-res-id="'+s+'"]',e,f,undefined,undefined,undefined,!0);if(n){bm.removeInlineStyleProp(o,e);if(i){bm.removeInlineStyleProp($(o).find('> [data-wv-layout-element="block_inner"]'),e)}}}}},copyStyleBySelector:function(t,e){var p=['default','768','992','1200','1600'],s=this.getRulesBySelectorText(t,this.styleElement.sheet,!1,!0,p),r,l,d,h,n,c,f,a,o,i,u=s.length;for(o=0;o<u;o++){i=s[o];d=i.selectorText;n=i.cssText;r=n.indexOf('{');l=n.lastIndexOf('}');c=n.slice(r+1,l);h=d.replace(t,e);n=h+'{'+c+'}';a=i.parentRule?i.parentRule:i.parentStyleSheet;f=Array.prototype.indexOf.call(a.cssRules,i)+1;a.insertRule(n,f)}},insertStyleRule:function(t,e,i){if(i===undefined||i===null){i=this.styleElement.sheet};if(e===undefined||e===null){var o=i.cssRules.length;for(var n=0;n<o;n++){if(i.cssRules[n].type==CSSRule.MEDIA_RULE)break};e=n};i.insertRule(t,e);return i.cssRules[e]},deleteRule:function(t){this.styleElement.sheet.deleteRule(t);return this},refreshStyleElementText:function(){var t=bm.styleSheetManager.getCssTextByRule(this.styleElement.sheet.cssRules);this.styleElement.innerHTML=t},deleteRuleBySelector:function(t,e,i,n){var r=this;if(n===undefined){n=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList()}
else if(n.length===0){n=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList()};if(t.indexOf('hover')){t=t}
else if(t.indexOf('data-wv-res-id')===-1){t='[data-wv-res-id="'+t+'"]'};var l=this.getRulesBySelectorText(t,r.styleElement.sheet,e,i,n),s,o,a,d=l.length;for(s=0;s<d;s++){o=l[s];if(o.selectorText.indexOf(t)>-1){if(o.parentRule){a=Array.prototype.indexOf.call(o.parentRule.cssRules,o);if(a>-1)o.parentRule.deleteRule(a)}
else{a=Array.prototype.indexOf.call(r.styleElement.sheet.cssRules,o);if(a>-1)r.styleElement.sheet.deleteRule(a)}}}},deleteUnnecessaryMediaRules:function(t,e,n){if(!t&&!e){t='block'};if(!n){n=WVAdminTopBar.RESPONSIVE_CONDITION_LIST};if(bm.bmEditorManager.registedBoardEditor===!1){const cssSheet=e?e:WVAdminResourceManager.getEmbededStyleObject(null,null,t).styleElement.sheet;const cssRules=cssSheet.cssRules;for(let i=0;i<cssRules.length;i++){if(cssRules[i].conditionText){let check=!1;for(let j=0;j<n.length;j++){if(cssRules[i].conditionText.trim().includes(n[j])===!0){check=!0;break}};if(check===!1){cssSheet.removeRule(i);i--}}}}}};var ToolCompBase=function(){this.type;this.element;this.initStatus=0;this.status=0;this.compBtnList=[];this.innerWindow=window;this.init=function(){if($('#WEVEN_IFRAME').length>0){this.innerWindow=$('#WEVEN_IFRAME')[0].contentWindow};this.addBtn(this.element)};this.getCompValue=function(){let obj={};for(let i=0;i<this.compBtnList.length;i++){if(this.compBtnList[i].tagName!=='INPUT'){continue};const key=$(this.compBtnList[i]).attr('data-wv-tool-btn-prop');const value=this.compBtnList[i]['value'];obj[key]=value};console.log('값 획득: '+obj);return obj};this.onCompBtnClick=function(t){console.log('[22] ToolSetOpBase.js::onOptionBtnClick => ',_this.type,t)};this.active=function(t,e,i){this.status=1;this.onCompChange=i;this.openerBtn=t;this.activeAfter(e);this.registListener();this.reposition(t)};this.deactive=function(t){if(this.status==0)return;this.status=0;$(this.element).hide();this.deactiveAfter();this.removeListener()};this.addBtn=function(t){const _this=this;$(t).find('[data-wv-tool-component-btn]').each(function(){prop=$(this).attr('data-wv-tool-component-btn');if(!_this.compBtnList[prop]){_this.compBtnList.push(this)};_this.compBtnList[prop]=this})};this.registListener=function(){const _this=this;$(this.element).on('click',function(t){for(let i=0;i<bm.selectBoxList.length;i++){bm.selectBoxList[i].close(t)};t.stopPropagation()});$(this.compBtnList).on('click',function(t){t.stopPropagation();prop=$(this).attr('data-wv-tool-component-btn');if(this.tagName==='INPUT'){$(this).select();return!0};_this.onCompBtnClick(prop)});this.addEvent()};this.removeListener=function(){$(this.element).off('click');$(this.compBtnList).off('click');this.removeEvent()};this.addEvent=function(){};this.removeEvent=function(){};this.activeAfter=function(){};this.deactiveAfter=function(){};this.reposition=function(){}},ToolOpBase=function(){this.type;this.element;this.onOptionChange;this.initStatus=0;this.status=0;this.optionBtnList=[];this.componentList=[];this.innerWindow=window;var t=this;this.getOptionValue=function(){console.log('ToolSetOpBase.js::getOptionValue => 신규 재정의 필요함',t.type);return null};this.onOptionBtnClick=function(t){};this.inputNumUpDownHandler=function(t){var o=t.target,r=['ToolOpDomBackgroundVideo','ToolOpMotion','ToolOpScroll'],s=$(o).closest('[data-wv-tool-option]');if(s.length>0&&r.includes(s.attr('data-wv-tool-option')))return;var i=t.originalEvent.code?.toLowerCase(),e=o.value,a=e.length,n='';if(i&&(i==='arrowdown'||i==='arrowup')){if((e.includes('px')&&e.lastIndexOf('px')!==a-2)||(e.includes('%')&&e.lastIndexOf('%')!==a-1))return;if(e.includes('px'))n='px';if(e.includes('%'))n='%';e=parseInt(e);if(isNaN(e))return;switch(i){case'arrowdown':if(t.ctrlKey)e-=100;else if(t.shiftKey)e-=10;else e--;break;case'arrowup':if(t.ctrlKey)e+=100;else if(t.shiftKey)e+=10;else e++;break};if(e<0)e=0;o.value=e+n}}};ToolOpBase.prototype={init:function(t){if(this.initStatus==1)return;if(t&&t.isConnected===!0){this.element=t};if($('#WEVEN_IFRAME').length>0){this.innerWindow=$('#WEVEN_IFRAME')[0].contentWindow};var e,n=this;$(this.element).find('[data-wv-tool-option-btn]').each(function(){e=$(this).attr('data-wv-tool-option-btn');n.optionBtnList.push(this);n.optionBtnList[e]=this});var o=this.componentList.length;for(i=0;i<o;i++){this.componentList[i].init()};this.initStatus=1},addComponent:function(t,e,i){if(e){this.componentList[e]=t};if(i){this.componentList[e]['toolOp']=i};if(!this.componentList){this.componentList=[]};this.componentList.push(t)},showComponent:function(t,e,i){this.activeComponent=t;$(t.element).show();if(this.onComponentShow)this.onComponentShow(e,t,i);var n=this;t.active(e,i,function(){n.onCompChange.apply(n,arguments)})},onComponentShow:function(t,e){},hideComponent:function(t,e){this.activeComponent=null;$(t.element).hide();t.deactive();if(this.onComponentHide)this.onComponentHide(e,t)},onComponentHide:function(t,e){},hideComponentAll:function(t){var i;for(var e=0;e<this.componentList.length;e++){i=this.componentList[e];i.deactive(t)}},active:function(t,e){if(this.status==1)return;this.status=1;this.onOptionChange=e;this.openerBtn=t;$(t).append(this.element);var r=$(t).parents('.toolset_bottom_con').length>0?!0:!1,d=$(this.innerWindow.document).find(t).length>0?!0:!1,h=r?parseInt($(this.element).css('marginLeft')):parseInt($(this.element).css('marginRight')),a;if(bm.bmEditorManager.registedBoardEditor){a=$(t).parents('.toolset_bottom_con').width()}
else if(d){a=$(this.innerWindow.document.body).width()}
else{a=wvAdminIFrameBridge.contentSizeCon.width()};var l=a,s=Math.ceil($(this.element).show().offset().left)+h;if(bm.bmEditorManager.registedBoardEditor){s-=$(t).parents('.toolset_bottom_con').offset().left};if(!r){s+=$(this.element)[0].offsetWidth};var i=s-l;if(r){if(i>0){$(this.element).css('marginLeft',-1*i)}
else{var n=parseInt($(this.element).css('marginLeft')),o=Math.min(0,(i*-1)+n);if(n!=0&&o<=0){$(this.element).css('marginLeft',o)}}}
else{if(i>0){$(this.element).css('marginRight',i)}
else{var n=parseInt($(this.element).css('marginRight')),o=Math.max(0,i+n);if(n!=0&&o>=0){$(this.element).css('marginRight',o)}}};this.registListener();this.show()},deactive:function(){if(this.status==0)return;this.hide();this.status=0;this.removeListener();$(this.element).hide()},onCompChange:function(t,e){},setStyleOpt:function(t){const componentList=this.componentList;for(let i=0;i<componentList.length;i++){componentList[i].setStyleComp(t,null)}},show:function(){},hide:function(){},closeOption:function(){events(this).dispatch('toolSetOptionCloseCall')},registListener:function(){var e=this,t;$(this.element).on('click',function(t){t.stopImmediatePropagation()});$(this.element).find('input[type=text]').on('keydown',this.inputNumUpDownHandler);$(this.optionBtnList).on('click',function(i){i.stopPropagation();t=$(this).attr('data-wv-tool-option-btn');if(this.tagName==='INPUT'){$(this).select()};e.onOptionBtnClick(t)});this.registListenerForComp();this.addEvent()},registListenerForComp:function(t){const _this=this;if(!t){t=this.optionBtnList};$(t).on('click',function(t){t.stopPropagation();let prop=$(this).attr('data-wv-tool-option-btn');let component;if(!prop){if(_this.componentList.length>0){component=_this.componentList[0]}}
else{if(_this.componentList[prop]){component=_this.componentList[prop]}};if(component){if(component.status==1){_this.hideComponent(component,this)}
else{if(this==_this.focusBtn){_this.hideOption(component,this)}
else{_this.showComponent(component,this)}}}
else{console.log('컴포넌트가 없습니다.')}})},removeListenerForComp:function(t){const _this=this;if(!t){t=this.optionBtnList};$(t).off('click')},addEvent:function(){},removeListener:function(){$(this.element).off();$(this.element).find('input[type=text]').off('keydown',this.inputNumUpDownHandler);$(this.optionBtnList).off();this.removeEvent();this.removeListenerForComp()},removeEvent:function(){},reset:function(){},destroy:function(){}};const ToolOpColorPicker=function(t,e){this.toolbtn=t;this.btnType=e;this.type='ToolOpColorPicker';this.element=$('#toolOpColorPicker');this.tabList=['custom','libraries'];this.gradationValue='linear-gradient(90deg, RGBA(0, 0, 0, 100%), RGBA(255, 255, 255, 100%))';if(isExpertMode===!0){let type;switch(e){case'ToolBtnDomBackgroundBorder':case'ToolOpTableBorder':case'ToolBtnTableBorder':case'ToolBtnLine':type='border-color';break;case'ToolBtnDomBackground':case'ToolBtnDomBackgroundVideo':case'ToolBtnDomBackgroundDim':case'ToolBtnTableBackground':case'ToolBtnDomBackgroundDim':type='background-color';break;case'ToolBtnTextColor':case'ToolBtnDomBoxShadow':case'ToolBtnTextShadow':case'ToolBtnSvg':type='color';break};this.localStyleMng=new WVLocalStyleListMng('color',this);this.addComponent(new WVLocalStyle('color',this),'WVLocalStyle',this)};var s=bm.cookie.getCookie('usedColorList');if(s.length==0||s==undefined||s==''){this.selectedColorList=[]}
else{this.selectedColorList=s.split(',')};var c=$(this.element).find('.recent_color > .color_code > .color_code_sample');for(var i=0;i<this.selectedColorList.length;i++){$(c[i]).css({'background-color':this.selectedColorList[i]});$(c[i]).attr('title',this.selectedColorList[i])};var g=loginSessionInfo.id+'_savedColorList',a=bm.cookie.getCookie(g);if(a.length==0||a==undefined||a==''){this.savedColorList=[]}
else{this.savedColorList=a.split('/')};var h=$(this.element).find('.my_saved_color > .color_code > .color_code_sample');for(var i=0;i<this.savedColorList.length;i++){this.savedColorList[i]=this.savedColorList[i].toLowerCase();$(h[i]).css({'background-color':this.savedColorList[i]});$(h[i]).attr('title',this.savedColorList[i])};this.cssPointColors=['#453fe8','#5bcdff','#75fcff'];this.defaultPointClassList=['.point','.bg_point','.svg_point','.stroke_point','.border_point','.before_point','.before_bg_point','.checked_before_bg_point','.after_point','.after_bg_point','.swiper_pagi_bg_point'];this.webPointClassList=['.h_point','.bg_h_point','.svg_h_point','.border_h_point'];var u='theme-common';if(typeof WVAdminResourceManager!=='undefined'){var l=WVAdminResourceManager.getEmbededStyleObject(u)};if(l&&l.styleElement.innerText!=''){for(var i=0;i<3;i++){var f=this.defaultPointClassList[0]+''+i,p=l.getRulesBySelectorText(f,null,!0,!0,null),o=p[0].style.color;if(o&&o!=''){var r;if(o.indexOf('rgb')>-1){o=o.replace('rgb','');r=bm.number.rgbToHex(o)}
else{r=o};this.cssPointColors[i]=r}}};if(typeof WVAdminResourceManager==='undefined'){$(this.element).find('.point_color_list_con').hide()};var d=$(this.element).find('.point_color_list_con .point_color_list_item');for(var i=0;i<3;i++){$(d[i]).find('input.point_color_code_input').val(this.cssPointColors[i]);$(d[i]).find('.point_color_option_prev').css({'background-color':this.cssPointColors[i]})};this.onWindowDown=function(t){bm.selectionManager.restoreRange()};this.onTextInputDown=function(t){t.stopImmediatePropagation();bm.selectionManager.saveRange()};this.setInputColorCode=function(t){if(t==''){t='#000000'};$(this.element).find('input.color_code_input').val(t.toUpperCase().replaceAll('#',''));this.changeCurrentActiveColor(t)};this.setRgbToHex=function(t){if(t===!0){this.setInputColorCode('')}
else{var e=$(this.element).find('input.color_input.red').val(),i=$(this.element).find('input.color_input.green').val(),n=$(this.element).find('input.color_input.blue').val();e=bm.number.hex(e);i=bm.number.hex(i);n=bm.number.hex(n);this.setInputColorCode('#'+e+i+n)}};this.setRgbaValue=function(t,e,i,n){if(isExpertMode){let hex=bm['number'].rgbToHex('rgba('+t+','+e+','+i+','+n+')');$(this.element).find('input.color_code_input').val(hex.toUpperCase().replaceAll('#',''));$(this.element).find('input.color_picker_btn').val(bm['number'].rgbToHex('rgba('+t+','+e+','+i+','+n+')'));$(this.element).find('input.color_input.opacity').val((Number(n)*100)+'%')}
else{if(!t){$(this.element).find('input.color_input.red').val();$(this.element).find('input.color_input.green').val();$(this.element).find('input.color_input.blue').val();$(this.element).find('input.color_input.opacity').val();if(isExpertMode){$(this.element).find('input.color_code_input').val('000000');$(this.element).find('input.color_picker_btn').val('#000000');$(this.element).find('input.color_input.opacity').val('100%')}}
else{$(this.element).find('input.color_input.red').val(t);$(this.element).find('input.color_input.green').val(e);$(this.element).find('input.color_input.blue').val(i);$(this.element).find('input.color_input.opacity').val((Number(n)*100)+'%')}}};this.setPointClass=function(t){$(this.element).find('.point_color_list_item input[name="color_type"]').prop('checked',!1);if(t>-1){$(this.element).find('.point_color_list_item input[name="color_type"]').eq(t).prop('checked',!0)}
else{}};this.setGradtionValue=function(t,e,i){$(this.element).find('[data-wv-tool-option-btn="gradation_degree"]').val(t?t:180);$(this.element).find('[data-wv-tool-option-btn="first_gradation_color"]').val(bm.number.rgbToHex(e));$(this.element).find('[data-wv-tool-option-btn="second_gradation_color"]').val(bm.number.rgbToHex(i));$(this.element).find('[data-wv-tool-option-btn="first_gradation_opacity"]').val(bm.number.rgbaToObj(e).a);$(this.element).find('[data-wv-tool-option-btn="second_gradation_opacity"]').val(bm.number.rgbaToObj(i).a);this.setGradationBar('linear-gradient('+(t?t+'deg, ':'')+e+', '+i+')')};this.changeCurrentActiveColor=function(t){if(!t){t=$(this.element).find('.color_code_input').val();t=t||'#000000'};$(this.element).find('.color_option_prev').css('background-color','#'+t.replaceAll('#',''))};var n=this;this.applyColor=function(t,e){var i=$(this.element).find('.list_con .color_code');i.removeClass('on');var t=t?t:$(n.element).find('.color_code_input').val();if(bm.number.isHex(t)==!1){bm.toast('올바른 색상코드를 입력해주세요!');return!1};if(n.selectedColorList.indexOf(t)>-1){n.selectedColorList.splice(n.selectedColorList.indexOf(t),1)}
else if(n.selectedColorList.length>=10){n.selectedColorList.pop()};if(t)this.selectedValue='#'+t.replaceAll('#','');n.addUserColor();$(n.element).find('.color_code_input').val(t.toUpperCase().replaceAll('#',''));if(e===!0){$(this.element).find('input.color_picker_btn').val('#'+t.replaceAll('#',''))}};this.changePointcolor=function(t){var m='point'+t,u=$(this.element).find('.point_color_list_con .point_color_list_item').eq(t),l=$(u).find('input.point_color_code_input').val();$(u).find('.point_color_option_prev').css({'background-color':l});var f='theme-common',p=WVAdminResourceManager.getEmbededStyleObject(f),d=$(wvAdminIFrameBridge._WVContentArea.innerWindow.document);for(var o=0;o<this.defaultPointClassList.length;o++){var s=this.defaultPointClassList[o]+''+t,a=p.getRulesBySelectorText(s,null,!1,!0,null);if(a.length===0){d.find('[data-theme-common-css]').append(''+s+' .swiper-pagination-bullet{background-color: '+l+' !important;}')};for(var e=0;e<a.length;e++){for(var n=0;n<a[e].style.length;n++){var i=a[e].style[n];i=bm.string.toUnitFromUpperCase(i,'-');a[e].style.setProperty(i,l,'important')}}};for(var o=0;o<this.webPointClassList.length;o++){var s=this.webPointClassList[o]+''+t,r=p.getRulesBySelectorText(s,null,!0,!0,['992']);for(var e=0;e<r.length;e++){for(var n=0;n<r[e].style.length;n++){var i=r[e].style[n];i=bm.string.toUnitFromUpperCase(i,'-');r[e].style.setProperty(i,l,'important')}}};d.find('[data-theme-common-css]').html(WVAdminResourceManager.applyMergedCssToStyleObject(f,!0));var g=d.find('[data-theme-common-css]').html();if(wvAdminIFrameBridge.previewMode){var h=WEB_ROOT+'saveThemeTemplateCommonCss',c=getThemeId()}
else{var h=WEB_ROOT+'saveUserThemeCommonCss',c=SITE_ID};bm.httpSend(h,{template_id:c,themeCommonCss:JSON.stringify(g)},function(t){if(t.result==!0){}
else{alert(t.message)}},'json','post')};this.setGradationColor=function(t,e,i,n,o){if(n&&o){var s='RGBA('+n.r+', '+n.g+', '+n.b+', '+e+')',r='RGBA('+o.r+', '+o.g+', '+o.b+', '+i+')',a='linear-gradient('+t+'deg, '+s+', '+r+')';this.setGradationBar(a);this.gradationValue=a}};this.setGradationBar=function(t){this.element.find('.gradation_bar').css({backgroundImage:t})};this.gradationColorApply=function(){bm.selectionManager.restoreRange();$(this.element).find('#gradation_menu_checkbox').prop('checked',!0);if(n.onOptionChange&&n.gradationValue.includes('gradient')){n.onOptionChange('ToolOpColorPicker',n.gradationValue)}
else{bm.toast('배경그라데이션을 설정해주세요.');return!1}};this.onComponentShow=function(t,e,i){i=i?i:$(t).attr('data-wv-tool-btn-prop');let mode;if(i.includes('edit')===!0){mode='edit'}
else{mode='add'};e['mode']=mode};this.onCompChange=function(t,e,i,n){switch(e){case'create':this.localStyleMng.addList(t,e,i,n);break;case'edit':this.localStyleMng.editList(t,e,i,n);break}}};bm.extend(ToolOpBase,ToolOpColorPicker);ToolOpColorPicker.instance=null;ToolOpColorPicker.get=function(t,e){if(ToolOpColorPicker.instance==null){ToolOpColorPicker.instance=new ToolOpColorPicker(t,e)};return ToolOpColorPicker.instance};ToolOpColorPicker.prototype.setStyleValue=function(t,e,i,n,o,a,s,r,l){var d=this;if(s&&r){this.setGradtionValue(a,s,r);$(this.element).find('input#gradation_menu_checkbox').prop('checked',!0)}
else{$(this.element).find('input#color').prop('checked',!0)};if(l===!0){this.setRgbaValue(null,null,null,null);this.setRgbToHex(!0)}
else{this.setRgbaValue(t,e,i,n);if(isExpertMode!==!0){this.setRgbToHex()}};this.changeCurrentActiveColor();this.setPointClass(o)};ToolOpColorPicker.prototype.registListener=function(){var t=this;const tabList=$(this.element).find('[colorpickertab]');var e=$(this.element).find('.list_con .color_code');this.changeCurrentActiveColor();$(this.element).on('focus','input.color_input',function(t){$(this).select()});$(this.element).on('focusout','input.color_input.rgb_code',function(e){t.setRgbToHex()});$(this.element).on('focusout','input.color_input.opacity',function(t){});$(this.element).off('click').on('click',function(t){t.stopImmediatePropagation()});if(isExpertMode){$(this.element).find('input.color_picker_btn').off('change').on('change',function(e){var i=this['value'];t.applyColor(i,!1);if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker',i,null,t.openerBtn)}})};tabList.on('click',function(e){if($(e.target).attr('onclick')!=='return false'){e.stopImmediatePropagation();$(this).siblings().removeClass('active');$(this).addClass('active');const targetCon=$(t.element).find('[colorpickercontent="'+$(this).attr('colorpickertab')+'"]');$(targetCon).siblings().removeClass('active');$(targetCon).addClass('active')}});e.on('click',function(e){e.stopImmediatePropagation();var n=$(this).find('.color_code_sample').css('background-color');if(t.selectedValue!=n){var i=bm.number.rgbaToObj(n);t.setStyleValue(i.r,i.g,i.b,i.a);t.selectedValue=bm.number.rgbToHex(n)};if($($(this).closest('ul')[0]).hasClass('my_saved_color')){$(t.element).find('a.delete_saved_color').show()}
else{$(t.element).find('a.delete_saved_color').hide()};t.applyColor(null,!0);if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker',t.selectedValue,!0,t.openerBtn)}});$(this.element).find('input[name="color_type"]').on('change',function(e){if($('input[name="color_type"]:checked').length>0){$(t.element).find('.color_code').removeClass('on')};$(t.element).find('input[name="color_type"]').prop('checked',!1);$(this).prop('checked',!0);if($(this).attr('id')==='color'){t.applyColor();if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker',t.selectedValue)}}
else if($(this).attr('id')==='gradation_menu_checkbox'){t.gradationColorApply()}
else if($(this).attr('id')==='point0'){e.stopImmediatePropagation();bm.selectionManager.restoreRange();var i=$(t.element).find('.point_color_list_item input[name="color_type"]').index($(t.element).find('input[name="color_type"]:checked'));if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker','applyPoint'+i)}}});$(this.element).find('.delete_saved_color').on('click',function(e){t.removeUserSavedColor(t.selectedValue)});$(this.element).find('.remove_color').on('click',function(i){i.stopImmediatePropagation();e.removeClass('on');$('input[name="color_type"]').prop('checked',!1);var n='transparent';if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker',n)}});$(this.element).find('.apply_color').on('click',function(e){e.stopImmediatePropagation();if($(t.element).find('input[name="color_type"]:checked').length>0){var i=$(t.element).find('.point_color_list_item input[name="color_type"]').index($(t.element).find('input[name="color_type"]:checked'));if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker','applyPoint'+i)}}
else{t.applyColor();if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker',t.selectedValue)}}});$(this.element).find('.save_my_color').on('click',function(e){e.stopImmediatePropagation();t.addUserSavedColor()});$(this.element).find('.point_color_code_input').on('keydown',function(e){if(e.keyCode==13){e.stopImmediatePropagation();var i=$(t.element).find('.point_color_code_input').index(this);t.changePointcolor(i)}});$(this.element).find('.color_code_input').on('keydown',function(e){var i=$(t.element).find('.color_code_input').val();i='#'+i.replaceAll('#','');$(t.element).find('.color_code_input').val(i.toUpperCase().replaceAll('#',''));if(e.keyCode==13){e.preventDefault();if(bm.number.isHex(i)==!1){bm.toast('올바른 색상코드를 입력해주세요!');return!1};t.selectedValue=i;t.addUserColor();bm.selectionManager.restoreRange();if(t.onOptionChange){t.onOptionChange('ToolOpColorPicker',i)}}});$(this.element).find('.color_code_input').on('keyup',function(e){t.changeCurrentActiveColor();var i=bm.number.hexToRgb($(t.element).find('.color_code_input').val());if(i){$(t.element).find('.color_input.rgb_code.red').val(i.r);$(t.element).find('.color_input.rgb_code.green').val(i.g);$(t.element).find('.color_input.rgb_code.blue').val(i.b)}});$(this.element).find('.color_input').on('keydown',function(e){if(e.keyCode===13){e.preventDefault();bm.selectionManager.restoreRange();if(t.onOptionChange){if(isExpertMode){var o=$(t.element).find('.color_code_input').val();const opacityInput=t.element.find('.color_input.opacity')[0];var i=bm.number.hexToRgb(o);if(opacityInput.value.indexOf('%')===-1&&!bm.valid.isOnlyNum(opacityInput.value)||!/^\d+(%{0,1})$/.test(opacityInput.value)){bm.toast('숫자를 입력해주세요.');return!1};i['a']=parseFloat(opacityInput.value)>100?1:parseFloat(opacityInput.value)/100;t.element.find('.color_input.opacity').val(i['a']*100+'%');t.onOptionChange('ToolOpColorPicker',i,null,t.openerBtn)}
else{t.onOptionChange('ToolOpColorPicker',$(t.element).find('.color_code_input').val(),null,t.openerBtn)};$(t.element).find('#color').prop('checked',!0)}}
else{if($(this).hasClass('opacity')){t.inputNumUpDownHandler(e);var n=parseInt($(this).val());if(n>100)$(this).val(100);else if(n<0)$(this).val(0)}}});$(window).on('mousedown',this.onWindowDown);$(this.element).find('.color_code_input').on('mousedown',this.onTextInputDown);$(this.element).find('#gradation_menu input[type="text"]').on('keyup',function(e){var o=$(t.optionBtnList['gradation_degree']).val(),a=(100-Number($(t.optionBtnList['first_gradation_opacity']).val()))/100,s=(100-Number($(t.optionBtnList['second_gradation_opacity']).val()))/100,i=bm.number.hexToRgb($(t.optionBtnList['first_gradation_color']).val()),n=bm.number.hexToRgb($(t.optionBtnList['second_gradation_color']).val());if(i!==null&&n!==null){t.setGradationColor(o,a,s,i,n)}});$(t.element).find('input[name="gradationDegree"]').on('click',function(){$(this).select()});$(t.element).find('input[name="gradationColor"]').on('click',function(){$(this).select()});$(t.element).find('input[name="gradationOpacity"]').on('click',function(){$(this).select()});$(this.element).find('input[name="gradationColor"]').on('focusout',function(){var t=$(this).val();if(t.length>=7){if(bm.number.isHex(t)==!1){$(this).focus();$(this).val('#000000');$(this).select();bm.toast('Hex코드를 입력해주세요.');return!1}}});$(this.element).find('input[name="gradationDegree"]').on('keydown',function(e){var i=Number($(this).val());if(e.keyCode===13){e.preventDefault();bm.selectionManager.restoreRange();if(bm.valid.isOnlyNum(i)){if(i>360){$(this).val(90);bm.toast('각도는 -360도에서 360도까지 가능합니다.');$(this).select();return!1}}
else if(i<0){if(i<-360){$(this).val(90);$(this).select();bm.toast('각도는 -360도에서 360도까지 가능합니다.');return!1}}
else{$(this).focus();$(this).val(90);$(this).select();bm.toast('숫자를 입력해주세요.');return!1};t.gradationColorApply()}
else{t.inputNumUpDownHandler(e);if(i>360)$(this).val(360);else if(i<-360)$(this).val(-360)}});$(this.element).find('input[name="gradationOpacity"]').on('keydown',function(e){var i=Number($(this).val());if(e.keyCode===13){e.preventDefault();bm.selectionManager.restoreRange();if(bm.valid.isOnlyNum(i)){if(i<0||i>100){$(this).val(0);$(this).select();bm.toast('투명도는 0에서 100까지 가능합니다.');return!1}}
else{$(this).focus();$(this).val(0);$(this).select();bm.toast('숫자를 입력해주세요.');return!1};t.gradationColorApply()}
else{t.inputNumUpDownHandler(e);if(i>100)$(this).val(100);else if(i<0)$(this).val(0)}});this.registListenerForComp()};ToolOpColorPicker.prototype.addUserColor=function(){this.selectedColorList.unshift(this.selectedValue);bm.cookie.setCookie('usedColorList',this.selectedColorList,7);var i=this.selectedColorList.length,e=$(this.element).find('.recent_color > .color_code > .color_code_sample');for(var t=0;t<i;t++){$(e[t]).css({'background-color':this.selectedColorList[t]});$(e[t]).attr('title',this.selectedColorList[t])}};ToolOpColorPicker.prototype.addUserSavedColor=function(){var r=loginSessionInfo.id+'_savedColorList',e=$(this.element).find('input.color_code_input').val(),i=bm.number.hexToRgb(e),l=$(this.element).find('input.color_input.opacity').val(),d=l.replace('%',''),a=parseFloat(d)/100,h=a==1?e:'rgba('+i.r+', '+i.g+', '+i.b+', '+a+')';if(bm.number.isHex(e)==!1){bm.toast('올바른 색상코드를 입력해주세요!');return!1};this.savedColorList.unshift(h);if(loginSessionInfo.seq==='-1'){var o=365}
else{var o=7};this.savedColorListStr=this.savedColorList.join('/');bm.cookie.setCookie(r,this.savedColorListStr,o);var s=this.savedColorList.length,n=$(this.element).find('.my_saved_color > .color_code > .color_code_sample');for(var t=0;t<s;t++){$(n[t]).css({'background-color':this.savedColorList[t]});$(n[t]).attr('title',this.savedColorList[t])}};ToolOpColorPicker.prototype.removeUserSavedColor=function(t){var o=t.toLowerCase();if(this.savedColorList.indexOf(o)>-1){var r=this.savedColorList.indexOf(o);this.savedColorList.splice(r,1)};var s=loginSessionInfo.id+'_savedColorList';if(loginSessionInfo.seq==='-1'){var n=365}
else{var n=7};bm.cookie.setCookie(s,this.savedColorList,n);$(this.element).find('.my_saved_color > .color_code > .color_code_sample').css('background-color','#fff');var a=this.savedColorList.length,i=$(this.element).find('.my_saved_color > .color_code > .color_code_sample');for(var e=0;e<a;e++){$(i[e]).css({'background-color':this.savedColorList[e]});$(i[e]).attr('title',this.savedColorList[e])}};ToolOpColorPicker.prototype.removeListener=function(){$(this.element).find('.color_input.opacity').off('keydown');$(this.element).find('input').off('focus');$(this.element).find('input').off('focusin');$(this.element).find('input').off('focusout');$(this.element).find('input').off('change');$(this.element).off('click');$(this.element).find('#gradation_menu input[type="text"]').off('keyup');$(this.element).find('input[name="gradationDegree"]').off('keydown');$(this.element).find('input[name="gradationDegree"]').off('keydown');bm.selectionManager.restoreRange();var t=$(this.element).find('.list_con .color_code');t.off();$(this.element).find('.color_code_input').off();$(this.element).find('.remove_color').off();$(this.element).find('.apply_color').off();$(this.element).find('input[name="color_type"]').off();$(this.optionBtnList).off('click');$(window).off('mousedown',this.onWindowDown);this.removeListenerForComp()};ToolOpColorPicker.prototype.registListenerForComp=function(t){const _this=this;if(!t){t=this.optionBtnList.filter(nd=>$(nd).attr('data-wv-tool-btn-prop')!=='delete_local_style')};$(t).on('click',function(t){if($(t.target).attr('onclick')!=='return false'){t.stopPropagation();let prop=$(this).attr('data-wv-tool-option-btn');let component;if(!prop){if(_this.componentList.length>0){component=_this.componentList[0]}}
else{if(_this.componentList[prop]){component=_this.componentList[prop]}};if(component){if(component.status==1&&(($(this).attr('data-wv-tool-btn-prop').includes('edit')===!0&&component['mode']==='edit'&&_this.comOpenerBtn===this)||($(this).attr('data-wv-tool-btn-prop').includes('add')===!0&&component['mode']==='add'))){_this.hideComponent(component,this)}
else{if(this==_this.focusBtn){_this.hideOption(component,this)}
else{_this.comOpenerBtn=this;_this.showComponent(component,this)}}}
else{console.log('컴포넌트가 없습니다.')}}})};var ToolOpTextPicker=function(t){this.toolbtn=t;this.type='ToolOpTextPicker';this.element=$('#toolOpTextPicker');if(isExpertMode===!0){const type='font';this.localStyleMng=new WVLocalStyleListMng(type,this);this.addComponent(new WVLocalStyle(type,this),'WVLocalStyle',this)};this.onWindowDown=function(t){bm.selectionManager.restoreRange()};this.onComponentShow=function(t,e){let prop=$(t).attr('data-wv-tool-btn-prop');let type=e.toolOp.toolbtn.type;let mode,mode_type;switch(prop){case'edit_local_style':mode='edit';break;case'add_local_style':mode='add';break};switch(type){case'ToolBtnDomBackground':mode_type='color';break};e['mode']=mode;e['mode_type']=mode_type};this.onCompChange=function(t,e,i,n){switch(e){case'create':this.localStyleMng.addList(t,e,i,n);break;case'edit':this.localStyleMng.editList(t,e,i,n);break}}};bm.extend(ToolOpBase,ToolOpTextPicker);ToolOpTextPicker.prototype.registListener=function(){$(this.element).off('click').on('click',function(t){t.stopImmediatePropagation()});this.registListenerForComp()};ToolOpTextPicker.prototype.removeListener=function(){bm.selectionManager.restoreRange();$(window).off('mousedown',this.onWindowDown);this.removeListenerForComp()};ToolOpTextPicker.prototype.registListenerForComp=function(t){const _this=this;if(!t){t=this.optionBtnList.filter(nd=>$(nd).attr('data-wv-tool-btn-prop')!=='delete_local_style')};$(t).on('click',function(t){if($(t.target).attr('onclick')!=='return false'){t.stopPropagation();let prop=$(this).attr('data-wv-tool-option-btn');let component;if(!prop){if(_this.componentList.length>0){component=_this.componentList[0]}}
else{if(_this.componentList[prop]){component=_this.componentList[prop]}};if(component){if(component.status==1&&(($(this).attr('data-wv-tool-btn-prop').includes('edit')===!0&&component['mode']==='edit'&&_this.comOpenerBtn===this)||($(this).attr('data-wv-tool-btn-prop').includes('add')===!0&&component['mode']==='add'))){_this.hideComponent(component,this)}
else{if(this==_this.focusBtn){_this.hideOption(component,this)}
else{_this.comOpenerBtn=this;_this.showComponent(component,this)}}}
else{console.log('컴포넌트가 없습니다.')}}})};var ToolOpMotion=function(){var t=this;this.type='ToolOpMotion';this.element=$('[data-wv-tool-option=ToolOpMotion]');this.duration=0.4;this.delay=0.2;this.motionType='';this.onOptionBtnClick=function(t){switch(t){case'applyDelay':this.setDelay();break;case'applyDuration':this.setDuration();break}};this.setDelay=function(){this.delay=this.element.find('[name="motion_delay"]').val();this.setMotion()};this.setDuration=function(){this.duration=this.element.find('[name="motion_duration"]').val();this.setMotion()};this.setMotion=function(){this.duration=this.element.find('[name="motion_duration"]').val();this.delay=this.element.find('[name="motion_delay"]').val();var t=$(this.element).find('.motion_type_con .motion_type.active');this.motionType='';if(!this.motionType&&t.length===0){bm.toast('종류를 선택해주세요.','등장모션');return};if(!this.delay){this.delay=0.2};if(!this.duration){this.duration=0.4};if(t.length>0){this.motionType=t.attr('tool-motion-type')};var e={type:this.motionType,duration:this.duration*1000,delay:this.delay*1000,easing:'ease-in-cubic'};this.onOptionChange(this.type,e)}};bm.extend(ToolOpBase,ToolOpMotion);ToolOpMotion.prototype.addEvent=function(){var t=this;$(this.element).find('.option_input_style_0').on('focusout',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=$.trim(t);if(isNaN(t))t='';$(this).val(t)}});$(this.element).find('.option_input_style_0').on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=''};$(this).val(t);$(this).select()});$(this.element).find('input[name="motion_duration"]').on('keyup',function(t){var e=$(this).val();if(bm.valid.isOnlyNumDot(e)){if(e>3){$(this).val(3);bm.toast('진행시간은 최대 3초입니다.','등장모션');return};if(e<0){$(this).val(0);bm.toast('진행시간은 최소 0초입니다.','등장모션');return}}
else{$(this).focus();$(this).val(0.4);bm.toast('숫자를 입력해주세요.','등장모션');return}});$(this.element).find('input[name="motion_delay"]').on('keyup',function(t){var e=$(this).val();if(bm.valid.isOnlyNumDot(e)){if(e>3){$(this).val(3);bm.toast('지연시간은 최대 3초입니다.','등장모션');return};if(e<0){$(this).val(0);bm.toast('지연시간은 최소 0초입니다.','등장모션');return}}
else{$(this).focus();$(this).val(0.2);bm.toast('숫자를 입력해주세요.','등장모션');return}});$(this.element).find('.motion_type_con .motion_type').on('click',function(){if($(this).hasClass('active')){t.onOptionChange('delete')}
else{var e=$(this).attr('tool-motion-type'),i=$(t.element).find('.motion_type_con .motion_type');i.removeClass('active');$(this).addClass('active');t.motionType=e;t.setMotion()}})};ToolOpMotion.prototype.removeEvent=function(){var t=this;$(this.element).find('.option_input_style_0').off('focusout');$(this.element).find('.option_input_style_0').off('focus')};var ToolOpScroll=function(){var t=this;this.type='ToolOpScroll';this.element=$('[data-wv-tool-option=ToolOpScroll]');this.duration=0.3;this.easing='linear';this.onOptionBtnClick=function(t){switch(t){case'apply':this.setDuration();break;case'applyScrollDuration':this.setDuration();break;case'delete':this.onOptionChange(t);break}};this.setDuration=function(){this.duration=this.element.find('[name="scroll_duration"]').val();this.easing=this.element.find('[name="scroll_easing"]').val()?this.element.find('[name="scroll_easing"]').val():this.easing;this.setMotion()};this.setMotion=function(){this.duration=this.duration?this.duration:this.element.find('[name="scroll_duration"]').val();if(!this.duration){this.duration=0.3};var t={duration:this.duration*1000,easing:this.easing};this.onOptionChange(this.type,t)}};bm.extend(ToolOpBase,ToolOpScroll);ToolOpScroll.prototype.addEvent=function(){var t=this;$(this.element).find('.option_input_style_0').on('focusout',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=$.trim(t);if(isNaN(t))t='';$(this).val(t)}});$(this.element).find('.option_input_style_0').on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=''};$(this).val(t);$(this).select()});$(this.element).find('input[name="scroll_duration"]').on('keyup',function(t){var e=$(this).val();if(bm.valid.isOnlyNumDot(e)){if(e>3){$(this).val(3);bm.toast('진행시간은 최대 3초입니다.','등장모션');return};if(e<0){$(this).val(0);bm.toast('진행시간은 최소 0초입니다.','등장모션');return}}
else{$(this).focus();$(this).val(0.3);bm.toast('숫자를 입력해주세요.','등장모션');return}})};ToolOpScroll.prototype.removeEvent=function(){var t=this;$(this.element).find('.option_input_style_0').off('focusout');$(this.element).find('.option_input_style_0').off('focus')};var ToolOpSwiperPagination=function(){this.type='ToolOpSwiperPagination';this.element=$('[data-wv-tool-option=ToolOpSwiperPagination]');this.colorPicker=ToolOpColorPicker.get();this.PaginationColor;var t=this;this.onOptionBtnClick=function(t){switch(t){case'paginationColor':this.showColorPicker();break}};this.showColorPicker=function(){if(this.colorPicker.status===1){t.colorPicker.deactive()}
else if(this.colorPicker.status===0){$(t.colorPicker.element).find('.option_row.line').hide();$(t.colorPicker.element).find('#gradation_menu').hide();this.colorPicker.active($(this.element).closest('[data-wv-tool-btn="ToolBtnSwiperPagination"]')[0],function(e,i){t.setPaginationColor(i);t.hideColorPicker()});this.colorPicker.element.show()}};this.hideColorPicker=function(){t.colorPicker.hide();t.colorPicker.deactive()};this.getCurrentPaginationStyle=function(t){var r=this,s;if(bm.bmEditorManager.registedBoardEditor===!1){s=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};var o;if($(t).closest('[data-wv-layout-element-type="shop_list"]').length>0){o='[data-wv-res-id="'+$(t).closest('[data-wv-layout-element="block"] [data-wv-design-area]').attr('data-wv-res-id')+'"] .swiper-pagination > span'}
else{o='[data-wv-res-id="'+$(t).closest('[data-wv-layout-element="block"]').attr('data-wv-res-id')+'"] [data-wv-swiper-pagination] > span'};var a=s.getRulesBySelectorText(o,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),i=['width','height','opacity','backgroundColor'],n={'width':undefined,'height':undefined,'opacity':undefined,'backgroundColor':undefined,};var e=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':e=0;break;case'768':e=1;break;case'992':e=2;break;case'1200':e=3;break;case'1600':e=4;break}
while(e>=0){for(let j=0;j<i.length;j++){if(a[e].style[i[j]]&&n[i[j]]===undefined){n[i[j]]=a[e].style[i[j]]}};e--};if($(t).closest('[data-wv-layout-element="block"]').hasClass('swiper_pagi_bg_point0')){n.backgroundColor=bm.getStyle($(t).children(),'background-color')};return n};this.setPaginationColor=function(e){this.PaginationColor=e;$(this.element).find('.choice_color').css({'background-color':e});if(e){if(e.indexOf('applyPoint')>-1){var i=e.replace('applyPoint','');this.pointIndex=i;e=this.colorPicker.cssPointColors[i];var n=$(this.colorPicker.element).find('.point_color_option_prev').css('background-color');$(this.element).find('.choice_color').css({backgroundColor:n})}
else{this.pointIndex=-1};t.Apply()}};this.getPaginationColor=function(){return $(this.element).find('.choice_color').css('background-color')};this.getPaginationWidth=function(){var t=parseInt($(this.element).find('[data-wv-tool-option-btn="paginationWidth"]').val());if(!t||isNaN(t))return 0;else return t};this.getPaginationOpacity=function(){return $(this.element).find('[data-wv-tool-option-btn="paginationOpacity"]').val()};this.controlByKeyDown=function(t,e){var i=Number($(t.target).val());if(e==='integer'){if(!($(t.target).val())){$(t.target).val(0)};if(t.keyCode===38){i+=1}
else if(t.keyCode===40){i-=1}}
else if(e==='decimal'){if(!($(t.target).val())){$(t.target).val(0.3)};if(t.keyCode===38){i+=0.1}
else if(t.keyCode===40){i-=0.1}};$(t.target).val(i)};this.Apply=function(){if(t.onOptionChange){t.onOptionChange('ToolOpSwiperPagination',{width:t.getPaginationWidth(),height:t.getPaginationWidth(),opacity:t.getPaginationOpacity(),backgroundColor:t.getPaginationColor()},this.pointIndex)}};this.deactive=function(){if(this.status==0)return;this.hide();this.status=0;this.hideColorPicker();$(this.element).hide();this.removeListener()};this.hide=function(){}};bm.extend(ToolOpBase,ToolOpSwiperPagination);ToolOpSwiperPagination.prototype.addEvent=function(){var t=this;$(this.element).find('[data-wv-tool-option-btn="paginationApply"]').on('click',function(){t.setPaginationColor();t.Apply()});$(t.element).find('input.option_input_style_0').on('keydown',function(e){if($(this).attr('data-wv-tool-option-btn')==='paginationWidth'){t.controlByKeyDown(e,'integer')}
else if($(this).attr('data-wv-tool-option-btn')==='paginationOpacity'){t.controlByKeyDown(e,'integer')};if(e.keyCode===13){t.Apply()}});$(this.element).find('[data-wv-tool-option-btn="paginationWidth"]').on('keyup',function(){var t=$(this).val();if(!bm.valid.isOnlyNum(t)){$(this).val(10);bm.toast('숫자를 입력해주세요.');return!1}});$(this.element).find('[data-wv-tool-option-btn="paginationOpacity"]').on('keyup',function(){if(!bm.valid.isOnlyNum($(this).val())){$(this).val(70);bm.toast('숫자만 입력가능합니다.');return!1}
else{if($(this).val()<0||$(this).val()>100){$(this).val(70);bm.toast('투명도는 0 ~ 100%까지 설정가능합니다.');return!1}}});$(this.element).find('input.option_input_style_0.swiper_pagi_input').on('focusout',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=$.trim(t);if(isNaN(t))t=0;$(this).val(t)}});$(this.element).find('input.option_input_style_0.swiper_pagi_input').on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()})};ToolOpSwiperPagination.prototype.setOptionValue=function(t,e,i,n){var o=this;if(t&&e&&i&&n){$(o.optionBtnList['paginationWidth']).val(t.replace('px',''));$(o.optionBtnList['paginationOpacity']).val(100-(i*100));$(o.optionBtnList['paginationColor']).find('.choice_color').css({backgroundColor:n})}
else{$(o.optionBtnList['paginationWidth']).val(0);$(o.optionBtnList['paginationOpacity']).val(0);$(o.optionBtnList['paginationColor']).find('.choice_color').css({backgroundColor:'rgb(228, 235, 245)'})}};ToolOpSwiperPagination.prototype.removeEvent=function(){$(this.element).find('[data-wv-tool-option-btn="apply"]').off('click');$(this.element).find('input.option_input_style_0').off('keydown');$(this.element).find('[data-wv-tool-option-btn="paginationWidth"]').off('keyup');$(this.element).find('[data-wv-tool-option-btn="paginationOpacity"]').off('keyup');$(this.element).find('input.option_input_style_0').off('keyup');$(this.element).find('input.option_input_style_0.swiper_pagi_input').off('focusout');$(this.element).find('input.option_input_style_0.swiper_pagi_input').off('focus')};var ToolOpSwiperNavigation=function(){this.type='ToolOpSwiperNavigation';this.element=$('[data-wv-tool-option=ToolOpSwiperNavigation]');var t=this.element;this.navigationPositionIndicator=$(t).find('#swiper_navi_positionIndicator')[0];this.onOptionBtnClick=function(t){};this.setNavigationPosition=function(){var e=$(this.optionBtnList['top']).val(),i=$(this.optionBtnList['bottom']).val(),n=$(this.optionBtnList['left']).val(),o=$(this.optionBtnList['right']).val(),t,a=$(this.optionBtnList['naviAlignTop']).attr('class'),s=$(this.optionBtnList['naviAlignCenter']).attr('class'),r=$(this.optionBtnList['naviAlignBottom']).attr('class');if(s.includes('active')){t='translateY(-50%)';e='50%'};if(a.includes('active')){t='matrix(1, 0, 0, 1, 0, 0)'};if(r.includes('active')){t='matrix(1, 0, 0, 1, 0, 0)'};return{top:e,bottom:i,left:n,right:o,transform:t}};this.getCurrentNavigationStyle=function(t){return[this.getStyleSheet(t[0]),this.getStyleSheet(t[1])]};this.getStyleSheet=function(t){var a;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};var s='[data-wv-res-id="'+$(t).attr('data-wv-res-id')+'"]',o=a.getRulesBySelectorText(s,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),i=['top','bottom','left','right','transform'],n={'top':undefined,'bottom':undefined,'left':undefined,'right':undefined,'transform':undefined};var e;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':e=0;break;case'768':e=1;break;case'992':e=2;break;case'1200':e=3;break;case'1600':e=4;break}
while(e>=0){for(let j=0;j<i.length;j++){if(o[e].style[i[j]]&&n[i[j]]===undefined){n[i[j]]=o[e].style[i[j]]}};e--};return n};this.controlByKeyDown=function(t){if(!($(t.target).val())){$(t.target).val(0)};var e=Number($(t.target).val());if(t.keyCode===38){e+=1;$(t.target).val(e)}
else if(t.keyCode===40){e-=1;$(t.target).val(e)}}};bm.extend(ToolOpBase,ToolOpSwiperNavigation);ToolOpSwiperNavigation.prototype.addEvent=function(){var t=this;t.Apply=function(){if(t.onOptionChange){if($(t.element).find('#swiper_navi_positionIndicator').text()==='고정'){bm.toast('고정되어있는 형태의 내비게이션은 위치를 바꿀 수 없습니다.');return!1}
else{t.onOptionChange('ToolOpSwiperNavigation',t.setNavigationPosition())}}};$(this.element).find('[data-wv-tool-option-btn="navigationApply"]').on('click',function(){t.Apply()});$(t.element).find('input.option_input_style_0').on('keydown',function(e){t.controlByKeyDown(e);if(e.keyCode===13){var i=$(this).val();if(!bm.valid.isOnlyNum(i)){$(this).val(0);$(this).select();bm.toast('0 이상의 숫자를 입력해주세요.');return!1}
else{t.Apply()}}});$(t.optionBtnList['naviAlignTop']).on('click',function(){t.setOptionValue('top')});$(t.optionBtnList['naviAlignCenter']).on('click',function(){t.setOptionValue('center')});$(t.optionBtnList['naviAlignBottom']).on('click',function(){t.setOptionValue('bottom')});$(this.element).find('input.option_input_style_0').on('focusout',function(){var t=$(this).val();if(t!==0&&t!=='0'&&t!==''){t=$.trim(t);if(isNaN(t))t=0;$(this).val(t)}});$(this.element).find('input.option_input_style_0').on('focus',function(){var t=$(this).val();if(t!==0&&t!=='0'&&t!==''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()})};ToolOpSwiperNavigation.prototype.setOptionValue=function(t){var e=this;$(e.optionBtnList['naviAlignTop']).removeClass('active');$(e.optionBtnList['naviAlignCenter']).removeClass('active');$(e.optionBtnList['naviAlignBottom']).removeClass('active');$(e.optionBtnList['naviAlignTop']).css({pointerEvents:'auto'});$(e.optionBtnList['naviAlignCenter']).css({pointerEvents:'auto'});$(e.optionBtnList['naviAlignBottom']).css({pointerEvents:'auto'});var i=function(){$(e.optionBtnList['top']).attr('disabled',!0);$(e.optionBtnList['bottom']).attr('disabled',!0);$(e.optionBtnList['left']).attr('disabled',!0);$(e.optionBtnList['right']).attr('disabled',!0);$(e.optionBtnList['top']).val('auto');$(e.optionBtnList['bottom']).val('auto');$(e.optionBtnList['left']).val('auto');$(e.optionBtnList['right']).val('auto');$(e.navigationPositionIndicator).text('고정');$(e.optionBtnList['naviAlignTop']).css({pointerEvents:'none'});$(e.optionBtnList['naviAlignCenter']).css({pointerEvents:'none'});$(e.optionBtnList['naviAlignBottom']).css({pointerEvents:'none'})},n=function(){$(e.optionBtnList['naviAlignTop']).addClass('active');$(e.optionBtnList['top']).removeAttr('disabled',!0);$(e.optionBtnList['bottom']).attr('disabled',!0);$(e.optionBtnList['left']).removeAttr('disabled',!0);$(e.optionBtnList['right']).removeAttr('disabled',!0);$(e.optionBtnList['top']).val('0');$(e.optionBtnList['bottom']).val('auto');$(e.optionBtnList['bottom']).attr('placeholder','');$(e.navigationPositionIndicator).text('상단정렬')},o=function(){$(e.optionBtnList['naviAlignCenter']).addClass('active');$(e.optionBtnList['top']).attr('disabled',!0);$(e.optionBtnList['bottom']).attr('disabled',!0);$(e.optionBtnList['left']).removeAttr('disabled',!0);$(e.optionBtnList['right']).removeAttr('disabled',!0);$(e.optionBtnList['top']).val('auto');$(e.optionBtnList['top']).attr('placeholder','');$(e.optionBtnList['bottom']).val('auto');$(e.optionBtnList['bottom']).attr('placeholder','');$(e.navigationPositionIndicator).text('중앙정렬')},a=function(){$(e.optionBtnList['naviAlignBottom']).addClass('active');$(e.optionBtnList['top']).attr('disabled',!0);$(e.optionBtnList['left']).removeAttr('disabled',!0);$(e.optionBtnList['right']).removeAttr('disabled',!0);$(e.optionBtnList['bottom']).val('0');$(e.optionBtnList['top']).val('auto');$(e.optionBtnList['top']).attr('placeholder','');$(e.optionBtnList['bottom']).removeAttr('disabled',!0);$(e.navigationPositionIndicator).text('하단정렬')};if(t==='none')i();if(t==='top')n();if(t==='center')o();if(t==='bottom')a()};ToolOpSwiperNavigation.prototype.removeEvent=function(){var t=this;$(this.element).find('[data-wv-tool-option-btn="applyNavigation"]').off('click');$(this.element).find('input.option_input_style_0.swiper_pagi_input').off('focusout');$(this.element).find('input.option_input_style_0.swiper_pagi_input').off('focus');$(t.optionBtnList['naviAlignTop']).off('click');$(t.optionBtnList['naviAlignCenter']).off('click');$(t.optionBtnList['naviAlignBottom']).off('click');$(t.element).find('input.option_input_style_0').off('keydown')};var ToolOpFontFamily=function(){this.type='ToolOpFontFamily';this.element=$('[data-wv-tool-option=ToolOpFontFamily]');this.show=function(){if(bm.bmEditorManager.registedBoardEditor===!0||$('#WEVEN_IFRAME').length===0||wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.STUDIO){}}};bm.extend(ToolOpBase,ToolOpFontFamily);ToolOpFontFamily.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange('ToolOpFontFamily','\''+i+'\'')}});$(this.element).find('.myFont_button').on('click',function(){t.showMyFontManagePopup()});$(this.element).find('.delete_list_contents_btn').on('click',function(e){var i=$(e.target).closest('li');if(confirm('나의 폰트 삭제 시, 이미 적용된 나의 폰트가 다른 폰트로 변경될 수 있습니다. 나의 폰트를 삭제하시겠습니까?')){t.deleteMyFontElement(i)}})};ToolOpFontFamily.prototype.deleteMyFontElement=function(t){var e=this,i=t.find('[data-wv-tool-option-value]').text();bm.httpSendJsonPost(WEB_ROOT+'memberBlock/deleteMyFont',{deleteMyFont:i},function(n){if(n.result){var a=n.data.result;bm.toast(i+' 폰트가 삭제되었습니다.');t.remove();if(e.element.find('.myFont .list_con li').not('.myFont_button').length===0){e.element.find('.myFont .font_list_title').hide()};var o=WVAdminResourceManager.getEmbededStyleObject('font');o.styleElement.innerHTML=a;o.refreshStyleElementText()}
else{bm.toast('나의 폰트 삭제에 실패하였습니다.')}})};ToolOpFontFamily.prototype.showMyFontManagePopup=function(){var t=this;this.$popupWrap=$('#myFontManagePopup');this.$applyBtn=this.$popupWrap.find('#myFontApplyBtn');this.$closeBtn=this.$popupWrap.find('.popup_close_btn');this.$popupWrap.css({'max-width':'800px','height':'450px'});this.$popupWrap=$(bm.popupManager.add('#myFontManagePopup',!1,null,0,!0,!0,!0,100002));bm.popupManager.addTransition('#myFontManagePopup');this.$popupWrap.find('#inputMyFont').val('');this.$closeBtn.off('click');this.$closeBtn.on('click',function(){bm.popupManager.removePopLatest(!0)});this.$applyBtn.off('click');this.$applyBtn.on('click',function(){t.addMyFont()});bm.popupManager.repositioningLatestPop()};ToolOpFontFamily.prototype.fontReplace=function(t){if(typeof(t)==='object'){return t};var e=/[\[\]?,|*~`!^\_+<>@\#$%&\='\\"]/gi;t=t.replace('@font-face','');t=t.replace(e,'');t=t.replaceAll(';',',');t=bm.parsing.parseStrToObj(t);return t};ToolOpFontFamily.prototype.checkFontValid=function(){var n=this,e=this.$popupWrap.find('#inputMyFont').val(),a=function(t){t=t.replace(/\s/g,'');var i=t,f=/^(@font-face\{)(\})$/,p=/(\})$/;t=n.fontReplace(t);var o=/^(url\((http|https):\/\/[^"'()]+(\.woff\)))(format(\(woff\)))/,a=/^(url\((http|https):\/\/[^"'()]+(\.woff2\)))(format(\(woff2\)))/,s=/^(url\((http|https):\/\/[^"'()]+(\.ttf\)))(format(\(truetype\)))/,r=['normal','bold','bolder','lighter',100,200,300,400,500,600,700,800,900],l=['normal','italic','oblique'],d=t['font-family'],e=t['src'],h=t['font-weight'],c=t['font-style'];if(!f.test(i)&&!p.test(i)){bm.toast('형식을 맞추어 작성해주세요');return!1}
else if(!d){bm.toast('font-family를 넣어주세요');return!1}
else if(!e){bm.toast('src를 넣어주세요');return!1}
else if(e.includes('woff2)')&&!a.test(e)||e.includes('woff)')&&!o.test(e)||e.includes('ttf')&&!s.test(e)){bm.toast('src가 잘못 작성되었습니다.');return!1}
else if(r.indexOf(h)<0){bm.toast('font-weight가 잘못 작성되었습니다.');return!1}
else if(l.indexOf(c)<0){bm.toast('font-style이 잘못 작성되었습니다.');return!1};return!0};if(e.split('@font-face').length>2){var s=n.fontReplace(e.split('@font-face')[1])['font-family'],o=0;for(let i=1;i<e.split('@font-face').length;i++){var t=e.split('@font-face')[i];if(t.split('}').length>2){t=t.split('}')[0]+'}'};if(a(t)){o=1}
else{return!1};t=n.fontReplace(t);if(t['font-family']!==s){bm.toast('한번에 하나의 폰트만 등록할 수 있습니다.<br>폰트이름들을 확인해주세요.');return!1}};if(o===1){return!0}}
else{return a(e)}};ToolOpFontFamily.prototype.postMyFont=function(t){var e=this;if(t){bm.httpSendJsonPost(WEB_ROOT+'memberBlock/addMyFont',{myFontValue:t},function(t){if(t.result){var o=t.data.result['font_name'],l=t.data.result['font_css'],c=e.element.find('[data-wv-tool-option-value]');for(let i=0;i<c.length;i++){if($(c[i]).attr('data-wv-tool-option-value')===o){bm.toast('동일한 폰트가 등록되어있습니다.');return!1}};var h=WVAdminResourceManager.getEmbededStyleObject('font');bm.styleSheetManager.mergeStyleSheetToText(h.styleElement,l);h.refreshStyleElementText();$('body').find('[data-wv-myfontlist]').append(l);$('<li><div class="delete_list_contents_btn"><img src="/weven_service/asset/toolbar/img/tool/tool_text_delete_myfont.png" alt="나의폰트삭제"></div><div class="list_contents" style="font-family:'+o+'; font-weight: 400; font-style: normal;" data-wv-tool-option-value="'+o+'">'+o+'</div></li>').insertBefore(e.element.find('.myFont_button'));var d=l.split('@font-face'),n={};for(let i=0;i<d.length;i++){var a=e.fontReplace(d[i]),s=a['font-family'];if(s){if(a['font-weight']==='normal'){a['font-weight']=400};if(typeof n[s]==='object'){if(n[s].length>0){n[s].push(String(a['font-weight']))}}
else{n[s]=[String(a['font-weight'])]}}};for(var r in n){for(let i=1;i<n[r].length;i++){if(n[r][i]===n[r][i-1]){n[r].splice(i,1);i--}}};e.fontWeightObj=n;events('ToolBtnTextFont').dispatch('fontWeight',{fontFamily:o,fontWeightList:e.fontWeightObj[o],myFont:!0});bm.popupManager.removePopLatest()}
else{bm.toast('나의 폰트 등록에 실패하였습니다.')}})}};ToolOpFontFamily.prototype.addMyFont=function(){var n=this,t=this.$popupWrap.find('#inputMyFont').val();if(t.includes('https://fonts.googleapis.com/css')){if(t.split('family').length>2){bm.toast('한번에 하나의 폰트만 등록할 수 있습니다.');return!1}
else{var o=t.substring(t.lastIndexOf('https://fonts.googleapis.com')).split('" rel')[0];$.get(o).done(function(e){t=e;if(t)n.postMyFont(t)}).fail(function(){bm.toast('유효한 주소인지 확인해주세요.')})}}
else{if(t.includes('@import url')){bm.toast('현재 구글API폰트만 지원하고 있습니다.');return!1}
else{if(n.checkFontValid()&&t){if(t.split('@font-face').length>2){var e='';for(let i=0;i<t.split('@font-face').length;i++){if(t.split('@font-face')[i].split('}').length>2){e=e+'@font-face'+t.split('@font-face')[i].split('}')[0]+'}'}
else if(t.split('@font-face')[i].includes('src')){e=e+'@font-face'+t.split('@font-face')[i]}}};if(e){n.postMyFont(e)}
else{n.postMyFont(t)}}}}};ToolOpFontFamily.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off();$(this.element).find('.myFont_button').off();$(this.element).find('.delete_list_contents_btn').off()};var ToolOpFontWeight=function(){this.type='ToolOpFontWeight';this.element=$('[data-wv-tool-option=ToolOpFontWeight]')};bm.extend(ToolOpBase,ToolOpFontWeight);ToolOpFontWeight.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange('ToolOpFontWeight',i)}})};ToolOpFontWeight.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpFontSize=function(){this.type='ToolOpFontSize';this.element=$('[data-wv-tool-option=ToolOpFontSize]')};bm.extend(ToolOpBase,ToolOpFontSize);ToolOpFontSize.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange('ToolOpFontSize',i)}})};ToolOpFontSize.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpLetterSpacing=function(){this.type='ToolOpLetterSpacing';this.element=$('[data-wv-tool-option=ToolOpLetterSpacing]')};bm.extend(ToolOpBase,ToolOpLetterSpacing);ToolOpLetterSpacing.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange('ToolOpLetterSpacing',i)}})};ToolOpLetterSpacing.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpLineHeight=function(){this.type='ToolOpLineHeight';this.element=$('[data-wv-tool-option=ToolOpLineHeight]')};bm.extend(ToolOpBase,ToolOpLineHeight);ToolOpLineHeight.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange('ToolOpLineHeight',i)}})};ToolOpLineHeight.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpTextTable=function(){this.type='ToolOpTextTable';this.element=$('[data-wv-tool-option=ToolOpTextTable]');var t=this;this.onOptionBtnClick=function(e){switch(e){case'apply':t.applyMakeTable();break}};this.applyMakeTable=function(){t.onOptionChange(t.type,{row:t.rowNum,col:t.colNum})};this.rowNum=2;this.colNum=2;this.inputList=$(this.element).find('.input_table_row, .input_table_col');this.rowInput=$(this.element).find('.input_table_row');this.colInput=$(this.element).find('.input_table_col');this.tableCellCon=$(this.element).find('.table_cell_con');this.tableCellTemplate=$(this.element).find('.table_cell_con .table_cell_template')[0].outerHTML;this.cellSize=19;this.cellGbList=[];this.cellList=[$(this.element).find('.table_cell_con .table_cell_template')];this.makePreviewTableCell=function(t,e){if(!t||!e){t=Math.ceil(this.tableCellCon.height()/this.cellSize);e=Math.floor(this.tableCellCon.width()/this.cellSize)}
else{this.tableCellCon.css({width:e*this.cellSize,height:t*this.cellSize})};var o=t*e;this.rowNum=t;this.colNum=e;this.rowInput.val(this.rowNum);this.colInput.val(this.colNum);var n=o-this.cellList.length,i;if(n<0){n=Math.abs(n);while(n--){i=this.cellList.pop();this.cellGbList.push(i);i.detach()}}
else{while(n--){if(this.cellGbList.length>0){i=this.cellGbList.pop();$(i).appendTo(this.tableCellCon)}
else{i=$(this.tableCellTemplate).appendTo(this.tableCellCon)};this.cellList.push(i)}}};this.removeDragPrevTable=function(){mouseAdapter(this.tableCellCon).offDrag()};this.registDragPrevTable=function(){var e=$(this.element).find('#makeTableDragArea')[0],a=$(this.element).find('#makeTableDragAreaInner')[0];mouseAdapter(this.tableCellCon).onDrag(r,l,s,!1,e);var t=this,i=$(this.tableCellCon).offset(),n=i.left,o=i.top;function s(t){};function r(e){var i=Math.max(t.cellSize,e.clientX-n),a=Math.max(t.cellSize,e.clientY-o);t.tableCellCon.css({width:i,height:a});t.makePreviewTableCell()};function l(t){};$(a).off('mouseenter').on('mouseenter',function(e){t.moveStatus=!0});$(e).off('mousemove').on('mousemove',function(e){if(t.moveStatus){var i=Math.max(t.cellSize,e.clientX-n),a=Math.max(t.cellSize,e.clientY-o);t.tableCellCon.css({width:i,height:a});t.makePreviewTableCell()}});$(e).off('click').on('click',function(e){t.moveStatus=!1})};this.makePreviewTableCell(7,7)};bm.extend(ToolOpBase,ToolOpTextTable);ToolOpTextTable.prototype.addEvent=function(){var t=this;this.registDragPrevTable();$(this.inputList).on('focusout',function(e){if($(this).hasClass('input_table_row')){t.makePreviewTableCell($(this).val(),t.colNum)}
else{t.makePreviewTableCell(t.rowNum,$(this).val())}});$(this.inputList).on('focus',function(t){$(this).select()})};ToolOpTextTable.prototype.removeEvent=function(){this.removeDragPrevTable();$(this.inputList).off('focusout');$(this.inputList).off('focus')};var ToolOpTextLink=function(){this.type='ToolOpTextLink';this.element=$('[data-wv-tool-option=ToolOpTextLink]');var t=this;this.menuList=$(this.element).find('[data-wv-tool-option-value]')};bm.extend(ToolOpBase,ToolOpTextLink);ToolOpTextLink.prototype.addEvent=function(){var t=this;this.menuList.on('click',function(e){var i=$(this).attr('data-wv-tool-option-value'),n=$(this).text();if(t.onOptionChange){t.onOptionChange('menu',{uri:i,title:n})}})};ToolOpTextLink.prototype.removeEvent=function(){this.menuList.off('click')};var ToolOpTextLinkSmall=function(){this.type='ToolOpTextLinkSmall';this.element=$('[data-wv-tool-option=ToolOpTextLinkSmall]');var t=this;this.inputList=[];this.radioList=[];this.radioList.push(this.element.find('[data-wv-tool-option-btn="_self"]').parent()[0]);this.radioList.push(this.element.find('[data-wv-tool-option-btn="_blank"]').parent()[0]);this.inputList.push(this.element.find('[data-wv-tool-option-btn="url"]')[0]);this.inputList.push(this.element.find('[data-wv-tool-option-btn="title"]')[0]);this.onTextInputDown=function(t){t.stopImmediatePropagation();if(bm.selectionManager.getRange()&&$(bm.selectionManager.getRange().startContainer).closest('.wveditor_text').length>0){bm.selectionManager.saveRange()}};this.getUrl=function(){return $(this.optionBtnList['url']).val()};this.getTitle=function(){return $(this.optionBtnList['title']).val()};this.getTarget=function(){return $(this.optionBtnList['_self']).is(':checked')?'_self':'_blank'};this.applyLink=function(e){var i=this.getUrl();if(e==='apply'&&!i){alert('링크주소를 입력해주세요.');$(this.optionBtnList['url']).focus();return}
else if(e==='home'){i=WEB_ROOT.replace('webadm/','web/');if(WEB_ROOT.indexOf(SITE_ID+'.weven')>-1){i=WEB_ROOT.replace('webadm/','')}};var o=i.split('?')[0],a=bm.valid.isValidUrl(o);if(e==='apply'&&!a&&!i.includes('[WEB_ROOT]')){alert('링크주소 형식이 잘못 되었습니다. 다시 입력해주세요.');$(this.optionBtnList['url']).focus();return};var n=this.getTitle();t.onOptionChange(t.type,{type:'apply',url:i,title:n,target:t.getTarget()})};this.removeLink=function(){this.onOptionChange(t.type,{type:'remove'})};this.findPage=function(){this.onOptionChange(t.type,{type:'page'})};this.onOptionBtnClick=function(t){switch(t){case'home':case'apply':this.applyLink(t);break;case'remove':this.removeLink();break;case'page':this.findPage();break}}};bm.extend(ToolOpBase,ToolOpTextLinkSmall);ToolOpTextLinkSmall.prototype.addEvent=function(){var t=this;$(t.inputList).on('focus',function(){$(this).select()});$(t.inputList).on('focusout',function(){var t=$(this).val();$(this).val($.trim(t))});$(t.radioList).on('mousedown',function(e){t.onTextInputDown(e)});$(t.inputList).on('mousedown',function(e){t.onTextInputDown(e);$(this).select()});$(t.inputList).on('keydown',function(e){if(e.keyCode==13){t.setLink('apply');e.preventDefault()}})};ToolOpTextLinkSmall.prototype.removeEvent=function(){var t=this;$(t.inputList).off('focus');$(t.inputList).off('focusout');$(t.inputList).off('mousedown');$(t.radioList).off('mousedown');$(t.inputList).off('keydown')};var ToolOpTextShadow=function(){this.type='ToolOpTextShadow';this.element=$('[data-wv-tool-option=ToolOpTextShadow]');this.colorPicker=ToolOpColorPicker.get();this.shadowColor=$(this.element).find('[data-wv-tool-option-btn="color"]').find('.choice_color');this.shadowOpacity=$(this.element).find('input[name="textShadowOpacity"]');this.shadowUpDown=$(this.element).find('input[name="textShadowUpDown"]');this.shadowLeftRight=$(this.element).find('input[name="textShadowLeftRight"]');this.shadowBlurRadius=$(this.element).find('input[name="textShadowBlurRadius"]');this.cssList={};this.onOptionBtnClick=function(t){switch(t){case'color':this.showColorPicker();break;case'textShadowApply':this.shadowApply();break;case'textShadowDelete':this.shadowDelete();break}};this.showColorPicker=function(){var t=this;if(t.colorPicker.status===1){t.colorPicker.deactive()}
else if(t.colorPicker.status===0){$(t.colorPicker.element).find('.option_row.line').hide();$(t.colorPicker.element).find('.point_color_list_con').hide();$(t.colorPicker.element).find('#gradation_menu').hide();t.colorPicker.active($(this.element).closest('[data-wv-tool-btn="ToolBtnTextShadow"]')[0],function(e,i){t.setShadowColor(e,i);t.hideColorPicker()});this.colorPicker.element.show()}};this.hideColorPicker=function(){this.colorPicker.hide();this.colorPicker.deactive()};this.setShadowColor=function(t,e){var n=this,i=bm.number.hexToRgb(e);if(!i){i={r:228,g:235,b:245,a:0}};i.a=1;n.shadowColor.css({backgroundColor:'rgba('+i.r+','+i.g+','+i.b+','+i.a+')'})};this.shadowApply=function(){var t=this,e=bm.number.rgbaToObj(t.shadowColor.css('backgroundColor')),i='rgba('+e.r+','+e.g+','+e.b+','+(100-Number(this.shadowOpacity.val()))/100+')';t.cssList['textShadow']=i+' '+this.shadowLeftRight.val()+'px '+this.shadowUpDown.val()+'px '+this.shadowBlurRadius.val()+'px ';if(t.onOptionChange){t.onOptionChange('ToolOpTextShadow',t.cssList)}};this.shadowDelete=function(){var t=this;t.cssList['textShadow']='none';if(t.onOptionChange){t.onOptionChange('ToolOpTextShadow',t.cssList)}}};bm.extend(ToolOpBase,ToolOpTextShadow);ToolOpTextShadow.prototype.addEvent=function(){var t=this;$(t.element).find('input[data-wv-tool-option-value]').on('click',function(){$(this).select()});$(t.element).find('input[data-wv-tool-option-value]').on('keydown',function(e){var i=$(this).val();if(e.keyCode===13){if($.isNumeric(i)===!1){if($(this).attr('name')==='textShadowOpacity'){$(this).val(0)}
else{$(this).val(5)};bm.toast('숫자만 입력해 주세요.');$(this).select();return!1}
else if((i<0||i>100)&&$(this).attr('name')==='textShadowOpacity'){$(this).val(0);bm.toast('투명도는 0 ~ 100%까지 설정가능합니다.');return!1};t.shadowApply()}})};ToolOpTextShadow.prototype.removeEvent=function(){var t=this;$(t.element).find('input[data-wv-tool-option-value]').off('focus');$(t.element).find('input[data-wv-tool-option-value]').off('keydown');$(t.element).find('input[data-wv-tool-option-value]').off('keyup');$(t.shadowUpDown).off('keydown');$(t.shadowLeftRight).off('keydown');$(t.shadowBlurRadius).off('keydown')};var ToolOpTextVideo=function(){this.type='ToolOpTextVideo';this.element=$('[data-wv-tool-option=ToolOpTextVideo]');this.urlInput=$(this.element).find('[data-wv-tool-option-value][name="editor_youtube_url"]');this.widthInput=$(this.element).find('[data-wv-tool-option-value][name="editor_youtube_width"]');this.heightInput=$(this.element).find('[data-wv-tool-option-value][name="editor_youtube_height"]');this.onOptionBtnClick=function(t){switch(t){case'apply':this.apply();break}};this.getOptionValue=function(){return{url:this.urlInput.val(),width:this.widthInput.val()!==''?this.widthInput.val():'560',height:this.heightInput.val()!==''?this.heightInput.val():'315',}};this.resetOptionValue=function(){$(this.urlInput).val('');$(this.widthInput).val('560');$(this.heightInput).val('315')};this.apply=function(){var t=this,e=$('<div></div>').appendTo($('#content_bmeditorEditor'));const videoUrl_com=this.getOptionValue()['url'];let videoId;if(videoUrl_com){if(videoUrl_com.includes('youtube')){videoId=videoUrl_com.split('v=')[1]}
else if(videoUrl_com.includes('youtu.be')){videoId=videoUrl_com.split('youtu.be/')[1].split('?')[0]}}
else{bm.toast('영상주소를 올바르게 입력해주세요.');return!1};if(videoId){const iframe=document.createElement('iframe');iframe.setAttribute('width',this.getOptionValue()['width']);iframe.setAttribute('height',this.getOptionValue()['height']);iframe.setAttribute('src','https://www.youtube.com/embed/'+videoId);iframe.setAttribute('frameborder','0');iframe.setAttribute('allowfullscreen','');$(e).append(iframe);this.resetOptionValue();if(t.onOptionChange){t.onOptionChange('ToolOpTextVideo',videoId)}}
else{bm.toast('영상주소를 올바르게 입력해주세요.');return!1}}};bm.extend(ToolOpBase,ToolOpTextVideo);ToolOpTextVideo.prototype.addEvent=function(){var t=this};ToolOpTextVideo.prototype.removeEvent=function(){var t=this};var ToolOpDomSpace=function(){this.type='ToolOpDomSpace';this.element=$('[data-wv-tool-option=ToolOpDomSpace]');var t=this;this.onOptionBtnClick=function(e){switch(e){case'px':t.unitChange('px');break;case'%':t.unitChange('%');break;case'apply':var i=t.getOptionValue();t.onOptionChange(t.type,i);break}};this.getOptionValue=function(){return{'marginTop':this.optionBtnList['marginTop'].val(),'marginRight':this.optionBtnList['marginRight'].val(),'marginBottom':this.optionBtnList['marginBottom'].val(),'marginLeft':this.optionBtnList['marginLeft'].val(),'paddingTop':this.optionBtnList['paddingTop'].val(),'paddingRight':this.optionBtnList['paddingRight'].val(),'paddingBottom':this.optionBtnList['paddingBottom'].val(),'paddingLeft':this.optionBtnList['paddingLeft'].val()}};var e=$(this.element).find('[data-wv-tool-option-btn=px]'),i=$(this.element).find('[data-wv-tool-option-btn=\'%\']');this.unit='px';this.unitChange=function(t){if(t!=this.unit){if(t=='px'){$(e).addClass('active');$(i).removeClass('active')}
else{$(e).removeClass('active');$(i).addClass('active')}};this.unit=t};this.paddingMarginBtnList=$(this.element).find('.margin_con input, .padding_con input');this.optionBtnList['paddingTop']=$(this.element).find('.padding_con .top input');this.optionBtnList['paddingRight']=$(this.element).find('.padding_con .right input');this.optionBtnList['paddingBottom']=$(this.element).find('.padding_con .bottom input');this.optionBtnList['paddingLeft']=$(this.element).find('.padding_con .left input');this.optionBtnList['marginTop']=$(this.element).find('.margin_con .top input');this.optionBtnList['marginRight']=$(this.element).find('.margin_con .right input');this.optionBtnList['marginBottom']=$(this.element).find('.margin_con .bottom input');this.optionBtnList['marginLeft']=$(this.element).find('.margin_con .left input');this.getPaddingStyle=function(){var t=this.optionBtnList['paddingTop'].val(),e=this.optionBtnList['paddingRight'].val(),i=this.optionBtnList['paddingBottom'].val(),n=this.optionBtnList['paddingLeft'].val();if(t==''&&e==''&&i==''&&n=='')return'initial';t=t||'0';e=e||'0';i=i||'0';n=n||'0';return t+' '+e+' '+i+' '+n};this.getMarginStyle=function(){var t=this.optionBtnList['marginTop'].val(),e=this.optionBtnList['marginRight'].val(),i=this.optionBtnList['marginBottom'].val(),n=this.optionBtnList['marginLeft'].val();if(t==''&&e==''&&i==''&&n=='')return'initial';t=t||'0';e=e||'0';i=i||'0';n=n||'0';return t+' '+e+' '+i+' '+n}};bm.extend(ToolOpBase,ToolOpDomSpace);ToolOpDomSpace.prototype.addEvent=function(){var t=this;$(this.paddingMarginBtnList).on('focusout',function(e){var i=$(this).val();if(i!=0&&i!='0'&&i!=''){i=$.trim(i)+t.unit;$(this).val(i)}});$(this.paddingMarginBtnList).on('focus',function(t){var e=$(this).val();if(e!=0&&e!='0'&&e!=''&&e!='px'&&e!='%'){e=parseFloat($(this).val());if(isNaN(e))e=0};$(this).val(e);$(this).select()})};ToolOpDomSpace.prototype.removeEvent=function(){var t=this;$(this.paddingMarginBtnList).off('focusout');$(this.paddingMarginBtnList).off('focus')};var ToolOpDomSize=function(){this.type='ToolOpDomSize';this.element=$('#ToolOpDomSize');this.unit='px';var t=this;this.onOptionBtnClick=function(t){this.changeUnit(t)};this.changeUnit=function(t){$(this.optionBtnList[this.unit]).removeClass('active');$(this.optionBtnList[t]).addClass('active');this.unit=t};this.setSize=function(){var e=$(t.element).find('.size_input_field');if(t.onOptionChange){t.onOptionChange('ToolOpDomSize',{'width':e.val()})}}};bm.extend(ToolOpBase,ToolOpDomSize);ToolOpDomSize.instance=null;ToolOpDomSize.get=function(){if(ToolOpDomSize.instance==null){ToolOpDomSize.instance=new ToolOpDomSize()};return ToolOpDomSize.instance};ToolOpDomSize.prototype.addEvent=function(){var t=this,e=$(this.element).find('.size_input_field');$(e).on('focusout',function(e){var i=$(this).val();if(i!=0&&i!='0'&&i!=''){if(i.indexOf(t.unit)==-1){i=parseInt($.trim(i));i=i+t.unit};$(this).val(i);t.setSize()}});$(e).on('focus',function(t){var e=$(this).val();if(e!=0&&e!='0'&&e!=''&&e!='px'&&e!='%'){e=parseFloat($(this).val());if(isNaN(e))e=0};$(this).val(e);$(this).select()});$(e).on('keyup',function(t){if(t.keyCode==13){$(this).trigger('focusout')}});$(this.element).on('click',function(t){t.stopImmediatePropagation()});$(this.element).find('.set_max_width').on('mousedown',function(e){e.stopImmediatePropagation();if(t.onOptionChange){t.onOptionChange('ToolOpDomSize',{'max-width':'none','width':'100%'})}});$(this.element).find('.color_code_input').on('mousedown',this.onTextInputDown)};ToolOpDomSize.prototype.removeEvent=function(){var t=$(this.element).find('.size_input_field');$(t).off('focusout');$(t).off('focus');$(t).off('keyup');$(this.element).find('.set_max_width').off('click');$(this.element).off('click')};var ToolOpDomWidth=function(){this.type='ToolOpDomWidth';this.element=$('[data-wv-tool-option=ToolOpDomWidth]')};bm.extend(ToolOpBase,ToolOpDomWidth);ToolOpDomWidth.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange(i)}})};ToolOpDomWidth.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpDomHeight=function(){this.type='ToolOpDomHeight';this.element=$('[data-wv-tool-option=ToolOpDomHeight]')};bm.extend(ToolOpBase,ToolOpDomHeight);ToolOpDomHeight.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange(i)}})};ToolOpDomHeight.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpGridMaxWidth=function(){var t=this;this.type='ToolOpGridMaxWidth';this.element=$('[data-wv-tool-option=ToolOpGridMaxWidth]');this.onOptionBtnClick=function(e){t.onOptionChange(e)}};bm.extend(ToolOpBase,ToolOpGridMaxWidth);ToolOpGridMaxWidth.prototype.addEvent=function(){var t=this};ToolOpGridMaxWidth.prototype.removeEvent=function(){var t=this};var ToolOpDomAlignHorizontalDefault=function(){var t=this;this.type='ToolOpDomAlignHorizontalDefault';this.element=$('[data-wv-tool-option=ToolOpDomAlignHorizontalDefault]');this.onOptionBtnClick=function(e){t.onOptionChange(e)}};bm.extend(ToolOpBase,ToolOpDomAlignHorizontalDefault);ToolOpDomAlignHorizontalDefault.prototype.addEvent=function(){var t=this};ToolOpDomAlignHorizontalDefault.prototype.removeEvent=function(){var t=this};var ToolOpDomBackgroundBorder=function(){var t=this;this.type='ToolOpDomBackgroundBorder';this.element=$('[data-wv-tool-option=ToolOpDomBackgroundBorder]');this.colorPicker=ToolOpColorPicker.get();this.borderColor='#e4ebf5';this.borderStyle='solid';this.css={};var e=$('[data-wv-toolset=ToolDomBackground]');this.widthInput=$(e).find('[data-wv-tool-option-value=borderWidthInput]')[0];this.radiusInput=$(e).find('[data-wv-tool-option-value=borderRadiusInput]')[0];this.currentTargetRadiusValue=0;this.onOptionBtnClick=function(t){switch(t){case'color':this.showColorPicker();break;case'solid':case'dotted':case'dashed':this.setBorderStyle(t);break;case'left':case'top':case'right':case'bottom':case'all':this.activeBorderStyle(t);break;case'top-left':case'top-right':case'bottom-left':case'bottom-right':case'radius-all':this.activeRadiusStyle(t);break;case'apply':this.applyBorderRadius(t);this.applyBorder(t);break;case'delete':this.deleteBorder(t);break;case'confirm':this.onOptionChange(this.type,'confirm');break}};this.showColorPicker=function(){if(this.colorPicker.status==1){t.colorPicker.deactive()}
else if(this.colorPicker.status==0){$(t.colorPicker.element).find('#gradation_menu').hide();this.colorPicker.active($(this.element).closest('[data-wv-tool-btn="ToolBtnDomBackgroundBorder"]')[0],function(e,i){t.setBorderColor(i);t.hideColorPicker()});this.colorPicker.element.show()}};this.hideColorPicker=function(){t.colorPicker.hide();t.colorPicker.deactive()};this.activeBorderStyle=function(t){if(t=='all'){var e=$(this.element).find('.border_type_list .border_control_btn').not('.radius_position'),i=$(this.element).find('.border_type_list .border_control_btn.active').not('.radius_position');if(e.length==i.length){$(this.element).find('.border_type_list .border_control_btn').not('.radius_position').removeClass('active')}
else{$(this.element).find('.border_type_list .border_control_btn').not('.radius_position').addClass('active')}}
else{if($(this.element).find('[data-wv-tool-option-value="'+t+'"]').hasClass('active')){$(this.element).find('[data-wv-tool-option-value="'+t+'"]').removeClass('active')}
else{$(this.element).find('[data-wv-tool-option-value="'+t+'"]').addClass('active')}}};this.activeRadiusStyle=function(t){if(t=='radius-all'){var e=$(this.element).find('.border_type_list .border_control_btn.radius_position'),i=$(this.element).find('.border_type_list .border_control_btn.radius_position.active');if(e.length==i.length){$(this.element).find('.border_type_list .border_control_btn.radius_position').removeClass('active')}
else{$(this.element).find('.border_type_list .border_control_btn.radius_position').addClass('active')}}
else{if($(this.element).find('[data-wv-tool-option-value="'+t+'"]').hasClass('active')){$(this.element).find('[data-wv-tool-option-value="'+t+'"]').removeClass('active')}
else{$(this.element).find('[data-wv-tool-option-value="'+t+'"]').addClass('active')}}};this.setBorderColor=function(t){var i=$(this.element).find('.border_type_list .border_control_btn');if(t.indexOf('applyPoint')>-1){var e=t.replace('applyPoint','');this.pointIndex=e;t=this.colorPicker.cssPointColors[e]}
else{this.pointIndex=-1};this.borderColor=t;$(this.element).find('.choice_color').css({backgroundColor:t});if($(i).hasClass('active')){this.css={color:t};this.applyBorderRadius();this.applyBorder()}};this.setBorderStyle=function(t){var e=$(this.element).find('.border_type_list .border_control_btn');this.borderStyle=t;$(this.optionBtnList).not('.border_control_btn').removeClass('active');$(this.optionBtnList[t]).addClass('active');if($(e).hasClass('active')){}};this.applyBorder=function(t){this.borderColor=(this.borderColor).indexOf('applyPoint')==-1?this.borderColor:'#000000';var a=$(this.colorPicker.element).find('input.opacity').val(),n=((100-parseInt(a==''?0:a))/100);let rgb;if(this.borderColor=='transparent'||!this.borderColor){rgb=bm.number.hexToRgb('#000000');n=0}
else{if(typeof(this.borderColor)==='string'&&!this.borderColor.includes('rgb')){rgb=bm.number.hexToRgb(this.borderColor)}
else{rgb=bm.number.rgbaToObj(this.borderColor)}};var s=n==1?'rgb('+rgb.r+', '+rgb.g+', '+rgb.b+')':'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+n+')',r=$(this.element).find('.option_input_style_0').val()+'px '+this.borderStyle+' '+s,o,i=$(this.element).find('.border_type_list .border_control_btn');this.css['border-style']=this.borderStyle;for(var e=0;e<i.length;e++){var t=$(i[e]).attr('data-wv-tool-option-value');o='border-'+t;if($(i[e]).hasClass('active')){this.css['border-'+t]=r}
else{this.css['border-'+t]='none'}};this.onOptionChange(o,this.css,this.pointIndex);this.css={}};this.applyBorderRadius=function(){var o=$(t.optionBtnList['px']).hasClass('active')?'px':'%',a=$(this.radiusInput).val()+o,i,s=0,n=$(this.element).find('.border_type_list .border_control_btn.radius_position');for(var e=0;e<n.length;e++){var r=$(n[e]).attr('data-wv-tool-option-value');i='border-'+r+'-radius';if($(n[e]).hasClass('active')){s++;this.css[i]=a}
else{this.css[i]='0px'};this.css['overflow']='hidden'};if(s===4&&a==='0'+o){this.css['border-radius']=''}};this.deleteBorder=function(t){this.css={border:'none',borderRadius:0};if(this.onOptionChange){this.onOptionChange(t,this.css)}};this.applyCurrentRange=function(){this.currentTargetRadiusValue=isNaN(this.currentTargetRadiusValue)?0:this.currentTargetRadiusValue;$(this.radiusInput).val(this.currentTargetRadiusValue+'%');if(this.onOptionChange==null)return;this.onOptionChange(this.type,{'border-radius':this.currentTargetRadiusValue+'%'})}};bm.extend(ToolOpBase,ToolOpDomBackgroundBorder);ToolOpDomBackgroundBorder.prototype.addEvent=function(){var t=this;$(t.optionBtnList['all']).hover(function(){var o=$(t.colorPicker.element).find('input.opacity').val(),i=((100-parseInt(o))/100);let rgb;if(this.borderColor=='transparent'||!this.borderColor){rgb=bm.number.hexToRgb('#000000');i=0}
else{if(typeof(this.borderColor)==='string'&&!this.borderColor.includes('rgb')){rgb=bm.number.hexToRgb(this.borderColor)}
else{rgb=bm.number.rgbaToObj(this.borderColor)}};var n=i==1?t.borderColor:'rgba('+rgb.r+', '+rgb.g+', '+rgb.b+', '+i+')',e={};e['border']=$(t.element).find('.option_input_style_0').val()+'px '+t.borderStyle+' '+n;e['color']=n;$(t.element).find('.border_control_con').css(e)},function(){$(t.element).find('.border_control_con').css(t.css)});$(this.element).find('.option_input_style_0').on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()});$('#borderWidthInputCon').find('.editor_input_button').off('click').on('click',function(){var i=$('#borderWidthInputCon').find('input.option_input_style_0'),n=parseInt($(i).val()),e,o=$(t.element).find('.border_type_list .border_control_btn');if($(this).hasClass('minus')){e=n-1;if(e<0)e=0}
else if($(this).hasClass('plus')){e=n+1};$(i).val(e)});$('#borderRadiusInputCon').find('.editor_input_button').off('click').on('click',function(){var i=$('#borderRadiusInputCon').find('input.option_input_style_0'),n=parseInt($(i).val()),e;if($(this).hasClass('minus')){e=n-1;if(e<0)e=0}
else if($(this).hasClass('plus')){e=n+1};$(i).val(e);t.currentTargetRadiusValue=e});$(t.optionBtnList['px']).on('click',function(){$(t.optionBtnList['percent']).removeClass('active');$(t.optionBtnList['px']).addClass('active')});$(t.optionBtnList['percent']).on('click',function(){$(t.optionBtnList['px']).removeClass('active');$(t.optionBtnList['percent']).addClass('active')});$(this.widthInput).on('focus',function(t){t.stopImmediatePropagation();$(this).select()});$(this.widthInput).on('keydown',function(e){if(e.keyCode==13){e.stopImmediatePropagation();t.applyBorderRadius();t.applyBorder()}});$(this.radiusInput).on('focus',function(t){t.stopImmediatePropagation();$(this).select()});$(this.radiusInput).on('keydown',function(e){if(e.keyCode==13){e.stopImmediatePropagation();t.applyBorderRadius();t.applyBorder()}});$(this.widthInput).on('keyup',function(){var t=$(this).val();if(!bm.valid.isOnlyNum(t)){$(this).val(1);bm.toast('숫자를 입력해주세요.');return!1}});$(this.radiusInput).on('keyup',function(){var t=$(this).val();if(!bm.valid.isOnlyNum(t)){$(this).val(50);bm.toast('숫자를 입력해주세요.');return!1}})};ToolOpDomBackgroundBorder.prototype.removeEvent=function(){var t=this;$(this.element).find('.option_input_style_0').off('focus');$(this.widthInput).off('focus');$(this.widthInput).off('keydown');$(this.radiusInput).off('focus');$(this.radiusInput).off('keydown')};var ToolOpDomBackgroundBorderWidth=function(){var t=this;this.type='ToolOpDomBackgroundBorderWidth';this.element=$('[data-wv-tool-option=ToolOpDomBackgroundBorderWidth]');this.applyBorderWidth=function(t,e){this.onOptionChange(e,t)}};bm.extend(ToolOpBase,ToolOpDomBackgroundBorderWidth);ToolOpDomBackgroundBorderWidth.prototype.getWidthInputValue=function(){var t=this;let valueObj={};for(let i=0;i<t.optionBtnList['length'];i++){let value=t.optionBtnList[i]['value'];if(typeof(value)==='string'&&value.includes('px')===!1){value=parseInt(value)+'px'};valueObj[$(t.optionBtnList[i]).attr('data-wv-tool-option-value')]=value};return valueObj};ToolOpDomBackgroundBorderWidth.prototype.addEvent=function(){var t=this,e=$(t.element).find('[data-wv-tool-option-value]');$(e).on('keydown',function(e){if(e.keyCode==13){t.applyBorderWidth(t.getWidthInputValue(),'width')}});$(e).on('keyup',function(){var t=$(this).val();if(!bm.valid.isOnlyNum(t)){$(this).val(1);bm.toast('숫자를 입력해주세요.');return!1}})};ToolOpDomBackgroundBorderWidth.prototype.removeEvent=function(){var t=$(this.element).find('[data-wv-tool-option-value]');$(t).off('keydown');$(t).off('keyup')};var ToolOpDomBackgroundBorderRadius=function(){var t=this;this.type='ToolOpDomBackgroundBorderRadius';this.element=$('[data-wv-tool-option=ToolOpDomBackgroundBorderRadius]');this.applyBorderRadius=function(t,e){this.onOptionChange(e,t)}};bm.extend(ToolOpBase,ToolOpDomBackgroundBorderRadius);ToolOpDomBackgroundBorderRadius.prototype.getRadiusInputValue=function(){var t=this;let valueObj={};for(let i=0;i<t.optionBtnList['length'];i++){let value=t.optionBtnList[i]['value'];if(typeof(value)==='string'&&value.includes('px')===!1){value=parseInt(value)+'px'};valueObj[$(t.optionBtnList[i]).attr('data-wv-tool-option-value')]=value};return valueObj};ToolOpDomBackgroundBorderRadius.prototype.addEvent=function(){var t=this,e=$(t.element).find('[data-wv-tool-option-value]');$(e).on('keydown',function(e){if(e.keyCode==13){t.applyBorderRadius(t.getRadiusInputValue(),'radius')}});$(e).on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)){$(this).val(1);bm.toast('숫자를 입력해주세요.');return!1}})};ToolOpDomBackgroundBorderRadius.prototype.removeEvent=function(){var t=$(this.element).find('[data-wv-tool-option-value]');$(t).off('keydown');$(t).off('keyup')};var ToolOpDomBackgroundImage=function(){var t=this;this.filemanager;this.webroot=window.parent?window.parent.WEB_ROOT:WEB_ROOT;this.fileUploadPath='domeditor/uploadFile/';this.defaultTextEditorFilePath=window.parent?window.parent.WEVEN_DATA_SITE_WEB_PATH:WEVEN_DATA_SITE_WEB_PATH;this.defaultTextEditorFilePath+='filemanager/';this.type='ToolOpDomBackgroundImage';this.element=$('[data-wv-tool-option=ToolOpDomBackgroundImage]');this.css={};this.onOptionBtnClick=function(e){var i={};if(e==='backgroundApply'){t.backgroundApply()}
else if(e==='backgroundReset'){this.css['background-repeat']='repeat';this.css['ackground-size']='auto';this.css['background-attachment']='scroll';this.css['background-position']='0% 0%';i['background-repeat']='repeat';i['background-size']='auto';i['background-attachment']='scroll';i['background-position']='0% 0%'}
else if(e=='select'){var a=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(a).css('max-width','1600px');$(a).on('load',function(){a.contentWindow.fileManager.onSelectCallBack=t.onFileManagerFileSelected});return}
else if(e=='delete'){i['background-image']='none';this.css['background-image']='none'}
else if(e=='repeat'){if(this.css['background-repeat']=='repeat'){i['background-repeat']='no-repeat';this.css['background-repeat']='no-repeat';$(this.optionBtnList[e]).removeClass('active')}
else{i['background-repeat']='repeat';this.css['background-repeat']='repeat';$(this.optionBtnList[e]).addClass('active')}}
else if(e.indexOf('size')>-1){var s=(e)=>{i['background-size']=e.split('_')[1];this.css['background-size']=e.split('_')[1];$(this.optionBtnList[e]).addClass('active')};this.element.find('[data-wv-tool-option-btn^="size"]').removeClass('active');if(this.css['background-size']==='cover'||this.css['background-size']==='contain'){if(e.split('_')[1]===this.css['background-size']){i['background-size']='inherit';this.css['background-size']='inherit'}
else{s(e)}}
else{s(e)};t.element.find('input[name="backgroundImageSizeAdjust"]').val(0)}
else if(e=='parallax'){if(this.css['background-attachment']=='fixed'){i['background-attachment']='unset';this.css['background-attachment']='unset';$(this.optionBtnList[e]).removeClass('active')}
else{i['background-attachment']='fixed';this.css['background-attachment']='fixed';$(this.optionBtnList[e]).addClass('active')}}
else{$(this.element).find('.bg_align_btn').removeClass('active');var n=e.split('_')[0],o=e.split('_')[1];n='calc('+n+')';o='calc('+o+')';i['background-position']=n+' '+o;this.css['background-position']=n+' '+o;$(this.optionBtnList[e]).addClass('active')};this.onOptionChange(e,i)};this.onFileManagerFileSelected=function(e){var n=e.extension.toLowerCase(),o=new RegExp('jpg|jpeg|gif|png');if(!o.test(n)){alert('배경이미지는 이미지 파일만 가능합니다.');return};var i=e.thumbImg;t.css['background-image']='url(\''+i+'\')';if(t.css['background-repeat']!='repeat')t.css['background-repeat']='no-repeat';t.onOptionChange('select',t.css);bm.popupManager.removePopLatest()};this.extractPercentage=function(t){const regex=/(\d+)%/g;const percentages=[];let match;while((match=regex.exec(t))){percentages.push(match[1])};return percentages};this.extractPx=function(t){const pxRegex=/([\d.]+)px/;const match=t.match(pxRegex);if(match){const pxValue=parseFloat(match[1]);if(t.includes('-')){return-pxValue}
else{return pxValue}};return 0};this.backgroundApply=function(t,e){var i=this,n=i.getOptionValue()['sizeAdjust'];i.css['background-size']=n+'px';xPosition=i.extractPercentage(i.css['background-position'])[0]+'%';yPosition=i.extractPercentage(i.css['background-position'])[1]+'%';i.css['background-position']='calc('+xPosition+' - '+i.getOptionValue()['leftright']+'px) calc('+yPosition+' - '+i.getOptionValue()['updown']+'px)';if(i.onOptionChange){i.onOptionChange('select',i.css)}};this.getOptionValue=function(){var t=this;return{'sizeAdjust':parseInt(t.element.find('input[name="backgroundImageSizeAdjust"]').val()),'updown':parseInt(t.element.find('input[name="backgroundImageUpDown"]').val()),'leftright':parseInt(t.element.find('input[name="backgroundImageLeftRight"]').val())}};this.controlByKeyDown=function(t){if(!($(t.target).val())){$(t.target).val(0)};var e=Number($(t.target).val());if(e){e=e}
else{e=0};if(t.keyCode===38){if(t.ctrlKey)e+=100;else if(t.shiftKey)e+=10;else e+=1;$(t.target).val(e)}
else if(t.keyCode===40){if(t.ctrlKey)e-=100;else if(t.shiftKey)e-=10;else e-=1;$(t.target).val(e)}}};bm.extend(ToolOpBase,ToolOpDomBackgroundImage);ToolOpDomBackgroundImage.prototype.addEvent=function(){var t=this;$(t.element).find('input[data-wv-tool-option-value]').on('click',function(){$(this).select()});$(t.element).find('input[data-wv-tool-option-value]').on('keydown',function(e){var i=$(this).val();if(e.keyCode===13){if($.isNumeric(i)===!1){if($(this).attr('name')==='backgroundImageSizeAdjust'){$(this).val('기본')}
else{$(this).val(0)};bm.toast('숫자를 입력해주세요.');$(this).select();return!1};t.backgroundApply(e,$(this).attr('data-wv-tool-option-value'))}});$(t.element).find('input[data-wv-tool-option-value]').on('keydown',function(e){t.controlByKeyDown(e)})};ToolOpDomBackgroundImage.prototype.removeEvent=function(){var t=this;$(t.element).find('input[data-wv-tool-option-value]').off('focus');$(t.element).find('input[data-wv-tool-option-value]').off('keydown');$(t.element).find('input[data-wv-tool-option-value]').off('keyup')};var ToolOpDomBackgroundVideo=function(){var t=this;this.type='ToolOpDomBackgroundVideo';this.element=$('[data-wv-tool-option=ToolOpDomBackgroundVideo]');this.onOptionBtnClick=function(t){this.onOptionChange(t)}};bm.extend(ToolOpBase,ToolOpDomBackgroundVideo);ToolOpDomBackgroundVideo.prototype.addEvent=function(){var t=this};ToolOpDomBackgroundVideo.prototype.removeEvent=function(){var t=this};var ToolOpDomShadow=function(){this.type='ToolOpDomShadow';this.element=$('[data-wv-tool-option=ToolOpDomShadow]');this.colorPicker=ToolOpColorPicker.get();this.shadowColor=$(this.element).find('[data-wv-tool-option-btn="color"]').find('.choice_color');this.shadowOpacity=$(this.element).find('input[name="boxShadowOpacity"]');this.shadowUpDown=$(this.element).find('input[name="boxShadowUpDown"]');this.shadowLeftRight=$(this.element).find('input[name="boxShadowLeftRight"]');this.shadowBlur=$(this.element).find('input[name="boxShadowBlur"]');this.shadowRadius=$(this.element).find('input[name="boxShadowLeftRadius"]');this.cssList={};this.onOptionBtnClick=function(t){switch(t){case'color':this.showColorPicker();break;case'boxshadowApply':this.shadowApply();break;case'boxshadowDelete':this.shadowDelete();break}};this.showColorPicker=function(){var t=this;if(t.colorPicker.status===1){t.colorPicker.deactive()}
else if(t.colorPicker.status===0){$(t.colorPicker.element).find('.option_row.line').hide();$(t.colorPicker.element).find('.point_color_list_con').hide();$(t.colorPicker.element).find('#gradation_menu').hide();t.colorPicker.active($(this.element).closest('[data-wv-tool-btn="ToolBtnDomBoxShadow"]')[0],function(e,i){t.setShadowColor(e,i);t.hideColorPicker()});this.colorPicker.element.show()}};this.hideColorPicker=function(){this.colorPicker.hide();this.colorPicker.deactive()};this.setShadowColor=function(t,e){var n=this,i=bm.number.hexToRgb(e);if(!i){i={r:228,g:235,b:245,a:0}};i.a=1;n.shadowColor.css({backgroundColor:'rgba('+i.r+','+i.g+','+i.b+','+i.a+')'})};this.shadowApply=function(){var t=this,e=bm.number.rgbaToObj(t.shadowColor.css('backgroundColor')),i='rgba('+e.r+','+e.g+','+e.b+','+(100-Number(this.shadowOpacity.val()))/100+')';t.cssList['boxShadow']=i+' '+this.shadowLeftRight.val()+'px '+this.shadowUpDown.val()+'px '+this.shadowBlur.val()+'px '+this.shadowRadius.val()+'px';if(t.onOptionChange){t.onOptionChange('ToolOpDomShadow',t.cssList)}};this.shadowDelete=function(){var t=this;t.cssList['boxShadow']='none';if(t.onOptionChange){t.onOptionChange('ToolOpDomShadow',t.cssList)}}};bm.extend(ToolOpBase,ToolOpDomShadow);ToolOpDomShadow.prototype.addEvent=function(){var t=this;$(t.element).find('input[data-wv-tool-option-value]').on('click',function(){$(this).select()});$(t.element).find('input[data-wv-tool-option-value]').on('keydown',function(e){var i=$(this).val();if(e.keyCode===13){if($.isNumeric(i)===!1){if($(this).attr('name')==='boxShadowOpacity'){$(this).val(0)}
else{$(this).val(5)};bm.toast('숫자만 입력해 주세요.');$(this).select();return!1}
else if((i<0||i>100)&&$(this).attr('name')==='boxShadowOpacity'){$(this).val(0);bm.toast('투명도는 0 ~ 100%까지 설정가능합니다.');return!1};t.shadowApply()}})};ToolOpDomShadow.prototype.removeEvent=function(){var t=this;$(t.element).find('input[data-wv-tool-option-value]').off('focus');$(t.element).find('input[data-wv-tool-option-value]').off('keydown');$(t.element).find('input[data-wv-tool-option-value]').off('keyup');$(t.shadowUpDown).off('keydown');$(t.shadowLeftRight).off('keydown');$(t.shadowBlur).off('keydown');$(t.shadowRadius).off('keydown')};var ToolOpDomOpacity=function(){this.type='ToolOpDomOpacity';this.element=$('[data-wv-tool-option=ToolOpDomOpacity]');this.opacityValue=$(this.element).find('input[name="opacity"]');this.css={};this.onOptionBtnClick=function(t){switch(t){case'opacityApply':this.opacityApply();break;case'opacityDelete':this.opacityDelete();break}};this.setOpacity=function(){var t=Number($(this.opacityValue).val())/100;this.css['opacity']=t};this.opacityApply=function(){var t=this;if(this.onOptionChange){t.setOpacity();this.onOptionChange(this.css)}};this.opacityDelete=function(){this.css['opacity']='';if(this.onOptionChange){this.onOptionChange(this.css)}}};bm.extend(ToolOpBase,ToolOpDomOpacity);ToolOpDomOpacity.prototype.addEvent=function(){var t=this;$(t.element).find('input[type="text"]').on('click',function(t){$(this).focus();$(this).select()});$(t.element).find('input[type="text"]').on('keydown',function(e){if(e.keyCode===13){t.opacityApply()}});$(t.element).find('input[type="text"]').on('keyup',function(){var e=$(t.opacityValue).val();if(bm.valid.isOnlyNum(e)){if(e<0||e>100){bm.toast('투명도는 0 ~ 100까지 설정할 수 있습니다.');$(t.opacityValue).val(0);return!1}}
else{bm.toast('숫자를 입력해주세요.');$(t.opacityValue).val(0);return!1}})};ToolOpDomOpacity.prototype.removeEvent=function(){var t=this;$(t.element).find('input[type="text"]').off('click');$(t.element).find('input[type="text"]').off('keydown');$(t.element).find('input[type="text"]').off('keyup')};var ToolOpTableBorder=function(){var t=this;this.type='ToolOpTableBorder';this.element=$('[data-wv-tool-option=ToolOpTableBorder]');this.colorPicker=ToolOpColorPicker.get(this,this.type);this.borderColor='#e4ebf5';this.borderStyle='solid';this.onOptionBtnClick=function(t){switch(t){case'color':this.showColorPicker();break;case'solid':case'dotted':case'dashed':this.setBorderStyle(t);break}};this.showColorPicker=function(){if(this.colorPicker.status==1){t.colorPicker.deactive()}
else if(this.colorPicker.status==0){$(t.colorPicker.element).find('#gradation_menu').hide();this.colorPicker.active($(this.element).closest('[data-wv-tool-btn="ToolBtnTableBorder"]')[0],function(e,i){t.setBorderColor(i);t.hideColorPicker()});this.colorPicker.element.show()}};this.hideColorPicker=function(){t.colorPicker.hide();t.colorPicker.deactive()};this.setBorderColor=function(t){this.borderColor=t;$(this.element).find('.choice_color').css({'background-color':t})};this.setBorderStyle=function(t){this.borderStyle=t;$(this.optionBtnList).removeClass('active');$(this.optionBtnList[t]).addClass('active')};this.getBorderWidth=function(){var t=parseInt($(this.element).find('input.table_border_width_input').val());if(!t||isNaN(t))return 0;else return t}};bm.extend(ToolOpBase,ToolOpTableBorder);ToolOpTableBorder.prototype.addEvent=function(){var t=this;$(this.element).find('.table_border_btn').on('click',function(){var e=$(this).attr('data-wv-tool-option-value');if(t.onOptionChange){t.onOptionChange('ToolOpTableBorder',{width:t.getBorderWidth(),borderStyle:t.borderStyle,color:t.borderColor,direction:e})}});$(this.element).find('.table_border_width_input').on('focusout',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=$.trim(t);if(isNaN(t))t=0;$(this).val(t)}});$(this.element).find('.table_border_width_input').on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()})};ToolOpTableBorder.prototype.removeEvent=function(){var t=this;$(this.element).find('.table_border_btn').off('click');$(this.element).find('.table_border_width_input').off('focusout');$(this.element).find('.table_border_width_input').off('focus')};var ToolOpTableCellSize=function(){this.type='ToolOpTableCellSize';this.element=$('#ToolOpTableCellSize');this.unit='px';this.sizeInputField=$(this.element).find('.size_input_field');var t=this;this.onOptionBtnClick=function(t){this.changeUnit(t)};this.changeUnit=function(e,i){$(this.optionBtnList).removeClass('active');$(this.optionBtnList[e]).addClass('active');this.unit=e;if(!i){t.changeCellSizeByUnit(this.unit)}};this.changeCellSizeByUnit=function(t){var n=bm.tableSelectionManager.targetTable,h=n.offsetWidth,o=bm.tableSelectionManager.getColRange(n,bm.tableSelectionManager.selectedCellList),s=o.length,a=[];for(var e=0;e<s;e++){var i=o[e];if(t=='px'){a.push(parseInt(i.offsetWidth*100)/100)}
else{a.push(parseInt(i.offsetWidth/h*10000)/100)}};for(e=0;e<s;e++){var i=o[e];bm.table.colWidthChange(i,a[e],t)};var r=bm.tableSelectionManager.getCurrentCell(),l=bm.tableSelectionManager.getColRange(n,[r]),d=l[0].width;this.sizeInputField.val(parseInt(parseFloat(d)*100)/100)};this.setSize=function(e){if(t.onOptionChange){if(!e)t.sizeInputField.val();t.onOptionChange('ToolOpTableCellSize',{'width':e})}};this.timer;this.setKeyUpTargetValue=function(t,e){if(t.keyCode==8||(t.keyCode>=48&&t.keyCode<=57)||(t.keyCode>=96&&t.keyCode<=105)){var i=this,n=i.target;clearTimeout(i.timer);i.timer=setTimeout(function(){if(n!=i.target)return!1;var t=$(e).val();if(t!=0&&t!='0'&&t!=''){if(t.indexOf(i.unit)==-1){t=parseInt($.trim(t))};$(e).val(t);i.setSize(t+i.unit)}},500)}}};bm.extend(ToolOpBase,ToolOpTableCellSize);ToolOpTableCellSize.prototype.addEvent=function(){var t=this;$(t.sizeInputField).on('keyup',function(e){t.setKeyUpTargetValue(e,this)});$(t.sizeInputField).on('focus',function(t){var e=$(this).val();if(e!=0&&e!='0'&&e!=''&&e!='px'&&e!='%'){e=parseFloat($(this).val());if(isNaN(e))e=0};$(this).val(e);$(this).select()});$(this.element).on('click',function(t){t.stopImmediatePropagation()});$(this.element).find('.set_auto_width').on('mousedown',function(e){e.stopImmediatePropagation();if(t.onOptionChange){t.onOptionChange('ToolOpTableCellSize',{'width':'auto'})}});$(this.element).find('.set_same_width').on('mousedown',function(e){e.stopImmediatePropagation();if(t.onOptionChange){t.onOptionChange('ToolOpTableCellSize',{'width':'same%'})}});$(this.element).find('.color_code_input').on('mousedown',this.onTextInputDown)};ToolOpTableCellSize.prototype.removeEvent=function(){var t=$(this.element).find('.size_input_field');$(t).off('focus');$(t).off('keyup');$(this.element).find('.set_max_width').off('click');$(this.element).off('click')};var ToolOpTableSpace=function(){this.type='ToolOpTableSpace';this.element=$('[data-wv-tool-option=ToolOpTableSpace]');var t=this;this.focusedCellList;this.onOptionBtnClick=function(e){switch(e){case'px':t.unitChange('px');break;case'%':t.unitChange('%');break;case'removeSpace':t.onOptionChange(t.type,'removeSpace');break}};var e=$(this.element).find('[data-wv-tool-option-btn=\'px\']'),i=$(this.element).find('[data-wv-tool-option-btn=\'%\']');this.unit='px';this.unitChange=function(t){if(t!=this.unit){if(t=='px'){$(e).addClass('active');$(i).removeClass('active')}
else{$(e).removeClass('active');$(i).addClass('active')}};this.unit=t};this.timer;this.setKeyUpTargetValue=function(t,e){if(t.keyCode==8||(t.keyCode>=48&&t.keyCode<=57)||(t.keyCode>=96&&t.keyCode<=105)){var i=this,n=i.target;clearTimeout(i.timer);i.timer=setTimeout(function(){if(n!=i.target)return!1;var t=$(e).val();if(t!=0&&t!='0'&&t!=''){t=$.trim(t)+i.unit;$(e).val(t)}
else{t=''};var a=$(e).attr('data-wv-tool-option-btn'),o={};o[a]=t;i.onOptionChange(i.type,o)},500)}};if(isExpertMode==!1){this.paddingBtnList=$(this.element).find('.white_space_control_con input');this.optionBtnList['paddingTop']=$(this.element).find('.white_space_control_con .top input');this.optionBtnList['paddingRight']=$(this.element).find('.white_space_control_con .right input');this.optionBtnList['paddingBottom']=$(this.element).find('.white_space_control_con .bottom input');this.optionBtnList['paddingLeft']=$(this.element).find('.white_space_control_con .left input')}};bm.extend(ToolOpBase,ToolOpTableSpace);ToolOpTableSpace.prototype.active=function(t,e){this.onOptionChange=e;this.registListener()};ToolOpTableSpace.prototype.deactive=function(){};ToolOpTableSpace.prototype.addEvent=function(){var t=this;$(this.paddingBtnList).on('focusout',function(e){var i=$(this).val();if(i!=''){i=$.trim(i);i=i.indexOf(t.unit)==-1?i+t.unit:i;$(this).val(i)}
else{i=''};var o=$(this).attr('data-wv-tool-option-btn'),n={};n[o]=i;clearTimeout(t.timer);t.onOptionChange(t.type,n,t.focusedCellList)});$(this.paddingBtnList).on('focus',function(e){var i=$(this).val();if(i!=0&&i!='0'&&i!=''&&i!='px'&&i!='%'){i=parseFloat($(this).val());if(isNaN(i))i=0};$(this).val(i);$(this).select();t.focusedCellList=bm.tableSelectionManager.getRange()});$(this.paddingBtnList).on('keyup',function(e){t.setKeyUpTargetValue(e,this)})};ToolOpTableSpace.prototype.setOptionValue=function(t){this.optionBtnList['paddingTop'].value=t['paddingTop'];this.optionBtnList['paddingRight'].value=t['paddingRight'];this.optionBtnList['paddingBottom'].value=t['paddingBottom'];this.optionBtnList['paddingLeft'].value=t['paddingLeft']};ToolOpTableSpace.prototype.removeEvent=function(){var t=this;$(this.paddingBtnList).off('focusout');$(this.paddingBtnList).off('focus');$(this.paddingBtnList).off('keyup')};var ToolOpTableCaption=function(){this.type='ToolOpTableCaption';this.element=$('[data-wv-tool-option=ToolOpTableCaption]');var t=this;this.captionInputList=$(this.element).find('.table_title_input, .table_summary_textarea');this.optionBtnList['titleInput']=$(this.element).find('input.table_title_input')[0];this.optionBtnList['summaryInput']=$(this.element).find('textarea.table_summary_textarea')[0];this.onOptionBtnClick=function(t){switch(t){case'apply':this.setCaption();break}};this.setCaption=function(){var e=$(this.element).find('.table_title_input').val(),i=$(this.element).find('.table_summary_textarea').val();t.onOptionChange('apply',{caption:e,summary:i})}};bm.extend(ToolOpBase,ToolOpTableCaption);ToolOpTableCaption.prototype.addEvent=function(){var t=this;$(this.captionInputList).on('input',function(e){var i=$(this).val();if($(this).hasClass('table_title_input')){t.onOptionChange(t.type,{caption:i})}
else{t.onOptionChange(t.type,{summary:i})}});$(this.captionInputList).on('keydown',function(e){if(e.keyCode==13){var i=$(this).val();if($(this).hasClass('table_title_input')){t.onOptionChange(t.type,{caption:i})}
else{t.onOptionChange(t.type,{summary:i})}}});$(this.captionInputList).on('focus',function(t){$(this).select()})};ToolOpTableCaption.prototype.removeEvent=function(){var t=this;$(this.captionInputList).off('focusout');$(this.captionInputList).off('focus')};ToolOpTableCaption.prototype.setOptionValue=function(t){if(this.optionBtnList['titleInput']){this.optionBtnList['titleInput'].value=t['caption']};if(this.optionBtnList['summaryInput']){this.optionBtnList['summaryInput'].value=t['summary']}};var ToolOpGrid=function(){this.type='ToolOpGrid';this.element=$('[data-wv-tool-option=ToolOpGrid]');this.columnSet=this.element.find('#gridColumnSet');this.columnMobileSet=this.element.find('#gridMobileColumnSet');this.applyList={column:null,columnMobile:null};this.onOptionBtnClick=function(t){};this.applyConfig=function(){var t=this;t.applyList['column']=t.getOptionValue().column;t.getOptionValue().mobileApply?t.applyList['columnMobile']=t.getOptionValue().columnMobile:t.applyList['columnMobile']=null;t.getOptionValue().autoResponsive?t.applyList['autoResponsiveGrid']=!0:t.applyList['autoResponsiveGrid']=!1;if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.STUDIO){t.applyList['withText']=!0}
else{t.applyList['withText']=!1};if(wvAdminIFrameBridge.toolManager.toolList['ToolGrid'].toolBtnList['ToolBtnGrid'].onOptionChange){wvAdminIFrameBridge.toolManager.toolList['ToolGrid'].toolBtnList['ToolBtnGrid'].onOptionChange('ToolOpGrid',t.applyList)}
else{bm.toast('새로고침 후 다시 시도해주세요.')}};this.getOptionValue=function(){var t=this;bm.toast('단 수가 변경되었습니다.');return{column:parseInt(t.columnSet.find('[gridsection].active').attr('gridsection')),columnMobile:parseInt(t.columnMobileSet.find('[gridsection].active').attr('gridsection')),mobileApply:t.element.find('input[id="mobileGrid"]').prop('checked'),autoResponsive:t.element.find('input[id="autoResponsiveGrid"]').prop('checked')}}};bm.extend(ToolOpBase,ToolOpGrid);ToolOpGrid.prototype.addEvent=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolGrid'].toolBtnList['ToolBtnGrid'].optionList['ToolOpGrid'];t.columnSet.find('[gridSection]').off('click').on('click',function(){$(this).siblings().removeClass('active');$(this).siblings().find('a').removeClass('active');$(this).addClass('active').find('a').addClass('active');t.applyConfig()});if(isExpertMode){t.columnMobileSet.find('[gridSection]').off('click').on('click',function(){$(this).siblings().removeClass('active');$(this).siblings().find('a').removeClass('active');$(this).addClass('active').find('a').addClass('active');t.applyConfig()})}
else{t.columnMobileSet.off('change').on('change',function(){t.applyConfig()})}};ToolOpGrid.prototype.removeEvent=function(){var t=this};var ToolOpInsta=function(){this.type='ToolOpInsta';this.element=$('[data-wv-tool-option=ToolOpInsta]');this.onOptionBtnClick=function(t){};this.applyConfig=function(){var t=this};this.getOptionValue=function(){var t=this};this.instaAPIready=function(){var t=this;const apiRoot='https://zgai.ai/';const param={site_id:SITE_ID};bm.httpSendJsonPost(apiRoot+'instagram/getInstaFeed',param,function(t){if(t['result']){console.log('이미 인스타그램이 연동되어 있습니다.')}
else{if(t['errCode']==='2'){console.log(t['message']);const instagram_ready_url=apiRoot+'instagram/ready';const combinedUrl=instagram_ready_url+'?site_id='+param['site_id'];window.open(combinedUrl,'instagram_auth','width=800,height=600');ToolInsta.prototype.closeConfig()}}})};this.instaUnLink=function(){var t=this;const apiRoot='https://zgai.ai/';const param={site_id:SITE_ID};bm.httpSendJsonPost(apiRoot+'instagram/unLinkInsta',param,function(t){if(t['result']){bm.toast('인스타그램 연동이 해제되었습니다.\n새로고침하시면 페이지에 반영이 됩니다.');ToolInsta.prototype.closeConfig()}
else{if(t['errCode']==='2'){console.log(t['message'])}}})}};bm.extend(ToolOpBase,ToolOpInsta);ToolOpInsta.prototype.addEvent=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolInsta'].toolBtnList['ToolBtnInsta'].optionList['ToolOpInsta'];$(this.optionBtnList['linking']).on('click',function(){bm.toast('2024년 상반기 인스타그램연동이 오픈예정입니다.');return!1;if($(this).attr('needlink')==='true'){if(confirm('인스타그램을 연동 후에 페이지를 저장한 후 새로고침해주세요.')===!0){try{t.instaAPIready()}catch(e){console.log(e)}}}
else{if(confirm('인스타그램을 연동해제하시겠습니까?')===!0){try{t.instaUnLink()}catch(e){console.log(e)}}}})};ToolOpInsta.prototype.removeEvent=function(){var t=this;$(this.optionBtnList['linking']).off('click')};var ToolOpHeaderFooterSetting=function(){var t=this;this.type='ToolOpHeaderFooterSetting';this.element=$('[data-wv-tool-option=ToolOpHeaderFooterSetting]');this.logoType='';this.data={};this.selectedBlockInfo;this.onOptionBtnClick=function(e){if(e==='changeHeader'){t.openBlockListPop('header')}
else if(e==='changeFooter'){t.openBlockListPop('footer')}
else if(e==='displayHeader'||e==='displayFooter'){t.onOptionChange(e)}
else if(e==='whiteBgLogo'||e==='blackBgLogo'){t.logoType=e;var i=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(i).css('max-width','1600px');$(i).on('load',function(){i.contentWindow.fileManager.onSelectCallBack=t.onFileManagerFileSelected})}};this.onFileManagerFileSelected=function(e){var n=e.extension.toLowerCase(),o=new RegExp('png');if(!o.test(n)){alert('로고는 png 확장자 파일로만 변경 가능합니다.');return};var i=fixedEncodeURI(e.thumbImg);t.onOptionChange(t.logoType,{imgPath:i,width:e.width,height:e.height});bm.popupManager.removePopLatest()};this.openBlockListPop=function(t){var e=this,i;if(t==='header')i='헤더';else if(t==='footer')i='푸터';e.selectedBlockInfo=i;if(e.data[t]&&e.data[t].length>0){e.$showBlockPopup=bm.popupManager.add('#showHeaderFooterBlockListPop',!1,null,[0,0,0,0],!0,!0,undefined,100006);if(!isExpertMode){$(e.$showBlockPopup).css('height','90%')}
else{$(e.$showBlockPopup).find('#changeHeaderFooterBtn').text(i+' 반영하기');$(e.$showBlockPopup).find('.popup_close_btn > a').text('');$(e.$showBlockPopup).find('.block_list_cnt_con').find('span').text(e.data[t].length+'개의 '+i)};$(e.$showBlockPopup).find('.popup_title').text(i+' 블록 템플릿');$(e.$showBlockPopup).find('[data-wv-block-template]').removeClass('selected curr_block');var a=$(wvAdminIFrameBridge.iframeWindow.document.body).find('[data-wv-inc^='+t+']'),o=a.attr('data-wv-block-id');if(!o)o=$(a.find('[data-wv-layout-element="block"]')[0]).attr('data-wv-block-id');if(o)o=o.replaceAll('___','');var r=$(e.$showBlockPopup).find('[data-wv-toolbar-side-block-id="'+o+'"]');r.addClass('curr_block');var s=$(e.$showBlockPopup).find('.show_all_block_list_con').children();s.each(function(t,e){if($(e).attr('data-wv-toolbar-side-block-tag').indexOf(i)>-1){$(e).show()}
else{$(e).hide()}})}
else{var n={startPage:1,numPerPage:100};n['memberSeq']=-1;n['isOwn']=0;n['themeId']=getThemeId();n['themeRev']=getThemeRev();n['isMaster']=getIsMasterMode();const kor=t==='header'?'헤더':'푸터';n['tagNameList[]']=[kor];bm.httpSendJsonPost(WEB_ROOT+'blockTemplateManage/getPublicBlockList',n,function(n){if(n.result){e.data[t]=n.data.result;if(e.data[t].length>0){e.$showBlockPopup=bm.popupManager.add('#showHeaderFooterBlockListPop',!1,null,[0,0,0,0],!0,!0,undefined,100006);if(!isExpertMode){$(e.$showBlockPopup).css('height','90%')}
else{$(e.$showBlockPopup).find('#changeHeaderFooterBtn').text(i+' 반영하기');$(e.$showBlockPopup).find('.popup_close_btn > a').text('');$(e.$showBlockPopup).find('.block_list_cnt_con').find('span').text(e.data[t].length+'개의 '+i)};$(e.$showBlockPopup).find('.popup_title').text(i+' 블록 템플릿');for(var a=0;a<e.data[t].length;a++){e.renderBlock(e.data[t][a])};bm.popupManager.repositioning('#showHeaderFooterBlockListPop');var s=$(wvAdminIFrameBridge.iframeWindow.document.body).find('[data-wv-inc^='+t+']'),o=s.attr('data-wv-block-id');if(!o)o=$(s.find('[data-wv-layout-element="block"]')[0]).attr('data-wv-block-id');if(o)o=o.replaceAll('___','');var l=$(e.$showBlockPopup).find('[data-wv-toolbar-side-block-id="'+o+'"]');l.addClass('curr_block');var r=$(e.$showBlockPopup).find('.show_all_block_list_con').children();r.each(function(t,e){if($(e).attr('data-wv-toolbar-side-block-tag').indexOf(i)>-1){$(e).show()}
else{$(e).hide()}});$(e.$showBlockPopup).find('[data-wv-block-template]').off('click').on('click',function(t){if($(t.target).closest('.show_all_block_list_inner').length>0){var i=$(this);$(e.$showBlockPopup).find('[data-wv-block-template]').removeClass('selected');i.addClass('selected');e.selectedBlockInfo={contentId:i.attr('data-wv-toolbar-side-block-id'),contentRev:i.attr('data-wv-toolbar-side-block-rev'),contentHtml:i.attr('data-wv-toolbar-side-block-html'),contentCss:i.attr('data-wv-toolbar-side-block-css'),contentJs:i.attr('data-wv-toolbar-side-block-script')}}});$(e.$showBlockPopup).find('#changeHeaderFooterBtn').off('click').on('click',function(n){n.stopPropagation();if($(n['target']).text().includes('헤더')){i='헤더';t='header'}
else{i='푸터';t='footer'};if(e.selectedBlockInfo&&confirm(i+' 변경 시 로고 및 사용중인 '+i+'는 모두 초기화 됩니다.')){if(e.onOptionChange){if(t==='header')e.onOptionChange('changeHeader',e.selectedBlockInfo);else if(t==='footer')e.onOptionChange('changeFooter',e.selectedBlockInfo)}}});$(e.$showBlockPopup).find('[data-wv-block-template]').off('dblclick').on('dblclick',function(t){t.stopPropagation();if($(t.target).closest('.show_all_block_list_inner').length>0&&e.selectedBlockInfo){$(e.$showBlockPopup).find('#changeHeaderFooterBtn').trigger('click')}})}
else{bm.toast(kor+'블록은 준비중입니다.')}}
else{alert(n.message)}})}};this.renderBlock=function(t){var e=t['tag_name']?t['tag_name']:'';if(isExpertMode){var i='<div data-wv-block-template class="col-12 col-md-6 col-xl-4 show_all_block_list"                   data-side-item-type="block" title="'+t['subject']+'"                   data-wv-toolbar-side-block-id="'+t['id']+'"                   data-wv-toolbar-side-block-rev="'+t['revision']+'"                   data-wv-toolbar-side-block-html="'+t['html']+'"                   data-wv-toolbar-side-block-css="'+t['css']+'"                   data-wv-toolbar-side-block-script="'+t['js']+'"                   data-wv-toolbar-side-block-tag="'+e+'">                <div class="col-12 show_all_block_list_inner">                    <div class="col-12 block_img_con">                       <img src="'+t['thumbnail']+'" alt="'+t['id']+'" data-wv-toolbar-side-block-thumb>                    </div>                    <div class="col-12 block_title_con">                        <div class="col-12 block_title">'+t['subject']+'                       </div>                        <div class="col-12 block_desc">'+e+'                       </div>                       <div class="col-0 is_using_block"></div>                    </div>               </div>           </div>'}
else{var i='<div data-wv-block-template class="col-12 col-sm-6 col-md-4 col-lg-3 show_all_block_list"                   data-side-item-type="block" title="'+t['subject']+'"                   data-wv-toolbar-side-block-id="'+t['id']+'"                   data-wv-toolbar-side-block-rev="'+t['revision']+'"                   data-wv-toolbar-side-block-html="'+t['html']+'"                   data-wv-toolbar-side-block-css="'+t['css']+'"                   data-wv-toolbar-side-block-script="'+t['js']+'"                   data-wv-toolbar-side-block-tag="'+e+'">                <div class="col-12 show_all_block_list_inner">                    <div class="col-12 block_title_con">                        <div class="col-12 block_title">'+t['subject']+'                       </div>                        <div class="col-12 block_desc">'+e+'                       </div>                    </div>                    <div class="col-12 block_img_con">                       <img src="'+t['thumbnail']+'" alt="'+t['id']+'" data-wv-toolbar-side-block-thumb>                    </div>               </div>           </div>'};$(this.$showBlockPopup).find('.show_all_block_list_con').append(i);$(this.$showBlockPopup).find('.is_using_block').text('사용중인 '+this.selectedBlockInfo)}};bm.extend(ToolOpBase,ToolOpHeaderFooterSetting);ToolOpHeaderFooterSetting.prototype.addEvent=function(){var t=this};ToolOpHeaderFooterSetting.prototype.removeEvent=function(){var t=this};var ToolOpTextAlign=function(){this.type='ToolOpTextAlign';this.element=$('[data-wv-tool-option=ToolOpTextAlign]');this.cssList={}};bm.extend(ToolOpBase,ToolOpTextAlign);ToolOpTextAlign.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.preventDefault();e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange('ToolOpTextAlign',i)}})};ToolOpTextAlign.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolOpSvg=function(){this.type='ToolOpSvg';this.element=$('[data-wv-tool-option=ToolOpSvg]')};bm.extend(ToolOpBase,ToolOpSvg);ToolOpSvg.prototype.addEvent=function(){var t=this;$(this.element).find('.list_contents').on('click',function(e){e.stopImmediatePropagation();var i=$(this).attr('data-wv-tool-option-value');t.selectedValue=i;if(t.onOptionChange){t.onOptionChange(i)}})};ToolOpSvg.prototype.removeEvent=function(){var t=this;$(this.element).find('.list_contents').off()};var ToolBtnBase=function(){this.btnList=[];this.optionList=[];this.focusBtn=null;this.activeOption=null;this.onOptionShow=null;this.onOptionHide=null;this.innerWindow=window;this.selectStartHandler=function(t){t.preventDefault()};this.preventEditHandler=function(t){this.isPreventEdit=!1;var e='';if(this instanceof Node===!1){if(bm.toolManager.isMenuTarget&&!bm.toolManager.menuEditableToolList.includes(this.type)){this.isPreventEdit=!0;e='메뉴 관련 블록에 해당 설정을 적용할 수 없습니다.<br/>글꼴, 글자 크기/굵기/색상/모양/간격, 줄 간격, 여백, 블록 좌우정렬, 채우기 설정만 가능합니다.'};if(bm.toolManager.isShopListTarget&&!bm.toolManager.shopListEditableToolList.includes(this.type)){this.isPreventEdit=!0;e='상품리스트 블록에 해당 설정을 적용할 수 없습니다.'};if($(bm.toolManager.targetElement).attr('data-wv-space-block')!==undefined&&!bm.toolManager.spaceBlockEditableToolList.includes(this.type)){this.isPreventEdit=!0;e='여백 블록에 해당 설정을 적용할 수 없습니다.'};if(this.isPreventEdit){t.preventDefault();t.stopImmediatePropagation();bm.toast(e);return!1}}};this.inputNumUpDownHandler=function(t){var i=t.target,d=['ToolBtnTextLink'];if(!t.originalEvent){return};if($(i).attr('type')==='text'&&!d.includes($(i).attr('data-wv-tool-btn'))){var n=t.originalEvent.code.toLowerCase(),e=i.value,a=e.length,o='',s=['margin','Spacing','boxShadow','textShadow'],r=$(i).attr('data-wv-tool-btn-prop')?$(i).attr('data-wv-tool-btn-prop'):null,l=s.some(function(t){return r.includes(t)});if(n&&(n==='arrowdown'||n==='arrowup')){if((e.includes('px')&&e.lastIndexOf('px')!==a-2)||(e.includes('%')&&e.lastIndexOf('%')!==a-1))return;if(e.includes('px'))o='px';if(e.includes('%'))o='%';e=parseFloat(e);if(isNaN(e))return;switch(n){case'arrowdown':if(t.ctrlKey)e-=100;else if(t.shiftKey)e-=10;else if(t.altKey)e-=0.1;else e--;break;case'arrowup':if(t.ctrlKey)e+=100;else if(t.shiftKey)e+=10;else if(t.altKey)e+=0.1;else e++;break};e=Math.round(e*10)/10;if(e<0&&!(l))e=0;i.value=e+o}}};this.inputNumUpDownApplyHandler=function(t,e){const _this=e;if((t.keyCode===38||t.keyCode===40)&&_this.isInputElement(t['target'])===!0){if(t['target']['value']!=_this['formerValue']){$(t['target']).trigger(jQuery.Event('keydown',{keyCode:13,which:13}))}}};this.isInputElement=function(t){if(t&&t['isConnected']){return t instanceof HTMLInputElement}};this.inputFocusHandler=function(t,e){const _this=e;if(_this.isInputElement(t['target'])===!0){_this['formerValue']=t['target']['value']}};this.inputFocusOutHandler=function(t,e){const _this=e;if(t.keyCode===9&&_this.isInputElement(t['target'])===!0){if(t['target']['value']!=_this['formerValue']){$(t['target']).trigger(jQuery.Event('keydown',{keyCode:13,which:13}))}}};this.onBtnClick=function(t,e){events(this).dispatch(ToolButtonEvent.CLICK,{prop:e,event:t})};this.onBtnKeyUp=function(t,e){events(this).dispatch(ToolButtonEvent.KEY_UP,{prop:e,event:t})};this.onOptionChange=function(t,e){}};ToolBtnBase.prototype={init:function(t,e,i){this.type=t;this.toolSetType=e;if($('#WEVEN_IFRAME').length>0){this.innerWindow=$('#WEVEN_IFRAME')[0].contentWindow};this.addBtn(i);this.target;this.selectedValue;this.selectedBtn;this.status=0;var n,o,a=this.optionList.length;for(n=0;n<a;n++){o=this.optionList[n];o.init()}},findBtnObj:function(t){const btnAttr=$(t['target']).attr('data-wv-tool-btn');if(btnAttr!==undefined){const toolList=wvAdminIFrameBridge['toolManager']['toolList'];for(let i=0;i<toolList['length'];i++){const toolbtnList=toolList[toolList[i]['type']]['toolBtnList'];for(let j=0;j<toolbtnList['length'];j++){if(toolbtnList[j]['type']===btnAttr){return toolbtnList[j]}}}}
else{console.warn('해당 버튼의 data-wv-tool-btn 속성이 없습니다.')}},setSelectedValue:function(t,e){this.selectedValue=t;var a=e?this.btnList[e]:this.btnList[0],n=$(a).find('.label');if(n.length>0){n.text(t);n.val(t)};var i=[];if(this.optionList.length>0&&this.optionList[e]){var o=this.optionList[e].element;i=$(o).find('.list_contents');if(i.length>0){i.removeClass('on');$(o).find('.list_contents[data-wv-tool-option-value=\''+t+'\']').addClass('on')}};if(n.length==0&&i.length==0){this.setSelectedBtn(e)}},setSelectedBtn:function(t){this.selectedBtn=this.btnList[t];$(this.btnList).removeClass('active');$(this.btnList[t]).addClass('active')},getSelectedOptionIndex:function(t,e){var n=this.optionList[t];if(!this.selectedValue){var o=$(this.btnList[t]).attr('data-wv-tool-btn'),i=$(n.element).closest('[data-wv-tool-btn=\''+o+'\']').find('input[data-wv-tool-btn=\''+o+'\']').val();if(!i)i=$(n.element).closest('[data-wv-tool-btn=\''+o+'\']').find('.label').text();this.selectedValue=isNaN(parseInt(i))?i:parseInt(i)};var a=$(n.element).find('.list_contents').index($(n.element).find('.list_contents[data-wv-tool-option-value=\''+this.selectedValue+'\']'));if(a==-1){return this.findOptionIndex(t,e)};return a},getSamplingElement:function(t){var e,i=bm.selectionManager.getAllNode();if(bm.selectionManager.isCollapsed()){if(bm.toolManager.isMultiSelectMode){e=t[0]}
else{e=this.target}}
else{if(i==null||i.length==0)e=t[0];else{e=i[0];if(e.nodeType!=1){e=e.parentElement}}};return e},findOptionIndex:function(t,e){var r=this.optionList[t],o=$(r.element).find('.list_contents'),a=o.length,i,s=parseFloat(this.selectedValue);if(e=='up'){for(i=0;i<a;i++){var n=parseFloat($(o[i]).attr('data-wv-tool-option-value'));if(s<n){return i-1}}}
else{for(i=a;i>-1;i--){var n=parseFloat($(o[i]).attr('data-wv-tool-option-value'));if(s>n){return i+1}}}},setPrevOption:function(t){var e=this.optionList[t],i=$(e.element).find('.list_contents'),n=this.getSelectedOptionIndex(t,'up');if(n<i.length-1){var o=i.eq(++n).attr('data-wv-tool-option-value');this.onOptionChange(e.type,o)}},setNextOption:function(t){var e=this.optionList[t],o=$(e.element).find('.list_contents'),i=this.getSelectedOptionIndex(t,'down');if(i>0){var n=o.eq(--i).attr('data-wv-tool-option-value');this.onOptionChange(e.type,n)}},changeBtnValueByOne:function(t,e,i){if(e==='up'){$(this.btnList[t]).val(parseInt($(this.btnList[t]).val())+1)}
else if(e==='down'){$(this.btnList[t]).val(parseInt($(this.btnList[t]).val())-1)};if(i)i()},setBtnValueByOne:function(t,e,i,n){var o=0;$(this.btnList[t]).on('mousedown',function(){o=setTimeout(function(){e[i]=!0;n()},300)}).on('mouseup mouseout mouseleave',function(){e[i]=!1;clearTimeout(o)})},addOption:function(t,e,i){if(e){this.optionList[e]=t};if(i){this.optionList[e]['toolbtn']=i};this.optionList.push(t)},addBtn:function(t){var e=$(t).attr('data-wv-tool-btn-prop');this.btnList[e]=t;this.btnList.push(t)},show:function(){if(this.isShow==!1||!this.isShow){$(this.btn).show();this.isShow=!0}},hide:function(){if(this.isShow==!0){$(this.btn).hide();$(this.focusBtn).removeClass('list_on');$(this.optionList).hide();this.optionList.forEach(function(t){t.deactive()});this.isShow=!1}},noneHideTypeList:['ToolOpTableSpace','ToolOpDomBackgroundBorder'],showOption:function(t,e){this.activeOption=t;$(e).parents('.toolset').addClass('active');$(e).parents('.tool_separation').addClass('active');if($(e).parents('[data-wv-tool-btn]').length>0)e=$(e).parents('[data-wv-tool-btn]');$(e).addClass('list_on');$(t.element).show();if(t.type=='ToolOpColorPicker'&&(this.type=='ToolBtnTextColor'&&!this.target.length&&!bm.selectionManager.isCollapsed())){$(t.element).find('.apply_point_color').hide()}
else{$(t.element).find('.apply_point_color').show()};if(t.type==='ToolOpColorPicker'&&(this.type==='ToolBtnDomBackgroundColor'||this.type==='ToolBtnDomBackgroundDim')){$(t.element).find('#gradation_menu').show()}
else{$(t.element).find('#gradation_menu').hide()};const ableBtn=function(t,e){if(!$(t)[0])return!1;if(e===!1){$(t).css({'border':'1px solid #cccccc','background-color':'#f0f0f0','color':'#aaaaaa','font-weight':'400','cursor':'not-allowed','opacity':'0.6'});$(t).attr('title','로컬스타일을 적용할 수 없는 편집모드입니다');$(t).attr('onclick','return false')}
else{$(t).css({'border':'','background-color':'','color':'','font-weight':'','padding-top':'','cursor':'','opacity':'','pointer-events':''});$(t).removeAttr('title');$(t).removeAttr('onclick')}};if(isExpertMode===!0){if(t.type==='ToolOpColorPicker'&&(this.type==='ToolBtnTableBackground'||this.type==='ToolBtnTableBorder'||this.type==='ToolBtnDomBackgroundDim'||this.type==='ToolBtnDomBackgroundVideo'||this.type==='ToolBtnSvg')){ableBtn($(t.element).find('#libraryAddBtn'),!1);ableBtn($(t.element).find('[colorpickertab="libraries"]'),!1)}
else{ableBtn($(t.element).find('#libraryAddBtn'),!0);ableBtn($(t.element).find('[colorpickertab="libraries"]'),!0)};if(templateEditMode!==!1){ableBtn($(t.element).find('#libraryAddBtn'),!1);ableBtn($(t.element).find('[colorpickertab="libraries"]'),!1)}}
else{ableBtn($(t.element).find('#libraryAddBtn'),!1);ableBtn($(t.element).find('[colorpickertab="libraries"]'),!1)};if(this.onOptionShow)this.onOptionShow(e,t);var i=this;t.active(e,function(){i.onOptionChange.apply(i,arguments)})},hideOption:function(t,e){if(t.colorPicker){t.colorPicker.element.find('.option_row').show();t.colorPicker.element.find('.point_color_list_con').show()};this.activeOption=null;$(e).parents('.toolset').removeClass('active');$(e).parents('.tool_separation').removeClass('active');if($(e).parents('[data-wv-tool-btn]').length>0)e=$(e).parents('[data-wv-tool-btn]');$(e).removeClass('list_on');if(t.type=='ToolOpColorPicker'&&this.type=='ToolBtnDomBackgroundColor')$(t.element).find('#gradation_menu').hide();$(t.element).hide();t.deactive();if(this.onOptionHide)this.onOptionHide(e,t)},hideOptionAll:function(t){if(this.type!=t){if(this.activeOption){this.hideOption(this.activeOption,this.focusBtn)}};var i;for(var e=0;e<this.optionList.length;e++){i=this.optionList[e];i.hideComponentAll(t)}},changeTarget:function(t){this.target=t},active:function(t){this.target=t;if(this.status==1)return;this.status=1;this.registListener()},deactive:function(){this.target=null;if(this.status==0)return;this.status=0;if(this.activeOption){this.hideOption(this.activeOption,this.focusBtn)};if(this.focusBtn){this.doFocusOutBtn(this.focusBtn)};this.hideOptionAll();this.removeListener()},doFocusBtn:function(t){this.focusBtn=t;if($(t).attr('readonly')!=='readonly'){$(t).select()}},doFocusOutBtn:function(t){$(t).removeClass('active');this.focusBtn=null},registListener:function(){var t=this,o=['ToolBtnTextSize','ToolBtnTextColor','ToolBtnTextLetterSpacing','ToolBtnTextLineHeight'];if(this.type.indexOf('ToolBtnText')==0&&this.type.indexOf('ToolBtnHistory')==0&&o.indexOf(this.type)==-1){$(this.btnList).on('mousedown',this.selectStartHandler)};$(this.btnList).on('mousedown',this.preventEditHandler.bind(this));if(isExpertMode){$(this.btnList).on('mousedown',function(i){const judge=function(t){if($(t).attr('data-wv-tool-btn-prop')&&$(t).attr('data-wv-tool-btn-prop').toLowerCase().includes('expand')){return!1}
else{return!0}};if(judge(this)){const getObj=function(){let obj={};for(let e=0;e<t['optionList']['length'];e++){if(t['optionList'][e]['type']==='ToolOpColorPicker'){obj['option']=t['optionList'][e]}};for(let e=0;e<t['btnList']['length'];e++){if(judge(t['btnList'][e])){obj['btn']=t['btnList'][e]}};return obj};const obj=getObj();if(obj['option']&&obj['btn']){t.hideOption(getObj()['option'],getObj()['btn'])}}})};$(this.btnList).on('click',function(e){if(isExpertMode){if(t.type!='ToolBtnHeaderFooterSetting'&&$(e['target']).attr('type')!=='color'){e.stopImmediatePropagation()}}
else{e.stopImmediatePropagation()};if(t.isPreventEdit)return!1;if($('#WEVEN_IFRAME').length>0&&wvAdminIFrameBridge._WVContentArea.designMode!==EDITOR_MODE.BOARD){if((t.type!=='ToolBtnHistory'&&t.type!=='ToolBtnTextHistory'&&t.type!=='ToolBtnHeaderFooterSetting'&&t.type!=='ToolBtnGridMaxWidth')&&!t.target){bm.toast('선택된 블록이 없습니다.');return}};if(bm.toolManager&&bm.toolManager.activeStatus){bm.toolManager.setFocusToolBtn(t.type)};if(bm.bmEditorManager&&Object.keys(bm.bmEditorManager.list).length>0){bm.bmEditorManager.hideAllTool(t.type)};var n=$(this).attr('data-wv-tool-btn-prop'),i;if(!n){if(t.optionList.length>0){i=t.optionList[0]}}
else{if(t.optionList[n]){i=t.optionList[n]}};if(i){if(i.status==1){t.hideOption(i,this);t.doFocusOutBtn(this)}
else{if(this==t.focusBtn&&$(this).hasClass('list_on')){t.hideOption(i,this);t.doFocusOutBtn(this)}
else{t.doFocusBtn(this);t.showOption(i,this)}}}
else{t.doFocusBtn(this);t.onBtnClick(e,n);if(n=='reset'){if($(this).attr('id')=='resetSizeBtn'){bm.toast('Size설정이 초기화되었습니다.')}
else if($(this).attr('id')=='resetSpacingBtn'){bm.toast('Spacing설정이 초기화되었습니다.')}
else if($(this).attr('id')=='resetBorderBtn'){bm.toast('Border설정이 초기화되었습니다.')}
else{bm.toast('설정값이 모두 초기화 되었습니다.')}}}});$(this.btnList).not('div').on('keydown',this.inputNumUpDownHandler);$(this.btnList).not('div').on('keydown',function(e){t.inputFocusOutHandler(e,t)});$(this.btnList).not('div').on('keyup',function(e){t.inputNumUpDownApplyHandler(e,t)});$(this.btnList).not('div').on('focus',function(e){t.inputFocusHandler(e,t)});var e,i,n=this.optionList.length;for(e=0;e<n;e++){i=this.optionList[e];events(i).addListener('toolSetOptionCloseCall',function(e){t.hideOption(t.activeOption,t.focusBtn)})};this.addEvent()},applyResourceStyle:function(t,e,i,n,o){var r=this;if(!n)n=this.target;if(bm.toolManager.isMultiSelectMode){if(!n['length'])n=bm.toolManager.targetElementList.concat();$(n).each(function(){var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,this)};var s=WVAdminResourceManager.checkNewResourceId(n);if(s!=null){a.copyStyleBySelector('[data-wv-res-id="'+s.old+'"]','[data-wv-res-id="'+s.new+'"]')};a.applyResourceStyle(this,t,e,i,!1,!0,o);a.refreshStyleElementText()})}
else{var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,r.target)};var s=WVAdminResourceManager.checkNewResourceId(n);if(s!=null){a.copyStyleBySelector('[data-wv-res-id="'+s.old+'"]','[data-wv-res-id="'+s.new+'"]')};a.applyResourceStyle(bm.toolManager.isMultiSelectMode?bm.toolManager.targetElementList:n,t,e,i,!1,!0,o);a.refreshStyleElementText()}},deleteResourceStyle:function(t,e){var a=window;if($('#WEVEN_IFRAME').length>0)a=$('#WEVEN_IFRAME')[0].contentWindow;var o=$(a.document).find(t),r=t+' > *';if(o.length==0||(o.length>0&&o[0].hasAttribute('data-wv-delete-resource'))){return};var i=$(a.document).find(t).parents('[data-wv-res-id]').first(),n,s;WVAdminResourceManager.applyDeletedCssToAllStyleObject(t,e['styleType']);if(i.length>0&&!i[0].hasAttribute('data-wv-delete-resource')){n='[data-wv-res-id="'+$(i).attr('data-wv-res-id')+'"]';WVAdminResourceManager.applyDeletedCssToAllStyleObject(n,e['styleType'])};e.deleteRuleBySelector(r,!1,!0);$(o).attr('data-wv-delete-resource','');if(n){var s=n+' > *';e.deleteRuleBySelector(s,!1,!0);$(i).attr('data-wv-delete-resource','')}},setStyleBtn:function(){},resetStyleBtn:function(){},addEvent:function(){},removeEvent:function(){},resetProperty:function(){},addElementAtLatestRange:function(t,e){e=e==!1?!1:!0;if($(this.target).hasClass('wveditor_text')==!1&&$(this.target).find('[data-wv-layout-element=block_inner]').hasClass('wveditor_text')==!1){alert('테이블은 텍스트 수정 중에만 삽입이 가능합니다.');return};var i;if(Object.prototype.toString.call(t)=='[object String]'){i=$(t)[0]}
else{i=t};if(e)bm.selectionManager.replaceContent(i);else bm.selectionManager.insertContent(i)},removeListener:function(){$(this.btnList).off('click');if(this.type.indexOf('Text')==0||this.type.indexOf('History')==0){$(this.btnList).off('mousedown',this.selectStartHandler)};$(this.btnList).off('mousedown',this.preventEditHandler);$(this.btnList).not('div').off('keydown',this.inputNumUpDownHandler);$(this.btnList).not('div').off('keydown',this.inputFocusOutHandler);$(this.btnList).not('div').off('keyup',this.inputNumUpDownApplyHandler);$(this.btnList).not('div').off('focus',this.inputFocusHandler);var t,e,i=this.optionList.length;for(t=0;t<i;t++){e=this.optionList[t];events(e).removeListener('toolSetOptionCloseCall')};this.removeEvent()},reset:function(){},destroy:function(){}};var ToolBtnVideo=function(){var t=this;this.type='ToolBtnVideo';this.playerType='';this.viewType='current';this.isLoop;this.videoInfo;this.player;this.isPop=!1;this.innerWindow=window;if($('#WEVEN_IFRAME').length>0){this.innerWindow=$('#WEVEN_IFRAME')[0].contentWindow};this.onBtnClick=function(t,e){switch(e){case'youtube':case'vimeo':this.changePlayer(e);break;case'current':case'popup':this.changeViewType(e);break;case'loopTrue':case'loopFalse':this.changeLoopStatus(e);bm.toast('Play설정이 적용 되었습니다.\n');break;case'apply':this.applyPlayer();break}};this.changePlayer=function(e){if(t.playerType==e)return;t.playerType=e};this.changeViewType=function(e){if(t.viewType==e)return;t.viewType=e;if(isExpertMode){if(e=='current'){$(t.btnList['popWidth']).closest('.toolset_partial').hide();$(t.btnList['height']).closest('.toolset_partial').show()}
else{$(t.btnList['popWidth']).closest('.toolset_partial').show();$(t.btnList['height']).closest('.toolset_partial').hide()}}
else{if(e=='current'){$(t.innerWindow.document).find('#ToolBtnVideoPopWidth').hide();$(t.innerWindow.document).find('#ToolBtnVideoPopHeight').hide()}
else{$(t.innerWindow.document).find('#ToolBtnVideoPopWidth').show();$(t.innerWindow.document).find('#ToolBtnVideoPopHeight').show()}};t.applyPlayer()};this.changeLoopStatus=function(e){var i;if(e=='loopTrue')i=!0;else if(e=='loopFalse')i=!1;if(t.isLoop==i)return;t.isLoop=i;t.applyPlayer()};this.changeVolume=function(e){var i=$(t.btnList['volume']),o=i.attr('max')-i.attr('min'),n=parseInt(e/o*100);i.siblings('.range_bg').css('background','linear-gradient(to right, #6738ff 0%, #6738ff '+n+'%, #e4ebf5 '+n+'%, #e4ebf5 100%)')};this.patchVideoJs=function(){var e=window['wvAdminIFrameBridge']&&wvAdminIFrameBridge.iframeWindow;if(!e)e=window;var i=$(t.target).attr('data-wv-res-id');if(e.wevenBlock[i]&&e.wevenBlock[i].hasOwnProperty('getPlayer')){bm.httpSendJsonPost(WEB_ROOT+'blockTemplateManage/getBlockTemplateDetailWithExtra',{id:'special_video_000',revision:1,extra:'js/block.script.html.tmplt'},function(t){if(t.result){var n=t.data.result;n=n.replace(/{{video_res_id}}/g,i);$(e.document).find('[data-block-js=\''+i+'\']')[0].outerHTML=n}})}};this.applyPlayer=function(){var t=this.btnList['url'].value;if(!t){alert('영상주소를 입력해주세요.');$(this.btnList['url']).focus();return};this.videoInfo=this.getVideoInfo(t);if(this.videoInfo&&this.videoInfo['type']){this.playerType=this.videoInfo['type'];if(!isExpertMode){var e=$(this.btnList[this.playerType]).is(':checked');if(e===!1){alert('영상 주소와 영상매체가 일치하지 않습니다.');$(this.btnList['url']).focus();return!1}}}
else{alert('영상 정보가 올바르지 않습니다.');return!1};if(this.videoInfo.loop===undefined){this.patchVideoJs()};if(bm.toolManager.toolMode==='side'){$(this.btnList['height']).val(650)};if(!this.videoInfo.type||!this.videoInfo.id){alert('영상주소가 올바르지 않습니다.');$(this.btnList['url']).focus();return};if(!$(this.btnList['height']).val()){alert('현재영역높이를 입력해주세요.');$(this.btnList['height']).focus();return};if($(this.btnList['popWidth']).is(':visible')&&!$(this.btnList['popWidth']).val()){alert('팝업영상너비를 입력해주세요.');$(this.btnList['popWidth']).focus();return};if($(this.btnList['popHeight']).is(':visible')&&!$(this.btnList['popHeight']).val()){alert('팝업영상높이를 입력해주세요.');$(this.btnList['popHeight']).focus();return};this.setPlayer();this.addPlayer(this.videoInfo.viewType);if(bm.toolManager.toolMode==='side'){bm.toast('영상은 실제 상세페이지에서 재생할 수 있습니다.')}};this.getVideoInfo=function(e){e.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);var i;if(RegExp.$3.indexOf('youtu')>-1){i='youtube'}
else if(RegExp.$3.indexOf('vimeo')>-1){i='vimeo'};var o={type:i,id:RegExp.$6};var n=JSON.parse($(t.target).closest('[data-wv-layout-element-type="video"]').attr('data-wv-layout-element-param').replace(/'/g,'"'));if(n.loop)o['loop']=n.loop;return o};this.setPlayer=function(){var i=$(this.btnList['height']).val(),s=$(this.btnList['popWidth']).val(),o=$(this.btnList['popHeight']).val(),e=t.target,a={};if(t.target.targetElement)e=t.target.targetElement;if(this.isVideoBlock(e)===!1){$(e).closest('[data-wv-layout-element-type="video"]').length>0?e=$(e).closest('[data-wv-layout-element-type="video"]')[0]:e=e};bm.toolManager.toolBtnEditBefore(this,e,HistoryType.EDITOR_VIDEO);if(this.viewType=='popup'){if(s&&o){a['height']=o+'px'}}
else{};if(i){i=i.indexOf('%')>-1?i:i+'px';a['height']=i};var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};n.applyResourceStyle($(e).closest('[data-wv-layout-element="block"]'),a,!1,!0);n.refreshStyleElementText();if(!this.videoInfo)this.videoInfo=this.getVideoInfo($(this.btnList['url']).val());if(this.playerType=='youtube'){this.videoInfo.src='https://www.youtube.com/embed/'+this.videoInfo.id;if(this.isLoop==!0)this.videoInfo.src+='?version=3&feature=player_embedded&loop=1&playlist='+this.videoInfo.id}
else if(this.playerType=='vimeo'){this.videoInfo.src='https://player.vimeo.com/video/'+this.videoInfo.id;if(this.isLoop==!0){this.videoInfo.src+='?loop=1'}};if(this.viewType=='current'){$(e).css('background-image','none');this.videoInfo.width='100%';this.videoInfo.height=i}
else{$(e).css('background-image','');this.videoInfo.width=s;this.videoInfo.height=o};this.videoInfo.viewType=this.viewType;this.videoInfo.loop=this.isLoop;$(e).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-type','video');$(e).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-param',JSON.stringify(this.videoInfo).replace(/"/g,'\''));bm.toolManager.toolBtnEditAfter(this,e,HistoryType.EDITOR_VIDEO)};this.addPlayer=function(e){if($(t.target).find('> [data-wv-layout-element="block_inner"]').length>0){var i=$(t.target).find('> [data-wv-layout-element="block_inner"]')}
else{var i=$(t.target)};if(i.find('.video-wrap'))i.find('.video-wrap').remove();var n=this.getPlayer(this.videoInfo.width,this.videoInfo.height);if(e=='current'){i.children().hide();i.append(n);this.isPop=!1}
else{i.children().show();this.isPop=!0}};this.getPlayer=function(e,i){let pointerEvent='';if(bm.toolManager.toolMode==='side'){pointerEvent='pointer-events: none;'};e=e.indexOf('%')>-1?e:e+'px';i=i.indexOf('%')>-1?i:i+'px';var n='position:relative; overflow:hidden;'+pointerEvent;if(this.videoInfo.viewType==='current')n+='width: 100%; height: 100%;';else n+='width:100%; max-width:'+e+'; height:'+i+';';return player='<div class="video-wrap" style="'+n+'"><iframe id="'+$(t.target).attr('data-wv-res-id')+'" width="100%" src="'+this.videoInfo.src+'" frameborder="0" allowfullscreen="" style="position:absolute; top:0; left:0; width:100%; height:100%; background-color: #000;"></iframe></div>'};this.getFormatValue=function(t){if(t!=0&&t!='0'&&t!=''&&!isNaN(t)){t=$.trim(t)}
else{t=''};return t};this.timer;this.setKeyUpTargetValue=function(t,e,i){if(t.keyCode==8||(t.keyCode>=48&&t.keyCode<=57)||(t.keyCode>=96&&t.keyCode<=105)){var n=this,o=n.target;clearTimeout(n.timer);n.timer=setTimeout(function(){if(o!=n.target)return!1;var t=n.getFormatValue($(e).val());$(e).val(t);if(i)n.setPlayer()},500)}};this.isVideoBlock=function(e){e?e=e:e=this.target;if($(t.target).attr('data-wv-layout-element-type')==='video'){return!0}
else{return!1}}};bm.extend(ToolBtnBase,ToolBtnVideo);ToolBtnVideo.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length==0){t.resetStyleBtn();return!1};if($(t.target).closest('[data-wv-layout-element-type="video"]').length==0){t.resetStyleBtn();return!1};if(bm.toolManager.toolMode==='side'){i='current'};if($(t.target).closest('[data-wv-layout-element-type="video"]').length>0){if($(t.target).closest('[data-wv-layout-element-type="video"]').attr('data-wv-layout-element-param')){var e=JSON.parse($(t.target).closest('[data-wv-layout-element-type="video"]').attr('data-wv-layout-element-param').replace(/'/g,'"')),n=e.type,i=e.viewType,o=e.loop;$(t.btnList[n]).prop('checked',!0);$(t.btnList[i]).prop('checked',!0);if(o==='true'||o===!0){this.isLoop=!0;$(t.btnList['loopTrue']).prop('checked',!0)}
else{this.isLoop=!1;$(t.btnList['loopFalse']).prop('checked',!0)};this.viewType=i;if(i=='current'){$(t.innerWindow.document).find('#ToolBtnVideoPopWidth').hide();$(t.innerWindow.document).find('#ToolBtnVideoPopHeight').hide()}
else{$(t.innerWindow.document).find('#ToolBtnVideoPopWidth').show();$(t.innerWindow.document).find('#ToolBtnVideoPopHeight').show()};if(n=='youtube'){this.playerType='youtube';$(t.btnList['url']).val('https://youtu.be/'+e.id)}
else if(n=='vimeo'){this.playerType='vimeo';$(t.btnList['url']).val('https://vimeo.com/'+e.id)};$(t.btnList['height']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('height'),10));$(t.btnList['popWidth']).val(e.width);$(t.btnList['popHeight']).val(e.height);this.videoInfo=e}
else{this.playerType='vimeo';this.viewType='current';this.isLoop=!1;$(t.innerWindow.document).find('#ToolBtnVideoPopWidth').hide();$(t.innerWindow.document).find('#ToolBtnVideoPopHeight').hide();$(t.btnList['vimeo']).prop('checked',!0);$(t.btnList['current']).prop('checked',!0);$(t.btnList['loopFalse']).prop('checked',!0);$(t.btnList['url']).val('https://vimeo.com/547451791');if($(t.target).closest('[data-wv-layout-element="block"]').length==0){$(t.btnList['height']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('height'),10));$(t.btnList['popWidth']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('width'),10));$(t.btnList['popHeight']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('height'),10))}
else{$(t.btnList['height']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('height'),10));$(t.btnList['popWidth']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('width'),10));$(t.btnList['popHeight']).val(parseInt($(t.target).closest('[data-wv-layout-element-type="video"]').css('height'),10))}}}};ToolBtnVideo.prototype.resetStyleBtn=function(){};ToolBtnVideo.prototype.addEvent=function(){var t=this;$(t.btnList['volume']).on('input',function(){t.changeVolume($(this).val())});$(t.btnList['url']).on('focus',function(){$(this).select()});$(t.btnList['url']).on('keydown',function(e){if(e.keyCode==13){t.applyPlayer()}});$(t.btnList['height']).on('keydown',function(e){if(e.keyCode==13){t.applyPlayer()}});$(t.btnList['popWidth']).on('keydown',function(e){if(e.keyCode==13){t.applyPlayer()}});$(t.btnList['popHeight']).on('keydown',function(e){if(e.keyCode==13){t.applyPlayer()}});$(t.btnList['height']).on('keyup',function(e){t.setKeyUpTargetValue(e,this,!0)});$(t.btnList['popWidth']).on('keyup',function(e){t.setKeyUpTargetValue(e,this)});$(t.btnList['popHeight']).on('keyup',function(e){t.setKeyUpTargetValue(e,this)});$(t.btnList['height']).on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()});$(t.btnList['popWidth']).on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()});$(t.btnList['popHeight']).on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()})};ToolBtnVideo.prototype.removeEvent=function(){var t=this;$(t.btnList['volume']).off('input');$(t.btnList['url']).off('focus');$(t.btnList['url']).off('keydown');$(t.btnList['height']).off('focus');$(t.btnList['height']).off('keydown');$(t.btnList['height']).off('keyup');$(t.btnList['popWidth']).off('focus');$(t.btnList['popWidth']).off('keydown');$(t.btnList['popWidth']).off('keyup');$(t.btnList['popHeight']).off('focus');$(t.btnList['popHeight']).off('keydown');$(t.btnList['popHeight']).off('keyup')};var ToolBtnMotion=function(){var t=this;this.type='ToolBtnMotion';if(isExpertMode){this.onBtnClick=function(t,e){if(e==='template'){this.showTemplate()}};this.onWindowDown=function(e){if($(e.target).closest('#motionTemplate').length===0)t.hideTemplate()}}
else{this.addOption(new ToolOpMotion(),'motion')};this.onOptionChange=function(t,e){var i=this.target;if(bm.toolManager.isMultiSelectMode){i=bm.toolManager.targetElementList.concat()};bm.toolManager.toolBtnEditBefore(this,i,HistoryType.EDITOR_MOTION);$(i).removeClass('aos-init aos-animate');if(t=='delete'){$(i).removeAttr('data-aos');$(i).removeAttr('data-aos-duration');$(i).removeAttr('data-aos-delay');$(i).removeAttr('data-aos-easing');$('[tool-motion-type]').removeClass('active');$(this.btnList[0]).trigger('click')}
else{$(i).attr('data-aos',e.type);$(i).attr('data-aos-duration',e.duration);$(i).attr('data-aos-delay',e.delay);$(i).attr('data-aos-easing',e.easing);setTimeout(function(){$('#WEVEN_IFRAME')[0].contentWindow.AOS.init()},e.duration+e.delay)};bm.toolManager.toolBtnEditAfter(this,i,HistoryType.EDITOR_MOTION)};this.setMotion=function(){var e=$(this.btnList['duration']).val(),i=$(this.btnList['delay']).val(),t=$('#motionTemplate').find('[tool-motion-type].active');if(!this.motionType&&t.length===0){bm.toast('종류를 선택해주세요.','등장모션');return};if(!i){bm.toast('지연시간(초)을 입력해주세요.','등장모션');$(this.btnList['delay']).focus();return};if(!e){bm.toast('진행시간(초)을 입력해주세요.','등장모션');$(this.btnList['duration']).focus();return};if(t.length>0){this.motionType=t.attr('tool-motion-type')};var n={type:this.motionType,duration:e*1000,delay:i*1000,easing:'ease-in-cubic'};this.onOptionChange('apply',n)};this.showTemplate=function(){$('#motionTemplate').show()};this.hideTemplate=function(){$('#motionTemplate').hide()}};bm.extend(ToolBtnBase,ToolBtnMotion);ToolBtnMotion.prototype.setStyleBtn=function(){var o=this;if(!this.target||this.target.length){this.resetStyleBtn();return!1};var t;if(isExpertMode){t=$('[data-wv-toolset=ToolMotion]')}
else{t=this.optionList['motion'].element};var e=$(this.target).attr('data-aos')?$(this.target).attr('data-aos'):null,i=$(this.target).attr('data-aos-duration')?parseFloat($(this.target).attr('data-aos-duration')/1000):0.4,n=$(this.target).attr('data-aos-delay')?parseFloat($(this.target).attr('data-aos-delay')/1000):0.2;$('[tool-motion-type]').removeClass('active');if(e){t.find('[tool-motion-type="'+e+'"]').addClass('active');if(isExpertMode)bm.toolManager.toolList['ToolMotion'].openControl(null,!0)}
else{if(isExpertMode)bm.toolManager.toolList['ToolMotion'].openControl(null,!1)};t.find('#motionDuration').val(i);t.find('#motionDelay').val(n)};ToolBtnMotion.prototype.resetStyleBtn=function(){var t=this};ToolBtnMotion.prototype.addEvent=function(){var t=this;if(isExpertMode){$(window).on('mousedown',this.onWindowDown);$(this.btnList['duration']).on('keydown',function(e){if(e.keyCode==13){var i=parseFloat(this.value);if(!i){bm.toast('진행시간을 입력해주세요.','등장모션');return};t.setMotion()}});$(this.btnList['duration']).on('keyup',function(t){var e=$(this).val().replace('s','');if(bm.valid.isOnlyNumDot(e)){if(e>3){$(this).val('3s');bm.toast('Duration(진행시간)은 최대 3초입니다.','등장모션');return};if(e<0){$(this).val('0s');bm.toast('Duration(진행시간)은 최소 0초입니다.','등장모션');return};if(t.keyCode==13){$(this).val(e+'s')}}
else{$(this).focus();$(this).val('0.4s');bm.toast('숫자를 입력해주세요.','등장모션');return}});$(this.btnList['delay']).on('keydown',function(e){if(e.keyCode==13){var i=parseFloat(this.value);if(!i){bm.toast('지연시간을 입력해주세요.','등장모션');return};t.setMotion()}});$(this.btnList['delay']).on('keyup',function(t){var e=$(this).val().replace('s','');if(bm.valid.isOnlyNumDot(e)){if(e>3){$(this).val('3s');bm.toast('Delay(지연시간)은 최대 3초입니다.','등장모션');return};if(e<0){$(this).val('0s');bm.toast('Delay(지연시간)은 최소 0초입니다.','등장모션');return};if(t.keyCode==13){$(this).val(e+'s')}}
else{$(this).focus();$(this).val('0.2s');bm.toast('숫자를 입력해주세요.','등장모션');return}});$('#motionTemplate').find('[tool-motion-type]').on('click',function(i){if($(this).hasClass('active')){t.onOptionChange('delete');bm.toolManager.toolList['ToolMotion'].openControl(null,!1)}
else{var n=$(this).attr('tool-motion-type'),a=$('#motionTemplate').find('[tool-motion-type]');a.removeClass('active');$(this).addClass('active');t.motionType=n;$('#motionType').val(e(n.replace('-',' ')));t.setMotion();t.btnList['exmotion'].value=n;var o=$(t.btnList['exmotion']).attr('class').split(' ');o=o.filter(function(t){return!t.startsWith('fade-')});$(t.btnList['exmotion']).attr('class',o.join(' '));$(t.btnList['exmotion']).addClass(n)};t.hideTemplate()});function e(t){return t.charAt(0).toUpperCase()+t.slice(1)}}};ToolBtnMotion.prototype.removeEvent=function(){var t=this;if(isExpertMode){$(window).off('mousedown',this.onWindowDown);$(this.btnList['duration']).off('keyup');$(this.btnList['duration']).off('keydown');$(this.btnList['delay']).off('keyup');$(this.btnList['delay']).off('keydown');$('#motionTemplate').find('[tool-motion-type]').off('click')}};ToolBtnMotion.prototype.showOption=function(t,e){var n=this;ToolBtnBase.prototype.showOption.call(this,t,e);if(!isExpertMode){if(!bm.toolManager.isMultiSelectMode){n.setStyleBtn()}
else{var i=n.optionList['motion'].element;$('[tool-motion-type]').removeClass('active');i.find('#motionDuration').val(0.4);i.find('#motionDelay').val(0.2)}}};ToolBtnMotion.prototype.resetProperty=function(){this.onOptionChange('delete')};var ToolBtnSource=function(){this.type='ToolBtnSource';this.wrapperSelector='[data-wv-layout-element="block_inner"]';this.mode='default';this.onBtnClick=function(t,e){this.lookSource()}};bm.extend(ToolBtnBase,ToolBtnSource);ToolBtnSource.prototype.lookSource=function(){var t=this;if(bm.toolManager.isMultiSelectMode){alert('블럭을 다중선택한 상태에서는 소스보기를 할 수 없습니다.\n블럭을 1개만 선택한 후에 소스보기를 시도해주세요.');return};if(!t.target){target=bm.toolManager.targetElement};this.mode=$('#WEVEN_IFRAME').length==0?'default':'block';if(this.mode=='default'){bm.sourceEditorMananger.isDesignEditMode=!1;bm.sourceEditorMananger.isCssMode=!0;bm.sourceEditorMananger.active(t.target,null,function(e,i,n){if(!n){var o=i,a=$(o).html();t.target.innerHTML=a}})}
else{bm.sourceEditorMananger.isDesignEditMode=!0;bm.sourceEditorMananger.isCssMode=!1;var e=$(target).find('#wvWebkit')[0];$(target).find('#wvWebkit').remove();bm.sourceEditorMananger.active(target,this.wrapperSelector?this.wrapperSelector:'[data-wv-layout-element="block_inner"]',function(t,i,n){if(!n){var o=i,a=$(o).html();target.innerHTML=a};$(target).append(e);bm.toolManager.resetHitTestBlock();bm.toolManager.kitReposition()})}};ToolBtnSource.prototype.addEvent=function(){var t=this};ToolBtnSource.prototype.removeEvent=function(){var t=this};var ToolBtnScroll=function(){this.type='ToolBtnScroll';if(isExpertMode){this.easingSelect=app.getWvCom('scrollEasing')}
else{this.addOption(new ToolOpScroll(),'scroll')};this.defaultScroll='swing';this.defaultDuration=0.3;this.onOptionChange=function(t,e){var o=this,i=this.getApplyTarget();bm.toolManager.toolBtnEditBefore(this,i,HistoryType.EDITOR_MOTION);var a=i.length,n=0;if(t=='delete'){if(bm.toolManager.isMultiSelectMode){for(n=0;n<a;n++){$(i[n]).removeAttr('data-wv-event');$(i[n]).removeAttr('data-wv-event-option')}}
else{$(i).removeAttr('data-wv-event');$(i).removeAttr('data-wv-event-option')};$('#scrollEasing').val(o.defaultScroll);$('#scrollEasing').trigger('change');$('#scrollDuration').val('')}
else{if(!e){$(this.btnList['duration']).val(o.defaultDuration);this.easingSelect.val(o.defaultScroll);e={duration:o.defaultDuration*1000,easing:o.defaultScroll}};if(bm.toolManager.isMultiSelectMode){for(n=0;n<a;n++){$(i[n]).attr('data-wv-event','scroll');$(i[n]).attr('data-wv-event-option',JSON.stringify(e))}}
else{$(i).attr('data-wv-event','scroll');$(i).attr('data-wv-event-option',JSON.stringify(e))}};setTimeout(function(){bm.scroll.init(o.innerWindow)},500);$(this.btnList[0]).trigger('click');bm.toolManager.toolBtnEditAfter(this,i,HistoryType.EDITOR_MOTION)}};bm.extend(ToolBtnBase,ToolBtnScroll);ToolBtnScroll.prototype.getApplyTarget=function(){var t=this.target;if(bm.toolManager.isMultiSelectMode){t=bm.toolManager.targetElementList.concat();var a=t.length,e=[];for(var n=0;n<a;n++){var i=t[n];if($(i).attr('data-wv-design-area')===undefined){var o=$(i).closest('[data-wv-design-area]');if(e.indexOf(o)===-1)e.push(o)}
else e.push(i)};t=e}
else{if($(t).attr('data-wv-design-area')===undefined){t=$(this.target).closest('[data-wv-design-area]')}};return t};ToolBtnScroll.prototype.setStyleBtn=function(){var s=this,i=this.getApplyTarget();if(!i||i.length==0){this.resetStyleBtn();return!1};if(!isExpertMode)var t=this.optionList['scroll'].element;if($(i).attr('data-wv-event')=='scroll'){if(isExpertMode)bm.toolManager.toolList['ToolScroll'].openControl(null,!0);else $(t).find('[data-wv-tool-option-btn=\'delete\']').show()}
else{if(isExpertMode)bm.toolManager.toolList['ToolScroll'].openControl(null,!1);else $(t).find('[data-wv-tool-option-btn=\'delete\']').hide()};var a=$(i).attr('data-wv-event-option'),e=null;if(a&&a!=''){e=bm.parsing.parseStrToObj(a,null,!0);var n=e.duration?parseFloat(parseInt(e.duration)/1000):this.optionList['scroll'].duration,o=e.easing?e.easing:this.optionList['scroll'].easing;if(isExpertMode){$(this.btnList['duration']).val(n);this.easingSelect.val(o)}
else{t.find('#scrollDuration').val(n);t.find('#scrollEasing').val(o)}}
else{if(isExpertMode){$(this.btnList['duration']).val(s.defaultDuration);this.easingSelect.val(s.defaultScroll)}
else{t.find('#scrollDuration').val(n);t.find('#scrollEasing').val(o)}}};ToolBtnScroll.prototype.resetStyleBtn=function(){var t=this};ToolBtnScroll.prototype.addEvent=function(){var t=this;if(isExpertMode){$(this.btnList['duration']).on('keydown',function(e){if(e.keyCode==13){var i=parseFloat(this.value);if(!i){bm.toast('진행시간을 입력해주세요.','휠 스크롤');return};var n=t.easingSelect.val(),o={duration:i*1000,easing:n};t.onOptionChange('apply',o)}});$(this.btnList['duration']).on('keyup',function(e){var i=$(this).val().replace('s','');if(bm.valid.isOnlyNumDot(i)){if(i>3){$(this).val('3s');bm.toast('Duration(진행시간)은 최대 3초입니다.','휠 스크롤');return};if(i<0){$(this).val('0s');bm.toast('Duration(진행시간)은 최소 0초입니다.','휠 스크롤');return};if(e.keyCode==13){$(this).val(i+'s')}}
else{$(this).focus();$(this).val(t.defaultDuration+'s');bm.toast('숫자를 입력해주세요.','휠 스크롤');return}});this.easingSelect.onChangeComplete=function(){var n=this.val(),e=$(t.btnList['duration']).val();if(!e){e=t.defaultDuration};var i={duration:e*1000,easing:n};t.onOptionChange('apply',i)}}};ToolBtnScroll.prototype.removeEvent=function(){var t=this;if(isExpertMode){$(this.btnList['duration']).off('keyup');$(this.btnList['duration']).off('keydown')}};ToolBtnScroll.prototype.showOption=function(t,e){var i=this;ToolBtnBase.prototype.showOption.call(this,t,e);if(!isExpertMode){if(!bm.toolManager.isMultiSelectMode){i.setStyleBtn()}
else{var n=i.optionList['scroll'].element;$('[tool-motion-type]').removeClass('active');n.find('#scrollDuration').val(i.optionList['scroll'].duration);n.find('#scrollEasing').val(i.optionList['scroll'].easing)}}};ToolBtnScroll.prototype.resetProperty=function(){this.onOptionChange('delete')};var ToolBtnMap=function(){var t=this;this.type='ToolBtnMap';this.mapInfo;this.fitHeight=500;this.naverKeyApplyUrl=['weven','zgai','zaemit'];this.onBtnClick=function(e,i){switch(i){case'google':$(t.btnList['key']).val('AIzaSyCrUo9fNNGqQgAj3TcUcpOoZluCfQb8wes');break;case'kakao':$(t.btnList['key']).val('1984ddaf3d57dbd6dde2bf008f2c6754');break;case'naver':var o=location.href;var n=!1;this.naverKeyApplyUrl.forEach((item)=>{if(o.indexOf(item)>-1)n=!0});if(n){$(t.btnList['key']).val('zjzr9mcpa6')}
else{$(t.btnList['key']).val('')};break;case'apply':this.applyMap();break}};this.patchMapJs=function(){var e=window['wvAdminIFrameBridge']&&wvAdminIFrameBridge.iframeWindow;if(!e)e=window;var i=$(t.target).closest('[data-wv-res-id]').attr('data-wv-res-id');bm.httpSendJsonPost(WEB_ROOT+'blockTemplateManage/getBlockTemplateDetailWithExtra',{id:'special_map_000',revision:1,extra:'js/block.script.html.tmplt'},function(t){if(t.result){var n=t.data.result;n=n.replace(/{{map_res_id}}/g,i);$(e.document).find('[data-block-js=\''+i+'\']')[0].outerHTML=n}})};var e={key:$('[data-wv-tool-btn-prop="key"]')[0],height:$('[data-wv-tool-btn-prop="height"]')[0],address:$('[data-wv-tool-btn-prop="address"]')[0],google:$('[data-wv-tool-btn-prop="google"]')[0],kakao:$('[data-wv-tool-btn-prop="kakao"]')[0],naver:$('[data-wv-tool-btn-prop="naver"]')[0]};$(e['key']).on('keydown',function(t){if(t.keyCode===13){var e=$(this).val().trim();if(!e){bm.toast('API Key를 입력해주세요.');$(this).focus();t.preventDefault();return}}});this.applyMap=function(t){this.patchMapJs();var i=this.btnList['key'].value;if(!i){bm.toast('API Key를 입력해주세요.');$(this.btnList['key']).focus();return};let byHeightChange;if(t)byHeightChange=!0;else byHeightChange=!1;var n=t?t:parseFloat(bm.getStyle(this.target,'height')),e=this.btnList['address'].value;if(!e){bm.toast('주소를 입력해주세요.');$(this.btnList['address']).focus();return};this.mapInfo={type:$(this.btnList['google']).is(':checked')?'google':$(this.btnList['kakao']).is(':checked')?'kakao':'naver',key:i,height:n,address:e};this.initMap(byHeightChange);bm.toolManager.kitReposition()};this.initMap=function(e){var i=document.write;document.write=function(t){$('body').append(t)};if(this.mapInfo.type=='google'){$.ajax({url:'https://maps.googleapis.com/maps/api/geocode/json',data:{address:t.mapInfo.address,sensor:!1,key:t.mapInfo.key},cache:!1,type:'GET',async:!1,dataType:'json'}).done(function(n){if(n.status=='OK'){var o=n.results,a=o[0].formatted_address;if(a){t.mapInfo.address=a;t.mapInfo.lat=o[0].geometry.location.lat;t.mapInfo.lng=o[0].geometry.location.lng;$(t.target).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-type','map').attr('data-wv-layout-element-param',JSON.stringify(t.mapInfo).replace(/"/g,'\''));if(typeof google==='undefined'){$.getScript('https://maps.googleapis.com/maps/api/js?key='+t.mapInfo.key,function(){setTimeout(function(){document.write=i;t.setMap(t.target,t.mapInfo.type,e)},100)})}
else{t.setMap(t.target,t.mapInfo.type,e)}}}
else if(n.status==='ZERO_RESULTS'){bm.toast('구글에서 주소정보를 찾을 수 없습니다.<br>주소정보를 정확하게 입력해주세요.')}
else{bm.toast('API KEY를 다시 확인해주세요.');t.wrongApi(t.target,t.mapInfo.type)}})}
else if(this.mapInfo.type=='kakao'){if(typeof kakao==='undefined'){$.getScript('https://dapi.kakao.com/v2/maps/sdk.js?appkey='+t.mapInfo.key+'&libraries=services',function(){setTimeout(function(){document.write=i;t.getGeoCode(e)},100)}).fail(function(){bm.toast('API KEY를 다시 확인해주세요.');t.wrongApi(t.target,t.mapInfo.type)})}
else{t.getGeoCode(e)}}
else{if(typeof naver==='undefined'){$.getScript('//openapi.map.naver.com/openapi/v3/maps.js?ncpClientId='+t.mapInfo.key+'&submodules=geocoder',function(){setTimeout(function(){document.write=i;t.getGeoCode(e)},100)}).fail(function(){bm.toast('API KEY를 다시 확인해주세요.');t.wrongApi(t.target,t.mapInfo.type)})}
else{t.getGeoCode(e)}}};this.getGeoCode=function(e){var n;if(t.mapInfo.type=='kakao'){n=new kakao.maps.services.Geocoder();n.addressSearch(t.mapInfo.address,function(i,n){if(n===kakao.maps.services.Status.OK){t.mapInfo.address=i[0].address_name;t.mapInfo.lat=i[0].y;t.mapInfo.lng=i[0].x;$(t.target).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-type','map').attr('data-wv-layout-element-param',JSON.stringify(t.mapInfo).replace(/"/g,'\''));t.setMap(t.target,t.mapInfo.type,e)}
else{bm.toast('주소를 잘못 입력하셨습니다. 다시 확인해주세요.')}})}
else if(t.mapInfo.type=='naver'){var i={};i.address=t.mapInfo.address;i.key=t.mapInfo.key;bm.httpSendJsonPost(WEB_ROOT+'login/getGeocode',i,function(i){var a=i.data.status,o=i.data;if(location.href.indexOf('weven.kr')===-1&&location.href.indexOf('weven.biz')===-1&&location.href.indexOf('zgai.ai')===-1&&location.href.indexOf('zgai.me')===-1){if(t.mapInfo.key==='zjzr9mcpa6'){t.wrongApi(t.target,t.mapInfo.type);return bm.toast('API KEY를 발급받아 사용해주세요.')};if(a!=='OK'){delete naver;t.wrongApi(t.target,t.mapInfo.type);return bm.toast('API KEY를 다시 확인해주세요.')};if(o.meta.totalCount===0){return bm.toast('주소를 잘못 입력하셨습니다. 다시 확인해주세요.')};var n=o.addresses[0];t.mapInfo.address=n.roadAddress;t.mapInfo.lat=n.y;t.mapInfo.lng=n.x;$(t.target).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-type','map').attr('data-wv-layout-element-param',JSON.stringify(t.mapInfo).replace(/"/g,'\''));t.setMap(t.target,t.mapInfo.type,e)}
else{if(a!=='OK'){delete naver;t.wrongApi(t.target,t.mapInfo.type);return bm.toast('API KEY를 다시 확인해주세요.')};if(o.meta.totalCount===0){return bm.toast('주소를 잘못 입력하셨습니다. 다시 확인해주세요.')};var n=o.addresses[0];t.mapInfo.address=n.roadAddress;t.mapInfo.lat=n.y;t.mapInfo.lng=n.x;$(t.target).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-type','map').attr('data-wv-layout-element-param',JSON.stringify(t.mapInfo).replace(/"/g,'\''));t.setMap(t.target,t.mapInfo.type,e)}})}};this.setMap=function(t,e,i){var d=this,n=t,l=this.getSamplingElement(t),s={color:bm.getStyle(l,'height')};bm.toolManager.toolBtnEditBefore(this,n,HistoryType.EDITOR_MAP,s);$(n).find('.wrong_api').hide();if($(n).hasClass('wveditor_map')==!1&&$(n).find(' > .wveditor_map').length>0){n=$(n).find(' > .wveditor_map')[0]};if($(n).find('.map_container').length==0){$(n).append('<div class="map_container"></div>');$(n).find('> img').remove();s={height:this.mapInfo.height+'px'}}
else{$(n).find('.map_container').empty();$(n).find('.map_container').show();s={height:this.mapInfo.height+'px'}};if(e=='google'){var o={lat:this.mapInfo.lat,lng:this.mapInfo.lng};var a=new google.maps.Map($(n).find('.map_container')[0],{center:o,zoom:17});var r=new google.maps.Marker({position:o,map:a})}
else if(e=='kakao'){var o=new kakao.maps.LatLng(this.mapInfo.lat,this.mapInfo.lng),a=new kakao.maps.Map($(n).find('.map_container')[0],{center:o,level:3});var r=new kakao.maps.Marker({position:o});r.setMap(a)}
else if(e=='naver'){var o=new naver.maps.LatLng(this.mapInfo.lat,this.mapInfo.lng),a=new naver.maps.Map($(n).find('.map_container')[0],{center:o,zoom:18});var r=new naver.maps.Marker({position:o,map:a})};if(i!==!0){bm.toast('지도설정이 적용되었습니다.')};bm.toolManager.toolBtnEditAfter(this,n,HistoryType.EDITOR_MAP,s)};this.wrongApi=function(t,e){var n={'google':'https://cloud.google.com/maps-platform','kakao':'https://apis.map.kakao.com/web/guide/','naver':'https://www.ncloud.com/product/applicationService/maps'};var i;if($(t).hasClass('wveditor_map')){i=t}
else{i=$(t).find('.wveditor_map')};if($(i).find('.wrong_api').length>0){$(i).find('.wrong_api').show();$(i).find('.wrong_api').find('.api_guide').attr('href',n[e])}
else{var o='<div class="wrong_api"><div class="wrong_api_inner"><div class="title">API 키값을 받아야 이용이 가능합니다!</div><div class="desc">지도를 이용하시려면 API 키값이 필요합니다.<br/>발급받은 API 키값을 입력해주세요.</div><div class="btn_con"><a href="javascript:void(0)" class="btn api_guide"><span class="btn_inner">API 키값 받기</span></a><a href="https://weven.kr/page/help-center?mode=view&seq=211&category=WEDITOR-MAP&parent_category=WEDITOR" class="btn"><span class="btn_inner">매뉴얼 보기</span></a></div></div></div>',a=$(o).appendTo(i);$(a).find('.api_guide').attr('href',n[e])};$(i).find('.map_container').hide()};this.setSize=function(){var e=$(this.btnList['height']).val();$(t.target).closest('[data-wv-layout-element="block"]').css({height:e+'px'})};this.applyStyle=function(t){var l=this,o=$(this.target).find('.wveditor_map .map_container'),d=o.length;if(d==0){bm.toast('적용할 대상이 선택되지 않았습니다.');return};var e=null;if(bm.bmEditorManager.registedBoardEditor===!1){e=WVAdminResourceManager.getEmbededStyleObject(null,l.target)};var h,n;n=o;var r=$(n).closest('[data-wv-layout-element="block"]');if(t['height']==='fit-content'){t['height']=this.fitHeight+'px'};var i=t;i['backgroundColor']='#f2f2f2';var a=e.applyResourceStyle(r,i,!1,!0),s='[data-wv-res-id="'+a[0]+'"] .map_container';t['height']='100% !important';e.applyResourceStyle(s,t,!1,!0);e.refreshStyleElementText()};this.getFormatValue=function(t){if(t!=0&&t!='0'&&t!=''&&!isNaN(t)){t=$.trim(t)}
else{t=''};return t}};bm.extend(ToolBtnBase,ToolBtnMap);ToolBtnMap.prototype.isMapBlock=function(t){if($(t).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-type')=='map'&&$(t).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-param')){return!0}
else{return!1}};ToolBtnMap.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1};if(this.isMapBlock(this.target)===!0){var e=$(t.target).closest('[data-wv-layout-element="block"]').attr('data-wv-layout-element-param');e=JSON.parse(e.replace(/'/g,'"'));$(t.btnList[e.type]).prop('checked',!0);$(t.btnList['key']).val(e.key);$(t.btnList['height']).val(Math.round(parseFloat($(t.target).css('height'))));$(t.btnList['address']).val(e.address)}};ToolBtnMap.prototype.resetStyleBtn=function(){var t=this;if(!this.target||$(this.target).find(' > .wveditor_map').length==0)return;$(t.btnList['google']).trigger('click');$(t.btnList['height']).val('500');$(t.btnList['address']).val('')};ToolBtnMap.prototype.addEvent=function(){var t=this;$(t.btnList['address']).on('focusout',function(){var t=$(this).val();$(this).val($.trim(t))});$(t.btnList['address']).on('focus',function(){$(this).select()});$(t.btnList['address']).on('keydown',function(e){if(e.keyCode==13){t.applyMap()}});$(t.btnList['height']).on('focus',function(){var t=$(this).val();if(t!=0&&t!='0'&&t!=''){t=parseFloat($(this).val());if(isNaN(t))t=0};$(this).val(t);$(this).select()});$(t.btnList['height']).on('focusout',function(){var e=t.getFormatValue($(this).val()),i={height:e+'px'};$(this).val(e)});$(t.btnList['height']).on('keydown',function(e){if(e.keyCode==13){t.applyMap()}})};ToolBtnMap.prototype.removeEvent=function(){var t=this;$(t.btnList['address']).off('focusout');$(t.btnList['address']).off('focus');$(t.btnList['address']).off('keydown');$(t.btnList['height']).off('focusout');$(t.btnList['height']).off('focus')};var ToolBtnSwiperAuto=function(){this.type='ToolBtnSwiperAuto';this.AutoplayStatus=null;this.AutoplayDelay=3000;this.currentSwiperThumb;this.currentSwiperList;this.optionAttr;this.textWhenBtnOff='비활성화';this.textWhenBtnOn='활성화';var t=$('[data-wv-toolset=ToolSwiper]');this.onOptionChange=function(t,e){};this.onBtnClick=function(t,e){switch(e){case'autoplaySetOnOff':this.autoplayOnOff(!1);break;case'autoplayPlay':this.autoplayOnOff(!0);bm.toast('Auto Rolling기능이 활성화 되었습니다.\n');break;case'autoplayStop':this.autoplayOnOff(!0);bm.toast('Auto Rolling기능이 비활성화 되었습니다.\n');break;case'autoplayReset':this.autoplayOnOff(!0,!0);bm.toast('Auto Rolling기능이 초기화 되었습니다.\n');break}};this.setAutoPlayDelay=function(){var t=this};this.setAutoPlay=function(t){var e=this};this.autoplayOnOff=function(t,e){var i=this;if(i.currentSwiperThumb.length<1){bm.toast('자동넘기기가 불가능한 스와이퍼입니다.');return!1};if(t){if($(i.btnList['autoplayPlay']).hasClass('active')||e){i.AutoplayStatus=!1;$(i.btnList['autoplayPlay']).removeClass('active');$(i.btnList['autoplayStop']).addClass('active');if(e){i.AutoplayDelay=3000;$(i.btnList['autoplayDelay']).val(3)}}
else{i.AutoplayStatus=!0;$(i.btnList['autoplayPlay']).addClass('active');$(i.btnList['autoplayStop']).removeClass('active')}}
else{if($(i.btnList['autoplaySetOnOff']).hasClass('active')){i.AutoplayStatus=!1;$(i.btnList['autoplaySetOnOff']).removeClass('active');$(i.btnList['autoplaySetOnOff']).val(i.textWhenBtnOff)}
else{i.AutoplayStatus=!0;$(i.btnList['autoplaySetOnOff']).addClass('active');$(i.btnList['autoplaySetOnOff']).val(i.textWhenBtnOn)}};if($(this.target).attr('data-wv-layout-element-type')==='shop_list'||$(this.target).find('[data-wv-layout-element-type="shop_list"]').length>0){var n=bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param'));wvAdminIFrameBridge._WVShopConfig.shopSwiper[n.shopListId].params.autoplay.delay=i.AutoplayDelay;if($(i.btnList['autoplaySetOnOff']).hasClass('active')&&i.AutoplayStatus===!0){n.paging_type='slideisAuto'+i.AutoplayDelay}
else if(!$(i.btnList['autoplaySetOnOff']).hasClass('active')&&i.AutoplayStatus===!1){n.paging_type='slide';wvAdminIFrameBridge._WVShopConfig.shopSwiper[n.shopListId].autoplay.stop()};$(wvAdminIFrameBridge._WVShopConfig.shopSwiper[n.shopListId].el).closest('[data-wv-layout-element-type="shop_list"]').attr('data-wv-layout-element-param',JSON.stringify(n).replaceAll('"',''));$(wvAdminIFrameBridge._WVShopConfig.shopSwiper[n.shopListId].el).closest('[data-wv-layout-element="plugin-content"]').attr('data-wv-layout-element-param',JSON.stringify(n).replaceAll('"',''));bm.toast('적용여부는 편집모드를 해제하거나 실제사이트에서 확인할 수 있습니다.')}
else{var o=function(t,e,i){var n=t.indexOf(i);if(n!==-1)return t.substr(0,n)+e+t.substr(n)},a=function(t,e,i){var n=t.indexOf(i)+i.length;if(n!==-1)return t.substr(0,n)+e+t.substr(n)};if($(i.btnList['autoplaySetOnOff']).hasClass('active')||i.AutoplayStatus===!0){if(i.optionAttr.includes('autoplay:{disableOnInteraction:0, delay:')||i.optionAttr.includes('autoplay: {disableOnInteraction:0, delay:')){i.optionAttr=i.optionAttr.replace('autoplay:0','autoplay: {disableOnInteraction:0, delay:'+i.AutoplayDelay+'},');i.optionAttr=i.optionAttr.replace('autoplay: 0','autoplay: {disableOnInteraction:0, delay:'+i.AutoplayDelay+'},')}
else{i.optionAttr=o(i.optionAttr,'autoplay: {disableOnInteraction:0, delay:'+i.AutoplayDelay+'},','direction')}}
else if(!$(i.btnList['autoplaySetOnOff']).hasClass('active')||i.AutoplayStatus===!1){if(i.optionAttr.includes('autoplay:{disableOnInteraction:0')||i.optionAttr.includes('autoplay: {disableOnInteraction:0')){i.optionAttr=i.optionAttr.replace('autoplay:{disableOnInteraction:0, delay:','');i.optionAttr=i.optionAttr.replace('autoplay: {disableOnInteraction:0, delay:','');i.optionAttr=i.optionAttr.replace('000}','')}};$(i.currentSwiperList[0]).attr('data-wv-com-op',i.optionAttr)}}};bm.extend(ToolBtnBase,ToolBtnSwiperAuto);ToolBtnSwiperAuto.prototype.setStyleBtn=function(t){var e=this;if(!this.target||this.target.length||$(e.target).closest('[data-wv-layout-element-type="thumb"]').length<1){if(bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param')).paging_type){if($(this.target).attr('data-wv-layout-element-type')!=='shop_list'||bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param')).paging_type.indexOf('slide')===-1||!wvAdminIFrameBridge._WVShopConfig.shopSwiper){this.resetStyleBtn();return!1}}
else{return!1}};if($(this.target).attr('data-wv-layout-element-type')==='shop_list'){e.currentSwiperThumb=$(this.target);if(e.currentSwiperThumb.length<1)return!1;var i=bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param'));$(e.btnList['autoplayDelay']).val(wvAdminIFrameBridge._WVShopConfig.shopSwiper[i.shopListId].params.autoplay.delay/1000);if(i.paging_type.indexOf('isAuto')>-1){e.AutoplayStatus=!0;$(e.btnList['autoplaySetOnOff']).addClass('active');$(e.btnList['autoplaySetOnOff']).val(e.textWhenBtnOn)}
else{e.AutoplayStatus=!1;$(e.btnList['autoplaySetOnOff']).removeClass('active');$(e.btnList['autoplaySetOnOff']).val(e.textWhenBtnOff)}}
else{e.currentSwiperThumb=$(e.target).closest('[data-wv-layout-element-type="thumb"]');if(e.currentSwiperThumb.length<1)return!1;e.currentSwiperList=$(e.currentSwiperThumb).find('[data-wv-com="swiper"]');e.optionAttr=$(e.currentSwiperList[0]).attr('data-wv-com-op');if($(e.currentSwiperList[0]).length>0){if(e.optionAttr.includes('autoplay:{disableOnInteraction:0')||e.optionAttr.includes('autoplay: {disableOnInteraction:0')){e.AutoplayStatus=!0;if(isExpertMode){$(e.btnList['autoplayPlay']).addClass('active');$(e.btnList['autoplayStop']).removeClass('active')}
else{$(e.btnList['autoplaySetOnOff']).addClass('active');$(e.btnList['autoplaySetOnOff']).val(e.textWhenBtnOn)}}
else{e.AutoplayStatus=!1;if(isExpertMode){$(e.btnList['autoplayPlay']).removeClass('active');$(e.btnList['autoplayStop']).addClass('active')}
else{$(e.btnList['autoplaySetOnOff']).removeClass('active');$(e.btnList['autoplaySetOnOff']).val(e.textWhenBtnOff)}};if(e.optionAttr.split('delay:')[1]){$(e.btnList['autoplayDelay']).val(Number(e.optionAttr.split('delay:')[1].substring(0,4))/1000)}
else{$(e.btnList['autoplayDelay']).val(3)}}};this.controlByKeyDown=function(t){if(!($(t.target).val())){$(t.target).val(0)};var e=Number($(t.target).val());if(t.keyCode===38){e+=1;$(t.target).val(e)}
else if(t.keyCode===40){e-=1;$(t.target).val(e)}}};ToolBtnSwiperAuto.prototype.resetStyleBtn=function(t){var e=this};ToolBtnSwiperAuto.prototype.addEvent=function(){var t=this;$(t.btnList['autoplayDelay']).on('click',function(){$(this).select()});$(t.btnList['autoplayDelay']).on('keydown',function(e){t.controlByKeyDown(e)});$(t.btnList['autoplayDelay']).on('keyup',function(){var e=$(this).val();if(bm.valid.isOnlyNum(e)){if(e<0||e>=10){$(this).focus();$(this).val(3);bm.toast('딜레이는 (1 ~ 9)초 단위만 설정가능합니다.');return!1}
else{t.AutoplayDelay=$(t.btnList['autoplayDelay']).val()*1000}}
else{$(this).focus();$(this).val(3);bm.toast('숫자를 입력해주세요.');return!1}})};ToolBtnSwiperAuto.prototype.removeEvent=function(){var t=this;$(t.btnList['autoplayDelay']).off('click');$(t.btnList['autoplayDelay']).off('keydown');$(t.btnList['autoplayDelay']).off('keyup')};var ToolBtnSwiperPagination=function(){this.type='ToolBtnSwiperPagination';this.addOption(new ToolOpSwiperPagination(),'pagination');this.colorPicker=ToolOpColorPicker.get();this.addOption(this.colorPicker);var t=$('[data-wv-toolset=ToolSwiper]'),e=this.optionList['pagination'].element;this.onBtnClick=function(t,e){};this.onOptionChange=function(t,e,i){var n=this;n.applyPaginationStyle(n.currentTarget,e,i)};this.applyPaginationStyle=function(t,e,i){var n,a;if($(t).closest('[data-wv-layout-element-type="shop_list"]').length>0){n=$(t).closest('[data-wv-layout-element="block"] [data-wv-design-area]');a='.swiper-pagination > span'}
else{n=$(t).closest('[data-wv-layout-element="block"]');a='[data-wv-swiper-pagination] > span'};if(i>-1){var s='swiper_pagi_bg_point'+i;$(n).addClass(s)}
else{$(n).removeClass('swiper_pagi_bg_point0');$(n).removeClass('swiper_pagi_bg_point1');$(n).removeClass('swiper_pagi_bg_point2')};var o;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};e.width=e.width+'px';e.height=e.height+'px';e.opacity=(100-Number(e.opacity))/100;o.applyResourceStyle(a,e,!1,!0,!1,!0,[],!1,'[data-wv-res-id="'+$(n).attr('data-wv-res-id')+'"]');o.refreshStyleElementText()}};bm.extend(ToolBtnBase,ToolBtnSwiperPagination);ToolBtnSwiperPagination.prototype.setStyleBtn=function(t){var o=this;if(!this.target||this.target.length||$(o.target).closest('[data-wv-layout-element-type="thumb"]').length<1){if(bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param')).paging_type){if($(this.target).attr('data-wv-layout-element-type')!=='shop_list'||bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param')).paging_type.indexOf('slide')===-1||!wvAdminIFrameBridge._WVShopConfig.shopSwiper){this.resetStyleBtn();return!1}}
else{return!1}};if($(this.target).attr('data-wv-layout-element-type')==='shop_list'){var n=$(o.target),i=$(n).find('.swiper-control').find('.swiper-pagination-bullet');if(i.length===0){i=$(n).parent().find('.swiper-control').find('.swiper-pagination-bullet')};o.currentTarget=$(i)[0]}
else{var n=$(o.target).closest('[data-wv-layout-element-type="thumb"]');if(n.length>0){var s=$(n).find('[data-wv-com="swiper"]'),i=$(n).find('[data-wv-swiper-pagination]');if(i.length===0){i=$(n).parent().find('[data-wv-swiper-pagination]')};o.currentTarget=$(i)[0]}};var a=o.optionList['pagination'],e=a.getCurrentPaginationStyle(o.currentTarget);if(e.opacity===undefined){e.opacity=0.3};if(e.backgroundColor===undefined){e.backgroundColor='rgb(0, 122, 255)'};if(e.width===undefined||e.height===undefined){e.width='10px';e.height='10px'};a.setOptionValue(e.width,e.height,e.opacity,e.backgroundColor)};ToolBtnSwiperPagination.prototype.resetStyleBtn=function(t){var e=this};ToolBtnSwiperPagination.prototype.addEvent=function(){var t=this};ToolBtnSwiperPagination.prototype.removeEvent=function(){var t=this};var ToolBtnSwiperNavigation=function(){this.type='ToolBtnSwiperNavigation';this.currentTarget;this.addOption(new ToolOpSwiperNavigation(),'navigation');this.colorPicker=ToolOpColorPicker.get();this.addOption(this.colorPicker);var t=$('[data-wv-toolset=ToolSwiper]'),e=this.optionList['navigation'].element;this.settingNavigation=$(t).find('#setting_navigation')[0];this.onBtnClick=function(t,e){};this.onOptionChange=function(t,e){var i=this,o=Object.assign({},e);var n=Object.assign({},e);i.applyNavigationStyle(i.currentTarget[0],o);i.applyNavigationStyle(i.currentTarget[1],n)};this.applyNavigationStyle=function(t,e){var o=this,n;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};var i=$(t);if(i.attr('data-wv-swiper-navigation')==='prev')e.right='';if(i.attr('data-wv-swiper-navigation')==='next')e.left='';if(!e.top.includes('px')&&!e.top.includes('%')&&!e.top.includes('auto'))e.top=e.top+'px';if(!e.bottom.includes('px')&&!e.bottom.includes('%')&&!e.bottom.includes('auto'))e.bottom=e.bottom+'px';if(!e.left.includes('px')&&!e.left.includes('%')&&e.left!==undefined)e.left=e.left+'px';if(!e.right.includes('px')&&!e.right.includes('%')&&e.right!==undefined)e.right=e.right+'px';if(e.top==='px')e.top='auto';if(e.bottom==='px')e.bottom='auto';if(e.left==='px')e.left='auto';if(e.right==='px')e.right='auto';n.applyResourceStyle(i,e,!1,!0)}};bm.extend(ToolBtnBase,ToolBtnSwiperNavigation);ToolBtnSwiperNavigation.prototype.setStyleBtn=function(t){var n=this;if(!this.target||this.target.length||$(n.target).closest('[data-wv-layout-element-type="thumb"]').length<1){if(bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param')).paging_type){if($(this.target).attr('data-wv-layout-element-type')!=='shop_list'||bm.parsing.parseStrToObj($(this.target).attr('data-wv-layout-element-param')).paging_type.indexOf('slide')===-1||!wvAdminIFrameBridge._WVShopConfig.shopSwiper){this.resetStyleBtn();return!1}}
else{return!1}};var i=n.optionList['navigation'],o=$(n.target).closest('[data-wv-layout-element-type="thumb"]');if(o.length>0){var s=$(o).find('[data-wv-com="swiper"]'),a=$(o).find('[data-wv-swiper-navigation]');if(a.length===0){a=$(o).parent().find('[data-wv-swiper-navigation]')};n.currentTarget=$(a)}
else{i.setOptionValue('none');return};var e=i.getCurrentNavigationStyle(n.currentTarget);if(e[0].top===undefined&&e[0].bottom===undefined&&e[0].left===undefined&&e[0].right===undefined)i.setOptionValue('none');else if(!e[0].transform)i.setOptionValue();else if(e[0].transform==='translateY(-50%)'&&e[0].top==='50%'||e[0].transform==='matrix(1, 0, 0, 1, 0, -23.5)'||e[0].transform!=='matrix(1, 0, 0, 1, 0, 0)')i.setOptionValue('center');else if(e[0].transform!=='translateY(-50%)'&&e[0].bottom==='auto')i.setOptionValue('top');else if(e[0].transform!=='translateY(-50%)'&&e[0].top==='auto')i.setOptionValue('bottom');else i.setOptionValue();if(typeof(e[0].top)==='string'){if(e[0].top.includes('calc')){$(i.optionBtnList['top']).val('auto')}}
else if(e[0].top!==undefined){$(i.optionBtnList['top']).val(e[0].top.replace('px',''))}
else{$(i.optionBtnList['top']).val('auto')};if(typeof(e[0].bottom)==='string'){if(e[0].bottom.includes('calc')){$(i.optionBtnList['bottom']).val('auto')}}
else if(e[0].bottom!==undefined){$(i.optionBtnList['bottom']).val(e[0].bottom.replace('px',''))}
else{$(i.optionBtnList['bottom']).val('auto')};if(typeof(e[0].left)==='string'){if(e[0].left.includes('calc')){$(i.optionBtnList['left']).val(0)}}
else if(e[0].left!==undefined){$(i.optionBtnList['left']).val(e[0].left.replace('px',''))}
else{$(i.optionBtnList['left']).val(0)};if(typeof(e[1].right)==='string'){if(e[1].right.includes('calc')){$(i.optionBtnList['right']).val(0)}}
else if(e[1].right!==undefined){$(i.optionBtnList['right']).val(e[0].right.replace('px',''))}
else{$(i.optionBtnList['right']).val(0)}};ToolBtnSwiperNavigation.prototype.resetStyleBtn=function(t){var e=this};ToolBtnSwiperNavigation.prototype.addEvent=function(){var t=this};ToolBtnSwiperNavigation.prototype.removeEvent=function(){var t=this};var ToolBtnHistory=function(){this.type='ToolBtnHistory';this.onBtnClick=function(t,e){if(e=='prev'){bm.toolManager.onToolPrevHistory()}
else if(e=='next'){bm.toolManager.onToolNextHistory()};if(bm.toolManager.toolMode==='side')bm.toolManager.toolSide.hide()}};bm.extend(ToolBtnBase,ToolBtnHistory);ToolBtnHistory.prototype.addEvent=function(){var t=this};ToolBtnHistory.prototype.removeEvent=function(){var t=this};var ToolBtnTextHistory=function(){this.type='ToolBtnTextHistory';this.onBtnClick=function(t,e){if(e=='prev'){bm.toolManager.onToolPrevHistory()}
else if(e=='next'){bm.toolManager.onToolNextHistory()}}};bm.extend(ToolBtnBase,ToolBtnTextHistory);ToolBtnTextHistory.prototype.addEvent=function(){var t=this};ToolBtnTextHistory.prototype.removeEvent=function(){var t=this};var ToolBtnTextLink=function(){this.type='ToolBtnTextLink';this.lastRange;this.inputList=[];this.radioList=[];this.targetParent=null;var t=$('[data-wv-toolset="ToolTextLink"]');this.radioList.push($(t).find('[data-wv-tool-btn-prop="_self"]').parent()[0]);this.radioList.push($(t).find('[data-wv-tool-btn-prop="_blank"]').parent()[0]);this.inputList.push($(t).find('[data-wv-tool-btn-prop="url"]')[0]);this.inputList.push($(t).find('[data-wv-tool-btn-prop="title"]')[0]);if(isExpertMode){this.addOption(new ToolOpTextLink(),'menuList');this.onOptionChange=function(t,e){if(t==='menu'){this.addPageLink(e.uri,e.title)}}};this.selectStartHandler=function(t){};this.onTextInputDown=function(t){t.stopImmediatePropagation();if(bm.selectionManager.getRange()){bm.selectionManager.saveRange()}};$(this.element).on('click',function(t){t.stopImmediatePropagation()});this.setLink=function(t){var n=this;bm.selectionManager.restoreRange();var r=$(n.target),s=bm.selectionManager.getAllTextNode(),e=bm.selectionManager.getRange();if(n.targetParent!=null)r=$(n.targetParent);var h=t=='remove'?'링크 삭제할 대상이 없습니다. 다시 선택해주세요.':'링크 연결할 대상이 없습니다. 다시 선택해주세요.';if((!s&&e&&e.collapsed)&&!n.target&&!n.targetParent){bm.toast(h);return}
else if(bm.bmEditorManager.registedBoardEditor&&s&&e&&e.collapsed&&t!='remove'){bm.toast(h);return}
else if(bm.bmEditorManager.registedBoardEditor&&(!s&&e.collapsed)){bm.toast(h);return};var p=!0,d=$(bm.selectionManager.getSelectionContainer()).attr('href');if(d==null||d==undefined||d==''){p=!1};if(bm.bmEditorManager.registedBoardEditor==!1){if(r.length>1||(t!='remove'&&e&&e.collapsed)||(t=='remove'&&e&&e.collapsed&&(p==!1)))s=null}
else{if(r.length>1||(t!='remove'&&e&&e.collapsed))s=null};var i=this.btnList['url'].value;if(t=='apply'&&!i){bm.toast('링크주소를 입력해주세요.');$(this.btnList['url']).focus();return}
else if(t.toLowerCase=='home'){i=WEB_ROOT.replace('webadm/','web/');if(WEB_ROOT.indexOf(SITE_ID+'.weven')>-1){i=WEB_ROOT.replace('webadm/','')}};if(!bm.bmEditorManager.registedBoardEditor&&wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){if(this.btnList['url'].value.includes('http')){var a=new URL(this.btnList['url'].value).hostname.replaceAll('www.','').split('.')[0]}
else{var a=new URL('http://'+this.btnList['url'].value).hostname.replaceAll('www.','').split('.')[0]}}
else{var a=this.btnList['title'].value};if(t.toLowerCase=='home'&&!a){a='홈'};var m=i.split('?')[0],v=bm.valid.isValidUrl(m);if(t=='apply'&&!v&&!i.includes('[WEB_ROOT]')){bm.toast('링크주소 형식이 잘못 되었습니다. 다시 입력해주세요.');$(this.btnList['url']).focus();return};var c=this.getSamplingElement(r),f=$(this.btnList['_blank']).is(':checked')?'_blank':'_self';bm.toolManager.toolBtnEditBefore(this,c,HistoryType.EDITOR_TEXT_LINK);if(i.indexOf('[WEB_ROOT]')==0)i=i;else if(i.indexOf('http')==-1)i='http://'+i;if(s||(e&&e.collapsed===!1)){if(t=='remove'){var g=$(e.commonAncestorContainer);g.closest('a').contents().unwrap();n.resetStyleBtn()}
else{var o=document.createElement('a');$(o).attr('href',i).attr('target',f).attr('title',a);var u=e.extractContents();$(o).append(u);e.insertNode(o);$(o).find('a').contents().unwrap();if($(o).parent()[0].tagName.toLowerCase()=='a'){$(o).unwrap()}}}
else{$(r).each(function(e,o){if(t=='remove'){$(o).removeAttr('onclick title tabindex').css('cursor','');n.resetStyleBtn()}
else{var s;if(f=='_self'){s='parent.location.href=\''+i+'\';'}
else{s='window.open(\''+i+'\');'};$(o).removeAttr('onclick').css('cursor','');$(o).attr('onclick',s).attr('title',a).attr('tabindex',0)}})};bm.toolManager.toolBtnEditAfter(this,c,HistoryType.EDITOR_TEXT_LINK);this.setStyleBtn();var l='';if(t==='remove')l='Link기능이 삭제되었습니다.';else l='Link기능이 적용되었습니다.';bm.toast(l)};this.findPage=function(){if(!this.target){bm.toast('대상이 선택되지 않았습니다.');return};if(window.wvAdminIFrameBridge&&wvAdminIFrameBridge.previewMode){var t=WEB_ROOT+'themeTemplateManage?layout=pc_popup&mode=getLink';t+='&id='+themeInfo.info.id+'&revision='+themeInfo.info.revision}
else{var t=WEB_ROOT+'userMenuManage?layout=pc_popup&mode=getLink'};var e=bm.popupManager.addToIframe(t,null,'','',null,[0,0,0,0],!0,!0,!0,100005);$(e).attr('id','pageLinkPopup')};this.addPageLink=function(t,e){bm.popupManager.removePopLatest(!0);var i=WEB_ROOT.replace('webadm/','web/');if(WEB_ROOT.indexOf(SITE_ID+'.weven')>-1){i=WEB_ROOT.replace('webadm/','')};var n=i+'page/'+t;$(this.btnList['url']).val(n);$(this.btnList['title']).val(e);if(t===''&&e.toLowerCase()==='home')this.setLink('home');else this.setLink('apply');if(isExpertMode){this.hideOption(this.optionList['menuList'],this.btnList['menuList'])}}};bm.extend(ToolBtnBase,ToolBtnTextLink);ToolBtnTextLink.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(isExpertMode){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnTextLink.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1};var i,p,s,h=bm.selectionManager.getAllTextNode(),o=bm.selectionManager.getRange();if(bm.bmEditorManager.registedBoardEditor==!1&&$(this.target).find('> .wveditor_text').length==0){h=null}
else if(o&&o.collapsed&&$(o.commonAncestorContainer).parents('a').length==0){h=null};t.targetParent=null;if(h||(o&&o.collapsed===!1)){var a=[];if(o==null)return;var l=$(o.commonAncestorContainer);l.find('a').each(function(){a.push(this)});if(l.attr('href')!==undefined){a.push($(l)[0])};if(l.parent()[0].tagName.toLowerCase()=='a'){a.push(l.parent()[0])};if(a.length>0){if(isExpertMode)bm.toolManager.toolList['ToolTextLink'].openControl(null,!0);var f=!0;for(var d=0;d<a.length;d++){var r=$(a[d]),c=r.attr('href').indexOf('[WEB_ROOT]')?r.attr('href'):r.attr('href').split('//')[1];p=r.attr('target');s=r.attr('title');if(!i)i=c;else if(i&&i!=c){f=!1;break}};if(f){$(t.btnList['url']).val(i);$(t.btnList['title']).val(s)};if(p=='_blank')$(t.btnList['_blank']).prop('checked',!0)}
else{if(isExpertMode)bm.toolManager.toolList['ToolTextLink'].openControl(null,!1)}}
else{s=$(t.target).attr('title');var e=$(t.target).attr('onclick'),n;i='';if(e){if(e.indexOf('return false')>-1)e=$(t.target)[0].clickAttr;n=e&&e.indexOf('[WEB_ROOT]')?'\'':'//';if(e.indexOf('window.open')!=-1){$(t.btnList['_blank']).prop('checked',!0);if(e.split(n)[1])i=e.split(n)[1].split('\'')[0]}
else{if(e.split(n)[1])i=e.split(n)[1].split('\';')[0]};$(t.btnList['url']).val(i);$(t.btnList['title']).val(s);if(isExpertMode)bm.toolManager.toolList['ToolTextLink'].openControl(null,!0)}
else{if($(t.target).closest('[onclick]').length>0){t.targetParent=$(t.target).closest('[onclick]');s=t.targetParent.attr('title');e=t.targetParent.attr('onclick');if(e.indexOf('return false')>-1)e=t.targetParent[0].clickAttr;n=e&&e.indexOf('[WEB_ROOT]')?'\'':'//';if(e){if(e.indexOf('window.open')!=-1){$(t.btnList['_blank']).prop('checked',!0);if(e.split(n)[1])i=e.split(n)[1].split('\'')[0]}
else{if(e.split(n)[1])i=e.split(n)[1].split('\';')[0]}};$(t.btnList['url']).val(i);$(t.btnList['title']).val(s);if(isExpertMode)bm.toolManager.toolList['ToolTextLink'].openControl(null,!0)}
else{if(isExpertMode)bm.toolManager.toolList['ToolTextLink'].openControl(null,!1)}}}};ToolBtnTextLink.prototype.resetStyleBtn=function(){var t=this;t.targetParent=null;$(t.btnList['_self']).prop('checked',!0);for(let i=0;i<t.inputList.length;i++){if(t.inputList[i]&&t.inputList[i].isConnected){$(t.inputList[i]).val('')}}};ToolBtnTextLink.prototype.addEvent=function(){var t=this;for(let i=0;i<t.inputList.length;i++){if(t.inputList[i]&&t.inputList[i].isConnected){$(t.inputList[i]).on('focusout',function(){var t=$(this).val();$(this).val($.trim(t))});$(t.inputList[i]).on('mousedown',function(e){t.onTextInputDown(e);$(this).select()});$(t.inputList[i]).on('keydown',function(e){if(e.keyCode==13){t.setLink('apply');e.preventDefault()}})}};for(let i=0;i<t.radioList.length;i++){if(t.radioList[i]&&t.radioList[i].isConnected){$(t.radioList[i]).on('mousedown',function(e){t.onTextInputDown(e)})}};if(isExpertMode){$(t.btnList['_blank']).on('mousedown',function(e){t.onTextInputDown(e)})}};ToolBtnTextLink.prototype.removeEvent=function(){var t=this;for(let i=0;i<t.inputList.length;i++){if(t.inputList[i]&&t.inputList[i].isConnected){$(t.inputList[i]).off('focusout');$(t.inputList[i]).off('mousedown');$(t.inputList[i]).off('keydown')}};for(let i=0;i<t.radioList.length;i++){if(t.radioList[i]&&t.inputList[i].isConnected){$(t.radioList[i]).off('mousedown')}};if(isExpertMode)$(t.btnList['_blank']).off('mousedown')};ToolBtnTextLink.prototype.resetProperty=function(){this.setLink('remove')};var ToolBtnTextFont=function(){this.type='ToolBtnTextFont';this.fontWeightObj=null;var t=this;this.addOption(new ToolOpFontFamily(),'mainBtn');this.onOptionChange=function(t,e){var r=this,g=!1,o=$(this.target).find('.wveditor_text');if(o.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){o=$(this.target)};if(o.length==1&&$(o).find('table').length>0){var u=bm.tableSelectionManager.getRange();if(u.length>0){g=!0;o=u}};var l=o.length,f=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&l==0){alert('적용할 대상이 선택되지 않았습니다.');return};var v=this.getSamplingElement(o),a={fontFamily:bm.getStyle(v,'fontFamily')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_FONT_FAMILY,a);a={fontFamily:e};var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,r.target)};var h,c;if(bm.bmEditorManager.registedBoardEditor||(l==1&&f&&!bm.selectionManager.isCollapsed())){var p=f?f.length:0,d;for(var i=0;i<p;i++){d=bm.editor.getSpanNodeByControl(i,p,f[i]);if(d){if(n){h=n.applyResourceStyle(d,a,!1,!0,!0,!0,[],!0);c='[data-wv-res-id="'+h[0]+'"]';r.deleteResourceStyle(c,n)}
else bm.editor.applyCssToElement(d,a)}}}
else{var i,s,l=o.length;for(i=0;i<l;i++){if(bm.toolManager.isMenuTarget){s=bm.toolManager.menuTargetSelector;n.applyResourceStyle(s,a,!1,!0,!1,!1)}
else{if(g){s=$(o[i])}
else{s=$(o[i]).closest('[data-wv-layout-element="block"]')};n.applyChildrenResourceStyle(s,a,!1,!0);h=n.applyResourceStyle(s,a,!1,!0,!0,!0,[],!0);c='[data-wv-res-id="'+h[0]+'"]';r.deleteResourceStyle(c,n)}}};if(n)n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_FONT_FAMILY,a);if(typeof(e)==='string'){if(e.includes('\''))e=e.replaceAll('\'','')};var m=$('[data-wv-tool-option="ToolOpFontFamily"]').find('[data-wv-tool-option-value="'+e+'"]').text();this.setSelectedValue(e,'mainBtn');$('[data-wv-tool-btn="ToolBtnTextFont"]').find('.label').text(m);this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:a});if(r.fontWeightObj){e=e.replaceAll(' ','+');events('ToolBtnTextFont').dispatch('fontWeight',{fontFamily:e,fontWeightList:r.fontWeightObj[e],myFont:!1})}};this.detectFont=function(t){if(t.css('fontFamily')){var e=t.css('fontFamily').split(',');return this.removeQuoted(e[0])}
else{return''}};this.removeQuoted=function(t){return t.replace(/(^("|'))|(("|')$)/g,'')};this.conversionFontToString=function(t){var e=[];for(let i=0;i<t.length;i++){if(t[i]==='100')e.push('Thin');if(t[i]==='200')e.push('Extra Light');if(t[i]==='300')e.push('Light');if(t[i]==='400')e.push('Regular');if(t[i]==='500')e.push('Medium');if(t[i]==='600')e.push('Semi Bold');if(t[i]==='700')e.push('Bold');if(t[i]==='800')e.push('Extra Bold');if(t[i]==='900')e.push('Black')};return e};this.conversionFontToNum=function(t){var e=[];for(let i=0;i<t.length;i++){if(t[i]==='Thin')e.push('100');if(t[i]==='Extra Light')e.push('200');if(t[i]==='Light')e.push('300');if(t[i]==='Regular')e.push('400');if(t[i]==='Medium')e.push('500');if(t[i]==='Semi Bold')e.push('600');if(t[i]==='Bold')e.push('700');if(t[i]==='Extra Bold')e.push('800');if(t[i]==='Black')e.push('900')};return e};this.setFontWeightByFamily=function(t){var f=$('[data-wv-tool-btn="ToolBtnTextBold"]').find('.label'),p=$('[data-wv-tool-option="ToolOpFontWeight"]'),e=$(p).find('[data-wv-tool-option-value]');if(!t.data.fontWeightList){for(let i=0;i<e.length;i++){$(e[i]).show()};return};var a=this.conversionFontToString(t.data.fontWeightList),h=this.conversionFontToString([bm.getStyle(this.target,'font-weight')])[0],c=[0,0,0,0,0,0,0,0];for(let i=0;i<e.length;i++){for(let j=0;j<a.length;j++){if($(e[i]).attr('data-wv-tool-option-value')===a[j]){c[i]=1}}};for(let i=0;i<e.length;i++){if(c[i]===1){$(e[i]).show();var s=0;for(let j=0;j<a.length;j++){if(h===a[j]){s=1}};if(f.text()===''){s=1};if(s===0){var o='Regular',n=Number(this.conversionFontToNum([h])[0]),d=0;for(let k=0;k<e.length;k++){if(n>400){n-=100}
else if(n<=400){n+=100};for(let l=0;l<t.data.fontWeightList.length;l++){if(Number(t.data.fontWeightList[l])===n&&d===0){o=String(n);f.text(this.conversionFontToString([o])[0]);e.removeClass('on');p.find('.list_contents[data-wv-tool-option-value="'+this.conversionFontToString([o])[0]+'"]').addClass('on');var r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};r.applyResourceStyle(this.target,{fontWeight:o},!1,!0);d=1}}}}}
else{$(e[i]).hide()}}};this.fontReplace=function(t){if(typeof(t)==='object'){return t};var e=/[\[\]?,|*~`!^\_+<>@\#$%&\='\\"]/gi;t=t.replace('@font-face','');t=t.replace(e,'');t=t.replaceAll(';',',');t=bm.parsing.parseStrToObj(t);return t};this.active=function(){var r=this;if($('#WEVEN_IFRAME').length>0&&!this.fontWeightObj){var c=wvAdminIFrameBridge._WVContentArea.$content.find('link[href="https://cdn.zgai.ai/weven_service/asset/css/wevenFont.css"]').attr('href'),h=$('html').find('link[href="/weven_service/asset/css/wevenFont.css"]').attr('href');$.get(h).done((res)=>{var d=wvAdminIFrameBridge._WVContentArea.$content.find('style[data-font-css]').text(),s=(res+d).split('@font-face'),t={};for(let i=0;i<s.length;i++){if(s[i].includes('import')){var a=s[i].split('@import');for(let i=0;i<a.length;i++){if(a[i].includes('family=')){var l=a[i].split('family=')[1].split(':wght')[0];t[l]=a[i].split('wght@')[1].split('&display')[0].split(';')}}}
else{var e=r.fontReplace(s[i]),n=e['font-family'];if(n){if(e['font-weight']==='normal'){e['font-weight']=400};if(typeof t[n]==='object'){if(t[n].length>0){t[n].push(String(e['font-weight']))}}
else{t[n]=[String(e['font-weight'])]}}}};for(var o in t){for(let i=1;i<t[o].length;i++){if(t[o][i]===t[o][i-1]){t[o].splice(i,1);i--}}};r.fontWeightObj=t}).fail((res)=>{console.log('fail')})};if(this.status===1)return;this.status=1;this.registListener()};events('ToolBtnTextFont').addListener('fontWeight',function(e){if(e.data.myFont===!0){t.fontWeightObj[e.data.fontFamily]=e.data.fontWeightList}
else{t.setFontWeightByFamily(e)}})};bm.extend(ToolBtnBase,ToolBtnTextFont);ToolBtnTextFont.prototype.setStyleBtn=function(){var t=this;if(!t.target){t.resetStyleBtn();return!1};var s=!0,e='',i='',r=0;if(!bm.toolManager.isMultiSelectMode){var a=bm.selectionManager.getAllTextNode();if(a){r=a.length;for(var o=0;o<r;o++){if(a[o].tagName&&a[o].tagName.toLowerCase()=='br')continue;if(e==''){e=this.detectFont($(a[o]).parent())}
else{i=this.detectFont($(a[o]).parent());if(e!=i)s=!1}}}
else{e=t.detectFont($(t.target));$(t.target).find('.wveditor_text').children().each(function(){i=t.detectFont($(this));if(e!=i){s=!1;return}})}}
else{$(t.target).each(function(){if(e==''){e=t.detectFont($(this))}
else{i=t.detectFont($(this));if(e!=i){s=!1;return}};$(this).find('.wveditor_text').children().each(function(){i=t.detectFont($(this));if(e!=i){s=!1;return}})})};t.setSelectedValue(s?e:'','mainBtn');var l=$('[data-wv-tool-option="ToolOpFontFamily"]').find('[data-wv-tool-option-value="'+e+'"]').text();$('[data-wv-tool-btn="ToolBtnTextFont"]').find('.label').text(l);var n=this.optionList['mainBtn'].element.find('.list_contents.on').attr('data-wv-tool-option-value');if(t.fontWeightObj){if(!t.fontWeightObj[n]&&typeof(t.fontWeightObj[n])==='string'){n=n.replaceAll(' ','+')};t.setFontWeightByFamily({type:'fontWeight',data:{fontFamily:n,fontWeightList:t.fontWeightObj[n]}})}};ToolBtnTextFont.prototype.resetStyleBtn=function(){var t=this;t.setSelectedValue('','mainBtn')};ToolBtnTextFont.prototype.addEvent=function(){var t=this};ToolBtnTextFont.prototype.removeEvent=function(){var t=this};var ToolBtnTextLocalStyle=function(t){this.type=t;this.ToolOpTextPicker=new ToolOpTextPicker(this);if(isExpertMode){this.addOption(this.ToolOpTextPicker,'textStyleExpand',this)};this.onBtnClick=function(t,e){switch(e){case'lib_name':this.optionList['textStyleExpand'].showComponent(this.optionList['textStyleExpand']['componentList']['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['textStyleExpand']['componentList']['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['textStyleExpand']['componentList']['WVLocalStyle'].libRemove(this);break}};this.onOptionChange=function(t,e){if(t.includes('WVLocalStyle')){if(t.includes('apply')){this.optionList['textStyleExpand']['componentList']['WVLocalStyle'].apply(t,e,this)}
else if(t.includes('delete')){this.optionList['textStyleExpand']['componentList']['WVLocalStyle'].delete(t,e,this)};return!0}
else{this.applyStyle(e)}};this.conversionFontToString=function(t){var e=[];for(let i=0;i<t.length;i++){if(t[i]==='100')e.push('Thin');if(t[i]==='200')e.push('Extra Light');if(t[i]==='300')e.push('Light');if(t[i]==='400')e.push('Regular');if(t[i]==='500')e.push('Medium');if(t[i]==='600')e.push('Semi Bold');if(t[i]==='700')e.push('Bold');if(t[i]==='800')e.push('Extra Bold');if(t[i]==='900')e.push('Black')};return e};this.conversionFontToNum=function(t){var e=[];for(let i=0;i<t.length;i++){if(t[i]==='Thin')e.push('100');if(t[i]==='Extra Light')e.push('200');if(t[i]==='Light')e.push('300');if(t[i]==='Regular')e.push('400');if(t[i]==='Medium')e.push('500');if(t[i]==='Semi Bold')e.push('600');if(t[i]==='Bold')e.push('700');if(t[i]==='Extra Bold')e.push('800');if(t[i]==='Black')e.push('900')};return e};this.applyStyle=function(t){var r=this,g=!1,e,m=window['wvAdminIFrameBridge']&&wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN;if(m){e=$(r.target).find('> .wveditor_text')}
else{e=$(r.target).find('.wveditor_text')};if(e.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){e=$(this.target)};if(e.length==1&&$(e).find('table').length>0){var u=bm.tableSelectionManager.getRange();if(u.length>0){g=!0;e=u}};var l=e.length,c=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&l==0){alert('적용할 대상이 선택되지 않았습니다.');return};var p=this.getSamplingElement(e),i={fontSize:bm.getStyle(p,'font-size')};if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo)i['lineHeight']=bm.getStyle(p,'lineHeight');bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_FONT_SIZE,i);i=t;if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo)i['lineHeight']='normal';var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,r.target)};var d,h;if(bm.bmEditorManager.registedBoardEditor||(l==1&&c&&!bm.selectionManager.isCollapsed())){var f=c?c.length:0,s;for(var n=0;n<f;n++){s=bm.editor.getSpanNodeByControl(n,f,c[n]);if(s){i.letterSpacing=t*(parseFloat($(s).css('letterSpacing')).toFixed(3)/parseInt($(s).css('fontSize')))+'px';if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){$(s).css(i)}
else{if(a){d=a.applyResourceStyle(s,i,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+d[0]+'"]';r.deleteResourceStyle(h,a)}
else bm.editor.applyCssToElement(s,i)}}}}
else{var n,o,l=e.length;for(n=0;n<l;n++){i.letterSpacing=t*(parseFloat($(e[n]).css('letterSpacing')).toFixed(3)/parseInt($(e[n]).css('fontSize')))+'px';if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){o=$(e[n]).closest('[data-wv-layout-element="block"]').find('.wveditor_text').find('[data-wv-res-id]');if(o.length===0){o=$(e[n]).closest('[data-wv-layout-element="block"]')};o.css(i);o.closest('[data-wv-design-area]').css({height:'auto'})}
else{if(bm.toolManager.isMenuTarget){o=bm.toolManager.menuTargetSelector;a.applyResourceStyle(o,i,!1,!0,!1,!1)}
else{if(g){o=$(e[n])}
else{o=$(e[n]).closest('[data-wv-layout-element="block"]')};a.applyChildrenResourceStyle(o,i,!1,!0);d=a.applyResourceStyle(o,i,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+d[0]+'"]';r.deleteResourceStyle(h,a)}}}};if(a)a.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_FONT_SIZE,i);bm.toolManager.kitReposition();this.setSelectedValue(t,'mainBtn');$(this.btnList['fontSize']).val(parseInt(t));this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:i})}};bm.extend(ToolBtnBase,ToolBtnTextLocalStyle);ToolBtnTextLocalStyle.prototype.setStyleBtn=function(){var t=this;if(!t.target){t.resetStyleBtn();return!1}};ToolBtnTextLocalStyle.prototype.resetStyleBtn=function(){var t=this};ToolBtnTextLocalStyle.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpTextPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnTextLocalStyle.prototype.addEvent=function(){var t=this};ToolBtnTextLocalStyle.prototype.removeEvent=function(){var t=this};var ToolBtnTextBold=function(){this.type='ToolBtnTextBold';this.addOption(new ToolOpFontWeight(),'mainBtn');this.onBtnClick=function(){};this.onOptionChange=function(t,e){var p=this,m=!1,v=!1,o=$(this.target).find('.wveditor_text');if(o.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){o=$(this.target)};if(o.closest('[data-wv-tab]').length>0){v=!0;var f=[];o.each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(f.indexOf(t)===-1)f.push(t)})};if(o.length==1&&$(o).find('table').length>0){var g=bm.tableSelectionManager.getRange();if(g.length>0){m=!0;o=g}};var l=o.length,c=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&l==0){alert('적용할 대상이 선택되지 않았습니다.');return};if(e=='Thin'){e=100}
else if(e=='Extra Light'){e=200}
else if(e=='Light'){e=300}
else if(e=='Regular'){e=400}
else if(e=='Medium'){e=500}
else if(e=='Semi Bold'){e=600}
else if(e=='Bold'){e=700}
else if(e=='Extra Bold'){e=800}
else if(e=='Black'){e=900};var w=this.getSamplingElement(o),a={fontWeight:bm.getStyle(w,'fontWeight')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_FONT_WEIGHT,a);a={fontWeight:e};var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,p.target)};var r,h;if(v&&n){var y=bm.toolManager.isTabActiveStyle?'.active':'';for(var i=0;i<f.length;i++){var b='[data-wv-res-id="'+f[i]+'"] [data-wv-tab-list] [data-wv-tab]'+y;r=n.applyResourceStyle(b,a,!1,!0,!0,!0,[],!1);p.deleteResourceStyle(r[0],n)}}
else if(bm.bmEditorManager.registedBoardEditor||(l==1&&c&&!bm.selectionManager.isCollapsed())){var u=c?c.length:0,d;for(var i=0;i<u;i++){d=bm.editor.getSpanNodeByControl(i,u,c[i]);if(d){if(n){r=n.applyResourceStyle(d,a,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+r[0]+'"]';p.deleteResourceStyle(h,n)}
else bm.editor.applyCssToElement(d,a)}}}
else{var i,s,l=o.length;for(i=0;i<l;i++){if(bm.toolManager.isMenuTarget){s=bm.toolManager.menuTargetSelector;n.applyResourceStyle(s,a,!1,!0,!1,!1)}
else{if(m){s=$(o[i])}
else{s=$(o[i]).closest('[data-wv-layout-element="block"]')};n.applyChildrenResourceStyle(s,a,!1,!0);r=n.applyResourceStyle(s,a,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+r[0]+'"]';p.deleteResourceStyle(h,n)}}};if(n)n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_FONT_WEIGHT,a);bm.toolManager.kitReposition();this.setSelectedValue(this.getLabel(e),'mainBtn');this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:a})};this.getLabel=function(t){var e='';if(t==100){e='Thin'}
else if(t==200){e='Extra Light'}
else if(t==300){e='Light'}
else if(t==400){e='Regular'}
else if(t==500){e='Medium'}
else if(t==600){e='Semi Bold'}
else if(t==700){e='Bold'}
else if(t==800){e='Extra Bold'}
else if(t==900){e='Black'};return e};this.onBtnClick=function(t,e){if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){if($(this.btnList['strong']).hasClass('active')){$(this.btnList['strong']).removeClass('active');this.onOptionChange(null,'Regular')}
else{$(this.btnList['strong']).addClass('active');this.onOptionChange(null,'Bold')}}
else{switch(e){case'upBtn':this.setPrevOption('mainBtn');break;case'downBtn':this.setNextOption('mainBtn');break}}}};bm.extend(ToolBtnBase,ToolBtnTextBold);ToolBtnTextBold.prototype.setStyleBtn=function(){var t=this;if(!t.target){t.resetStyleBtn();return!1};var a=!0,e='',i='',s=0;if(!bm.toolManager.isMultiSelectMode){var o=bm.selectionManager.getAllTextNode();if(o){s=o.length;for(var n=0;n<s;n++){if(o[n].tagName&&o[n].tagName.toLowerCase()=='br')continue;if(e==''){e=t.getLabel($(o[n]).parent().css('fontWeight'))}
else{i=t.getLabel($(o[n]).parent().css('fontWeight'));if(e!=i)a=!1}}}
else{e=t.getLabel($(t.target).css('fontWeight'));$(t.target).find('.wveditor_text').children().each(function(){i=t.getLabel($(this).css('fontWeight'));if(e!=i){a=!1;return}})}}
else{$(t.target).each(function(){if(e==''){e=t.getLabel($(this).css('fontWeight'))}
else{i=t.getLabel($(this).css('fontWeight'));if(e!=i){a=!1;return}};$(this).find('.wveditor_text').children().each(function(){i=t.getLabel($(this).css('fontWeight'));if(e!=i){a=!1;return}})})};if($('#WEVEN_IFRAME').length>0&&wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){if(e==='Bold'){$(this.btnList['strong']).addClass('active')}
else{$(this.btnList['strong']).removeClass('active')}}
else{t.setSelectedValue(a?e:'Mixed','mainBtn')}};ToolBtnTextBold.prototype.resetStyleBtn=function(){var t=this;if($('#WEVEN_IFRAME').length>0&&wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){$(this.btnList['strong']).removeClass('active')}
else{t.setSelectedValue('','mainBtn')}};ToolBtnTextBold.prototype.addEvent=function(){var t=this};ToolBtnTextBold.prototype.removeEvent=function(){var t=this};var ToolBtnTextSize=function(){this.type='ToolBtnTextSize';this.addOption(new ToolOpFontSize(),'mainBtn');this.onOptionChange=function(t,e){this.applyStyle(e)};this.onBtnClick=function(t,e){switch(e){case'upBtn':this.setPrevOption('mainBtn');break;case'downBtn':this.setNextOption('mainBtn');break}};this.applyStyle=function(t){var r=this,g=!1,e,m=window['wvAdminIFrameBridge']&&wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN;if(m){e=$(r.target).find('> .wveditor_text')}
else{e=$(r.target).find('.wveditor_text')};if(e.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){e=$(this.target)};if(e.length==1&&$(e).find('table').length>0){var u=bm.tableSelectionManager.getRange();if(u.length>0){g=!0;e=u}};var l=e.length,c=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&l==0){alert('적용할 대상이 선택되지 않았습니다.');return};var p=this.getSamplingElement(e),i={fontSize:bm.getStyle(p,'font-size')};if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo)i['lineHeight']=bm.getStyle(p,'lineHeight');bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_FONT_SIZE,i);i={fontSize:t+'px'};if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo)i['lineHeight']='normal';var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,r.target)};var d,h;if(bm.bmEditorManager.registedBoardEditor||(l==1&&c&&!bm.selectionManager.isCollapsed())){var f=c?c.length:0,s;for(var n=0;n<f;n++){s=bm.editor.getSpanNodeByControl(n,f,c[n]);if(s){i.letterSpacing=t*(parseFloat($(s).css('letterSpacing')).toFixed(3)/parseInt($(s).css('fontSize')))+'px';if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){$(s).css(i)}
else{if(a){d=a.applyResourceStyle(s,i,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+d[0]+'"]';r.deleteResourceStyle(h,a)}
else bm.editor.applyCssToElement(s,i)}}}}
else{var n,o,l=e.length;for(n=0;n<l;n++){i.letterSpacing=t*(parseFloat($(e[n]).css('letterSpacing')).toFixed(3)/parseInt($(e[n]).css('fontSize')))+'px';if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){o=$(e[n]).closest('[data-wv-layout-element="block"]').find('.wveditor_text').find('[data-wv-res-id]');if(o.length===0){o=$(e[n]).closest('[data-wv-layout-element="block"]')};o.css(i);o.closest('[data-wv-design-area]').css({height:'auto'})}
else{if(bm.toolManager.isMenuTarget){o=bm.toolManager.menuTargetSelector;a.applyResourceStyle(o,i,!1,!0,!1,!1)}
else{if(g){o=$(e[n])}
else{o=$(e[n]).closest('[data-wv-layout-element="block"]')};a.applyChildrenResourceStyle(o,i,!1,!0);d=a.applyResourceStyle(o,i,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+d[0]+'"]';r.deleteResourceStyle(h,a)}}}};if(a)a.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_FONT_SIZE,i);bm.toolManager.kitReposition();this.setSelectedValue(t,'mainBtn');$(this.btnList['fontSize']).val(parseInt(t));this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:i})}};bm.extend(ToolBtnBase,ToolBtnTextSize);ToolBtnTextSize.prototype.setStyleBtn=function(){var i=this;if(!i.target){i.resetStyleBtn();return!1};var a=!0,t='',e='',s=0;if(!bm.toolManager.isMultiSelectMode){var o=bm.selectionManager.getAllTextNode();if(o){s=o.length;for(var n=0;n<s;n++){if(o[n].tagName&&o[n].tagName.toLowerCase()=='br')continue;if(t==''){t=parseInt($(o[n]).parent().css('fontSize'))}
else{e=parseInt($(o[n]).parent().css('fontSize'));if(t!=e)a=!1}}}
else{t=parseInt($(i.target).css('fontSize'));$(i.target).find('.wveditor_text').children().each(function(){e=parseInt($(this).css('fontSize'));if(t!=e){a=!1;return}})}}
else{$(i.target).each(function(){if(t==''){t=parseInt($(this).css('fontSize'))}
else{e=parseInt($(this).css('fontSize'));if(t!=e){a=!1;return}};$(this).find('.wveditor_text').children().each(function(){e=parseInt($(this).css('fontSize'));if(t!=e){a=!1;return}})})};i.setSelectedValue(a?t:'','mainBtn');$(i.btnList['fontSize']).val(a?t:'Mixed');this.timer;this.setKeyUpTargetValue=function(t,e){if(t.keyCode==8||(t.keyCode>=48&&t.keyCode<=57)||(t.keyCode>=96&&t.keyCode<=105)){var i=this,n=i.target;clearTimeout(i.timer);i.timer=setTimeout(function(){if(n!=i.target)return!1;t.stopImmediatePropagation();var o=parseInt($.trim($(e).val()),10);if(isNaN(o)||(o<=0)){o=19};i.applyStyle(o);$(e).select()},400)}}};ToolBtnTextSize.prototype.resetStyleBtn=function(){var t=this;t.setSelectedValue('','mainBtn')};ToolBtnTextSize.prototype.addEvent=function(){var t=this;$(t.btnList['fontSize']).on('keydown',function(e){if(e.keyCode==13){var i=parseInt($.trim($(this).val()),10);if(isNaN(i)||(i<=0)){bm.toast('숫자만 입력해 주세요.');t.setStyleBtn();$(this).select();return};t.applyStyle(i);$(this).select()}});$(t.btnList['fontSize']).on('keyup',function(t){})};ToolBtnTextSize.prototype.removeEvent=function(){var t=this;$(t.btnList['fontSize']).off('keydown');$(t.btnList['fontSize']).off('keyup')};var ToolBtnTextColor=function(t){this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);if(isExpertMode){this.addOption(this.colorPicker,'textColorExpand')}
else{this.addOption(this.colorPicker,'color')};this.onOptionChange=function(t,e){if(t==='ToolOpColorPicker'){this.setStyle(e,undefined,t)}
else if(t.includes('WVLocalStyle')===!0){if(t.includes('apply')){this.optionList['textColorExpand']['componentList']['WVLocalStyle'].apply(t,e,this)}
else if(t.includes('delete')){this.optionList['textColorExpand']['componentList']['WVLocalStyle'].delete(t,e,this)};return!0}
else{this.setStyle(e)}};this.setStyle=function(t,e,i){var B=this,M=!1;if(typeof(t)==='object'){M=!0};t=bm.number.rgbaObjToStr(t);var T=!1,O=!1,o=$(this.target).find('.wveditor_text');if(o.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){o=$(this.target)};if(o.closest('[data-wv-tab]').length>0){O=!0;var w=[];o.each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(w.indexOf(t)===-1)w.push(t)})};if(o.length==1&&$(o).find('table').length>0){var I=bm.tableSelectionManager.getRange();if(I.length>0){T=!0;o=I}};var L=o.length,y=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&L==0){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.indexOf('applyPoint')==-1){var x=$(this.colorPicker.element).find('input.opacity').val(),l;if(x){if(isExpertMode){if(e){l=parseInt(e)/100}
else{l=parseInt(x)/100}}
else{l=((100-parseInt(x))/100)}}
else{l=1};var b=bm.number.hexToRgb(t);if(b){var v=l==1?t:'rgba('+b.r+', '+b.g+', '+b.b+', '+l+')'}
else{var v=t}};if(T){for(var n=0;n<o.length;n++){$(o[n]).removeClass('point0');$(o[n]).removeClass('point1');$(o[n]).removeClass('point2')}}
else{$(this.target).removeClass('point0');$(this.target).removeClass('point1');$(this.target).removeClass('point2');var p=$(this.target).closest('[data-wv-layout-element="block"]');p.removeClass('point0');p.removeClass('point1');p.removeClass('point2')};var m=this.getSamplingElement(o),s={color:bm.getStyle(m,'color')};bm.toolManager.toolBtnEditBefore(this,m,HistoryType.EDITOR_TEXT_COLOR,s);if(bm.number.isHex(v)===!0){v='#'+t.replaceAll('#','')};s={color:t=='transparent'?'':v};var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,m)};var c=null,g=null;if(O&&a){if(t.indexOf('applyPoint')>-1){s['color']=this.optionList['color'].cssPointColors[t.replace('applyPoint','')]};var A=bm.toolManager.isTabActiveStyle?'.active':'';for(var n=0;n<w.length;n++){var R='[data-wv-res-id="'+w[n]+'"] [data-wv-tab-list] [data-wv-tab]'+A;c=a.applyResourceStyle(R,s,!1,!0,!0,!0,[],!1);B.deleteResourceStyle(c[0],a)}}
else if(bm.bmEditorManager.registedBoardEditor||(L==1&&y&&!bm.selectionManager.isCollapsed())){var k=y?y.length:0,r;for(var n=0;n<k;n++){r=bm.editor.getSpanNodeByControl(n,k,y[n]);$(r).removeClass('point0');$(r).removeClass('point1');$(r).removeClass('point2');if(r){if(t.indexOf('applyPoint')>-1){var S=t.replace('applyPoint',''),h='point'+S;$(r).addClass(h)}
else{if(a){c=a.applyResourceStyle(r,s,!1,!0,!0,!0,[],!0);g='[data-wv-res-id="'+c[0]+'"]';B.deleteResourceStyle(g,a)}
else bm.editor.applyCssToElement(r,s)}}}}
else{if(t.indexOf('applyPoint')>-1){var S=t.replace('applyPoint',''),h='point'+S;for(var n=0;n<o.length;n++){if(T){$(o[n]).addClass(h)}
else{$(this.target).addClass(h);var C=$(this.target).find(' > *').find('[data-wv-res-id]');if(C.length>0){var u,E;for(u=0;u<C.length;u++){E=C[u];$(E).addClass(h)}};var p=$(o[n]).closest('[data-wv-layout-element="block"]');p.addClass(h)}}}
else{var n,d;for(n=0;n<o.length;n++){if(bm.toolManager.isMenuTarget){d=bm.toolManager.menuTargetSelector;a.applyResourceStyle(d,s,!1,!0,!1,!1)}
else{if(T){d=$(o[n])}
else{d=$(o[n]).closest('[data-wv-layout-element="block"]')};a.applyChildrenResourceStyle(d,s,!1,!0);if(e){$(this.btnList['color_opacity']).val(e+'%')};if(i==='ToolOpColorPicker'){var f;if(M){f=bm.number.rgbToHex(t)}
else{f=t};$(this.btnList['color_word']).val(f);$('#textColorPicker').val('#'+f.replaceAll('#',''));$(this.btnList['color_opacity']).val(l*100+'%');$(this.colorPicker.element).find('input.color_option_prev').val('#'+f.replaceAll('#',''))};c=a.applyResourceStyle(d,s,!1,!0,!0,!0,[],!0);g='[data-wv-res-id="'+c[0]+'"]';B.deleteResourceStyle(g,a)}}}};if(a)a.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,m,HistoryType.EDITOR_TEXT_COLOR,s);$(this.btnList).find('.text_color_thumbnail').css({backgroundColor:t,transition:'none'});events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:s})};this.onBtnClick=function(t,e){switch(e){case'color':{this.showOption(this.optionList[0],this.btnList['apply']);this.focusBtn=this.btnList['apply']};break;case'apply':{var i=bm.number.rgbToHex($(this.btnList['apply']).find('.text_color_thumbnail').css('backgroundColor'));this.setStyle(i)};case'lib_name':this.optionList['textColorExpand'].showComponent(this.optionList['textColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['textColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['textColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}}};bm.extend(ToolBtnBase,ToolBtnTextColor);ToolBtnTextColor.prototype.setStyleBtn=function(t){var i=this;if(!i.target){i.resetStyleBtn();return!1};var f,i=this,c=!0,e='',o='',n='',u=0;if(!bm.toolManager.isMultiSelectMode){var h=bm.selectionManager.getAllTextNode();if(h){u=h.length;for(var d=0;d<u;d++){if(h[d].tagName&&h[d].tagName.toLowerCase()=='br')continue;var l=$(h[d]).parent();if($(l).hasClass('point0')){n='point0'}
else if($(l).hasClass('point1')){n='point1'}
else if($(l).hasClass('point2')){n='point2'};if(e==''){e=l.css('color')}
else{o=l.css('color');if(e!=o)c=!1}}}
else{if($(i.target).hasClass('point0')){n='point0'}
else if($(i.target).hasClass('point1')){n='point1'}
else if($(i.target).hasClass('point2')){n='point2'};e=$(i.target).css('color');$(i.target).find('.wveditor_text').children().each(function(){o=$(this).css('color');if(e!=o){c=!1;return}})}}
else{$(i.target).each(function(){if($(this).hasClass('point0')){n='point0'}
else if($(this).hasClass('point1')){n='point1'}
else if($(this).hasClass('point2')){n='point2'};if(e==''){e=$(this).css('color')}
else{o=$(this).css('color');if(e!=o){c=!1;return}};$(this).find('.wveditor_text').children().each(function(){if($(this).hasClass('point0')){n='point0'}
else if($(this).hasClass('point1')){n='point1'}
else if($(this).hasClass('point2')){n='point2'};o=$(this).css('color');if(e!=o){c=!1;return}})})};if(n!=''){var p=n.replace('point','');p=parseInt(p);f=p}
else{f=-1};if(c){if(e===''){e='rgba(255, 255, 255, 1)'};let hexColor=bm.number.rgbToHex(e);if(f>-1){$(i.btnList).find('.text_color_thumbnail').css({backgroundColor:e,transition:'none'});e='#000000'}
else{$(i.btnList).find('.text_color_thumbnail').css({backgroundColor:e,transition:'none'})};if(isExpertMode){this['btnList']['color_opacity'].value=bm.number.rgbaToObj(e)['a']*100+'%';this['btnList']['color_word'].value=bm.number.rgbToHex(hexColor).toUpperCase().replaceAll('#','');this['btnList']['color_img'].value=hexColor};var a,r=0;if(e){if(e.indexOf('#')!=-1){a=e}
else{if(parseFloat(e.split(',')[3])){if(isExpertMode){r=parseFloat((parseFloat(e.split(',')[3])).toFixed(2))}
else{r=parseFloat((1-parseFloat(e.split(',')[3])).toFixed(2));r*=100}}
else{r=1};a=bm.number.rgbToHex(e)}}
else{a='#000000'};var s=bm.number.hexToRgb(a),g=90,m='rgb(0, 0, 0)',v='rgb(255, 255, 255)';if(!isExpertMode){this.colorPicker.setStyleValue(s.r,s.g,s.b,r,f,g,m,v)}
else{this.colorPicker.setStyleValue(s.r,s.g,s.b,r,null,null,null,null)}}
else{e='#000000';i.colorPicker.setInputColorCode(e);a=e.toUpperCase().replaceAll('#','');if(isExpertMode){this['btnList']['color_opacity'].value=bm.number.rgbaToObj(e)['a'];this['btnList']['color_word'].value=a;this['btnList']['color_img'].value=a}
else{$(i.btnList).find('.text_color_thumbnail').css({backgroundColor:e,transition:'none'})};$(i.colorPicker.element).find('input.color_input.red').val(0);$(i.colorPicker.element).find('input.color_input.green').val(0);$(i.colorPicker.element).find('input.color_input.blue').val(0);$(i.colorPicker.element).find('input.color_input.opacity').val(0)}};ToolBtnTextColor.prototype.resetStyleBtn=function(){var t=this};ToolBtnTextColor.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnTextColor.prototype.addEvent=function(){var t=this;if(isExpertMode){this.onOptionShow=function(e,i){t.setStyleBtn(!0)};$(t.btnList['color_word']).on('keydown',function(e){var i=$(this).val();if(e.keyCode==13){if(bm.number.isHex(i)==!1){bm.toast('올바른 색상코드를 입력해주세요.');return!1};t.setStyle(this['value'],parseFloat(t.btnList['color_opacity']['value']));this['value']=this['value'].toUpperCase().replaceAll('#','');t.btnList['color_img']['value']='#'+this['value'].replaceAll('#','');$(this).select()}});$(t.btnList['color_img']).on('change',function(e){t.setStyle(this['value'],parseFloat(t.btnList['color_opacity']['value']));t.btnList['color_word']['value']=this['value'].toUpperCase().replaceAll('#','')});$(t.btnList['color_opacity']).on('keydown',function(e){var i=$(this).val();if(e.keyCode==13){if(i.indexOf('%')===-1&&!bm.valid.isOnlyNum(i)||!/^\d+(%{0,1})$/.test(i)){bm.toast('숫자만 입력해 주세요.');$(this).val(100+'%');return!1}
else if(i<0||i>100){$(this).val(100+'%');bm.toast('투명도는 0 ~ 100%까지 설정가능합니다.');return!1};t.setStyle(t.btnList['color_word']['value'],parseFloat(this['value']));$(this).select()}})}};ToolBtnTextColor.prototype.removeEvent=function(){var t=this};var ToolBtnTextDecoration=function(){this.type='ToolBtnTextDecoration';this.styleKey;this.styleOriginValue;this.styleValue;this.isTabMenuEdit=!1;this.onBtnClick=function(t,e){$(this.btnList).removeClass('active');if(e=='italic'){this['styleKey']='font-style'}
else if(e=='bold'){e='700';this['styleKey']='font-weight'}
else{this['styleKey']='text-decoration'};this.styleOriginValue=e=='lineThrough'?'line-through':e;this.styleValue=this.styleOriginValue+' !important';this.setStyle(e)};this.setStyle=function(t){var p=this,v=!1,o=$(this.target).find('.wveditor_text');if(o.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){o=$(this.target)};if(o.closest('[data-wv-tab]').length>0){this.isTabMenuEdit=!0;var f=[];o.each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(f.indexOf(t)===-1)f.push(t)})};if(o.length==1&&$(o).find('table').length>0){var m=bm.tableSelectionManager.getRange();if(m.length>0){v=!0;o=m}};var l=o.length,c=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&l==0){alert('적용할 대상이 선택되지 않았습니다.');return};var r=this.getIsApplyStyle(this.styleKey,this.styleOriginValue),g=this.target,w=this.getSamplingElement(o),e={};e[this.styleKey]=bm.getStyle(w,this.styleKey);bm.toolManager.toolBtnEditBefore(this,g,HistoryType.EDITOR_TEXT_DECORATION,e);if(this.isTabMenuEdit){if(this.styleKey==='font-style'){e[this.styleKey]=!r?this.styleValue:'normal !important'}
else{e[this.styleKey]=!r?this.styleValue:'none !important'}}
else{if(this.styleKey==='font-style'||this['styleKey']=='font-weight'){e[this.styleKey]=!r?this.styleValue:'normal'}
else{e[this.styleKey]=!r?this.styleValue:'none'}};var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,p.target)};var s,h;if(this.isTabMenuEdit&&n){var y=bm.toolManager.isTabActiveStyle?'.active':'';for(var i=0;i<f.length;i++){var b='[data-wv-res-id="'+f[i]+'"] [data-wv-tab-list] [data-wv-tab]'+y;s=n.applyResourceStyle(b,e,!1,!0,!0,!0,[],!1);p.deleteResourceStyle(s[0],n)}}
else if(bm.bmEditorManager.registedBoardEditor||(l==1&&c&&!bm.selectionManager.isCollapsed())){var u=c?c.length:0,d;for(var i=0;i<u;i++){d=bm.editor.getSpanNodeByControl(i,u,c[i]);if(d){if(n){s=n.applyResourceStyle(d,e,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+s[0]+'"]';p.deleteResourceStyle(h,n)}
else{e[this.styleKey]=!r?this.styleOriginValue:'';bm.editor.applyCssToElement(d,e)}}}}
else{var i,a,l=o.length;for(i=0;i<l;i++){if(bm.toolManager.isMenuTarget){a=bm.toolManager.menuTargetSelector;n.applyResourceStyle(a,e,!1,!0,!1,!1)}
else{if(v){a=$(o[i])}
else{a=$(o[i]).closest('[data-wv-layout-element="block"]')};n.applyChildrenResourceStyle(a,e,!1,!0);s=n.applyResourceStyle(a,e,!1,!0,!0,!0,[],!0);h='[data-wv-res-id="'+s[0]+'"]';p.deleteResourceStyle(h,n)}}};if(n)n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,g,HistoryType.EDITOR_TEXT_DECORATION,e);this.setStyleBtn();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:e})};this.checkProperty=function(t,e){var i=null;if(!this.target)return i;if(e==='text-decoration')e=e+'-line';if(t[0])t=t[0];if(this.target==t||document.body==t||this.innerWindow.document.body==t){return $(t).css(e)};if($(t).css(e)==='none'&&(t.style[e]==='inherit'||t.style[e]==='')){i=this.checkProperty($(t).parent(),e)}
else{i=$(t).css(e)};return i};this.getIsApplyStyle=function(t,e){var o=this,a,n=!0;if(!o.target){return};if(this.isTabMenuEdit){var l=WVAdminResourceManager.getEmbededStyleObject(null,o.target),d=bm.toolManager.isTabActiveStyle?'.active':'',h=$(o.target).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id'),c='[data-wv-res-id="'+h+'"] [data-wv-tab-list] [data-wv-tab]'+d,r=l.getRulesBySelectorText(c,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),i;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':i=0;break;case'768':i=1;break;case'992':i=2;break;case'1200':i=3;break;case'1600':i=4;break};if(t==='text-decoration')t=t+'-line';for(i;i>=0;i--){if(r[i].style&&r[i].style[t]!==e&&r[i].style[t].indexOf(e)===-1){n=!1;break}};return n}
else if(!bm.toolManager.isMultiSelectMode){var s=bm.selectionManager.getAllTextNode();if(s){len=s.length;for(var i=0;i<len;i++){a=bm.dom.findParentUntilElement(s[i]);if($(a).css(t)!=e&&$(a).css(t).indexOf(e)==-1){if(o.checkProperty(a,t)!=e){n=!1;break}}};return n}
else{if($(o.target).css(t)!=e&&$(o.target).css(t).indexOf(e)==-1){n=!1};const recursiveSearch=(target)=>{if($(target).children('[data-wv-res-id]').length>0){$(target).children('[data-wv-res-id]').each(function(){if($(this).css(t)!=e&&$(this).css(t).indexOf(e)==-1){n=!1;recursiveSearch(this)}})}};$(o.target).find('.wveditor_text').children('[data-wv-res-id]').each(function(){if($(this).css(t)!=e&&$(this).css(t).indexOf(e)==-1){n=!1;recursiveSearch(this);return}});return n}}
else{$(o.target).each(function(){if($(this).css(t)!=e&&$(this).css(t).indexOf(e)==-1){n=!1;return};$(this).find('.wveditor_text').children().each(function(){if($(this).css(t)!=e&&$(this).css(t).indexOf(e)==-1){if(o.checkProperty(this,t)!=e){n=!1;return}}})});return n}}};bm.extend(ToolBtnBase,ToolBtnTextDecoration);ToolBtnTextDecoration.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length===0){t.resetStyleBtn();return!1};if($(t.target).closest('[data-wv-tab]').length>0){this.isTabMenuEdit=!0};var e=t.getIsApplyStyle('text-decoration','underline');if(e)$(t.btnList['underline']).addClass('active');else $(t.btnList['underline']).removeClass('active');e=t.getIsApplyStyle('text-decoration','line-through');if(e)$(t.btnList['lineThrough']).addClass('active');else $(t.btnList['lineThrough']).removeClass('active');e=t.getIsApplyStyle('font-style','italic');if(e)$(t.btnList['italic']).addClass('active');else $(t.btnList['italic']).removeClass('active');e=t.getIsApplyStyle('font-weight','700');if(e)$(t.btnList['bold']).addClass('active');else $(t.btnList['bold']).removeClass('active')};ToolBtnTextDecoration.prototype.resetStyleBtn=function(){var t=this;$(t.btnList).removeClass('active')};ToolBtnTextDecoration.prototype.addEvent=function(){var t=this};ToolBtnTextDecoration.prototype.removeEvent=function(){var t=this};var ToolBtnTextLetterSpacing=function(){this.type='ToolBtnTextLetterSpacing';this.addOption(new ToolOpLetterSpacing(),'mainBtn');this.onOptionChange=function(t,e){this.setStyle(e)};this.onBtnClick=function(t,e){switch(e){case'upBtn':this.setPrevOption('mainBtn');break;case'downBtn':this.setNextOption('mainBtn');break}};this.setStyle=function(t){var c=this,u=!1,i=$(this.target).find('.wveditor_text');if(i.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){i=$(this.target)};if(i.length==1&&$(i).find('table').length>0){var p=bm.tableSelectionManager.getRange();if(p.length>0){u=!0;i=p}};var s=i.length,h=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&s==0){alert('적용할 대상이 선택되지 않았습니다.');return};var g=this.getSamplingElement(i),o={letterSpacing:bm.getStyle(g,'letterSpacing')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_LETTER_SPACING,o);o={letterSpacing:t};var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,c.target)};var l,d;if(bm.bmEditorManager.registedBoardEditor||(s==1&&h&&!bm.selectionManager.isCollapsed())){var f=h?h.length:0,r;for(var e=0;e<f;e++){r=bm.editor.getSpanNodeByControl(e,f,h[e]);if(r){if(n){l=n.applyResourceStyle(r,o,!1,!0,!0,!0,[],!0);d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,n)}
else bm.editor.applyCssToElement(r,o)}}}
else{var e,a,s=i.length;for(e=0;e<s;e++){if(bm.toolManager.isMenuTarget){a=bm.toolManager.menuTargetSelector;n.applyResourceStyle(a,o,!1,!0,!1,!1)}
else{if(u){a=$(i[e])}
else{a=$(i[e]).closest('[data-wv-layout-element="block"]')};n.applyChildrenResourceStyle(a,o,!1,!0);l=n.applyResourceStyle(a,o,!1,!0,!0,!0,[],!0);d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,n)}}};n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_LETTER_SPACING,o);this.setSelectedValue(t,'mainBtn');$(this.btnList['letterSpacing']).val(parseFloat(t)*100/10);this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:o})}};bm.extend(ToolBtnBase,ToolBtnTextLetterSpacing);ToolBtnTextLetterSpacing.prototype.setStyleBtn=function(){var o=this;if(!o.target){o.resetStyleBtn();return!1};var a=!0,t='',e='',s=0;if(!bm.toolManager.isMultiSelectMode){var n=bm.selectionManager.getAllTextNode();if(n){s=n.length;for(var i=0;i<s;i++){if(n[i].tagName&&n[i].tagName.toLowerCase()=='br')continue;if(t==''){t=parseFloat($(n[i]).parent().css('letterSpacing'))/parseInt($(n[i]).parent().css('fontSize'),10)||0;t=t.toFixed(3)}
else{e=parseFloat($(n[i]).parent().css('letterSpacing'))/parseInt($(n[i]).parent().css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e)a=!1}}}
else{t=parseFloat($(o.target).css('letterSpacing'))/parseInt($(o.target).css('fontSize'),10)||0;t=t.toFixed(3);$(o.target).find('.wveditor_text').children().each(function(){e=parseFloat($(this).css('letterSpacing'))/parseInt($(this).css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e){a=!1;return}})}}
else{$(o.target).each(function(){if(t==''){t=parseFloat($(this).css('letterSpacing'))/parseInt($(this).css('fontSize'),10)||0;t=t.toFixed(3)}
else{e=parseFloat($(this).css('letterSpacing'))/parseInt($(this).css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e){a=!1;return}};$(this).find('.wveditor_text').children().each(function(){e=parseFloat($(this).css('letterSpacing'))/parseInt($(this).css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e){a=!1;return}})})};o.setSelectedValue(a?t+'em':'0em','mainBtn');$(o.btnList['letterSpacing']).val(parseFloat(t)*1000/100)};ToolBtnTextLetterSpacing.prototype.resetStyleBtn=function(){var t=this;t.setSelectedValue('','mainBtn')};ToolBtnTextLetterSpacing.prototype.addEvent=function(){var t=this;$(t.btnList['letterSpacing']).on('keydown',function(e){if(e.keyCode==13){var i=parseFloat($.trim($(this).val()));if($.isNumeric(i)==!1){bm.toast('숫자만 입력해 주세요.');t.setStyleBtn();$(this).select();return};t.setStyle(i/10+'em');$(this).select()}})};ToolBtnTextLetterSpacing.prototype.removeEvent=function(){var t=this;$(t.btnList['letterSpacing']).off('focusout');$(t.btnList['letterSpacing']).off('focus');$(t.btnList['letterSpacing']).off('keydown')};var ToolBtnTextWordSpacing=function(){this.type='ToolBtnTextWordSpacing';this.onOptionChange=function(t,e){this.setStyle(e)};this.onBtnClick=function(t,e){switch(e){case'upBtn':this.setPrevOption('mainBtn');break;case'downBtn':this.setNextOption('mainBtn');break}};this.setStyle=function(t){var c=this,u=!1,i=$(this.target).find('.wveditor_text');if(i.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){i=$(this.target)};if(i.length==1&&$(i).find('table').length>0){var p=bm.tableSelectionManager.getRange();if(p.length>0){u=!0;i=p}};var s=i.length,h=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&s==0){alert('적용할 대상이 선택되지 않았습니다.');return};var g=this.getSamplingElement(i),o={wordSpacing:bm.getStyle(g,'wordSpacing')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_LETTER_SPACING,o);o={wordSpacing:t};var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,c.target)};var l,d;if(bm.bmEditorManager.registedBoardEditor||(s==1&&h&&!bm.selectionManager.isCollapsed())){var f=h?h.length:0,r;for(var e=0;e<f;e++){r=bm.editor.getSpanNodeByControl(e,f,h[e]);if(r){if(n){l=n.applyResourceStyle(r,o,!1,!0,!0,!0,[],!0);d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,n)}
else bm.editor.applyCssToElement(r,o)}}}
else{var e,a,s=i.length;for(e=0;e<s;e++){if(bm.toolManager.isMenuTarget){a=bm.toolManager.menuTargetSelector;n.applyResourceStyle(a,o,!1,!0,!1,!1)}
else{if(u){a=$(i[e])}
else{a=$(i[e]).closest('[data-wv-layout-element="block"]')};n.applyChildrenResourceStyle(a,o,!1,!0);l=n.applyResourceStyle(a,o,!1,!0,!0,!0,[],!0);d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,n)}}};n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_LETTER_SPACING,o);this.setSelectedValue(t,'mainBtn');$(this.btnList['wordSpacing']).val(parseFloat(t)*100/10);this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:o})}};bm.extend(ToolBtnBase,ToolBtnTextWordSpacing);ToolBtnTextWordSpacing.prototype.setStyleBtn=function(){var o=this;if(!o.target){o.resetStyleBtn();return!1};var a=!0,t='',e='',s=0;if(!bm.toolManager.isMultiSelectMode){var n=bm.selectionManager.getAllTextNode();if(n){s=n.length;for(var i=0;i<s;i++){if(n[i].tagName&&n[i].tagName.toLowerCase()=='br')continue;if(t==''){t=parseFloat($(n[i]).parent().css('wordSpacing'))/parseInt($(n[i]).parent().css('fontSize'),10)||0;t=t.toFixed(3)}
else{e=parseFloat($(n[i]).parent().css('wordSpacing'))/parseInt($(n[i]).parent().css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e)a=!1}}}
else{t=parseFloat($(o.target).css('wordSpacing'))/parseInt($(o.target).css('fontSize'),10)||0;t=t.toFixed(3);$(o.target).find('.wveditor_text').children().each(function(){e=parseFloat($(this).css('wordSpacing'))/parseInt($(this).css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e){a=!1;return}})}}
else{$(o.target).each(function(){if(t==''){t=parseFloat($(this).css('wordSpacing'))/parseInt($(this).css('fontSize'),10)||0;t=t.toFixed(3)}
else{e=parseFloat($(this).css('wordSpacing'))/parseInt($(this).css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e){a=!1;return}};$(this).find('.wveditor_text').children().each(function(){e=parseFloat($(this).css('wordSpacing'))/parseInt($(this).css('fontSize'),10)||0;e=e.toFixed(3);if(t!=e){a=!1;return}})})};o.setSelectedValue(a?t+'em':'0em','mainBtn');$(o.btnList['wordSpacing']).val(parseInt(t)===0?'Normal':parseFloat(t)*1000/100)};ToolBtnTextWordSpacing.prototype.resetStyleBtn=function(){var t=this;t.setSelectedValue('','mainBtn')};ToolBtnTextWordSpacing.prototype.addEvent=function(){var t=this;$(t.btnList['wordSpacing']).on('keydown',function(e){if(e.keyCode==13){var i=parseFloat($.trim($(this).val()));if($.isNumeric(i)==!1){bm.toast('숫자만 입력해 주세요.');t.setStyleBtn();$(this).select();return};t.setStyle(i/10+'em');$(this).select()}})};ToolBtnTextWordSpacing.prototype.removeEvent=function(){var t=this;$(t.btnList['wordSpacing']).off('focusout');$(t.btnList['wordSpacing']).off('focus');$(t.btnList['wordSpacing']).off('keydown')};var ToolBtnTextLineHeight=function(){this.type='ToolBtnTextLineHeight';this.addOption(new ToolOpLineHeight(),'mainBtn');this.onOptionChange=function(t,e){this.setStyle(e)};this.onBtnClick=function(t,e){switch(e){case'upBtn':this.setPrevOption('mainBtn');break;case'downBtn':this.setNextOption('mainBtn');break}};this.setStyle=function(t){var h=this,v=!1,n,b=window['wvAdminIFrameBridge']&&wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN;if(b){n=$(h.target).find('> .wveditor_text')}
else{n=$(h.target).find('.wveditor_text')};if(n.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){n=$(this.target)};if(n.length==1&&$(n).find('table').length>0){var m=bm.tableSelectionManager.getRange();if(m.length>0){v=!0;n=m}};var c=n.length,d=bm.selectionManager.getAllTextNode();if(bm.bmEditorManager.registedBoardEditor==!1&&c==0){alert('적용할 대상이 선택되지 않았습니다.');return}
else if(bm.bmEditorManager.registedBoardEditor){if(!d||d.length==0){alert('적용할 대상이 선택되지 않았습니다.');return}};var y=this.getSamplingElement(n),o={lineHeight:bm.getStyle(y,'lineHeight')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_LINE_HEIGHT,o);o={lineHeight:t.includes('px')?t:t+'px'};var i=null;if(bm.bmEditorManager.registedBoardEditor===!1){i=WVAdminResourceManager.getEmbededStyleObject(null,h.target)};var r,l,a,e=0;if(bm.bmEditorManager.registedBoardEditor||(c==1&&d&&!bm.selectionManager.isCollapsed())){if(b){var g=bm.selectionManager.getSelectionLine(!0);for(e=0;e<g.length;e++){a=g[e];if($(a).attr('data-wv-layout-element')==='block_inner')a=$(a).parent()[0];if(i){r=i.applyResourceStyle(a,o,!1,!0,!0,!0,[],!0);l='[data-wv-res-id="'+r[0]+'"]';h.deleteResourceStyle(l,i)}
else{bm.editor.applyCssToElement(a,o)}}}
else{var p=d?d.length:0,f,u;u={lineHeight:0};for(e=0;e<p;e++){a=bm.editor.getSpanNodeByControl(e,p,d[e]);f=bm.editor.getSpanParentDivNode(a);if(i){r=i.applyResourceStyle(a,o,!1,!0,!0,!0,[],!0);l='[data-wv-res-id="'+r[0]+'"]';if(f)i.applyResourceStyle(f,u,!1,!0,!0,!0,[],!0);h.deleteResourceStyle(l,i)}
else{bm.editor.applyCssToElement(a,o)}};bm.selectionManager.applyRange(bm.selectionManager.range)}}
else{var s,c=n.length;for(e=0;e<c;e++){if(bm.toolManager.isMenuTarget){s=bm.toolManager.menuTargetSelector;i.applyResourceStyle(s,o,!1,!0,!1,!1)}
else{if(v){s=$(n[e])}
else{s=$(n[e]).closest('[data-wv-layout-element="block"]')};i.applyChildrenResourceStyle(s,o,!1,!0);r=i.applyResourceStyle(s,o,!1,!0,!0,!0,[],!0);l='[data-wv-res-id="'+r[0]+'"]';h.deleteResourceStyle(l,i)}}};if(i)i.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_LINE_HEIGHT,o);bm.toolManager.kitReposition();this.setSelectedValue(t,'mainBtn');if(t==='normal')$(this.btnList['lineHeight']).val('Auto');else $(this.btnList['lineHeight']).val(parseInt(t));this.hideOptionAll();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:o})};this.timer;this.setKeyUpTargetValue=function(t,e){if(t.keyCode==8||(t.keyCode>=48&&t.keyCode<=57)||(t.keyCode>=96&&t.keyCode<=105)){var i=this,n=i.target;clearTimeout(i.timer);i.timer=setTimeout(function(){if(n!=i.target)return!1;t.stopImmediatePropagation()},400)}}};bm.extend(ToolBtnBase,ToolBtnTextLineHeight);ToolBtnTextLineHeight.prototype.setStyleBtn=function(){var e=this;if(!e.target){e.resetStyleBtn();return!1};var o=!0,t=0,n=0,s;if(bm.bmEditorManager.registedBoardEditor===!1&&window['wvAdminIFrameBridge']&&wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN){s=$(e.target).find('> .wveditor_text')}
else{s=$(e.target).find('.wveditor_text')};if(s.length===0){return!1};if(s.length==1&&$(s).find('table').length>0){var l=bm.tableSelectionManager.getRange()};if(l){len=l.length;var r;for(var i=0;i<len;i++){r=l[i];if(t==0){t=$(r).css('lineHeight')}
else{n=$(r).css('lineHeight');if(t!=n){o=!1}}};if(o){e.setSelectedValue(t,'mainBtn');$(e.btnList['lineHeight']).val(t)}
else{e.resetStyleBtn()}}
else{if(!bm.toolManager.isMultiSelectMode){var a=bm.selectionManager.getAllTextNode();if(a){len=a.length;for(var i=0;i<len;i++){if(a[i].tagName&&a[i].tagName.toLowerCase()=='br')continue;if(t==''){t=$(a[i]).parent().css('lineHeight')}
else{n=$(a[i]).parent().css('lineHeight');if(t!=n)o=!1}}}
else{t=$(e.target).css('lineHeight');$(e.target).find('.wveditor_text').children().each(function(){n=$(this).css('lineHeight');if(t!=n){o=!1;return}})}}
else{$(e.target).each(function(){if(t==''){t=$(this).css('lineHeight')}
else{n=$(this).css('lineHeight');if(t!=n){o=!1;return}};$(this).find('.wveditor_text').children().each(function(){n=$(this).css('lineHeight');if(t!=n){o=!1;return}})})};if(o){e.setSelectedValue(t,'mainBtn');if(t==='normal')$(this.btnList['lineHeight']).val('Auto');else $(e.btnList['lineHeight']).val(parseInt(t))}
else{e.resetStyleBtn();$(e.btnList['lineHeight']).val('Mixed')}}};ToolBtnTextLineHeight.prototype.resetStyleBtn=function(){var t=this;t.setSelectedValue('','mainBtn')};ToolBtnTextLineHeight.prototype.addEvent=function(){var t=this;$(t.btnList['lineHeight']).on('keydown',function(e){if(e.keyCode==13){var i=parseInt($.trim($(this).val()),10);if(isNaN(i)||(i<=0)){bm.toast('숫자만 입력해 주세요.');t.setStyleBtn();$(this).select();return};t.setStyle(i+'px');$(this).select()}});if($('#WEVEN_IFRAME').length>0){if(!isPrdDetailInfo){$(t.btnList['lineHeight']).on('keyup',function(e){t.setKeyUpTargetValue(e,this)})}}
else{$(t.btnList['lineHeight']).on('keyup',function(e){t.setKeyUpTargetValue(e,this)})}};ToolBtnTextLineHeight.prototype.removeEvent=function(){var t=this;$(t.btnList['lineHeight']).off('focus');$(t.btnList['lineHeight']).off('keydown');$(t.btnList['lineHeight']).off('keyup')};var ToolBtnTextAlign=function(){this.type='ToolBtnTextAlign';this.caseArray=['left','center','right','justify'];if(bm.toolManager.toolMode==='design'){this.addOption(new ToolOpTextAlign(),'mainBtn');this.onOptionChange=function(t,e){this.setStyle(e)}};this.onBtnClick=function(t,e){if(bm.toolManager.toolMode!=='design'){this.setStyle(e)}};this.setStyle=function(t){var c=this,f=!1,n=$(this.target).find('.wveditor_text');if(n.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){n=$(this.target)};if(n.length==1&&$(n).find('table').length>0){var v=bm.tableSelectionManager.getRange();if(v.length>0){f=!0;n=v}};var r=n.length,h=bm.selectionManager.getAllTextNode()||[],m=$(this.btnList[t]).hasClass('active');if(!bm.bmEditorManager.registedBoardEditor&&r==0&&h.length==0){alert('적용할 대상이 선택되지 않았습니다.');return};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_ALIGN,s);var s={textAlign:!m?t:''};var e=null;if(bm.bmEditorManager.registedBoardEditor===!1){e=WVAdminResourceManager.getEmbededStyleObject(null,c.target)};$(this.btnList).removeClass('active');if(!m){$(this.btnList[t]).addClass('active')};if(bm.toolManager.isMultiSelectMode||r>1||f){var i,o,r=n.length;for(i=0;i<r;i++){o=n[i];if(f){var u=$(o)}
else{var u=$(o).closest('[data-wv-layout-element="block"]')};if(e){e.applyChildrenResourceStyle(u,s,!1,!0);var l=e.applyResourceStyle(u,s,!1,!0),d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,e)}}}
else{var p=bm.selectionManager.getRange(),y=!1;if(p.startContainer.nodeType==3&&$(p.startContainer.parentNode).hasClass('wveditor_text')){h.unshift(bm.dom.wrapOuter(p.startContainer,'<div></div>'));y=!0};if(bm.bmEditorManager.registedBoardEditor||(r==1&&!bm.selectionManager.isCollapsed())){var b=h?h.length:0,a;for(var i=0;i<b;i++){a=h[i];if(a){if(bm.dom.isInline(a)){var g=$(a).parent()[0];if($(g).hasClass('wveditor_text')){a=bm.dom.wrapOuter(a,'<div></div>')}
else{a=g}};if(e){e.applyChildrenResourceStyle(a,s,!1,!0);var l=e.applyResourceStyle(a,s,!1,!0,!0),d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,e)}
else{bm.editor.applyCssToElement(a,s)}}}}
else{var o,r=n.length;for(i=0;i<r;i++){if(bm.toolManager.isMenuTarget){o=bm.toolManager.menuTargetSelector;e.applyResourceStyle(o,s,!1,!0)}
else{if(f){o=$(n[i])}
else{o=$(n[i]).closest('[data-wv-layout-element="block"]')};e.applyChildrenResourceStyle(o,s,!1,!0);l=e.applyResourceStyle(o,s,!1,!0,!0,!0,[],!0);d='[data-wv-res-id="'+l[0]+'"]';c.deleteResourceStyle(d,e)}}}};if(e)e.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_ALIGN);this.setStyleBtn();events(this).dispatch(ToolButtonEvent.CLICK,{btn:this,data:s})}};bm.extend(ToolBtnBase,ToolBtnTextAlign);ToolBtnTextAlign.prototype.setStyleBtn=function(){var n=this;if(!n.target){n.resetStyleBtn();return!1};var d=!1,e=$(n.target).find('.wveditor_text');if(e.length==0&&$(this.target).find('> [data-wv-layout-element="block_inner"]').hasClass('wveditor_text')){e=$(this.target)};if(e.length==1&&$(e).find('table').length>0){var h=bm.tableSelectionManager.getRange();if(h.length>0){d=!0;e=h}};if(!bm.bmEditorManager.registedBoardEditor&&e.length==0){n.resetStyleBtn();return!1};var s=!0,t='',c=e.length,l=bm.selectionManager.getAllElementNode()||[],a='',i;if(bm.toolManager.isMultiSelectMode||c>1||d){for(var o=0;o<e.length;o++){i=e[o];if(d){var r=$(i)}
else{var r=$(i).closest('[data-wv-layout-element="block"]')};if(t==''){t=r.css('textAlign')}
else{a=r.css('textAlign');if(t!=a){s=!1}};r.find('.wveditor_text').children().each(function(){a=$(this).css('textAlign');if(t!=a){s=!1;return}})}}
else{if(l.length==0){i=e[0];t=$(i).css('textAlign');if(t=='start'||t==''){s=!1}}
else{for(var o=0;o<l.length;o++){i=l[o];if(t==''){t=$(i).css('textAlign')}
else{a=$(i).css('textAlign');if(t!=a){s=!1}}}}};if(bm.toolManager.toolMode==='design'){if(t==='start')t='justify';n.resetMainBtnClass();$(n.btnList['mainBtn']).addClass(t)}
else{if(s){$(n.btnList[t]).addClass('active')}
else{n.resetStyleBtn()}}};ToolBtnTextAlign.prototype.resetMainBtnClass=function(){var t=this;for(let i=0;i<t['caseArray'].length;i++){$(t.btnList).removeClass(t['caseArray'][i])}};ToolBtnTextAlign.prototype.resetStyleBtn=function(){var t=this;$(t.btnList).removeClass('active')};ToolBtnTextAlign.prototype.addEvent=function(){var t=this};ToolBtnTextAlign.prototype.removeEvent=function(){var t=this};if(bm.toolManager.toolMode==='design'){ToolBtnTextAlign.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e)}};var ToolBtnTextImage=function(){this.type='ToolBtnTextImage';var t=this;this.filemanager;this.mode='default';this.webroot=window.parent?window.parent.WEB_ROOT:WEB_ROOT;this.fileUploadPath='texteditor/uploadFile/';this.defaultTextEditorFilePath=window.parent?window.parent.WEVEN_DATA_SITE_WEB_PATH:WEVEN_DATA_SITE_WEB_PATH;this.defaultTextEditorFilePath+='file_manager/';this.forceInsertLocation;this.isFileClick=!1;this.onBtnClick=function(e,i){if(this.target.length){alert('블럭을 다중선택한 상태에서는 이미지/파일넣기를 할 수 없습니다.\n블럭을 1개만 선택해주세요.');return};e.stopImmediatePropagation();this.mode=$('#WEVEN_IFRAME').length==0?'default':'block';if(this.isFileClick){this.isFileClick=!1;return!1};if(this.mode=='block'){this.isFileClick=!1;if(!t.target||$(t.target).find('> .wveditor_text').length==0){alert('파일 삽입을 위한 위치를 먼저 선택해주세요.');return};var n=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(n).css('max-width','1600px');$(n).on('load',function(){n.contentWindow.fileManager.onSelectCallBack=t.onFileManagerFileSelected})}
else{var a=bm.selectionManager.getRange();if(!a){t.forceInsertLocation=$('#content_bmeditorEditor')[0]}
else{var l=$(a.commonAncestorContainer);if(l.closest('.editor_wrapper').length==0){t.forceInsertLocation=$('#content_bmeditorEditor')[0]}
else{t.forceInsertLocation=undefined}};console.log('게시판에서는 파일매니저 오픈 X');var s=loginSessionInfo.seq,r='<form name=\'fileUpload\' method=\'post\' enctype=\'multipart/form-data\'><input type=\'hidden\' name=\'apiPath\' value=\'bbs/'+s+'/\'/><input type=\'hidden\' name=\'isBbs\' value=\'1\'/><input type=\'file\' name=\'userfile[]\' multiple=\'multiple\' accept=\'image/gif, image/jpeg, image/png, image/jpg\' style=\'display: none;\'/></form>';if($(this.focusBtn).find('form').length)$(this.focusBtn).find('form').remove();$(this.focusBtn).append(r);var o=$(this.focusBtn).find('input[type=\'file\']')[0];$(o).on('change',function(){Progress.ON();$(t.focusBtn).find('form').ajaxForm({url:WEB_ROOT+'filemanager/uploadFile',dataType:'json',success:function(e){console.log(e);if(e.result&&e.data){var n=e.data;for(var i=0;i<n.length;i++){var o=n[i];t.onFileManagerFileSelected(o)}}
else if(e.result==!1){bm.toast(e.message)};if($(t.focusBtn).find('form').length)$(t.focusBtn).find('form').remove();Progress.OFF()}});t.isFileClick=!1;$(t.focusBtn).find('form').submit()});this.isFileClick=!0;$(o).trigger('click')}};this.onFileManagerFileSelected=function(e,i){bm.popupManager.removePopLatest();var p=e.extension.toLowerCase();bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_IMAGE);var n,f=new RegExp('jpg|jpeg|gif|png'),o,d=!1;if(f.test(p)){if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){$(i).attr('src',e.thumbImg);if($(i).siblings('source').length>0){$(i).siblings('source').attr('srcset',e.thumbImg)}}
else{var a=e.thumbImg;if($(i).closest('[data-wv-logo]').length>0){o=$(i).closest('[data-wv-logo]').attr('data-wv-logo-param');if(o)o=bm.parsing.parseStrToObj(o);d=!0;n=this.getLogoImg(a,i,o);var l=WVAdminResourceManager.getEmbededStyleObject(null,this.target),c='[data-wv-res-id="'+$(this.target).attr('data-wv-res-id')+'"] img';l.deleteRuleBySelector(c,!1,!1);if(l)l.refreshStyleElementText()}
else{if(i)n=this.getPictureSet(i,a);else n=bm.html('<img src=\''+a+'\'/>')};if(i){if($(i).closest('picture').length>0)i=$(i).closest('picture')[0];var h=$(i).before(n);$(i).remove();if(d){if(o['sync']=='true'){$(t.innerWindow.document).find('[data-wv-logo]').not($(h).closest('data-wv-logo')).each(function(e,i){var o=$(i).attr('data-wv-logo-param');if(o){o=bm.parsing.parseStrToObj(o);if(o['sync']=='true'){var s=$(i).find('img')[0];n=t.getLogoImg(a,s,o);if($(i).find('picture').length>0)s=$(i).find('picture')[0];$(s).before(n);$(s).remove()}}})}}}
else if(t.editor){t.editor.addElementAtLatestRange(n)}
else{if(t.forceInsertLocation){var r;if(Object.prototype.toString.call(n)=='[object String]'){r=$(n)[0]}
else{r=n};$(t.forceInsertLocation).append(r)}
else{t.addElementAtLatestRange(n,!1)}}}}
else{var s='<p class="bmeditor_file" style="min-width: 200px; padding: 10px; display: inline-block; border: 1px solid #dee1e2; background-color: #fafafa; cursor: pointer;" contentEditable="false"><a href="'+t.defaultTextEditorFilePath+e.path+e.name+'" target="_blank">'+e.name+'</a></p>';if(i){$(s).before(i);$(i).remove()}
else if(t.editor){t.editor.addElementAtLatestRange(s)}
else{t.addElementAtLatestRange(s)}};bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_IMAGE)};this.getPictureSet=function(t,e){var o=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),a=wvAdminIFrameBridge._WVAdminTopBar.responsiveCheckedSizeVal;t=t&&t.length&&t.length>0?t[0]:t;if(t&&t.tagName.toLowerCase()==='img'&&a.length>0){o=o.reverse();var i,n,s;s=t.src;if($(t).closest('picture').length>0){i=$(t).closest('picture').clone(!0);a.forEach(function(t){if(t==='default'){i.children('img').attr('src',e)}
else{i.children('source[media="(min-width: '+t+'px)"]').attr('srcset',e)}})}
else{i=bm.html('<picture></picture>');o.forEach(function(t){n=a.includes(t)?e:s;if(t==='default'){i.append(bm.html('<img src="'+n+'"/>'))}
else{i.append(bm.html('<source media="(min-width: '+t+'px)" srcset="'+n+'">'))}})};return i}};this.getLogoImg=function(t,e,i){var o,a={},n={};var r=60;if(i)n=i;if(n['maxHeight']&&n['maxHeight']!='')o=n['maxHeight'];else o=r;var s=this.getPictureSet(e,t);if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.STUDIO||wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.EXPERT){a={'max-height':'100%'}}
else{a={'max-height':parseInt(o)+'px'}};$(s).find('img').css(a);return s}};bm.extend(ToolBtnBase,ToolBtnTextImage);ToolBtnTextImage.prototype.addEvent=function(){var t=this};ToolBtnTextImage.prototype.removeEvent=function(){var t=this};var ToolBtnTextTable=function(){this.type='ToolBtnTextTable';var t=this;this.selectStartHandler=function(t){};if(isExpertMode===!1){this.addOption(new ToolOpTextTable())};this.onBtnClick=function(t,e){switch(e){case'apply':const value={col:this['btnList']['colNum']['value'],row:this['btnList']['rowNum']['value'],};this.onOptionChange(null,value);bm.toast('Table이 추가되었습니다.');break}};this.onOptionChange=function(e,i){if($(this.target).length>1){bm.toast('블록을 다중선택한 상태에서는 테이블을 삽입 할 수 없습니다.<br>블록을 1개만 선택해주세요.');return!1};if(bm.bmEditorManager.registedBoardEditor===!0){if($(bm.selectionManager.range.commonAncestorContainer).closest('table').length>0){bm.toast('테이블 안에 테이블을 삽입 할 수 없습니다.');return!1}}
else{if($(this.target).find('table').length>0){bm.toast('테이블 안에 테이블을 삽입 할 수 없습니다.');return!1}};if(t.editor&&(!t.editor.lastRange||(t.editor.editorEl!=t.editor.lastRange.endContainer&&$.contains(t.editor.editorEl,t.editor.lastRange.endContainer)==!1))){bm.toast('테이블 삽입을 위한 위치를 먼저 선택해주세요.');return!1};t.mode=$('#WEVEN_IFRAME').length==0?'default':'block';if(t.mode=='block'){if(!t.target||$(t.target).find('> .wveditor_text').length==0){bm.toast('테이블은 텍스트 블록에만 삽입할 수 있습니다.');return!1}};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_TABLE);var r='',l='';if(bm.bmEditorManager.registedBoardEditor===!1){l=WVAdminResourceManager.createResourceId();r='data-wv-res-id="'+l+'"'};var s=parseInt(i.col),p=parseInt(i.row),n='';n+='<div class="wveditor_table_wrap">';n+='<table class="wv_default_table wveditor_table" style="width: 100%;" summary="ZGAI Default Table">';n+='<caption>ZGAI Default Table</caption>';n+='<colgroup>';var f=Math.floor(100/s*100)/100;for(var o=0;o<s;o++){n+='<col width="'+f+'%">'};n+='</colgroup>';n+='<tbody contenteditable="false">';n+='<tr>';for(o=0;o<s;o++){n+='<td class="" '+r+' contenteditable="true"><br></td>'};n+='</tr>';for(var d=0;d<p-1;d++){n+='<tr>';for(o=0;o<s;o++){n+='<td class="" '+r+' contenteditable="true"><br></td>'};n+='</tr>'};n+='</tbody>';n+='</table>';n+='</div>';if(t.editor){t.editor.addElementAtLatestRange(n)}
else{t.addElementAtLatestRange(n)};var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){var c={fontSize:'17px',lineHeight:'23px',color:'#000',fontWeight:400,letterSpacing:0,padding:'15px 20px 13px',border:'1px solid #e9f0f3',boxSizing:'border-box'};var h=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList();a=WVAdminResourceManager.getEmbededStyleObject(null,t.target);a.applyResourceStyle($(t.target).find('[data-wv-res-id=\''+l+'\']'),c,!1,!0,!1,!0,h);if(a)a.refreshStyleElementText()}
else{$(this.target).find('table').css({width:'100%','border-collapse':'collapse'});$(this.target).find('table td').css({border:'1px solid #a2a2a2',height:'30px'})};bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_TABLE);this.hideOptionAll();bm.toast('Table이 추가되었습니다.')};this.removeTable=function(t){$(t).find('table').parent().remove();wvAdminIFrameBridge._WVContentArea.layoutKit.kitRepositioning()}};bm.extend(ToolBtnBase,ToolBtnTextTable);ToolBtnTextTable.prototype.setStyleBtn=function(){var t=this;if(!t.target){t.resetStyleBtn();return!1};const colBtn=this.btnList['colNum'];const rowBtn=this.btnList['rowNum'];const colCnt=$(this.target).find('colgroup').children()['length'];const rowCnt=$(this.target).find('tr')['length'];e(colBtn,colCnt);e(rowBtn,rowCnt);function e(t,e){if(t){t['value']=e}}};ToolBtnTextTable.prototype.addEvent=function(){var t=this};ToolBtnTextTable.prototype.removeEvent=function(){var t=this};ToolBtnTextTable.prototype.resetProperty=function(){this.removeTable(this.target)};var ToolBtnTextLinkSmall=function(){this.type='ToolBtnTextLinkSmall';this.lastRange;this.addOption(new ToolOpTextLinkSmall());this.targetParent=null;this.selectStartHandler=function(t){};this.onOptionChange=function(t,e){if(e.type==='page'){this.findPage()}
else{this.setLink(e)}};this.setLink=function(t){var a=this,s=this.optionList[0].optionBtnList,i=t.type,e=t.url,o=t.title,w=t.target;bm.selectionManager.restoreRange();var d=$(a.target),l=bm.selectionManager.getAllTextNode(),n=bm.selectionManager.getRange();if(a.targetParent!=null)d=$(a.targetParent);var c=i==='remove'?'링크 삭제할 대상이 없습니다. 다시 선택해주세요.':'링크 연결할 대상이 없습니다. 다시 선택해주세요.';if(!l&&!a.target&&!a.targetParent){alert(c);return}
else if(bm.bmEditorManager.registedBoardEditor&&l&&n&&n.collapsed&&i!=='remove'){alert(c);return}
else if(bm.bmEditorManager.registedBoardEditor&&!l){alert(c);return};var u=!0,y=$(bm.selectionManager.getSelectionContainer()).attr('href');if(!y)u=!1;if(bm.bmEditorManager.registedBoardEditor===!1){if(d.length>1||(i!=='remove'&&n&&n.collapsed)||(i==='remove'&&n.collapsed&&(u===!1)))l=null}
else{if(d.length>1||(i!=='remove'&&n.collapsed))l=null};if(!e)e=s['url'].value;if(i==='apply'&&!e){alert('링크주소를 입력해주세요.');$(s['url']).focus();return}
else if(i==='home'){e=WEB_ROOT.replace('webadm/','web/');if(WEB_ROOT.indexOf(SITE_ID+'.weven')>-1){e=WEB_ROOT.replace('webadm/','')}};if(!bm.bmEditorManager.registedBoardEditor&&wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.BOARD){if(s['url'].value.includes('http')){o=new URL(s['url'].value).hostname.replaceAll('www.','').split('.')[0]}
else{o=new URL('http://'+s['url'].value).hostname.replaceAll('www.','').split('.')[0]}}
else if(!o){o=s['title'].value};if(i==='home'&&!o){o='홈'};var v=e.split('?')[0],b=bm.valid.isValidUrl(v);if(i==='apply'&&!b&&!e.includes('[WEB_ROOT]')){alert('링크주소 형식이 잘못 되었습니다. 다시 입력해주세요.');$(s['url']).focus();return};var f=this.getSamplingElement(d),p=w;bm.toolManager.toolBtnEditBefore(this,f,HistoryType.EDITOR_TEXT_LINK);if(e.indexOf('[WEB_ROOT]')===0)e=e;else if(e.indexOf('http')===-1)e='http://'+e;if(l){if(i==='remove'){var m=$(n.commonAncestorContainer);m.closest('a').contents().unwrap();a.resetStyleBtn()}
else{var r=document.createElement('a');$(r).attr('href',e).attr('target',p).attr('title',o);var g=n.extractContents();$(r).append(g);n.insertNode(r);$(r).find('a').contents().unwrap();if($(r).parent()[0].tagName.toLowerCase()==='a'){$(r).unwrap()}}}
else{$(d).each(function(t,n){if(i==='remove'){$(n).removeAttr('onclick title tabindex').css('cursor','');a.resetStyleBtn()}
else{var s;if(p==='_self'){s='parent.location.href=\''+e+'\';'}
else{s='window.open(\''+e+'\');'};$(n).removeAttr('onclick').css('cursor','');$(n).attr('onclick',s).attr('title',o).attr('tabindex',0)}})};bm.toolManager.toolBtnEditAfter(this,f,HistoryType.EDITOR_TEXT_LINK);this.setStyleBtn();var h='';if(i==='remove')h='Link기능이 삭제되었습니다.';else h='링크가 적용되었습니다.';bm.toast(h)};this.findPage=function(){if(!this.target){alert('대상이 선택되지 않았습니다.');return};if(window.wvAdminIFrameBridge&&wvAdminIFrameBridge.previewMode){var t=WEB_ROOT+'themeTemplateManage?layout=pc_popup&mode=getLink';t+='&id='+themeInfo.info.id+'&revision='+themeInfo.info.revision}
else{var t=WEB_ROOT+'userMenuManage?layout=pc_popup&mode=getLink'};var e=bm.popupManager.addToIframe(t,null,'','',null,[0,0,0,0],!0,!0,!0,100005);$(e).attr('id','pageLinkPopup')};this.addPageLink=function(t,e){bm.popupManager.removePopLatest(!0);var i=WEB_ROOT.replace('webadm/','web/');if(WEB_ROOT.indexOf(SITE_ID+'.weven')>-1){i=WEB_ROOT.replace('webadm/','')};var n=i+'page/'+t;$(this.optionList[0].optionBtnList['url']).val(n);$(this.optionList[0].optionBtnList['title']).val(e);this.setLink('apply')}};bm.extend(ToolBtnBase,ToolBtnTextLinkSmall);ToolBtnTextLinkSmall.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1};var i,p,o,h=bm.selectionManager.getAllTextNode(),s=bm.selectionManager.getRange();if(bm.bmEditorManager.registedBoardEditor==!1&&$(this.target).find('> .wveditor_text').length==0){h=null}
else if(s&&s.collapsed&&$(s.commonAncestorContainer).parents('a').length==0){h=null};t.targetParent=null;if(h){var r=[];if(s==null)return;var d=$(s.commonAncestorContainer);d.find('a').each(function(){r.push(this)});if(d.parent()[0].tagName.toLowerCase()=='a'){r.push(d.parent()[0])};var f=!0;for(var l=0;l<r.length;l++){var a=$(r[l]),c=a.attr('href').indexOf('[WEB_ROOT]')?a.attr('href'):a.attr('href').split('//')[1];p=a.attr('target');o=a.attr('title');if(!i)i=c;else if(i&&i!=c){f=!1;break}};if(f){$(t.optionList[0].optionBtnList['url']).val(i);$(t.optionList[0].optionBtnList['title']).val(o)};if(p=='_blank')$(t.optionList[0].optionBtnList['_blank']).prop('checked',!0)}
else{o=$(t.target).attr('title');var e=$(t.target).attr('onclick'),n;i='';if(e){if(e.indexOf('return false')>-1)e=$(t.target)[0].clickAttr;n=e&&e.indexOf('[WEB_ROOT]')?'\'':'//';if(e.indexOf('window.open')!=-1){$(t.optionList[0].optionBtnList['_blank']).prop('checked',!0);if(e.split(n)[1])i=e.split(n)[1].split('\'')[0]}
else{if(e.split(n)[1])i=e.split(n)[1].split('\';')[0]};$(t.optionList[0].optionBtnList['url']).val(i);$(t.optionList[0].optionBtnList['title']).val(o)}
else{if($(t.target).closest('[onclick]').length>0){t.targetParent=$(t.target).closest('[onclick]');o=t.targetParent.attr('title');e=t.targetParent.attr('onclick');if(e.indexOf('return false')>-1)e=t.targetParent[0].clickAttr;n=e&&e.indexOf('[WEB_ROOT]')?'\'':'//';if(e){if(e.indexOf('window.open')!=-1){$(t.optionList[0].optionBtnList['_blank']).prop('checked',!0);if(e.split(n)[1])i=e.split(n)[1].split('\'')[0]}
else{if(e.split(n)[1])i=e.split(n)[1].split('\';')[0]}};$(t.optionList[0].optionBtnList['url']).val(i);$(t.optionList[0].optionBtnList['title']).val(o)}}}};ToolBtnTextLinkSmall.prototype.resetStyleBtn=function(){var t=this;t.targetParent=null;$(t.optionList[0].optionBtnList['_self']).prop('checked',!0);$(t.optionList[0].inputList).val('')};ToolBtnTextLinkSmall.prototype.addEvent=function(){var t=this};ToolBtnTextLinkSmall.prototype.removeEvent=function(){var t=this};var ToolBtnTextShadow=function(t){this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);if(isExpertMode){this.addOption(this.colorPicker,'textShadowColorExpand');this.element=$('[data-wv-toolset="ToolTextShadow"]')}
else{this.addOption(new ToolOpTextShadow(),'ToolOpTextShadow');this.addOption(this.colorPicker)};this.selectStartHandler=function(){};if(isExpertMode===!0){this.onBtnClick=function(t,e){switch(e){case'reset':this.resetBorder();break;case'lib_name':this.optionList['textShadowColorExpand'].showComponent(this.optionList['textShadowColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['textShadowColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['textShadowColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}}};this.onOptionChange=function(t,e){var o=this,r=null,n,s,i;if(t.includes('WVLocalStyle')){if(t.includes('apply')){this.optionList['textShadowColorExpand']['componentList']['WVLocalStyle'].apply(t,e,this)}
else if(t.includes('delete')){this.optionList['textShadowColorExpand']['componentList']['WVLocalStyle'].delete(t,e,this)};return!0}
else if(t==='ToolOpColorPicker'){if(typeof(e)==='object'){var h='rgb('+e.r+', '+e.g+', '+e.b+')';n=bm.number.rgbToHex(h)}
else{n=e};if(isExpertMode){s=this.element.find('input.color_input.opacity').val()}
else{s='100'};i=bm.number.hexToRgb(n);i.a=parseFloat(s)/100;if(typeof(e)==='object'){e['textShadow']='rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')';delete e['hex'];delete e['opacity']}
else{e={textShadow:'rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')'}};e={textShadow:'rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+') '+o['element'].find('input[name=textShadowLeftRight]').val()+'px '+o['element'].find('input[name=textShadowUpDown]').val()+'px '+o['element'].find('input[name=textShadowBlur]').val()+'px '}}
else if(t==='text-shadow'){e={textShadow:e}};var d=this.getSamplingElement($(o.target)),a={textShadow:bm.getStyle(d,'textShadow')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_TEXT_SHADOW,a);const classList=Array.from($(o.target)[0].classList);const localClassList=WVLocalStyle.prototype.hasLocalClass(classList,[],[])['localClassList'];const localClassNumList=WVLocalStyle.prototype.hasLocalClass(classList,[],[])['localClassNumList'];const textShadowObj=WVLocalStyle.prototype.localClassObj(localClassList,localClassNumList)['textShadowClass'];if(textShadowObj.has===!0){const obj={class:textShadowObj.numcls,css:e.textShadow};this.optionList['textShadowColorExpand']['componentList']['WVLocalStyle'].apply(t,obj,this);return!0}
else{a=e;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,$(this.target))};r.applyResourceStyle($(this.target),a,!1,!0);r.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_TEXT_SHADOW,a);if(t==='ToolOpColorPicker'){this.element.find('input[name=textShadowColor]').val(n);this.element.find('input[name=textShadowOpacity]').val(s);$('#textShadowColorPicker').val(n);$(this.colorPicker.element).find('input.color_option_prev').val(n)};var l=this.element.find('input[name=textShadowOpacity]').val();if(!l.endsWith('%')){this.element.find('input[name=textShadowOpacity]').val(l+'%')};if(e['textShadow']=='none'){this.element.find('input[name=textShadowColor]').val('000000');this.element.find('input[name=textShadowOpacity]').val('100%');$('#textShadowColorPicker').val('#000000');this.element.find('input[name=textShadowUpDown]').val(0);this.element.find('input[name=textShadowLeftRight]').val(0);this.element.find('input[name=textShadowBlur]').val(0);this.element.find('input[name=textShadowLeftRadius]').val(0)}
else{this.setStyleBtn()}}}};bm.extend(ToolBtnBase,ToolBtnTextShadow);ToolBtnTextShadow.prototype.setStyleBtn=function(){var e=this;if(!e.target||e.target.length===0){e.resetStyleBtn();return!1};var a=bm.getStyle($(e.target),'textShadow');if(a){if(a==='none'){e.resetStyleBtn();if(bm.toolManager.toolList['ToolTextShadow']){bm.toolManager.toolList['ToolTextShadow'].openControl(null,!1)}}
else{var t=a.replaceAll(', ',',').split(' ');for(let i=1;i<t.length;i++){t[i]=Number(t[i].replace('px',''));if(t[i]===undefined)t[i]=1};var n=t[0],s=t[2],r=t[1],l=t[3],d=t[4],o;if(t[0].split(',').length>3){o=Number(t[0].split(',')[3].replace(')',''))*100}
else{o=100};if(isExpertMode){this.element.find('input[name=textShadowColor]').val(bm.number.rgbToHex(n).toUpperCase().replaceAll('#',''));this.element.find('input[name=textShadowOpacity]').val(o+'%');$('#textShadowColorPicker').val(bm.number.rgbToHex(n));this.element.find('input[name=textShadowUpDown]').val(s);this.element.find('input[name=textShadowLeftRight]').val(r);this.element.find('input[name=textShadowBlur]').val(l);this.element.find('input[name=textShadowLeftRadius]').val(d)}
else{e.optionList['ToolOpTextShadow'].shadowColor.css({backgroundColor:n});e.optionList['ToolOpTextShadow'].shadowUpDown.val(s);e.optionList['ToolOpTextShadow'].shadowLeftRight.val(r);e.optionList['ToolOpTextShadow'].shadowBlurRadius.val(l)};bm.toolManager.toolList['ToolTextShadow'].openControl(null,!0)}}};ToolBtnTextShadow.prototype.resetStyleBtn=function(){var t=this;if(isExpertMode){this.element.find('input[name=textShadowColor]').val('000000');this.element.find('input[name=textShadowOpacity]').val('100%');$('#textShadowColorPicker').val('#000000');this.element.find('input[name=textShadowUpDown]').val(0);this.element.find('input[name=textShadowLeftRight]').val(0);this.element.find('input[name=textShadowBlur]').val(0);this.element.find('input[name=textShadowLeftRadius]').val(0)}
else{t.optionList['ToolOpTextShadow'].shadowColor.css({backgroundColor:'rgb(228, 235, 245)'});t.optionList['ToolOpTextShadow'].shadowOpacity.val(0);t.optionList['ToolOpTextShadow'].shadowUpDown.val(0);t.optionList['ToolOpTextShadow'].shadowLeftRight.val(0);t.optionList['ToolOpTextShadow'].shadowBlurRadius.val(0)}};ToolBtnTextShadow.prototype.addEvent=function(){var t=this;if(isExpertMode){this.onOptionHide=function(t,e){if(e.status==1){e.deactive()}};this.onOptionShow=function(t,e){var i=bm.number.hexToRgb($(this.element).find('input[name="textShadowColor"]').val());i.a=parseFloat($(this.element).find('input[name="textShadowOpacity"]').val())/100;e.setStyleValue(i.r,i.g,i.b,i.a)};$(t.element).find('input').on('keydown',function(e){var n=$(this).val();if(e.keyCode===13){if((n.indexOf('%')===-1&&!bm.valid.isOnlyNum(n)||!/^\d+(%{0,1})$/.test(n))&&$(this).attr('name')!='textShadowColor'){if($(this).attr('name')==='textShadowOpacity'){$(this).val(100+'%')}
else if($(this).attr('name')==='textShadowBlur'){bm.toast('0이상 숫자만 입력해 주세요.');$(this).val(0)}}
else if((n<0||n>100)&&$(this).attr('name')==='textShadowOpacity'){$(this).val(100+'%');bm.toast('투명도는 0 ~ 100%까지 설정가능합니다.');return!1}
else if((bm.number.isHex(n)==!1)&&$(this).attr('name')==='textShadowColor'){bm.toast('올바른 색상코드를 입력해주세요.');return!1};var i=bm.number.hexToRgb($(t['element']).find('input[name="textShadowColor"]').val());if(isExpertMode){var r=$(t['element']).find('input[name="textShadowOpacity"]').val()!==''?parseInt($(t['element']).find('input[name="textShadowOpacity"]').val())/100:100,o='rgba('+i.r+','+i.g+','+i.b+','+r+')'}
else{var o='rgba('+i.r+','+i.g+','+i.b+','+(100-parseInt($(t['element']).find('input[name="textShadowOpacity"]').val()))/100+')'};var s={textShadow:o+' '+t['element'].find('input[name=textShadowLeftRight]').val()+'px '+t['element'].find('input[name=textShadowUpDown]').val()+'px '+t['element'].find('input[name=textShadowBlur]').val()+'px '};t.onOptionChange('apply',s);if($(this).attr('name')==='textShadowColor'){var a=bm.number.rgbToHex(o);$('#textShadowColorPicker').val(a)}}});$(t.element).find('#textShadowColorPicker').on('change',function(e){var i=bm.number.hexToRgb(this['value']),n=$(t['element']).find('input[name="textShadowOpacity"]').val()!==''?parseInt($(t['element']).find('input[name="textShadowOpacity"]').val())/100:100,o='rgba('+i.r+','+i.g+','+i.b+','+n+')',a={textShadow:o+' '+t['element'].find('input[name=textShadowLeftRight]').val()+'px '+t['element'].find('input[name=textShadowUpDown]').val()+'px '+t['element'].find('input[name=textShadowBlur]').val()+'px '};t.onOptionChange('apply',a);t['btnList']['textShadowColorInput'].value=this['value'].toUpperCase().replaceAll('#','')})}
else{this.onOptionHide=function(t,e){if(e.colorPicker.status===1){e.colorPicker.deactive()}}}};ToolBtnTextShadow.prototype.removeEvent=function(){var t=this;if(isExpertMode)$(t.element).find('input').off('keydown')};ToolBtnTextShadow.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnTextShadow.prototype.resetProperty=function(){this.onOptionChange('apply',{textShadow:'none'})};var ToolBtnTextVideo=function(){this.type=' ToolBtnTextVideo';this.addOption(new ToolOpTextVideo(),'ToolOpTextVideo');this.onOptionChange=function(t,e){var i=this;this.hideOptionAll()}};bm.extend(ToolBtnBase,ToolBtnTextVideo);ToolBtnTextVideo.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1}};ToolBtnTextVideo.prototype.resetStyleBtn=function(){var t=this};ToolBtnTextVideo.prototype.addEvent=function(){var t=this};ToolBtnTextVideo.prototype.removeEvent=function(){var t=this};var ToolBtnDomSpaceSmall=function(){this.addOption(new ToolOpDomSpace(),'');this.onOptionChange=function(t,e){var i=this;$(i.target).each(function(){if(this.tagName.toLowerCase()=='table'){bm.table.setCellStyle(bm.tableSelectionManager.getRange(),'PADDING',e)}
else if($(this).hasClass('wveditor_line')){$(this).css(e)}
else{var t=this;i.checkAddOrRemoveClass('margin-top',e['marginTop'],t);i.checkAddOrRemoveClass('margin-right',e['marginRight'],t);i.checkAddOrRemoveClass('margin-bottom',e['marginBottom'],t);i.checkAddOrRemoveClass('margin-left',e['marginLeft'],t);t=$(this).find('>[data-wv-layout-element="block_inner"]');i.checkAddOrRemoveClass('padding-top',e['paddingTop'],t);i.checkAddOrRemoveClass('padding-right',e['paddingRight'],t);i.checkAddOrRemoveClass('padding-bottom',e['paddingBottom'],t);i.checkAddOrRemoveClass('padding-left',e['paddingLeft'],t)}});bm.toolManager.kitReposition()};this.checkAddOrRemoveClass=function(t,e,i){var n=bm.getResponsivePrefix(t,this.innerWindow),o=bm.getAppliedSpaceClass(i,n);if(o){$(i).removeClass(o)};if(e&&e!='0'){e=parseInt(e);$(i).addClass(n+e)}}};bm.extend(ToolBtnBase,ToolBtnDomSpaceSmall);ToolBtnDomSpaceSmall.prototype.addEvent=function(){var t=this;$(this.btnList).on('focusout',function(e){var i=$(this).val();if(i!=0&&i!='0'&&i!=''){i=$.trim(i)+t.unit;$(this).val(i)}});$(this.btnList).on('focus',function(t){var e=$(this).val();if(e!=0&&e!='0'&&e!=''&&e!='px'&&e!='%'){e=parseFloat($(this).val());if(isNaN(e))e=0};$(this).val(e);$(this).select()})};ToolBtnDomSpaceSmall.prototype.removeEvent=function(){var t=this;$(this.btnList).off('focusout');$(this.btnList).off('focus')};var ToolBtnDomSizeSmall=function(){this.addOption(ToolOpDomSize.get());var t=this;this.onOptionChange=function(e,i){var n=t.target;if(bm.toolManager.isMultiSelectMode){n=bm.toolManager.targetElementList.concat()};bm.toolManager.toolBtnEditBefore(this,n,HistoryType.EDITOR_DOM_WIDTH);$(n).css(i);bm.toolManager.toolBtnEditAfter(this,n,HistoryType.EDITOR_DOM_WIDTH);bm.toolManager.kitReposition()}};bm.extend(ToolBtnBase,ToolBtnDomSizeSmall);ToolBtnDomSizeSmall.prototype.addEvent=function(){};ToolBtnDomSizeSmall.prototype.removeEvent=function(){};var ToolBtnDomSpace=function(){this.unit='px';var t=this;this.currentTarget;this.onBtnClick=function(e,i){switch(i){case'padding-expand':t.expandControl('padding');break;case'margin-expand':t.expandControl('margin');break;case'reset':t.resetData('margin');t.resetData('padding');break}};this.expandControl=function(t){var e=$(this.btnList[t+'-expand']),o=e.hasClass('active'),i='#'+t+'All',n='#'+t+'Separate';if(t==='padding'||t==='margin'){if(o){$(i).show();$(n).hide();e.removeClass('active')}
else{$(i).hide();$(n).show();e.addClass('active')}}};this.resetData=function(e){var i={};i[e+'-top']=bm.getStyle(this.target,e+'-top',!0);i[e+'-right']=bm.getStyle(this.target,e+'-right',!0);i[e+'-bottom']=bm.getStyle(this.target,e+'-bottom',!0);i[e+'-left']=bm.getStyle(this.target,e+'-left',!0);this.beforeEdit(i);$(this.btnList[e+'-top']).val('');$(this.btnList[e+'-right']).val('');$(this.btnList[e+'-bottom']).val('');$(this.btnList[e+'-top-bottom']).val('');$(this.btnList[e+'-left-right']).val('auto');i[e+'-top']='0';i[e+'-bottom']='0';if(e==='margin'){i[e+'-right']='auto';i[e+'-left']='auto'}
else if(e==='padding'){i[e+'-right']='0';i[e+'-left']='0'};this.applyStyle(i);bm.toolManager.kitReposition();t.afterEdit(i);bm.toolManager.targetElementList=this.currentTarget};this.applyStyle=function(t){var l=this.target,d=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList(),a,s=this;$.each(t,function(t,e){$.each(d,function(e,i){a=bm.getResponsiveSpaceByResponsiveText(t,bm.getResponsiveSizeTextBySize(i));if(bm.toolManager.isMultiSelectMode){$(s.currentTarget).each(function(){bm.removeClassAtPrefix(this,a)})}
else{bm.removeClassAtPrefix(s.currentTarget,a)}})});var o=[];o.push(l);if(bm.toolManager.isMultiSelectMode){o=bm.toolManager.targetElementList.concat()};var r=o.length;for(i=0;i<r;i++){var e=o[i],n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,e)};if(bm.toolManager.isMenuTarget){n.applyResourceStyle(bm.toolManager.menuTargetSelector,t,!1,!0,!1,!1)}
else{n.applyResourceStyle(e,t,!1,!0,!1,!0,[],!1)};n.refreshStyleElementText();if($(e).closest('[data-wv-design-area]').attr('data-wv-inc')&&$(e).closest('[data-wv-design-area]').attr('data-wv-inc').indexOf('header')>-1){const headerEvent=wvAdminIFrameBridge.iframeWindow.bm.headerEvent;headerEvent.headerResizeEvent()}};this.setStyleBtn();bm.toolManager.kitReposition()};this.beforeEdit=function(t,e){if(bm.toolManager.isMultiSelectMode){this.currentTarget=bm.toolManager.targetElementList.concat()}
else{this.currentTarget=this.target};if(e&&e.indexOf('padding')>-1){bm.toolManager.toolBtnEditBefore(this,this.currentTarget,HistoryType.EDITOR_DOM_PADDING,t)}
else{bm.toolManager.toolBtnEditBefore(this,this.currentTarget,HistoryType.EDITOR_DOM_MARGIN,t)}};this.afterEdit=function(t,e){if(e&&e.indexOf('padding')>-1){bm.toolManager.toolBtnEditAfter(this,this.currentTarget,HistoryType.EDITOR_DOM_PADDING,t)}
else{bm.toolManager.toolBtnEditAfter(this,this.currentTarget,HistoryType.EDITOR_DOM_MARGIN,t)}};this.getCurrentSpaceValue=function(e){this.currentTarget=this.target;var n=this.target,a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};var i;if(a){var r='[data-wv-res-id="'+WVAdminResourceManager.getResourceId(n,!0)+'"]',o=wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal;o=o==='480'?null:[o];var s=a.getRulesBySelectorText(r,null,!1,!1,o);if(s.length>0){i=s[0].style[e];if(!i)i=bm.getStyle($(n)[0],e,!0)}
else{i=bm.getStyle($(n)[0],e,!0)}}
else{i=bm.getStyle($(n)[0],e,!0)};if(e=='marginLeft'||e=='margin-left'||e=='marginRight'||e=='margin-right'){if(bm.getStyle($(n)[0],'float')=='none')i='auto'};if(typeof(i)==='string'&&i.indexOf('calc')>-1){i=bm.string.unwrapStringInCalc(i)}
else if(typeof(i)==='string'&&i.indexOf('px')>-1){i=parseInt(i,10)};return i||0}};bm.extend(ToolBtnBase,ToolBtnDomSpace);ToolBtnDomSpace.prototype.setStyleBtn=function(){var a=this;if(!a.target||a.target.length){a.resetStyleBtn();return!1};var float=bm.getStyle(this.target,'float'),o=this.getCurrentSpaceValue('margin-top'),l=this.getCurrentSpaceValue('margin-bottom'),t=this.getCurrentSpaceValue('margin-right'),e=this.getCurrentSpaceValue('margin-left');if(float=='none'&&t!=0&&e!=0&&t==e){t='Auto';e='Auto'};$(this.btnList['margin-top-bottom']).val(o===l?o:'Mixed');$(this.btnList['margin-left-right']).val(t===e?t:'Mixed');$(this.btnList['margin-top']).val(o);$(this.btnList['margin-right']).val(t);$(this.btnList['margin-bottom']).val(l);$(this.btnList['margin-left']).val(e);var i=this.getCurrentSpaceValue('padding-top'),s=this.getCurrentSpaceValue('padding-bottom'),n=this.getCurrentSpaceValue('padding-right'),r=this.getCurrentSpaceValue('padding-left');$(this.btnList['padding-top-bottom']).val(i===s?i:'Mixed');$(this.btnList['padding-left-right']).val(n===r?n:'Mixed');$(this.btnList['padding-top']).val(i);$(this.btnList['padding-right']).val(n);$(this.btnList['padding-bottom']).val(s);$(this.btnList['padding-left']).val(r)};ToolBtnDomSpace.prototype.applyStyleCss=function(t,e){var i=$(t).val();if(e===undefined)e=!1;var o=$(t).attr('data-wv-tool-btn-prop'),n={};var a=o.split('-'),l=a.length>2;if(l){var s=a[0]+'-'+a[1],r=a[0]+'-'+a[2];n[s]=bm.getStyle(this.target,s,!0);n[r]=bm.getStyle(this.target,r,!0)}
else{n[o]=bm.getStyle(this.target,o,!0)};if(!e)this.beforeEdit(n,o);if($(this.target).attr('data-wv-layout-element-type')==='svg'&&o.includes('padding')&&parseFloat($(t).val())!=='0'){bm.toast('svg블록에는 안쪽여백을 설정할 수 없습니다.');$(t).val(0);return!1};if(($(this.target).attr('data-wv-inc')&&($(this.target).attr('data-wv-inc').indexOf('header')>0||$(this.target).attr('data-wv-inc').indexOf('footer')))&&o.includes('margin')&&parseFloat($(t).val())!=='0'){bm.toast('헤더/푸터블록에는 바깥여백을 설정할 수 없습니다.');$(t).val(0);return!1};if(bm.string.hasArithmeticOperators(i)){if(!bm.string.isValidParenthesis(i)){bm.toast('입력한 값의 괄호 짝이 올바르지 않습니다.');return!1};i=bm.string.wrapStringInCalc(bm.string.addSpaceAroundOperators(i))};if(i.indexOf('%')===-1&&i.indexOf('px')===-1)i+='px';if(l){n[s]=i;n[r]=i}
else{n[o]=i};this.applyStyle(n,i);if(!e)this.afterEdit(n,o)};ToolBtnDomSpace.prototype.addEvent=function(){var t=this;$(t.btnList).not('.padding_btn').not('.margin_btn').on('keydown',function(e){if(e.keyCode==13){t.applyStyleCss(this)}})};ToolBtnDomSpace.prototype.removeEvent=function(){$(this.btnList).off('keydown')};var ToolBtnDomWidth=function(){this.unit='px';var t=this;this.applyType='';this.currentTarget;this.addOption(new ToolOpDomWidth(),'widthType');this.onWindowResizeHandler=function(e){if(t.target){var i=t.target.offsetWidth;$(t.btnList['widthInput']).val(parseInt(i,10))}};this.onOptionChange=function(e){switch(e){case'normal':case'fixed':t.setInputWidth(e);break;case'fit':t.applyAutoWidth(e);break;case'fill':t.applyFullWidth(e);break}};this.onBtnClick=function(e,i){switch(i){case'widthUp':t.widthChange('width',t.getFormatValue(String(parseInt($(this.btnList['widthInput']).val())+1)));break;case'widthDown':t.widthChange('width',t.getFormatValue(String(parseInt($(this.btnList['widthInput']).val())-1)));break;case'reset':t.resetData();break}};this.resetData=function(){var e=t.target,i={},n={};i['width']=bm.getStyle(this.target,'width',!0);n={maxWidth:bm.getStyle(e,'maxWidth'),width:bm.getStyle(e,'width')};bm.toolManager.toolBtnEditBefore(t,e,HistoryType.EDITOR_DOM_WIDTH,n);this.onOptionChange('fit');wvAdminIFrameBridge.toolManager.toolList.ToolDomHeight.toolBtnList.ToolBtnDomHeight.onOptionChange('fit');bm.toolManager.kitReposition();bm.toolManager.toolBtnEditAfter(t,e,HistoryType.EDITOR_DOM_WIDTH,i);bm.toolManager.targetElementList=this.currentTarget};this.changeUnit=function(t){$(this.btnList[this.unit]).removeClass('active');this.unit=t;$(this.btnList[this.unit]).addClass('active')};function e(e){e=e.length?e[0]:e;var C=parseInt(bm.getStyle(e,'max-width'));if(!isNaN(C)){return-1};var f='col-',T=t.innerWindow,p=bm.getResponsiveSizeText(T);f=f+(p!=''?p+'-':p);var m=null;if(bm.bmEditorManager.registedBoardEditor===!1){m=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};var y=WVAdminResourceManager.getResourceId(e,!0),w=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList(),c=m.getRulesBySelectorText(y,null,!1,!0,w);if(c.length>0){var n,i,g,s=c.length;for(i=0;i<s;i++){g=c[i];n=g.style.width;if(n!==''&&n){return n}}};var a=['col-xl-','col-lg-','col-md-','col-sm-','col-'],v=a.indexOf(f),u=e.hasAttribute('class')?$(e).attr('class').split(' '):[],s=a.length,r=null,l,d,h,b=-1;for(var i=v;i<s;i++){if(r!==null)break;h=a[i];for(var o=0;o<u.length;o++){d=u[o];b=d.indexOf(h);l=parseInt(d.slice(h.length));if(!isNaN(l)){r=l;break}}};return r};function n(t,e,i){var n=bm.dom.getOuterPosition(t,'top');if(n>=e&&n<i){return!0}
else{return!1}};function o(){var s=t.target,d=$(s).parent(),h=bm.dom.getOuterPosition(s,'top'),c=bm.dom.getOuterPosition(s,'bottom'),a=0,i,r,l=0;d.children().each(function(){if(r===!1||r<0)return;if(this==s)return;if(n(this,h,c)){i=e(this);if(bm.type.isString(i)&&i.indexOf('px')>-1){l=parseInt(l)+parseInt(i)+'px'};if(bm.type.isString(i)&&i.indexOf('%')>-1){if(parseFloat(i)!='100')a+=parseFloat(i)}
else{if(i==-1){r=-1}
else if(i==''||i=='0'||i=='12'){r=!1}
else{a+=Math.floor(i/12*100)}}}});if(l){var o=100;if(a){o=100-(a/12*100);o=Math.floor(o*100)/100};return'calc( '+o+'% - '+l+' )'}
else{o=100-a;return o+'%'}};this.setWidthType=function(t){this.applyType=t;this.setSelectedValue(bm.string.toUpperCaseFirstChar(t),'widthType')};this.applyAutoWidth=function(e){var i=t.target;if(!t.widthChangeRestrictCheck(i))return!1;var n,o;if(bm.toolManager.isMultiSelectMode){i=bm.toolManager.targetElementList.concat()};var a={},l={};l={maxWidth:bm.getStyle(i,'maxWidth'),width:bm.getStyle(i,'width')};bm.toolManager.toolBtnEditBefore(t,i,HistoryType.EDITOR_DOM_WIDTH,l);var r=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList();if(bm.toolManager.isMultiSelectMode){$.each(i,function(t){var e=this;$.each(r,function(t,i){n=bm.getResponsiveSpaceByResponsiveText('width',bm.getResponsiveSizeTextBySize(i));o=bm.getAppliedSpaceClass(e,n);if(o){$(e).removeClass(o)};$(e).addClass(n+'0')})})}
else{$.each(r,function(t,e){n=bm.getResponsiveSpaceByResponsiveText('width',bm.getResponsiveSizeTextBySize(e));o=bm.getAppliedSpaceClass(i,n);if(o){$(i).removeClass(o)};$(i).addClass(n+'0')})};var s=null;if(bm.bmEditorManager.registedBoardEditor===!1){s=WVAdminResourceManager.getEmbededStyleObject(null,i);a={width:'fit-content',maxWidth:'100%'};s.applyResourceStyle(i,a,!1,!0,!1,!0)};bm.toolManager.toolBtnEditAfter(t,i,HistoryType.EDITOR_DOM_WIDTH,a);bm.toolManager.kitReposition();$(t.btnList['widthInput']).val('Auto');$(t.btnList['widthInput']).attr('readonly',!0);t.hideOption(t.optionList['widthType'],t.btnList['widthType']);t.setWidthType(e)};this.applyFillWidth=function(e){var n=t.target;if(!t.widthChangeRestrictCheck(n))return!1;if(bm.toolManager.isMultiSelectMode){alert('블럭을 다중선택한 상태에서는 최대화 할 수 없습니다.\n블럭을 1개만 선택해주세요.');return};var i=o(),r;if(i&&bm.type.isString(i)&&i.indexOf('calc')>-1){}
else if(i===!1){alert('같은 열에 존재하는 블럭 중 \n반응형 너비가 적용되지 않은 블럭이 있으면, \n채우기를 실행할 수 없습니다.\n\n\'반응형 너비\'란 1-12단계 너비조절 값을 의미하며,\nauto는 자동너비로써 반응형이 아닙니다.');return}
else if(i<=0){alert('같은 열에 존재하는 엘리먼트에 최대너비가 설정된 경우 \n채우기를 실행할 수 없습니다.');return};var a={maxWidth:bm.getStyle(n,'maxWidth'),width:bm.getStyle(n,'width')};bm.toolManager.toolBtnEditBefore(t,n,HistoryType.EDITOR_DOM_WIDTH,a);var s=null;if(bm.bmEditorManager.registedBoardEditor===!1){s=WVAdminResourceManager.getEmbededStyleObject(null,n)};if(i&&bm.type.isString(i)&&i.indexOf('calc')>-1){a={maxWidth:'none',width:i};s.applyResourceStyle(n,a,!1,!0,!1,!0);r=Math.floor($(n).outerWidth()/$(n).parent().outerWidth()*12)}
else{var h=i.indexOf('%')>-1?i:(Math.floor(parseFloat(i)/12*10000)/100)+'%';a={maxWidth:'none',width:h};s.applyResourceStyle(n,a,!1,!0,!1,!0);r=Math.floor(parseFloat(i)/100*12)};var l=bm.getResponsivePrefix('width',t.innerWindow),d=bm.getAppliedSpaceClass(n,l);if(d){$(n).removeClass(d)};$(n).addClass(l+r);s.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(t,n,HistoryType.EDITOR_DOM_WIDTH,a);bm.toolManager.kitReposition();$(t.btnList['widthInput']).val('Auto');t.hideOption(t.optionList['widthType'],t.btnList['widthType']);t.setWidthType(e)};this.applyFullWidth=function(e){var i=this.target,n,o,a;if(!this.widthChangeRestrictCheck(i))return!1;a={maxWidth:bm.getStyle(i,'maxWidth'),width:bm.getStyle(i,'width')};bm.toolManager.toolBtnEditBefore(t,i,HistoryType.EDITOR_DOM_WIDTH,a);if(bm.toolManager.isMultiSelectMode){i=bm.toolManager.targetElementList.concat()};a={maxWidth:'none',width:''};var r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,i)};r.applyResourceStyle(i,a,!1,!0,!1,!1);var s=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList();if(bm.toolManager.isMultiSelectMode){$.each(i,function(t){var e=this;$.each(s,function(t,i){n=bm.getResponsiveSpaceByResponsiveText('width',bm.getResponsiveSizeTextBySize(i));o=bm.getAppliedSpaceClass(e,n);if(o){$(e).removeClass(o)};$(e).addClass(n+'12')});if(t==0)targetWidth=Math.floor($(this).outerWidth()*100)/100})}
else{$.each(s,function(t,e){n=bm.getResponsiveSpaceByResponsiveText('width',bm.getResponsiveSizeTextBySize(e));o=bm.getAppliedSpaceClass(i,n);if(o){$(i).removeClass(o)};$(i).addClass(n+'12')});targetWidth=Math.floor($(i).outerWidth()*100)/100};bm.toolManager.toolBtnEditAfter(t,i,HistoryType.EDITOR_DOM_WIDTH,a);bm.toolManager.kitReposition();$(t.btnList['widthInput']).val('Auto');$(t.btnList['widthInput']).attr('readonly',!0);t.hideOption(t.optionList['widthType'],t.btnList['widthType']);t.setWidthType(e)};this.setInputWidth=function(t){$(this.btnList['widthInput']).removeAttr('readonly');$(this.btnList['widthInput']).val(parseInt(bm.getStyle(this.target,'width')));$(this.btnList['widthInput']).focus();this.setWidthType(t);this.hideOption(this.optionList['widthType'],this.btnList['widthType'])};this.widthChange=function(e,n,o){var a=this.target;if(this.widthChangeRestrictCheck(a)===!1){return!1};var s={},l={};if(e=='width'){if(parseInt(n)==0||n=='auto'){this.applyAutoWidth('fit');return}
else if(n=='100%'){bm.toast('Width설정이 Fill로 변경되었습니다.');this.applyFillWidth('fill');return}
else if(this.applyType==='fill'){bm.toast('Width설정이 Fixed로 변경되었습니다.');this.setInputWidth('fixed');$(this.btnList['widthInput']).val(n.replace('px',''))};if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){s['maxWidth']='none';l['maxWidth']=bm.getStyle(a,'maxWidth')}};if(bm.string.hasArithmeticOperators(n)){if(!bm.string.isValidParenthesis(n)){bm.toast('입력한 값의 괄호 짝이 올바르지 않습니다.');return!1};n=bm.string.wrapStringInCalc(bm.string.addSpaceAroundOperators(n))};l['width']=bm.getStyle(a,'width');l['maxWidth']=bm.getStyle(a,'maxWidth');if(t.applyType==='normal'){s['maxWidth']=n;s['width']='100%'}
else if(t.applyType==='fixed'){s['maxWidth']='none';s['width']=n}
else{s[e]=n};bm.toolManager.toolBtnEditBefore(this,a,HistoryType.EDITOR_DOM_WIDTH,l);var r=[];if(!Array.isArray(a)){r.push(a)}
else{r=a};var c=r.length;for(i=0;i<c;i++){var h=r[i],d=null;if(bm.bmEditorManager.registedBoardEditor===!1){d=WVAdminResourceManager.getEmbededStyleObject(null,h)};d.applyResourceStyle(h,s,!1,!0,!1,!0,[],!1);d.refreshStyleElementText()};bm.toolManager.toolBtnEditAfter(this,a,HistoryType.EDITOR_DOM_WIDTH,s);bm.toolManager.kitReposition();if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){this.setStyleBtn();if(this.isFixed.isFixed&&!o){bm.toolManager.toolList['ToolDomHeight'].toolBtnList['ToolBtnDomHeight'].heightChange('height',t.getFormatValue(String(this.isFixed.rate*$(this.btnList['widthInput']).val())),!0)}}};this.getFormatValue=function(e){if(e!=0&&e!='0'&&e!=''){if(e=='auto'){}
else if(typeof e=='string'&&e.indexOf('px')==-1&&e.indexOf('%')==-1){e=parseInt($.trim(e));e=e+t.unit}}
else if(e==0||e=='0'){}
else{e=''};return e};this.getWidthInfo=function(){var r=this,a;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};var s='[data-wv-res-id="'+$(this.target).attr('data-wv-res-id')+'"]',n=a.getRulesBySelectorText(s,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),i,t=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':t=0;break;case'768':t=1;break;case'992':t=2;break;case'1200':t=3;break;case'1600':t=4;break};if(n.length>=t+1){while(t>=0){if(n[t].style&&n[t].style.width){i=n[t].style.width;break};t--}};if(i===undefined){var o=e(r.target);if(o===12)i='100%';else if(o===0)i='auto'};return i};this.widthChangeRestrictCheck=function(t){if($(t).hasClass('swiper-slide')){bm.toast('내부슬라이드는 넓이를 변경할 수 없습니다.');return!1}
else{return!0}}};bm.extend(ToolBtnBase,ToolBtnDomWidth);ToolBtnDomWidth.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1};var l=wvAdminIFrameBridge._WVContentArea.designMode;if(l===EDITOR_MODE.BOARD){setTimeout(function(){if(t.isMouseDown_Up){t.widthChange('width',t.getFormatValue(String(parseInt($(t.btnList['widthInput']).val())+1)))};if(t.isMouseDown_Down){t.widthChange('width',t.getFormatValue(String(parseInt($(t.btnList['widthInput']).val())-1)))}},20)};if(l===EDITOR_MODE.EXPERT||l===EDITOR_MODE.STUDIO)t.applyType='normal';if($(t.target).length===0||!$(t.target)[0]||$(t.target)[0].isConnected===!1){return!1};var n,e;if(t.target.style.width){e=t.target.style.width;if(t.target.style.width.indexOf('px')>-1){e=parseInt(t.target.style.width,10)};n='fixed'}
else{var r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};if(r){var d='[data-wv-res-id="'+WVAdminResourceManager.getResourceId(t.target,!0)+'"]',a=wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal;a=a==='480'?null:[a];var s=r.getRulesBySelectorText(d,null,!1,!1,a);if(s.length>0){var i=s[0].style['width'],o=s[0].style['maxWidth'];if(i==='100%'&&o&&o!=='none'){e=o;if(!e)e=parseInt(Math.round($(t.target).outerWidth()),10);n='normal'}
else if((i&&i==='fit-content'&&o&&o==='100%')||i==='auto'){e='Auto';n='fit'}
else if((!i&&o&&o==='none')||i==='100%'){e='Auto';n='fill'}
else if(i&&i!=='auto'&&i!=='100%'&&o==='none'){e=i;if(!e)e=Math.round($(t.target).outerWidth());n='fixed'}
else{e=parseInt(Math.round($(t.target).outerWidth()),10);n='fixed'}}
else{e=parseInt(Math.round($(t.target).outerWidth()),10);n='fixed'}}
else{e=parseInt(Math.round($(t.target).outerWidth()),10);n='fixed'}};if(typeof(e)==='string'&&e.indexOf('calc')>-1){e=bm.string.unwrapStringInCalc(e)}
else if(typeof(e)==='string'&&e.indexOf('px')>-1){e=parseInt(e,10)};$(t.btnList['widthInput']).val(e);t.applyType=n;t.setSelectedValue(bm.string.toUpperCaseFirstChar(n),'widthType')};ToolBtnDomWidth.prototype.resetStyleBtn=function(){$(this.btnList['widthInput']).val(0)};ToolBtnDomWidth.prototype.addEvent=function(){var t=this;$(this.innerWindow).on('resize',this.onWindowResizeHandler);$(this.btnList['widthInput']).on('keydown',function(e){if(e.keyCode==13){var i=t.getFormatValue($(this).val());t.widthChange('width',i)}});if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){this.setBtnValueByOne('widthUp',this,'isMouseDown_Up',function(){t.widthChange('width',t.getFormatValue(String(parseInt($(t.btnList['widthInput']).val())+1)))});this.setBtnValueByOne('widthDown',this,'isMouseDown_Down',function(){t.widthChange('width',t.getFormatValue(String(parseInt($(t.btnList['widthInput']).val())+1)))})}};ToolBtnDomWidth.prototype.removeEvent=function(){$(window).off('resize',this.onWindowResizeHandler);$(this.btnList['widthInput']).off();if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){$(this.btnList['widthUp']).off();$(this.btnList['widthDown']).off()}};ToolBtnDomWidth.prototype.addBtn=function(t){var i=$(t).attr('data-wv-tool-btn-prop');this.btnList[i]=t;this.btnList.push(t);var e=$('[data-wv-tool-btn="ToolBtnDomWidth"][data-wv-tool-btn-prop="reset"]')[0];if(e&&!this.btnList['reset']){this.btnList['reset']=e;this.btnList.push(e)}};var ToolBtnGridMaxWidth=function(){this.type='ToolBtnGridMaxWidth';this.maxWidthValList=['1600px','1200px','full'];this.addOption(new ToolOpGridMaxWidth(),'GridMaxWidth');this.onOptionChange=function(t){this.applyBlockGridMaxWidth(t)};this.applyBlockGridMaxWidth=function(t){if(!this.maxWidthValList.includes(t))return;var d=[];d.push(this.target);if(bm.toolManager.isMultiSelectMode){d=bm.toolManager.targetElementList.concat()};var o=[],s=[],r=!1,i=' 그리드 너비를 수정할 수 없습니다.';d.forEach(function(t){if($(t).attr('data-wv-space-block')!==undefined){i='여백블록은'+i;r=!0;return!1};if($(t).attr('data-wv-inc')!==undefined){if($(t).attr('data-wv-inc').indexOf('header')===0||$(t).closest('[data-wv-inc^="header"]').length>0){i='헤더블록은'+i;r=!0;return!1}
else if($(t).attr('data-wv-inc').indexOf('footer')===0||$(t).closest('[data-wv-inc^="footer"]').length>0){i='푸터블록은'+i;r=!0;return!1}};if($(t).attr('data-wv-design-area')===undefined){var e=$(t).closest('[data-wv-design-area]')[0];if(!s.includes($(e).attr('data-wv-res-id'))){s.push($(e).attr('data-wv-res-id'));o.push(e)}}
else{if(!s.includes($(t).attr('data-wv-res-id'))){s.push($(t).attr('data-wv-res-id'));o.push(t)}}});if(r){bm.toast(i);return!1};var e=this.getSamplingElement(o),a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,e)};var n={maxWidth:bm.getStyle(e,'maxWidth'),float:bm.getStyle(e,'float'),clear:bm.getStyle(e,'clear'),overflow:bm.getStyle(e,'overflow'),marginLeft:bm.getStyle(e,'marginLeft'),marginRight:bm.getStyle(e,'marginRight')};var f=o.length;bm.toolManager.toolBtnEditBefore(this,e,HistoryType.EDITOR_DOM_WIDTH,n);if(a){if(t==='full'){n={maxWidth:'',float:'',clear:'',overflow:'',marginLeft:'',marginRight:''}}
else if(!isNaN(parseInt(t))){n={maxWidth:t,float:'none',clear:'both',overflow:'hidden',marginLeft:'auto',marginRight:'auto'}};for(var l=0;l<f;l++){var c=o[l];a.applyResourceStyle($(c),n,!1,!0,!0,!0,[],!1)};a.refreshStyleElementText()};bm.toolManager.toolBtnEditAfter(this,e,HistoryType.EDITOR_DOM_WIDTH,n);bm.toolManager.onChangeGridMaxWidth(t);bm.toolManager.kitReposition();var h=this.optionList['GridMaxWidth'].optionBtnList;$(h).removeClass('active');$(h[t]).addClass('active')}};bm.extend(ToolBtnBase,ToolBtnGridMaxWidth);ToolBtnGridMaxWidth.prototype.setStyleBtn=function(){var e=this;if(!e.target){e.resetStyleBtn();return!1};var a=!0,t='',n='';if(!bm.toolManager.isMultiSelectMode){if($(e.target).attr('data-wv-design-area')===undefined){e.target=$(e.target).closest('[data-wv-design-area]')[0]};t=bm.getStyle(e.target,'maxWidth');if(t==='none')t='full'}
else{var i;$(e.target).each(function(){i=this;if($(this).attr('data-wv-design-area')===undefined){i=$(this).closest('[data-wv-design-area]')[0]};if(n===''){n=bm.getStyle(i,'maxWidth')}
else{t=bm.getStyle(i,'maxWidth');if(t!==n){a=!1;return!1}}});if(t===''||t==='none')t='full'};var o=this.optionList['GridMaxWidth'].optionBtnList;$(o).removeClass('active');if(a){$(o[t]).addClass('active')};bm.toolManager.onChangeGridMaxWidth(t)};ToolBtnGridMaxWidth.prototype.resetStyleBtn=function(){var t=this.optionList['GridMaxWidth'].optionBtnList;$(t).removeClass('active')};ToolBtnGridMaxWidth.prototype.addEvent=function(){var t=this};ToolBtnGridMaxWidth.prototype.removeEvent=function(){var t=this};ToolBtnGridMaxWidth.prototype.showOption=function(t,e){var i=this;ToolBtnBase.prototype.showOption.call(this,t,e);i.setStyleBtn()};var ToolBtnDomHeight=function(){this.unit='px';var t=this;this.applyType='';this.addOption(new ToolOpDomHeight(),'heightType');this.onWindowResizeHandler=function(e){if(t.target){var i=t.target.offsetHeight;$(t.btnList['heightInput']).val(parseInt(i,10))}};this.forMapBlock=function(e,i,n){const heightInputValue=n?n:this.getFormatValue(this.btnList['heightInput']['value'].toLowerCase());let css;if(e==='fit')css={height:i.fitHeight+'px'};else if(e==='fill'){this.addFullHeightAttr(this.target);const view100Height=document.body.clientHeight;css={minHeight:'',height:view100Height+'px'}}
else{css={height:heightInputValue+'px'}};this.removeFullHeightAttr(this.target);this.hideOption(t.optionList['heightType'],t.btnList['heightType']);this.setInputHeight(e);this.setHeightType(e);i.applyStyle(css);i.applyMap(heightInputValue);this.setStyleBtn();if(e==='fit'){bm.toast('지도블록에 맞게 높이가 보정되었습니다.')}};this.onOptionChange=function(e){const btnMap=wvAdminIFrameBridge.toolManager.toolList.ToolMap.toolBtnList.ToolBtnMap;if(btnMap.isMapBlock(this.target)===!0){this.forMapBlock(e,btnMap)}
else{switch(e){case'normal':case'fixed':t.setInputHeight(e);break;case'fit':if(btnMap.isMapBlock(this.target)===!1)t.applyAutoHeight(e);break;case'fill':t.applyFullHeight(e);break}}};this.onBtnClick=function(e,i){switch(i){case'heightUp':t.heightChange('height',t.getFormatValue(String(parseInt($(this.btnList['heightInput']).val())+1)));break;case'heightDown':t.heightChange('height',t.getFormatValue(String(parseInt($(this.btnList['heightInput']).val())-1)));break}};this.changeUnit=function(t){$(this.btnList[this.unit]).removeClass('active');this.unit=t;$(this.btnList[this.unit]).addClass('active')};this.setHeightType=function(t){this.applyType=t;this.setSelectedValue(bm.string.toUpperCaseFirstChar(t),'heightType')};this.applyFullHeight=function(e){var i=this.target,n;n={minHeight:bm.getStyle(i,'minHeight'),height:bm.getStyle(i,'height')};bm.toolManager.toolBtnEditBefore(t,i,HistoryType.EDITOR_DOM_HEIGHT,n);if(bm.toolManager.isMultiSelectMode){i=bm.toolManager.targetElementList.concat()};const view100Height=document.body.clientHeight;n={minHeight:'',height:view100Height+'px'};var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,i)};const resId=$(i).attr('data-wv-res-id');var a='[data-wv-res-id="'+resId+'"]';o.applyResourceStyle(a,{minHeight:'',height:''},!1,!0,!1,!0,[],null,undefined);o.applyResourceStyle(a,n,!1,!0,!1,!0,[],null,'[data-wv-design-mode]');this.removeFullHeightAttr(i);this.addFullHeightAttr(i);o.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(t,i,HistoryType.EDITOR_DOM_HEIGHT,n);bm.toolManager.kitReposition();$(t.btnList['heightInput']).val('Auto');$(t.btnList['heightInput']).attr('readonly',!0);t.hideOption(t.optionList['heightType'],t.btnList['heightType']);t.setHeightType(e)};this.applyAutoHeight=function(e){var i=this.target;if(bm.toolManager.isMultiSelectMode){i=bm.toolManager.targetElementList.concat()};var o={},a={};a={minHeight:bm.getStyle(i,'minHeight'),maxHeight:bm.getStyle(i,'maxHeight'),height:bm.getStyle(i,'height')};bm.toolManager.toolBtnEditBefore(this,i,HistoryType.EDITOR_DOM_HEIGHT,a);o={minHeight:'',maxHeight:'',height:''};var n=null;if(Array.isArray(i)){i.forEach(item=>{if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,item);n.applyResourceStyle(item,o,!1,!1,!1,!0)}})}
else{if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,i);n.applyResourceStyle(i,o,!1,!1,!1,!0)}};this.removeFullHeightAttr(i);n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(t,i,HistoryType.EDITOR_DOM_HEIGHT,o);bm.toolManager.kitReposition();$(t.btnList['heightInput']).val('Auto');$(t.btnList['heightInput']).attr('readonly',!0);t.hideOption(t.optionList['heightType'],t.btnList['heightType']);t.setHeightType(e)};this.setInputHeight=function(t){$(this.btnList['heightInput']).removeAttr('readonly');$(this.btnList['heightInput']).val(parseInt(bm.getStyle(this.target,'height')));$(this.btnList['heightInput']).focus();this.setHeightType(t);this.hideOption(this.optionList['heightType'],this.btnList['heightType'])};this.heightChange=function(e,n,o){var s=this.target,a={},h={};if(bm.string.hasArithmeticOperators(n)){if(!bm.string.isValidParenthesis(n)){bm.toast('입력한 값의 괄호 짝이 올바르지 않습니다.');return!1};n=bm.string.wrapStringInCalc(bm.string.addSpaceAroundOperators(n))};h['height']=bm.getStyle(s,'height');h['minHeight']=bm.getStyle(s,'minHeight');if(t.applyType==='normal'){a['minHeight']=n;a['height']=''}
else if(t.applyType==='fixed'){a['minHeight']='';a['height']=n}
else{a[e]=n};bm.toolManager.toolBtnEditBefore(this,s,HistoryType.EDITOR_DOM_HEIGHT,h);var r=[];r.push(s);if(bm.toolManager.isMultiSelectMode){r=bm.toolManager.targetElementList.concat()};var c=r.length;for(i=0;i<c;i++){var l=r[i],d=null;if(bm.bmEditorManager.registedBoardEditor===!1){d=WVAdminResourceManager.getEmbededStyleObject(null,l)};d.applyResourceStyle(l,a,!1,!1,!1,!0,[],!1);d.refreshStyleElementText();this.removeFullHeightAttr(l)};bm.toolManager.toolBtnEditAfter(this,s,HistoryType.EDITOR_DOM_HEIGHT,a);bm.toolManager.kitReposition();if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){this.setStyleBtn();if(this.isFixed.isFixed&&!o){bm.toolManager.toolList['ToolDomWidth'].toolBtnList['ToolBtnDomWidth'].widthChange('width',t.getFormatValue(String(this.isFixed.rate*$(this.btnList['heightInput']).val())),!0)}}};this.getFormatValue=function(e){if(e!=0&&e!='0'&&e!=''){if(e=='auto'){}
else if(typeof e=='string'&&e.indexOf('px')==-1&&e.indexOf('%')==-1){e=parseInt($.trim(e));e=e+t.unit}}
else if(e==0||e=='0'){}
else{e=''};return e};this.getHeightInfo=function(){var n;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};var o='[data-wv-res-id="'+$(this.target).attr('data-wv-res-id')+'"]',e=n.getRulesBySelectorText(o,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),i,t=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':t=0;break;case'768':t=1;break;case'992':t=2;break;case'1200':t=3;break;case'1600':t=4;break};for(let t=0;t>=0;t--){if(e[t].style.height){i=e[t].style.height;break}};return i};this.removeFullHeightAttr=function(t){$(t).removeAttr('data-wv-full-height480');$(t).removeAttr('data-wv-full-height768');$(t).removeAttr('data-wv-full-height992');$(t).removeAttr('data-wv-full-height1200');$(t).removeAttr('data-wv-full-height1600')};this.addFullHeightAttr=function(t,e){e=e?e:wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList();e.forEach(function(e){if(e==='default')e='480';$(t).attr('data-wv-full-height'+e,'')})}};bm.extend(ToolBtnBase,ToolBtnDomHeight);ToolBtnDomHeight.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length===0){t.resetStyleBtn();return!1};var l=wvAdminIFrameBridge._WVContentArea.designMode;if(l==EDITOR_MODE.BOARD){setTimeout(function(){if(t.isMouseDown_Up){t.heightChange('height',t.getFormatValue(String(parseInt($(t.btnList['heightInput']).val())+1)))};if(t.isMouseDown_Down){t.heightChange('height',t.getFormatValue(String(parseInt($(t.btnList['heightInput']).val())-1)))}},20)};if(l===EDITOR_MODE.EXPERT||l===EDITOR_MODE.STUDIO)t.applyType='normal';var n,e;if($(t.target)[0].style.height){e=$(t.target)[0].style.height;if($(t.target)[0].style.height.indexOf('px')>-1){e=parseInt(t.target.style.width,10)};n='fixed'}
else{var r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};var h;if(r){var d='[data-wv-res-id="'+WVAdminResourceManager.getResourceId(t.target,!0)+'"]',s=wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal;s=s==='480'?null:[s];var a=r.getRulesBySelectorText(d,null,!1,!1,s);if(a.length>0){var o=a[a.length-1].style['height'],i=a[a.length-1].style['minHeight'];const view100Height=document.body.clientHeight;if((!o||o==='auto')&&(i&&(i!=='none'||i!==0))){if(i==='auto'){e='Auto';n='normal'}
else{e=i;if(!e)e=parseInt(Math.round($(t.target).outerHeight()),10);n='fixed'}}
else if((!o||o==='auto')&&(!i||i==='none'||i===0)){e='Auto';n='fit'}
else if(o&&parseInt(view100Height)===parseFloat(o)){e='Auto';n='fill'}
else if(o&&o!=='auto'&&parseInt(view100Height)!==parseFloat(o)&&(!i||i==='none'||i===0)){e=o;if(!e)e=Math.round($(t.target).outerHeight());n='fixed'}
else{e=parseInt(Math.round($(t.target).outerHeight()),10);n='fixed'}}
else{e=parseInt(Math.round($(t.target).outerHeight()),10);n='fixed'}}
else{e=parseInt(Math.round($(t.target).outerHeight()),10);n='fixed'}};if(typeof(e)==='string'&&e.indexOf('calc')>-1){e=bm.string.unwrapStringInCalc(e)}
else if(typeof(e)==='string'&&e.indexOf('px')>-1){e=parseInt(e,10)};$(t.btnList['heightInput']).val(e);t.applyType=n;t.setSelectedValue(bm.string.toUpperCaseFirstChar(n),'heightType')};ToolBtnDomHeight.prototype.resetStyleBtn=function(){$(this.btnList['heightInput']).val(0)};ToolBtnDomHeight.prototype.addEvent=function(){var t=this;$(this.innerWindow).on('resize',this.onWindowResizeHandler);$(this.btnList['heightInput']).on('keydown',function(e){if(e.keyCode==13){var i=t.getFormatValue($(this).val());const btnMap=wvAdminIFrameBridge.toolManager.toolList.ToolMap.toolBtnList.ToolBtnMap;if(btnMap.isMapBlock(t.target)===!0){t.forMapBlock(t.btnList.heightType.outerText.toLowerCase(),btnMap,parseFloat(i));t.heightChange('height',i)}
else{t.heightChange('height',i)}}});if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){var e=0;$(this.btnList['heightUp']).on('mousedown',function(){e=setTimeout(function(){t.isMouseDown_Up=!0;t.heightChange('height',t.getFormatValue(String(parseInt($(t.btnList['heightInput']).val())+1)))},300)}).on('mouseup mouseleave',function(){clearTimeout(e)});$(this.btnList['heightUp']).on('mouseup mouseout mouseleave',function(e){t.isMouseDown_Up=!1});$(this.btnList['heightDown']).on('mousedown',function(){e=setTimeout(function(){t.isMouseDown_Down=!0;t.heightChange('height',t.getFormatValue(String(parseInt($(t.btnList['heightInput']).val())-1)))},300)}).on('mouseup mouseleave',function(){clearTimeout(e)});$(this.btnList['heightDown']).on('mouseup mouseout mouseleave',function(e){t.isMouseDown_Down=!1})}};ToolBtnDomHeight.prototype.removeEvent=function(){$(window).off('resize',this.onWindowResizeHandler);$(this.btnList['heightInput']).off();if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){$(this.btnList['heightUp']).off();$(this.btnList['heightDown']).off()}};var ToolBtnDomAlignVerticalDefault=function(){this.onBtnClick=function(t,e){this.applyStyle(e)};this.applyStyle=function(t){var o=this,a=[];a.push(this.target);var i=!1;this.isActive=$(this.btnList[t]).hasClass('active');if(this.btnType)$(this.btnList[this.btnType]).removeClass('active');if(this.isActive){this.css={'align-self':''};this.parentCss={display:'block',alignItems:'','flex-wrap':''}}
else{this.css={'align-self':'auto'};this.parentCss={display:'flex',alignItems:t,'flex-wrap':'wrap'}};var l=this.getSamplingElement(a);bm.toolManager.toolBtnEditBefore(this,l,HistoryType.EDITOR_DOM_ALIGN_VERTICAL,this.css);var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,l)};var e=null,r=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList();if(a[0].length){var s=!1;a[0].forEach(function(t){e=$($(t).parents('[data-wv-layout-element="block"]')[0]);i=e.is('[data-wv-grid-block]');if(!i&&!s){if(!confirm('선택된 블록의 세로 정렬을 활성화합니다.\n해당 기능을 적용하시면 내부 요소의 이동에 제한이 있습니다.\n적용하시겠습니까 ?\n\n해당 기능은 언제든 다시 클릭하여 해제하실 수 있습니다.\n'))return!1;else s=!0};if(o.isActive){i=!1;var a=n.getRulesBySelectorText(e.attr('data-wv-res-id'),null,!1,!0,r);a.forEach(function(t){if(t.style.display==='grid'){i=!0;return!1}});o.isActive=!1;if(!i){$(e).removeAttr('data-wv-grid-block')};bm.toast('세로 정렬이 해제되었습니다.')}
else{o.isActive=!0;$(e).attr('data-wv-grid-block','');bm.toast('세로 정렬이 설정되었습니다.')};n.applyResourceStyle(e,o.parentCss,!0,!0);n.applyResourceStyle(t,o.css,!1,!0)})}
else{e=$($(a[0]).parents('[data-wv-layout-element="block"]')[0]);i=e.css('display')==='flex'?!0:!1;if(!i){if(!confirm('선택된 블록의 세로 정렬을 활성화합니다.\n해당 기능을 적용하시면 내부 요소의 이동에 제한이 있습니다.\n적용하시겠습니까 ?\n\n해당 기능은 언제든 다시 클릭하여 해제하실 수 있습니다.\n'))return!1};if(o.isActive){i=!1;var d=n.getRulesBySelectorText(e.attr('data-wv-res-id'),null,!1,!0,r);d.forEach(function(t){if(t.style.display==='grid'){i=!0;return!1}});o.isActive=!1;if(!i)$(e).removeAttr('data-wv-grid-block');bm.toast('세로 정렬이 해제되었습니다.')}
else{$(e).attr('data-wv-grid-block','');o.isActive=!0;bm.toast('세로 정렬이 설정되었습니다.')};n.applyResourceStyle(e,this.parentCss,!0,!0);n.applyResourceStyle(a[0],this.css,!1,!0)};n.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_DOM_ALIGN_VERTICAL,this.css);this.setStyleBtn();bm.toolManager.kitReposition()}};bm.extend(ToolBtnBase,ToolBtnDomAlignVerticalDefault);ToolBtnDomAlignVerticalDefault.prototype.setStyleBtn=function(){if(!this.target||this.target.length){this.resetStyleBtn();return!1};if($(this.target).parents('[data-wv-layout-element="block"]').length===0)return!1;var e=$(this.target).parents('[data-wv-layout-element="block"]')[0],a=[];a.push(this.target);var s=this.getSamplingElement(a),t=null;if(bm.bmEditorManager.registedBoardEditor===!1){t=WVAdminResourceManager.getEmbededStyleObject(null,s)};var o=bm.getStyle(e,'display'),i=bm.getStyle(e,'align-items'),n=bm.getStyle(this.target,'align-self');if(n!=='auto'){t.applyResourceStyle(this.target,{'align-self':'auto'},!1,!0);$(this.target).siblings().each(function(){t.applyResourceStyle($(this)[0],{'align-self':'auto'},!1,!0)});t.applyResourceStyle(e,{'display':'flex','align-items':n},!0,!0);o='flex';i=n;if($(e).children('[data-wv-layout-element=\'block_inner\']').length>0){t.applyResourceStyle($(e).children('[data-wv-layout-element=\'block_inner\']'),{'display':'flex','align-items':n},!0,!0)}};if(o==='flex'&&(i&&i!=='')){this.btnType=i}
else{return!1};$(this.btnList[this.btnType]).addClass('active')};ToolBtnDomAlignVerticalDefault.prototype.resetStyleBtn=function(){var t=this;$(t.btnList).removeClass('active')};ToolBtnDomAlignVerticalDefault.prototype.addEvent=function(){var t=this};ToolBtnDomAlignVerticalDefault.prototype.removeEvent=function(){var t=this};var ToolBtnDomAlignHorizontalDefault=function(){this.type='';this.addOption(new ToolOpDomAlignHorizontalDefault(),'mainBtn');this.onOptionChange=function(t){this.applyStyle(t)};this.onBtnClick=function(t,e){this.applyStyle(e)};this.applyStyle=function(t){var r=this;this.resetStyleBtn();var i=[];i.push(this.target);if(wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN){if(i[0].length){i[0].forEach(function(t){if($(t).closest('[data-wv-design-area]').find('[data-wv-layout-element="block"]')[0]!==t){i[0].push($(t).closest('[data-wv-design-area]').find('[data-wv-layout-element="block"]')[0])}})}
else{var s=$(i[0]).closest('[data-wv-design-area]').find('> [data-wv-layout-element="block_inner"] > [data-wv-layout-element="block"]');if(s.length===1&&s[0]!==i[0]){i[0]=s[0]}}};var e,n='';if(t==='left'){e={float:t,clear:'none',overflow:'',marginLeft:'0',marginRight:'auto',left:'0'};n='left'}
else if(t==='right'){e={float:t,clear:'none',overflow:'',marginLeft:'auto',marginRight:'0',left:'0'};n='right'}
else{e={float:'none',clear:'both',overflow:'hidden',marginLeft:'auto',marginRight:'auto',left:'0'};n='center'};var a=this.getSamplingElement(i);bm.toolManager.toolBtnEditBefore(this,a,HistoryType.EDITOR_DOM_ALIGN_HORIZONTAL,e);var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,a)};if(i[0].length){i[0].forEach(function(t){if(r.isAutoWidth(t)){if(n==='center'){e.width='fit-content'}}
else{if(n!=='center'){delete e.width}};if(bm.toolManager.isMenuTarget){o.applyResourceStyle(bm.toolManager.menuTargetSelector,e,!1,!0,!1,!1)}
else{o.applyResourceStyle(t,e,!1,!0)}})}
else{if(r.isAutoWidth(i[0])){if(n==='center'){e.width='fit-content'}}
else{if(n!=='center'){delete e.width}};if(bm.toolManager.isMenuTarget){o.applyResourceStyle(bm.toolManager.menuTargetSelector,e,!1,!0,!1,!1)}
else{o.applyResourceStyle(i[0],e,!1,!0)}};o.refreshStyleElementText();this.setStyleBtn();bm.toolManager.toolBtnEditAfter(this,a,HistoryType.EDITOR_DOM_ALIGN_HORIZONTAL,e);$(this.btnList[t]).addClass('active');this.type=t;bm.toolManager.kitReposition();ToolBtnDomCondition.prototype.setStyleBtn()};this.isAutoWidth=function(t){var i=!1,o=WVAdminResourceManager.getEmbededStyleObject(null,t),a='[data-wv-res-id="'+$(t).attr('data-wv-res-id')+'"]',n=o.getRulesBySelectorText(a,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),e=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':e=0;break;case'768':e=1;break;case'992':e=2;break;case'1200':e=3;break;case'1600':e=4;break}
while(e>0){if(n[e].style.width==='auto'||n[e].style.width==='fit-content'){i=!0;break};if(n[e].style.width===''&&($(t).hasClass('col-0')||t.hasAttribute('data-wv-menu-depth'))){i=!0;break};e--};return i};this.isFullWidth=function(t){var i=!1,o=WVAdminResourceManager.getEmbededStyleObject(null,t),a='[data-wv-res-id="'+$(t).attr('data-wv-res-id')+'"]',n=o.getRulesBySelectorText(a,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),e=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':e=0;break;case'768':e=1;break;case'992':e=2;break;case'1200':e=3;break;case'1600':e=4;break}
while(e>0){if(n[e].style.width==='100%'){i=!0;break};if(n[e].style.width===''&&$(t).hasClass('col-12')){i=!0;break};e--};return i}};bm.extend(ToolBtnBase,ToolBtnDomAlignHorizontalDefault);ToolBtnDomAlignHorizontalDefault.prototype.setStyleBtn=function(){if(!this.target||this.target.length){this.resetStyleBtn();return!1};if(wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN){var o=$(this.target).closest('[data-wv-design-area]').find('> [data-wv-layout-element="block_inner"] > [data-wv-layout-element="block"]');if(o.length===1&&o[0]!==this.target){this.target=o[0]}};var float=bm.getStyle(this.target,'float'),a=bm.getStyle(this.target,'clear'),r=bm.getStyle(this.target,'overflow'),i=parseInt(bm.getStyle(this.target,'marginLeft')),n=parseInt(bm.getStyle(this.target,'marginRight')),e;if(wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN){var s=$(this.btnList['mainBtn']);e=$(s).find('[data-wv-tool-option-btn="'+float+'"]')}
else{e=$(this.btnList[float])};if((float=='left'||float=='right')&&(!a||a=='none')&&!parseInt(i)&&!parseInt(n)){$(e).addClass('active')}
else if((float=='none'&&i=='auto'&&n=='auto')||(float=='none'&&(i==n))){$(e).addClass('active')}};ToolBtnDomAlignHorizontalDefault.prototype.resetStyleBtn=function(){var i=this,t;if(wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.DESIGN){var e=$(this.btnList['mainBtn']);t=$(e).find('[data-wv-tool-option-btn]')}
else{t=$(this.btnList)};$(t).removeClass('active')};ToolBtnDomAlignHorizontalDefault.prototype.addEvent=function(){var t=this};ToolBtnDomAlignHorizontalDefault.prototype.removeEvent=function(){var t=this};ToolBtnDomAlignHorizontalDefault.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e)};var ToolBtnDomBackgroundBorder=function(t){var i=this;this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);this.unit=null;var e;if(isExpertMode){e=$('[data-wv-toolset=ToolDomBackgroundBorder]');this.radiusInput=$(e).find('[data-wv-tool-btn-prop=borderRadiusInput]')[0];this.widthInput=$(e).find('[data-wv-tool-btn-prop=borderWidthInput]')[0];this.styleSelect=app.getWvCom('borderStyleSelect');this.addOption(new ToolOpDomBackgroundBorderWidth(),'borderWidthExpand');this.addOption(new ToolOpDomBackgroundBorderRadius(),'borderRadiusExpand');this.addOption(this.colorPicker,'borderColorExpand');this.onBtnClick=function(t,e){switch(e){case'reset':this.resetBorder();break;case'lib_name':this.optionList['borderColorExpand'].showComponent(this.optionList['borderColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['borderColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['borderColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}}}
else{e=$('[data-wv-toolset=ToolDomBackground]');this.radiusInput=$(e).find('[data-wv-tool-option-value=borderRadiusInput]')[0];this.widthInput=$(e).find('[data-wv-tool-option-value=borderWidthInput]')[0];this.colorPrev=$(e).find('[data-wv-tool-option-btn=color] .choice_color')[0];this.addOption(new ToolOpDomBackgroundBorder(),'border');this.addOption(this.colorPicker,'color')};this.onOptionChange=function(t,i,n){if(t&&t.includes('WVLocalStyle')===!0){if(t.includes('apply')){this.optionList['borderColorExpand']['componentList']['WVLocalStyle'].apply(t,i,this)}
else if(t.includes('delete')){this.optionList['borderColorExpand']['componentList']['WVLocalStyle'].delete(t,i,this)};return!0};var o=[];o.push(this.target);if(bm.toolManager.isMultiSelectMode&&Array.isArray(bm.toolManager.targetElementList)===!0){o=bm.toolManager.targetElementList.concat()};if(typeof(i)==='string'){if(bm.number.isHex(bm.number.rgbToHex(i))===!0){i={'border-color':i}}}
else if(i['border-color']&&bm.number.isHex(i['border-color'])===!0){i['border-color']='#'+i['border-color'].replaceAll('#','')};var g=!1;if($(o).closest('[data-wv-tab]').length>0){g=!0;var h=[];$(o).each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(h.indexOf(t)===-1)h.push(t)})};var c=this.getSamplingElement(o),r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,c)};var T=this.getCurrentBorderStyle(),C=o.length;if(bm.toolManager.toolBtnEditBefore(this,c,HistoryType.EDITOR_DOM_BORDER,T))return;var l,d,a;if(t==='ToolOpColorPicker'){if(typeof(i)==='object'){var w='rgb('+i.r+', '+i.g+', '+i.b+')';l=bm.number.rgbToHex(w)}
else{l=i};if(isExpertMode){d=$(e).find('input.color_input.opacity').val()}
else{d='100'};a=bm.number.hexToRgb(l);if(d){a.a=parseFloat(d)/100};if(typeof(i)==='object'){i['border-color']='rgba('+a.r+', '+a.g+', '+a.b+', '+a.a+')';delete i['hex'];delete i['opacity']}
else{i={'border-color':'rgba('+a.r+', '+a.g+', '+a.b+', '+a.a+')'}}};if(t!='radius'){if(n>-1){var y='border_point'+n;$(o).addClass(y)}
else{$(o).removeClass('border_point0');$(o).removeClass('border_point1');$(o).removeClass('border_point2')}};if(t!=='delete')i['border-style']=this.borderStyle;i['background-clip']='padding-box';if(g&&r){for(var s=0;s<h.length;s++){var u='[data-wv-res-id="'+h[s]+'"] [data-wv-tab-list] [data-wv-tab].active';if(bm.toolManager.isTabActiveStyle){r.applyResourceStyle(u,i,!1,!0,!0,!0,[],!1)}
else{var b='[data-wv-res-id="'+h[s]+'"] [data-wv-tab-list] [data-wv-tab]';r.applyResourceStyle(b,i,!1,!0,!0,!0,[],!1);var v=$('[data-wv-tool-option=ToolOpDomBackgroundBorder]').find('.option_input_style_0').val()+'px solid transparent',p={};for(var f in i){if(i[f]!=='none')p[f]=v};r.applyResourceStyle(u,p,!1,!0,!0,!0,[],!1)}}}
else{for(var s=0;s<C;s++){var m=o[s];r.applyResourceStyle($(m),i,!1,!0,!0,!0,[],!1)}};if(r)r.refreshStyleElementText();if(t==='ToolOpColorPicker'){$(this.btnList['borderColorInput']).val(l);$('#borderColorPicker').val('#'+l.replaceAll('#',''));$(this.btnList['borderOpacityInput']).val(d);$(this.colorPicker.element).find('input.color_option_prev').val(l)};bm.toolManager.toolBtnEditAfter(this,c,HistoryType.EDITOR_DOM_BORDER,i);bm.toolManager.kitReposition();this.setStyleBtn()};this.getCurrentBorderStyle=function(t){var o=[];o.push(this.target);if(bm.toolManager.isMultiSelectMode&&Array.isArray(bm.toolManager.targetElementList)===!0){o=bm.toolManager.targetElementList.concat()};var e=this.getSamplingElement(o),t=t?'-'+t:'';if(t=='-radius'){var n={};n['border-top-left'+t]=bm.getStyle(e,'border-top-left'+t);n['border-top-right'+t]=bm.getStyle(e,'border-top-right'+t);n['border-bottom-left'+t]=bm.getStyle(e,'border-bottom-left'+t);n['border-bottom-right'+t]=bm.getStyle(e,'border-bottom-right'+t);return n}
else{var i={};i['border-left'+t]=bm.getStyle(e,'border-left'+t);i['border-top'+t]=bm.getStyle(e,'border-top'+t);i['border-right'+t]=bm.getStyle(e,'border-right'+t);i['border-bottom'+t]=bm.getStyle(e,'border-bottom'+t);return i}};this.resetBorder=function(){this.onOptionChange('delete',{border:'none',borderColor:'unset',borderRadius:0})}};bm.extend(ToolBtnBase,ToolBtnDomBackgroundBorder);ToolBtnDomBackgroundBorder.prototype.setStyleBtn=function(){var f=this;if(!this.target||this.target.length){this.resetStyleBtn();return!1};var n,a,o=this.getCurrentBorderStyle('radius'),d=this.getCurrentBorderStyle('width'),s=Object.keys(d).map(function(t){return Math.round(parseFloat(d[t]))});if(isExpertMode){var g=s.filter(function(t,e){return s.indexOf(t)===e}).length===1;$(this.widthInput).val(g?s[0]:'Mixed');if(g){$(this.optionList['borderWidthExpand'].element).find('[data-wv-tool-option-value]').val(s[0])}
else{Object.keys(d).forEach(function(t){$(f.optionList['borderWidthExpand'].element).find('[data-wv-tool-option-value='+t+']').val(Math.round(parseFloat(d[t])))})};var l=Object.keys(o).map(function(t){return Math.round(parseFloat(o[t]))}),u=l.filter(function(t,e){return l.indexOf(t)===e}).length===1;$(this.radiusInput).val(u?l[0]:'Mixed');if(u){$(this.optionList['borderRadiusExpand'].element).find('[data-wv-tool-option-value]').val(l[0])}
else{Object.keys(o).forEach(function(t){$(f.optionList['borderRadiusExpand'].element).find('[data-wv-tool-option-value='+t+']').val(Math.round(parseFloat(o[t])))})};a=bm.number.rgbToHex($(this.target).css('borderColor'));$(this.btnList['borderColorInput']).val(a.toUpperCase().replaceAll('#',''));$('#borderColorPicker').val(a);$(this.btnList['borderOpacityInput']).val(bm.number.rgbaToObj($(this.target).css('borderColor')).a*100+'%');n=$(this.target).css('borderStyle');if(n==='none')this.borderStyle='solid';else this.borderStyle=n;this.styleSelect.val(this.borderStyle);this.styleSelect.optionList.forEach(function(t){f.styleSelect.dom.find('.selected_item').removeClass(t.value)});this.styleSelect.dom.find('.selected_item').addClass(this.borderStyle);if(parseInt($(this.widthInput)[0]['value'])>0||parseInt($(this.radiusInput)[0]['value'])>0||$(this.btnList['borderColorInput'])[0]['value']!=='000000'||parseInt($(this.btnList['borderOpacityInput'])[0]['value'])!==100||this.borderStyle!=='solid'){bm.toolManager.toolList[this.toolSetType].openControl(null,!0)}
else{bm.toolManager.toolList[this.toolSetType].openControl(null,!1)}}
else{var t=this.optionList['border'].element,e=this.optionList['border'].borderColor;a=this.getCurrentBorderStyle('color');n=this.getCurrentBorderStyle('style');$(t).find('[data-wv-tool-option-value]').removeClass('active');$(t).find('[data-wv-tool-option-btn]').removeClass('active');for(var i in n){var b=i.replace('border-','').replace('-style',''),p=n[i],y=a[i.replace('-style','-color')];if(p!='none'){e=y;$(t).find('[data-wv-tool-option-value="'+b+'"]').addClass('active');$(t).find('[data-wv-tool-option-btn="'+p+'"]').addClass('active')}};for(var i in o){var m=i.replace('border-','').replace('-radius',''),v=o[i];if(v!='0px'){$(t).find('[data-wv-tool-option-value="'+m+'"]').addClass('active')}};if(!$(t).find('.border_control_btn').hasClass('active')){e='#e4ebf5';$(t).find('[data-wv-tool-option-btn="solid"]').addClass('active')};this.optionList['border'].borderColor=e;$(this.colorPrev).css({backgroundColor:e});if(e.indexOf('rgb')>-1)e=bm.number.rgbToHex(e);var c=$(this.target).css('borderRadius');if(c.indexOf('px')>-1){$(t).find('[data-wv-tool-option-value="px"]').addClass('active')}
else if(c.indexOf('%')>-1){$(t).find('[data-wv-tool-option-value="%"]').addClass('active')};var r=parseInt(c);r=isNaN(r)?0:r;$(this.radiusInput).val(r);var h=Math.max.apply(null,s);if(h<1)h=1;$(this.widthInput).val(h)}};ToolBtnDomBackgroundBorder.prototype.resetStyleBtn=function(){var i=this,t;if(!isExpertMode){var e=this.optionList['border'].element;t='#e4ebf5';this.optionList['border'].borderColor=t;$(e).find('[data-wv-tool-option-value]').removeClass('active');$(e).find('[data-wv-tool-option-btn]').removeClass('active');$(e).find('[data-wv-tool-option-btn="solid"]').addClass('active');$(this.colorPrev).css({backgroundColor:t});$(this.radiusInput).val(0);$(this.widthInput).val(1)}
else{t='#ffffff';$(this.optionList['borderWidthExpand'].element).find('[data-wv-tool-option-value]').val(0);$(this.widthInput).val(0);$(this.optionList['borderRadiusExpand'].element).find('[data-wv-tool-option-value]').val(0);$(this.radiusInput).val(0);$(this.btnList['borderColorInput']).val(t);$('#borderColorPicker').val(t);$(this.btnList['borderOpacityInput']).val('0%');this.borderStyle='solid';this.styleSelect.val(this.borderStyle);this.styleSelect.optionList.forEach(function(t){i.styleSelect.dom.find('.selected_item').removeClass(t.value)});this.styleSelect.dom.find('.selected_item').addClass(this.borderStyle)}};ToolBtnDomBackgroundBorder.prototype.showOption=function(t,e){for(var i=0;i<this.optionList.length;i++){ToolBtnBase.prototype.hideOption.call(this,this.optionList[i],e)};ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpDomBackgroundBorderWidth'||t.type==='ToolOpDomBackgroundBorderRadius'||t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnDomBackgroundBorder.prototype.addEvent=function(){var t=this;this.onOptionHide=function(t,e){var i;if(e.type==='ToolOpDomBackgroundBorder'){i=e.colorPicker}
else if(e.type==='ToolOpColorPicker'){i=e};if(i&&i.status==1){i.deactive()}};this.onOptionShow=function(t,e){var i;if(isExpertMode){i=bm.number.hexToRgb($(this.btnList['borderColorInput']).val());i.a=parseFloat($(this.btnList['borderOpacityInput']).val())/100}
else{i=$(e.element).find('[data-wv-tool-option-btn=color] .choice_color')[0].style['backgroundColor'];i=bm.number.rgbaToObj(i)};var o='';if($(this.target).hasClass('border_point0')){o='border_point0'}
else if($(this.target).hasClass('border_point1')){o='border_point1'}
else if($(this.target).hasClass('border_point2')){o='border_point2'};var n;if(o!=''){n=o.replace('border_point','');n=parseInt(n)}
else{n=-1};if(e.type==='ToolOpDomBackgroundBorder')e.colorPicker.setStyleValue(i.r,i.g,i.b,i.a,n);else if(e.type==='ToolOpColorPicker')e.setStyleValue(i.r,i.g,i.b,i.a,n)};if(isExpertMode){$(this.widthInput).on('keydown',function(e){if(e.keyCode==13){t.onOptionChange('width',{'border-width':this.value+'px'})}});$(this.widthInput).on('keyup',function(){var t=$(this).val();if(!bm.valid.isOnlyNum(t)){$(this).val(1);bm.toast('숫자를 입력해주세요.');return!1}});$(this.radiusInput).on('keydown',function(e){if(e.keyCode==13){var i=this.value;if(i.indexOf('%')===-1)i+='px';t.onOptionChange('radius',{'border-radius':i})}});$(this.radiusInput).on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)||!/^\d+(%{0,1})$/.test(t)){$(this).val(1);bm.toast('숫자를 입력해주세요.');return!1}});$(this.btnList['borderColorInput']).on('keydown',function(e){if(e.keyCode==13){var i=this.value;if(bm.number.isHex(i)==!1){bm.toast('올바른 색상코드를 입력해주세요.');return!1};t.onOptionChange('color',{'border-color':i})}});$('#borderColorPicker').on('change',function(e){$(t.btnList['borderColorInput']).val(this.value);var i=bm.number.hexToRgb(this.value);opacity=$(t.btnList['borderOpacityInput']).val();if(isExpertMode){i.a=parseFloat(opacity)/100}
else{i.a=(100-parseFloat(opacity))/100};t.onOptionChange('color',{'border-color':bm['number'].rgbaObjToStr(i)})});$(this.btnList['borderOpacityInput']).on('keydown',function(e){if(e.keyCode==13){var n=parseInt(this.value);if(n<0||n>100){bm.toast('테두리 색상 투명도는 0부터 100 사이 값만 적용할 수 있습니다.');return!1};var i=bm.number.hexToRgb($(t.btnList['borderColorInput']).val());if(isExpertMode){i.a=parseFloat(n)/100}
else{i.a=(100-parseFloat(n))/100};var o='rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')';t.onOptionChange('color',{'border-color':o})}});$(this.btnList['borderOpacityInput']).on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)||!/^\d+(%{0,1})$/.test(t)){$(this).val(0);bm.toast('숫자를 입력해주세요.');return!1}});$('#borderStyleBtn').on('click',function(e){e.stopImmediatePropagation();if(t.styleSelect.isActive){t.styleSelect.close()}
else{t.styleSelect.open()}});this.styleSelect.onChangeComplete=function(){var e=this.val();this.optionList.forEach(function(e){t.styleSelect.dom.find('.selected_item').removeClass(e.value)});this.dom.find('.selected_item').addClass(e);t.borderStyle=e;t.onOptionChange('style',{'border-style':e})}}};ToolBtnDomBackgroundBorder.prototype.removeEvent=function(){if(isExpertMode){$(this.widthInput).off('keydown');$(this.widthInput).off('keyup');$(this.radiusInput).off('keydown');$(this.radiusInput).off('keyup');$(this.btnList['borderColorInput']).off('keydown');$(this.btnList['borderOpacityInput']).off('keydown');$(this.btnList['borderOpacityInput']).off('keyup');$('#borderColorPicker').off('change');$('#borderStyleBtn').off('click')}};ToolBtnDomBackgroundBorder.prototype.resetProperty=function(){this.resetBorder()};var ToolBtnDomBackgroundColor=function(){this.colorPicker=ToolOpColorPicker.get();this.addOption(this.colorPicker,'color');this.onOptionChange=function(t,e){var T=this,d=[];d.push(this.target);if(bm.toolManager.isMultiSelectMode){d=bm.toolManager.targetElementList.concat()};if(!e){bm.toast('컬러를 선택해주세요.');return!1};var v=!1;if($(d).closest('[data-wv-tab]').length>0){v=!0;var p=[];$(d).each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(p.indexOf(t)===-1)p.push(t)})};var g=0;if(!e.includes('gradient')){$(this.colorPicker.element).find('input.opacity').val()==''?g=0:g=$(this.colorPicker.element).find('input.opacity').val()};var h=isPrdDetailInfo?1:parseInt(g)/100,s=this.getSamplingElement(d),n={backgroundColor:bm.getStyle(s,'backgroundColor'),backgroundImage:bm.getStyle(s,'backgroundImage')};if(bm.getStyle(s,'backgroundImage')!=='none'){n['backgroundImage']=bm.getStyle(s,'backgroundColor')};bm.toolManager.toolBtnEditBefore(this,s,HistoryType.EDITOR_DOM_BACKGROUND_COLOR,n);var l=null;if(bm.bmEditorManager.registedBoardEditor===!1){l=WVAdminResourceManager.getEmbededStyleObject(null,s)};var i=null,c=null,r=bm.toolManager.menuTargetSelector,f=wvAdminIFrameBridge._WVContentArea.$contentBody;if(v&&l){if(e.indexOf('applyPoint')>-1){if(confirm('탭 블록 메뉴에 포인트 컬러 반영 시 현재 페이지에서만 반영이 됩니다.\n 반영하시겠습니까?')){i=bm.number.hexToRgb(this.optionList['color'].cssPointColors[e.replace('applyPoint','')]);c=h===1?e:'rgba('+i.r+', '+i.g+', '+i.b+', '+h+') !important;'}
else{return}}
else{i=bm.number.hexToRgb(e);c=h===1?e:'rgba('+i.r+', '+i.g+', '+i.b+', '+h+')';if(e!=='transparent'&&bm.getStyle(s,'backgroundImage')!=='none'){n['backgroundImage']='none'}};n={backgroundColor:c};var w=bm.toolManager.isTabActiveStyle?'.active':'';for(var o=0;o<p.length;o++){var y='[data-wv-res-id="'+p[o]+'"] [data-wv-tab-list] [data-wv-tab]'+w;l.applyResourceStyle(y,n,!1,!0,!0,!0,[],!1)}}
else if(e.indexOf('applyPoint')>-1){var b=e.replace('applyPoint',''),m='bg_point'+b;if(e!='transparent'&&!e.includes('gradient')&&bm.getStyle(s,'backgroundImage')!='none'){n['backgroundImage']='none'};var o,a,u=d.length;if(h===1){for(o=0;o<u;o++){a=d[o];if(bm.toolManager.isMenuTarget){f.find(r).removeClass('bg_point0');f.find(r).removeClass('bg_point1');f.find(r).removeClass('bg_point2');f.find(r).addClass(m);l.applyResourceStyle(r,n,!1,!0,!1,!1)}
else{$(a).removeClass('bg_point0');$(a).removeClass('bg_point1');$(a).removeClass('bg_point2');$(a).addClass(m);l.applyResourceStyle($(a),n,!1,!0)}}}
else{}}
else{if(e!=='transparent'&&(typeof(e)=='string'&&!e.includes('gradient'))){i=bm.number.rgbaToObj(e);c='rgba('+i.r+', '+i.g+', '+i.b+', '+h+')'}
else{c=e};if(e.length!==7&&e.includes('gradient')){n['backgroundImage']=e;n['backgroundColor']='transparent'}
else{i=bm.number.hexToRgb(e);c=h==1?e:'rgba('+i.r+', '+i.g+', '+i.b+', '+h+')';n={backgroundColor:c}};if(e!='transparent'&&!e.includes('gradient')&&bm.getStyle(s,'backgroundImage')!='none'){n['backgroundImage']='none'};if(e==='transparent'&&bm.getStyle(s,'backgroundImage').includes('gradient')){n['backgroundImage']='none'};var o,a,u=d.length;for(o=0;o<u;o++){a=d[o];if(bm.toolManager.isMenuTarget){f.find(r).removeClass('bg_point0');f.find(r).removeClass('bg_point1');f.find(r).removeClass('bg_point2');l.applyResourceStyle(r,n,!1,!0,!1,!1)}
else{$(a).removeClass('bg_point0');$(a).removeClass('bg_point1');$(a).removeClass('bg_point2');l.applyResourceStyle($(a),n,!1,!0,!0,!0,[],!1)}}};if(l)l.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,s,HistoryType.EDITOR_DOM_BACKGROUND_COLOR,n)}};bm.extend(ToolBtnBase,ToolBtnDomBackgroundColor);ToolBtnDomBackgroundColor.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length===0){t.resetStyleBtn();return!1};let target=this.target;if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){var e={backgroundColor:bm.getStyle(target,'backgroundColor'),backgroundImage:bm.getStyle(target,'backgroundImage')};$(this.btnList['color']).find('.choice_color').css({backgroundColor:e.backgroundColor})}};ToolBtnDomBackgroundColor.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);var v,b,y,w,p,a=this,m=!0,i='',g='',s='';if(!bm.toolManager.isMultiSelectMode){if($(a.target).hasClass('bg_point0')){s='bg_point0'}
else if($(a.target).hasClass('bg_point1')){s='bg_point1'}
else if($(a.target).hasClass('bg_point2')){s='bg_point2'};i=$(a.target).css('background-color');$(a.target).find('.wveditor_text').children().each(function(){g=$(this).css('background-color');if(i!=g){m=!1;return}})}
else{i='#000000'};if(s!==''){var f=s.replace('bg_point','');f=parseInt(f);p=f;i='#000000'}
else{p=-1};var h,c=0;if(i.indexOf('#')!=-1){h=i}
else{if(parseFloat(i.split(',')[3])){c=parseFloat((1-parseFloat(i.split(',')[3])).toFixed(2));c*=100};h=bm.number.rgbToHex(i)};var r=bm.number.hexToRgb(h),o=bm.getStyle(this.target,'background-image'),n,u,l,d;if(o!=='none'&&o.includes('linear-gradient')){if(o.includes('deg')){n=o.split('linear-gradient')[1];u=n.split('deg,')[0].replace('(','');l=n.split('),')[0].split('deg,')[1]+')';d=n.split('),')[1].replace(')','')}
else{n=o.split('linear-gradient(')[1];l=n.split('),')[0]+')';d=n.split('),')[1].replace(')','')}};this.colorPicker.setStyleValue(r.r,r.g,r.b,c,p,u,l,d)};ToolBtnDomBackgroundColor.prototype.addEvent=function(){this.onOptionShow=function(t,e){if(!this.target||this.target.length){this.resetStyleBtn();return!1};var i=bm.number.rgbaToObj(bm.getStyle(this.target,'backgroundColor'));if(parseInt(i.r)===0&&parseInt(i.g)===0&&parseInt(i.b)===0&&i.a===100)i.a=0;this.colorPicker.setStyleValue(i.r,i.g,i.b,i.a)}};ToolBtnDomBackgroundColor.prototype.removeEvent=function(){var t=this};var ToolBtnDomBackgroundImage=function(){this.type='ToolBtnDomBackgroundImage';this.addOption(new ToolOpDomBackgroundImage(),'backgroundImage');this.onOptionChange=function(t,e){var f=this,a=[];a.push(this.target);if(bm.toolManager.isMultiSelectMode){a=bm.toolManager.targetElementList.concat()};var n,i;if(t=='select'||t=='delete'){n=HistoryType.EDITOR_DOM_BACKGROUND_IMAGE;i='backgroundImage'}
else if(t=='repeat'){n=HistoryType.EDITOR_DOM_BACKGROUND_REPEAT;i='backgroundRepeat'}
else if(t=='size'){n=HistoryType.EDITOR_DOM_BACKGROUND_SIZE;i='backgroundSize'}
else if(t=='parallax'){n=HistoryType.EDITOR_DOM_BACKGROUND_PARALLAX;i='backgroundAttachment'}
else{n=HistoryType.EDITOR_DOM_BACKGROUND_POSITION;i='backgroundPosition'};var s=this.getSamplingElement(a),r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,s)};var h={};h[i]=bm.getStyle(s,i);var c=a.length,d=[];bm.toolManager.toolBtnEditBefore(this,s,n,h);for(var l=0;l<c;l++){var o=a[l];if(t==='delete'&&$(o).find('[data-wv-background-dim]').length>0){d.push($(o).find('[data-wv-background-dim]')[0])};if(i==='backgroundImage'&&$(o).find('.video-bg-wrap').length>0){this.removeVideo($(o))};r.applyResourceStyle($(o),e,!1,!0,!0,!0,[],!1)};if(t==='delete'&&d.length>0){this.removeBackgroundDim(d)};this.setStyleBtn();if(r)r.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,s,n,e)};this.removeVideo=function(t){var a=wvAdminIFrameBridge._WVContentArea.$content;bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);for(var o=0;o<t.length;o++){var i=t[o];if($(i).find('.video-bg-wrap').length>0){$(i).find('.video-bg-wrap').remove()};if(bm.getStyle(i,'backgroundImage')==='none'){$(i).css('background-image','')};if($(i).attr('data-wv-layout-element-param')){var e=JSON.parse($(i).attr('data-wv-layout-element-param').replace(/'/g,'"'));if(e.videoType)delete e.videoType;if(e.videoId)delete e.videoId;if(e.videoSrc)delete e.videoSrc;if(e.videoLoop)delete e.videoLoop;if(e.videoAutoplay)delete e.videoAutoplay;if(Object.keys(e).length===0){e=''}
else{e=JSON.stringify(e).replace(/"/g,'\'')}};$(i).attr('data-wv-layout-element-param',e);var n=$(i).attr('data-wv-res-id');if(a.find('script[data-block-js=\''+n+'\']').length===1){a.find('script[data-block-js=\''+n+'\']').remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[n]}};bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO)};this.removeBackgroundDim=function(t){if(t.length>0){var o=this.getSamplingElement(t),s={backgroundImage:bm.getStyle(o,'backgroundImage'),backgroundColor:bm.getStyle(o,'backgroundColor')};var i=null;if(bm.bmEditorManager.registedBoardEditor===!1){i=WVAdminResourceManager.getEmbededStyleObject(null,o)};if(i){bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_DIM,s);var a=wvAdminIFrameBridge._WVContentArea.$content,e,n;$(t).each(function(){e=$(this).attr('data-wv-res-id');n='[data-wv-res-id="'+e+'"]';$(this).remove();if(i.styleElement.outerHTML.indexOf(n)>0){i.deleteRuleBySelector(n,!1,!0)};if(a.find('script[data-block-js=\''+e+'\']').length===1){a.find('script[data-block-js=\''+e+'\']').remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[e]}});i.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_DIM,s)}}};this.onFileManagerFileSelected=function(t,e){bm.popupManager.removePopLatest();var h=t.extension.toLowerCase(),c=new RegExp('jpg|jpeg|gif|png');if(c.test(h)){var r=t.thumbImg,i={'background-image':$(this.target).css('background-image')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_DOM_BACKGROUND_IMAGE,i);i={'background-image':'url(\''+r+'\')'};var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};o.applyResourceStyle(this.target,i,!1,!0,!1,!0,[],!1);o.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_DOM_BACKGROUND_IMAGE,i);if($(this.target).closest('[data-wv-swiper-con]').length>0){var d=$(this.target).closest('[data-wv-swiper-con]').attr('data-wv-res-id');for(var n=0;n<wvAdminIFrameBridge._WVContentArea.innerWindow.bm.swiper.list.length;n++){var s=wvAdminIFrameBridge._WVContentArea.innerWindow.bm.swiper.list[n];if(s['res-id']==d){var a=$(this.target).closest('.swiper-slide');if(a.find('[data-wv-swiper-img]').index(this.target)===0){var l=$(s.el).find('.swiper-slide').index(a[0]);wvAdminIFrameBridge.toolManager.toolList['ToolThumb'].changeThumb(r,l);break}}}}}
else{alert('배경이미지 변경을 위해 이미지를 선택해주세요.')}}};bm.extend(ToolBtnBase,ToolBtnDomBackgroundImage);ToolBtnDomBackgroundImage.prototype.setStyleBtn=function(){if(!this.target||this.target.length){this.resetStyleBtn();return!1};var i=this,s={};var p=['background-repeat','background-size','background-attachment','background-position'],t=this.optionList['backgroundImage'],r=t.optionBtnList,a=!$(i.target).css('background-image')||$(i.target).css('background-image')=='none'?!1:!0;for(var h=0;h<p.length;h++){var n='',e,o=p[h];if(o=='background-repeat'){n=$(i.target).css('background-repeat');s[o]=$(i.target).css('background-repeat');e=r['repeat'];if(a&&n=='repeat'){$(e).addClass('active')}
else{$(e).removeClass('active')}}
else if(o=='background-size'){n=$(i.target).css('background-size');s[o]=$(i.target).css('background-size');t.element.find('[data-wv-tool-option-btn^="size"]').removeClass('active');e=r['size_'+n];if(a&&n=='cover'){$(e).addClass('active');t.element.find('input[name="backgroundImageSizeAdjust"]').val('채우기')}
else if(a&&n=='contain'){$(e).addClass('active');t.element.find('input[name="backgroundImageSizeAdjust"]').val('맞추기')}
else{t.element.find('input[name="backgroundImageSizeAdjust"]').val(n.replace('px',''))}}
else if(o=='background-attachment'){n=$(i.target).css('background-attachment');s[o]=$(i.target).css('background-attachment');e=r['parallax'];if(a&&n=='fixed'){$(e).addClass('active')}
else{$(e).removeClass('active')}}
else if(o=='background-position'){var l=$(i.target).css('backgroundPositionX'),d=$(i.target).css('backgroundPositionY'),c=t.extractPercentage(l)+'%',f=t.extractPercentage(d)+'%';s[o]=$(i.target).css('backgroundPosition');if(a&&c!=''&&f!=''){e=r[c+'_'+f];t.element.find('input[name="backgroundImageLeftRight"]').val(t.extractPx(l)!==0?-t.extractPx(l):0);t.element.find('input[name="backgroundImageUpDown"]').val(t.extractPx(d)!==0?-t.extractPx(d):0);$(t.element).find('.bg_align_btn').removeClass('active');if(e)$(e).addClass('active')}
else{t.element.find('input[name="backgroundImageLeftRight"]').val(0);t.element.find('input[name="backgroundImageUpDown"]').val(0);$(t.element).find('.bg_align_btn').removeClass('active')}}};t.css=s};ToolBtnDomBackgroundImage.prototype.showOption=function(t,e){var o=this;ToolBtnBase.prototype.showOption.call(this,t,e);if(!bm.toolManager.isMultiSelectMode){o.setStyleBtn()}
else{var i=this.optionList['backgroundImage'],n=i.optionBtnList;$(n).removeClass('active')}};ToolBtnDomBackgroundImage.prototype.resetStyleBtn=function(){var t=this};ToolBtnDomBackgroundImage.prototype.addEvent=function(){var t=this};ToolBtnDomBackgroundImage.prototype.removeEvent=function(){var t=this};var ToolBtnDomBackgroundVideo=function(t){this.type=t;if(isExpertMode){this.element=$('[data-wv-toolset=ToolDomBackgroundVideo]');this.colorPicker=ToolOpColorPicker.get(this,t);this.addOption(this.colorPicker,'videoDimColorExpand')}
else{this.element=$('[data-wv-tool-option=ToolOpDomBackgroundVideo]');this.addOption(new ToolOpDomBackgroundVideo(),'backgroundVideo')};this.playerTmplt;this.dimColor;this.blockJsTmplt;this.onOptionChange=function(t,e){var i=[];if(!this['target']){bm.toast('선택된 블록이 없습니다.');return!1};i.push(this.target);if(bm.toolManager.isMultiSelectMode){i=bm.toolManager.targetElementList.concat()};if(t==='apply'){for(var n=0;n<i.length;n++){if($(i[n]).attr('data-wv-layout-element-type')==='video'){bm.toast('영상 블록에 배경동영상을 설정할 수 없습니다.');return!1}
else if($(i[n]).closest('[data-wv-inc="header"]').length>0){bm.toast('헤더 영역에 배경동영상을 설정할 수 없습니다.');return!1}
else if($(i[n]).attr('data-wv-layout-element-type')==='map'){bm.toast('지도 블록에 배경동영상을 설정할 수 없습니다.');return!1}
else if($(i[n]).attr('data-wv-layout-element-type')==='bbs'){bm.toast('게시판 블록에 배경동영상을 설정할 수 없습니다.');return!1}
else if($(i[n]).find('.video-bg-wrap').length===0&&wvAdminIFrameBridge._WVContentArea.$contentBody.find('script[data-block-js=\''+$(i[n]).attr('data-wv-res-id')+'\']').length>0){bm.toast('특수 기능을 가진 블록에 배경동영상을 설정할 수 없습니다.');return!1}};if(!this.validVideo())return!1;this.addPlayer(i)}
else if(t==='ToolOpColorPicker'){if(typeof(e)==='string'&&e.indexOf('#')>-1){e=bm.number.hexToRgb(e)};this.dimColor='background-color: rgba('+e.r+','+e.g+','+e.b+','+e.a/100+')';$(this.target).find('.dim').css('background-color','rgba('+e.r+','+e.g+','+e.b+','+e.a/100+')');$(this.element).find('input[name="videoDim"]').val((bm.number.rgbToHex('rgb('+e.r+','+e.g+','+e.b+',)')).toUpperCase());$(this.element).find('#videoDimColorPicker').val(bm.number.rgbToHex('rgb('+e.r+','+e.g+','+e.b+',)'));$(this.btnList.videoDimOpacity).val(e.a+'%')}
else{this.removeVideo(i)};$(this.btnList[0]).trigger('click')};this.removeVideo=function(t){var s=wvAdminIFrameBridge._WVContentArea.$content,r={backgroundImage:'',backgroundRepeat:'',backgroundSize:'',backgroundPosition:''};bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);for(var o=0;o<t.length;o++){var i=t[o];if($(i).find('.video-bg-wrap').length>0){$(i).find('.video-bg-wrap').remove()};if(bm.getStyle(i,'backgroundImage')==='none'){$(i).css('background-image','')}
else{var a=WVAdminResourceManager.getEmbededStyleObject(null,i);a.applyResourceStyle(i,r,!1,!0,!1,!1);a.refreshStyleElementText()};if($(i).attr('data-wv-layout-element-param')){var e=JSON.parse($(i).attr('data-wv-layout-element-param').replace(/'/g,'"'));if(e.videoType)delete e.videoType;if(e.videoId)delete e.videoId;if(e.videoSrc)delete e.videoSrc;if(e.videoLoop)delete e.videoLoop;if(e.videoAutoplay)delete e.videoAutoplay;if(Object.keys(e).length===0){e=''}
else{e=JSON.stringify(e).replace(/"/g,'\'')};$(i).attr('data-wv-layout-element-param',e)};var n=$(i).attr('data-wv-res-id');if(s.find('script[data-block-js=\''+n+'\']').length===1){s.find('script[data-block-js=\''+n+'\']').remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[n]}};bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO)};this.validVideo=function(){if(isExpertMode){var t=$(this['btnList']['url'])}
else{var t=$(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]')};if(!t.val()){bm.toast('영상주소를 입력해주세요.');t.focus();return!1};var e=this.getVideoInfo(null,t.val());if(!e.videoType){bm.toast('영상매체는 Youtube와 Vimeo만 가능합니다.');t.focus();return!1};if(!e.videoId){bm.toast('영상주소가 올바르지 않습니다.');t.focus();return!1};return!0};this.getUrlType=function(t){t.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);var e;if(RegExp.$3.indexOf('youtu')>-1){e='youtube'}
else if(RegExp.$3.indexOf('vimeo')>-1){e='vimeo'};return{videoType:e,videoId:RegExp.$6}};this.getVideoInfo=function(t,e){var i={};if(t&&$(t).attr('data-wv-layout-element-param')){i=bm.object.deepCopy(JSON.parse($(t).attr('data-wv-layout-element-param').replace(/'/g,'"')))};if(e){var n=this.getUrlType(e);i['videoType']=n['videoType'];i['videoId']=n['videoId']};return i};this.getVideoParam=function(t){if(isExpertMode){var e=this.getVideoInfo(t,$(this['btnList']['url']).val())}
else{var e=this.getVideoInfo(t,$(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]').val())};e.videoLoop=!0;e.videoAutoplay=!0;var i=WEB_ROOT;if(i.indexOf('/webadm')>-1)i.replaceAll('/webadm','/web');if(e.videoType==='youtube'){e.videoSrc='https://www.youtube.com/embed/'+e.videoId+'?autoplay=1&mute=1&controls=0&disablekb=1&enablejsapi=1&modestbranding=1&iv_load_policy=3&loop=1&playlist='+e.videoId+'&origin='+encodeURIComponent(i)}
else if(e.videoType==='vimeo'){e.videoSrc='https://player.vimeo.com/video/'+e.videoId+'?autoplay=1&muted=1&autopause=0&loop=1&controls=0&background=1'};return e};this.addVideoBg=function(t,e,i){let css={backgroundRepeat:'no-repeat',backgroundSize:'cover',backgroundPosition:'center'};let styleObj=WVAdminResourceManager.getEmbededStyleObject(null,e);i=i?i:wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList();if(t.videoType==='vimeo'){let ajaxUrl='http://vimeo.com/api/v2/video/'+t.videoId+'.json';$.ajax({url:ajaxUrl,dataType:'json'}).done((data)=>{let n=data[0]['thumbnail_large'];css['backgroundImage']='url("'+n+'")';styleObj.applyResourceStyle(e,css,!1,!0,!1,!1,i);styleObj.refreshStyleElementText()}).fail(()=>{console.log('썸네일 추출 실패')})}
else if(t.videoType==='youtube'){var n='https://img.youtube.com/vi/'+t.videoId+'/maxresdefault.jpg',o=new Image();o.src=n;css['backgroundImage']='url("'+n+'")';styleObj.applyResourceStyle(e,css,!1,!0,!1,!1,i);styleObj.refreshStyleElementText()}};this.setVideo=function(){this.playerTmplt='<div class="video-bg-wrap"><div class="dim" style="position: absolute;top: 0;left: 0;height: 100%;width: 100%;z-index: 1;"></div><div class="video-bg"><iframe id="'+$(this.target).attr('data-wv-res-id')+'" src="{{videoSrc}}" frameborder="0" allowfullscreen="1" allow="autoplay; fullscreen" style="position:absolute; top:0; left:0;"></iframe></div></div>';this.blockJsTmplt='{ videoInfo: null, videoWidth : 0, videoHeight : 0 ,init : function(){ this.registEvent(); this.onLoadHandler(); } ,registEvent : function() { } ,onLoadHandler : function(){ var _this = this; if(_this.block && $(_this.block).attr(\'data-wv-layout-element-param\')) { _this.videoInfo = JSON.parse($(_this.block).attr(\'data-wv-layout-element-param\').replace(/\'/g, \'"\')); if($(_this.block).find(\'.video-bg-wrap\').length > 0) { $(_this.block).find(\'.video-bg-wrap\').remove(); } $(_this.block).append(_this.getPlayer());  _this.observer  = new ResizeObserver(function (entries, observer) { var width = entries[0].borderBoxSize[0].inlineSize; var height = entries[0].borderBoxSize[0].blockSize; if(width !== _this.videoWidth || height !== _this.videoHeight) { _this.setVideoFullSize(width, height); } _this.videoWidth = width; _this.videoHeight = height; }); _this.observer.observe(_this.block); } }  , setVideoFullSize : function ( w, h ) { var iframe = $(this.block).find(\'iframe\'); var ratio = 1.778; var extraValue = 200;  iframe.height(Math.round(w / ratio)); iframe.width(Math.round(iframe.height() * ratio)); if (w > iframe.width()) { iframe.width(w + extraValue); iframe.height(iframe.width() / ratio ); } if (h > iframe.height()) { iframe.height(h + extraValue); iframe.width(iframe.height() * ratio); }  iframe.parent().css(\'left\', \'-\' + (iframe.width() - w) / 2 + \'px\' ); iframe.parent().css(\'top\', \'-\' + (iframe.height() - h) / 2 + \'px\' ); } ,getPlayer : function() { return \''+this.playerTmplt+'\'; } ,removeEvent : function(){ if(this.observer) this.observer.disconnect(); }  ,destroy : function(){ this.videoWidth = 0; this.videoHeight = 0; this.removeEvent(); } }'};this.addPlayer=function(t){bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);for(var o=0;o<t.length;o++){var e=t[o],i=this.getVideoParam(e);if($(e).find('.video-bg-wrap').length>0){$(e).find('.video-bg-wrap').remove()};if($(e).attr('data-wv-layout-element-param')){var n=JSON.parse($(e).attr('data-wv-layout-element-param').replace(/'/g,'"'));n['videoType']=i.videoType;n['videoId']=i.videoId;n['videoSrc']=i.videoSrc;n['videoLoop']=i.videoLoop;n['videoAutoplay']=i.videoAutoplay;$(e).attr('data-wv-layout-element-param',JSON.stringify(n).replace(/"/g,'\''))}
else{$(e).attr('data-wv-layout-element-param',JSON.stringify(i).replace(/"/g,'\''))};if(!$(e).attr('data-wv-res-id')){var a=$(e).attr('data-wv-block-id');$(e).attr('data-wv-res-id',WVAdminResourceManager.createResourceId(a))};if(!$(e).attr('data-wv-block-id')){$(e).attr('data-wv-block-id','___block'+$(e).attr('data-wv-res-id'))};this.addVideoBg(i,$(e));this.setVideo();this.addBlockJs($(e).attr('data-wv-res-id'),i.videoSrc)};bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);this.setStyleBtn()};this.addBlockJs=function(t,e){var n=wvAdminIFrameBridge._WVContentArea,o='wevenBlock[\''+t+'\'] = '+this.blockJsTmplt,i=n.innerWindow.document.createElement('script');i.setAttribute('type','text/javascript');i.setAttribute('data-block-js',t);if($(this.target).closest('data-wv-inc').length>0){i.setAttribute('data-inc-js',t)}
else if($(this.target).closest('[data-wv-layout-element="layout"]').length>0){i.setAttribute('data-layout-js','')};if(o.indexOf('{{videoSrc}}')>-1)o=o.replace(/{{videoSrc}}/g,e);i.text=o;if(n.$contentBody.find('script[data-block-js=\''+t+'\']').length>0){var a=n.$contentBody.find('script[data-block-js=\''+t+'\']');a.each(function(){if(this.innerHTML.indexOf('video-bg-wrap')){$(this).remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[t]}})};n.$contentBody.append(i);app.childApp.wvLayoutTargetCrawling(t,!0)}};bm.extend(ToolBtnBase,ToolBtnDomBackgroundVideo);ToolBtnDomBackgroundVideo.prototype.setStyleBtn=function(){if(!this.target||this.target.length){this.resetStyleBtn();return!1};if($(this.target).attr('data-wv-layout-element-type')==='video'||$(this.target).attr('data-wv-layout-element-type')==='map'||$(this.target).closest('[data-wv-inc="header"]').length>0||$(this.target).attr('data-wv-layout-element-type')==='bbs'||$(this.target).attr('data-wv-layout-element-type')==='line'||$(this.target).closest('[data-wv-layout-element-type="shop_list"]').length>0||$(this.target).closest('[data-wv-layout-element-type="shop_review"]').length>0||$(this.target).closest('[data-wv-layout-element-type="shop_BBS_recent"]').length>0||$(this.target).closest('[data-wv-layout-element-type="insta"]').length>0){this.resetStyleBtn();return!1};if(!isExpertMode){this.bgVideoOpt=this.optionList['backgroundVideo'];var i=this.bgVideoOpt.optionBtnList}
else{this.bgVideoOpt={'element':this.element}};const videoDimNode=$(this.target).find('.dim')[0];let videoDimStyle;if(videoDimNode){videoDimStyle=bm.getStyle(videoDimNode,'backgroundColor')}
else{videoDimStyle='rgba(0,0,0,0)'};var t=$(this.target).attr('data-wv-layout-element-param');if(t&&bm.valid.isValidJSON(t,!0)===!1){return!1};if(t&&!t.includes('vertical')&&!t.includes('horizon')){var t=JSON.parse($(this.target).attr('data-wv-layout-element-param').replace(/'/g,'"'));if(t.videoType&&t.videoId){var e='';if(t.videoType==='youtube'){e='https://youtu.be/'+t.videoId}
else if(t.videoType==='vimeo'){e='https://vimeo.com/'+t.videoId};if(isExpertMode){$(this.element).find('input[name=url]').val(e);$(this.element).find('input[name=videoDim]').val(bm['number'].rgbToHex(videoDimStyle));$('#videoDimColorPicker').val(bm['number'].rgbToHex(videoDimStyle));$(this.element).find('input[name=videoDimOpacity]').val((bm['number'].rgbaToObj(videoDimStyle)['a']*100)+'%');bm.toolManager.toolList['ToolDomBackgroundVideo'].openControl(null,!0)}
else{$(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]').val(e);$(i['delete']).show()}}}
else{if(isExpertMode){$(this.element).find('input[name=url]').val('');$(this.element).find('input[name=videoDim]').val('#000000');$('#videoDimColorPicker').val('#000000');$(this.element).find('input[name=videoDimOpacity]').val('0%');bm.toolManager.toolList['ToolDomBackgroundVideo'].openControl(null,!1)}
else{$(this.bgVideoOpt.element).find('[data-wv-tool-option-value="url"]').val('');$(i['delete']).hide()}}};ToolBtnDomBackgroundVideo.prototype.resetStyleBtn=function(){var t=this;if(isExpertMode){$(this.element).find('input[name=url]').val('');$(this.element).find('input[name=videoDim]').val('#000000');$('#videoDimColorPicker').val('#000000');$(this.element).find('input[name=videoDimOpacity]').val('0%')}};ToolBtnDomBackgroundVideo.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnDomBackgroundVideo.prototype.addEvent=function(){var t=this;if(isExpertMode){this.onOptionHide=function(t,e){if(e.status==1){e.deactive()}};this.onOptionShow=function(t,e){var i=bm.number.hexToRgb($(this.element).find('input[name="videoDim"]').val());i.a=parseFloat($(this.element).find('input[name="videoDimOpacity"]').val())/100;e.setStyleValue(i.r,i.g,i.b,i.a)};$(this.element).find('input[name="url"]').on('keydown',function(e){if(e.keyCode==13){t.onOptionChange('apply')}});$(this.element).find('input[name="videoDim"]').on('keydown',function(e){if(e.keyCode==13){var i=this.value;if(bm.number.isHex(i)==!1){bm.toast('올바른 색상코드를 입력해주세요.','영상 딤 색상');return!1};t.onOptionChange('apply')}});$('#videoDimColorPicker').on('change',function(e){$(t.element).find('input[name="videoDim"]').val(this.value);t.onOptionChange('apply')});$(this.element).find('input[name="videoDimOpacity"]').on('keydown',function(e){if(e.keyCode==13){var i=parseInt(this.value);if(i<0||i>100){bm.toast('0부터 100 사이 값만 적용할 수 있습니다.','영상 딤 투명도');return!1};t.onOptionChange('apply')}});$(this.element).find('input[name="videoDimOpacity"]').on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)||!/^\d+(%{0,1})$/.test(t)){$(this).val(0);bm.toast('숫자를 입력해주세요.','영상 딤 투명도');return!1}})}
else{$(this.element).find('input[name="videoDim"]').on('keyup',function(t){var e=$(this).val();if(bm.valid.isOnlyNumDot(e)){if(e<0||e>1){$(this).val(0.2);bm.toast('0 ~ 1사이의 수치를 입력해주세요.','영상투명도');return}}
else{$(this).focus();$(this).val(0.2);bm.toast('숫자를 입력해주세요.','영상투명도');return}})}};ToolBtnDomBackgroundVideo.prototype.removeEvent=function(){var t=this;if(isExpertMode){$(this.element).find('input[name="videoDim"]').off('keydown');$('#videoDimColorPicker').off('change');$(this.element).find('input[name="videoDimOpactiy"]').off('keydown');$(this.element).find('input[name="videoDimOpactiy"]').off('keyup')}
else{$(this.element).find('input[name="videoDim"]').off('keyup')}};ToolBtnDomBackgroundVideo.prototype.resetProperty=function(){this.onOptionChange('delete')};var ToolBtnDomBackgroundDim=function(t){const _this=this;this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);if(isExpertMode){this.addOption(this.colorPicker,'fillColorExpand')}
else{this.addOption(this.colorPicker,'color')};var e=$('[data-wv-toolset=ToolDomBackgroundDim]');this.fillColorCon=e.find('#fillColorCon');this.gradationCon=e.find('#gradationCon');this.pointColorCon=e.find('#pointColorCon');this.addOption(this.colorPicker,'fillColorExpand');this.getTargetDim=function(t){return $(t).children('[data-wv-layout-element="block_inner"]').children('[data-wv-background-dim]')[0]};this.onBtnClick=function(t,e){switch(e){case'color':case'backgroundGradation':case'pointColor':this.showTab(e);break}};this.showColorPicker=function(t){var i=this;if(this.colorPicker.status==1){this.colorPicker.deactive();this.showColorPicker(t)}
else if(this.colorPicker.status==0){var e;if(t){e=this.pointColorCon[0];this.colorPicker.element.find('.layer_title').text('Point Color')}
else{e=this.fillColorCon[0];this.colorPicker.element.find('.layer_title').text('Dim Color')};this.colorPicker.active(e,function(t,e){i.onOptionChange('color',e)});this.colorPicker.element.removeClass('input_layer_con');this.colorPicker.element.show();this.colorPicker.element.css('margin-right',0)}};this.onOptionChange=function(t,e,i){var n=[];n.push(this.target);if(bm.toolManager.isMultiSelectMode){n=bm.toolManager.targetElementList.concat()};if(typeof(e)==='string'&&(e.toLowerCase().includes('rgb')==!1&&e.toLowerCase().includes('#')==!1)){return!1}
else{if(bm.number.isHex(e)===!0){e='#'+e.replaceAll('#','')}};if(!e){bm.toast('컬러를 선택해주세요.');return!1};var o=[];$(n).each(function(){if($(_this.getTargetDim(this)).length>0){o.push(_this.getTargetDim(this))}});if(e==='transparent'){this.removeDim(o)}
else{this.setDim(e,n,o,t)};this.setStyleBtn()};this.setDim=function(t,e,i,n){var m=this,T=m.getTargetDim($(e[0])),u=this.getSamplingElement(T),a={backgroundColor:bm.getStyle(u,'backgroundColor')};bm.toolManager.toolBtnEditBefore(this,u,HistoryType.EDITOR_DOM_BACKGROUND_DIM,a);var h=null;if(bm.bmEditorManager.registedBoardEditor===!1){h=WVAdminResourceManager.getEmbededStyleObject(null,u)};$(e).each(function(){if($(m.getTargetDim(this)).length===0){var t=m.insertDim(this);i.push(t)}});var s,o,g=i.length,l=null,p=null,d,b;if(n==='ToolOpColorPicker'){if(typeof(t)==='object'){var w='rgb('+t.r+', '+t.g+', '+t.b+')';d=bm.number.rgbToHex(w)}
else{d=t};if(isExpertMode){var c=parseFloat($(this.colorPicker.element).find('input.color_input.opacity').val())}
else{var r='100'};b=bm.number.hexToRgb(d);b.a=c/100;r=c/100}
else{var c=isNaN(parseInt($(this.btnList['fillColorOpacityInput']).val().replace('%','')))?30:parseInt($(this.btnList['fillColorOpacityInput']).val().replace('%','')),r=c>100?100:parseInt(c)/100};if(typeof(t)==='string'&&t.indexOf('applyPoint')>-1){var y=t.replace('applyPoint',''),v='bg_point'+y;if(r===1){for(s=0;s<g;s++){o=i[s];a={backgroundColor:bm.getStyle(o,'backgroundColor')};if(t!=='transparent'&&!t.includes('gradient')&&bm.getStyle(o,'backgroundImage')!=='none'){a['backgroundImage']='url("")'};$(o).removeClass('bg_point0');$(o).removeClass('bg_point1');$(o).removeClass('bg_point2');$(o).addClass(v);h.applyResourceStyle($(o),a,!1,!0)}}
else{if(confirm('포인트 컬러 투명도 반영시 현재 페이지에서만 반영이 됩니다.\n 반영하시겠습니까?')){var f;for(s=0;s<g;s++){o=i[s];if(t!=='transparent'&&!t.includes('gradient')&&bm.getStyle(o,'backgroundImage')!=='none'){a['backgroundImage']='url("")'};$(o).removeClass('bg_point0');$(o).removeClass('bg_point1');$(o).removeClass('bg_point2');$(o).addClass(v);f=bm.number.rgbaToObj(bm.getStyle(o,'backgroundColor'));a={backgroundColor:'rgba('+f.r+', '+f.g+', '+f.b+', '+r+') !important;'};h.applyResourceStyle($(o),a,!1,!0,!0,!0,[],!1)}}
else{this.setStyleBtn();return!1}}}
else{if(typeof(t)==='string'&&t!=='transparent'&&!t.includes('gradient')){l=bm.number.hexToRgb(t);p=r===1?t:'rgba('+l.r+', '+l.g+', '+l.b+', '+r+')'}
else{p=t};const strValue=bm['number'].rgbaObjToStr(t);if(strValue.length!==7&&strValue.includes('gradient')){a['backgroundImage']=t;a['backgroundColor']='transparent'}
else{l=bm.number.hexToRgb(t);p=r===1?strValue:'rgba('+l.r+', '+l.g+', '+l.b+', '+r+')';a={backgroundColor:p}};for(s=0;s<g;s++){o=i[s];if(typeof(strValue)==='string'&&strValue!=='transparent'&&!strValue.includes('gradient')&&bm.getStyle(o,'backgroundImage')!=='none'){a['backgroundImage']='url("")'};if(strValue==='transparent'&&bm.getStyle(o,'backgroundImage').includes('gradient')){a['backgroundImage']='url("")'};$(o).removeClass('bg_point0');$(o).removeClass('bg_point1');$(o).removeClass('bg_point2');h.applyResourceStyle($(o),a,!1,!0,!0,!0,[],!1)}};if(h)h.refreshStyleElementText();if(n==='ToolOpColorPicker'){$(this.btnList['fillColorInput']).val(d);$('#dimfillColorPicker').val(d);$(this.colorPicker.element).find('input.color_option_prev').val(d)};$(this.btnList['fillColorOpacityInput']).val(r*100+'%');bm.toolManager.toolBtnEditAfter(this,u,HistoryType.EDITOR_DOM_BACKGROUND_DIM,a)};this.insertDim=function(t){if(t){var i='<div data-wv-background-dim data-wv-block-id=\'___background_dim_000\'></div>',e=$(i).prependTo($(t).find('> [data-wv-layout-element="block_inner"]')),n=WVAdminResourceManager.getResourceId(e);this.addBlockJs(n);return e}};this.removeDim=function(t){if(t.length>0){var o=this.getSamplingElement(t),s={backgroundImage:bm.getStyle(o,'backgroundImage'),backgroundColor:bm.getStyle(o,'backgroundColor')};var i=null;if(bm.bmEditorManager.registedBoardEditor===!1){i=WVAdminResourceManager.getEmbededStyleObject(null,o)};if(i){bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_DIM,s);var a=wvAdminIFrameBridge._WVContentArea.$content,e,n;$(t).each(function(){e=$(this).attr('data-wv-res-id');n='[data-wv-res-id="'+e+'"]';$(this).remove();if(i.styleElement.outerHTML.indexOf(n)>0){i.deleteRuleBySelector(n,!1,!0)};if(a.find('script[data-block-js=\''+e+'\']').length===1){a.find('script[data-block-js=\''+e+'\']').remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[e]}});i.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_DIM,s)}}};this.addBlockJs=function(t){var n='';for(let i=0;i<Object.keys(bm.dimTmplt)['length'];i++){if(i===0){n+='{'};n+=Object.keys(bm.dimTmplt)[i]+': '+bm.dimTmplt[Object.keys(bm.dimTmplt)[i]].toString()+'\n,';if(i===Object.keys(bm.dimTmplt)['length']-1){n+='}'}};var o=wvAdminIFrameBridge._WVContentArea,a='wevenBlock[\''+t+'\'] = '+n,e=o.innerWindow.document.createElement('script');e.setAttribute('data-block-js',t);if($(this.target).closest('data-wv-inc').length>0){e.setAttribute('data-inc-js',t)}
else if($(this.target).closest('[data-wv-layout-element="layout"]').length>0){e.setAttribute('data-layout-js','')};e.text=a;o.$contentBody.append(e);app.childApp.wvLayoutTargetCrawling(t,!0)};this.showTab=function(t,e){this.fillColorCon.hide();this.pointColorCon.hide();this.gradationCon.hide();let style;if(t==='color'){this.fillColorCon.show();style=$('#dimfillColorPicker').val();if(e){this.setBgColor()}}
else if(t==='pointColor'){this.pointColorCon.show();this.setPointColor()}
else if(t==='backgroundGradation'){this.gradationCon.show();style=this.gradationCon.find('.gradation_box').css('backgroundImage');if(e){this.setGradation()}
else{this.setGradation(null,!1)}};if(!e){_this.onOptionChange(t,style)};$('#backgroundDimTabCon').find('[data-wv-tool-btn-prop]').removeClass('active');$('#backgroundDimTabCon').find('[data-wv-tool-btn-prop='+t+']').addClass('active')};this.getBgColor=function(t){var i='',s='',n='',o=!0;if(!t){t=this.getTargetDim(this.target)};const bgColornarrow=(target)=>{try{let $document;if(document.WEVEN_IFRAME)$document=document.WEVEN_IFRAME.document;else if(document.wevenIframePreview)$document=document.wevenIframePreview.document;if($document.defaultView.getComputedStyle){if($document.defaultView.getComputedStyle(target,null).getPropertyValue('background-color')!=='rgba(0, 0, 0, 0)'){o=!1};if($document.defaultView.getComputedStyle(target,null).getPropertyValue('background-image')!=='none'){o=!1};if(o===!0){return{bgColor:'rgba(255, 255, 255, 0.3)',bgImg:'linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.3))'}}
else{return{bgColor:$(target).css('background-color'),bgImg:$(target).css('background-image')}}}}catch(e){console.warn(e)}};if(!bm.toolManager.isMultiSelectMode){if($(_this.target).hasClass('bg_point0')){n='bg_point0'}
else if($(_this.target).hasClass('bg_point1')){n='bg_point1'}
else if($(_this.target).hasClass('bg_point2')){n='bg_point2'};i=bgColornarrow(t)['bgColor']}
else{var a=!0;$(_this.target).each(function(){if($(this).hasClass('bg_point0')){n='bg_point0'}
else if($(this).hasClass('bg_point1')){n='bg_point1'}
else if($(this).hasClass('bg_point2')){n='bg_point2'};if(i==''){i=bgColornarrow(t)['bgColor']}
else{s=bgColornarrow(t);if(i!=s){a=!1;return}}});if(!a)i=this.defaultColor?this.defaultColor:i};bgImg=bgColornarrow(t)['bgImg'];return{bgColor:i,bgImg:bgImg,pointClass:n,isNone:o}};this.setBgColor=function(t){if(!t)t=this.getBgColor().bgColor;var e,i=100;if(t.indexOf('#')!=-1){e=t}
else{if(parseFloat(t.split(',')[3])){if(isExpertMode){i=parseFloat(t.split(',')[3])}
else{i=parseFloat((1-parseFloat(t.split(',')[3])).toFixed(2))}}
else{i=parseFloat($(this.btnList['fillColorOpacityInput']).val())/100};e=bm.number.rgbToHex(t)};var n=bm.number.hexToRgb(e);$(this.btnList['fillColorInput']).val(e.toUpperCase().replaceAll('#',''));$('#dimfillColorPicker').val(e);$(this.btnList['fillColorOpacityInput']).val(i*100+'%');this.colorPicker.setStyleValue(n.r,n.g,n.b,i)};this.setPointColor=function(t){if(!t)t=this.getBgColor().pointClass;if(t){var e=parseInt(t.replace('bg_point',''));bgColor=bm.number.hexToRgb(this.defaultColor);this.colorPicker.setStyleValue(rgb.r,rgb.g,rgb.b,0,e)}};this.setGradation=function(t,e){if(!t)t=bm.getStyle(this.getTargetDim(this.target),'background-image');if(t!=='none'&&t.includes('linear-gradient')&&!e){var i,n,o,a;if(t.includes('deg')){i=t.split('linear-gradient')[1];n=i.split('deg,')[0].replace('(','');o=i.split('),')[0].split('deg,')[1]+')';a=i.split('),')[1].replace(')','')}
else{i=t.split('linear-gradient(')[1];o=i.split('),')[0]+')';a=i.split('),')[1].replace(')','')};var s=bm.number.rgbToHex(o),r=bm.number.rgbToHex(a);$(this.btnList['gradationStartInput']).val(s);$(this.btnList['gradationEndInput']).val(r);$('#dimGradationStartColorPicker').val(s);$('#dimGradationEndColorPicker').val(r);$(this.btnList['gradationStartOpacityInput']).val(bm.number.rgbaToObj(o).a*100+'%');$(this.btnList['gradationEndOpacityInput']).val(bm.number.rgbaToObj(a).a*100+'%');$(this.btnList['gradationDegreeInput']).val(n?n:90);this.setGradationBar('linear-gradient('+(n?n+'deg, ':'')+o+', '+a+')')}
else if(!e){}
else{$(this.btnList['gradationStartInput']).val('#000000');$(this.btnList['gradationEndInput']).val('#FFFFFF');$('#dimGradationStartColorPicker').val('#000000');$('#dimGradationEndColorPicker').val('#FFFFFF');$(this.btnList['gradationStartOpacityInput']).val('30%');$(this.btnList['gradationEndOpacityInput']).val('30%');$(this.btnList['gradationDegreeInput']).val(90);this.gradationCon.find('.gradation_box').css({backgroundImage:'linear-gradient(90deg, rgba(0,0,0,0.3), rgba(255,255,255,0.3)'})}};this.setGradationBar=function(t){this.gradationCon.find('.gradation_box').css({backgroundImage:t})};this.gradationApply=function(){const _this=this;var a=$(_this.btnList['gradationDegreeInput']).val(),t=bm.number.hexToRgb($(_this.btnList['gradationStartInput']).val()),e=bm.number.hexToRgb($(_this.btnList['gradationEndInput']).val()),s=$(_this.btnList['gradationStartOpacityInput']).val(),r=$(_this.btnList['gradationEndOpacityInput']).val();if(s==''){$(_this.btnList['gradationStartOpacityInput']).val('0%');var n=0}
else{n=parseFloat(s)};if(r==''){$(_this.btnList['gradationEndOpacityInput']).val('0%');var i=0}
else{i=parseFloat(r)};$(_this.btnList['gradationStartOpacityInput']).val(n+'%');$(_this.btnList['gradationEndOpacityInput']).val(i+'%');var h=(n)/100,i=(i)/100;_this.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc('+a+'deg - 90deg))');if(t==null&&e!==null){t=e;$(_this.btnList['gradationStartInput']).val($(_this.btnList['gradationEndInput']).val());$('#dimGradationStartColorPicker').val($(_this.btnList['gradationEndInput']).val())};if(e==null&&t!==null){e=t;$(_this.btnList['gradationEndInput']).val($(_this.btnList['gradationStartInput']).val());$('#dimGradationEndColorPicker').val($(_this.btnList['gradationStartInput']).val())};if(t!==null&&e!==null){var l='RGBA('+t.r+', '+t.g+', '+t.b+', '+h+')',d='RGBA('+e.r+', '+e.g+', '+e.b+', '+i+')',o='linear-gradient('+a+'deg, '+l+', '+d+')';_this.setGradationBar(o);_this.onOptionChange('backgroundGradation',o)};$('#dimGradationStartColorPicker').val($(_this.btnList['gradationStartInput']).val());$('#dimGradationEndColorPicker').val($(_this.btnList['gradationEndInput']).val())};this.resetBackgroundDim=function(t){if(!t){t=this.block};var e=this.getTargetDim(this.target);this.removeDim($(e))}};bm.extend(ToolBtnBase,ToolBtnDomBackgroundDim);ToolBtnDomBackgroundDim.prototype.setStyleBtn=function(){var e=this,n=this.getTargetDim(this.target);if(!e.target||e.target.length===0||$(n).length===0){if(isExpertMode){bm.toolManager.toolList['ToolDomBackgroundDim'].openControl(null,!1)};e.resetStyleBtn();return!1};var t=this.getBgColor(n),o=t.bgColor,a=t.bgImg,i=t.pointClass;if(o!=='rgba(0, 0, 0, 0)'){this.showTab('color',!0)}
else if(i!==''){this.showTab('pointColor',!0);this.setPointColor(i)}
else{this.showTab('backgroundGradation',!0)};if(t.isNone===!0){bm.toolManager.toolList['ToolDomBackgroundDim'].openControl(null,!1)}
else{bm.toolManager.toolList['ToolDomBackgroundDim'].openControl(null,!0)}};ToolBtnDomBackgroundDim.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)};this.setStyleBtn()};ToolBtnDomBackgroundDim.prototype.addEvent=function(){var t=this;this.gradationCon.find('input').on('keyup',function(e){if(e.keyCode===13){t.gradationApply()}});$(this.btnList['gradationDegreeInput']).on('keydown',function(e){var i=Number($(this).val());if(e.keyCode===13){e.preventDefault();bm.selectionManager.restoreRange();if(bm.valid.isOnlyNum(i)){if(i>360){$(this).val(90);t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc(90deg))');bm.toast('각도는 -360도에서 360도까지 가능합니다.');$(this).select();return!1}}
else if(i<0){if(i<-360){$(this).val(90);t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc(90deg))');$(this).select();bm.toast('각도는 -360도에서 360도까지 가능합니다.');return!1}}
else{$(this).focus();$(this).val(90);t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc(90deg))');$(this).select();bm.toast('숫자를 입력해주세요.');return!1}}});this.gradationCon.find('input[name="gradationOpacity"]').on('keydown',function(t){var e=parseFloat($(this).val());if(t.keyCode===13){t.preventDefault();bm.selectionManager.restoreRange();if(bm.valid.isOnlyNum(e)){if(e<0||e>100){$(this).val(0);$(this).select();bm.toast('투명도는 0에서 100까지 가능합니다.');return!1}}
else{$(this).focus();$(this).val(0);$(this).select();bm.toast('숫자를 입력해주세요.');return!1}}});this.onOptionShow=function(t,e){if(!this.target||this.target.length){this.resetStyleBtn();return!1}};this.gradationCon.find('#dimGradationStartColorPicker').on('change',function(){if($(t.btnList['gradationStartOpacityInput']).val()==''){$(t.btnList['gradationStartOpacityInput']).val('100%')};t.gradationCon.find('[data-wv-tool-btn-prop="gradationStartInput"]').val($(this).val().toUpperCase()).trigger($.Event('keyup',{keyCode:13}))});this.gradationCon.find('#dimGradationEndColorPicker').on('change',function(){if($(t.btnList['gradationEndOpacityInput']).val()==''){$(t.btnList['gradationEndOpacityInput']).val('100%')};t.gradationCon.find('[data-wv-tool-btn-prop="gradationEndInput"]').val($(this).val().toUpperCase()).trigger($.Event('keyup',{keyCode:13}))});$('#dimfillColorPicker').on('change',function(){$(t.btnList['fillColorInput']).val($(this).val().toUpperCase());var e=bm.number.hexToRgb($(this).val()),i=$(t.btnList['fillColorOpacityInput']).val().replace('%','');e.a=parseFloat(i)/100;e=bm.number.rgbaObjToStr(e);t.onOptionChange('color',e)});if(isExpertMode){$(this.btnList['fillColorInput']).on('keydown',function(e){if(e.keyCode==13){var i=this.value;if(bm.number.isHex(i)==!1){bm.toast('올바른 색상코드를 입력해주세요.');return!1};t.onOptionChange('color',i)}});$(this.btnList['fillColorOpacityInput']).on('keydown',function(e){if(e.keyCode==13){var n=parseInt(this.value);if(n<0||n>100){bm.toast('테두리 색상 투명도는 0부터 100 사이 값만 적용할 수 있습니다.');return!1};var i=bm.number.hexToRgb($(t.btnList['fillColorInput']).val());if(isExpertMode){i.a=parseFloat(n)/100}
else{i.a=(100-parseFloat(n))/100};var o='rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')';t.onOptionChange('color',o)}});$(this.btnList['fillColorOpacityInput']).on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)||!/^\d+(%{0,1})$/.test(t)){$(this).val(0);bm.toast('숫자를 입력해주세요.');return!1}})}};ToolBtnDomBackgroundDim.prototype.removeEvent=function(){var t=this};ToolBtnDomBackgroundDim.prototype.resetProperty=function(){this.resetBackgroundDim(this.target)};var ToolBtnDomBackground=function(t){var e=this;this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);this.defaultColor='#ffffff';var i=$('[data-wv-toolset=ToolDomBackground]');this.fillColorCon=i.find('#fillColorCon');this.pointColorCon=i.find('#pointColorCon');this.gradationCon=i.find('#gradationCon');this.imageCon=i.find('#backgroundCon');this.bgImgSizeSelect=app.getWvCom('backgroundSizeSelect');this.addOption(this.colorPicker,'fillColorExpand',this);this.addOption(this.colorPicker,'pointColorExpand',this);this.onBtnClick=function(t,i){switch(i){case'none':case'reset':$(this.btnList).removeClass('active');$(this.btnList['prop']).addClass('active');this.none(this.target);break;case'color':case'backgroundGradation':case'pointColor':case'image':this.showTab(i);break;case'select':var n=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(n).css('max-width','1600px');$(n).css('max-height','1200px');$(n).css('border-radius','8px');$(n).on('load',function(){n.contentWindow.fileManager.onSelectCallBack=e.onFileManagerFileSelected});break;case'delete':this.onOptionChange('background-delete',{'background-image':'none'});break;case'repeat':if($(this.btnList[i]).hasClass('active')){this.onOptionChange('background-repeat',{'background-repeat':'no-repeat'});$(this.btnList[i]).removeClass('active')}
else{this.onOptionChange('background-repeat',{'background-repeat':'repeat'});$(this.btnList[i]).addClass('active')};break;case'parallax':if($(this.btnList[i]).hasClass('active')){this.onOptionChange('background-attachment',{'background-attachment':'unset'});bm.toast('Parallax기능이 해제되었습니다.');$(this.btnList[i]).removeClass('active')}
else{this.onOptionChange('background-attachment',{'background-attachment':'fixed'});bm.toast('Parallax기능이 적용되었습니다.');$(this.btnList[i]).addClass('active')};break;case'0%_0%':case'50%_0%':case'100%_0%':case'0%_50%':case'50%_50%':case'100%_50%':case'0%_100%':case'50%_100%':case'100%_100%':this.imageCon.find('.background_position_view').removeClass('active');var o=i.split('_')[0],a=i.split('_')[1],s=$(e.btnList['imgPosLeft']).val()!=0?' + '+$(e.btnList['imgPosLeft']).val()+'px':'',r=$(e.btnList['imgPosTop']).val()!=0?' + '+$(e.btnList['imgPosTop']).val()+'px':'';o='calc('+o+s+')';a='calc('+a+r+')';this.onOptionChange('background-position',{'background-position':o+' '+a});$(this.btnList[i]).addClass('active');break;case'lib_name':this.optionList['fillColorExpand'].showComponent(this.optionList['fillColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['fillColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['fillColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}};this.onOptionChange=function(t,e,n,o){var T=this,h=[];h.push(this.target);if(bm.toolManager.isMultiSelectMode){h=bm.toolManager.targetElementList.concat()};var r={};var u,f;if(t.includes('background')){if(t=='background-select'||t=='background-delete'||t=='backgroundGradation'){u=HistoryType.EDITOR_DOM_BACKGROUND_IMAGE;f='backgroundImage'}
else if(t=='background-repeat'){u=HistoryType.EDITOR_DOM_BACKGROUND_REPEAT;f='backgroundRepeat'}
else if(t=='background-size'){u=HistoryType.EDITOR_DOM_BACKGROUND_SIZE;f='backgroundSize';if(e['background-size']==='fill'){this.setBackgroundFillImg(h);return}
else{this.removeBackgroundFillImg(h)}}
else if(t=='background-attachment'){u=HistoryType.EDITOR_DOM_BACKGROUND_PARALLAX;f='backgroundAttachment'}
else{u=HistoryType.EDITOR_DOM_BACKGROUND_POSITION;f='backgroundPosition'}}
else if(t.includes('ToolOpColorPicker')){u=HistoryType.EDITOR_DOM_BACKGROUND_COLOR;f='backgroundColor';if(!e){bm.toast('컬러를 선택해주세요.');return!1};if(typeof(e)=='object'){var y=e.a*100,d=y>100?100:parseInt(y)/100,g='rgba('+e.r+', '+e.g+', '+e.b+', '+d+')',e=bm.number.rgbToHex('rgba('+e.r+','+e.g+','+e.b+','+e.a+')')}
else if(e.includes('#')===!0&&n!==!0){if(isNaN(parseInt($(this.colorPicker.element).find('.color_input.opacity').val()))){var d=1}
else{var d=parseInt($(this.colorPicker.element).find('.color_input.opacity').val())/100}}
else{var d=parseInt($(i).find('input.color_input.opacity').val())/100};var w=!1;if($(h).closest('[data-wv-tab]').length>0){w=!0;var b=[];$(h).each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(b.indexOf(t)===-1)b.push(t)})};$(this.btnList['fillColorInput']).val(e.toUpperCase());$('#fillColorPicker').val('#'+e.replaceAll('#',''));$(this.btnList['fillColorOpacityInput']).val(d+'%');$(this.colorPicker.element).find('input.color_option_prev').val('#'+e.replaceAll('#',''))}
else if(t.includes('WVLocalStyle')){if(t.includes('apply')){this.optionList['fillColorExpand']['componentList']['WVLocalStyle'].apply(t,e,this)}
else if(t.includes('delete')){this.optionList['fillColorExpand']['componentList']['WVLocalStyle'].delete(t,e,this)};return!0}
else if(t.includes('color')){u=HistoryType.EDITOR_DOM_BACKGROUND_COLOR;f='backgroundColor';if(!e){bm.toast('컬러를 선택해주세요.');return!1};var y=isNaN(parseInt($(this.btnList['fillColorOpacityInput']).val().replace('%','')))?100:parseInt($(this.btnList['fillColorOpacityInput']).val().replace('%',''));if(y=='')y=100;var d=y>100?100:parseInt(y)/100,w=!1;if($(h).closest('[data-wv-tab]').length>0){w=!0;var b=[];$(h).each(function(){var t=$(this).closest('[data-wv-layout-element-type="tab"]').attr('data-wv-res-id');if(b.indexOf(t)===-1)b.push(t)})};if($(T.btnList['fillColorInput']).val()==''){$(T.btnList['fillColorInput']).val(e.toUpperCase().replaceAll('#',''))}};var m=this.getSamplingElement(h);r[f]=bm.getStyle(m,f);bm.toolManager.toolBtnEditBefore(this,m,u,r);var c=null;if(bm.bmEditorManager.registedBoardEditor===!1){c=WVAdminResourceManager.getEmbededStyleObject(null,m)};var l,s,S=h.length;if(t.includes('background')&&t!=='backgroundGradation'){var C=[];for(l=0;l<S;l++){s=h[l];if(t==='background-delete'){if(s){s.style.removeProperty('height');s.style.removeProperty('padding-top');$(s).removeAttr('data-wv-fill-bg-block');if($(s).find('[data-wv-background-dim]').length>0){C.push($(s).find('[data-wv-background-dim]')[0])};if(o===!0){bm.toast('Background기능이 삭제되었습니다.')};r=e}};if(f==='backgroundImage'&&$(s).find('.video-bg-wrap').length>0){this.removeVideo($(s))};c.applyResourceStyle($(s),e,!1,!0,!0,!0,[],!1)};if(t==='delete'&&C.length>0){this.removeBackgroundDim(C)}}
else if(t.includes('color')||t=='backgroundGradation'||t.includes('ToolOpColorPicker')){var a=null,g=null,p=bm.toolManager.menuTargetSelector,v=wvAdminIFrameBridge._WVContentArea.$contentBody;if(w&&c){if(e.indexOf('applyPoint')>-1){if(confirm('탭 블록 메뉴에 포인트 컬러 반영 시 현재 페이지에서만 반영이 됩니다.\n 반영하시겠습니까?')){a=bm.number.hexToRgb(this.optionList['color'].cssPointColors[e.replace('applyPoint','')]);g=d===1?e:'rgba('+a.r+', '+a.g+', '+a.b+', '+a['a']?a['a']/100:d+') !important;'}
else{return}}
else{a=bm.number.hexToRgb(e);g=d===1?e:'rgba('+a.r+', '+a.g+', '+a.b+', '+a['a']?a['a']/100:d+')';if(e!=='transparent'&&bm.getStyle(m,'backgroundImage')!=='none'){r['backgroundImage']='none'}};r={backgroundColor:g};var k=bm.toolManager.isTabActiveStyle?'.active':'';for(l=0;l<b.length;l++){var E='[data-wv-res-id="'+b[l]+'"] [data-wv-tab-list] [data-wv-tab]'+k;c.applyResourceStyle(E,r,!1,!0,!0,!0,[],!1)}}
else if(typeof(e)==='string'&&e.indexOf('applyPoint')>-1){var B=e.replace('applyPoint',''),x='bg_point'+B;if(e!='transparent'&&!e.includes('gradient')&&bm.getStyle(m,'backgroundImage')!='none'){r['backgroundImage']='none'};if(d===1){for(l=0;l<S;l++){s=h[l];if(bm.toolManager.isMenuTarget){v.find(p).removeClass('bg_point0');v.find(p).removeClass('bg_point1');v.find(p).removeClass('bg_point2');v.find(p).addClass(x);c.applyResourceStyle(p,r,!1,!0,!1,!1)}
else{$(s).removeClass('bg_point0');$(s).removeClass('bg_point1');$(s).removeClass('bg_point2');$(s).addClass(x);c.applyResourceStyle($(s),r,!1,!0)}}}
else{}}
else{if(e!=='transparent'&&(typeof(e)=='string'&&!e.includes('gradient'))){a=bm.number.rgbaToObj(e);g='rgba('+a.r+', '+a.g+', '+a.b+', '+d+')'}
else{g=e};const strValue=bm['number'].rgbaObjToStr(e);if(strValue['length']!==7&&strValue.includes('gradient')){r['backgroundImage']=e;r['backgroundColor']='transparent'}
else{typeof(e)=='string'?a=bm.number.rgbaToObj(e):a=e;g='rgba('+a.r+', '+a.g+', '+a.b+', '+d+')';r={backgroundColor:g}};if(strValue!='transparent'&&!strValue.includes('gradient')&&bm.getStyle(m,'backgroundImage')!='none'){r['backgroundImage']='none'};if(strValue==='transparent'&&bm.getStyle(m,'backgroundImage').includes('gradient')){r['backgroundImage']='none'};for(l=0;l<S;l++){s=h[l];if(bm.toolManager.isMenuTarget){v.find(p).removeClass('bg_point0');v.find(p).removeClass('bg_point1');v.find(p).removeClass('bg_point2');c.applyResourceStyle(p,r,!1,!0,!1,!1)}
else{$(s).removeClass('bg_point0');$(s).removeClass('bg_point1');$(s).removeClass('bg_point2');c.applyResourceStyle($(s),r,!1,!0,!0,!0,[],!1)}};if(t==='backgroundGradation'){$('#gradationStartColorPicker').val('#'+$(T.btnList['gradationStartInput']).val().replaceAll('#',''));$('#gradationEndColorPicker').val('#'+$(T.btnList['gradationEndInput']).val().replaceAll('#',''))}}};if(c)c.refreshStyleElementText();if(d)$(this.btnList['fillColorOpacityInput']).val((d*100)+'%');if(typeof(e)==='string'&&bm.number.isHex(e)===!0){this.btnList['fillColorInput'].value=e.toUpperCase().replaceAll('#','')};bm.toolManager.toolBtnEditAfter(this,m,u,r);this.displayResetBtn()};this.showTab=function(t,i){this.fillColorCon.hide();this.pointColorCon.hide();this.gradationCon.hide();this.imageCon.hide();var n,o=!1;if(t==='none'){this.none(this.target)}
else if(t==='color'){this.fillColorCon.show();n=$('#fillColorPicker').val();if(i){this.setBgColor()}}
else if(t==='pointColor'){this.pointColorCon.show();this.setPointColor()}
else if(t==='backgroundGradation'){this.gradationCon.show();n=this.gradationCon.find('.gradation_box').css('backgroundImage');if(i){this.setGradation()}
else{if(n.includes('linear-gradient')==!1){this.setGradation(null,!0);o=!0}}}
else if(t==='image'){this.imageCon.show();this.setBgImage()};if(!i&&!o&&t!='image'&&t!=='none'){if(bm.number.isHex(n)){e.onOptionChange(t,n.toUpperCase())}
else{e.onOptionChange(t,n)}};$('#backgroundTabCon').find('[data-wv-tool-btn-prop]').removeClass('active');$('#backgroundTabCon').find('[data-wv-tool-btn-prop='+t+']').addClass('active');this.tabStatus=t;if(this.optionList['fillColorExpand']&&this.optionList['fillColorExpand'].componentList&&this.optionList['fillColorExpand'].componentList['WVLocalStyle']){this.optionList['fillColorExpand'].componentList['WVLocalStyle'].setStyleComp(this)}};this.showColorPicker=function(t){if(this.colorPicker.status==1){this.colorPicker.deactive();this.showColorPicker(t)}
else if(this.colorPicker.status==0){var i;if(t){i=this.pointColorCon[0];this.colorPicker.element.find('.layer_title').text('Point Color')}
else{i=this.fillColorCon[0];this.colorPicker.element.find('.layer_title').text('Fill Color')};this.colorPicker.active(i,function(t,i){e.onOptionChange('color',i)});this.colorPicker.element.removeClass('input_layer_con');this.colorPicker.element.show();this.colorPicker.element.css('margin-right',0)}};this.getBgColor=function(){var n='',s='',i='',o=!0;const bgColornarrow=(target)=>{try{const $document=document.WEVEN_IFRAME?document.WEVEN_IFRAME.document:document;if($document.defaultView.getComputedStyle){if($document.defaultView.getComputedStyle(target,null).getPropertyValue('background-color')!=='rgba(0, 0, 0, 0)'){o=!1};if($document.defaultView.getComputedStyle(target,null).getPropertyValue('background-image')!=='none'){o=!1};if(o===!0){return{bgColor:'rgba(217, 217, 217, 1)',bgImg:'linear-gradient(90deg, rgba(0, 0, 0, 1), rgba(255, 255, 255, 1))'}}
else{return{bgColor:bm.number.rgbaObjToStr(bm.number.rgbaToObj($(target).css('background-color'))),bgImg:$(target).css('background-image')}}}}catch(t){console.warn(t)}};if(!bm.toolManager.isMultiSelectMode){if($(e.target).hasClass('bg_point0')){i='bg_point0'}
else if($(e.target).hasClass('bg_point1')){i='bg_point1'}
else if($(e.target).hasClass('bg_point2')){i='bg_point2'};n=bgColornarrow(e.target)['bgColor'];bgImg=bgColornarrow(e.target)['bgImg']}
else{var a=!0;$(e.target).each(function(){if($(this).hasClass('bg_point0')){i='bg_point0'}
else if($(this).hasClass('bg_point1')){i='bg_point1'}
else if($(this).hasClass('bg_point2')){i='bg_point2'};if(n==''){n=bgColornarrow(this)['bgColor']}
else{s=bgColornarrow(this)['bgColor'];if(n!=s){a=!1;return}};bgImg=bgColornarrow(this)['bgImg']});if(!a)n=this.defaultColor};return{bgColor:n,bgImg:bgImg,pointClass:i,isNone:o}};this.setBgColor=function(t){if(!t)t=this.getBgColor().bgColor;var e,i=0;if(typeof(t)==='string'&&t.indexOf('#')!=-1){e=t}
else{if(typeof(t)==='object'){t=bm.number.rgbaObjToStr(t)};if(parseFloat(t.split(',')[3])){if(isExpertMode){i=parseFloat(t.split(',')[3])}
else{i=parseFloat((1-parseFloat(t.split(',')[3])).toFixed(2))}}
else{i=isNaN(parseFloat($(this.btnList['fillColorOpacityInput']).val()))?1:parseFloat($(this.btnList['fillColorOpacityInput']).val())/100};e=bm.number.rgbToHex(t)};var n=bm.number.hexToRgb(e);$(this.btnList['fillColorInput']).val(e.toUpperCase().replaceAll('#',''));$('#fillColorPicker').val(e);$(this.btnList['fillColorOpacityInput']).val(i*100+'%');this.colorPicker.setStyleValue(n.r,n.g,n.b,i)};this.setPointColor=function(t){if(!t)t=this.getBgColor().pointClass;if(t){var e=parseInt(t.replace('bg_point',''));bgColor=bm.number.hexToRgb(this.defaultColor);this.colorPicker.setStyleValue(rgb.r,rgb.g,rgb.b,0,e)}};this.setGradation=function(t,i){if(!t)t=bm.getStyle(this.target,'background-image');if(t!=='none'&&t.includes('linear-gradient')&&!i){var n,o,a,s;if(t.includes('deg')){n=t.split('linear-gradient')[1];o=n.split('deg,')[0].replace('(','');a=n.split('),')[0].split('deg,')[1]+')';s=n.split('),')[1].replace(')','')}
else{n=t.split('linear-gradient(')[1];o=90;a=n.split('),')[0]+')';s=n.split('),')[1].replace(')','')};var l=bm.number.rgbToHex(a),d=bm.number.rgbToHex(s);$(this.btnList['gradationStartInput']).val(l.toUpperCase().replaceAll('#',''));$(this.btnList['gradationEndInput']).val(d.toUpperCase().replaceAll('#',''));$('#gradationStartColorPicker').val(l);$('#gradationEndColorPicker').val(d);$(this.btnList['gradationStartOpacityInput']).val(bm.number.rgbaToObj(a).a*100+'%');$(this.btnList['gradationEndOpacityInput']).val(bm.number.rgbaToObj(s).a*100+'%');$(this.btnList['gradationDegreeInput']).val(o);e.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc('+o+'deg - 90deg))');e.setGradationBar('linear-gradient('+(o+'deg, ')+a+', '+s+')')}
else{$(this.btnList['gradationStartInput']).val('000000');$(this.btnList['gradationEndInput']).val('FFFFFF');$('#gradationStartColorPicker').val('#000000');$('#gradationEndColorPicker').val('#FFFFFF');$(this.btnList['gradationStartOpacityInput']).val('100%');$(this.btnList['gradationEndOpacityInput']).val('100%');$(this.btnList['gradationDegreeInput']).val(90);e.gradationCon.find('.gradation_box').css({backgroundImage:'linear-gradient(90deg, rgba(0,0,0,1), rgba(255,255,255,1)'});e.gradationCon.find('.gradation_degree_angle').css('transform','');var r='linear-gradient(90deg, RGBA(0, 0, 0, 1), RGBA(255, 255, 255, 1))';e.setGradationBar(r);e.onOptionChange('backgroundGradation',r)}};this.setGradationBar=function(t){this.gradationCon.find('.gradation_box').css({backgroundImage:t})};this.setBgImage=function(){var d=['background-repeat','background-size','background-attachment','background-position'],p=this.imageCon,h=$(this.btnList['repeat']),c=$(this.btnList['parallax']),f=p.find('.background_position_view_wrap');for(var a=0;a<d.length;a++){var t='',i=d[a];if(i=='background-repeat'){t=$(e.target).css('background-repeat');if(t==='repeat'){h.addClass('active')}
else{h.removeClass('active')}}
else if(i=='background-size'){t=$(e.target).css('background-size');if(t==='cover'||t==='contain'){this.bgImgSizeSelect.setSelectedIndexAtValue(t)}
else if($(e.target).attr('data-wv-fill-bg-block')!==undefined){this.bgImgSizeSelect.setSelectedIndexAtValue('fill')}
else{this.bgImgSizeSelect.setSelectedIndexAtValue('auto')}}
else if(i=='background-attachment'){t=$(e.target).css('background-attachment');if(t==='fixed'){c.addClass('active')}
else{c.removeClass('active')}}
else if(i=='background-position'){var n=$(e.target).css('backgroundPositionX'),o=$(e.target).css('backgroundPositionY'),r=this.extractPercentage(n)+'%',l=this.extractPercentage(o)+'%';if(r!=''&&l!=''){var s=$(this.btnList[r+'_'+l]);$(e.btnList['imgPosLeft']).val(this.extractPx(n)!==0?this.extractPx(n):0);$(e.btnList['imgPosTop']).val(this.extractPx(o)!==0?this.extractPx(o):0);f.children().removeClass('active');if(s.length>0)$(s).addClass('active')}
else{$(e.btnList['imgPosLeft']).val(0);$(e.btnList['imgPosTop']).val(0);f.children().removeClass('active')}}}};this.setBackgroundFillImg=function(t){for(var e=0;e<t.length;e++){i=t[e];if($(i).find('[data-wv-res-id]').length>0){bm.toast('이미지 내부에 요소가 있는 경우에는 적용할 수 없습니다.');return}};bm.toolManager.toolBtnEditBefore(this,t[0],HistoryType.EDITOR_DOM_BACKGROUND_SIZE_FILL);var i;for(var e=0;e<t.length;e++){i=t[e];var o=new Image(),a=bm.getStyle(i,'background-image'),s=a.match(/http[^")\s]+/)[0];o.src=s;var n=o.naturalHeight/o.naturalWidth;if(n>0){n=o.naturalHeight/o.naturalWidth*100;n=n.toFixed(2)+'%';i.style.setProperty('height','auto','important');i.style.setProperty('padding-top',n,'important');$(i).attr('data-wv-fill-bg-block','')}};bm.toolManager.toolBtnEditAfter(this,t[0],HistoryType.EDITOR_DOM_BACKGROUND_SIZE_FILL);bm.toolManager.kitReposition()};this.removeBackgroundFillImg=function(t){bm.toolManager.toolBtnEditBefore(this,t[0],HistoryType.EDITOR_DOM_BACKGROUND_SIZE_FILL);var e;for(var i=0;i<t.length;i++){e=t[i];e.style.removeProperty('height');e.style.removeProperty('padding-top');$(e).removeAttr('data-wv-fill-bg-block')};bm.toolManager.toolBtnEditAfter(this,t[0],HistoryType.EDITOR_DOM_BACKGROUND_SIZE_FILL);bm.toolManager.kitReposition()};this.removeVideo=function(t){var a=wvAdminIFrameBridge._WVContentArea.$content;bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO);for(var o=0;o<t.length;o++){var i=t[o];if($(i).find('.video-bg-wrap').length>0){$(i).find('.video-bg-wrap').remove()};if(bm.getStyle(i,'backgroundImage')==='none'){$(i).css('background-image','')};if($(i).attr('data-wv-layout-element-param')){var e=JSON.parse($(i).attr('data-wv-layout-element-param').replace(/'/g,'"'));if(e.videoType)delete e.videoType;if(e.videoId)delete e.videoId;if(e.videoSrc)delete e.videoSrc;if(e.videoLoop)delete e.videoLoop;if(e.videoAutoplay)delete e.videoAutoplay;if(Object.keys(e).length===0){e=''}
else{e=JSON.stringify(e).replace(/"/g,'\'')}};$(i).attr('data-wv-layout-element-param',e);var n=$(i).attr('data-wv-res-id');if(a.find('script[data-block-js=\''+n+'\']').length===1){a.find('script[data-block-js=\''+n+'\']').remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[n]}};bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_VIDEO)};this.removeBackgroundDim=function(t){if(t.length>0){var o=this.getSamplingElement(t),s={backgroundImage:bm.getStyle(o,'backgroundImage'),backgroundColor:bm.getStyle(o,'backgroundColor')};var i=null;if(bm.bmEditorManager.registedBoardEditor===!1){i=WVAdminResourceManager.getEmbededStyleObject(null,o)};if(i){bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_DOM_BACKGROUND_DIM,s);var a=wvAdminIFrameBridge._WVContentArea.$content,e,n;$(t).each(function(){e=$(this).attr('data-wv-res-id');n='[data-wv-res-id="'+e+'"]';$(this).remove();if(i.styleElement.outerHTML.indexOf(n)>0){i.deleteRuleBySelector(n,!1,!0)};if(a.find('script[data-block-js=\''+e+'\']').length===1){a.find('script[data-block-js=\''+e+'\']').remove();delete wvAdminIFrameBridge.iframeWindow.wevenBlock[e]}});i.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_DOM_BACKGROUND_DIM,s)}}};this.onFileManagerFileSelected=function(t,i){const e=wvAdminIFrameBridge.toolManager.toolList['ToolDomBackground']['toolBtnList']['ToolBtnDomBackground'];bm.popupManager.removePopLatest();var c=t.extension.toLowerCase(),f=new RegExp('jpg|jpeg|gif|png');if(f.test(c)){var r=t.thumbImg;if(!this.target)this.target=e.target;var n={'background-image':$(e.target).css('background-image')};bm.toolManager.toolBtnEditBefore(e,e.target,HistoryType.EDITOR_DOM_BACKGROUND_IMAGE,n);n={'background-image':'url(\''+r+'\')'};var a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,e.target)};a.applyResourceStyle(e.target,n,!1,!0,!1,!0,[],!1);a.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(e,e.target,HistoryType.EDITOR_DOM_BACKGROUND_IMAGE,n);if($(e.target).closest('[data-wv-swiper-con]').length>0){var h=$(e.target).closest('[data-wv-swiper-con]').attr('data-wv-res-id');for(var o=0;o<wvAdminIFrameBridge._WVContentArea.innerWindow.bm.swiper.list.length;o++){var s=wvAdminIFrameBridge._WVContentArea.innerWindow.bm.swiper.list[o];if(s['res-id']==h){var l=$(s['el']).find('.swiper-slide').index($(e.target).closest('.swiper-slide')),d=$('.thumb_con .thumb_img_list')[l];$(d).css({'background-image':'url(\''+r+'\')'})}}}}
else{alert('배경이미지 변경을 위해 이미지를 선택해주세요.')}};this.extractPercentage=function(t){const regex=/(\d+)%/g;const percentages=[];let match;while((match=regex.exec(t))){percentages.push(match[1])};return percentages};this.extractPx=function(t){const pxRegex=/([\d.]+)px/;const match=t.match(pxRegex);if(match){const pxValue=parseFloat(match[1]);if(t.includes('-')){return-pxValue}
else{return pxValue}};return 0};this.none=function(){this.fillColorCon.hide();this.pointColorCon.hide();this.gradationCon.hide();this.imageCon.hide();this.resetBackground(this.target,!1)};this.resetBackground=function(t,i){var n=e.getSamplingElement($(this.target));const historyType=HistoryType.EDITOR_DOM_BACKGROUND_IMAGE;const css={'background-image':'none','background-color':'transparent'};this.onOptionChange('background-delete',css,!1,i);$(this.btnList['fillColorInput']).val('#D9D9D9');$('#fillColorPicker').val('#D9D9D9');$(this.btnList['fillColorOpacityInput']).val('100%');$(this.btnList['gradationStartInput']).val('000000');$(this.btnList['gradationEndInput']).val('FFFFFF');$('#gradationStartColorPicker').val('#000000');$('#gradationEndColorPicker').val('#FFFFFF');$(this.btnList['gradationStartOpacityInput']).val('100%');$(this.btnList['gradationEndOpacityInput']).val('100%');$(this.btnList['gradationDegreeInput']).val(90);this.gradationCon.find('.gradation_box').css({backgroundImage:'linear-gradient(90deg, rgba(0,0,0,1), rgba(255,255,255,1)'})}};bm.extend(ToolBtnBase,ToolBtnDomBackground);ToolBtnDomBackground.prototype.resetStyleBtn=function(){};ToolBtnDomBackground.prototype.setStyleBtn=function(){var i=this;if(!i.target||i.target.length===0){i.resetStyleBtn();return!1};var e=this.getBgColor(),n=e.bgColor,o=e.pointClass,t=bm.getStyle(this.target,'background-image');let isColor=!1;if(n&&t.includes('linear-gradient')==!1&&t.includes('url("http')==!1){isColor=!0;this.showTab('color',!0);this.setBgColor(n)}
else if(o!==''){this.showTab('pointColor',!0);this.setPointColor(o)}
else{if(t!=='none'){if(t.includes('linear-gradient')){this.showTab('backgroundGradation',!0);this.setGradation(t)}
else{this.showTab('image',!0);this.setBgImage()}}};if((t==='none'||t===undefined)&&e.isNone===!0){bm.toolManager.toolList['ToolDomBackground'].openControl(null,!1)}
else{bm.toolManager.toolList['ToolDomBackground'].openControl(null,!0)};this.displayResetBtn()};ToolBtnDomBackground.prototype.displayResetBtn=function(){if(bm.getStyle(this.target,'background-image')==='none'&&this.getBgColor().isNone===!0){$(this.btnList['reset']).hide()}
else{$(this.btnList['reset']).show()}};ToolBtnDomBackground.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnDomBackground.prototype.addEvent=function(){var t=this;this.gradationCon.find('input').on('keyup',function(e){if(e.keyCode===13){var r=$(t.btnList['gradationDegreeInput']).val(),i=bm.number.hexToRgb($(t.btnList['gradationStartInput']).val()),n=bm.number.hexToRgb($(t.btnList['gradationEndInput']).val()),l=$(t.btnList['gradationStartOpacityInput']).val(),d=$(t.btnList['gradationEndOpacityInput']).val();if(l==''){$(t.btnList['gradationStartOpacityInput']).val('0%');var a=0}
else{a=parseFloat(l)};if(d==''){$(t.btnList['gradationEndOpacityInput']).val('0%');var o=0}
else{o=parseFloat(d)};$(t.btnList['gradationStartOpacityInput']).val(a+'%');$(t.btnList['gradationEndOpacityInput']).val(o+'%');var f=(a)/100,o=(o)/100;t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc('+r+'deg - 90deg))');if(i==null&&n!==null){i=n;$(t.btnList['gradationStartInput']).val($(t.btnList['gradationEndInput']).val());$('#gradationStartColorPicker').val($(t.btnList['gradationEndInput']).val())};if(n==null&&i!==null){n=i;$(t.btnList['gradationEndInput']).val($(t.btnList['gradationStartInput']).val());$('#gradationEndColorPicker').val($(t.btnList['gradationStartInput']).val())};if(i!==null&&n!==null){var h='RGBA('+i.r+', '+i.g+', '+i.b+', '+f+')',c='RGBA('+n.r+', '+n.g+', '+n.b+', '+o+')',s='linear-gradient('+r+'deg, '+h+', '+c+')';t.setGradationBar(s);t.onOptionChange('backgroundGradation',s)}}});$(this.btnList['gradationDegreeInput']).on('keydown',function(e){var i=Number($(this).val());if(e.keyCode===13){e.preventDefault();bm.selectionManager.restoreRange();if(bm.valid.isOnlyNum(i)){if(i>360){$(this).val(90);t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc(90deg))');bm.toast('각도는 -360도에서 360도까지 가능합니다.');$(this).select();return!1}}
else if(i<0){if(i<-360){$(this).val(90);t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc(90deg))');$(this).select();bm.toast('각도는 -360도에서 360도까지 가능합니다.');return!1}}
else{$(this).focus();$(this).val(90);t.gradationCon.find('.gradation_degree_angle').css('transform','rotate(calc(90deg))');$(this).select();bm.toast('숫자를 입력해주세요.');return!1}}});this.gradationCon.find('input[name="gradationOpacity"]').on('keydown',function(t){var e=parseFloat($(this).val());if(t.keyCode===13){t.preventDefault();bm.selectionManager.restoreRange();if(bm.valid.isOnlyNum(e)){if(e<0||e>100){$(this).val(0);$(this).select();bm.toast('투명도는 0에서 100까지 가능합니다.');return!1}}
else{$(this).focus();$(this).val(0);$(this).select();bm.toast('숫자를 입력해주세요.');return!1}}});this.imageCon.find('input[name=backgroundImagePosition]').on('keydown',function(e){var a=$(this).val();if(e.keyCode===13){if($.isNumeric(a)===!1){bm.toast('숫자를 입력해주세요.');$(this).select();return!1};var i=t.imageCon.find('.background_position_view.active'),n=t.extractPercentage(i.attr('data-wv-tool-btn-prop'))[0]+'%',o=t.extractPercentage(i.attr('data-wv-tool-btn-prop'))[1]+'%';t.onOptionChange('background-position',{'background-position':'calc('+n+' + '+$(t.btnList['imgPosLeft']).val()+'px) calc('+o+' + '+$(t.btnList['imgPosTop']).val()+'px)'})}});try{if(this.bgImgSizeSelect){this.bgImgSizeSelect.onChangeComplete=function(){t.onOptionChange('background-size',{'background-size':this.val()})}}
else{setTimeout(function(){wvAdminIFrameBridge.toolManager.toolList['ToolDomBackground'].toolBtnList['ToolBtnDomBackground'].bgImgSizeSelect.onChangeComplete=function(){t.onOptionChange('background-size',{'background-size':this.val()})}},150)}}catch(e){throw e};this.gradationCon.find('#gradationStartColorPicker').on('change',function(){if($(t.btnList['gradationStartOpacityInput']).val()==''){$(t.btnList['gradationStartOpacityInput']).val('100%')};t.gradationCon.find('[data-wv-tool-btn-prop="gradationStartInput"]').val($(this).val().toUpperCase().replaceAll('#','')).trigger($.Event('keyup',{keyCode:13}))});this.gradationCon.find('#gradationEndColorPicker').on('change',function(){if($(t.btnList['gradationEndOpacityInput']).val()==''){$(t.btnList['gradationEndOpacityInput']).val('100%')};t.gradationCon.find('[data-wv-tool-btn-prop="gradationEndInput"]').val($(this).val().toUpperCase().replaceAll('#','')).trigger($.Event('keyup',{keyCode:13}))});$('#fillColorPicker').on('change',function(){if($(t.btnList['fillColorOpacityInput']).val()==''){$(t.btnList['fillColorOpacityInput']).val('100%')};$(t.btnList['fillColorInput']).val($(this).val().toUpperCase().replaceAll('#',''));var e=bm.number.hexToRgb($(this).val()),i=$(t.btnList['fillColorOpacityInput']).val().replace('%','');e.a=parseFloat(i)/100;t.onOptionChange('color',e)});if(isExpertMode){$(this.btnList['fillColorInput']).on('keydown',function(e){if(e.keyCode==13){var i=this.value;if(bm.number.isHex(i)===!1){bm.toast('올바른 색상코드를 입력해주세요.');return!1};t.onOptionChange('color',i);$('#fillColorPicker').val('#'+i.toUpperCase().replaceAll('#',''))}});$(this.btnList['fillColorOpacityInput']).on('keydown',function(e){if(e.keyCode==13){var n=parseInt(this.value);if(n<0||n>100){bm.toast('테두리 색상 투명도는 0부터 100 사이 값만 적용할 수 있습니다.');return!1};var i=bm.number.hexToRgb($(t.btnList['fillColorInput']).val());if(isExpertMode){i.a=parseFloat(n)/100}
else{i.a=(100-parseFloat(n))/100};var o='rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')';t.onOptionChange('color',o)}});$(this.btnList['fillColorOpacityInput']).on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)||!/^\d+(%{0,1})$/.test(t)){$(this).val(0);bm.toast('숫자를 입력해주세요.');return!1}})};this.onOptionShow=function(e,i){var n=bm.number.hexToRgb($(t.btnList['fillColorInput']).val()),o=$(t.btnList['fillColorOpacityInput']).val().replace('%','');n.a=parseFloat(o)/100;i.setStyleValue(n.r,n.g,n.b,n.a)}};ToolBtnDomBackground.prototype.removeEvent=function(){var t=this;$(this.btnList['gradationDegreeInput']).off('keydown');this.gradationCon.find('input').off('keyup');this.gradationCon.find('input[name="gradationOpacity"]').off('keydown');this.imageCon.find('input[name=backgroundImagePosition]').off('keydown')};ToolBtnDomBackground.prototype.resetProperty=function(){this.resetBackground(this.target,!0)};var ToolBtnDomPointColor=function(){this.colorPicker=ToolOpColorPicker.get();this.addOption(this.colorPicker);this.onOptionChange=function(t,e){var n=this.target;if(bm.toolManager.isMultiSelectMode){n=bm.toolManager.targetElementList.concat()};var a=$(this.colorPicker.element).find('input.opacity').val(),o=((100-parseInt(a))/100),i=bm.number.hexToRgb(e),s=o==1?e:'rgba('+i.r+', '+i.g+', '+i.b+', '+o+')';bm.toolManager.toolBtnEditBefore(this,n,HistoryType.EDITOR_DOM_POINT_COLOR);$.get('/weven_template/theme/THEME009/resource/css/theme.common.css',function(t){console.log(t);var e=/#c3a78c/g,i=t.replace(e,s);$('body').append('<style>'+i+'</style>')});bm.toolManager.toolBtnEditAfter(this,n,HistoryType.EDITOR_DOM_POINT_COLOR)}};bm.extend(ToolBtnBase,ToolBtnDomPointColor);ToolBtnDomPointColor.prototype.addEvent=function(){var t=this};ToolBtnDomPointColor.prototype.removeEvent=function(){var t=this};var ToolBtnDomBoxShadow=function(t){this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);if(isExpertMode){this.addOption(this.colorPicker,'boxShadowColorExpand');this.element=$('[data-wv-toolset="ToolDomShadow"]')}
else{this.addOption(new ToolOpDomShadow(),'ToolOpDomShadow');this.addOption(this.colorPicker)};if(isExpertMode===!0){this.onBtnClick=function(t,e){switch(e){case'reset':this.resetBorder();break;case'lib_name':this.optionList['boxShadowColorExpand'].showComponent(this.optionList['boxShadowColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['boxShadowColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['boxShadowColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}}};this.onOptionChange=function(t,e){var n=this,r=null,o,s,i;if(t.includes('WVLocalStyle')){if(t.includes('apply')){this.optionList['boxShadowColorExpand']['componentList']['WVLocalStyle'].apply(t,e,this)}
else if(t.includes('delete')){this.optionList['boxShadowColorExpand']['componentList']['WVLocalStyle'].delete(t,e,this)};return!0}
else if(t==='ToolOpColorPicker'){if(typeof(e)==='object'){var h='rgb('+e.r+', '+e.g+', '+e.b+')';o=bm.number.rgbToHex(h)}
else{o=e};if(isExpertMode){s=this.element.find('input.color_input.opacity').val()}
else{s='100'};i=bm.number.hexToRgb(o);i.a=parseFloat(s)/100;if(typeof(e)==='object'){e['boxShadow']='rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')';delete e['hex'];delete e['opacity']}
else{e={boxShadow:'rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')'}};e={boxShadow:'rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+') '+n['element'].find('input[name=boxShadowLeftRight]').val()+'px '+n['element'].find('input[name=boxShadowUpDown]').val()+'px '+n['element'].find('input[name=boxShadowBlur]').val()+'px '+n['element'].find('input[name=boxShadowLeftRadius]').val()+'px'}}
else if(t==='box-shadow'){e={boxShadow:e}};var d=this.getSamplingElement($(n.target)),a={boxShadow:bm.getStyle(d,'boxShadow')};bm.toolManager.toolBtnEditBefore(this,this.target,HistoryType.EDITOR_DOM_SHADOW,a);const classList=Array.from($(n.target)[0].classList);const localClassList=WVLocalStyle.prototype.hasLocalClass(classList,[],[])['localClassList'];const localClassNumList=WVLocalStyle.prototype.hasLocalClass(classList,[],[])['localClassNumList'];const boxShadowObj=WVLocalStyle.prototype.localClassObj(localClassList,localClassNumList)['boxShadowClass'];if(boxShadowObj.has===!0){const obj={class:boxShadowObj.numcls,css:e.boxShadow};this.optionList['boxShadowColorExpand']['componentList']['WVLocalStyle'].apply(t,obj,this);return!0}
else{if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,$(this.target))};a=e;r.applyResourceStyle($(this.target),a,!1,!0);r.refreshStyleElementText();bm.toolManager.toolBtnEditAfter(this,this.target,HistoryType.EDITOR_DOM_SHADOW,a);if(t==='ToolOpColorPicker'){this.element.find('input[name=boxShadowColor]').val(o);this.element.find('input[name=boxShadowOpacity]').val(s);$('#boxShadowColorPicker').val(o);$(this.colorPicker.element).find('input.color_option_prev').val(o)};var l=this.element.find('input[name=boxShadowOpacity]').val();if(!l.endsWith('%')){this.element.find('input[name=boxShadowOpacity]').val(l+'%')};if(e['boxShadow']=='none'){this.element.find('input[name=boxShadowColor]').val('000000');this.element.find('input[name=boxShadowOpacity]').val('100%');$('#boxShadowColorPicker').val('#000000');this.element.find('input[name=boxShadowUpDown]').val(0);this.element.find('input[name=boxShadowLeftRight]').val(0);this.element.find('input[name=boxShadowBlur]').val(0);this.element.find('input[name=boxShadowLeftRadius]').val(0)}
else{this.setStyleBtn()}}}};bm.extend(ToolBtnBase,ToolBtnDomBoxShadow);ToolBtnDomBoxShadow.prototype.setStyleBtn=function(){var e=this;if(!e.target||e.target.length){e.resetStyleBtn();return!1};var a=bm.getStyle($(e.target),'boxShadow');if(a){if(a==='none'){e.resetStyleBtn();if(isExpertMode){bm.toolManager.toolList['ToolDomShadow'].openControl(null,!1)}}
else{var t=a.replaceAll(', ',',').split(' ');for(let i=1;i<t.length;i++){t[i]=Number(t[i].replace('px',''));if(t[i]===undefined)t[i]=1};var o;if(t[0].split(',').length>3){o=Number(t[0].split(',')[3].replace(')',''))*100}
else{o=100};var n=t[0],s=t[1],r=t[2],l=t[3],d=t[4];if(n.includes('rgba')){var h=n.split('(')[1].split(',0.')[0];n='rgb('+h+')'};if(isExpertMode){this.element.find('input[name=boxShadowColor]').val(bm.number.rgbToHex(n).toUpperCase().replaceAll('#',''));this.element.find('input[name=boxShadowOpacity]').val(o+'%');$('#boxShadowColorPicker').val(bm.number.rgbToHex(n));this.element.find('input[name=boxShadowUpDown]').val(r);this.element.find('input[name=boxShadowLeftRight]').val(s);this.element.find('input[name=boxShadowBlur]').val(l);this.element.find('input[name=boxShadowLeftRadius]').val(d)}
else{e.optionList['ToolOpDomShadow'].shadowColor.css({backgroundColor:n});e.optionList['ToolOpDomShadow'].shadowOpacity.val(o);e.optionList['ToolOpDomShadow'].shadowLeftRight.val(s);e.optionList['ToolOpDomShadow'].shadowUpDown.val(r);e.optionList['ToolOpDomShadow'].shadowBlur.val(l);e.optionList['ToolOpDomShadow'].shadowRadius.val(d)};bm.toolManager.toolList['ToolDomShadow'].openControl(null,!0)}}};ToolBtnDomBoxShadow.prototype.resetStyleBtn=function(){var t=this;if(isExpertMode){this.element.find('input[name=boxShadowColor]').val('000000');this.element.find('input[name=boxShadowOpacity]').val('100%');$('#boxShadowColorPicker').val('#000000');this.element.find('input[name=boxShadowUpDown]').val(0);this.element.find('input[name=boxShadowLeftRight]').val(0);this.element.find('input[name=boxShadowBlur]').val(0);this.element.find('input[name=boxShadowLeftRadius]').val(0)}
else{t.optionList['ToolOpDomShadow'].shadowColor.css({backgroundColor:'rgb(228, 235, 245)'});t.optionList['ToolOpDomShadow'].shadowOpacity.val(0);t.optionList['ToolOpDomShadow'].shadowLeftRight.val(0);t.optionList['ToolOpDomShadow'].shadowUpDown.val(0);t.optionList['ToolOpDomShadow'].shadowBlur.val(0);t.optionList['ToolOpDomShadow'].shadowRadius.val(0)}};ToolBtnDomBoxShadow.prototype.addEvent=function(){var t=this;if(isExpertMode){this.onOptionHide=function(t,e){if(e.status==1){e.deactive()}};this.onOptionShow=function(t,e){var i=bm.number.hexToRgb($(this.element).find('input[name="boxShadowColor"]').val());i.a=parseFloat($(this.element).find('input[name="boxShadowOpacity"]').val())/100;e.setStyleValue(i.r,i.g,i.b,i.a)};$(t.element).find('input').on('keydown',function(e){var n=$(this).val();if(e.keyCode===13){if((n.indexOf('%')===-1&&!bm.valid.isOnlyNum(n)||!/^\d+(%{0,1})$/.test(n))&&$(this).attr('name')!='boxShadowColor'){if($(this).attr('name')==='boxShadowOpacity'){bm.toast('숫자만 입력해 주세요.');$(this).val(100+'%')}
else if($(this).attr('name')==='boxShadowBlur'||$(this).attr('name')==='boxShadowLeftRadius'){bm.toast('0이상 숫자만 입력해 주세요.');$(this).val(0)}}
else if((n<0||n>100)&&$(this).attr('name')==='boxShadowOpacity'){$(this).val(0);bm.toast('투명도는 0 ~ 100%까지 설정가능합니다.');return!1}
else if((bm.number.isHex(n)==!1)&&$(this).attr('name')==='boxShadowColor'){bm.toast('올바른 색상코드를 입력해주세요.');return!1};var i=bm.number.hexToRgb($(t['element']).find('input[name="boxShadowColor"]').val());if(isExpertMode){var r=$(t['element']).find('input[name="boxShadowOpacity"]').val()!==''?parseInt($(t['element']).find('input[name="boxShadowOpacity"]').val())/100:100,o='rgba('+i.r+','+i.g+','+i.b+','+r+')'}
else{var o='rgba('+i.r+','+i.g+','+i.b+','+(100-parseInt($(t['element']).find('input[name="boxShadowOpacity"]').val()))/100+')'};var s={boxShadow:o+' '+t['element'].find('input[name=boxShadowLeftRight]').val()+'px '+t['element'].find('input[name=boxShadowUpDown]').val()+'px '+t['element'].find('input[name=boxShadowBlur]').val()+'px '+t['element'].find('input[name=boxShadowLeftRadius]').val()+'px'};t.onOptionChange('apply',s);if($(this).attr('name')==='boxShadowColor'){var a=bm.number.rgbToHex(o);$('#boxShadowColorPicker').val(a)}}});$(t.element).find('#boxShadowColorPicker').on('change',function(e){var i=bm.number.hexToRgb(this['value']),n=$(t['element']).find('input[name="boxShadowOpacity"]').val()!==''?parseInt($(t['element']).find('input[name="boxShadowOpacity"]').val())/100:100,o='rgba('+i.r+','+i.g+','+i.b+','+n+')',a={boxShadow:o+' '+t['element'].find('input[name=boxShadowLeftRight]').val()+'px '+t['element'].find('input[name=boxShadowUpDown]').val()+'px '+t['element'].find('input[name=boxShadowBlur]').val()+'px '+t['element'].find('input[name=boxShadowLeftRadius]').val()+'px'};t.onOptionChange('apply',a)})}
else{this.onOptionHide=function(t,e){if(e.colorPicker.status===1){e.colorPicker.deactive()}}}};ToolBtnDomBoxShadow.prototype.removeEvent=function(){var t=this;if(isExpertMode)$(t.element).find('input').off('keydown')};ToolBtnDomBoxShadow.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnDomBoxShadow.prototype.resetProperty=function(){this.onOptionChange('apply',{boxShadow:'none'})};var ToolBtnDomOpacity=function(){this.type='ToolBtnDomOpacity';if(isExpertMode){this.opacityValue=$('[data-wv-tool-btn=ToolBtnDomOpacity]')}
else{this.opacityValue=$('[data-wv-tool-option=ToolOpDomOpacity]').find('input[name="opacity"]');this.addOption(new ToolOpDomOpacity(),'ToolOpDomOpacity')};this.onOptionChange=function(t,e){var a=this,i=a.getSamplingElement($(this.target)),n={opacity:bm.getStyle(i,'opacity')};bm.toolManager.toolBtnEditBefore(this,i,HistoryType.EDITOR_DOM_OPACITY,n);if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){$(this.target).css({opacity:e/100})}
else{var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,i)};n=e;o.applyResourceStyle(this.target,n,!1,!0)};bm.toolManager.toolBtnEditAfter(this,i,HistoryType.EDITOR_DOM_OPACITY,n)}};bm.extend(ToolBtnBase,ToolBtnDomOpacity);ToolBtnDomOpacity.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length===0){t.resetStyleBtn();return!1};if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){var e=Number(bm.getStyle(t.target,'opacity'))*100;if(e){$(this.btnList['opacityRange']).val(e);$(this.btnList['opacityOutput']).text(e)}
else{t.resetStyleBtn()}}
else{var e=Number(bm.getStyle(t.target,'opacity'))*100;$(t.opacityValue).val(e+'%');if(e!==100){$(t.opacityValue).val(e+'%');if(isExpertMode)bm.toolManager.toolList['ToolDomOpacity'].openControl(null,!0)}
else{if(isExpertMode)bm.toolManager.toolList['ToolDomOpacity'].openControl(null,!1);t.resetStyleBtn()};t.resetStyleBtn()}};ToolBtnDomOpacity.prototype.resetStyleBtn=function(){var t=this;$(this.btnList['opacityRange']).val(100);$(this.btnList['opacityOutput']).text(100+'%')};ToolBtnDomOpacity.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e)};ToolBtnDomOpacity.prototype.addEvent=function(){var t=this;if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){$(this.btnList['opacityRange']).on('propertychange change keyup paste input',function(){$(t.btnList['opacityOutput']).val($(this).val());t.onOptionChange('opacity',$(this).val())})}
else if(isExpertMode){this.opacityValue.on('keydown',function(e){if(e.keyCode===13){var i=Number($(this).val().replace('%',''));i=i/100;t.onOptionChange('opacity',{opacity:i});$(t.btnList['opacity']).val(i*100+'%')}});this.opacityValue.on('keyup',function(){var t=$(this).val();if(t.includes('%')){t=Number(t.replace('%',''))};if(bm.valid.isOnlyNum(t)){if(t<0||t>100){if(t<0){$(this).val(0+'%')}
else if(t>100){$(this).val(100+'%')};bm.toast('투명도는 0 ~ 100% 까지 설정할 수 있습니다.');return!1}}})}};ToolBtnDomOpacity.prototype.removeEvent=function(){if(isExpertMode){this.opacityValue.off('keydown');this.opacityValue.off('keyup')}};ToolBtnDomOpacity.prototype.resetProperty=function(){this.onOptionChange({opacity:''})};var ToolBtnDomCondition=function(){this.type='ToolBtnDomCondition';this.activeClass='active';this.selectBoxId='domPosition';this.onBtnClick=function(t,e){switch(e){case'show':wvAdminIFrameBridge._WVLayoutKit.displayShowBlock(this.target,this.setStyleBtn);break;case'hide':wvAdminIFrameBridge._WVLayoutKit.displayHideBlock(this.target,this.setStyleBtn);break;case'visible':case'hidden':this.onOptionChange('overflow',{overflow:e});break;case'reset':this.onOptionChange('reset',{position:'relative',opacity:'100%',overflow:'visible'});wvAdminIFrameBridge._WVLayoutKit.displayShowBlock(this.target,this.setStyleBtn);break};if(e==='visible'||e==='hidden'){this.setStyleBtn(e)}};this.onOptionChange=function(t,e){var a=this,i=a.getSamplingElement($(this.target)),n={};if(t==='position'){n['position']=bm.getStyle(i,'position')}
else if(t==='opacity'){n['opacity']=bm.getStyle(i,'opacity')}
else if(t==='overflow'){n['overflow']=bm.getStyle(i,'overflow')}
else if(t==='reset'){n={position:bm.getStyle(i,'position'),opacity:bm.getStyle(i,'opacity'),overflow:bm.getStyle(i,'overflow')}};bm.toolManager.toolBtnEditBefore(this,i,HistoryType.EDITOR_DOM_OPACITY,n);var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,i)};n=e;o.applyResourceStyle(this.target,n,!1,!0);bm.toolManager.toolBtnEditAfter(this,i,HistoryType.EDITOR_DOM_OPACITY,n);if(t!=='reset'){this.setStyleBtn()};if(t==='reset'||t==='position'){wvAdminIFrameBridge._WVLayoutKit.kitRepositioning()}}};bm.extend(ToolBtnBase,ToolBtnDomCondition);ToolBtnDomCondition.prototype.setStyleBtn=function(t){const _this=wvAdminIFrameBridge.toolManager.toolList.ToolDomCondition.toolBtnList.ToolBtnDomCondition;if(!_this.target||_this.target.length===0){_this.resetStyleBtn();return!1};window.requestAnimationFrame(()=>{let target;if(wvAdminIFrameBridge._WVEffect.targetMode===WVEffect.prototype.ELEMENTMODE){target=wvAdminIFrameBridge._WVEffect.effectTarget}
else{if(Array.isArray(_this.target)===!1){target=[_this.target]}
else{target=_this.target}};for(let i=0;i<target.length;i++){$(target[i]).css({width:$(target[i])[0].getBoundingClientRect().width+'px'});const mouseOverEvent=new MouseEvent('mouseover',{view:window,bubbles:!0,cancelable:!0});$(target[i])[0].dispatchEvent(mouseOverEvent);const position=bm.getStyle(target[i],'position');const opacity=Number(bm.getStyle(target[i],'opacity'))*100;let display='show';for(let attr of target[i].attributes){if(attr.name.startsWith('data-wv-display-hide'+wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal)){display='none'};if(attr.name.startsWith('effect-display')){let isDefaultMode=(wvAdminIFrameBridge._WVEffect.applyMode===WVEffect.prototype.DEFAULTMODE)?!0:!1;switch(attr.value){case'show':if(isDefaultMode)display='none';else display='show';break;case'hide':if(isDefaultMode)display='show';else display='none';break}}};const overflow=t?t:bm.getStyle(target[i],'overflow');for(let i=0;i<bm.selectBoxList.length;i++){if(bm.selectBoxList[i]['id'].includes(_this.selectBoxId)){bm.selectBoxList[i].setSelectedIndexAtValue(position.charAt(0).toUpperCase()+position.slice(1))}};$(_this.btnList['position']).val(position);$(_this.btnList['opacity']).val(opacity+'%');if(display==='none'){_this.controlTab(_this.btnList['hide'].parentElement,$(_this.btnList['hide']))}
else{_this.controlTab(_this.btnList['show'].parentElement,$(_this.btnList['show']))};if(overflow==='visible'){_this.controlTab(_this.btnList['visible'].parentElement,$(_this.btnList['visible']))}
else{_this.controlTab(_this.btnList['hidden'].parentElement,$(_this.btnList['hidden']))};$(target[i]).css({width:''})}})};ToolBtnDomCondition.prototype.resetStyleBtn=function(){for(let i=0;i<bm.selectBoxList.length;i++){if(bm.selectBoxList[i]['id'].includes(this.selectBoxId)){bm.selectBoxList[i].setSelectedIndexAtValue('Relative')}};$(this.btnList['opacityRange']).val(100);$(this.btnList['opacityOutput']).text(100+'%');this.controlTab(this.btnList['show'].parentElement,$(this.btnList['show']));this.controlTab(this.btnList['visible'].parentElement,$(this.btnList['visible']))};ToolBtnDomCondition.prototype.controlTab=function(t,e){$(t).children().removeClass(this.activeClass);$(e).addClass(this.activeClass)};ToolBtnDomCondition.prototype.addEvent=function(){const _this=this;$(this.btnList['position']).on('change',function(t){_this.onOptionChange($(this).attr('data-wv-tool-btn-prop'),{position:this['value']})});$(this.btnList['opacity']).on('keydown',function(t){if(t.keyCode===13){var e=Number($(this).val().replace('%',''));e=e/100;_this.onOptionChange('opacity',{opacity:e});$(_this.btnList['opacity']).val(e*100+'%')}});$(this.btnList['opacity']).on('keyup',function(){var t=$(this).val();if(t.includes('%')){t=Number(t.replace('%',''))};if(bm.valid.isOnlyNum(t)){if(t<0||t>100){if(t<0){$(this).val(0+'%')}
else if(t>100){$(this).val(100+'%')};bm.toast('투명도는 0 ~ 100% 까지 설정할 수 있습니다.');return!1}}})};ToolBtnDomCondition.prototype.removeEvent=function(){$(this.btnList['position']).off('change');$(this.btnList['opacity']).off('keydown');$(this.btnList['opacity']).off('keyup')};var ToolBtnTableAlign=function(){this.type='ToolBtnTableAlign';var t=this;this.onBtnClick=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var r=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,o=/left/.test(i)?'left':(/center/.test(i)?'center':'right'),a=/Top/.test(i)?'top':(/Middle/.test(i)?'middle':'bottom'),s={'text-align':o,'vertical-align':a};this.setSelectedBtn(i);var n=bm.tableSelectionManager.getRange();bm.table.setCellStyle(n,'ALIGN',s)}};bm.extend(ToolBtnBase,ToolBtnTableAlign);ToolBtnTableAlign.prototype.setStyleBtn=function(){var h=this,i=bm.tableSelectionManager.getRange();if(i&&i.length>0){var d=i.length,r=!0,t='',e='';for(var n=0;n<d;n++){var a=i[n],s=$(a).css('textAlign');if(t=='')t=s;var o=$(a).css('verticalAlign');if(e=='')e=o;if((t!=''&&t!=s)||(e!=''&&e!=o))r=!1};if(r){if(t=='start')t='left';else if(t=='end')t='right';var l=t+e.charAt(0).toLocaleUpperCase()+e.slice(1);$(h.btnList[l]).addClass('active')}}};ToolBtnTableAlign.prototype.resetStyleBtn=function(){var t=this;$(t.btnList).removeClass('active')};ToolBtnTableAlign.prototype.addEvent=function(){var t=this};ToolBtnTableAlign.prototype.removeEvent=function(){var t=this};var ToolBtnTableBackground=function(t){this.type=t;var e=this;this.colorPicker=ToolOpColorPicker.get(this,t);if(isExpertMode){this.addOption(this.colorPicker,'cellColorExpand')}
else{this.addOption(this.colorPicker,'color')};if(isExpertMode){this.onBtnClick=function(t,e){switch(e){case'reset':this.resetBorder();break;case'lib_name':this.optionList['cellColorExpand'].showComponent(this.optionList['cellColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['cellColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['cellColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}}};this.onOptionChange=function(t,i){if(t&&t.includes('WVLocalStyle')===!0){if(type.includes('apply')){this.optionList['cellColorExpand']['componentList']['WVLocalStyle'].apply(type,i,this)}
else if(type.includes('delete')){this.optionList['cellColorExpand']['componentList']['WVLocalStyle'].delete(type,i,this)};return!0};var n=bm.tableSelectionManager.getRange();if(!e.target||(e.target.tagName.toLowerCase()!='table'&&$(e.target).find('table').length>0)||n.length==0){alert('적용할 대상이 선택되지 않았습니다.');return};if(e.target['length'])e.target=e.target[0];var g=e.target.tagName.toLowerCase()!=='table'?$(e.target).find('table')[0]:e.target,h=n[0];if(!i&&$(h).hasClass('bg_point0'))i='applyPoint0';if(!i){alert('컬러를 선택해주세요.');return};if(t==='ToolOpColorPicker'){var a=parseFloat($(this.colorPicker.element).find('input.color_input.opacity').val())/100}
else{var p=$(this['btnList']['cellOpacityInput']).val(),a=parseInt(p)/100};var o;if(i=='applyPoint0'){o={'backgroundColor':''};if(a===1){bm.table.setCellStyle(n,'BACKGROUND_COLOR',o);$(n).addClass('bg_point0')}
else{if(confirm('테마 컬러 투명도 반영시 현재 페이지에서만 반영이 됩니다.\n 반영하시겠습니까?')){var f=wvAdminIFrameBridge._WVContentArea.$content[0],d=wvAdminIFrameBridge._WVContentArea.$contentBody[0],s=f.createElement('div');d.appendChild(s);$(s).addClass('bg_point0');var l=bm.number.rgbaToObj(bm.getStyle(s,'backgroundColor'));d.removeChild(s);o={backgroundColor:'rgba('+l.r+', '+l.g+', '+l.b+', '+a+') !important;'};bm.table.setCellStyle(n,'BACKGROUND_COLOR',o)}
else{return}}}
else{var r=bm.number.hexToRgb(i),c=a==1?i:'rgba('+r.r+', '+r.g+', '+r.b+', '+a+')',u=!1;o={backgroundColor:c};if($(h).hasClass('bg_point0')){if(confirm('포인트 컬러가 적용된 부분에 색상 변경을 할 경우 포인트 컬러 적용 대상에서 제외됩니다. 변경 하시겠습니까?')){bm.table.setCellStyle(n,'BACKGROUND_COLOR',o);$(n).removeClass('bg_point0')}
else{return}}
else{bm.table.setCellStyle(n,'BACKGROUND_COLOR',o)}};this.setStyleBtn()}};bm.extend(ToolBtnBase,ToolBtnTableBackground);ToolBtnTableBackground.prototype.setStyleBtn=function(){var e=bm.tableSelectionManager.getRange();if(e&&e.length>0){var c,E=!0,t='',m='',o='',f=null;if(bm.bmEditorManager.registedBoardEditor===!1){f=WVAdminResourceManager.getEmbededStyleObject(null,e)};var x='[data-wv-res-id="'+$(e).attr('data-wv-res-id')+'"]',B=f.getRulesBySelectorText(x,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),n=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':n=0;break;case'768':n=1;break;case'992':n=2;break;case'1200':n=3;break;case'1600':n=4;break};var i=0;if(e.length<2){if($(e).hasClass('bg_point0')){o='bg_point0'}
else if($(e).hasClass('bg_point1')){o='bg_point1'}
else if($(e).hasClass('bg_point2')){o='bg_point2'};this.defaultPointClassList=['.point','.bg_point','.svg_point','.stroke_point','.border_point','.before_point','.before_bg_point','.checked_before_bg_point','.after_point','.after_bg_point'];var S='theme-common';if(typeof WVAdminResourceManager!=='undefined'){var h=WVAdminResourceManager.getEmbededStyleObject(S)};if(h&&h.styleElement.innerText!=''){var w=this.defaultPointClassList[0]+''+0,T=h.getRulesBySelectorText(w,null,!0,!0,null),C=T[0].style.color};t=B[n].style.backgroundColor;if(t==''){if(o){t=C}
else t='#ffffff';i=100}
else{if(t.indexOf('#')!=-1){var g=parseFloat($(this['btnList']['cellOpacityInput']).val());i=isNaN(g)?100:g}
else{if(parseFloat(t.split(',')[3])&&!isNaN(parseFloat(t.split(',')[3]))){i=parseFloat(t.split(',')[3]);i=parseInt(i*100)}
else{i=100}}};$(e).find('.wveditor_text').children().each(function(){m=$(this).css('background-color');if(t!=m){E=!1;return}})}
else{var i=100,y=e.length,p='',u='',d=[];for(var r=0;r<y;r++){p='[data-wv-res-id="'+$(e[r]).attr('data-wv-res-id')+'"]';u=f.getRulesBySelectorText(p,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList());d[r]=u[n].style.backgroundColor};var b=new Set(d);t=b.size===1?d[0]:'#000000';if(t==''){t='#ffffff'}};if(o!=''){var l=o.replace('bg_point','');l=parseInt(l);c=l;t='#000000'}
else{c=-1};var s;if(t.indexOf('#')!=-1){s=t}
else{s=bm.number.rgbToHex(t)};var a=bm.number.hexToRgb(s),v=i/100;this.colorPicker.setStyleValue(a.r,a.g,a.b,v,c);this.setInput(a,s,i)}};ToolBtnTableBackground.prototype.setInput=function(t,e,i){for(key in this.btnList){if(this.btnList[key].tagName.toLowerCase()==='input'){if(key.toLowerCase().includes('color')){this.btnList[key]['value']=e}
else if(key.toLowerCase().includes('opacity')){this.btnList[key]['value']=i+'%'}}}};ToolBtnTableBackground.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}
else if(t['type']==='cellColorExpand'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnTableBackground.prototype.addEvent=function(){var t=this;$(this['btnList']).on('keydown',function(e){if(e.keyCode==13){t.onOptionChange(null,t['btnList']['cellColorHexInput']['value'])}});$(this['btnList']['cellColorPickerInput']).on('change',function(e){t.onOptionChange(null,this['value'])})};ToolBtnTableBackground.prototype.removeEvent=function(){var t=this;$(this['btnList']).off('keydown');$(this['btnList']['cellColorPickerInput']).off('keydown');$(this['btnList']['cellColorPickerInput']).off('change')};var ToolBtnTableBorder=function(t){this.type=t;var e=this;this.addOption(new ToolOpTableBorder(),'border');if(isExpertMode){this.styleSelect=app.getWvCom('tableBorderStyleSelect');this.colorPicker=ToolOpColorPicker.get(this,t);this.addOption(this.colorPicker,'tableBorderColorExpand')};var n=$('[data-wv-toolset=ToolTable]'),o=this.optionList['border'].element;this.getCurrentBorderStyle=function(t){if(!e.target||(e.target.tagName.toLowerCase()!='table'&&$(e.target).find('table').length==0))return;var o=bm.tableSelectionManager.getRange(),n=o[0],t=t?'-'+t:'',i={};i['border-left'+t]=bm.getStyle(n,'border-left'+t);i['border-top'+t]=bm.getStyle(n,'border-top'+t);i['border-right'+t]=bm.getStyle(n,'border-right'+t);i['border-bottom'+t]=bm.getStyle(n,'border-bottom'+t);return i};this.wrapValue=function(t){if(t){if(typeof(t)==='string'&&t.includes('px')==!0){t=t}
else{t=parseInt(t)+'px'};return t}
else{console.warn(t+'가 없습니다.')}};this.getValues=function(){return{width:e.wrapValue($(e.btnList['tableBorderWeightInput']).val()),color:$(e.btnList['tableBorderColorInput']).val(),opacity:$(e.btnList['tableBorderOpacityInput']).val(),borderStyle:$('#tableBorderStyleSelect').val(),direction:e.getActivePosBtnProp()}};this.getActivePosBtnProp=function(){const posBtnList=e.getPosBtnList();for(let i=0;i<posBtnList['length'];i++){const prop=$(posBtnList[i]).attr('data-wv-tool-btn-prop');if(prop.indexOf('table_border_')>-1&&$(posBtnList[i]).hasClass('active')){return prop}}};this.getPosBtnList=function(){let array=[];for(let i=0;i<e.btnList['length'];i++){const prop=$(e.btnList[i]).attr('data-wv-tool-btn-prop');if(prop.indexOf('table_border_')>-1){array.push(e.btnList[i])}};return array};this.onBtnClick=function(t,i){if(t['target']instanceof HTMLAnchorElement){$(this.getPosBtnList()).removeClass('active');$(t['target']).addClass('active');e.onOptionChange(null,e.getValues(),t['target'])}};this.onOptionChange=function(t,i,n){if(t==='ToolOpColorPicker'){let hex,alpha;if(typeof(i)==='string'&&i.indexOf('#')>-1){hex=i;alpha=1}
else if(typeof(i)==='object'&&i['a']){hex=bm.number.rgbToHex(bm.number.rgbaObjToStr(i));alpha=i['a']};e['btnList']['tableBorderColorInput']['value']=hex;$('#tableBorderColorPicker')[0]['value']=hex;this.btnList['tableBorderOpacityInput']['value']=(alpha*100)+'%'}
else{$(n).removeClass('active');var s=bm.number.hexToRgb(i['color']);if(!e.target||(e.target.tagName.toLowerCase()!='table'&&$(e.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(e.target['length'])e.target=e.target[0];var h=e.target.tagName.toLowerCase()!=='table'?$(e.target).find('table')[0]:e.target,a=bm.tableSelectionManager.getRange(),l=isNaN(parseInt($(this.btnList['tableBorderOpacityInput']).val().replace('%','')))?100:parseInt($(this.btnList['tableBorderOpacityInput']).val().replace('%','')),d=l>100?100:parseInt(l)/100;if(i.color=='transparent'){s=bm.number.hexToRgb('#000000');d=0}
else{s=bm.number.hexToRgb(i.color)};var o=i.width+' '+i.borderStyle+' rgba('+s.r+', '+s.g+', '+s.b+', '+d+')',r;switch(i.direction){case'table_border_all':r=bm.table.checkAppliedStyleAll(a,{'borderTop':o,'borderRight':o,'borderBottom':o,'borderLeft':o});if(r){o=''};bm.table.setCellAllBorderStyle(a,o);break;case'table_border_inner_all':bm.table.setCellBorderInnerStyle(a,o,'all');break;case'table_border_inner_row':bm.table.setCellBorderInnerStyle(a,o,'horizontal');break;case'table_border_inner_col':bm.table.setCellBorderInnerStyle(a,o,'vertical');break;case'table_border_outer_all':bm.table.setCellBorderOuterStyle(a,o,'all');break;case'table_border_left':bm.table.setCellBorderOuterStyle(a,o,'left');break;case'table_border_top':bm.table.setCellBorderOuterStyle(a,o,'top');break;case'table_border_right':bm.table.setCellBorderOuterStyle(a,o,'right');break;case'table_border_bottom':bm.table.setCellBorderOuterStyle(a,o,'bottom');break;case'table_border_none':o='none';bm.table.setCellAllBorderStyle(a,o);break}}};if(isExpertMode){this.onOptionShow=function(t,i){e.setStyleBtn(!0)}}};bm.extend(ToolBtnBase,ToolBtnTableBorder);ToolBtnTableBorder.prototype.setStyleBtn=function(t){var l=this;if(!this.target||this.target.length){this.resetStyleBtn();return!1};var n=this.optionList['border'].element,o=this.getCurrentBorderStyle('style'),c=this.getCurrentBorderStyle('color'),r,e=this.optionList['border'].borderColor,f=bm.number.rgbaToObj(e);if(!o)return;$(n).find('[data-wv-tool-option-value]').removeClass('active');let hasStyle=!1;for(var s=0;s<Object.keys(o).length;s++){var a=Object.keys(o)[s],h=a.replace('border-','').replace('-style',''),i=o[a],d=c[a.replace('-style','-color')];if(i&&i!='none'){e=d;hasStyle=!0;$(n).find('[data-wv-tool-option-btn]').removeClass('active');$(n).find('[data-wv-tool-option-btn="'+i+'"]').addClass('active');$(n).find('[data-wv-tool-option-value="'+h+'"]').addClass('active')}
else{e=d;$(n).find('[data-wv-tool-option-btn="solid"]').addClass('active')}};if(hasStyle===!1)return;if(e.indexOf('rgb')>-1){r=bm.number.rgbaToObj(e)['a'];e=bm.number.rgbToHex(e)};const setWidth=function(t){const l=t;var i=l.getCurrentBorderStyle('width'),n=Object.keys(i).map(function(t){return Math.round(parseFloat(i[t]))}),e=Math.max.apply(null,n);if(e<1)e=1;return e};if(isExpertMode){this['btnList']['tableBorderWeightInput']['value']=setWidth(this);this['btnList']['tableBorderColorInput']['value']=e;$('#tableBorderColorPicker')[0]['value']=e;this['btnList']['tableBorderOpacityInput']['value']=(r*100)+'%';this.styleSelect.val(i);this.styleSelect.optionList.forEach(function(t){l.styleSelect.dom.find('.selected_item').removeClass(t.value)});this.styleSelect.dom.find('.selected_item').addClass(i)}
else{this.optionList['border'].borderColor=e;$(this.colorPrev).css({backgroundColor:e});$(this.widthInput).val(setWidth(this))};if(!isExpertMode||t){const rgb=bm.number.rgbaToObj(e);this.colorPicker.setStyleValue(rgb.r,rgb.g,rgb.b,r,null,null,null,null)}};ToolBtnTableBorder.prototype.resetStyleBtn=function(){var t=this};ToolBtnTableBorder.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};ToolBtnTableBorder.prototype.addEvent=function(){var t=this;$(this.btnList['tableBorderWeightInput']).on('keyup',function(e){let needToLimit=!1;let limitVal=1;if(Number($(this).val())>10){needToLimit=!0;limitVal=10};if(Number($(this).val())<1){needToLimit=!0};if(needToLimit===!0){bm.toast('두께는 1에서 10 사이여야 합니다.');$(this).val(limitVal);return};if(e.keyCode===13){t.onOptionChange(null,t.getValues())}});$(this.btnList['tableBorderColorInput']).on('keyup',function(){var i=$(this).val();if(i.charAt(0)!=='#'){i='#'+i};if(i.length>7){bm.toast('입력값은 최대 6자리 수 입니다.');i=i.substring(0,10);$(this).val(i)};if(e.keyCode===13){t.btnList['tableBorderColorPicker']['value']=this['value'];t.onOptionChange(null,t.getValues())}});$(this.btnList['tableBorderColorPicker']).on('change',function(){t.btnList['tableBorderColorInput']['value']=this['value']})};ToolBtnTableBorder.prototype.removeEvent=function(){var t=this};var ToolBtnTableCaption=function(){this.type='ToolBtnTableCaption';var t=this;this.addOption(new ToolOpTableCaption());this.serviceName='ZGAI';this.onOptionChange=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var n=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target;if(i['caption']){$(n).find('caption').text(i.caption)};if(i['summary']){$(n).attr('summary',i.summary)};if(e=='apply')t.hideOptionAll()}};bm.extend(ToolBtnBase,ToolBtnTableCaption);ToolBtnTableCaption.prototype.showOption=function(t,e){this.activeOption=t;$(t.element).show();var i=this;t.active(e,function(){i.onOptionChange.apply(i,arguments)})};ToolBtnTableCaption.prototype.hideOption=function(t,e){this.activeOption=null;t.deactive()};ToolBtnTableCaption.prototype.setStyleBtn=function(){var t=this;if(!t.target||bm.toolManager.isMultiSelectMode){t.resetStyleBtn();return!1};var n=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target;if(n){const convertServiceName=(string)=>{if(typeof(string)==='string'&&string.toLowerCase().includes('weven')){return string.replaceAll('weven',this.serviceName).replaceAll('WEVEN',this.serviceName)}
else{return string}};var e=$(n).find('caption').text(),i=$(n).attr('summary');e=convertServiceName(e);i=convertServiceName(i);if(isExpertMode){this.btnList['caption']['value']=e;this.btnList['summary']['value']=i}
else{t.optionList[0].setOptionValue({'caption':e,'summary':i})}}};ToolBtnTableCaption.prototype.addEvent=function(){var t=this;if(isExpertMode){t.show=function(){};t.show();$(this['btnList']).on('keydown',function(e){if(e.keyCode==13){const value={caption:t['btnList']['caption']['value'],summary:t['btnList']['summary']['value'],};t.onOptionChange(null,value)}})}
else{t.show()}};ToolBtnTableCaption.prototype.removeEvent=function(){var t=this};var ToolBtnTableDelete=function(){this.type='ToolBtnTableDelete';var t=this;this.onBtnClick=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var u=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,f=bm.tableSelectionManager.getRange(),p=bm.tableSelectionManager.scanning(t.target),l=f.length,o=i;if(l==0){alert('제거하려는 대상 셀을 선택해 주세요.');return};var n,h=[],c=[],s=[],r=0;for(var a=0;a<l;a++){n=f[a];if(o=='horizontal'){if(c.indexOf(n.offsetTop)>-1){continue}
else{c.push(n.offsetTop);r+=n.rowSpan;s.push(n)}}
else if(o=='vertical'){if(h.indexOf(n.offsetLeft)>-1){continue}
else{r+=n.colSpan;s.push(n);h.push(n.offsetLeft)}}};if(o=='horizontal'&&r==p.length){bm.toast('삭제하려는 행이 테이블의 전체 행이므로 삭제할 수 없습니다.');return}
else if(o=='vertical'&&r==p[0].length){bm.toast('삭제하려는 열이 테이블의 전체 열이므로 삭제할 수 없습니다.\n');return};l=s.length;var d;for(a=0;a<l;a++){n=s[a];if(o=='horizontal'){d=n.rowSpan}
else if(o=='vertical'){d=n.colSpan}
while(d--){if(o=='horizontal'){bm.toast('행이 삭제되었습니다.')}
else if(o=='vertical'){bm.toast('열이 삭제되었습니다.')};bm.table.removeLine(u,n,o)}};bm.tableSelectionManager.removeRange()}};bm.extend(ToolBtnBase,ToolBtnTableDelete);ToolBtnTableDelete.prototype.addEvent=function(){var t=this};ToolBtnTableDelete.prototype.removeEvent=function(){var t=this};var ToolBtnTableInsert=function(){this.type='ToolBtnTableInsert';var t=this;this.onBtnClick=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var a=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,n=i;bm.table.addLine(a,bm.tableSelectionManager.getRange(n),n);var o=(n==='top'||n==='bottom')?'행이 삽입되었습니다.':'열이 삽입되었습니다.';bm.toast(o)}};bm.extend(ToolBtnBase,ToolBtnTableInsert);ToolBtnTableInsert.prototype.addEvent=function(){var t=this};ToolBtnTableInsert.prototype.removeEvent=function(){var t=this};var ToolBtnTableMerge=function(){this.type='ToolBtnTableMerge';var t=this;this.onBtnClick=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){bm.toast('적용할 대상이 선택되지 않았습니다.');return!1};if(t.target['length'])t.target=t.target[0];var a=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,n=bm.tableSelectionManager.getRange();if(n.length==1){if(n[0].rowSpan>1||n[0].colSpan>1){n=bm.table.mergeCancel(a,n[0]);bm.tableSelectionManager.setRange(n)}
else if(i=='merge'){bm.toast('병합하려는 2개 이상의 셀을 선택해주세요.');return!1}}
else{var o=bm.table.merge(a,n);if(o){n=[o];bm.tableSelectionManager.setRange(n)}}}};bm.extend(ToolBtnBase,ToolBtnTableMerge);ToolBtnTableMerge.prototype.addEvent=function(){var t=this};ToolBtnTableMerge.prototype.removeEvent=function(){var t=this};var ToolBtnTableCellSize=function(){this.type='ToolBtnTableCellSize';var t=this;this.onBtnClick=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){bm.toast('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var o=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,n=bm.tableSelectionManager.getRange();if(!n||(n&&n.length==0))return;var a=bm.tableSelectionManager.getColRange(o,n),f=a.length;if(bm.tableSelectionManager.getColRange(o,bm.tableSelectionManager.selectedCellList).length<2){bm.toast('열이 다른 2개 이상의 셀을 선택해주세요.');return};var s=bm.tableSelectionManager.getSumWidthSelectedCell(),r=o.offsetWidth,l=s/r*100,d=Math.floor(l/f*100)/100,h=d,c={width:h+'%'};bm.table.setCellStyle(a,'WIDTH',c)}};bm.extend(ToolBtnBase,ToolBtnTableCellSize);ToolBtnTableCellSize.prototype.addEvent=function(){var t=this};ToolBtnTableCellSize.prototype.removeEvent=function(){var t=this};var ToolBtnTableSpace=function(){this.type='ToolBtnTableSpace';var t=this;this.key0='paddingTop';this.key1='paddingLeft';this.key2='paddingBottom';this.key3='paddingRight';this.addOption(new ToolOpTableSpace());this.onOptionChange=function(e,i,n){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var a=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,o=n||bm.tableSelectionManager.getRange();for(key in i){if(typeof(i[key]==='string')&&i[key].includes('px')===!1){i[key]+='px'}};if(i=='removeSpace'){bm.table.setCellStyle(o,'PADDING',{'paddingTop':'0px','paddingRight':'0px','paddingBottom':'0px','paddingLeft':'0px'});t.optionList[0].setOptionValue({'paddingTop':0,'paddingRight':0,'paddingBottom':0,'paddingLeft':0})}
else{bm.table.setCellStyle(o,'PADDING',i)};this.setStyleBtn()}};bm.extend(ToolBtnBase,ToolBtnTableSpace);ToolBtnTableSpace.prototype.showOption=function(t,e){this.activeOption=t;$(t.element).show();var i=this;t.active(e,function(){i.onOptionChange.apply(i,arguments)})};ToolBtnTableSpace.prototype.hideOption=function(t,e){this.activeOption=null;t.deactive()};ToolBtnTableSpace.prototype.setStyleBtn=function(){var e=this,t=bm.tableSelectionManager.getRange();const keyList=[this.key0,this.key1,this.key2,this.key3];let applyList={};if(t&&t.length>0){for(let i=0;i<keyList['length'];i++){applyList[keyList[i]]=bm.table.getCellListStyle(t,keyList[i])};if(isExpertMode){for(key in applyList){this['btnList'][key]['value']=applyList[key]}}
else{const key0=this.key0;const key1=this.key1;const key2=this.key2;const key3=this.key3;e.optionList[0].setOptionValue({[key0]:applyList[key0],[key1]:applyList[key1],[key2]:applyList[key2],[key3]:applyList[key3]})}}};ToolBtnTableSpace.prototype.addEvent=function(){var t=this;$(this['btnList']).on('keydown',function(e){if(e.keyCode==13){const key0=t.key0;const key1=t.key1;const key2=t.key2;const key3=t.key3;const value={[key0]:t['btnList'][key0]['value'],[key1]:t['btnList'][key1]['value'],[key2]:t['btnList'][key2]['value'],[key3]:t['btnList'][key3]['value']};t.onOptionChange(null,value,null)}})};ToolBtnTableSpace.prototype.removeEvent=function(){var t=this};var ToolBtnTableScroll=function(){this.type='ToolBtnTableScroll';this.scrollStdValue=992;this.webPaddingTmpValue=60;this.isActive=!1;var t=this;this.onBtnClick=function(e,i){if(!t.target||(t.target.tagName.toLowerCase()!='table'&&$(t.target).find('table').length==0)){alert('적용할 대상이 선택되지 않았습니다.');return};if(t.target['length'])t.target=t.target[0];var s=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,l=$(s).closest('div:not([data-wv-layout-element="block_inner"])')[0],n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};if(n){if(!this.isActive){var f=WVAdminResourceManager.getResourceId($(t.target).closest('[data-wv-res-id]')[0],!0),p=this.getResIdSelectorText(f),r=n.getRulesBySelectorText(p,null,!1,!1,[this.scrollStdValue]),o=0,a=0;if(r.length>0){o=parseInt(r[0].style.paddingLeft.slice(0,-2));a=parseInt(r[0].style.paddingRight.slice(0,-2))};o=isNaN(o)||o===0?this.webPaddingTmpValue:o;a=isNaN(a)||a===0?this.webPaddingTmpValue:a;var c=this.scrollStdValue-o-a;n.applyResourceStyle(s,{'min-width':0},!1,!0,!1,!0);n.applyResourceStyle(l,{'overflow-x':'visible'},!1,!0,!1,!0);n.applyResourceStyle(s,{'min-width':c+'px'},!1,!0,!1,!0,['default','768']);n.applyResourceStyle(l,{'overflow-x':'auto'},!1,!0,!1,!0,['default','768']);this.isActive=!0;$(this.btnList).addClass('active')}
else{var d=this.getResIdSelectorText(WVAdminResourceManager.getResourceId(s,!0)),h=this.getResIdSelectorText(WVAdminResourceManager.getResourceId(l,!0));n.deleteRuleBySelector(d,!1,!1);n.deleteRuleBySelector(h,!1,!1);$(s).removeAttr('data-wv-res-id');this.isActive=!1;$(this.btnList).removeClass('active')};n.refreshStyleElementText()}};this.getResIdSelectorText=function(t){return'[data-wv-res-id="'+t+'"]'}};bm.extend(ToolBtnBase,ToolBtnTableScroll);ToolBtnTableScroll.prototype.setStyleBtn=function(){var t=this;if(!t.target||bm.toolManager.isMultiSelectMode){t.resetStyleBtn();return!1};var i=t.target.tagName.toLowerCase()!=='table'?$(t.target).find('table')[0]:t.target,r=$(i).closest('div:not([data-wv-layout-element="block_inner"])')[0],e=null;if(bm.bmEditorManager.registedBoardEditor===!1){e=WVAdminResourceManager.getEmbededStyleObject(null,t.target)};if(i&&e){var n=e.getRulesBySelectorText(this.getResIdSelectorText(WVAdminResourceManager.getResourceId(i,!0)),null,!1,!1),o=e.getRulesBySelectorText(this.getResIdSelectorText(WVAdminResourceManager.getResourceId(r,!0)),null,!1,!1),a=!1,s=!1;if(n.length>0&&o.length>0){a=parseInt(n[0].style.minWidth.slice(0,-2))>0;s=o[0].style.overflowX==='auto'};if(a&&s){$(this.btnList).addClass('active');this.isActive=!0}
else{$(this.btnList).removeClass('active');this.isActive=!1}}};ToolBtnTableScroll.prototype.addEvent=function(){var t=this};ToolBtnTableScroll.prototype.removeEvent=function(){var t=this};var ToolBtnSvg=function(t){this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);this.selectedSvgTag=null;this.selectedSvg=null;this.changeSvgTag=null;this.changeSvg=null;this.categoryId=null;this.addOption(this.colorPicker);this.addOption(new ToolOpSvg(),'widthType');this.addOption(this.colorPicker,'svgfillColorExpand');this.addOption(this.colorPicker,'svgstrokeColorExpand');this.onOptionChange=function(t,e,i,n){if(t&&t.toLowerCase().includes('color')==!0){if(t==='ToolOpColorPicker'&&typeof(n)==='object'){const prop=$(n).attr('data-wv-tool-btn-prop');if(prop&&prop.includes('fill')===!0)n='fill';else if(prop&&prop.includes('stroke')===!0)n='stroke'};this.setColor(t,e,i,n)}
else if(t&&t.toLowerCase().includes('normal')){this.setSize('auto',t,!1)}
else if(t&&t.toLowerCase().includes('fit')){this.setSize('fit-content',t,!1)}
else if(t&&t.toLowerCase().includes('fill')){this.setSize('100%',t,!1)}
else if(t&&t.toLowerCase().includes('fixed')){this.setSize(this['btnList']['width']['value'],t,!1)}};this.onBtnClick=function(t,e){this.selectedSvgTag=$(this.target);this.selectedSvg=$(this.target).find('.wveditor_svg svg').length>0?$(this.target).find('.wveditor_svg svg'):$(this.target).find('.wveditor_svg .material-symbols-outlined');switch(e){case'svgPopOpen':this.openChangeSvg(this.selectedSvgTag,this.selectedSvg);break;case'svg_horizontal':this.flipSvg('flip','horizontal');break;case'svg_vertical':this.flipSvg('flip','vertical');break;case'svg_left':this.flipSvg('rotate','left');break;case'svg_right':this.flipSvg('rotate','right');break};t.preventDefault()};this.setSize=function(t,e,i){var n=this.target,a=$(n).find('svg').length>0?$(n).find('svg'):$(n).find('.material-symbols-outlined'),s=a.width(),r=a.height(),l=r/s;bm.toolManager.toolBtnEditBefore(this,n,HistoryType.EDITOR_SVG);if(i===!0){var o={width:t+'px',maxWidth:'',height:'',minHeight:'',fontSize:t+'px'}}
else{var o={width:t,maxWidth:'',height:'',minHeight:'',fontSize:t+'px'}};this.applyStyle(o);bm.toolManager.kitReposition();bm.toolManager.toolBtnEditAfter(this,n,HistoryType.EDITOR_SVG);this.hideOption(this.optionList['widthType'],this.btnList['widthType']);if(i===!1){this.setWidthType(e)}};this.getHasFillOrStroke=function(t){let hasFill=!1;let hasStroke=!1;const fillNode=$(t).find('[fill]')[0];const strokeNode=$(t).find('[stroke]')[0];if(fillNode){const fillAttr=$(fillNode).attr('fill');if(fillAttr!==''&&fillAttr!==undefined&&fillAttr!=='none'){hasFill=!0}};if(strokeNode){const strokeAttr=$(strokeNode).attr('fill');if(strokeAttr!==''&&strokeAttr!==undefined){hasStroke=!0}};return{hasFill:hasFill,hasStroke:hasStroke}};this.setColor=function(t,e,i,n){var o=this.target;const currentSVG=$(o).find('svg').length>0?$(o).find('svg'):$(o).find('.material-symbols-outlined');var h=this;bm.toolManager.toolBtnEditBefore(this,o,HistoryType.EDITOR_SVG);currentSVG.removeClass('svg_point0');currentSVG.removeClass('svg_point1');currentSVG.removeClass('svg_point2');if(typeof(e)==='string'&&e.indexOf('applyPoint')>-1){var p=e.replace('applyPoint',''),u='svg_point'+p;currentSVG.addClass(u)}
else{if(t==='ToolOpColorPicker'){var d=$(this.colorPicker.element).find('input.opacity').val()}
else{var d=$(h.btnList['svg'+n+'OpacityInput']).val()};if(isExpertMode){var r=parseInt(d)/100}
else{var r=((100-parseInt(d))/100)};if(typeof(e)==='object'){var f='rgb('+e.r+', '+e.g+', '+e.b+')',s=bm.number.rgbToHex(f)}
else{var s=e};var l=bm.number.hexToRgb(e),a=r==1?e:'rgba('+l.r+', '+l.g+', '+l.b+', '+r+')';if(n==='fill')var c={fill:a,color:a};else if(n==='stroke')var c={stroke:a,color:a};this.applyStyle(c)};bm.toolManager.toolBtnEditAfter(this,o,HistoryType.EDITOR_SVG);$(h.btnList['svgColorInput']).val(s);$(h.btnList['svgOpacityInput']).val(r*100+'%');$('#svgColorPicker').val(s);if(t==='ToolOpColorPicker'){$(this.colorPicker.element).find('input.color_option_prev').val(s)}};this.setWidthType=function(t){this.applyType=t;this.setSelectedValue(bm.string.toUpperCaseFirstChar(t),'widthType')};this.applyStyle=function(t){var r=this,o=$(this.target).find('.wveditor_svg'),n=o.length;if(n==0){alert('적용할 대상이 선택되지 않았습니다.');return};var e=null;if(bm.bmEditorManager.registedBoardEditor===!1){e=WVAdminResourceManager.getEmbededStyleObject(null,r.target)};var i,s,n=o.length;for(i=0;i<n;i++){s=o[i];var a=$(s).closest('[data-wv-layout-element="block"]');function l(t,i,n){if(Object.keys(t).indexOf(i)>-1){n.find('['+i+']').removeAttr(i)};$(n).find('style').remove();$(n).find('script').remove();const svgSelector='[data-wv-res-id="'+$(n).attr('data-wv-res-id')+'"] svg';if(e.styleElement.outerHTML.indexOf(svgSelector)>0){e.deleteRuleBySelector(svgSelector,!1,!0);e.applyResourceStyle(svgSelector,{width:'100%',height:'100%'},!1,!0)}};l(t,Object.keys(t)[0],a);e.applyResourceStyle(a,t,!1,!0)};e.refreshStyleElementText();this.setStyleBtn()};this.getFormatValue=function(t){if(t!=0&&t!='0'&&t!=''&&!isNaN(t)){t=$.trim(t)}
else{t=''};return t};this.openChangeSvg=function(t,e){bm.popupManager.add('#svgChangePopup',null,null,null,null,!0,!1,100015);this.svgMenuClick()};this.cancel=function(){this.closeChangeSvg()};this.closeChangeSvg=function(){bm.popupManager.removePopLatest(!0)};this.svgMenuClick=function(t){var n=this,e,a=[];$('#svg_selectView_grid > *').remove();$('#svg_selectView_grid_myIcon .svg_item_con.real').remove();$('#svg_menuList').find('li').removeClass('active');if(!t){$($('.svg_menu')[0]).addClass('active')}
else{$(t.target).addClass('active');e=$(t.target).text()};if(e==='전체')e='';if(e==='MY 아이콘'){$('#svg_selectView_grid').hide();$('#svg_selectView_grid_googleMaterial').hide();$('#svg_selectView_grid_myIcon').show();$('#svg_selectView_grid_myIcon input').on('change',this.svgValCheck);$('.svg_desc_con').show();$('.svg_search_con').hide()}
else if(e&&typeof(e)==='string'&&e.toLowerCase()==='googlematerial'){$('#svg_selectView_grid_googleMaterial').show();$('#svg_selectView_grid_myIcon').hide();$('#svg_selectView_grid_myIcon input').off('change');$('.svg_desc_con').hide();$('.svg_search_con').show()}
else{$('#svg_selectView_grid').show();$('#svg_selectView_grid_googleMaterial').hide();$('#svg_selectView_grid_myIcon').hide();$('#svg_selectView_grid_myIcon input').off('change');$('.svg_desc_con').hide();$('.svg_search_con').hide()};if(e){var o=e.split(' ');for(var i=0;i<o.length;i++){a.push(o[i])}};if(e==='MY 아이콘'){n.svgSearch('MY_ICON',$('#svg_selectView_grid_myIcon'))}
else if(e&&typeof(e)==='string'&&e.toLowerCase()==='googlematerial'){n.svgSearch('googleMaterial',$('#svg_selectView_grid_googleMaterial'))}
else{n.svgSearch('BLOCK',$('#svg_selectView_grid'),a)}};this.onGetBlockData=function(t,e,n){var s=this,a,o;for(let i=0;i<e.length;i++){o=e[i];if(t==='BLOCK'){if(o['search_category_list'].includes(this.categoryId)||o['tag_name'].includes('아이콘')){a='<div class="col-2 svg_item_con real"><div data-wv-toolbar-side-block-html="'+o.html+'" class="svg_item" style="background-image: url('+o.thumbnail+');"></div></div>';n.prepend(a)}}
else if(t==='MY_ICON'){var r=fixedEncodeURI(o.file_src);a='<div class="col-2 svg_item_con real"><div id="svg_item_delete" class="svg_item_delete"></div><div data-wv-toolbar-side-block-html="'+o.html+'" class="svg_item" style="background-image: url('+r+');"></div></div>';n.prepend(a)};if(i===e.length-1){if(n.find('.svg_item_con.add').length>0){n.find('.svg_item_con.real').first().before(n.find('.svg_item_con.add'))};n.find('.svg_item_con.real').on('click',function(t){n.find('.svg_item_con.real').removeClass('active');$(t.target).closest('.svg_item_con.real').addClass('active');s.svgClick(t)});n.find('.svg_item_con.real').on('dblclick',function(t){s.svgChange(t)});n.find('.svg_item_delete').on('click',function(t){s.svgDelete(t)})}}};this.svgSearch=function(t,e,i){var n=this;if(t.toLowerCase()==='googlematerial'){n.googleMaterialSearch('')}
else if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){wvAdminIFrameBridge._WVAdminBlockBar.getBlockData(t,null,null,i,null,!1,function(i,o){n.onGetBlockData(t,i,e)})}
else{wvAdminIFrameBridge._WVAdminBlockBar.getBlockData(t,null,null,n.categoryId?n['categoryId']:'B0013',i,function(i,o){n.onGetBlockData(t,i,e)})}};this.svgClick=function(t,e){if(e===!0){this.changeSvg=$($(t.target).closest('.svg_item_con').find('.material-symbols-outlined')[0].outerHTML)}
else{if($(t.target).attr('data-wv-toolbar-side-block-html')){this.changeSvgTag=$(t.target).attr('data-wv-toolbar-side-block-html')}
else{this.changeSvgTag=$(t.target).find('[data-wv-toolbar-side-block-html]').attr('data-wv-toolbar-side-block-html')}}};this.svgChange=function(t,e){var n=this,o;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,n.selectedSvg)};function a(){n.closeChangeSvg();n.setStyleBtn();wvAdminIFrameBridge._WVLayoutKit.kitRepositioning()};if(e===!0){$(n.selectedSvg).remove();$(n.selectedSvgTag).find('.wveditor_svg').append(n.changeSvg);$(n.changeSvg).css({fontSize:''});o.applyResourceStyle(n.target,{fontSize:$(n.selectedSvgTag)[0].clientWidth+'px',width:'fit-content',minHeight:'auto'},!1,!0);o.refreshStyleElementText();a()}
else{$.get(n.changeSvgTag,function(t,e){var s=t.data['html'];if(!s||s===''||s===undefined){bm.toast('아이콘을 찾을 수 없습니다');return!1}
else{if($(s).find('svg').length>1)n.changeSvg=$(s).find('svg')[0];else n.changeSvg=$(s).find('svg');$(n.changeSvg).removeAttr('fill');var d='[data-wv-res-id="'+$(n.selectedSvg).attr('data-wv-res-id')+'"]',l=o.getRulesBySelectorText(d,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),r;for(let i=0;i<l.length;i++){if(l[i].style.transform){r=l[i].style.transform;break}};const generateUniqueStyleId=(el)=>{let htmlSource=$(el)[0].outerHTML;if(typeof htmlSource==='string'&&htmlSource.indexOf('<style')){htmlSource=htmlSource.replace(/st\d/g,function(t){return WVAdminResourceManager.createResourceId()+t});return htmlSource}
else{return htmlSource}};n.changeSvg=generateUniqueStyleId(n.changeSvg);$(n.selectedSvg).remove();$(n.selectedSvgTag).find('.wveditor_svg').append(n.changeSvg);if(r&&!isPrdDetailInfo){o.applyResourceStyle(n.changeSvg,{transform:r},!1,!0);o.refreshStyleElementText()}
else if(r&&isPrdDetailInfo){$(n.changeSvg).css({transform:r})};a()}})}};this.svgDelete=function(t){if(confirm('나의 아이콘을 삭제하시겠습니까?')===!1)return;var i=this;i.changeSvgTag=$(t.target).closest('.svg_item_con ').find('[data-wv-toolbar-side-block-html]').attr('data-wv-toolbar-side-block-html');var e=i.changeSvgTag.split('getBlockHTMLSource?id=')[1];e=e.split('&rev')[0];var n={id:e};bm.httpSendJsonPost(WEB_ROOT+'memberBlock/deleteMyIcon',n,function(t){if(t.result){bm.toast('아이콘이 삭제되었습니다.');$('#svg_selectView_grid_myIcon .svg_item_con.real').remove();i.svgSearch('MY_ICON',$('#svg_selectView_grid_myIcon'))}})};var e=this;this.svgValCheck=function(t,i){var o=this;if(this.files[0]){var n=$(this).val().split('.').pop().toLowerCase();if(n&&$.inArray(n,['svg'])===-1){bm.toast('아이콘은 svg 형태의 파일만 등록가능합니다.');return!1}
else if(this.files[0].size>=500*500){bm.toast('500kb 이하 파일만 등록할 수 있습니다.');return!1}
else{e.regMysvg(this.files[0])}}};this.regMysvg=function(t){var i=new FileReader();i.onload=function(i){var n=i.target.result;n='<div class="col-0" data-wv-layout-element="block" data-wv-block-id="___myIcon_000" data-wv-layout-element-type="svg">'+n+'</div>';if(n){var a=fixedEncodeURI(t.name),s={blockId:'___myIcon_'+(new Date()).getTime()+'',revision:1,sourceHtml:n,file:i.target.result,fileName:a};var o=wvAdminIFrameBridge._WVContentArea.$contentBody.append($(n)).children().last();$(o).css('width',parseInt($(n).width()));bm.httpSendJsonPost(WEB_ROOT+'memberBlock/addMyIcon',s,function(t){if(t.result){bm.toast('아이콘이 등록되었습니다.');$('#svg_selectView_grid_myIcon .svg_item_con.real').remove();e.svgSearch('MY_ICON',$('#svg_selectView_grid_myIcon'));$('#registIcon').val('')};$(o).remove()})}};i.readAsDataURL(t)};this.flipSvg=function(t,e){var n,s,a;if(t==='flip')a=this.target;if(t==='rotate')a=$(this.target).find('svg').length>0?$(this.target).find('svg'):$(this.target).find('.material-symbols-outlined');if(!isPrdDetailInfo){if(bm.bmEditorManager.registedBoardEditor===!1){s=WVAdminResourceManager.getEmbededStyleObject(null,a)};var l='[data-wv-res-id="'+$(a).attr('data-wv-res-id')+'"]',r=s.getRulesBySelectorText(l,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),i,o=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':o=0;break;case'768':o=1;break;case'992':o=2;break;case'1200':o=3;break;case'1600':o=4;break};for(let o=0;o>=0;o--){if(r[o].style.transform){i=r[o].style.transform;break}}}
else if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){var i=$(a)[0].style.transform};if(t==='flip'){if(e==='horizontal'){if(i===undefined||i===''||i==='rotate(0deg)')n={transform:'scale(-1, 1)'};if(i==='scale(-1, -1)')n={transform:'scale(1, -1)'};if(i==='scale(1, -1)')n={transform:'scale(-1, -1)'};if(i==='scale(-1, 1)')n={transform:'scale(1, 1)'};if(i==='scale(1, 1)')n={transform:'scale(-1, 1)'}};if(e==='vertical'){if(i===undefined||i===''||i==='rotate(0deg)')n={transform:'scale(1, -1)'};if(i==='scale(-1, -1)')n={transform:'scale(-1, 1)'};if(i==='scale(-1, 1)')n={transform:'scale(-1, -1)'};if(i==='scale(1, -1)')n={transform:'scale(1, 1)'};if(i==='scale(1, 1)')n={transform:'scale(1, -1)'}}};if(t==='rotate'){if(e==='right'){if(i===undefined||i===''||i==='')n={transform:'rotate(90deg)'};if(i==='rotate(90deg)')n={transform:'rotate(180deg)'};if(i==='rotate(180deg)')n={transform:'rotate(270deg)'};if(i==='rotate(270deg)')n={transform:'rotate(0deg)'};if(i==='rotate(0deg)')n={transform:'rotate(90deg)'}};if(e==='left'){if(i===undefined||i===''||i==='')n={transform:'rotate(270deg)'};if(i==='rotate(270deg)')n={transform:'rotate(180deg)'};if(i==='rotate(180deg)')n={transform:'rotate(90deg)'};if(i==='rotate(90deg)')n={transform:'rotate(0deg)'};if(i==='rotate(0deg)')n={transform:'rotate(270deg)'}}};if(!isPrdDetailInfo){s.applyResourceStyle(a,n,!1,!0,!1,!0);s.refreshStyleElementText()}
else if(isPrdDetailInfo){$(a)[0].style.transform=n.transform};bm.toolManager.kitReposition();this.setStyleBtn()};this.googleMaterialSearch=function(t){if(!t||t.trim()===''){this.googleMaterialReset()}
else{if(t.length===1||!GoogleMaterialIconList){return!1};const resultArr=GoogleMaterialIconList.filter((name)=>{if(name.includes(t)===!0){return!0}});if(resultArr.length===0){return!1};this.newSetgoogleMaterial(resultArr)}};this.googleMaterialReset=function(){const materialView=$('#svg_selectView_grid_googleMaterial')[0];$(materialView).empty();$('.svg_search_input').val('');this.newSetgoogleMaterial(JSON.parse(JSON.stringify(GoogleMaterialIconList)).splice(0,ToolBtnSvg.prototype.numPerPage))};this.newSetgoogleMaterial=function(t){const _this=this;const materialView=$('#svg_selectView_grid_googleMaterial')[0];$(materialView).empty();for(let i=0;i<t.length;i++){$(materialView).append('<div class="col-2 svg_item_con real"><div class="material-symbols-outlined" style="font-size: 40px;">'+t[i]+'</div></div>')};$(materialView).find('.svg_item_con.real').off('click').on('click',function(t){$(materialView).find('.svg_item_con.real').removeClass('active');$(t.target).closest('.svg_item_con.real').addClass('active');_this.svgClick(t,!0)});$(materialView).find('.svg_item_con.real').off('dblclick').on('dblclick',function(t){_this.svgChange(t,!0)});return!0}};bm.extend(ToolBtnBase,ToolBtnSvg);ToolBtnSvg.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length||$(t.target).attr('data-wv-layout-element-type')!=='svg'){t.resetStyleBtn();return!1};const currentTarget=$(this.target).find('svg').length>0?$(this.target).find('svg'):$(this.target).find('.material-symbols-outlined');var e=currentTarget.width(),i=currentTarget.height();$(t.btnList['width']).val(e);$(t.btnList['height']).val(i);if(isExpertMode){const currentColor=this.getCurrentColor();const fillhex=bm['number'].rgbToHex(bm['number'].rgbaObjToStr(currentColor['fillrgb']));const strokehex=bm['number'].rgbToHex(bm['number'].rgbaObjToStr(currentColor['strokergb']));const cloneSvg=$(t['target']).find('svg').length>0?$(t['target']).find('svg').clone().css({width:'50%',height:'50%'}):$(t['target']).find('.material-symbols-outlined').clone().css({fontSize:'119px'});$(cloneSvg).find('path').attr('fill',fillhex).attr('stroke',strokehex);$('#svgPreview').empty().append(cloneSvg);$(t.btnList['svgfillColorInput']).val(fillhex);$(t.btnList['svgstrokeColorInput']).val(strokehex);$(t.btnList['svgfillOpacityInput']).val(currentColor['fillalpha']+'%');$(t.btnList['svgstrokeOpacityInput']).val(currentColor['strokealpha']+'%');const defaultHex='#d9d9d9';if(fillhex)$('#svgfillColorPicker').val(fillhex);else $('#svgfillColorPicker').val(defaultHex);if(strokehex)$('#svgstrokeColorPicker').val(strokehex);else $('#svgstrokeColorPicker').val(defaultHex);t.setWidthType('Normal')}};ToolBtnSvg.prototype.resetStyleBtn=function(){var t=this};ToolBtnSvg.prototype.addEvent=function(){const _this=this;$(_this.btnList['width']).on('focus',function(t){t.stopImmediatePropagation();$(this).select()});$(_this.btnList['width']).on('keydown',function(t){if(t.keyCode==13){t.stopImmediatePropagation();var e=_this.getFormatValue($(this).val());$(this).val(e);if(e){_this.setSize(e,'Fixed',!0)}}});$('#svgChangeCancel').on('click',function(){_this.cancel()});$('#svg_menuList').find('li').on('click',function(t){t.stopImmediatePropagation();_this.svgMenuClick(t)});$('#svgChangeApply').on('click',function(t){t.stopImmediatePropagation();if(_this.changeSvgTag===undefined){bm.toast('변경할 svg가 존재하지 않습니다.');return!1};const GoogleMaterialMenu=$('#svg_menuList').children()[2];if(GoogleMaterialMenu.textContent.toLowerCase()==='googlematerial'&&$(GoogleMaterialMenu).hasClass('active')){_this.svgChange(t,!0)}
else{_this.svgChange(t,!1)};bm.toast('아이콘이 변경되었습니다.\n')});$('.svg_search_input').off('keyup').on('keyup',function(t){_this.googleMaterialSearch(this.value)});$('.svg_search_submit').off('click').on('click',function(){_this.googleMaterialSearch($('.svg_search_input')[0].value)});$('.svg_search_reset').off('click').on('click',function(){_this.googleMaterialReset()});if(isExpertMode){const applyArr=['fill','stroke'];for(let i=0;i<applyArr.length;i++){$(this['btnList']['svg'+applyArr[i]+'ColorInput']).off('keydown').on('keydown',function(t){if(t.keyCode==13){_this.onOptionChange('color',this['value'],!1,applyArr[i])}});$(this['btnList']['svg'+applyArr[i]+'OpacityInput']).off('keydown').on('keydown',function(t){if(t.keyCode==13){_this.onOptionChange('color',_this.btnList['svg'+applyArr[i]+'ColorInput']['value'],!1,applyArr[i])}});$('#svg'+applyArr[i]+'ColorPicker').off('change').on('change',function(){_this.onOptionChange('color',this['value'],!1,applyArr[i])})}}};ToolBtnSvg.prototype.removeEvent=function(){var t=this;$(t.btnList['width']).off('focus');$(t.btnList['width']).off('keydown');$(t.btnList['height']).off('focus');$(t.btnList['height']).off('keydown');$('#svgChangeCancel').off('click');$('#svg_menuList').find('li').off('click');$('#svg_selectView_grid').find('data-wv-toolbar-side-block-html').off('click');$('#svgChangeApply').off('click')};ToolBtnSvg.prototype.getCurrentColor=function(){var r,l,d,h,n,t=this,e='';if($(t.target).hasClass('svg_point0')){e='svg_point0'}
else if($(t.target).hasClass('svg_point1')){e='svg_point1'}
else if($(t.target).hasClass('svg_point2')){e='svg_point2'};if(e!=''){var i=e.replace('svg_point','');i=parseInt(i);n=i}
else{n=-1};var a=$(t.target).find('path').length>0?$(t.target).find('path').css('fill'):bm.getStyle($(t.target).find('.material-symbols-outlined'),'color'),s=$(t.target).find('path').length>0?$(t.target).find('path').css('stroke'):bm.getStyle($(t.target).find('.material-symbols-outlined'),'color');function o(t){var i,e=0;if(t.indexOf('#')!=-1){i=t}
else if(t==='none'){i='none';e=100}
else{if(parseFloat(t.split(',')[3])&&t){if(isExpertMode){e=parseFloat((parseFloat(t.split(',')[3])).toFixed(2));e*=100}
else{e=parseFloat((1-parseFloat(t.split(',')[3])).toFixed(2));e*=100}}
else{e=100};i=bm.number.rgbToHex(t)};return{rgb:bm.number.hexToRgb(i),alpha:e}};let fill=o(a);let stroke=o(s);return{fillrgb:fill.rgb,fillalpha:fill.alpha,strokergb:stroke.rgb,strokealpha:stroke.alpha}};ToolBtnSvg.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);const currentColor=this.getCurrentColor();function i(t,e,i){const _this=i;if(t){_this.colorPicker.setStyleValue(t.r,t.g,t.b,e/100)}
else{_this.colorPicker.setStyleValue(null,null,null,null,null,null,null,null,!0)}};if(this.btnList['svgfillColorExpand']===e)i(currentColor.fillrgb,currentColor.fillalpha,this);else if(this.btnList['svgstrokeColorExpand']===e)i(currentColor.strokergb,currentColor.strokealpha,this);if(isExpertMode&&t.type==='ToolOpColorPicker'){$(t.element).closest('.tool_form_style_0_content').append(t.element)}};var ToolBtnLine=function(t){this.type=t;this.colorPicker=ToolOpColorPicker.get(this,t);this.thickMin=1;this.thickMax=10;this.styleSelect=app.getWvCom('lineStyleSelect');if(isExpertMode){this.addOption(this.colorPicker,'lineColorExpand')}
else{this.addOption(this.colorPicker)};if(window['ToolOpLine']){this.addOption(new ToolOpLine(),'mainBtn')};this.onOptionChange=function(t,e){if(t.includes('WVLocalStyle')===!0){if(t.includes('apply')){this.optionList['lineColorExpand']['componentList']['WVLocalStyle'].apply(t,e,this)}
else if(t.includes('delete')){this.optionList['lineColorExpand']['componentList']['WVLocalStyle'].delete(t,e,this)};return!0};if(typeof(e)==='object'&&bm.number.isHex(e['border-color'])===!0){e['border-color']='#'+e['border-color'].replaceAll('#','')}
else if(typeof(e)==='string'&&bm.number.isHex(e)===!0){e='#'+e.replaceAll('#','')};if(t==='color'){if(e['border-color']){this.setColor(e['border-color'])}
else{this.setColor(e)}}
else if(t==='ToolOpColorPicker'){if(e.length===7&&typeof(e)==='string'){this.setColor(e,t);$('#lineColorPicker').val(e.toUpperCase());$(this.btnList['lineColorInput']).val(e.toUpperCase().replaceAll('#',''));var o=$(this.colorPicker.element).find('.color_input.opacity').val();$(this.btnList['lineOpacityInput']).val(o);$(this.colorPicker.element).find('input.color_option_prev').val(e)}
else{var n=bm.number.rgbaObjToStr(e),i=bm.number.rgbToHex(n);this.setColor(n);$('#lineColorPicker').val(i.toUpperCase());$(this.btnList['lineColorInput']).val(i.toUpperCase());$(this.btnList['lineOpacityInput']).val(e.a*100+'%');$(this.colorPicker.element).find('input.color_option_prev').val(i)}}
else{this.setColor(e)}};this.onBtnClick=function(t,e){var i=this;switch(e){case'solid':case'dotted':case'dashed':this.activeTypeBtn(t.target,function(){i.setLineStyle()});break;case'widthUp':this.changeBtnValueByOne('width','up',this.setLineSize());break;case'widthDown':this.changeBtnValueByOne('width','down',this.setLineSize());break;case'heightUp':this.changeBtnValueByOne('height','up',this.setLineSize());break;case'heightDown':this.changeBtnValueByOne('height','down',this.setLineSize());break;case'lib_name':this.optionList['lineColorExpand'].showComponent(this.optionList['lineColorExpand'].componentList['WVLocalStyle'],t.target,'edit');break;case'lib_detach':this.optionList['lineColorExpand'].componentList['WVLocalStyle'].libDetach(this);break;case'lib_remove':this.optionList['lineColorExpand'].componentList['WVLocalStyle'].libRemove(this);break}};this.patchParam=function(){var t=$(this.target).find('.wveditor_line hr');if(t.css('borderRightStyle')==='none'){$(this.target).attr('data-wv-layout-element-param','horizon')}
else{$(this.target).attr('data-wv-layout-element-param','vertical')}};this.setLineSize=function(){var o=$(this.target).find('.wveditor_line hr'),n=parseInt($(this.btnList['width']).val());if(!n){bm.toast('두께를 입력해주세요.','라인 블록');$(this.btnList['width']).focus();return};if(n>this.thickMax||n<this.thickMin){bm.toast('라인 블록의 두께는 '+this.thickMin+'px ~ '+this.thickMax+'px 사이의 값만 적용할 수 있습니다.','라인 블록');$(this.btnList['width']).focus();return};var i=parseInt($(this.btnList['height']).val());if(!i){bm.toast('길이를 입력해주세요.','라인 블록');$(this.btnList['height']).focus().val('');return};if(n>i&&this.widthUnit.includes('px')){if(this.borderType==='borderBottom')bm.toast('가로 라인의 두께는 길이보다 작아야합니다.','라인 블록');else if(this.borderType==='borderRight')bm.toast('세로 라인의 두께는 길이보다 작아야합니다.','라인 블록');$(this.btnList['width']).focus();return};if(this.borderType==='borderBottom'&&this.widthUnit.includes('%')&&i>100){bm.toast('1에서 100 사이의 %값을 입력해주세요','라인 블록');$(this.btnList['height']).focus();return};var e={};var t={};bm.toolManager.toolBtnEditBefore(this,o,HistoryType.EDITOR_LINE);t[this.borderType.toString()+'Width']=n+'px';if(!isPrdDetailInfo){if(this.borderType==='borderBottom'){t['width']='100%';e['width']=i+this.widthUnit;e['height']='auto'}
else{t['width']='auto';t['height']=i+'px';e['width']='fit-content';e['height']='auto'}}
else{if(this.borderType==='borderBottom'){t['width']='100%'}
else{t['width']='auto';t['height']=i+'px';e['width']='fit-content';e['height']='auto'}};this.applyStyle(e,t);bm.toolManager.kitReposition();bm.toolManager.toolBtnEditAfter(this,o,HistoryType.EDITOR_LINE);this.setStyleBtn()};this.setLineStyle=function(){var i=$(this.target).find('.wveditor_line hr'),t;if(!isExpertMode){t=$(this.btnList['solid']).hasClass('active')?'solid':$(this.btnList['dotted']).hasClass('active')?'dotted':'dashed'}
else{t=$(this.btnList['style']).siblings().find('.selected_item').attr('class').replace('selected_item ','').replace('active','')};var e={};bm.toolManager.toolBtnEditBefore(this,i,HistoryType.EDITOR_LINE);e[this.borderType.toString()+'Style']=t;this.applyStyle(null,e);bm.toolManager.toolBtnEditAfter(this,i,HistoryType.EDITOR_LINE)};this.activeTypeBtn=function(t,e){var i=this;$(i.btnList['solid']).removeClass('active');$(i.btnList['dotted']).removeClass('active');$(i.btnList['dashed']).removeClass('active');$(t).addClass('active');e()};this.setColor=function(t,e){var a=$(this.target).find('.wveditor_line hr');a.removeClass('border_point0');a.removeClass('border_point1');a.removeClass('border_point2');if(isExpertMode){var i;if(t.length===7&&typeof(t)==='string'){i=t;var n=bm.number.hexToRgb(i);if(e==='ToolOpColorPicker'){o=$(this.colorPicker.element).find('.color_input.opacity').val()}
else{o=$(this.btnList['lineOpacityInput']).val()};i=o===1?i:'rgba('+n.r+', '+n.g+', '+n.b+', '+o+')'}
else{t=bm.number.rgbaToObj(t);i='rgba('+t.r+', '+t.g+', '+t.b+', '+t.a+')'}}
else{if(t.indexOf('applyPoint')>-1){var l=t.replace('applyPoint',''),d='border_point'+l;a.addClass(d);return};var i=$(this.colorPicker.element).find('.color_code_input').val(),r=$(this.colorPicker.element).find('.color_input.opacity').val(),o=((100-parseInt(r))/100),n=bm.number.hexToRgb(i);i=o===1?i:'rgba('+n.r+', '+n.g+', '+n.b+', '+o+')'};var s={};bm.toolManager.toolBtnEditBefore(this,a,HistoryType.EDITOR_LINE);s[this.borderType.toString()+'Color']=i;this.applyStyle(null,s);bm.toolManager.toolBtnEditAfter(this,a,HistoryType.EDITOR_LINE)};this.applyStyle=function(t,e){var h=this,r=$(this.target).find('.wveditor_line > hr'),l=r.length;if(l===0){alert('적용할 대상이 선택되지 않았습니다.');return};if(t!=null||e!=null){var n=null;if(bm.bmEditorManager.registedBoardEditor===!1){n=WVAdminResourceManager.getEmbededStyleObject(null,h.target)};var i,s;for(i=0;i<l;i++){s=r[i];var a=$(s).closest('[data-wv-layout-element="block"]'),o;if(t===null){o=a.attr('data-wv-res-id')}
else{o=n.applyResourceStyle(a,t,!1,!1)[0]};var d='[data-wv-res-id="'+o+'"] hr';n.applyResourceStyle(d,e,!1,!1)};n.refreshStyleElementText()}};this.getFormatValue=function(t,e){if(isExpertMode){if(t==='width'){if(e!=0&&e!='0'&&e!=''&&!isNaN(e)){e=$.trim(e)}
else{e=''}}
else if(t==='height'){if(e!=0&&e!='0'&&e!=''){e=$.trim(e);if(e.includes('%')){this.widthUnit='%'}
else if(e.includes('px')){this.widthUnit='px'}
else{e=e+'%';this.widthUnit='%'}}
else{e=''}}}
else{if(e!=0&&e!='0'&&e!=''&&!isNaN(e)){e=$.trim(e)}
else{e=''}};return e};this.getLineInfo=function(){this.patchParam();var n=this,i=$(this.target).find('.wveditor_line hr'),a=null;if(bm.bmEditorManager.registedBoardEditor===!1){a=WVAdminResourceManager.getEmbededStyleObject(null,this.target)};var h='[data-wv-res-id="'+$(this.target).attr('data-wv-res-id')+'"]',c=a.getRulesBySelectorText(h,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),t='',e=0;switch(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal){case'480':e=0;break;case'768':e=1;break;case'992':e=2;break;case'1200':e=3;break;case'1600':e=4;break};if(i.css('borderRightStyle')==='none'){this.borderType='borderBottom'}
else{this.borderType='borderRight'};var l=i.css(this.borderType+'Color'),d=i.css(this.borderType+'Style'),o=i.css(this.borderType+'Width');$(this.btnList['%']).removeClass('active');$(this.btnList['px']).removeClass('active');if(this.borderType==='borderBottom'){t=c[e].style.width;if(t.includes('%')||t==''){this.widthUnit='%'}
else{this.widthUnit='px'};$(n.btnList['height']).next().text('');$(n.btnList['height']).siblings('div').css('display','')}
else{this.widthUnit='px';t=i.height();$(n.btnList['height']).next().text('px');$(n.btnList['height']).siblings('div').css('display','none')};$(this.btnList[this.widthUnit]).addClass('active');var s=isNaN(parseFloat(o))===!0?100:parseFloat(o),r=isNaN(parseFloat(t))===!0?100:parseFloat(t);return{type:this.borderType,color:l,style:d,width:Math.round(s),height:Math.round(r)}};this.timer;this.setKeyUpTargetValue=function(t,e){if(!isExpertMode){if(t.keyCode===8||(t.keyCode>=48&&t.keyCode<=57)||(t.keyCode>=96&&t.keyCode<=105)){var i=this,n=i.target;clearTimeout(i.timer);i.timer=setTimeout(function(){if(n!=i.target)return!1;t.stopImmediatePropagation();var o=i.getFormatValue($(e).val());$(e).val(o);if(o){i.setLineSize()}},500)}}}};bm.extend(ToolBtnBase,ToolBtnLine);ToolBtnLine.prototype.setStyleBtn=function(){var t=this,i=wvAdminIFrameBridge._WVContentArea.designMode===EDITOR_MODE.BOARD;if(i){if(!$(t.target).find('.wveditor_line hr').length){return}}
else{if(!$(t.target).find('> .wveditor_line hr').length){return}};if(!t.target||t.target.length){t.resetStyleBtn();return!1};if(i){if(!this.optionList['ToolOpLine']){this.addOption(new ToolOpLine(),'ToolOpLine')}};if(i){setTimeout(function(){if(t.isMouseDown_widthUp){t.changeBtnValueByOne('width','up',t.setLineSize())};if(t.isMouseDown_widthDown){t.changeBtnValueByOne('width','down',t.setLineSize())};if(t.isMouseDown_heightUp){t.changeBtnValueByOne('height','up',t.setLineSize())};if(t.isMouseDown_heightDown){t.changeBtnValueByOne('height','down',t.setLineSize())}},50)};var e=t.getLineInfo();$(t.btnList['width']).val(e.width);$(t.btnList['height']).val(e.height+t.widthUnit);if(!isExpertMode){$(t.btnList['solid']).removeClass('active');$(t.btnList['dotted']).removeClass('active');$(t.btnList['dashed']).removeClass('active');$(t.btnList[e.style]).addClass('active')}
else{$(t.btnList['style']).addClass(e.style);$(t.btnList['style']).siblings().find('.selected_item').removeClass('solid dotted dashed');$(t.btnList['style']).siblings().find('.selected_item').addClass(e.style);var n=bm.number.rgbToHex(e.color),o=bm.number.rgbaToObj(e.color).a*100;$(t.btnList['lineColorInput']).val(n.toUpperCase().replaceAll('#',''));$('#lineColorPicker').val(n);$(t.btnList['lineOpacityInput']).val(o+'%')}};ToolBtnLine.prototype.resetStyleBtn=function(){var t=this};ToolBtnLine.prototype.addEvent=function(){var t=this;$(t.btnList['px']).on('focus',function(){$(t.btnList['%']).removeClass('active');$(t.btnList['px']).addClass('active');t.widthUnit='px'});$(t.btnList['%']).on('focus',function(){$(t.btnList['px']).removeClass('active');$(t.btnList['%']).addClass('active');t.widthUnit='%'});$(t.btnList['width']).on('focus',function(t){t.stopImmediatePropagation();$(this).select()});$(t.btnList['width']).on('change',function(e){e.stopImmediatePropagation();var i=t.getFormatValue('width',$(this).val());$(this).val(i);if(i){t.setLineSize()}});$(t.btnList['height']).on('focus',function(t){t.stopImmediatePropagation();$(this).select()});$(t.btnList['height']).on('change',function(e){e.stopImmediatePropagation();var i=t.getFormatValue('height',$(this).val());$(this).val(i);if(i){t.setLineSize()}});$('#lineColorPicker').on('change',function(e){e.stopImmediatePropagation();$(t.btnList['lineColorInput']).val(this.value.toUpperCase().replaceAll('#',''));t.onOptionChange('color',{'border-color':this.value})});$('#lineStyleBtn').on('click',function(e){e.stopImmediatePropagation();if(t.styleSelect.isActive){t.styleSelect.close()}
else{t.styleSelect.open()}});$(t.btnList['style']).on('change',function(e){e.stopImmediatePropagation();var i=$(e.target).val();$(t.btnList['style']).siblings().find('.selected_item').removeClass('solid dotted dashed').addClass(i);$(t.btnList['style']).siblings().find('li').removeClass('active');$(t.btnList['style']).siblings().find('li[data-value=\''+i+'\']').addClass('active');t.setLineStyle()});$(t.btnList['lineColorInput']).on('keydown',function(e){if(e.keyCode===13){e.stopImmediatePropagation();var i=this.value;if(bm.number.isHex(i)==!1){bm.toast('올바른 색상코드를 입력해주세요.');return!1};t.onOptionChange('color',{'border-color':i});$(this).val(i.toUpperCase().replaceAll('#',''));$('#lineColorPicker').val('#'+i.toUpperCase().replaceAll('#',''))}});$(t.btnList['lineOpacityInput']).on('keyup',function(e){if(e.keyCode===13){e.stopImmediatePropagation();var n=parseInt(this.value);if(n<0||n>100){bm.toast('라인 색상 투명도는 0부터 100 사이 값만 적용할 수 있습니다.');return!1};var i=bm.number.hexToRgb($(t.btnList['lineColorInput']).val());i.a=parseFloat(n)/100;var o='rgba('+i.r+', '+i.g+', '+i.b+', '+i.a+')';t.onOptionChange('color',{'border-color':o});$(this).val(n+'%')}});$(this.btnList['lineOpacityInput']).on('keyup',function(){var t=$(this).val();if(t.indexOf('%')===-1&&!bm.valid.isOnlyNum(t)||!/^\d+(%{0,1})$/.test(t)){$(this).val(0);bm.toast('숫자를 입력해주세요.');return!1}});if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){this.setBtnValueByOne('widthUp',this,'isMouseDown_widthUp',function(){t.changeBtnValueByOne('width','up',t.setLineSize())});this.setBtnValueByOne('widthDown',this,'isMouseDown_widthDown',function(){t.changeBtnValueByOne('width','down',t.setLineSize())});this.setBtnValueByOne('heightUp',this,'isMouseDown_heightUp',function(){t.changeBtnValueByOne('height','up',t.setLineSize())});this.setBtnValueByOne('heightDown',this,'isMouseDown_heightDown',function(){t.changeBtnValueByOne('height','down',t.setLineSize())})}};ToolBtnLine.prototype.removeEvent=function(){var t=this;$(t.btnList['width']).off('focus');$(t.btnList['width']).off('keydown');$(t.btnList['width']).off('keyup');$(t.btnList['height']).off('focus');$(t.btnList['height']).off('keydown');$(t.btnList['height']).off('keyup');$(t.btnList['%']).off('focus');$(t.btnList['px']).off('focus');if(isExpertMode===!0){$('#lineColorPicker').off('change');$('#lineStyleBtn').off('click');$(t.btnList['style']).off('change');$(t.btnList['lineColorInput']).off('keydown');$(t.btnList['lineOpacityInput']).off('keyup')};if(wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.BOARD){$(this.btnList['widthUp']).off();$(this.btnList['widthDown']).off();$(this.btnList['heightUp']).off();$(this.btnList['heightDown']).off()}};ToolBtnLine.prototype.showOption=function(t,e){ToolBtnBase.prototype.showOption.call(this,t,e);if(t.type==='ToolOpColorPicker'&&isExpertMode){$(t.element).closest('.tool_form_style_0_content').append(t.element)};var h,c,f,p,s,i=this,n='';if(!$(i.target).find('.wveditor_line hr').length){return};if(!i.target||i.target.length){return!1};if($(i.target).hasClass('border_point0')){n='border_point0'}
else if($(i.target).hasClass('border_point1')){n='border_point1'}
else if($(i.target).hasClass('border_point2')){n='border_point2'};if(n!=''){var a=n.replace('border_point','');a=parseInt(a);s=a}
else{s=-1};var r=i.getLineInfo(),l=bm.number.rgbToHex(r.color),o=bm.number.hexToRgb(l),d=parseFloat($(this.btnList['lineOpacityInput']).val())/100;this.colorPicker.setStyleValue(o.r,o.g,o.b,d,s)};var ToolBtnTab=function(){this.type='ToolBtnTab';this.onBtnClick=function(t,e){switch(e){case'duplicate':this.duplicateTab();break;case'delete':this.deleteTab();break;case'active':this.applyActiveStyle(e);break}};this.duplicateTab=function(){var i=$(this.target).closest('[data-wv-layout-element-type="tab"]'),t=$(this.target).closest('[data-wv-tab]')[0],n=$(t).index(),e=i.find('[data-wv-tab-content]').eq(n)[0];wvAdminIFrameBridge._WVLayoutKit.duplicateBlock(t);wvAdminIFrameBridge._WVLayoutKit.duplicateBlock(e);$(t).next().removeClass('active');$(e).next().removeClass('active')};this.deleteTab=function(){var e=$(this.target).closest('[data-wv-layout-element-type="tab"]'),t=$(this.target).closest('[data-wv-tab]')[0],i=$(t).index(),n=e.find('[data-wv-tab-content]').eq(i)[0];wvAdminIFrameBridge._WVLayoutKit.removeBlock(n);wvAdminIFrameBridge._WVLayoutKit.removeBlock(t,!0)};this.applyActiveStyle=function(t){bm.toolManager.isTabActiveStyle=!bm.toolManager.isTabActiveStyle;$(this.btnList[t]).toggleClass('active')}};bm.extend(ToolBtnBase,ToolBtnTab);ToolBtnTab.prototype.setStyleBtn=function(){var t=this;if(!$(t.target).closest('[data-wv-tab]').length){bm.toolManager.isTabActiveStyle=!1;return};if(!t.target||t.target.length){t.resetStyleBtn();return!1};if(bm.toolManager.isTabActiveStyle)$(t.btnList['active']).addClass('active');else $(t.btnList['active']).removeClass('active')};ToolBtnTab.prototype.resetStyleBtn=function(){var t=this};ToolBtnTab.prototype.addEvent=function(){var t=this};ToolBtnTab.prototype.removeEvent=function(){var t=this};var ToolBtnGrid=function(){this.type=' ToolBtnGrid';this.addOption(new ToolOpGrid(),'ToolOpGrid');this.onOptionChange=function(t,e){var s=this,n=$($(s.target).closest('[data-wv-list]').find('[data-wv-list-template]')[0]),r=this.getSamplingElement($(n)),o={width:bm.getStyle(r,'width')};bm.toolManager.toolBtnEditBefore(this,n,HistoryType.EDITOR_DOM_WIDTH,o);var a=WVAdminResourceManager.getEmbededStyleObject(null,n);wvAdminIFrameBridge._WVContentArea.changeGridColumn(n,e,function(){var t=$(n).closest('[data-wv-list]').find('[data-wv-list-template]');for(let i=0;i<t.length;i++){if(t[i]!==n){$(t[i]).removeClass('wvelLayoutViewBorderPadding');$(t[i]).removeClass('edit_target_block')}};a.refreshStyleElementText();wvAdminIFrameBridge.toolManager.kitReposition();wvAdminIFrameBridge.resetHitTestBlock()});bm.toolManager.toolBtnEditAfter(this,n,HistoryType.EDITOR_DOM_WIDTH,o)};this.hideOption=function(){};this.selectBoxSet=function(t,e){var n=$(t).siblings().find('li');$(n).removeClass('active');if(e===''){}
else{for(let i=0;i<n.length;i++){if($(n[i]).attr('data-value')===''+e+''){$(n[i]).addClass('active');$(t).siblings().find('.selected_item').text($(n[i]).text())}}}}};bm.extend(ToolBtnBase,ToolBtnGrid);ToolBtnGrid.prototype.setStyleBtn=function(){var n=this,o=$($(n.target).closest('[data-wv-list]').find('[data-wv-list-template]')[0]),e={column:null,columnMobile:null};if(!n.target||n.target.length){n.resetStyleBtn();return!1};if($(o).attr('data-wv-list')==undefined&&$(o).attr('data-wv-list-template')==undefined&&$(o).closest('[data-wv-list]').length===0){n.resetStyleBtn();return!1};this.extractPercentage=function(t){return t.match(/\d+(\.\d+)?/)[0]};var a=$($(o).closest('[data-wv-list]').find('[data-wv-list-template]')[0]),s=null;if(bm.bmEditorManager.registedBoardEditor===!1){s=WVAdminResourceManager.getEmbededStyleObject(null,a)};var r='[data-wv-res-id="'+$(a).attr('data-wv-res-id')+'"]',i=s.getRulesBySelectorText(r,null,!0,!1,wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList()),t=4;if(i.length>=t+1){while(t>=0){if(i[t].style&&i[t].style.width){if(t===4){e.column=parseInt(100/parseInt(this.extractPercentage(i[t].style.width)))};if(t===0){e.columnMobile=parseInt(100/parseInt(this.extractPercentage(i[t].style.width)))}};t--}};if(isExpertMode){this.optionList['ToolOpGrid'].element.find('#gridColumnSet').find('[gridSection] a').removeClass('active');this.optionList['ToolOpGrid'].element.find('#gridMobileColumnSet').find('[gridSection] a').removeClass('active');this.optionList['ToolOpGrid'].element.find('#gridColumnSet').find('[gridSection="'+e.column+'"] a').addClass('active');this.optionList['ToolOpGrid'].element.find('#gridMobileColumnSet').find('[gridSection="'+e.columnMobile+'"] a').addClass('active')}
else{this.optionList['ToolOpGrid'].element.find('#gridColumnSet').find('[gridSection]').removeClass('active');this.optionList['ToolOpGrid'].element.find('#gridColumnSet').find('[gridSection="'+e.column+'"]').addClass('active');this.selectBoxSet($('#gridMobileColumnSet'),e.columnMobile)}};ToolBtnGrid.prototype.resetStyleBtn=function(){var t=this;if(isExpertMode){this.optionList['ToolOpGrid'].element.find('#gridColumnSet').find('[gridSection] a').removeClass('active');this.optionList['ToolOpGrid'].element.find('#gridMobileColumnSet').find('[gridSection] a').removeClass('active')}
else{this.optionList['ToolOpGrid'].element.find('#gridColumnSet').find('[gridSection]').removeClass('active');this.selectBoxSet($('#gridMobileColumnSet'),1)}};ToolBtnGrid.prototype.addEvent=function(){var t=this};ToolBtnGrid.prototype.removeEvent=function(){var t=this};var ToolBtnInsta=function(){this.type=' ToolBtnInsta';this.addOption(new ToolOpInsta(),'ToolOpInsta');this.instaUsernameSec=$(this.optionList['ToolOpInsta'].element).find('[insta_username]');this.instaExplanationSec=$(this.optionList['ToolOpInsta'].element).find('[insta_explanation]');this.onOptionChange=function(t,e){var i=this};this.hideOption=function(){console.log('옵션 숨기기')}};bm.extend(ToolBtnBase,ToolBtnInsta);ToolBtnInsta.prototype.setStyleBtn=function(){var t=this;if(!this.target||$(this.target).attr('data-wv-layout-element-type')!=='insta'){t.resetStyleBtn();return};const linking=$(this.target).attr('instalinking')==='succeed'?!0:!1;const instaUsername=$(this.target).attr('username');const linkingbtn=this.optionList['ToolOpInsta'].optionBtnList['linking'];if(linking===!0){$(this.instaUsernameSec).show();$(this.instaUsernameSec).text(instaUsername);$(linkingbtn).attr('needlink',!1);$(linkingbtn).css({width:'33%',float:'right'});$(linkingbtn).text('연동해제');$(this.instaExplanationSec).text('- 인스타그램 계정과 연동되었습니다.')}
else{t.resetStyleBtn()}};ToolBtnInsta.prototype.resetStyleBtn=function(){var t=this;const linkingbtn=this.optionList['ToolOpInsta'].optionBtnList['linking'];$(this.instaUsernameSec).hide();$(this.instaUsernameSec).text('');$(linkingbtn).attr('needlink',!0);$(linkingbtn).css({width:'',float:''});$(linkingbtn).text('연동하기');$(this.instaExplanationSec).text('- 인스타그램 계정과 연동이 필요합니다.')};ToolBtnInsta.prototype.addEvent=function(){var t=this};ToolBtnInsta.prototype.removeEvent=function(){var t=this};var ToolBtnHeaderFooterSetting=function(){this.type='ToolBtnHeaderFooterSetting';this.$header=null;this.$footer=null;this.addOption(new ToolOpHeaderFooterSetting(),'headerFooterSetting');this.onOptionChange=function(t,e){var n=this,i=$('#WEVEN_IFRAME').contents();this.$header=i.find('[data-wv-inc^=header]')[0];this.$footer=i.find('[data-wv-inc^=footer]')[0];if(t==='changeHeader'){this.appendBlock('header',e);this.removePrevBlock(this.$header)}
else if(t==='changeFooter'){this.appendBlock('footer',e);this.removePrevBlock(this.$footer)}
else if(t==='displayHeader'){this.displayBlock('header')}
else if(t==='displayFooter'){this.displayBlock('footer')}
else{bm.toolManager.toolBtnEditBefore(this,this.$header,HistoryType.EDITOR_CHANGE_LOGO);this.changeLogo(t,e);bm.toolManager.toolBtnEditAfter(this,this.$header,HistoryType.EDITOR_CHANGE_LOGO);this.setStyleBtn()}};this.removePrevBlock=function(t){wvAdminIFrameBridge._WVLayoutKit.removeBlock(t,!0,!0)};this.appendBlock=function(t,e){var c=this,s=e['contentId'],d=e['contentRev'],r=e['contentHtml'],h=e['contentCss'],l=e['contentJs'],o=wvAdminIFrameBridge,n=o._WVContentArea,a=o._WVAdminBlockBar,i=o._WVLayoutKit;let param={};if(isStudio){param={themeId:themeInfo['info']['id'],themeRev:themeInfo['info']['revision']}};$.get(r,param,function(e){if(typeof e=='string'){if(e.indexOf('<title>Error</title>')>-1){o.showLoginPopup();o.toolManager.reset();o.resetControllContentArea();return}
else{e=$.parseJSON(e)}};var c,f;n.setBlockNewResourceId(e.data['html'],s,!0,function(t,e){c=t;f=e});n.addBlockRes(l,s,d,c,'block',function(e,s){var m=$(f).clone(),u;if(e!=null&&e.result){var c=e.data.result,d=c.id;u=n.changeAddBlockTag(m[0].outerHTML)};var p=!1;if(t==='header')p=n.dropElement(u,'headerAdd');else if(t==='footer')p=n.dropElement(u,'footerAdd');if(p!==!1){bm.httpSendJsonPost(WEB_ROOT+'memberBlock/mergeMemberBlock',{id:d,revision:c.revision,type:'0'},function(t){if(t.result){var n=t.data.result,o={css:h,description:c.description,html:r,id:c.id,is_favorite:n.is_favorite,js:l,revision:c.revision,subject:c.subject,thumbnail:c.source_thumb};var i=WVAdminBlockBar.MY_RECENT_BLOCK;if(a.data[i].find(function(t){return t.id===d})==undefined){a.data[i].unshift(o);a.totalBlockCount[i]++;var e=$('[data-side-category-type="MY_RECENT_BLOCK"]').attr('data-side-item-length');e=parseInt(e)?e:0;$('[data-side-category-type="MY_RECENT_BLOCK"]').attr('data-side-item-length',parseInt(e)+1)}}
else{alert(t.message)}});if(m.attr('data-wv-inc')===undefined){if($(i.targetElement).length===0){var g=n.$contentBody.find('[data-wv-block-id="___'+d+'"]').parents('[data-wv-layout-element="block"]');if(g.length>0){events(n).dispatch('selectModeChanged',{mode:'single'});i.attach(g)}
else{n.$contentBody.find('[data-wv-block-id="___'+d+'"]').trigger('mousedown')}};if($(i.targetElement).find('[data-wv-block-id="___'+d+'"]').length>0){i.attach($(i.targetElement).find('[data-wv-block-id="___'+d+'"]'))}
else if($(i.targetElement).attr('data-wv-block-id')==='___'+d){i.attach($(i.targetElement))};let newBlockId=t+'_'+d+'_'+new Date().getTime()+'';i.updateMasterBlock(i.targetElement,newBlockId)}};o.resetControllContentArea()})})};this.changeLogo=function(t,e){var i='',a=$('#WEVEN_IFRAME').contents().find('[data-wv-logo]'),n=e['imgPath'],s=e['width'],o=e['height'];if(t==='whiteBgLogo')i='black';else if(t==='blackBgLogo')i='white';a.each(function(){var t=$(this),e=t.attr('data-wv-logo-param');if(e){e=bm.parsing.parseStrToObj(e);var h=e.color,r=e.maxHeight;if(h===i){var d=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList();$.each(d,function(e,i){var o=t.find('picture > source[media="(min-width: '+i+'px)"]');if(o.length>0){o.attr('srcset',n)}
else{t.find('img').attr('src',n)}});if(r&&o>r){var l=r/o,a=Math.round(s*l);if(t.find('picture').length>0){if(a<=t.outerWidth())t.find('picture').css('width',a);else t.find('picture').css('width','')}
else{if(a<=t.outerWidth())t.find('img').css('width',a);else t.find('img').css('width','')}}}}})};this.onFileManagerFileSelected=function(t,e){var a=$('#WEVEN_IFRAME').contents();this.$header=a.find('[data-wv-inc^=header]')[0];this.$footer=a.find('[data-wv-inc^=footer]')[0];var i=$(e).closest('[data-wv-layout-element="block"]').attr('data-wv-logo-param');if(i){i=bm.parsing.parseStrToObj(i);var n=i.color;if(!n){i['color']='white';const newParam=JSON.stringify(i).replaceAll('"','');$(e).closest('[data-wv-layout-element="block"]').attr('data-wv-logo-param',newParam);i=bm.parsing.parseStrToObj($(e).closest('[data-wv-layout-element="block"]').attr('data-wv-logo-param'));n=i.color};if(n){var o='';if(n==='black')o='whiteBgLogo';else if(n==='white')o='blackBgLogo';bm.popupManager.removePopLatest();var s=t.extension.toLowerCase(),r=new RegExp('png');if(r.test(s)){bm.toolManager.toolBtnEditBefore(this,this.$header,HistoryType.EDITOR_CHANGE_LOGO);this.changeLogo(o,{imgPath:t.thumbImg,width:t.width,height:t.height});bm.toolManager.toolBtnEditAfter(this,this.$header,HistoryType.EDITOR_CHANGE_LOGO)}
else{alert('로고는 png 확장자 파일로만 변경 가능합니다.')}}}};this.displayBlock=function(t){var e,i='';if(t==='header'){e=this.$header;i='헤더'}
else if(t==='footer'){e=this.$footer;i='푸터'};if($(e).length===0){bm.toast('현재 페이지에'+i+' 블록이 존재하지 않습니다.');return};if($(e).is(':visible')){$(e).hide();if(t==='header'){bm.headerEvent.setPaddingAfterSeparateHeader($(e),0);$('[data-wv-tool-option-btn=\'displayHeader\']').addClass('off')}
else{$('[data-wv-tool-option-btn=\'displayFooter\']').addClass('off')}}
else{$(e).show();if(t==='header'){bm.headerEvent.setPaddingAfterSeparateHeader($(e));$('[data-wv-tool-option-btn=\'displayHeader\']').removeClass('off')}
else if(t==='footer'){$('#WEVEN_IFRAME').contents().scrollTop($('#WEVEN_IFRAME').contents().height());$('[data-wv-tool-option-btn=\'displayFooter\']').removeClass('off')}};wvAdminIFrameBridge.toolManager.kitReposition()};if(isExpertMode){this.hideOption=function(t,e){t.deactive()}}};bm.extend(ToolBtnBase,ToolBtnHeaderFooterSetting);ToolBtnHeaderFooterSetting.prototype.setStyleBtn=function(){var t=this,o=$('#WEVEN_IFRAME').contents();this.$header=o.find('[data-wv-inc^=header]')[0];this.$footer=o.find('[data-wv-inc^=footer]')[0];var a=o.find('[data-wv-logo]');if(a.length===0)return!1;var e=t.optionList['headerFooterSetting'].optionBtnList;t.whiteBgLogoImg=$(e['whiteBgLogo']).find('.logo_image');t.blackBgLogoImg=$(e['blackBgLogo']).find('.logo_image');var i=!1,n=!1;a.each(function(){var o=$(this).attr('data-wv-logo-param');if(o){o=bm.parsing.parseStrToObj(o);var a=o.color?o['color']:'black';if(a){var s=wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal,e=$(this).find('picture > source[media="(min-width: '+s+'px)"]').attr('srcset');if(!e)e=$(this).find('img').attr('src');e=fixedEncodeURI(decodeURI(e));if(a==='black'){i=!0;t.whiteBgLogoImg.css('backgroundImage','url('+e+')')}
else if(a==='white'){n=!0;t.blackBgLogoImg.css('backgroundImage','url('+e+')')}}}});if(!i&&!n){$(t.optionList['headerFooterSetting'].element).find('#logoChangeCon').hide()}
else{$(t.optionList['headerFooterSetting'].element).find('#logoChangeCon').show();if(!isExpertMode){$(e['whiteBgLogo']).hide();$(e['blackBgLogo']).hide();if(i)$(e['whiteBgLogo']).show();if(n)$(e['blackBgLogo']).show()}}};ToolBtnHeaderFooterSetting.prototype.showOption=function(t,e){var i=this;ToolBtnBase.prototype.showOption.call(this,t,e);i.setStyleBtn()};ToolBtnHeaderFooterSetting.prototype.resetStyleBtn=function(){var t=this};ToolBtnHeaderFooterSetting.prototype.addEvent=function(){var t=this};ToolBtnHeaderFooterSetting.prototype.removeEvent=function(){var t=this};var ToolBtnRecentBoard=function(){this.type='ToolBtnRecentBoard';this.selectBox=$('#selectRecentBoard');var t=this;this.onBtnClick=function(t,e){switch(e){case'apply':this.apply();break};t.preventDefault()};this.apply=function(){var i=t.target;if(t.target.targetElement)i=t.target.targetElement;if(!i){bm.toast('적용할 대상을 선택해주세요.');return}
else if(!($(i).attr('data-wv-layout-element-type')=='bbs')&&!($(i).attr('data-wv-layout-element-type')=='shop_BBS_recent')){bm.toast('게시판을 선택 후 적용해주세요.');return};var e=bm.parsing.parseStrToObj($(i).attr('data-wv-layout-element-param'));if(!e.shopBBSId){if(!e['bbsTy'])e=$.parseJSON($(i).attr('data-wv-layout-element-param'));if(e['bbsTy'].indexOf('recent')==-1){bm.toast('최근게시물 블록을 선택 후 적용해주세요.');return!1}};if(t.selectBox.val()==''||t.selectBox.val()==null||t.selectBox.val()=='선택하세요'){bm.toast('연결할 게시판을 선택해주세요.');return!1};e['connectBbsId']=t.selectBox.val();$(i).attr('data-wv-layout-element-param',JSON.stringify(e).replace(/"/g,''));if(e.shopBBSId){$(t.target).closest('[data-wv-layout-element="plugin-content"]').attr('data-wv-layout-element-param',JSON.stringify(e).replace(/"/g,''));var n=wvAdminIFrameBridge.iframeWindow.crud[e.shopBBSId].list.bmList}
else{var n=wvAdminIFrameBridge.iframeWindow.crud[e.bbsId].list.bmList};var o=bm.parsing.parseStrToObj($(n.container).attr('data-wv-option'));o.param.connectBbsId=e['connectBbsId'];n.setParam(o.param);n.load();n.onComplete=function(){bm.toast('게시판 연결이 완료되었습니다.')}}};bm.extend(ToolBtnBase,ToolBtnRecentBoard);ToolBtnRecentBoard.prototype.addEvent=function(){var t=this};ToolBtnRecentBoard.prototype.removeEvent=function(){var t=this};var ToolBtnImageEdit=function(){this.type='ToolBtnImageEdit';this.imageEditor=bm.imageEditor;this.selectedItem=null;var t=this;this.onBtnClick=function(t,e){var o=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),n=o.reverse().indexOf(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal);if($(this.target).find('picture').length>0&&(n>-1&&n<4)){this.selectedItem=$(this.target).find('picture > source')[n];this.selectedItemSrc=this.selectedItem.getAttribute('srcset');var i=new Image();i.src=this.selectedItemSrc;this.openEditImage(i)}
else{if($(this.target).find('.wveditor_image img').length>0){this.selectedItem=$(this.target).find('.wveditor_image img')[0];this.selectedItemSrc=this.selectedItem.src;var i=new Image();i.src=this.selectedItemSrc}
else{if(confirm('배경화면편집은 모든 해상도에 적용됩니다.\n편집기를 열까요?')===!1){return!1};this.selectedItem=$(this.target)[0];var i=new Image();const backgroundImageUrl=bm.getStyle(this.target,'background-image');const regex=/http[^")\s]+/;const match=backgroundImageUrl.match(regex);const image=match[0];this.selectedItemSrc=image;i.src=image};this.openEditImage(i)}};this.openEditImage=function(t){bm.popupManager.add($('#imageEditorPopup'),null,null,null,null,!0,!1,100010);this.imageEditor.init($('#imageEditorPopup'),t,this.onImageEditComplete)};this.onImageEditComplete=function(e){bm.toolManager.toolBtnEditBefore(this,t.selectedItem,HistoryType.EDITOR_IMAGE);var i=t.selectedItemSrc,a=i.substring(i.lastIndexOf('.')+1),n=i.substring(i.lastIndexOf('/')+1,i.lastIndexOf('.'));n=n+'_'+app.uniqueCode();var o={'defaultPath':'/','isOverride':1,'name':n+'.'+a,'type':'image/jpeg','filedata':e};bm.httpSendJsonPost(WEB_ROOT+'filemanager/uploadSimpleAjaxImage',o,function(e){if(e.result==!0){var s=e.data.file.src,d=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),h=wvAdminIFrameBridge._WVAdminTopBar.responsiveCheckedSizeVal;if(h.length>0){d=d.reverse();var n,l,o,a;o=wvAdminIFrameBridge._WVContentArea.webRootChangeToShortTag(i);o=o.replace('[WEB_ROOT]','/');const backgroundImageStyle=t.selectedItem['style']['backgroundImage'];if(backgroundImageStyle!=='none'&&backgroundImageStyle!==''){var r=null;if(bm.bmEditorManager.registedBoardEditor===!1){r=WVAdminResourceManager.getEmbededStyleObject(null,t.selectedItem)};css={backgroundImage:'url('+s+')'};r.applyResourceStyle(t.selectedItem,css,!1,!0,!1,!1,['default','768','992','1200','1600']);r.refreshStyleElementText()}
else{if($(t.selectedItem).closest('picture').length>0){n=$(t.selectedItem).closest('picture').clone(!0);h.forEach(function(t){if(t==='default'){n.children('img').attr('src',s)}
else{n.children('source[media="(min-width: '+t+'px)"]').attr('srcset',s)}});a=$(t.selectedItem).closest('picture').before(n)}
else{n=bm.html('<picture></picture>');d.forEach(function(t){l=h.includes(t)?s:o;if(t==='default'){n.append(bm.html('<img src="'+l+'"/>'))}
else{n.append(bm.html('<source media="(min-width: '+t+'px)" srcset="'+l+'">'))}});a=$(t.selectedItem).before(n)};t.selectedItem=a;$(a).remove()}};bm.toolManager.toolBtnEditAfter(this,t.selectedItem,HistoryType.EDITOR_IMAGE);return}})}};bm.extend(ToolBtnBase,ToolBtnImageEdit);ToolBtnImageEdit.prototype.addEvent=function(){var t=this};ToolBtnImageEdit.prototype.removeEvent=function(){var t=this};var ToolBtnImageCrop=function(){this.type='ToolBtnImageCrop';this.imageEditor=bm.imageEditor;this.selectedItem=null;var e=this;this.layer=$('#toolImageEditLayer');this.cropLayer=$('#cropLayer');this.cropSizeHandler=$('#cropSizeHandler');this.layer.remove();this.cropLayerStatus=!1;this.targetImage;this.canvasImg=$('#canvas_to_img')[0];this.ctxImg=this.canvasImg.getContext('2d');this.resizerBtnTopRight=$(this.cropLayer).find('.resizer.top-right');this.resizerBtnTopLeft=$(this.cropLayer).find('.resizer.top-left');this.resizerBtnBottomRight=$(this.cropLayer).find('.resizer.bottom-right');this.resizerBtnBottomLeft=$(this.cropLayer).find('.resizer.bottom-left');var r,l,d,s,h,c,f,g,i,n,o,a,t,p,u,m,v;this.onBtnClick=function(t,e){switch(e){case'apply':this.apply();bm.toast('이미지가 편집되었습니다.\n');break;case'origin':this.imageBackToOrigin();break;case'full':this.imageCropOpen('full');break;case'16_9':case'3_2':case'4_3':case'1_1':case'3_4':case'2_3':case'9_16':this.imageCropOpen(e);break};t.preventDefault()};this.apply=function(){var e=this,s=this.target;if(this.target.targetElement)s=this.target.targetElement;var f=this.btnList['alt'].value;if(f){$(s).find('.wveditor_image img').attr('alt',f)};var h=null;if(this.cropLayerStatus){var d=new Image();d.src=this.targetImageSrc;var c=d,r=t.width/c.naturalWidth,l=new Image();l.crossOrigin='Anonymous';l.onload=function(){var f=document.createElement('canvas'),g=f.getContext('2d'),m;f.height=this.height;f.width=this.width;g.drawImage(this,0,0);$(e.canvasImg).attr('width',o);$(e.canvasImg).attr('height',a);e.ctxImg.clearRect(0,0,o,a);e.ctxImg.drawImage(l,i/r,n/r,o/r,a/r,0,0,o,a);h=e.canvasImg.toDataURL();bm.toolManager.toolBtnEditBefore(e,s,HistoryType.EDITOR_IMAGE);if(h){var t=$(d).attr('src'),u=t.substring(t.lastIndexOf('.')+1),c=t.substring(t.lastIndexOf('/')+1,t.lastIndexOf('.'));c=c+'_'+app.uniqueCode();var p={'defaultPath':'/','isOverride':1,'name':c+'.'+u,'type':'image/jpeg','filedata':h};bm.httpSendJsonPost(WEB_ROOT+'filemanager/uploadSimpleAjaxImage',p,function(i){if(i.result==!0){var r=i.data.file.src,l=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),d=wvAdminIFrameBridge._WVAdminTopBar.responsiveCheckedSizeVal;if(d.length>0){l=l.reverse();var n,a,o;o=wvAdminIFrameBridge._WVContentArea.webRootChangeToShortTag(t);o=o.replace('[WEB_ROOT]','/');if($(e.targetImage)[0].tagName.toLowerCase()==='picture'){n=$(e.targetImage).clone(!0);d.forEach(function(t){if(t==='default'){n.children('img').attr('src',r)}
else{n.children('source[media="(min-width: '+t+'px)"]').attr('srcset',r)}})}
else{n=bm.html('<picture></picture>');l.forEach(function(t){a=d.includes(t)?r:o;if(t==='default'){n.append(bm.html('<img src="'+a+'"/>'))}
else{n.append(bm.html('<source media="(min-width: '+t+'px)" srcset="'+a+'">'))}})};var h=$(e.targetImage).before(n);e.targetImage=h;$(h).remove()};bm.toolManager.toolBtnEditAfter(e,s,HistoryType.EDITOR_IMAGE);return}})}
else{bm.toolManager.toolBtnEditAfter(e,s,HistoryType.EDITOR_IMAGE)}};l.src=c.src;e.imageCropClose();bm.toolManager.kitReposition()}};this.imageBackToOrigin=function(){var t=e.target;if(e.target.targetElement)t=e.target.targetElement;bm.toolManager.toolBtnEditBefore(this,t,HistoryType.EDITOR_IMAGE);bm.toolManager.toolBtnEditAfter(this,t,HistoryType.EDITOR_IMAGE)};this.imageCropOpen=function(p){var u=e.target;$(e.btnList).removeClass('active');$(e.btnList[p]).addClass('active');if(e.target.targetElement)u=e.target.targetElement;var C=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),b=C.reverse().indexOf(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal);if($(u).find('picture').length>0&&(b>-1&&b<4)){this.targetImage=$(u).find('picture');this.targetImageSrc=this.targetImage.find('> source')[b].getAttribute('srcset')}
else{this.targetImage=$(u).find('.wveditor_image img');this.targetImageSrc=this.targetImage.attr('src')};h=this.targetImage.width();c=this.targetImage.height();s=h/c;if(p=='full'){l=this.targetImage.width();d=this.targetImage.height();r=s}
else{var T=p.split('_');l=parseInt(T[0]);d=parseInt(T[1]);r=l/d};i=0;n=0;var m=t?t.height:c,v=t?t.width:h;if(r<=s){a=m;o=a/d*l;i=v-o>>1}
else{o=v;a=o/l*d;n=m-a>>1};var y=parseInt($(u).find('>[data-wv-layout-element="block_inner"]').css('padding')),w=$(u).offset();n+=$(this.targetImage).offset().top-w.top-parseFloat($(u).css('padding-top'))-y;i+=$(this.targetImage).offset().left-w.left-parseFloat($(u).css('padding-left'))-y;if(!t){var S=$(this.innerWindow.document).scrollTop();f=$(u).offset().left+($(this.targetImage).offset().left-$(u).offset().left);g=$(u).offset().top+($(this.targetImage).offset().top-$(u).offset().top);this.layer.css({width:v,height:m,left:f,top:g,background:'url(\''+this.targetImageSrc+'\')',backgroundSize:'cover',backgroundRepeat:'no-repeat'});this.cropSizeHandler.css({width:this.targetImage.width(),top:this.targetImage.height()});this.layer.show();$(this.innerWindow.document.body).prepend(this.layer)};this.cropLayer.css({width:o,height:a,left:i,top:n,background:'url(\''+this.targetImageSrc+'\')',backgroundSize:'cover',backgroundRepeat:'no-repeat',backgroundPositionX:-i,backgroundPositionY:-n});this.registCropLayerEvent()};this.imageCropClose=function(){this.layer.remove();this.removeCropLayerEvent();t=null};this.registCropLayerEvent=function(){var x=this.cropLayer,W=this.cropSizeHandler;if(this.cropLayerStatus==!1){this.cropLayer[0].addEventListener('click',function(t){t.preventDefault();t.stopImmediatePropagation()},!0);mouseAdapter(x).onDrag(j,U,G,!0);mouseAdapter(W).onDrag(K,X,Y,!0);$(x).find('.resizer').each(function(){mouseAdapter(this).onDrag(q,Z,J,!0)});this.cropLayerStatus=!0};if(!t){t={width:this.targetImage.width(),height:this.targetImage.height()}};function j(e){e.stopImmediatePropagation();e.preventDefault();m=e.clientX-p;v=e.clientY-u;o=$(x).width();a=$(x).height();i=x[0].offsetLeft+m;if(t.width-o<i)i=(t.width-o);if(i<0)i=0;n=x[0].offsetTop+v;if(t.height-a<n)n=(t.height-a);if(n<0)n=0;if(r<=s){$(x).css({left:i,backgroundPositionX:-i})}
else{$(x).css({top:n,backgroundPositionY:-n})};p=e.clientX;u=e.clientY};function U(t){t.stopImmediatePropagation();t.preventDefault()};function G(t){t.stopImmediatePropagation();t.preventDefault();p=t.clientX;u=t.clientY};var P,H,O,F,N,V,z;function K(l){l.stopImmediatePropagation();l.preventDefault();P=l.clientY-H;if(O+P<c)return;O+=P;t.height=O;t.width=t.height*s;var d=-(t.width-h)/2+f;$(W).css({top:O,width:t.width,left:0});$(e.layer).css({left:d,width:t.width,height:t.height});if(r<=s){a=t.height;i=F+(t.width-V)/2}
else{o=t.width;n=N};$(e.cropLayer).css({width:o,height:a,left:i,top:n,backgroundPositionX:-i,backgroundPositionY:-n});H=l.clientY};function X(t){t.stopImmediatePropagation();t.preventDefault()};function Y(e){e.stopImmediatePropagation();e.preventDefault();H=e.clientY;O=W[0].offsetTop;F=i;N=n;V=t.width;z=t.height};var A,D,B,b,y,g=10,w,T,l,d,L,I,E=0,M=t.width,R=t.height,k=0,C,S;function q(t){t.stopImmediatePropagation();b=t.clientX-A;y=t.clientY-D;w=parseInt(e.cropLayer[0].offsetLeft);T=parseInt(e.cropLayer[0].offsetTop);l=parseInt(e.cropLayer[0].offsetWidth);d=parseInt(e.cropLayer[0].offsetHeight);L=w+l;I=T+d;if($(B).hasClass('top-left')){C=L-E;S=I-k;if(l-b<=g){w=L-g}
else{if(w+b<E)w=E;else w=w+b};if(d-y<=g){T=I-g}
else{if(T+y<k)T=k;else T=T+y};if(l-b>=C){l=C}
else{if(l-b<g)l=g;else l=l-b};if(d-y>=S){d=S}
else{if(d-y<g)d=g;else d=d-y}}
else if($(B).hasClass('top-right')){C=M-w;S=I-k;if(l+b>=C){l=C}
else{if(l+b<g)l=g;else l=l+b};if(d-y<=g){T=I-g}
else{if(T+y<k)T=k;else T=T+y};if(d-y>=S){d=S}
else{if(d-y<g)d=g;else d=d-y}}
else if($(B).hasClass('bottom-left')){C=L-E;S=R-T;if(l-b<=g){w=L-g}
else{if(w+b<E)w=E;else w=w+b};if(l-b>=C){l=C}
else{if(l-b<g)l=g;else l=l-b};if(d+y>=S){d=S}
else{if(d+y<g)d=g;else d=d+y}}
else if($(B).hasClass('bottom-right')){C=M-w;S=R-T;if(l+b>=C){l=C}
else{if(l+b<g)l=g;else l=l+b};if(d+y>=S){d=S}
else{if(d+y<g)d=g;else d=d+y}}
else if($(B).hasClass('right')){C=M-w;if(l+b>=C){l=C}
else{if(l+b<g)l=g;else l=l+b}}
else if($(B).hasClass('bottom')){S=R-T;if(d+y>=S){d=S}
else{if(d+y<g)d=g;else d=d+y}};if(r<=s){$(e.cropLayer).css({left:w,width:l})}
else{$(e.cropLayer).css({top:T,height:d})};A=t.clientX;D=t.clientY};function Z(t){t.stopImmediatePropagation()};function J(e){e.stopImmediatePropagation();e.preventDefault();B=e.currentTarget;A=e.clientX;D=e.clientY;M=t.width;R=t.height}};this.removeCropLayerEvent=function(){if(this.cropLayerStatus==!0){$(this.cropLayer).off('click');mouseAdapter(this.cropLayer).offDrag();mouseAdapter(this.cropSizeHandler).offDrag();$(this.cropLayer).find('.resizer').each(function(){mouseAdapter(this).offDrag()});this.cropLayerStatus=!1}};this.onWindowResize=function(t){if(e.cropLayerStatus){e.imageCropClose()}}};bm.extend(ToolBtnBase,ToolBtnImageCrop);ToolBtnImageCrop.prototype.resetStyleBtn=function(){var t=this;$(t.btnList['alt']).val('')};ToolBtnImageCrop.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1};var e=t.target;if(t.target.targetElement)e=t.target.targetElement;$(t.btnList['alt']).val($(e).find('.wveditor_image img').attr('alt'))};ToolBtnImageCrop.prototype.changeTarget=function(t){var e=this;if(this.cropLayerStatus){if(t&&this.targetImage){this.imageCropClose()}};this.target=t};ToolBtnImageCrop.prototype.addEvent=function(){var t=this;$(t.btnList['alt']).on('focus',function(){$(this).select()});$(t.btnList['alt']).on('keydown',function(e){if(e.keyCode==13){t.apply()}});$(window).on('resize',this.onWindowResize)};ToolBtnImageCrop.prototype.removeEvent=function(){if(this.cropLayerStatus){this.imageCropClose()};$(this.btnList['alt']).off('focus');$(this.btnList['alt']).off('keydown');$(window).off('resize',this.onWindowResize)};var ToolBtnLogoImageSize=function(){this.type='ToolBtnLogoImageSize';var t=this;this.selectedItem=null;this.targetImage=null;this.imageSizeLevel=0;this.changeDefaultValue=5;this.onBtnClick=function(t,e){switch(e){case'0':case'-1':case'-2':case'-3':this.imageSizeControl(e);break};t.preventDefault()};this.apply=function(){var t=this.target;if(this.target.targetElement)t=this.target.targetElement};this.imageSizeControl=function(e){var o=t.target,n=parseInt(e);if(!$(t.target)[0].hasAttribute('data-wv-logo')&&$(t.target).find('[data-wv-logo]').length==0)return;var i;if($(o).find('.wveditor_image img').length==0){i=$(o).find('.wveditor_image').closest('[data-wv-layout-element-type=image]')[0]}
else{i=$(o).find('.wveditor_image img')[0]};if(!i)return;if(t.imageSizeLevel==n)return;var a=parseInt($(i).width()-(t.changeDefaultValue*(t.imageSizeLevel))),s=t.changeDefaultValue*n,r={'width':parseInt(a+s)+'px'};t.applyStyle(r);t.setImageSizeLevel($(i),n);t.imageSizeLevel=n;$(t.btnList).removeClass('active');$(t.btnList[e]).addClass('active')};this.getImageSizeLevel=function(t){var a=this,e=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),i=e.indexOf(wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal),n=t.attr('data-wv-img-size-level').split(','),o=n[i];return parseInt(o)};this.setImageSizeLevel=function(t,e){var l=this,n=[],o=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList(),r=wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList();if(!t[0].hasAttribute('data-wv-img-size-level')){for(var i=0;i<o.length;i++){n.push('0')};t.attr('data-wv-img-size-level',n.toString())}
else if(t.attr('data-wv-img-size-level').split(',').length!=o.length){for(var i=0;i<o.length;i++){n.push(''+t.attr('data-wv-img-size-level').split(',')[0])};t.attr('data-wv-img-size-level',n.toString())};if(e!=null||e!==undefined){n=t.attr('data-wv-img-size-level').split(',');for(var i=0;i<n.length;i++){for(var a=0;a<r.length;a++){var s=o.indexOf(wvAdminIFrameBridge._WVAdminTopBar.getResponsiveCheckSizeList()[a]);if(i==s)n[i]=e}};t.attr('data-wv-img-size-level',n.toString())}};this.applyStyle=function(t){var r=this,i=$(r.target).find('img'),n=i.length;if(n==0){alert('적용할 대상이 선택되지 않았습니다.');return};var a=this.getSamplingElement(i);bm.toolManager.toolBtnEditBefore(this,a,'EDITOR_LOGO',{width:parseInt(bm.getStyle(a,'width'))});var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,r.target)};var e,s,n=i.length;for(e=0;e<n;e++){s=i[e];var l=$(s).closest('[data-wv-layout-element="block"]'),d=l.attr('data-wv-res-id'),h='[data-wv-res-id="'+d+'"] img';o.applyResourceStyle(h,t,!1,!0)};bm.toolManager.toolBtnEditAfter(this,a,'EDITOR_LOGO',t);o.refreshStyleElementText()}};bm.extend(ToolBtnBase,ToolBtnLogoImageSize);ToolBtnLogoImageSize.prototype.resetStyleBtn=function(){var t=this;$(t.btnList).removeClass('active')};ToolBtnLogoImageSize.prototype.setStyleBtn=function(){var t=this;if(!t.target||$(t.target).find(' > .wveditor_image').length==0){t.resetStyleBtn();return!1};var i=t.target;if(t.target.targetElement)i=t.target.targetElement;var e;if($(i).find('.wveditor_image img').length==0){e=$(i).find('.wveditor_image').closest('[data-wv-layout-element-type=image]')[0]}
else{e=$(i).find('.wveditor_image img')[0]};if(!e)return;t.setImageSizeLevel($(e));t.imageSizeLevel=t.getImageSizeLevel($(e));$(t.btnList[t.imageSizeLevel]).addClass('active')};ToolBtnLogoImageSize.prototype.changeTarget=function(t){var e=this;e.target=t};ToolBtnLogoImageSize.prototype.addEvent=function(){var t=this};ToolBtnLogoImageSize.prototype.removeEvent=function(){var t=this};bm.editor={checkResourceId:function(t){return;if(t.hasAttribute('data-wv-res-id')){t.setAttribute('data-wv-res-id-duplicated',t.getAttribute('data-wv-res-id'));t.removeAttribute('data-wv-res-id')}},getSpanParentDivNode:function(t){var e=$(t).closest('div');return e},getSpanNodeByControl:function(t,e,i){var o=bm.selectionManager.range;if(o.collapsed||(i.tagName&&i.tagName.toLowerCase()=='br'))return;var n,s;if(e==1){if(bm.dom.isInline(i.parentNode)&&((i.localName=='img')||(o.startOffset==0&&o.endOffset==i.nodeValue.length))){n=i.parentNode}
else{if(bm.dom.isInline(i.parentNode)){n=i.parentNode.cloneNode(!1);bm.editor.checkResourceId(n)}
else{n=bm.html('<span></span>')};$(n).append(bm.selectionManager.getText(i));if(bm.dom.isInline(i.parentNode)){var g=i.parentNode;if(o.startOffset==0&&o.endOffset<i.nodeValue.length){$(i.parentNode).before(n);var a=bm.dom.splitNodeAt(i.parentNode,o.endOffset);$(n).after(a[1]);$(a[0]).remove()}
else if(o.startOffset!=0&&o.endOffset==i.nodeValue.length){$(i.parentNode).after(n);var a=bm.dom.splitNodeAt(i.parentNode,o.startOffset);$(n).before(a[0]);$(a[1]).remove()}
else{var d=o.startOffset,f=o.endOffset,a=bm.dom.splitNodeAt(i.parentNode,d),u=a[0];a=bm.dom.splitNodeAt(a[1],f-d);n=a[0];bm.editor.checkResourceId(n);var p=a[1]};o.deleteContents()}
else if(bm.dom.isBlock(i.parentNode)){if(i.localName=='img'){$(n).append(i);o.deleteContents();o.insertNode(n)}
else{o.deleteContents();o.insertNode(n)}};var c=n.firstChild.nodeValue?n.firstChild.nodeValue.length:0;bm.selectionManager.setRange(n.firstChild,0,n.firstChild,c)}}
else if(t==0){if(bm.dom.isInline(i.parentNode)&&o.startOffset==0){n=i.parentNode}
else{if(bm.dom.isInline(i.parentNode)){n=i.parentNode.cloneNode(!1);bm.editor.checkResourceId(n)}
else{n=bm.html('<span></span>')};if(i.localName=='img'){if(bm.dom.isInline(i.parentNode))$(i.parentNode).after(n);else $(i).after(n);$(n).append(i)}
else{$(n).append(i.nodeValue.slice(o.startOffset,i.nodeValue.length));if(bm.dom.isInline(i.parentNode))$(i.parentNode).after(n);else $(i).after(n);var r=i.nodeValue?i.nodeValue.length:0;s=bm.selectionManager.setTempRange(i,o.startOffset,i,r);s.deleteContents()};bm.selectionManager.restoreRange();if(n.firstChild){bm.selectionManager.setRange(n.firstChild,0,o.endContainer,o.endOffset)}
else{bm.selectionManager.setRange(n,0,o.endContainer,o.endOffset)}}}
else if(t==e-1){if(bm.dom.isInline(i.parentNode)&&o.endOffset==i.nodeValue.length){n=i.parentNode}
else{if(bm.dom.isInline(i.parentNode)){n=i.parentNode.cloneNode(!1);bm.editor.checkResourceId(n)}
else{n=bm.html('<span></span>')};if(i.localName=='img'){if(bm.dom.isInline(i.parentNode))$(i.parentNode).before(n);else $(i).before(n);$(n).append(i)}
else{$(n).append(i.nodeValue.slice(0,o.endOffset));if(bm.dom.isInline(i.parentNode))$(i.parentNode).before(n);else $(i).before(n);var r=i.nodeValue?o.endOffset:0;s=bm.selectionManager.setTempRange(i,0,i,r);s.deleteContents()};bm.selectionManager.restoreRange();var l=n;if(n.firstChild){r=n.firstChild.nodeValue?n.firstChild.nodeValue.length:0;l=n.firstChild}
else if(n.nodeValue){r=n.nodeValue.length};bm.selectionManager.setRange(o.startContainer,o.startOffset,l,r)}}
else{if(bm.dom.isInline(i.parentNode)){n=i.parentNode}
else if(bm.dom.isBlock(i.parentNode)){n=bm.html('<span></span>');if(i.localName=='img'){if(bm.dom.isInline(i.parentNode))$(i.parentNode).before(n);else $(i).before(n);$(n).append(i)}
else{$(n).append(i.nodeValue);var h=i.nodeValue?i.nodeValue.length:0;s=bm.selectionManager.setTempRange(i,0,i,h);s.insertNode(n);s.deleteContents();$(i).before(n)};bm.selectionManager.restoreRange()}};return n},applyCssToElement:function(t,e){for(var n in e){var i=e[n];if(n.indexOf('color')!=-1&&i.indexOf('!important')>-1){i=i.replace('!important','');$(t)[0].style.setProperty(n,i,'important')}};$(t).css(e);if($(t).attr('style')&&$(t).attr('style')!=''){$(t).attr('style',$(t).attr('style').toString().replaceAll('"',''))}},applyCssToTextNode:function(t,e,i,n){var o=this.getSpanNodeByControl(t,e,i);if(o){this.applyCssToElement(o,n)};return o},wrapTagToTextNode:function(t,e,i,n){var o=this.getSpanNodeByControl(t,e,i),a;if(o){a=bm.dom.wrapOuter(o,n)};return a}};var HistoryType={BLOCK_ADDED:'BLOCK_ADDED',PLUGIN_ADDED:'PLUGIN_ADDED',BLOCK_REMOVE:'BLOCK_REMOVE',BLOCK_SHOW:'BLOCK_SHOW',BLOCK_HIDE:'BLOCK_HIDE',BLOCK_DUPLICATE:'BLOCK_DUPLICATE',BLOCK_RESIZE:'BLOCK_RESIZE',BLOCK_MOVE:'BLOCK_MOVE',BLOCK_OPTION_CHANGE:'BLOCK_OPTION_CHANGE',EDITOR_TEXT_FONT_FAMILY:'EDITOR_TEXT_FONT_FAMILY',EDITOR_TEXT_FONT_SIZE:'EDITOR_TEXT_FONT_SIZE',EDITOR_TEXT_FONT_WEIGHT:'EDITOR_TEXT_FONT_WEIGHT',EDITOR_TEXT_COLOR:'EDITOR_TEXT_COLOR',EDITOR_TEXT_DECORATION:'EDITOR_TEXT_DECORATION',EDITOR_TEXT_LETTER_SPACING:'EDITOR_TEXT_LETTER_SPACING',EDITOR_TEXT_LINE_HEIGHT:'EDITOR_TEXT_LINE_HEIGHT',EDITOR_TEXT_ALIGN:'EDITOR_TEXT_ALIGN',EDITOR_TEXT_LIST_STYLE:'EDITOR_TEXT_LIST_STYLE',EDITOR_TEXT_IMAGE:'EDITOR_TEXT_IMAGE',EDITOR_TEXT_TABLE:'EDITOR_TEXT_TABLE',EDITOR_TEXT_LINK:'EDITOR_TEXT_LINK',EDITOR_TEXT_SHADOW:'EDITOR_TEXT_SHADOW',EDITOR_DOM_PADDING:'EDITOR_DOM_PADDING',EDITOR_DOM_MARGIN:'EDITOR_DOM_MARGIN',EDITOR_DOM_WIDTH:'EDITOR_DOM_WIDTH',EDITOR_DOM_HEIGHT:'EDITOR_DOM_HEIGHT',EDITOR_DOM_ALIGN_VERTICAL:'EDITOR_DOM_ALIGN_VERTICAL',EDITOR_DOM_ALIGN_HORIZONTAL:'EDITOR_DOM_ALIGN_HORIZONTAL',EDITOR_DOM_BORDER:'EDITOR_DOM_BORDER',EDITOR_DOM_BACKGROUND_COLOR:'EDITOR_DOM_BACKGROUND_COLOR',EDITOR_DOM_BACKGROUND_IMAGE:'EDITOR_DOM_BACKGROUND_IMAGE',EDITOR_DOM_BACKGROUND_REPEAT:'EDITOR_DOM_BACKGROUND_REPEAT',EDITOR_DOM_BACKGROUND_SIZE:'EDITOR_DOM_BACKGROUND_SIZE',EDITOR_DOM_BACKGROUND_SIZE_FILL:'EDITOR_DOM_BACKGROUND_SIZE_FILL',EDITOR_DOM_BACKGROUND_PARALLAX:'EDITOR_DOM_BACKGROUND_PARALLAX',EDITOR_DOM_BACKGROUND_POSITION:'EDITOR_DOM_BACKGROUND_POSITION',EDITOR_DOM_BACKGROUND_VIDEO:'EDITOR_DOM_BACKGROUND_VIDEO',EDITOR_DOM_BACKGROUND_DIM:'EDITOR_DOM_BACKGROUND_DIM',EDITOR_DOM_POINT_COLOR:'EDITOR_DOM_POINT_COLOR',EDITOR_DOM_SHADOW:'EDITOR_DOM_SHADOW',EDITOR_DOM_OPACITY:'EDITOR_DOM_OPACITY',EDITOR_TABLE_PADDING:'EDITOR_TABLE_PADDING',EDITOR_TABLE_MARGIN:'EDITOR_TABLE_MARGIN',EDITOR_TABLE_WIDTH:'EDITOR_TABLE_WIDTH',EDITOR_TABLE_COL_WIDTH:'EDITOR_TABLE_COL_WIDTH',EDITOR_TABLE_TEXT_ALIGN:'EDITOR_TABLE_TEXT_ALIGN',EDITOR_TABLE_BORDER:'EDITOR_TABLE_BORDER',EDITOR_TABLE_BACKGROUND_COLOR:'EDITOR_TABLE_BACKGROUND_COLOR',EDITOR_TABLE_POINT_COLOR:'EDITOR_TABLE_POINT_COLOR',EDITOR_TABLE_ADD:'EDITOR_TABLE_ADD',EDITOR_TABLE_REMOVE:'EDITOR_TABLE_REMOVE',EDITOR_TABLE_MERGE:'EDITOR_TABLE_MERGE',EDITOR_TABLE_MERGE_CANCEL:'EDITOR_TABLE_MERGE_CANCEL',EDITOR_CHANGE_LOGO:'EDITOR_CHANGE_LOGO',EDITOR_MAP:'EDITOR_MAP',EDITOR_VIDEO:'EDITOR_VIDEO',EDITOR_IMAGE:'EDITOR_IMAGE',EDITOR_MOTION:'EDITOR_MOTION',EDITOR_SVG:'EDITOR_SVG',EDITOR_LINE:'EDITOR_LINE',EDITOR_SWIPER:'EDITOR_SWIPER',BR_TAG:'BR_TAG',BLOCK_DEFAULT_CHANGE:'BLOCK_DEFAULT_CHANGE',BLOCK_POSITION_ABSOLUTE:'BLOCK_POSITION_ABSOLUTE',BLOCK_ZINDEX_CONTROL:'BLOCK_ZINDEX_CONTROL',BLOCK_REVERSE_CONTROL:'BLOCK_REVERSE_CONTROL',BLOCK_LAYOUT_CHANGE:'BLOCK_LAYOUT_CHANGE'};var ToolBase=function(){var t=this;this.onShow=null;this.onHide=null;this.innerWindow=window;this.onBtnClick=function(e){t.applyStyle(e.data)};this.onBtnKeyup=function(t){};this.applyStyle=function(e){$(t.targetElement).css(e)};this.quickEdit=function(t){}};ToolBase.prototype={init:function(t,e,n,o,a){this.type=t;this.element=e;this.resetMsg=a;this.targetElement;this.prevTargetElement;this.status=0;if($('#WEVEN_IFRAME').length>0){this.innerWindow=$('#WEVEN_IFRAME')[0].contentWindow;this.layoutKit=wvAdminIFrameBridge?wvAdminIFrameBridge._WVLayoutKit:null};if($(this.element).is(':visible')){this.isShow=!0}
else{this.isShow=!1};this.toolBtnList=[];var s=this;$(this.element).find('[data-wv-tool-btn]').each(function(){var t=$(this).attr('data-wv-tool-btn'),e;if(n&&n.indexOf(t)!=-1){$(this).hide();$(this).addClass('dont_use')}
else if(o&&o.indexOf(t)!=-1){$(this).show();$(this).addClass('use')}
else{if(t){if(s.toolBtnList[t]){e=s.toolBtnList[t];e.addBtn(this)}
else{if(window[t]){e=new window[t](t)}
else{e=new ToolBtnBase(t)};s.toolBtnList.push(e);e.init(t,s.type,this)}}
else{var i=s.type.substr(s.type.indexOf('Tool'));t='ToolBtn'+i+s.toolBtnList.length;e=new ToolBtnBase();s.toolBtnList.push(e);e.init(t,s.type,this)};s.toolBtnList[t]=e}});if(n){$(this.element).find('.tool_separation_inner').each(function(){if($(this).find('[data-wv-tool-btn]').not('.dont_use').length==0)$(this).hide()})};if(o){$(this.element).find('.tool_separation_inner').each(function(){if($(this).find('[data-wv-tool-btn].use').length>0){for(let i=0;i<$(this).find('[data-wv-tool-btn].use').length;i++){let btnType=$(this).find('[data-wv-tool-btn].use').attr('data-wv-tool-btn');let btn;if(btnType){if(s.toolBtnList[btnType]){btn=s.toolBtnList[btnType];btn.addBtn(this)}
else{if(window[btnType]){btn=new window[btnType]()}
else{btn=new ToolBtnBase()};s.toolBtnList.push(btn);btn.init(btnType,s.type,this)}}
else{var t=s.type.substr(s.type.indexOf('Tool'));btnType='ToolBtn'+t+s.toolBtnList.length;btn=new ToolBtnBase();s.toolBtnList.push(btn);btn.init(btnType,s.type,this)};s.toolBtnList[btnType]=btn};$(this).show()}})}},registListener:function(){var t=this;$(this.toolBtnList).each(function(){events(this).addListener(ToolButtonEvent.CLICK,t.onBtnClick)});$(this.element).find('[data-wv-tool-open-btn]').off('click').on('click',t.openControl.bind(this));$(this.element).find('[data-wv-tool-reset-btn]').off('click').on('click',t.resetProperty.bind(this));this.addEvent()},setStyleTool:function(){var e,t,i=this.toolBtnList.length;for(e=0;e<i;e++){t=this.toolBtnList[e];t.resetStyleBtn();if(t.target){t.setStyleBtn()};const optionList=t.optionList;for(let j=0;j<optionList.length;j++){optionList[j].setStyleOpt(t)}}},onChangeTarget:function(t,e){},onChangeTarget_Expert:function(t,e,i,n){var o=i;if(!t||($(t).attr('data-wv-layout-element')!=='block')){return};if(n&&n()===!1)return!1;o.show=function(){$(o['element']).removeClass('closed');if(o['toolBtnList'][0]){o.toolBtnList[0].addEvent?o.toolBtnList[0].addEvent():{};if(o['toolBtnList'][0]['optionList'][0]){o.toolBtnList[0].optionList[0].addEvent?o.toolBtnList[0].optionList[0].addEvent():{}}}};o.hide=function(){};o.reposition=function(){$(o['element']).css({display:''});$(o['element']).css({top:''});$(o['element']).css({left:''})};o.show();o.reposition()},addEvent:function(){},removeEvent:function(){},changeTarget:function(t,e,i){this.prevTargetElement=this.targetElement;this.targetElement=t;var n,o,a=this.toolBtnList.length;for(n=0;n<a;n++){o=this.toolBtnList[n];o.changeTarget(t,e,i)};this.onChangeTarget(t,e,i)},show:function(t,e){if(this.isShow==!1){var i,n,o=this.toolBtnList.length;for(i=0;i<o;i++){n=this.toolBtnList[i];if($(n).parent().length==0)$(this.element).append(n);n.show()};if(t){if($(this.targetElement).attr('data-wv-layout-element-type')===e){$(this.element).show()}
else{$(this.element).hide()}}
else{$(this.element).show()};this.isShow=!0;if(this.onShow)this.onShow(this)}},hide:function(){if(this.isShow==!0){var t,e,i=this.toolBtnList.length;for(t=0;t<i;t++){e=this.toolBtnList[t];e.hide()};$(this.element).hide();this.isShow=!1;if(this.onHide)this.onHide(this)}},hideOptionAll:function(t){var i;for(var e=0;e<this.toolBtnList.length;e++){i=this.toolBtnList[e];i.hideOptionAll(t)}},openControl:function(t,e){try{if(isPrdDetailInfo){return!1}}catch(n){console.warn(n)};var o;if(!t)o=$(this.element);else o=$(t.target).closest('[data-wv-toolset]');if(typeof(e)==='boolean'){if(e){o.removeClass('folded')}
else{o.addClass('folded')}}
else{var a=o.length>0&&o.hasClass('folded');if(a){o.removeClass('folded');const showTabExistBtnList={ToolDomBackground:['ToolBtnDomBackground'],ToolDomBackgroundDim:['ToolBtnDomBackgroundDim']};if(showTabExistBtnList[this.type]){for(let i=0;i<showTabExistBtnList[this.type].length;i++){this.toolBtnList[showTabExistBtnList[this.type][i]].showTab('none')}};if([this.type]=='ToolScroll'){this.toolBtnList['ToolBtnScroll'].onOptionChange('apply')}}
else{o.addClass('folded');this.resetProperty()}}},resetProperty:function(){$(this.toolBtnList).each(function(){this.resetProperty()});bm.toast(this.resetMsg)},active:function(t,e,i){this.changeTarget(t,e,i);if(this.status==1)return;this.status=1;var n,o,a=this.toolBtnList.length;for(n=0;n<a;n++){o=this.toolBtnList[n];o.active(t)};this.registListener()},deactive:function(t){if(this.status==0)return;this.status=0;var e,i,n=this.toolBtnList.length;for(e=0;e<n;e++){i=this.toolBtnList[e];i.deactive(t)};this.removeListener(t);this.targetElement=null;this.status=0},reposition:function(){if(this.targetElement){var n=10;if($('#WEVEN_IFRAME').length>0){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var o=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon];for(var i=0;i<o.length;i++){if($(o[i]).is(':visible')){n=25;break}}};var t=$(this.targetElement).offset().top-this.element.offsetHeight-n;if(t<0){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+n;if(t<0){t=0}};var e=$(this.targetElement).offset().left;if(e+parseFloat(this.element.offsetWidth)+10>parseFloat(wvAdminIFrameBridge._WVContentArea.innerWindow.innerWidth)){e=parseFloat(wvAdminIFrameBridge._WVContentArea.innerWindow.innerWidth)-parseFloat(this.element.offsetWidth)};$(this.element).css({'top':t,'left':e})}},removeListener:function(t){var e=this;$(this.toolBtnList).each(function(){events(this).removeListener(ToolButtonEvent.CLICK,e.onBtnClick)});this.removeEvent(t)},destroy:function(){}};var ToolHistory=function(){this.elementType='history'};bm.extend(ToolBase,ToolHistory);ToolHistory.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent()};ToolHistory.prototype.addEvent=function(){};ToolHistory.prototype.removeEvent=function(){};var ToolText=function(){this.targetImage=null;this.prevTargetElement=null;this.eventTargetListforImage=[];this.elementType='text';this.hideBtnList=['ToolBtnTextFont','ToolBtnTextLetterSpacing'];this.quickEdit=function(t){if(this.status){switch(t){case'image':$(this.toolBtnList['ToolBtnTextImage'].btnList[t]).trigger('click');break;case'source':$(this.toolBtnList['ToolBtnSource'].btnList[t]).trigger('click');break}}}};bm.extend(ToolBase,ToolText);ToolText.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent();if(i==='side'||i==='expert'){this.isShow=!1;this.show(!0,this.elementType)}
else{if(bm.toolManager.toolMode==='design'){var n=$(t).attr('data-wv-layout-element-type');if(n&&(n==='text'||n.indexOf('table')>-1)){this.show();this.reposition()}
else{this.hide()}}
else{}}};ToolText.prototype.addEvent=function(){var t=this;if(this.targetElement){if($('#WEVEN_IFRAME').length>0&&$(this.targetElement).find('.wveditor_text').length>0){$(this.targetElement).off('click').on('click',function(){if($(this).hasClass('edit_target_block')){if(t.prevTargetElement!=t.targetElement){$(t.prevTargetElement).find('>.wveditor_text').attr('contenteditable',!1)};if($(t.targetElement).find('>.wveditor_text').attr('contenteditable')==='false'){$(t.targetElement).css({cursor:''});$(t.targetElement).find('>.wveditor_text').attr('contenteditable',!0)}
else{$(t.targetElement).find('>.wveditor_text').focus();t.prevTargetElement=t.targetElement}}})};$(this.targetElement).off('paste');$(this.targetElement).on('paste',function(t){var i=t.originalEvent&&t.originalEvent.clipboardData?t.originalEvent.clipboardData:window.clipboardData;if(i.getData('Text')||i.files.length==0){return};var n=i.items[0];if(n.type.indexOf('image')==-1){return};var o=n.getAsFile(),e=new FileReader();e.readAsDataURL(o);e.onload=function(){var t=e.result,i='png',n='paste_'+app.uniqueCode(),o={'defaultPath':'clipboardData/','isOverride':1,'name':n+'.'+i,'type':'image/jpeg','filedata':t};bm.httpSendJsonPost(WEB_ROOT+'filemanager/uploadSimpleAjaxImage',o,function(t){if(t.result==!0){var e=new Image();e.src=t.data.file.src;bm.selectionManager.getRange().insertNode(e);return}})};return!1})}};ToolText.prototype.removeEvent=function(){if(this.targetElement){$(this.targetElement).off('paste')}};ToolText.prototype.hideBtn=function(){var t=bm.toolManager['toolList']['ToolText'];for(let i=0;i<t.hideBtnList.length;i++){$(t['toolBtnList'][t.hideBtnList[i]]['btnList']['mainBtn']).hide()}};ToolText.prototype.showBtn=function(){var t=bm.toolManager['toolList']['ToolText'];for(let i=0;i<t.hideBtnList.length;i++){$(t['toolBtnList'][t.hideBtnList[i]]['btnList']['mainBtn']).show()}};ToolText.prototype.btnShowHideControl=function(){var t=bm.toolManager['toolList']['ToolText'];const currentResponsiveSize=window.parent.wvAdminIFrameBridge._WVAdminTopBar.currentResponsiveSizeVal;if(currentResponsiveSize==='480'||currentResponsiveSize==='default'){t.hideBtn()}
else{t.showBtn()}};ToolText.prototype.reposition=function(t){if(this.targetElement){const narrowedMenuWidth=426;var e=this.targetElement;if(t)e=t;if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var d=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon],r=2;if(e.length&&e.length>1){e=e[e.length-1]};var a=!1,o=!1,s=$(e).closest('[data-wv-layout-element="block"]').find('table');if(s.length>0){a=!0;if(s.find('td.active').length>0)o=!0};var i=$(e).offset().top-this.element.offsetHeight-r,n=$(e).offset().left,l=$(this.innerWindow.document).scrollTop();if(o){i+=(e.offsetHeight+this.element.offsetHeight)};if(i<0||i<l){i=$(e).offset().top+e.offsetHeight+r;if(i<0){i=0}};if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.width()-$(this.element)[0].offsetWidth<n){n=$(e).offset().left+e.offsetWidth-$(this.element)[0].offsetWidth};const viewWidth=wvAdminIFrameBridge._WVContentArea.$contentBody.width();if(viewWidth<$(this.element)[0].offsetWidth||viewWidth<500){n=viewWidth/2-narrowedMenuWidth/2};$(this.element).css({'top':i,'left':n});if(a){if(o){$(this.element).css('visibility','')}
else{$(this.element).css('visibility','hidden')}}}};var ToolTextLink=function(){var t=this;this.onBtnClick=function(e){var i=e.data.prop;switch(i){case'home':case'remove':case'apply':t.toolBtnList['ToolBtnTextLink'].setLink(i);break;case'page':t.toolBtnList['ToolBtnTextLink'].findPage();break}}};bm.extend(ToolBase,ToolTextLink);var ToolTextShadow=function(){var t=this;this.elementType='text';this.onBtnClick=function(t){var e=t.data.prop};ToolTextShadow.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent();if(i==='side'||i==='expert'){this.isShow=!1;this.show(!0,this.elementType)}
else{if(bm.toolManager.toolMode==='design'){var n=$(t).attr('data-wv-layout-element-type');if(n&&(n==='text'||n.indexOf('table')>-1)){this.show();this.reposition()}
else{this.hide()}}
else{}}}};bm.extend(ToolBase,ToolTextShadow);var ToolDomSpaceSizeSmall=function(){var t=this;this.onBtnClick=function(e){var i=e.data.prop;switch(i){case'%':t.changeUnit('%');break;default:break}}};bm.extend(ToolBase,ToolDomSpaceSizeSmall);var ToolDomSpace=function(){this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnDomSpace'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolDomSpace);ToolDomSpace.prototype.addEvent=function(){};ToolDomSpace.prototype.removeEvent=function(){};var ToolDomWidth=function(){var t=this;this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnDomWidth'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolDomWidth);var ToolDomHeight=function(){var t=this;this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnDomHeight'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolDomHeight);var ToolDomAlignVertical=function(){var t=this;this.onBtnClick=function(t){};this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnDomAlignVerticalDefault'].btnList[t]).trigger('click')}}};bm.extend(ToolBase,ToolDomAlignVertical);var ToolDomAlignHorizontal=function(){var t=this;this.onBtnClick=function(t){};this.quickEdit=function(t){if(this.status){this.toolBtnList['ToolBtnDomAlignHorizontalDefault'].onOptionChange(t)}}};bm.extend(ToolBase,ToolDomAlignHorizontal);var ToolDomBackground=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop;console.log('ToolDomBackground: '+e)};this.applyStyle=function(){console.log('ToolDomBackground applyStyle')}};bm.extend(ToolBase,ToolDomBackground);var ToolDomBackgroundImage=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomBackgroundImage);var ToolDomBackgroundBorder=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomBackgroundBorder);var ToolDomBackgroundVideo=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomBackgroundVideo);var ToolDomBackgroundDim=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomBackgroundDim);var ToolDomCondition=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomCondition);var ToolDomOpacity=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomOpacity);var ToolDomShadow=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.applyStyle=function(){}};bm.extend(ToolBase,ToolDomShadow);var ToolDomEffect=function(){var t=this;this.onBtnClick=function(t){};this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolDomEffect'].btnList[t]).trigger('click')}}};bm.extend(ToolBase,ToolDomEffect);var ToolScroll=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop}};bm.extend(ToolBase,ToolScroll);var ToolMotion=function(){var t=this;this.onBtnClick=function(t){var e=t.data.prop};this.quickEdit=function(t){ToolBtnSource.prototype.lookSource(t)}};bm.extend(ToolBase,ToolMotion);var ToolMotionSource=function(){var t=this;this.onBtnClick=function(t){};this.quickEdit=function(t){if(this.status&&this.toolBtnList['ToolBtnSource']){$(this.toolBtnList['ToolBtnSource'].btnList[t]).trigger('click')}}};bm.extend(ToolBase,ToolMotionSource);var ToolGridMaxWidth=function(){this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnGridMaxWidth'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolGridMaxWidth);ToolGridMaxWidth.prototype.onChangeTarget=function(){this.removeEvent();this.addEvent()};var ToolVideo=function(){var t=this;this.targetVideo=null;this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolVideo);ToolVideo.prototype.onChangeTarget=function(t,e){const _this=this;function o(){if(!t||$(t).find('> .wveditor_video').length!=1){if(isExpertMode){_this.closeConfig();return!1};return!1}
else{return!0}};function s(t,e,i,n){var o=i;if(!t||($(t).attr('data-wv-layout-element')!=='block')){return};if(n&&n()===!1)return!1;o.show=function(){$(o['element']).removeClass('closed');if(o['toolBtnList'][0]){o.toolBtnList[0].addEvent?o.toolBtnList[0].addEvent():{};if(o['toolBtnList'][0]['optionList'][0]){o.toolBtnList[0].optionList[0].addEvent?o.toolBtnList[0].optionList[0].addEvent():{}}}};o.hide=function(){};o.reposition=function(){$(o['element']).css({display:''});$(o['element']).css({top:''});$(o['element']).css({left:''})};o.reposition()};if(isExpertMode){s(t,e,this,o)}
else{if(o()===!0){var i,n,a=_this.toolBtnList.length;for(i=0;i<a;i++){n=_this.toolBtnList[i];n.changeTarget(t)};_this.show();if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){_this.prdreposition()}
else{_this.reposition()}}
else{_this.hide()}}};ToolVideo.prototype.closeConfig=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolVideo'];$(t.element).addClass('closed');if(t.toolBtnList['ToolBtnVideo']){t.toolBtnList['ToolBtnVideo'].removeEvent()}};ToolVideo.prototype.addEvent=function(){};ToolVideo.prototype.prdreposition=function(){if(this.targetElement){var o=10;if($('#WEVEN_IFRAME').length>0){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var i=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon];for(var e=0;e<i.length;e++){if($(i[e]).is(':visible')){o=25;break}}};var t=$(this.targetElement).offset().top;if(t<0){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+15};var n=$(this.targetElement).offset().left;$(this.element).css({'top':t,'left':n})}};var ToolMap=function(){var t=this;this.targetMap=null;this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolMap);ToolMap.prototype.onChangeTarget=function(t,e){const _this=this;function o(){if(!t||$(t).find('> .wveditor_map').length!=1){if(isExpertMode){_this.closeConfig();return!1};return!1}
else{return!0}};if(isExpertMode){ToolMap.prototype.onChangeTarget_Expert(t,e,this,o);_this.closeConfig()}
else{if(o()===!0){var i,n,a=_this.toolBtnList.length;for(i=0;i<a;i++){n=_this.toolBtnList[i];n.changeTarget(t)};_this.show();if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){_this.prdreposition()}
else{_this.reposition()}}
else{_this.hide()}}};ToolMap.prototype.closeConfig=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolMap'];$(t.element).addClass('closed');if(t.toolBtnList['ToolBtnMap']){t.toolBtnList['ToolBtnMap'].removeEvent()}};ToolMap.prototype.addEvent=function(){};ToolMap.prototype.prdreposition=function(){if(this.targetElement){var n=10;if($('#WEVEN_IFRAME').length>0){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var i=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon];for(var e=0;e<i.length;e++){if($(i[e]).is(':visible')){n=25;break}}};var t=$(this.targetElement).offset().top;if(t<0){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+15};var o=$(this.targetElement).offset().left-this.element.offsetWidth-n;$(this.element).css({'top':t,'left':o})}};var ToolTable=function(){this.targetTable=null;this.currentTableList;this.tableEventStatus=0;var t=this;this.onBtnClick=function(t){};this.applyStyle=function(){};this.onSelectionChange=function(t){if(t.length==0){}};this.onTargetClickHandler=function(e){if($(e.target).closest('table').length==0){if(isExpertMode){t.closeConfig()}
else{t.hide()};bm.tableSelectionManager.restoreRange()}};this.onTableClickHandler=function(e){e.stopPropagation();var i=this;if(i.tagName.toLowerCase()!='table'){if($(i).find('table').length==0){alert('[43] ToolTable : wveditor_table가 설정되어 있지만, 하위에 테이블이 없습니다.');return};i=$(i).find('table')[0]};if($(i).closest('[data-wv-design-area]').attr('data-wv-layout-element-type')=='bbs'){return};if(t.targetTable!=i){bm.table.colSizeStatus='';bm.tableSelectionManager.removeRange();bm.selectionManager.saveRange();$(t.targetTable).find('td').removeClass('active');t.targetTable=i;t.setTarget(t.targetTable,e.target);bm.table.colResizerActive(t.targetTable,t.onTableColResizeStart,t.onTableColResizeUpdate,t.onTableColResizeEnd)};if(t.isShow==!1){$(t.targetTable).find('thead, tbody').attr('contenteditable','false');$(t.targetTable).find('th, td').attr('contenteditable','true');t.show()}};this.onTableKeyupHandler=function(t){var e=bm.tableSelectionManager.getCurrentCell();if(!e){return};var n=$(e.childNodes).last()[0];if($(e).length===1&&n.nodeType!==3&&(t.which===8||t.which===46)){if($(e).find('br').length===0){var i=document.createElement('br');$(i).appendTo(e)};return!1}};function e(t){var e;if($(t).attr('style')){var i=$(t).attr('style').split(':');e=$.trim(i[1].replace(';',''))}
else{e=$(t).css('width')};return e};this.onTableColResizeStart=function(t){var i=[t.leftColData.col,t.rightColData.col],n=e(i[0])+'|'+e(i[1]);bm.toolManager.toolBtnEditBefore(this,t.table,HistoryType.EDITOR_TABLE_COL_WIDTH,n)};this.onTableColResizeUpdate=function(t){};this.onTableColResizeEnd=function(i){var n=[i.leftColData.col,i.rightColData.col],s=[{width:e(i.leftColData.col)},{width:e(i.rightColData.col)}];var o=WVAdminResourceManager.getEmbededStyleObject(null,t.targetTable);o.applyResourceStyle(n,s,!1,!1,!1,!0);if(o)o.refreshStyleElementText();var a=e(n[0])+'|'+e(n[1]);$(n).removeAttr('style');bm.toolManager.toolBtnEditAfter(this,i.table,HistoryType.EDITOR_TABLE_COL_WIDTH,a)};this.repositionTextTool=function(){var e=bm.tableSelectionManager.endCell,t=bm.tableSelectionManager.selectedCellList;if($(e).length>0){bm.toolManager.toolList['ToolText'].reposition(e)}
else if(t.length>0){bm.toolManager.toolList['ToolText'].reposition(t[t.length-1])}}};bm.extend(ToolBase,ToolTable);ToolTable.prototype.removeRangeActive=function(t){bm.table.colSizeStatus='';bm.tableSelectionManager.removeRange();bm.selectionManager.saveRange();$(t).find('td').removeClass('active')};ToolTable.prototype.onChangeTarget=function(t,e){const _this=this;function i(){var t=$(_this.targetElement).attr('data-wv-layout-element-type');_this.removeEvent();_this.addEvent();if(bm.string.contains(t,'table')||$(_this.targetElement).find('table').length>0){return!0}
else{if(isExpertMode){_this.closeConfig();return!1}}};i()};ToolTable.prototype.openConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolTable'];$(e.element).removeClass('closed')};ToolTable.prototype.closeConfig=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolTable'];$(t.element).addClass('closed');if(t.toolBtnList['ToolTable']){t.toolBtnList['ToolTable'].optionList['ToolTable'].removeEvent()}};ToolTable.prototype.setTarget=function(t,e){var t=t?t:this.targetTable,e=e?e:this.targetElement;bm.tableSelectionManager.setTarget(t,e);var i,n,o=this.toolBtnList.length;for(i=0;i<o;i++){n=this.toolBtnList[i];n.changeTarget(this.targetTable)}};ToolTable.prototype.addEvent=function(){var t=this;if(this.tableEventStatus==1)return;this.tableEventStatus=1;if(this.targetElement){$(this.targetElement).on('click','table',this.onTableClickHandler);if($(this.targetElement).find('table').length>0){$(this.targetElement).on('click',this.onTargetClickHandler);$(this.targetElement).on('keyup',this.onTableKeyupHandler)}}};ToolTable.prototype.removeEvent=function(){if(this.tableEventStatus==0)return;this.tableEventStatus=0;if(this.prevTargetElement){$(this.prevTargetElement).off('click','table',this.onTableClickHandler);$(this.prevTargetElement).off('keyup',this.onTableKeyupHandler);$(this.prevTargetElement).off('click',this.onTargetClickHandler)};$(this.targetElement).off('click','table',this.onTableClickHandler);$(this.targetElement).off('keyup',this.onTableKeyupHandler);$(this.targetElement).off('click',this.onTargetClickHandler);if(this.targetElement&&this.targetTable){this.targetTable=null;bm.table.colResizerDeActive(this.targetTable);bm.tableSelectionManager.removeChangeHandler(this.onSelectionChange);bm.tableSelectionManager.removeListener();bm.tableSelectionManager.targetTable=null}};ToolTable.prototype.reposition=function(){if(this.targetTable){var n=10;if(!bm.bmEditorManager.registedBoardEditor){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var o=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon];for(var i=0;i<o.length;i++){if($(o[i]).is(':visible')){n=30;break}}};var e=$(this.targetTable).offset().top-this.element.offsetHeight-n,t=$(this.targetTable).offset().left;if(e<0){e=$(this.targetTable).offset().top+this.targetTable.offsetHeight+n};if(window['wvAdminIFrameBridge']&&$(this.innerWindow.document.body).width()-$(this.element)[0].offsetWidth<t){t=$(this.targetElement).offset().left+this.targetElement.offsetWidth-$(this.element)[0].offsetWidth};if(t<0)t=0;$(this.element).css({'top':e,'left':t})}};ToolTable.prototype.deactive=function(t){$(this.targetTable).find('td').removeClass('active');ToolBase.prototype.deactive.call(this,t)};var ToolCreateTable=function(){this.elementType='text';this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnTextTable'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolCreateTable);ToolCreateTable.prototype.onChangeTarget=function(t,e,i){if(i==='side'||i==='expert'){if($(t).find('table')['length']>0){this.openControl(null,!0)}
else{this.openControl(null,!1)}}
else{if(bm.toolManager.toolMode==='design'){var n=$(t).attr('data-wv-layout-element-type');if(n&&(n==='text'||n.indexOf('table')>-1)){this.show();this.reposition()}
else{this.hide()}}
else{}}};var ToolSvg=function(){this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolSvg);ToolSvg.prototype.onChangeTarget=function(t,e){const _this=this;function o(){if(!t||$(t).find('> .wveditor_svg').length!=1){if(isExpertMode){_this.closeConfig();return!1};return!1}
else{return!0}};if(isExpertMode){o()}
else{if(o()===!0){var i,n,a=_this.toolBtnList.length;for(i=0;i<a;i++){n=_this.toolBtnList[i];n.changeTarget(t)};_this.show();if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){_this.prdreposition()}
else{_this.reposition()}}
else{_this.hide()}}};ToolSvg.prototype.closeConfig=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolSvg'];$(t.element).addClass('closed');if(t.toolBtnList['ToolBtnSvg']){t.toolBtnList['ToolBtnSvg'].removeEvent()}};ToolSvg.prototype.addEvent=function(){};ToolSvg.prototype.prdreposition=function(){if(this.targetElement){var n=10;if($('#WEVEN_IFRAME').length>0){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var i=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon];for(var e=0;e<i.length;e++){if($(i[e]).is(':visible')){n=25;break}}};var t=$(this.targetElement).offset().top;if(t<0){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+15};var o=$(this.targetElement).offset().left-this.element.offsetWidth-n;$(this.element).css({'top':t,'left':o})}};var ToolLine=function(){this.targetLine=null;this.elementType='line';this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolLine);ToolLine.prototype.onChangeTarget=function(t,e,i){const _this=this;function a(){if(!t||$(t).find('> .wveditor_line').length!=1){return!1}
else{return!0}};if(isExpertMode){ToolLine.prototype.onChangeTarget_Expert(t,e,this,a);_this.closeConfig()}
else{if(a()===!0){var n,o,s=_this.toolBtnList.length;for(n=0;n<s;n++){o=_this.toolBtnList[n];o.changeTarget(t)};_this.show();if($('#WEVEN_IFRAME').length>0&&!isPrdDetailInfo){_this.reposition()}}
else{_this.isShow=!0;_this.hide()}}};ToolLine.prototype.closeConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolLine'];$(e.element).addClass('closed');if(e.toolBtnList['ToolBtnLine']){e.toolBtnList['ToolBtnLine'].removeEvent()}};ToolLine.prototype.reposition=function(){if(this.targetElement){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var o=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon],n=10;for(var i=0;i<o.length;i++){if($(o[i]).is(':visible')){n=25;break}};var e=$(this.targetElement).offset().top-this.element.offsetHeight-n,t=$(this.targetElement).offset().left,a=$(this.innerWindow.document).scrollTop();if(e<0||e<a){e=$(this.targetElement).offset().top+this.targetElement.offsetHeight+n};if(window['wvAdminIFrameBridge']&&$(this.innerWindow.document.body).width()-$(this.element)[0].offsetWidth<t){t=$(this.targetElement).offset().left+this.targetElement.offsetWidth-$(this.element)[0].offsetWidth};if(t<0)t=0;$(this.element).css({'top':e,'left':t})}};ToolLine.prototype.addEvent=function(){};ToolLine.prototype.removeEvent=function(){};var ToolImage=function(){var t=this;this.targetImage=null;this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolImage);ToolImage.prototype.onChangeTarget=function(t,e){const _this=this;function o(){if(!t||$(t).find('> .wveditor_image').length!=1){if(isExpertMode){_this.closeConfig();return!1};return!1}
else{return!0}};if(isExpertMode){ToolImage.prototype.onChangeTarget_Expert(t,e,this,o);_this.closeConfig();return!1}
else{if(o()===!0){var i,n,a=_this.toolBtnList.length;for(i=0;i<a;i++){n=_this.toolBtnList[i];n.changeTarget(t)};_this.show();if($('#WEVEN_IFRAME').length>0&&isPrdDetailInfo){_this.prdreposition()}
else{_this.reposition()};const imageEditBtn=this.toolBtnList['ToolBtnImageEdit']['btnList']['imageEdit'];if($(t)[0].hasAttribute('data-wv-logo')){$(this.element).find('#toolImageContent').hide();$(this.element).find('#toolLogoContent').show();$(this.element).find('#toolImageAlt').show();$(imageEditBtn).find('.label').text('이미지편집');$(imageEditBtn).parent().css({width:'',marginRight:''})}
else if(bm.getStyle(t,'background-image')!=='none'){$(this.element).find('#toolImageContent').hide();$(this.element).find('#toolLogoContent').hide();$(this.element).find('#toolImageAlt').hide();$(imageEditBtn).find('.label').text('배경이미지편집');$(imageEditBtn).parent().css({width:'115px',marginRight:'0'})}
else{$(this.element).find('#toolImageContent').show();$(this.element).find('#toolLogoContent').hide();$(this.element).find('#toolImageAlt').show();$(imageEditBtn).find('.label').text('이미지편집');$(imageEditBtn).parent().css({width:'',marginRight:''})}}
else{_this.hide()}}};ToolImage.prototype.closeConfig=function(){var t=wvAdminIFrameBridge.toolManager.toolList['ToolImage'];$(t.element).addClass('closed');if(t.toolBtnList['ToolBtnImage']){t.toolBtnList['ToolBtnImage'].removeEvent()}};ToolImage.prototype.addEvent=function(){};ToolImage.prototype.prdreposition=function(){if(this.targetElement){var n=10;if($('#WEVEN_IFRAME').length>0){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var i=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon];for(var e=0;e<i.length;e++){if($(i[e]).is(':visible')){n=25;break}}};var t=$(this.targetElement).offset().top;if(t<0){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+15};var o=$(this.targetElement).offset().left-this.element.offsetWidth-n;$(this.element).css({'top':t,'left':o})}};var ToolThumb=function(){this.thumbCon;this.thumbTemplate;this.swiperCon;this.swiperBlockCon;this.thumbDropArea;this.thumbList=[];this.swiperSelector;this.textThumbBgPath='/weven_service/asset/toolbar/img/tool_data/thumb_text_default.png';this.kit;this.kitReposMode='fixed';this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolThumb);ToolThumb.prototype.onChangeTarget=function(t,e){if(bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param')).paging_type==='slide'&&$(t).attr('data-wv-layout-element-type')==='shop_list'){this.swiperBlockCon=$(t)}
else{this.swiperBlockCon=$(t).closest('[data-wv-layout-element-type=thumb]')};this.swiperCon=$(t).closest('[data-wv-swiper-con]');if(this.swiperCon.length==0){this.swiperCon=$(this.swiperBlockCon).find('[data-wv-swiper-con]').eq(0)};if(!t||this.swiperBlockCon.length==0){return};var i=this;if(isExpertMode){i['kit']=$('#SwiperControlKit')[0]};if(this.swiperCon.find('[data-wv-swiper-img]').eq(0).css('backgroundImage')=='none'&&this.swiperBlockCon.find('[data-wv-swiper-con]').length>1){var n=0;while(1){$(this.swiperBlockCon).find('[data-wv-swiper-con]').each(function(){if(n==0){n++;return};if(n==-1){return};if($(this).find('[data-wv-swiper-img]').eq(0).css('backgroundImage')!='none'){i.swiperCon=this;n=-1;return};n++});if(n==-1)break}};var o,a;if(!i['toolBtnList']){i['toolBtnList']=[]};var s=i.toolBtnList.length;for(o=0;o<s;o++){a=i.toolBtnList[o];a.changeTarget(t)};if(!this['element']){this['element']=$('#thumbImgManager')[0]};if(this.element){this.swiperSelector=bm.parsing.parseStrToObj($(this.swiperBlockCon).find('[data-wv-com-op]').attr('data-wv-com-op'))['selector'];if(!this.thumbCon){this.thumbCon=$(this.element).find('.thumb_con');this.thumbDropArea=$(this.element).find('.thumb_drop_area');this.thumbDropArea.remove();this.thumbTemplate=this.thumbTemplate?this.thumbTemplate:$(this.element).find('[data-thumb-template]')[0].outerHTML;$(this.element).find('[data-thumb-template]').remove()};this.clearThumbList();this.thumbList=[];this.initImgListCon()};if(isExpertMode){this.reposition=function(){};this.hide=function(){};this.show=function(){}};if(!$(i.targetElement).attr('data-wv-layout-element-type')||!$(i.targetElement).attr('data-wv-layout-element-type')==='shop_list'){i.show()};i.reposition()};ToolThumb.prototype.initImgListCon=function(){var i={};var n,t=this,o=!1,a=this.swiperCon;if($(this.swiperCon).find('[data-wv-swiper-img]').length==0){a=this.swiperBlockCon};var e;$(t.thumbCon).empty();$(a).find('.swiper-slide').each(function(){if($(this).attr('data-wv-swiper-img')!==undefined){e=$(this)[0]}
else if($(this).find('[data-wv-swiper-img]').length>0){e=$(this).find('[data-wv-swiper-img]')[0]};if(e){i['url']=bm.getStyle(e,'background-image');if(i['url']=='none'||!i['url']){if(e.tagName==='IMG'&&e.src){i['url']='url("'+e.src+'")'}
else{i['url']='url("'+t.textThumbBgPath+'")';o=!0}};n=bm.dom.singleInterpreter(i,t.thumbTemplate,t.thumbCon);if(o){$(n).addClass('text_thumb')};t.thumbList.push(n)}});t.registThumbEvent();this.resetThumbDragEvent();if(isExpertMode){t.kitReposition(t['kit'],null,!1)}};ToolThumb.prototype.registEvent=function(){};ToolThumb.prototype.openPopAndChangeThumb=function(t){var i=this,e=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(e).css('max-height','1200px');$(e).css('max-width','1600px');$(e).on('load',function(){e.contentWindow.fileManager.onSelectCallBack=function(e){bm.popupManager.removePopLatest();var o=new RegExp('jpg|jpeg|gif|png'),a=e.extension.toLowerCase();if(o.test(a)){var n=e.thumbImg;if(n.indexOf('/__thumb__/')>-1)n=n.replace('/__thumb__/','/');if(n.indexOf('?ver=')>-1){n=n.replace(n.slice(n.indexOf('?ver='),n.length),'')}
else if(n.indexOf('image.weven.kr')>-1){n=n.replace('//image.weven.kr','//cdn.zgai.ai')}
else if(n.indexOf('image-studio.weven.kr')>-1){n=n.replace('//image-studio.weven.kr','//cdn.zgai.ai')}
else if(n.indexOf('image.zgai.ai')>-1){n=n.replace('//image.zgai.ai','//cdn.zgai.ai')}
else if(n.indexOf('image-studio.zgai.ai')>-1){n=n.replace('//image-studio.zgai.ai','//cdn.zgai.ai')};i.changeThumb(n,t);i.resetThumbDragEvent()}
else{alert('이미지만 선택 가능합니다.')}}})};ToolThumb.prototype.deleteThumb=function(t,e){if(this.thumbList.length==1){alert('롤링배너는 최소 1개의 이미지를 가지고 있어야 합니다.')}
else{if(confirm('삭제하시겠습니까?')){e?e=e:e=$(t['target']).parent();var i=$(e).index();this.removeThumb($(e),i)}}};ToolThumb.prototype.moveSlide=function(t){var e;if($('#WEVEN_IFRAME').length>0)e=$('#WEVEN_IFRAME')[0].contentWindow;else e=window;e.bm.swiper.setSwiperIndex(this.swiperSelector,t)};ToolThumb.prototype.registThumbEvent=function(){var t=this;$(this.element).off('dblclick','[data-thumb-template]');$(this.element).off('click','[data-thumb-template]');$(this.element).off('click','[data-thumb-template] .delete_btn');$(this.element).on('click','[data-thumb-template]',function(e){$(e.target).siblings().removeClass('active');$(this).toggleClass('active');t.moveSlide($(this).index())});$(this.element).on('dblclick','[data-thumb-template]',function(e){var i=$(this).index();t.openPopAndChangeThumb(i)});$(this.element).on('click','[data-thumb-template] .delete_btn',function(e){e.stopPropagation();t.deleteThumb(e,null)})};ToolThumb.prototype.removeThumbEvent=function(t){$(t).off('click');$(t).find('.delete_btn').off('click')};ToolThumb.prototype.clearThumbList=function(){var t=this;this.thumbCon.find('[data-thumb-template]').each(function(){t.removeThumbEvent(this)});this.thumbCon.empty()};ToolThumb.prototype.changeThumb=function(t,e){var i=this.thumbList[e];if(i['length']&&i['length']>0)i=i[0];$(i).css('backgroundImage','url(\''+t+'\')');var o=$(this.swiperCon).find('[data-wv-com="swiper"]');bm.toolManager.toolBtnEditBefore(null,o,HistoryType.EDITOR_SWIPER);var n;if($('#WEVEN_IFRAME').length>0)n=$('#WEVEN_IFRAME')[0].contentWindow;else n=window;n.bm.swiper.changeThumbImageItem(this.swiperSelector,t,e);bm.toolManager.toolBtnEditAfter(null,o,HistoryType.EDITOR_SWIPER)};ToolThumb.prototype.getDimResId=function(t){const attr=$(t).find('[data-wv-background-dim]').attr('data-wv-res-id');if(attr!==undefined&&attr!==''){return attr}
else{return!1}};ToolThumb.prototype.addBlockJs=function(t){wvAdminIFrameBridge.toolManager.toolList.ToolDomBackgroundDim.toolBtnList.ToolBtnDomBackgroundDim.addBlockJs(t)};ToolThumb.prototype.addThumb=function(t,e){var a={};t=fixedEncodeURI(t);a['url']='url("'+t+'")';var o=$(this.swiperCon).find('[data-wv-com="swiper"]');bm.toolManager.toolBtnEditBefore(null,o,HistoryType.EDITOR_SWIPER);var n=bm.dom.singleInterpreter(a,this.thumbTemplate,this.thumbCon);if(e){n.addClass('text_thumb')};this.thumbList.push(n);this.registThumbEvent(n);var i;if($('#WEVEN_IFRAME').length>0)i=$('#WEVEN_IFRAME')[0].contentWindow;else i=window;const newSlide=i.bm.swiper.addThumbItem(this.swiperSelector,t,e);const newDimResId=this.getDimResId(newSlide);if(newDimResId){this.addBlockJs(newDimResId)};bm.toolManager.toolBtnEditAfter(null,o,HistoryType.EDITOR_SWIPER)};ToolThumb.prototype.removeThumb=function(t,e){var n=$(this.swiperCon).find('[data-wv-com="swiper"]');bm.toolManager.toolBtnEditBefore(null,n,HistoryType.EDITOR_SWIPER);this.removeThumbEvent(t);$(t).remove();this.thumbList.splice(e,1);var i;if($('#WEVEN_IFRAME').length>0)i=$('#WEVEN_IFRAME')[0].contentWindow;else i=window;i.bm.swiper.removeThumbItem(this.swiperSelector,e);bm.toolManager.toolBtnEditAfter(null,n,HistoryType.EDITOR_SWIPER)};ToolThumb.prototype.changeThumbIndex=function(t,e){var n=$(this.swiperCon).find('[data-wv-com="swiper"]');bm.toolManager.toolBtnEditBefore(null,n,HistoryType.EDITOR_SWIPER);var i;if($('#WEVEN_IFRAME').length>0)i=$('#WEVEN_IFRAME')[0].contentWindow;else i=window;i.bm.swiper.changeThumbItem(this.swiperSelector,t,e);bm.toolManager.toolBtnEditAfter(null,n,HistoryType.EDITOR_SWIPER)};ToolThumb.prototype.resetThumbDragEvent=function(){this.removeThumbDragEvent();this.registThumbDragEvent()};ToolThumb.prototype.registThumbDragEvent=function(){$(this.element).find('.thumb_con .thumb_img_list').each(function(){if(isExpertMode){mouseAdapter(this).onDrag(p,g,u,undefined,window.parent.document.body)}
else{mouseAdapter(this).onDrag(p,g,u)}});if(isExpertMode){var h,a,s,t,i=!1}
else{var d,n,o,t,i=!1};var e=this,l,c,f;function p(e){if(isExpertMode){a=e.clientY-h;s+=a}
else{n=e.clientX-d;o+=n};if(i){if(isExpertMode){t.yy=t.yy+a;$(t).css({top:t.yy+'px'});r(t.yy)}
else{t.xx=t.xx+n;$(t).css({left:t.xx+'px'});r(t.xx)}}
else{if(isExpertMode){if(Math.abs(s)>10){i=!0;t.yy=(t.offsetTop+s);t.xx=t.offsetLeft;$(t).css({position:'absolute',left:t.xx+'px',top:t.yy+'px',zIndex:9999,opacity:0.6});$(t).addClass('thumb_drag_target');r(t.yy)}}
else{if(Math.abs(o)>10){i=!0;t.xx=(t.offsetLeft+o);t.yy=t.offsetTop;$(t).css({position:'absolute',left:t.xx+'px',top:t.yy+'px',zIndex:9999,opacity:0.6});$(t).addClass('thumb_drag_target');r(t.xx)}}};if(isExpertMode){h=e.clientY}
else{d=e.clientX}};function u(i){t=i.target;if(isExpertMode){h=i.clientY;a=0;s=0}
else{d=i.clientX;n=0;o=0};var r=$(e.element).find('.thumb_con .thumb_img_list');l=r.not(t);c=r.index(t);if(isExpertMode){e.kitReposition(e['kit'],i,!0)}};function g(n){if(!i)return;i=!1;$(e.thumbDropArea).before(t);$(t).removeClass('thumb_drag_target');$(t).css({position:'relative',left:'unset',top:'unset',zIndex:'',opacity:1});$(e.thumbDropArea).remove();var o=$(e.element).find('.thumb_con .thumb_img_list');f=o.index(t);e.changeThumbIndex(c,f);if(isExpertMode){e.kitReposition(e['kit'],n,!0)}};function r(t){var o=l.length,n=0,i=!1;l.each(function(){if(i)return;if(isExpertMode){var f=this.offsetTop,d=this.offsetHeight,s=f+d/2,h=s+d;if(n==0&&t<s){$(this).before(e.thumbDropArea);i=!0}
else if(n==o-1&&t>h){$(this).after(e.thumbDropArea);i=!0}
else if(t>s&&t<=h){$(this).after(e.thumbDropArea);i=!0}}
else{var c=this.offsetLeft,r=this.offsetWidth,a=c+r/2,l=a+r;if(n==0&&t<a){$(this).before(e.thumbDropArea);i=!0}
else if(n==o-1&&t>l){$(this).after(e.thumbDropArea);i=!0}
else if(t>a&&t<=l){$(this).after(e.thumbDropArea);i=!0}}})}};ToolThumb.prototype.removeThumbDragEvent=function(){$(this.element).find('.thumb_con .thumb_img_list').each(function(){if(__mouseAdapter.is(this))mouseAdapter(this).offDrag()})};ToolThumb.prototype.addEvent=function(){var t=this;if(!t['element']){t['element']=$('#thumbImgManager')};if(!t['kit']){t['kit']=$('#SwiperControlKit')};function e(e,i){bm.popupManager.removePopLatest();var a,r=new RegExp('jpg|jpeg|gif|png');!e['extension']?e['extension']=e['type']:{};var s=e.extension.toLowerCase();if(r.test(s)){try{var o;if(isExpertMode&&!e.thumbImg){if(isStudio===!0){o=!e.thumbImg?CDN_URL.replace('-studio','')+'/weven_template/member/'+loginSessionInfo['seq']+'/file_manager/'+e['name']+'?type=w&w=768&quality=80':e.thumbImg}
else{const path=i['data']['dataList'][e['name']];o=CDN_URL.replace('-studio','')+path+'?type=w&w=768&quality=80'}}
else{o=e.thumbImg}}catch(n){console.error(n)};a=new Image();a.src=o;t.addThumb(o);t.resetThumbDragEvent();if(isExpertMode&&wvAdminIFrameBridge['iframeWindow']){t.moveSlide(wvAdminIFrameBridge['iframeWindow']['bm']['swiper'].getSwiper(t.swiperSelector)['slideCount']-1);$($('[data-wv-toolset="ToolSwiper_ex"] [role="tablist"]').children()[1]).trigger('click')};bm.toast('슬라이드가 추가되었습니다.')}
else{alert('이미지만 추가 가능합니다.')}};if(!t['dragDropUpload']){t['dragDropUpload']=new bm.dragDropUpload($('#fileManagerUploadFormByDrop')[0],$('#filemanagerFileSelectByDrop')[0],e)};$(this.element).find('.add_btn').off('click').on('click',function(){if($(t.thumbList[t.thumbList.length-1]).hasClass('text_thumb')){t.addThumb(t.textThumbBgPath,!0);t.resetThumbDragEvent()}
else{var i=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(i).css('max-height','1200px');$(i).css('max-width','1600px');$(i).on('load',function(){i.contentWindow.fileManager.onSelectCallBack=e})}});if(isExpertMode){$(t['kit']).find('.edit').off('click').on('click',function(e){e.stopPropagation();var i=$(t['targetThumb']).index();t.openPopAndChangeThumb(i)});$(t['kit']).find('.delete').off('click').on('click',function(e){e.stopPropagation();t.deleteThumb(e,t['targetThumb']);t.initImgListCon()});$(t['kit']).find('.up').off('click').on('click',function(e){e.stopPropagation();var i=$(t['targetThumb']).index()-1,n=$(t['targetThumb']).index();if(i<0){bm.toast('맨 처음 슬라이드입니다.');return!1};t.changeThumbIndex(i,n);t.initImgListCon()});$(t['kit']).find('.down').off('click').on('click',function(e){e.stopPropagation();var i=$(t['targetThumb']).index()+1,n=$(t['targetThumb']).index();if(t['thumbList'].length-1<i){bm.toast('마지막 슬라이드입니다.');return!1};t.changeThumbIndex(i,n);t.initImgListCon()})}};ToolThumb.prototype.removeEvent=function(){$(this.element).find('.add_btn').off('click');this.removeThumbDragEvent();$(this['kit']).find('.edit').off('click');$(this['kit']).find('.delete').off('click');$(this['kit']).find('.up').off('click');$(this['kit']).find('.down').off('click')};ToolThumb.prototype.reposition=function(){if(this.swiperBlockCon&&this.swiperBlockCon.length>0){var t=$(this.swiperBlockCon).offset().top-this.element.offsetHeight-10,i=$(this.innerWindow.document).scrollTop();if(t<0||t<i){t=$(this.swiperBlockCon).offset().top+$(this.swiperBlockCon)[0].offsetHeight+10};if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.height()+i<t){t=window['wvAdminIFrameBridge'].contentSizeCon[0].offsetHeight-this.element.offsetHeight-10+i};var e=$(this.swiperBlockCon).offset().left+($(this.swiperBlockCon).width()-this.element.offsetWidth)/2;if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.width()-$(this.element)[0].offsetWidth<e){e=$(this.swiperBlockCon).offset().left+this.swiperBlockCon.offsetWidth-$(this.element)[0].offsetWidth};$(this.element).css({'top':t,'left':e})}};ToolThumb.prototype.kitReposition=function(t,e,i){if(!t){t=$('#SwiperControlKit')[0]};if(i===!0){$(t).css({display:'flex'})}
else{$(t).css({display:'none'})};if(!e){return!0};this['targetThumb']=e['target'];const scrollKit=$(t).closest('.toolset_wrap')[0];const kitParentNodeRect=t['parentNode'].getBoundingClientRect();const kitNodeRect=t.getBoundingClientRect();const targetThumbRect=this['targetThumb'].getBoundingClientRect();let x,y;if(this['kitReposMode']==='fixed'){x=targetThumbRect['width']/2-kitNodeRect['width']/2;y=targetThumbRect['y']+scrollKit.scrollTop-10}
else if(this['kitReposMode']==='auto'){x=e['x']-kitParentNodeRect['x'];y=e['y']-kitParentNodeRect['y']-kitNodeRect['height'];const kitWidth=kitNodeRect['width']==0?110:kitNodeRect['width'];if(window['innerWidth']<e['clientX']+kitWidth){x-=kitWidth}};$(t).css({top:y,left:x})};var ToolSwiper_ex=function(){this.data={};this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolSwiper_ex);ToolSwiper_ex.prototype.onChangeTarget=function(t,e){var i=this;if(bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param')).paging_type&&$(t).attr('data-wv-layout-element-type')==='shop_list'){if(bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param')).paging_type.indexOf('slide')>-1){i.swiperBlockCon=$(t)}
else{i.swiperBlockCon=null}}
else{if($(t).closest('[data-wv-layout-element-type=thumb]').length>0){i.swiperBlockCon=$(t).closest('[data-wv-layout-element-type=thumb]')}
else{i.swiperBlockCon=null}};if(!i.swiperBlockCon){ToolSwiper_ex.prototype.closeConfig();return!1};i.swiperCon=$(t).closest('[data-wv-swiper-con]');if(i.swiperCon.length==0){i.swiperCon=$(i.swiperBlockCon).find('[data-wv-swiper-con]').eq(0)};if(!t||i.swiperBlockCon.length==0){return!1};i['currBlock']=i['swiperBlockCon'].closest('[data-wv-design-area]')[0];this.showThumb(t);wvAdminIFrameBridge['toolManager']['toolList']['ToolThumb'].addEvent();const elementBtnList=$('[data-wv-toolset="ToolSwiper_ex"] [role="tablist"]');$(elementBtnList.find('li')[0]).trigger('click')};ToolSwiper_ex.prototype.showThumb=function(t,e){e?e=e:e=!1;if(bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param')).paging_type==='slide'&&$(t).attr('data-wv-layout-element-type')==='shop_list'){this.swiperBlockCon=$(t)}
else{this.swiperBlockCon=$(t).closest('[data-wv-layout-element-type=thumb]');if(this['swiperBlockCon'].length===0){return!1}};this.designBlock=$(this['swiperBlockCon']).closest('[data-wv-layout-element="block"]')[0];if(!this.designBlock){this.designBlock=this['swiperBlockCon']};if($(this.designBlock).attr('data-wv-block-id')){var i=$(this.designBlock).attr('data-wv-block-id').replace('___','')}
else{var i=''};const prevImgUrl=IMAGE_URL+'weven_template/block/'+i+'/1/block.thumb?type=w&w=480&quality=80';$('#thumbSwiperManager').find('.svg_preview_con').css({backgroundImage:'url('+prevImgUrl+')',backgroundSize:'contain'});if(e){$('#thumbSwiperManager').find('.svg_preview_con').addClass('text_thumb')}};ToolSwiper_ex.prototype.openBlockListPop=function(t){var e=this,n='스와이퍼',i={startPage:1,numPerPage:100};i['memberSeq']=-1;i['isOwn']=0;i['themeId']=getThemeId();i['themeRev']=getThemeRev();i['isMaster']=getIsMasterMode();i['searchCategory']='B0001';bm.httpSendJsonPost(WEB_ROOT+'blockTemplateManage/getPublicBlockList',i,function(i){if(i.result){e.data[t]=i.data.result;if(e.data[t].length>0){e.$showBlockPopup=bm.popupManager.add('#showSwiperBlockListPop',!1,null,[0,0,0,0],!0,!0,undefined,100006);$(e.$showBlockPopup).find('#changeSwiperBtn').text(n+' 반영하기');$(e.$showBlockPopup).find('.popup_close_btn > a').text('');$(e.$showBlockPopup).find('.block_list_cnt_con').find('span').text(e.data[t].length+'개의 '+n);$(e.$showBlockPopup).find('.popup_title').text(n+' 블록 템플릿');$(e['$showBlockPopup']).find('.show_all_block_list_con').empty();for(var o=0;o<e.data[t].length;o++){e.renderBlock(e.data[t][o])};bm.popupManager.repositioning('#showSwiperBlockListPop');$(e.$showBlockPopup).find('[data-wv-block-template]').off('click').on('click',function(t){if($(t.target).closest('.show_all_block_list_inner').length>0){var i=$(this);$(e.$showBlockPopup).find('[data-wv-block-template]').removeClass('selected');i.addClass('selected');e.selectedBlockInfo={contentId:i.attr('data-wv-toolbar-side-block-id'),contentRev:i.attr('data-wv-toolbar-side-block-rev'),contentHtml:i.attr('data-wv-toolbar-side-block-html'),contentCss:i.attr('data-wv-toolbar-side-block-css'),contentJs:i.attr('data-wv-toolbar-side-block-script')}}});$(e.$showBlockPopup).find('#changeSwiperBtn').off('click').on('click',function(t){if(e.selectedBlockInfo&&confirm(n+' 템플릿 변경 시, 현재 사용중인 '+n+'는 모두 초기화 됩니다. 변경하시겠습니까?')){e.appendBlock('swiper',e['selectedBlockInfo'],e['removePrevBlock'])}});$(e.$showBlockPopup).find('[data-wv-block-template]').off('dblclick').on('dblclick',function(t){if($(t.target).closest('.show_all_block_list_inner').length>0&&e.selectedBlockInfo){$(e.$showBlockPopup).find('#changeSwiperBtn').trigger('click')}})}}
else{alert(i.message)}})};ToolSwiper_ex.prototype.removePrevBlock=function(t){const blockHeight=parseInt(t['clientHeight']);wvAdminIFrameBridge._WVLayoutKit.removeBlock(t,!0,!0);bm.popupManager.removePopLatest(!0);wvAdminIFrameBridge['iframeWindow'].scrollBy(0,-(blockHeight));bm.toast('스와이퍼 블록이 교체되었습니다.')};ToolSwiper_ex.prototype.appendBlock=function(t,e,i){var s=this,a=e['contentId'],r=e['contentRev'],l=e['contentHtml'],h=e['contentCss'],d=e['contentJs'],n=wvAdminIFrameBridge,o=n._WVContentArea,c=n._WVAdminBlockBar,f=n._WVLayoutKit;$.get(l,function(t){if(typeof t=='string'){if(t.indexOf('<title>Error</title>')>-1){n.showLoginPopup();n.toolManager.reset();n.resetControllContentArea();return}
else{t=$.parseJSON(t)}};var e,l;o.setBlockNewResourceId(t.data['html'],a,!0,function(t,i){e=t;l=i});o.addBlockRes(d,a,r,e,'block',function(t,e){var h=$(l).clone(),a;if(t!=null&&t.result){var d=t.data.result,c=d.id;a=o.changeAddBlockTag(h[0].outerHTML)};var r=!1;r=o.dropElement(a,'swiperAdd');if(i)i(s['currBlock']);n.resetControllContentArea()})})};ToolSwiper_ex.prototype.renderBlock=function(t){var e=t['tag_name']?t['tag_name']:'',i='<div data-wv-block-template class="col-12 col-md-6 col-xl-4 show_all_block_list"                   data-side-item-type="block" title="'+t['subject']+'"                   data-wv-toolbar-side-block-id="'+t['id']+'"                   data-wv-toolbar-side-block-rev="'+t['revision']+'"                   data-wv-toolbar-side-block-html="'+t['html']+'"                   data-wv-toolbar-side-block-css="'+t['css']+'"                   data-wv-toolbar-side-block-script="'+t['js']+'"                   data-wv-toolbar-side-block-tag="'+e+'">                <div class="col-12 show_all_block_list_inner">                    <div class="col-12 block_img_con">                       <img src="'+t['thumbnail']+'" alt="'+t['id']+'" data-wv-toolbar-side-block-thumb>                    </div>                    <div class="col-12 block_title_con">                        <div class="col-12 block_title">'+t['subject']+'                       </div>                        <div class="col-12 block_desc">'+e+'                       </div>                       <div class="col-0 is_using_block"></div>                    </div>               </div>           </div>';$(this.$showBlockPopup).find('.show_all_block_list_con').append(i);$(this.$showBlockPopup).find('.is_using_block').text('사용중인 '+this.selectedBlockInfo)};ToolSwiper_ex.prototype.openConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolSwiper_ex'];$(e.element).removeClass('closed');ToolThumb.prototype.addEvent()};ToolSwiper_ex.prototype.closeConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolSwiper_ex'];$(e.element).addClass('closed');ToolThumb.prototype.removeEvent()};ToolSwiper_ex.prototype.addEvent=function(){const _this=this;const elementBtnList=$('[data-wv-toolset="ToolSwiper_ex"] [role="tablist"]');elementBtnList.on('click',function(t){const innerTool=wvAdminIFrameBridge['toolManager']['toolList'];elementBtnList.find('li').removeClass('active');$(t['target']).closest('li').addClass('active');switch(t['target']['textContent']){case'요소':$(innerTool['ToolSwiper']['element']).show();$(innerTool['ToolThumb']['element']).hide();break;case'이미지':$(innerTool['ToolSwiper']['element']).hide();$(innerTool['ToolThumb']['element']).show();break}});const templateBtn=$('#SwiperTemplate');templateBtn.on('click',function(t){_this.openBlockListPop('스와이퍼')})};ToolSwiper_ex.prototype.removeEvent=function(){const elementBtnList=$('[data-wv-toolset="ToolSwiper_ex"] [role="tablist"]');elementBtnList.off('click')};var ToolSwiper=function(){this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolSwiper);ToolSwiper.prototype.onChangeTarget=function(t,e){var i=this;if(isExpertMode){if(!this['element']){this['element']=$('#thumbSwiperManager')[0]};i.show();return!1}
else{if(bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param')).paging_type&&$(t).attr('data-wv-layout-element-type')==='shop_list'){if(bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param')).paging_type.indexOf('slide')>-1){i.swiperBlockCon=$(t)}
else{i.swiperBlockCon=null}}
else{if($(t).closest('[data-wv-layout-element-type=thumb]').length>0){i.swiperBlockCon=$(t).closest('[data-wv-layout-element-type=thumb]')}
else{i.swiperBlockCon=null}};if(!i.swiperBlockCon){i.hide();return!1};i.swiperCon=$(t).closest('[data-wv-swiper-con]');if(i.swiperCon.length==0){i.swiperCon=$(i.swiperBlockCon).find('[data-wv-swiper-con]').eq(0)};if(!t||i.swiperBlockCon.length==0){return!1};if(!this['element']){this['element']=$('#thumbSwiperManager')[0]};var i=this,n,o,a=i.toolBtnList.length;for(n=0;n<a;n++){o=i.toolBtnList[n];o.changeTarget(t)};i.show();i.reposition()}};ToolSwiper.prototype.addEvent=function(){};ToolSwiper.prototype.removeEvent=function(){};ToolSwiper.prototype.reposition=function(){var i=$(wvAdminIFrameBridge._WVContentArea.$contentBody).find('#thumbImgManager');if(this.swiperBlockCon&&this.swiperBlockCon.length>0&&i.length>0){if(!$(this.targetElement).attr('data-wv-layout-element-type')||!$(this.targetElement).attr('data-wv-layout-element-type')==='shop_list'){var t=i.offset().top-this.element.offsetHeight,e=i.offset().left;if(t<0){t=i.offset().top+i[0].offsetHeight};$(this.element).css({'top':t,'left':e})}
else{var t=$(this.swiperBlockCon).offset().top-this.element.offsetHeight-10,n=$(this.innerWindow.document).scrollTop();if(t<0||t<n){t=$(this.swiperBlockCon).offset().top+$(this.swiperBlockCon)[0].offsetHeight+10};if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.height()+n<t){t=window['wvAdminIFrameBridge'].contentSizeCon[0].offsetHeight-this.element.offsetHeight-10+n};var e=$(this.swiperBlockCon).offset().left;if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.width()-$(this.element)[0].offsetWidth<e){e=$(this.swiperBlockCon).offset().left+this.swiperBlockCon.offsetWidth-$(this.element)[0].offsetWidth};$(this.element).css({'top':t,'left':e})}}};var ToolTab=function(){this.targetLine=null;this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolTab);ToolTab.prototype.onChangeTarget=function(t){if(!t||$(t).closest('[data-wv-tab]').length!=1){return};var e=this,i,n,o=e.toolBtnList.length;for(i=0;i<o;i++){n=e.toolBtnList[i];n.changeTarget(t)};e.show();e.reposition()};ToolTab.prototype.reposition=function(){var t=null;if(this.targetElement){if($(this.targetElement).closest('[data-wv-tab]').length)t=this.targetElement;else return;var i=$(t).offset().top-this.element.offsetHeight-10,e=$(t).offset().left,n=$(this.innerWindow.document).scrollTop();if(i<0||i<n){i=$(t).offset().top+t.offsetHeight+10};if(window['wvAdminIFrameBridge']&&$(this.innerWindow.document.body).width()-$(this.element)[0].offsetWidth<e){e=$(t).offset().left+t.offsetWidth-$(this.element)[0].offsetWidth};if(e<0)e=0;$(this.element).css({'top':i,'left':e})}};ToolTab.prototype.addEvent=function(){};ToolTab.prototype.removeEvent=function(){};var ToolLabel=function(){this.onBtnClick=function(t){var e=t.data.prop;ToolLabel.prototype.elementLabel(e)};$('#letsLabel').prop('checked',bm.cookie.getCookie('label')==='true'?!0:!1);var t=this;$('#letsLabel').off('change').on('change',function(){if($(this).prop('checked')&&wvAdminIFrameBridge._WVLayoutKit.targetElement){t.show()}
else{t.hide()};t.reposition();bm.cookie.setCookie('label',$(this).prop('checked'),3)})};bm.extend(ToolBase,ToolLabel);ToolLabel.prototype.elementLabel=function(t){var e=wvAdminIFrameBridge.toolManager.toolList.ToolLabel.target,i=wvAdminIFrameBridge.toolManager.toolList.ToolLabel.element;if(t!==''&&t){if($(e).attr('data-wv-label')===t){$(e).removeAttr('data-wv-label');$(i).find('[data-wv-tool-btn-prop]').removeClass('active')}
else{$(e).attr('data-wv-ai-label',t);$(i).find('[data-wv-tool-btn-prop]').removeClass('active');$(i).find('[data-wv-tool-btn-prop="'+t+'"]').addClass('active')}}};ToolLabel.prototype.onChangeTarget=function(t){if(!t||($(t).attr('data-wv-layout-element')!=='block')){return};if((wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.STUDIO||wvAdminIFrameBridge._WVContentArea.designMode==EDITOR_MODE.EXPERT)&&loginSessionInfo.seq!=='-1'){return!1};if(isExpertMode===!1){return!1};var e=this,i,n,o=e.toolBtnList.length;for(i=0;i<o;i++){n=e.toolBtnList[i];n.changeTarget(t)};if($('#letsLabel').prop('checked')){e.show()}
else{e.hide()};e.reposition();e.target=t;$(this.element).find('[data-wv-tool-btn="ToolBtnLabel"]').off('mouseenter').on('mouseenter',function(){$(this).find('img').attr('src','/weven_service/asset/toolbar/img/tool/AI_LABEL_PIKA.png');$(this).find('img').attr('alt','피카')});$(this.element).find('[data-wv-tool-btn="ToolBtnLabel"]').off('mouseleave').on('mouseleave',function(){$(this).find('img').attr('src','/weven_service/asset/toolbar/img/tool/tool_image_edit.png');$(this).find('img').attr('alt','라벨링')});$(this.element).find('[data-wv-tool-btn-prop]').removeClass('active');$(this.element).find('[data-wv-tool-btn-prop="'+$(t).attr('data-wv-ai-label')+'"]').addClass('active');$(this.element).find('#imageLabel').show();$(this.element).find('#aiLabel').hide()};ToolLabel.prototype.addEvent=function(){};ToolLabel.prototype.removeEvent=function(){};ToolLabel.prototype.reposition=function(){if(this.targetElement){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var o=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.elementVisibleToggleBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon],n=10;for(var i=0;i<o.length;i++){if($(o[i]).is(':visible')){n=25;break}};var t=$(this.targetElement).offset().top-this.element.offsetHeight-n,e=$(this.targetElement).offset().left,a=$(this.innerWindow.document).scrollTop();if(t<0||t<a){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+n};if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.width()-$(this.element)[0].offsetWidth<e){e=$(this.targetElement).offset().left+this.targetElement.offsetWidth-$(this.element)[0].offsetWidth};$(this.element).css({'top':t,'left':e})}};var ToolGrid=function(){this.onBtnClick=function(t){var e=t.data.prop;ToolGrid.prototype.elementGrid(e)}};bm.extend(ToolBase,ToolGrid);ToolGrid.prototype.elementGrid=function(t){var e=wvAdminIFrameBridge.toolManager.toolList.ToolGrid.target,i=wvAdminIFrameBridge.toolManager.toolList.ToolGrid.element};ToolGrid.prototype.onChangeTarget=function(t,e){function i(){if(($(t).attr('data-wv-list')==undefined&&$(t).attr('data-wv-list-template')==undefined&&$(t).closest('[data-wv-list]').length===0)||$(t).closest('[data-wv-list]').attr('data-wv-list')==='unsort'){ToolGrid.prototype.closeConfig();return!1};if($(t).closest('[data-wv-list]').attr('data-wv-list')==='unsort'){ToolGrid.prototype.closeConfig();return};if($(t).attr('data-wv-list')!==undefined){$(this.element).find('.grid_indigator').find('span').text('컨테이너')}
else{$(this.element).find('.grid_indigator').find('span').text('템플릿')};ToolGrid.prototype.closeConfig();return!1};if(isExpertMode)ToolGrid.prototype.onChangeTarget_Expert(t,e,this,i);else i()};ToolGrid.prototype.closeConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolGrid'];$(e.element).addClass('closed');if(e.toolBtnList['ToolBtnGrid']){e.toolBtnList['ToolBtnGrid'].optionList['ToolOpGrid'].removeEvent()}};ToolGrid.prototype.addEvent=function(){};ToolGrid.prototype.removeEvent=function(){};ToolGrid.prototype.reposition=function(){if(this.targetElement){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var o=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon],n=10;for(var i=0;i<o.length;i++){if($(o[i]).is(':visible')){n=25;break}};var t=$(this.targetElement).offset().top-this.element.offsetHeight-n,e=$(this.targetElement).offset().left,a=$(this.innerWindow.document).scrollTop();if(t<0||t<a){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+n};if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.width()-$(this.element)[0].offsetWidth<e){e=$(this.targetElement).offset().left+this.targetElement.offsetWidth-$(this.element)[0].offsetWidth};$(this.element).css({'top':t,'left':e})}};var ToolInsta=function(){this.onBtnClick=function(t){var e=t.data.prop;ToolInsta.prototype.elementGrid(e)}};bm.extend(ToolBase,ToolInsta);ToolInsta.prototype.elementGrid=function(t){var e=wvAdminIFrameBridge.toolManager.toolList.ToolInsta.target,i=wvAdminIFrameBridge.toolManager.toolList.ToolInsta.element};ToolInsta.prototype.onChangeTarget=function(t){var e=this;if(!t||($(t).attr('data-wv-layout-element')!=='block')){return};if($(t).attr('data-wv-layout-element-type')!=='insta'){ToolInsta.prototype.closeConfig();return};e.show=function(){$(this.element).removeClass('closed');e.toolBtnList['ToolBtnInsta'].optionList['ToolOpInsta'].addEvent()};e.hide=function(){};e.reposition=function(){$(this.element).css({display:''});$(this.element).css({top:''});$(this.element).css({left:''})};e.show();e.reposition()};ToolInsta.prototype.applyConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolInsta'];e.toolBtnList['ToolBtnInsta'].optionList.onOptionChange()};ToolInsta.prototype.openConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolInsta'];$(e.element).removeClass('closed');if(e.toolBtnList['ToolBtnInsta']){}};ToolInsta.prototype.closeConfig=function(t){var e=wvAdminIFrameBridge.toolManager.toolList['ToolInsta'];$(e.element).addClass('closed');if(e.toolBtnList['ToolBtnInsta']){e.toolBtnList['ToolBtnInsta'].optionList['ToolOpInsta'].removeEvent()}};ToolInsta.prototype.addEvent=function(){};ToolInsta.prototype.removeEvent=function(){};ToolInsta.prototype.reposition=function(){if(this.targetElement){if(!this.layoutKit)this.layoutKit=wvAdminIFrameBridge._WVLayoutKit;var o=[this.layoutKit.blockSpaceCloseBtn,this.layoutKit.resetPosBtn,this.layoutKit.moveBtn,this.layoutKit.wvPosDisplayCon],n=10;for(var i=0;i<o.length;i++){if($(o[i]).is(':visible')){n=25;break}};var t=$(this.targetElement).offset().top-this.element.offsetHeight-n,e=$(this.targetElement).offset().left,a=$(this.innerWindow.document).scrollTop();if(t<0||t<a){t=$(this.targetElement).offset().top+this.targetElement.offsetHeight+n};if(window['wvAdminIFrameBridge']&&window['wvAdminIFrameBridge'].contentSizeCon.width()-$(this.element)[0].offsetWidth<e){e=$(this.targetElement).offset().left+this.targetElement.offsetWidth-$(this.element)[0].offsetWidth};$(this.element).css({'top':t,'left':e})}};var ToolHeaderFooterSetting=function(){this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnHeaderFooterSetting'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolHeaderFooterSetting);ToolHeaderFooterSetting.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent()};ToolHeaderFooterSetting.prototype.addEvent=function(){};ToolHeaderFooterSetting.prototype.removeEvent=function(){};var ToolRecentBoard=function(){this.onBtnClick=function(t){}};bm.extend(ToolBase,ToolRecentBoard);ToolRecentBoard.prototype.onChangeTarget=function(t){if(!t||(!($(t).attr('data-wv-layout-element-type')=='bbs')&&$(t).closest('[data-wv-layout-element-type="shop_BBS_recent"]').length===0)){return};var i=this;if($(t).attr('data-wv-layout-element-type')=='bbs'){var e=bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param'));if(!e['bbsTy'])e=$.parseJSON($(t).attr('data-wv-layout-element-param'));if(e['bbsTy'].indexOf('recent')==-1)return}
else if($(t).closest('[data-wv-layout-element-type="shop_BBS_recent"]').length>0){var e=bm.parsing.parseStrToObj($(t).attr('data-wv-layout-element-param'));if(!e['shopBBSId']){var s=$(t).find('[data-wv-type="list"]'),r=bm.parsing.parseStrToObj(s.attr('data-wv-option'));e=r.param}};i.toolBtnList['ToolBtnRecentBoard'].selectBox.val(e.connectBbsId);var n,o,a=i.toolBtnList.length;for(n=0;n<a;n++){o=i.toolBtnList[n];o.changeTarget(t)};i.show();i.reposition()};ToolRecentBoard.prototype.addEvent=function(){};ToolRecentBoard.prototype.removeEvent=function(){};var ToolBoardRichEditor=function(t){this.type='ToolBoardRichEditor';this.targetTextArea;this.targetTextAreaWidth;this.btnSet=null;this.btnObjList=[];this.btnSeperator=[];var e=this;this.onWindowResize=function(){e.reposition()};var e=this};bm.extend(ToolBase,ToolBoardRichEditor);ToolBoardRichEditor.prototype.setEditor=function(t){this.editor=t;for(var i=0;i<this.btnObjList.length;i++){this.btnObjList[i].editor=this.editor};var e=this.getBtnObj('dom_sourceCode');if(e){e.target=t;e.wrapperSelector=''}};ToolBoardRichEditor.prototype.registListener=function(){$(window).on('resize',this.onWindowResize);this.registTableMouseInteraction()};ToolBoardRichEditor.prototype.setTextArea=function(t){this.targetTextArea=t;var e=parseInt($(this.targetTextArea).parent().width()),i=this.targetTextArea.offsetWidth;if(e-i<=1||(e<=100&&e>0)){this.targetTextAreaWidth='100%'}
else{this.targetTextAreaWidth=parseInt($(this.targetTextArea).width())}};ToolBoardRichEditor.prototype.removeListener=function(){$(window).off('resize',this.onWindowResize);this.removeTableMouseInteraction();$(this.targetList).off('mouseenter');ToolBase.prototype.removeListener.call(this)};ToolBoardRichEditor.prototype.registTableMouseInteraction=function(){var t=this;$(this.targetList).on('mouseenter','table',function(e){if(t.currentTarget!==this){bm.table.colSizeStatus=''};if(bm.table.colSizeStatus=='active')return;if(t.currentTarget){bm.tableSelectionManager.removeRange()};t.currentTarget=this;bm.table.colSizeStatus='ready';bm.tableSelectionManager.setTarget(this);var n=t.btnObjList.length;for(var i=0;i<n;i++){if(t.btnObjList[i].type.indexOf('table_')==0||t.btnObjList[i].type=='dom_padding'){t.btnObjList[i].changeTarget(this)}}})};ToolBoardRichEditor.prototype.removeTableMouseInteraction=function(){$(this.targetList).off('mouseenter','table')};ToolBoardRichEditor.prototype.reposition=function(){if(!this.targetTextArea)return;$(this.btnSet).css({position:'relative',marginBottom:'-1px'})};ToolBoardRichEditor.prototype.deactive=function(){if(this.status==0)return;this.status=0;var e=this.btnSeperator.length;for(var t=0;t<e;t++){this.btnSeperator[t].deactive()};if(this.currentTarget){bm.tableSelectionManager.removeRange()};this.removeListener()};var GraphicsCore={};GraphicsCore.setPixel=function(t,e,i,n,o,a){t.data[e+0]=i;t.data[e+1]=n;t.data[e+2]=o;t.data[e+3]=a};bm.imageEditorCanvasCon={container:null,canvas:null,ctx:null,canvasImg:null,ctxImg:null,canvasWidth:0,canvasHeight:0,dx:0,dy:0,currentWidth:0,currentHeight:0,imgWidth:0,imgHeight:0,naturalWidth:0,naturalHeight:0,isMotionZoom:!1,tempOriginImg:null,img:null,originImgData:null,imgData:null,latestAppliedFilterType:null,latestFilteredImgData:null,currentFilteredImgData:null,appliedFilterValue:{},zoomValue:1,originZoomValue:1,angleDegree:0,onZoom:null,onChange:null,onApplyFilter:null,init:function(t,e,i,n){this.container=i;this.canvas=$(t)[0];this.canvasImg=$(n)[0];this.ctx=this.canvas.getContext('2d',{willReadFrequently:!0});this.ctxImg=this.canvasImg.getContext('2d');var o=this;this.loadImg(e,function(){o.resetProperties();o.canvasContainerSizeResetting();o.drawImage(o.naturalWidth,o.naturalHeight,o.img);o.saveImgData();o.zoomValue=o.getFitZoomValue();o.setZoom(o.zoomValue)})},canvasContainerSizeResetting:function(){var t=$(this.container).find('#img_con').parent().width(),e=$(this.container).find('#img_con').parent().height();$(this.container).find('#img_con').width(t);$(this.container).find('#img_con').height(e)},loadImg:function(t,e){var i=this;this.img=new Image();this.img.src=t;this.img.crossOrigin='Anonymous';this.img.onload=function(){this.onload=null;i.naturalWidth=i.img.naturalWidth;i.naturalHeight=i.img.naturalHeight;i.imgWidth=i.currentWidth=i.img.naturalWidth;i.imgHeight=i.currentHeight=i.img.naturalHeight;if(e)e()}},resetImage:function(t,e){var i=this;this.loadImg(t,function(){i.canvasWidth=i.naturalWidth;i.canvasHeight=i.naturalHeight;$(i.canvas).attr('width',i.canvasWidth);$(i.canvas).attr('height',i.canvasHeight);i.setCanvasCenterPosition();i.ctx.imageSmoothingEnabled=0;i.ctx.drawImage(i.img,0,0,i.naturalWidth,i.naturalHeight,0,0,i.naturalWidth,i.naturalHeight);i.saveImgData();if(e)e()})},resetProperties:function(){this.angleDegree=0;this.zoomValue=1;this.appliedFilterValue={};this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.ctx.resetTransform();this.currentFilteredImgData=null;this.latestFilteredImgData=null},getImageData:function(){this.setZoom(1);$(this.canvasImg).attr('width',this.currentWidth);$(this.canvasImg).attr('height',this.currentHeight);var t=this.ctx.getImageData(this.dx,this.dy,this.imgWidth,this.imgHeight);this.ctxImg.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctxImg.putImageData(t,0,0);return this.canvasImg.toDataURL()},saveImgData:function(){this.imgData=this.ctx.getImageData(this.dx,this.dy,this.currentWidth,this.currentHeight)},saveImg:function(t){$(this.canvasImg).attr('width',this.imgWidth);$(this.canvasImg).attr('height',this.imgHeight);var n=this.ctx.getImageData(this.dx,this.dy,this.imgWidth,this.imgHeight);this.ctxImg.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctxImg.putImageData(n,0,0);var e=this,i=new Image();i.src=this.canvasImg.toDataURL();i.onload=function(){$(e.canvasImg).attr('width',e.currentWidth);$(e.canvasImg).attr('height',e.currentHeight);e.ctxImg.clearRect(0,0,e.canvasWidth,e.canvasHeight);e.ctxImg.drawImage(i,0,0,e.imgWidth,e.imgHeight,0,0,e.currentWidth,e.currentHeight);e.img.src=e.canvasImg.toDataURL()};this.naturalWidth=this.currentWidth;this.naturalHeight=this.currentHeight;if(t){this.img.addEventListener('load',function(e){t(e.target);e.target.removeEventListener('load',arguments.callee)})}},clearRender:function(){this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctx.beginPath()},render:function(){var t=this.currentWidth,e=this.currentHeight;this.clearRender();t=Math.floor(t*this.zoomValue);e=Math.floor(e*this.zoomValue);this.dx=this.canvasWidth-t>>1;this.dy=this.canvasHeight-e>>1;this.ctx.putImageData(this.imgData,this.dx,this.dy)},drawImage:function(t,e,i,n,o){this.clearRender();var a=this.currentWidth,s=this.currentHeight;if(t===0||t){a=t};if(e===0||e){s=e};var r=!1;if(a!=this.canvasWidth){this.canvasWidth=a;$(this.canvas).attr('width',this.canvasWidth);r=!0};if(s!=this.canvasHeight){this.canvasHeight=s;$(this.canvas).attr('height',this.canvasHeight);r=!0};if(r||o){this.setCanvasCenterPosition()};if(!i)i=this.img;this.ctx.drawImage(i,0,0,this.naturalWidth,this.naturalHeight,this.dx,this.dy,a,s);this.imgWidth=a;this.imgHeight=s;if(!n&&this.onChange)this.onChange('resize',this.getSize())},rotateVal:0,rotateImage:function(t){var n=this;if(this.currentFilteredImgData){this.applyFilteredImageToOrigin(function(){n.rotateImage(t)});return};var i=this.canvasWidth;this.canvasWidth=this.canvasHeight;this.canvasHeight=i;$(this.canvas).attr('width',this.canvasWidth);$(this.canvas).attr('height',this.canvasHeight);this.setCanvasCenterPosition();this.ctx.save();this.ctx.translate(Math.floor(this.canvasWidth/2),Math.floor(this.canvasHeight/2));if(t=='left'){this.rotateVal--;if(this.rotateVal==-4)this.rotateVal=0;this.ctx.rotate(Math.PI/180*-90)}
else{this.rotateVal++;if(this.rotateVal==4)this.rotateVal=0;this.ctx.rotate(Math.PI/180*90)};this.ctx.translate(-Math.floor(this.canvasHeight/2),-Math.floor(this.canvasWidth/2));this.ctx.drawImage(this.img,0,0,this.naturalWidth,this.naturalHeight,0,0,this.canvasHeight,this.canvasWidth);this.ctx.restore();var e=this.currentHeight;this.currentHeight=this.currentWidth;this.currentWidth=e;e=this.imgHeight;this.imgHeight=this.imgWidth;this.imgWidth=e;var e=this.naturalWidth;this.naturalHeight=this.naturalWidth;this.naturalWidth=e;this.saveImg();this.saveImgData();if(this.onChange)this.onChange('rotate',this.getSize())},cropImage:function(t){t.left*=1/this.zoomValue;t.top*=1/this.zoomValue;t.width*=1/this.zoomValue;t.height*=1/this.zoomValue;$(this.canvasImg).attr('width',t.width);$(this.canvasImg).attr('height',t.height);this.ctxImg.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctxImg.drawImage(this.img,t.left,t.top,t.width,t.height,0,0,t.width,t.height);var e=this;this.resetImage(this.canvasImg.toDataURL(),function(){if(e.onChange)e.onChange('crop',e.getSize())})},flipImage:function(t){var e=this;if(this.currentFilteredImgData){this.applyFilteredImageToOrigin(function(){e.flipImage(t)});return};this.clearRender();this.ctx.save();if(t=='horizontal'){this.ctx.translate(this.canvasWidth,0);this.ctx.scale(-1,1)}
else{this.ctx.translate(0,this.canvasHeight);this.ctx.scale(1,-1)};this.ctx.drawImage(this.img,0,0,this.naturalWidth,this.naturalHeight,0,0,this.canvasWidth,this.canvasHeight);this.ctx.restore();this.saveImg();this.saveImgData();if(this.onChange)this.onChange('flip',this.getSize())},applyFilteredImageToOrigin:function(t){if(confirm('필터가 기본 이미지에 적용됩니다. 계속하시겠습니까?\n계속해도 초기화를 통해 원본이미지로 되돌릴 수 있습니다. ')){$(this.canvasImg).attr('width',this.currentWidth);$(this.canvasImg).attr('height',this.currentHeight);this.ctxImg.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctxImg.drawImage(this.currentFilteredImgData,0,0,this.currentFilteredImgData.width,this.currentFilteredImgData.height,0,0,this.currentWidth,this.currentHeight);this.img.src=this.canvasImg.toDataURL();this.latestAppliedFilterType=null;this.currentFilteredImgData=null;this.imgWidth=this.naturalWidth=this.currentWidth;this.imgHeight=this.naturalHeight=this.currentHeight;if(this.onApplyFilter)this.onApplyFilter();if(t){this.img.addEventListener('load',function(e){setTimeout(t,100);e.target.removeEventListener('load',arguments.callee)})}}},setSizeImg:function(t,e){var n=this.currentFilteredImgData||this.img;this.currentWidth=t;this.currentHeight=e;var o=this.zoomValue;this.zoomValue=1;this.drawImage(t,e,n);this.naturalWidth=this.currentWidth;this.naturalHeight=this.currentHeight;var i=this;this.saveImg(function(){var t=i.getFitZoomValue();i.setZoom(t)});this.saveImgData()},setDimLayer:function(t){if(t&&t>0){this.ctx.fillStyle='rgba(0,0,0,'+t+')';this.ctx.fillRect(0,0,this.canvasWidth,this.canvasHeight);this.saveImg();this.saveImgData()}},zoomIncrease:function(){this.zoomValue*=10;this.zoomValue++;this.zoomValue/=10;if(this.onZoom)this.onZoom(this.zoomValue);this.canvas.style.zoom=this.zoomValue;this.setCanvasCenterPosition();return this.zoomValue},zoomDecrease:function(){this.zoomValue*=10;this.zoomValue--;if(this.zoomValue<=0)this.zoomValue=1;this.zoomValue/=10;if(this.onZoom)this.onZoom(this.zoomValue);this.canvas.style.zoom=this.zoomValue;this.setCanvasCenterPosition();return this.zoomValue},setZoom:function(t,e){if(this.isMotionZoom){return};this.zoomValue=t;if(this.onZoom)this.onZoom(this.zoomValue);this.canvas.style.zoom=t;this.setCanvasCenterPosition();if(e)e(this.zoomValue);return this.zoomValue},setCanvasCenterPosition:function(){var t=this.zoomValue,i=this.canvasWidth,n=this.canvasHeight,o=i*t,a=n*t,e=this.getContainerSize(),s=e.width-o>>1,r=e.height-a>>1,l=s*1/t,d=r*1/t;this.canvas.style.marginLeft=l+'px';this.canvas.style.marginTop=d+'px'},getCanvas:function(){return this.canvas},getProp:function(t){return this.img[t]},getImgSize:function(){return{width:this.imgWidth,height:this.imgHeight}},getCanvasSize:function(){return{width:this.canvasWidth,height:this.canvasHeight}},getSize:function(){return{width:this.currentWidth,height:this.currentHeight}},getContainerSize:function(){return{width:$('#img_con').width(),height:$('#img_con').height()}},getOffset:function(){return{left:this.canvas.offsetLeft+this.dx,top:this.canvas.offsetTop+this.dy}},getFitZoomValue:function(t){var s=50,e;if(t){e=t}
else{e=this.getSize()};var i={width:$('#img_con').width(),height:$('#img_con').height()};var o,a;if(e.width>i.width||e.height>i.height){o=(i.width-s*2)/e.width;a=(i.height-s*2)/e.height;var n=Math.min(o,a);n=Math.floor(n*10)/10;return n}
else{e.width=e.width*this.zoomValue;e.height=e.height*this.zoomValue;if(e.width>i.width||e.height>i.height){return 1}};return 1},onWindowResizeHandler:function(){bm.imageEditorCanvasCon.canvasContainerSizeResetting();var t;if(bm.imageEditorCanvasCon.currentFilteredImgData)t=bm.imageEditorCanvasCon.currentFilteredImgData;else t=bm.imageEditorCanvasCon.img;bm.imageEditorCanvasCon.drawImage(null,null,t,null,!0);bm.imageEditor.onWindowResize()},registEvent:function(){$(window).on('resize',bm.imageEditorCanvasCon.onWindowResizeHandler)},removeEvent:function(){$(this.container).off('mousewheel');$(window).off('resize',bm.imageEditorCanvasCon.onWindowResizeHandler)},filterControl:function(t,e){this.appliedFilterValue[t]=e;var i;if(this.latestAppliedFilterType!=t||!this.latestFilteredImgData){this.drawImage(null,null,this.img);i=this.ctx.getImageData(this.dx,this.dy,this.imgWidth,this.imgHeight);if(this.appliedFilterValue['brightness']!==undefined&&t!=='brightness'){i=this.getFilterBrightness(i,this.appliedFilterValue['brightness'])};if(this.appliedFilterValue['contrast']!==undefined&&t!=='contrast'){i=this.getFilterContrast(i,this.appliedFilterValue['contrast'])};if(this.appliedFilterValue['color']!==undefined&&t!=='color'){i=this.getFilterColor(i,this.appliedFilterValue['color'])};if(this.appliedFilterValue['blur']!==undefined&&t!=='blur'){i=this.getFilterBlur(i,this.imgWidth,this.imgHeight,this.appliedFilterValue['blur'],!1)};if(this.appliedFilterValue['sharpen']!==undefined&&t!=='sharpen'){i=this.getFilterSharpen(i,this.appliedFilterValue['sharpen'])};$(this.canvasImg).attr('width',this.imgWidth);$(this.canvasImg).attr('height',this.imgHeight);this.ctxImg.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctxImg.putImageData(i,0,0);if(!this.latestFilteredImgData)this.latestFilteredImgData=new Image();this.latestFilteredImgData.src=this.canvasImg.toDataURL();this.originImgData=this.ctx.getImageData(this.dx,this.dy,this.imgWidth,this.imgHeight)}
else{this.clearRender();this.ctx.drawImage(this.latestFilteredImgData,this.dx,this.dy);i=this.ctx.getImageData(this.dx,this.dy,this.imgWidth,this.imgHeight)};switch(t){case'brightness':i=this.getFilterBrightness(i,this.appliedFilterValue['brightness']);break;case'contrast':i=this.getFilterContrast(i,this.appliedFilterValue['contrast']);break;case'color':i=this.getFilterColor(i,this.appliedFilterValue['color']);break;case'blur':i=this.getFilterBlur(i,this.imgWidth,this.imgHeight,this.appliedFilterValue['blur'],!1);break;case'sharpen':i=this.getFilterSharpen(i,this.appliedFilterValue['sharpen']);break};this.ctx.putImageData(i,this.dx,this.dy);this.latestAppliedFilterType=t;$(this.canvasImg).attr('width',this.imgWidth);$(this.canvasImg).attr('height',this.imgHeight);this.ctxImg.clearRect(0,0,this.canvasWidth,this.canvasHeight);this.ctxImg.putImageData(i,0,0);if(!this.currentFilteredImgData)this.currentFilteredImgData=new Image();this.currentFilteredImgData.src=this.canvasImg.toDataURL()},getFilterBrightness:function(t,e){if(!t.data)return t;var n=t.data;for(var i=0;i<n.length;i+=4){n[i]+=255*(e/100);n[i+1]+=255*(e/100);n[i+2]+=255*(e/100)};return t},getFilterContrast:function(t,e){if(!t.data)return t;var n=t.data;e*=2.55;var o=(255+e)/(255.01-e);for(var i=0;i<n.length;i+=4){n[i]=o*(n[i]-128)+128;n[i+1]=o*(n[i+1]-128)+128;n[i+2]=o*(n[i+2]-128)+128};return t},getFilterColor:function(t,e){this.ctx.filter='hue-rotate('+e+'deg)';return this.ctx.getImageData(this.dx,this.dy,this.imgWidth,this.imgHeight)},getFilterColorRgb:function(t,e){if(!t.data)return t;function n(t){var s=[],i=255,a=o(t);for(var e=0;e<=i;e++){var n=e;s[e]={r:(n*a.r)/i,g:(n*a.g)/i,b:(n*a.b)/i}};return s};function o(t){var e;if(t[0]==='#'){t=t.substr(1)};e=parseInt(t,16);return{r:e>>16,g:(e>>8)&255,b:e&255}};var i=n(e);a(t.data);function a(t){for(var e=0;e<t.length;e+=4){var n=t[e],o=t[e+1],a=t[e+2],s=t[e+3];if(!(n==0&&o==0&&a==0)&&!(n==255&&o==255&&a==255)){t[e]=i[n].r;t[e+1]=i[o].g;t[e+2]=i[a].b;t[e+3]=s}};console.log(t)};return t},getFilterBlur:function(t,e,i,n,o){if(!t.data)return t;var a=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],s=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];if(o)return r(t,n);else return l(t,n);function r(t,n){var o=t.data;if(isNaN(n)||n<1)return;n|=0;var C,P,f,d,F,h,N,b,y,w,T,I,O,M,R,S,x,B,E,g,m,v,l,A,j=n+n+1,U=e<<2,W=e-1,V=i-1,p=n+1,D=p*(p+1)/2,H={r:0,g:0,b:0,a:0,next:null};var r=H;for(f=1;f<j;f++){r=r.next={r:0,g:0,b:0,a:0,next:null};if(f==p)var z=r};r.next=H;var c=null,u=null;N=h=0;var k=a[n],L=s[n];for(P=0;P<i;P++){S=x=B=E=b=y=w=T=0;I=p*(g=o[h]);O=p*(m=o[h+1]);M=p*(v=o[h+2]);R=p*(l=o[h+3]);b+=D*g;y+=D*m;w+=D*v;T+=D*l;r=H;for(f=0;f<p;f++){r.r=g;r.g=m;r.b=v;r.a=l;r=r.next};for(f=1;f<p;f++){d=h+((W<f?W:f)<<2);b+=(r.r=(g=o[d]))*(A=p-f);y+=(r.g=(m=o[d+1]))*A;w+=(r.b=(v=o[d+2]))*A;T+=(r.a=(l=o[d+3]))*A;S+=g;x+=m;B+=v;E+=l;r=r.next};c=H;u=z;for(C=0;C<e;C++){o[h+3]=l=(T*k)>>L;if(l!=0){l=255/l;o[h]=((b*k)>>L)*l;o[h+1]=((y*k)>>L)*l;o[h+2]=((w*k)>>L)*l}
else{o[h]=o[h+1]=o[h+2]=0};b-=I;y-=O;w-=M;T-=R;I-=c.r;O-=c.g;M-=c.b;R-=c.a;d=(N+((d=C+n+1)<W?d:W))<<2;S+=(c.r=o[d]);x+=(c.g=o[d+1]);B+=(c.b=o[d+2]);E+=(c.a=o[d+3]);b+=S;y+=x;w+=B;T+=E;c=c.next;I+=(g=u.r);O+=(m=u.g);M+=(v=u.b);R+=(l=u.a);S-=g;x-=m;B-=v;E-=l;u=u.next;h+=4};N+=e};for(C=0;C<e;C++){x=B=E=S=y=w=T=b=0;h=C<<2;I=p*(g=o[h]);O=p*(m=o[h+1]);M=p*(v=o[h+2]);R=p*(l=o[h+3]);b+=D*g;y+=D*m;w+=D*v;T+=D*l;r=H;for(f=0;f<p;f++){r.r=g;r.g=m;r.b=v;r.a=l;r=r.next};F=e;for(f=1;f<=n;f++){h=(F+C)<<2;b+=(r.r=(g=o[h]))*(A=p-f);y+=(r.g=(m=o[h+1]))*A;w+=(r.b=(v=o[h+2]))*A;T+=(r.a=(l=o[h+3]))*A;S+=g;x+=m;B+=v;E+=l;r=r.next;if(f<V){F+=e}};h=C;c=H;u=z;for(P=0;P<i;P++){d=h<<2;o[d+3]=l=(T*k)>>L;if(l>0){l=255/l;o[d]=((b*k)>>L)*l;o[d+1]=((y*k)>>L)*l;o[d+2]=((w*k)>>L)*l}
else{o[d]=o[d+1]=o[d+2]=0};b-=I;y-=O;w-=M;T-=R;I-=c.r;O-=c.g;M-=c.b;R-=c.a;d=(C+(((d=P+p)<V?d:V)*e))<<2;b+=(S+=(c.r=o[d]));y+=(x+=(c.g=o[d+1]));w+=(B+=(c.b=o[d+2]));T+=(E+=(c.a=o[d+3]));c=c.next;I+=(g=u.r);O+=(m=u.g);M+=(v=u.b);R+=(l=u.a);S-=g;x-=m;B-=v;E-=l;u=u.next;h+=e}};return t};function l(t,n){if(isNaN(n)||n<1)return t;n|=0;var r=t.data,w,k,l,d,D,h,P,v,b,y,x,B,E,T,C,S,p,u,g,O,F=n+n+1,N=e<<2,A=e-1,H=i-1,f=n+1,M=f*(f+1)/2,R={r:0,g:0,b:0,a:0,next:null};var o=R;for(l=1;l<F;l++){o=o.next={r:0,g:0,b:0,a:0,next:null};if(l==f)var W=o};o.next=R;var c=null,m=null;P=h=0;var L=a[n],I=s[n];for(k=0;k<i;k++){T=C=S=v=b=y=0;x=f*(p=r[h]);B=f*(u=r[h+1]);E=f*(g=r[h+2]);v+=M*p;b+=M*u;y+=M*g;o=R;for(l=0;l<f;l++){o.r=p;o.g=u;o.b=g;o=o.next};for(l=1;l<f;l++){d=h+((A<l?A:l)<<2);v+=(o.r=(p=r[d]))*(O=f-l);b+=(o.g=(u=r[d+1]))*O;y+=(o.b=(g=r[d+2]))*O;T+=p;C+=u;S+=g;o=o.next};c=R;m=W;for(w=0;w<e;w++){r[h]=(v*L)>>I;r[h+1]=(b*L)>>I;r[h+2]=(y*L)>>I;v-=x;b-=B;y-=E;x-=c.r;B-=c.g;E-=c.b;d=(P+((d=w+n+1)<A?d:A))<<2;T+=(c.r=r[d]);C+=(c.g=r[d+1]);S+=(c.b=r[d+2]);v+=T;b+=C;y+=S;c=c.next;x+=(p=m.r);B+=(u=m.g);E+=(g=m.b);T-=p;C-=u;S-=g;m=m.next;h+=4};P+=e};for(w=0;w<e;w++){C=S=T=b=y=v=0;h=w<<2;x=f*(p=r[h]);B=f*(u=r[h+1]);E=f*(g=r[h+2]);v+=M*p;b+=M*u;y+=M*g;o=R;for(l=0;l<f;l++){o.r=p;o.g=u;o.b=g;o=o.next};D=e;for(l=1;l<=n;l++){h=(D+w)<<2;v+=(o.r=(p=r[h]))*(O=f-l);b+=(o.g=(u=r[h+1]))*O;y+=(o.b=(g=r[h+2]))*O;T+=p;C+=u;S+=g;o=o.next;if(l<H){D+=e}};h=w;c=R;m=W;for(k=0;k<i;k++){d=h<<2;r[d]=(v*L)>>I;r[d+1]=(b*L)>>I;r[d+2]=(y*L)>>I;v-=x;b-=B;y-=E;x-=c.r;B-=c.g;E-=c.b;d=(w+(((d=k+f)<H?d:H)*e))<<2;v+=(T+=(c.r=r[d]));b+=(C+=(c.g=r[d+1]));y+=(S+=(c.b=r[d+2]));c=c.next;x+=(p=m.r);B+=(u=m.g);E+=(g=m.b);T-=p;C-=u;S-=g;m=m.next;h+=e}};return t}},getFilterSharpen:function(t,e){var l=this.currentWidth,b=this.currentHeight,y=[0,-1,0,-1,5,-1,0,-1,0],d=Math.round(Math.sqrt(y.length)),w=(d*0.5)|0,u=b,h=t.data,n=new Uint8ClampedArray(t.data);while(u--){var p=l;while(p--){var T=u,C=p,i=(u*l+p)*4,g=0,m=0,v=0,S=0;for(var r=0;r<d;r++){for(var s=0;s<d;s++){var c=T+r-w,f=C+s-w;if(c>=0&&c<b&&f>=0&&f<l){var o=(c*l+f)*4,a=y[r*d+s];g+=n[o]*a;m+=n[o+1]*a;v+=n[o+2]*a;S+=n[o+3]*a}}};h[i]=g*e+n[i]*(1-e);h[i+1]=m*e+n[i+1]*(1-e);h[i+2]=v*e+n[i+2]*(1-e);h[i+3]=n[i+3]}};return t},convolution:function(t,e,i){var h=Math.round(Math.sqrt(e.length)),T=Math.floor(h/2),c=t.data,m=t.width,C=t.height,v=m,S=C,x=this.ctx.getImageData(0,0,v,S),f=x.data,k=i?1:0;for(var d=0;d<S;d++){for(var l=0;l<v;l++){var B=d,E=l,r=(d*v+l)*4,b=0,y=0,w=0,g=0;for(var s=0;s<h;s++){for(var a=0;a<h;a++){var p=B+s-T,u=E+a-T;if(p>=0&&p<C&&u>=0&&u<m){var n=(p*m+u)*4,o=e[s*h+a];b+=c[n]*o;y+=c[n+1]*o;w+=c[n+2]*o;g+=c[n+3]*o}}};f[r]=b;f[r+1]=y;f[r+2]=w;f[r+3]=g+k*(255-g)}};return x},destroy:function(){}};bm.imageEditor={imageEditorCanvasCon:null,btnList:[],dataURL:null,editorContainer:null,originImage:null,onImageEditComplete:null,status:0,cropMode:!1,dimMode:!1,filterControl:function(t,e){if(this.checkCropMode()||this.checkDimMode())return;this.imageEditorCanvasCon.filterControl(t,e)},cropImage:function(t){if(this.checkDimMode())return;this.imageEditorCanvasCon.cropImage(t)},rotateImage:function(t){if(this.checkCropMode()||this.checkDimMode())return;this.imageEditorCanvasCon.rotateImage(t)},flipImage:function(t){if(this.checkCropMode()||this.checkDimMode())return;this.imageEditorCanvasCon.flipImage(t)},setZoom:function(t,e){if(this.checkCropMode()||this.checkDimMode())return;this.imageEditorCanvasCon.setZoom(t,e)},setSizeImg:function(t,e){if(this.checkCropMode()||this.checkDimMode())return;this.imageEditorCanvasCon.setSizeImg(t,e)},setDimLayer:function(){if(this.checkCropMode()||!this.checkDimMode())return;this.imageEditorCanvasCon.setDimLayer(this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM].dimOpacityValue)},onWindowResize:function(){if(this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_CROP].status==1){this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_CROP].status=0;this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_CROP].deactiveCropMode()};this.cropMode=!1;if(this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM].status==1){this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM].status=0;this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM].deactiveDimMode()};this.dimMode=!1},getFitZoomValue:function(t){return this.imageEditorCanvasCon.getFitZoomValue(t)},getZoomValue:function(){return this.imageEditorCanvasCon.zoomValue},getSize:function(){return this.imageEditorCanvasCon.getSize()},getImgSize:function(){return this.imageEditorCanvasCon.getImgSize()},getOffset:function(){return this.imageEditorCanvasCon.getOffset()},getCanvasSize:function(){return this.imageEditorCanvasCon.getCanvasSize()},getBoundingClientRect:function(){return this.imageEditorCanvasCon.canvas.getBoundingClientRect()},getContainerSize:function(){return this.imageEditorCanvasCon.getContainerSize()},init:function(t,e,i){if(this.status)return;this.status=1;this.cropMode=!1;this.dimMode=!1;this.onImageEditComplete=i;if(!this.imageEditorCanvasCon){this.editorContainer=t;this.imageEditorCanvasCon=bm.imageEditorCanvasCon;this.originImage=e['length']?e[0]:e;this.originImage.src=this.originImage.src.replace('/__thumb__/','/');var o=this.getOriginImageSrc(this.originImage.src);this.imageEditorCanvasCon.init('#canvas',o,this.editorContainer,'#canvas_to_img');var r=this;this.imageEditorCanvasCon.onApplyFilter=function(){r.resetFilterBtn()};this.createBtn()}
else{this.originImage=e['length']?e[0]:e;this.originImage.src=this.originImage.src.replace('/__thumb__/','/');var o=this.getOriginImageSrc(this.originImage.src);this.imageEditorCanvasCon.init('#canvas',o,this.editorContainer,'#canvas_to_img');var n,a,s=this.btnList.length;for(n=0;n<s;n++){a=this.btnList[n];a.reset()}};this.reset(!0);this.registEvent()},getOriginImageSrc:function(t){var e=t;if(e.indexOf('/__thumb__/')>-1)e=e.replace('/__thumb__/','/');if(e.indexOf('?ver=')>-1){e=e.replace(e.slice(e.indexOf('?ver='),e.length),'')}
else if(e.indexOf('image.weven.kr')>-1){e=e.replace('//image.weven.kr','//cdn.zgai.ai')}
else if(e.indexOf('image-studio.weven.kr')>-1){e=e.replace('//image-studio.weven.kr','//cdn.zgai.ai')}
else if(e.indexOf('image.zgai.ai')>-1){e=e.replace('//image.zgai.ai','//cdn.zgai.ai')}
else if(e.indexOf('image-studio.zgai.ai')>-1){e=e.replace('//image-studio.zgai.ai','//cdn.zgai.ai')}
else if(e.indexOf('image.zaemit.com')>-1){e=e.replace('//image.zaemit.com','//cdn.zaemit.com')}
else if(e.indexOf('image-studio.zaemit.kr')>-1){e=e.replace('//image-studio.zaemit.kr','//cdn.zaemit.kr')};return e},createBtn:function(){var t=new imageEditorBtnSize(imageEditorBtnType.IMAGE_EDITOR_BUTTON_SIZE);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnRotate(imageEditorBtnType.IMAGE_EDITOR_BUTTON_ROTATE);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnFlip(imageEditorBtnType.IMAGE_EDITOR_BUTTON_FLIP);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnCrop(imageEditorBtnType.IMAGE_EDITOR_BUTTON_CROP);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnZoom(imageEditorBtnType.IMAGE_EDITOR_BUTTON_ZOOM);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnBrightness(imageEditorBtnType.IMAGE_EDITOR_BUTTON_BRIGHTNESS);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnContrast(imageEditorBtnType.IMAGE_EDITOR_BUTTON_CONTRAST);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnColor(imageEditorBtnType.IMAGE_EDITOR_BUTTON_COLOR);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnBlur(imageEditorBtnType.IMAGE_EDITOR_BUTTON_BLUR);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnSharpen(imageEditorBtnType.IMAGE_EDITOR_BUTTON_SHARPEN);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init();t=new imageEditorBtnDim(imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM);this.btnList[t.type]=t;this.btnList.push(t);this.btnList[t.type].init()},registEvent:function(){var t=this;this.imageEditorCanvasCon.onZoom=function(e){t.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_ZOOM].setZoom(e)};this.imageEditorCanvasCon.onChange=function(e,i){if(e=='rotate'){var n=t.imageEditorCanvasCon.getSize();t.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_SIZE].setValue(n.width,n.height)}
else if(e=='resize'){var n=t.imageEditorCanvasCon.getSize();t.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_SIZE].setValue(n.width,n.height)}
else if(e=='flip'){}
else if(e=='crop'){var n=t.imageEditorCanvasCon.getSize();t.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_SIZE].setValue(n.width,n.height)}
else if(e=='draw'){}};this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_CROP].onStatusChange=function(e){t.cropMode=e};this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM].onStatusChange=function(e){t.dimMode=e};var e,i,n=this.btnList.length;for(e=0;e<n;e++){i=this.btnList[e];i.registEvent()};this.imageEditorCanvasCon.registEvent();$('#imageEditorCancelBtn').on('click',function(){t.cancel()});$('#imageEditorApplyBtn').on('click',function(){t.apply()});$('#imageEditorResetBtn').on('click',function(e){t.reset()});this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_ZOOM].onZoomIncrease=function(){if(t.cropMode||t.dimMode)return;return t.imageEditorCanvasCon.zoomIncrease()};this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_ZOOM].onZoomDecrease=function(){if(t.cropMode||t.dimMode)return;return t.imageEditorCanvasCon.zoomDecrease()};$(this.editorContainer).on('mousewheel',function(e){if(e.ctrlKey){e.preventDefault();e.stopImmediatePropagation();if(t.cropMode||t.dimMode)return;var i=e.originalEvent,n=0;if(i.detail){n=i.detail*-40}
else{n=i.wheelDelta};if(n>0){t.imageEditorCanvasCon.zoomIncrease()}
else{t.imageEditorCanvasCon.zoomDecrease()}}})},checkCropMode:function(){return this.cropMode},checkDimMode:function(){return this.dimMode},cancel:function(){if(confirm('이미지 편집을 취소합니다. 계속 하시겠습니까?')==!1){return};this.closeImageEditor()},apply:function(){if(confirm('편집된 이미지를 저장하시겠습니까?')==!1){return};if(this.onImageEditComplete)this.onImageEditComplete(this.imageEditorCanvasCon.getImageData());this.closeImageEditor()},reset:function(t){if(!t&&confirm('편집된 이미지를 초기화 합니다. 계속하시겠습니까?')==!1){return};var e=this,i=this.getOriginImageSrc(this.originImage.src);this.imageEditorCanvasCon.resetImage(i,function(){var n=e.imageEditorCanvasCon.getFitZoomValue();if(n!=e.imageEditorCanvasCon.zoomValue){e.imageEditorCanvasCon.setZoom(n)};var t,i,o=e.btnList.length;for(t=0;t<o;t++){i=e.btnList[t];i.reset()}})},resetFilterBtn:function(){this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_BRIGHTNESS].reset();this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_CONTRAST].reset();this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_BLUR].reset();this.btnList[imageEditorBtnType.IMAGE_EDITOR_BUTTON_SHARPEN].reset()},closeImageEditor:function(){if(this.status==0)return;this.status=0;this.imgWidth=0;this.imgHeight=0;this.naturalWidth=0;this.naturalHeight=0;this.removeEvent();bm.popupManager.removePop(this.editorContainer)},removeEvent:function(){$('#imageEditorCancelBtn').off('click');$('#imageEditorApplyBtn').off('click');$('#imageEditorResetBtn').off('click');var t,e,i=this.btnList.length;for(t=0;t<i;t++){e=this.btnList[t];e.removeEvent()};this.imageEditorCanvasCon.removeEvent()},destroy:function(){}};var imageEditorBtnType={};imageEditorBtnType.IMAGE_EDITOR_BUTTON_SIZE='IMAGE_EDITOR_BUTTON_SIZE';imageEditorBtnType.IMAGE_EDITOR_BUTTON_ROTATE='IMAGE_EDITOR_BUTTON_ROTATE';imageEditorBtnType.IMAGE_EDITOR_BUTTON_FLIP='IMAGE_EDITOR_BUTTON_FLIP';imageEditorBtnType.IMAGE_EDITOR_BUTTON_BRIGHTNESS='IMAGE_EDITOR_BUTTON_BRIGHTNESS';imageEditorBtnType.IMAGE_EDITOR_BUTTON_ZOOM='IMAGE_EDITOR_BUTTON_ZOOM';imageEditorBtnType.IMAGE_EDITOR_BUTTON_CROP='IMAGE_EDITOR_BUTTON_CROP';imageEditorBtnType.IMAGE_EDITOR_BUTTON_BLUR='IMAGE_EDITOR_BUTTON_BLUR';imageEditorBtnType.IMAGE_EDITOR_BUTTON_CONTRAST='IMAGE_EDITOR_BUTTON_CONTRAST';imageEditorBtnType.IMAGE_EDITOR_BUTTON_COLOR='IMAGE_EDITOR_BUTTON_COLOR';imageEditorBtnType.IMAGE_EDITOR_BUTTON_SHARPEN='IMAGE_EDITOR_BUTTON_SHARPEN';imageEditorBtnType.IMAGE_EDITOR_BUTTON_DIM='IMAGE_EDITOR_BUTTON_DIM';imageEditorBtnType.IMAGE_EDITOR_BUTTON_APPLY='IMAGE_EDITOR_BUTTON_APPLY';imageEditorBtnType.IMAGE_EDITOR_BUTTON_RESET='IMAGE_EDITOR_BUTTON_RESET';var imageEditorBtnBase=function(t,e){this.id=t;this.type=e;this.value;this.element;this.onChange=null;this.reset=function(){}};imageEditorBtnBase.prototype={init:function(){this.element=document.querySelector(this.id)},registEvent:function(){var t=this},removeEvent:function(){},destroy:function(){}};var imageEditorBtnSize=function(t){this.type=t;this.isSync=!0;this.widthField;this.heightField;this.wApplyBtn;this.hApplyBtn;this.onChange=null};bm.extend(imageEditorBtnBase,imageEditorBtnSize);imageEditorBtnSize.prototype={init:function(){this.widthField=document.querySelector('#imageEditorWidthField');this.heightField=document.querySelector('#imageEditorHeightField');this.wApplyBtn=document.querySelector('#imageEditorWidthApplyBtn');this.hApplyBtn=document.querySelector('#imageEditorHeightApplyBtn');this.syncBtn=document.querySelector('#imageEditorSyncBtn');var t=bm.imageEditor.imageEditorCanvasCon.getSize();this.setValue(t.width,t.height);this.sizeSyncLock(this.isSync)},reset:function(){var t=bm.imageEditor.imageEditorCanvasCon.getSize();this.setValue(t.width,t.height)},sizeSyncLock:function(t){this.isSync=t;if(this.isSync){$(this.syncBtn).css('opacity',1)}
else{$(this.syncBtn).css('opacity',0.2)};$(this.heightField).attr('disabled',t)},resetSyncSize:function(){var e=this.widthField.value,t,i=bm.imageEditor.getSize();if(this.isSync){t=e*(i.height/i.width)}
else{t=this.heightField.value};this.setValue(e,Math.round(t))},setValue:function(t,e){this.widthField.value=t;this.heightField.value=e},getValue:function(t,e){return{width:this.widthField.value,height:this.heightField.value}},applySize:function(){bm.imageEditor.setSizeImg(this.widthField.value,this.heightField.value)},checkNumber:function(t,e){if(t.keyCode!=8&&t.keyCode!=13&&(t.keyCode<96||t.keyCode>105)){alert('숫자만 입력해주세요');$(e=='widthInput'?this.widthInput:this.heightInput).keypress(function(e){e.preventDefault();if(t.keyCode>=96||t.keyCode<=105){$(this).off('keypress')}})}
else if(t.keyCode==13){if(this.isSync)this.resetSyncSize()}},registEvent:function(){var t=this;$(this.heightField).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1}});$(this.widthField).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1}});$(this.heightField).on('keydown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1}});$(this.widthField).on('keydown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1}});$(this.heightField).on('keyup',function(e){this.value=this.value.replace(bm.valid.onlyNumRegex,'');if(e.keyCode==13){if(t.isSync)t.resetSyncSize();t.applySize()}});$(this.widthField).on('keyup',function(e){this.value=this.value.replace(bm.valid.onlyNumRegex,'');if(e.keyCode==13){if(t.isSync)t.resetSyncSize();t.applySize()}});$(this.widthField).on('click',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1};$(this).select()});$(this.heightField).on('click',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1};$(this).select()});$(this.wApplyBtn).on('click',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};if(t.isSync)t.resetSyncSize();t.applySize();if(t.onChange)t.onChange(e)});$(this.hApplyBtn).on('click',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.applySize();if(t.onChange)t.onChange(e)});$(this.syncBtn).on('click',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.sizeSyncLock(!t.isSync)})},removeEvent:function(){$(this.widthField).off('click');$(this.heightField).off('click');$(this.heightField).off('mousedown');$(this.widthField).off('mousedown');$(this.wApplyBtn).off('click');$(this.hApplyBtn).off('click');$(this.syncBtn).off('click');$(this.widthField).off('keyup');$(this.heightField).off('keyup');$(this.widthField).off('keydown');$(this.heightField).off('keydown')},destroy:function(){}};var imageEditorBtnRotate=function(t){this.type=t;this.leftBtn;this.rightBtn};$.extend(imageEditorBtnRotate,imageEditorBtnBase);imageEditorBtnRotate.prototype={init:function(){this.leftBtn=document.querySelector('#imageEditorRotateLeftBtn');this.rightBtn=document.querySelector('#imageEditorRotateRightBtn')},reset:function(){},registEvent:function(){var t=this;$(this.leftBtn).on('click',function(){bm.imageEditor.rotateImage('left')});$(this.rightBtn).on('click',function(){bm.imageEditor.rotateImage('right')})},removeEvent:function(){$(this.leftBtn).off('click');$(this.rightBtn).off('click')},destroy:function(){}};var imageEditorBtnFlip=function(t){this.type=t;this.horizontalBtn;this.verticalBtn};$.extend(imageEditorBtnFlip,imageEditorBtnBase);imageEditorBtnFlip.prototype={init:function(){this.horizontalBtn=document.querySelector('#imageEditorHorizontalBtn');this.verticalBtn=document.querySelector('#imageEditorVerticalBtn')},reset:function(){},registEvent:function(){var t=this;$(this.horizontalBtn).on('click',function(){bm.imageEditor.flipImage('horizontal')});$(this.verticalBtn).on('click',function(){bm.imageEditor.flipImage('vertical')})},removeEvent:function(){$(this.horizontalBtn).off('click');$(this.verticalBtn).off('click')},destroy:function(){}};var imageEditorBtnCrop=function(t){this.type=t;this.status=0;this.prevX=0;this.prevY=0;this.layerMinimumSize=10;this.targetBounding=null;this.cropBtn;this.cropConfirmBtn;this.editorBoxWrap;this.editorBox;this.cropLayer;this.resizerBtnTopRight;this.resizerBtnTopLeft;this.resizerBtnBottomRight;this.resizerBtnBottomLeft;this.gapTop;this.gapLeft;this.onStatusChange=null};$.extend(imageEditorBtnCrop,imageEditorBtnBase);imageEditorBtnCrop.prototype={init:function(){this.cropBtn=$('#imageEditorShowCropBoxBtn');this.cropConfirmBtn=$('#imageEditorCropConfirmBtn');this.editorBoxWrap=$('#imageEditorPopup')[0];this.editorBox=$('.image_editor_box')[0];this.cropLayer=$('#imageEditorCropLayer')[0];this.resizerBtnTopRight=$(this.cropLayer).find('.resizer.top-right');this.resizerBtnTopLeft=$(this.cropLayer).find('.resizer.top-left');this.resizerBtnBottomRight=$(this.cropLayer).find('.resizer.bottom-right');this.resizerBtnBottomLeft=$(this.cropLayer).find('.resizer.bottom-left');this.gapLeft=parseInt($(this.resizerBtnTopLeft).css('left'));this.gapTop=parseInt($(this.resizerBtnTopLeft).css('top'))},reset:function(){this.status=0;if(this.onStatusChange)this.onStatusChange(this.status);this.deactiveCropMode()},registEvent:function(){var t=this;$(this.cropBtn).on('click',function(e){if(bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.status=!t.status;if(t.status){if(bm.imageEditorCanvasCon.currentFilteredImgData){bm.imageEditorCanvasCon.applyFilteredImageToOrigin(function(){t.activeCropMode()});return};t.activeCropMode()}
else{t.deactiveCropMode()};if(t.onStatusChange)t.onStatusChange(t.status)})},activeCropMode:function(){var t=this,e=bm.imageEditor.getFitZoomValue();if(e!=bm.imageEditor.getZoomValue()){bm.imageEditor.setZoom(e,function(){t.showCropLayer();t.showCropConfirmBtn();t.registEventForCrop()})}
else{t.showCropLayer();t.showCropConfirmBtn();t.registEventForCrop()}},deactiveCropMode:function(){this.hideCropLayer();this.hideCropConfirmBtn();this.removeEventForCrop()},removeEvent:function(){$(this.cropBtn).off('click')},registEventForCrop:function(){var t=this;mouseAdapter(this.cropLayer).onDrag(I,O,M,!0,this.editorBoxWrap);$(this.cropLayer).find('.resizer').each(function(){mouseAdapter(this).onDrag(R,A,D,!0,t.editorBoxWrap)});var C,S,g,o,a,s,r,e,i,m,v,L=bm.getStyle(this.editorBox,'position'),c,f,x,B,l,d;c=t.targetBounding.left;f=t.targetBounding.top;x=c+t.targetBounding.width;B=f+t.targetBounding.height;var b,y,E,k,h,p,u,w,T,n=this.layerMinimumSize;function I(e){e.stopImmediatePropagation();E=e.clientX-b;k=e.clientY-y;w=$(h).width();T=$(h).height();p=h.offsetLeft+E;if(t.targetBounding.width-w<p-t.targetBounding.left)p=t.targetBounding.left+(t.targetBounding.width-w);if(p-t.targetBounding.left<0)p=t.targetBounding.left;u=h.offsetTop+k;if(t.targetBounding.height-T<u-t.targetBounding.top)u=t.targetBounding.top+(t.targetBounding.height-T);if(u-t.targetBounding.top<0)u=t.targetBounding.top;h.style.left=p+'px';h.style.top=u+'px';b=e.clientX;y=e.clientY};function O(t){t.stopImmediatePropagation()};function M(t){t.stopImmediatePropagation();h=t.target;b=t.clientX;y=t.clientY;if(L!='absolute'){h.style.position='absolute'}};function R(h){h.stopImmediatePropagation();o=h.clientX-C;a=h.clientY-S;s=parseInt(t.cropLayer.offsetLeft);r=parseInt(t.cropLayer.offsetTop);e=parseInt(t.cropLayer.offsetWidth);i=parseInt(t.cropLayer.offsetHeight);m=s+e;v=r+i;if($(g).hasClass('top-left')){l=m-c;d=v-f;if(e-o<=n){s=m-n}
else{if(s+o<c)s=c;else s=s+o};if(i-a<=n){r=v-n}
else{if(r+a<f)r=f;else r=r+a};if(e-o>=l){e=l}
else{if(e-o<n)e=n;else e=e-o};if(i-a>=d){i=d}
else{if(i-a<n)i=n;else i=i-a}}
else if($(g).hasClass('top-right')){l=x-s;d=v-f;if(e+o>=l){e=l}
else{if(e+o<n)e=n;else e=e+o};if(i-a<=n){r=v-n}
else{if(r+a<f)r=f;else r=r+a};if(i-a>=d){i=d}
else{if(i-a<n)i=n;else i=i-a}}
else if($(g).hasClass('bottom-left')){l=m-c;d=B-r;if(e-o<=n){s=m-n}
else{if(s+o<c)s=c;else s=s+o};if(e-o>=l){e=l}
else{if(e-o<n)e=n;else e=e-o};if(i+a>=d){i=d}
else{if(i+a<n)i=n;else i=i+a}}
else if($(g).hasClass('bottom-right')){l=x-s;d=B-r;if(e+o>=l){e=l}
else{if(e+o<n)e=n;else e=e+o};if(i+a>=d){i=d}
else{if(i+a<n)i=n;else i=i+a}};$(t.cropLayer).css({left:s,top:r,width:e,height:i});C=h.clientX;S=h.clientY};function A(t){t.stopImmediatePropagation()};function D(t){t.stopImmediatePropagation();t.preventDefault();g=t.currentTarget;C=t.clientX;S=t.clientY};$(this.cropConfirmBtn).on('click',function(){var e={};e.left=t.cropLayer.offsetLeft-t.targetBounding.left;e.top=t.cropLayer.offsetTop-t.targetBounding.top;e.width=t.cropLayer.offsetWidth;e.height=t.cropLayer.offsetHeight;bm.imageEditor.cropImage(e);t.reset();if(t.onStatusChange)t.onStatusChange(t.status)});$(window).on('keydown',t.onEnterKeyEvent.bind(this))},removeEventForCrop:function(){mouseAdapter(this.cropLayer).offDrag();$(this.cropLayer).find('.resizer').each(function(){mouseAdapter(this).offDrag()});$(this.cropConfirmBtn).off();$(window).off('keydown',this.onEnterKeyEvent)},onEnterKeyEvent:function(t){if(!this.status||t.which!==13)return;$(this.cropConfirmBtn).trigger('click')},showCropConfirmBtn:function(){$(this.cropConfirmBtn).show()},hideCropConfirmBtn:function(){$(this.cropConfirmBtn).hide()},showCropLayer:function(){var o=bm.imageEditor.getCanvasSize(),a=bm.imageEditor.getContainerSize(),s=bm.imageEditor.getZoomValue(),i,n,t,e;t=o.width*s;e=o.height*s;i=a.width-t>>1;n=a.height-e>>1;this.targetBounding={width:t,height:e,left:i,top:n};$(this.cropLayer).css({'width':t+'px','height':e+'px','left':i,'top':n,});$(this.cropLayer).show()},hideCropLayer:function(){$(this.cropLayer).hide()},destroy:function(){this.removeEvent()}};var imageEditorBtnBrightness=function(t){this.type=t;this.brightnessValue=0;this.brightnessRange};$.extend(imageEditorBtnBrightness,imageEditorBtnBase);imageEditorBtnBrightness.prototype={init:function(){this.brightnessRange=$('#imageEditorBrightnessRange')},reset:function(){this.brightnessRange.val(this.brightnessRange[0].defaultValue)},registEvent:function(){var t=this;$(this.brightnessRange).on('input',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.brightnessValue=this.value;bm.imageEditor.filterControl('brightness',t.brightnessValue)});$(this.brightnessRange).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation()}})},setValue:function(t){t=Math.min(t,100);t=Math.max(t,-100);this.brightnessValue=t;$(this.brightnessRange).val(this.brightnessValue)},getValue:function(){return this.brightnessValue},removeEvent:function(){$(this.brightnessRange).off('input');$(this.brightnessRange).off('mousedown')},destroy:function(){}};var imageEditorBtnContrast=function(t){this.type=t;this.contrastValue=0;this.contrastRange};$.extend(imageEditorBtnContrast,imageEditorBtnBase);imageEditorBtnContrast.prototype={init:function(){this.contrastRange=$('#imageEditorContrastRange')},reset:function(){this.contrastRange.val(this.contrastRange[0].defaultValue)},registEvent:function(){var t=this;$(this.contrastRange).on('input',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.contrastValue=this.value;bm.imageEditor.filterControl('contrast',t.contrastValue)});$(this.contrastRange).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation()}})},setValue:function(t){t=Math.min(t,100);t=Math.max(t,-100);this.contrastValue=t;$(this.contrastRange).val(this.contrastValue)},getValue:function(){return this.contrastValue},removeEvent:function(){$(this.contrastRange).off('input');$(this.contrastRange).off('mousedown')},destroy:function(){}};var imageEditorBtnColor=function(t){this.type=t;this.colorH=0;this.colorRangeH};$.extend(imageEditorBtnColor,imageEditorBtnBase);imageEditorBtnColor.prototype={init:function(){this.colorRangeH=$('#imageEditorColorH')},reset:function(){this.colorRangeH.val(this.colorRangeH[0].defaultValue)},registEvent:function(){var t=this;$(this.colorRangeH).on('input mouseup',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.colorH=this.value;bm.imageEditor.filterControl('color',t.colorH)});$(this.colorRangeH).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation()}})},setValue:function(t){console.log('set');t=Math.min(t,100);t=Math.max(t,-100);this.contrastValue=t;$(this.contrastRange).val(this.contrastValue)},getValue:function(){console.log('get');return this.contrastValue},removeEvent:function(){$(this.colorRangeH).off('input');$(this.colorRangeH).off('mouseup');$(this.colorRangeH).off('mousedown')},destroy:function(){}};var imageEditorBtnBlur=function(t){this.type=t;this.blurValue=1;this.blurRange};$.extend(imageEditorBtnBlur,imageEditorBtnBase);imageEditorBtnBlur.prototype={init:function(){this.blurRange=$('#imageEditorBlurRange')},reset:function(){this.blurRange.val(this.blurRange[0].defaultValue)},registEvent:function(){var t=this;$(this.blurRange).on('input',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.blurValue=this.value;bm.imageEditor.filterControl('blur',t.blurValue)});$(this.blurRange).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation()}})},setValue:function(t){t=Math.min(t,50);t=Math.max(t,0);this.blurValue=t;$(this.blurRange).val(this.blurValue)},getValue:function(){return this.blurValue},removeEvent:function(){$(this.blurRange).off('input');$(this.blurRange).off('mousedown')},destroy:function(){}};var imageEditorBtnSharpen=function(t){this.type=t;this.sharpenValue=0;this.sharpenMaxValue=2;this.sharpenRange};$.extend(imageEditorBtnSharpen,imageEditorBtnBase);imageEditorBtnSharpen.prototype={init:function(){this.sharpenRange=$('#imageEditorSharpenRange')},reset:function(){this.sharpenRange.val(this.sharpenRange[0].defaultValue)},registEvent:function(){var t=this;$(this.sharpenRange).on('input',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return!1};t.sharpenValue=this.value;bm.imageEditor.filterControl('sharpen',t.sharpenValue)});$(this.sharpenRange).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){t.preventDefault();t.stopPropagation();return!1}})},setValue:function(t){t=Math.min(t,this.sharpenMaxValue);t=Math.max(t,0);this.sharpenValue=t;$(this.sharpenRange).val(this.sharpenValue)},getValue:function(){return this.sharpenValue},removeEvent:function(){$(this.sharpenRange).off('input');$(this.sharpenRange).off('mousedown')},destroy:function(){}};var imageEditorBtnZoom=function(t){this.type=t;this.zoomInBtn;this.zoomOutBtn;this.zoomValue=1;this.onZoomIncrease=null;this.onZoomDecrease=null};$.extend(imageEditorBtnZoom,imageEditorBtnBase);imageEditorBtnZoom.prototype={init:function(){this.zoomValue=1;this.zoomInBtn=document.querySelector('#zoomInBtn');this.zoomOutBtn=document.querySelector('#zoomOutBtn')},reset:function(){$('#imageEditorZoomText').text(parseInt(this.zoomValue*100)+'%')},registEvent:function(){var t=this;$(this.zoomInBtn).on('click',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return};if(t.onZoomIncrease){t.zoomValue=t.onZoomIncrease()}});$(this.zoomOutBtn).on('click',function(e){if(bm.imageEditor.checkCropMode()||bm.imageEditor.checkDimMode()){e.preventDefault();e.stopPropagation();return};if(t.onZoomDecrease){t.zoomValue=t.onZoomDecrease()}})},setZoom:function(t){this.zoomValue=t;this.setZoomText()},setZoomText:function(){$('#imageEditorZoomText').text(parseInt((this.zoomValue*100).toFixed())+'%')},removeEvent:function(){$(this.zoomInBtn).off('click');$(this.zoomOutBtn).off('click')},destroy:function(){}};var imageEditorBtnDim=function(t){this.type=t;this.status=0;this.dimOpacityValue=0.5;this.addDimBtn;this.dimConfirmBtn;this.dimOpacityCon;this.dimOpacityRange;this.dimOpacityOutput;this.onStatusChange=null};$.extend(imageEditorBtnDim,imageEditorBtnBase);imageEditorBtnDim.prototype={init:function(){this.addDimBtn=$('#imageEditorAddDimBtn');this.dimConfirmBtn=$('#imageEditorConfirmDimBtn');this.dimOpacityCon=$('#imageEditorDimOpCon');this.dimOpacityRange=$('#imageEditorDimOpacity');this.dimOpacityOutput=$('#dimOpacityOutput')},reset:function(){this.status=0;if(this.onStatusChange)this.onStatusChange(this.status);this.setValue(this.dimOpacityRange[0].defaultValue);this.addDimBtn.show();this.dimConfirmBtn.closest('#imageEditorConfirmDimBtnCon').hide();this.dimOpacityCon.hide();this.removeDimLayer()},registEvent:function(){var t=this;$(t.addDimBtn).on('click',function(e){if(bm.imageEditor.checkCropMode()){e.preventDefault();e.stopPropagation();return!1};t.status=!t.status;if(t.status){if(bm.imageEditorCanvasCon.currentFilteredImgData){bm.imageEditorCanvasCon.applyFilteredImageToOrigin(function(){t.activeDimMode()});return};t.activeDimMode()};if(t.onStatusChange)t.onStatusChange(t.status)});$(t.dimConfirmBtn).on('click',function(e){bm.imageEditor.setDimLayer();t.status=!t.status;if(!t.status){t.deactiveDimMode()}});$(t.dimOpacityRange).on('input',function(e){if(bm.imageEditor.checkCropMode()){e.preventDefault();e.stopPropagation();return!1};t.setDimOpacity(this.value)});$(t.dimOpacityRange).on('mousedown',function(t){if(bm.imageEditor.checkCropMode()){t.preventDefault();t.stopPropagation()}});$(window).on('keydown',t.onEnterKeyEvent.bind(this))},activeDimMode:function(){var t=this,e=t.getValue(),i=bm.imageEditor.getFitZoomValue();if(i!=bm.imageEditor.getZoomValue()){bm.imageEditor.setZoom(i,function(){t.addDimLayer(e);t.addDimBtn.hide();t.dimConfirmBtn.closest('#imageEditorConfirmDimBtnCon').show();t.dimOpacityCon.show()})}
else{t.addDimLayer(e);t.addDimBtn.hide();t.dimConfirmBtn.closest('#imageEditorConfirmDimBtnCon').show();t.dimOpacityCon.show()}},deactiveDimMode:function(){$(window).off('keydown',this.onEnterKeyEvent);this.removeDimLayer();this.reset()},onEnterKeyEvent:function(t){if(!this.status||t.which!==13)return;$(this.dimConfirmBtn).trigger('click')},removeDimLayer:function(){$(this.dimLayer).remove()},setDimOpacity:function(t){if(!this.status||!t)return;this.setValue(t);$(this.dimLayer).css({'background-color':'rgba(0,0,0,'+this.getValue()+')'})},addDimLayer:function(t){var n=bm.imageEditor.getCanvasSize(),o=bm.imageEditor.getContainerSize(),a=bm.imageEditor.getZoomValue(),s,r,e,i;e=n.width*a;i=n.height*a;s=o.width-e>>1;r=o.height-i>>1;this.dimLayer=document.createElement('div');$(this.dimLayer).css({'position':'absolute','width':e+'px','height':i+'px','left':s,'top':r,'background-color':'rgba(0,0,0,'+t+')'});bm.imageEditor.imageEditorCanvasCon.container.find('#img_con').append(this.dimLayer)},setValue:function(t){t=Math.min(t,100);t=Math.max(t,0);$(this.dimOpacityRange).val(t);this.dimOpacityValue=t/100;this.dimOpacityOutput.text(t)},getValue:function(){return this.dimOpacityValue},removeEvent:function(){$(this.addDimBtn).off('click');$(this.dimConfirmBtn).off('click');$(this.dimOpacityRange).off('input');$(this.dimOpacityRange).off('mousedown')},destroy:function(){this.removeEvent()}};bm.dragMove={offsetX:0,offsetY:0,target:null,dragging:!1,onlyX:!1,onlyY:!1,limitX:null,limitY:null,cursorChange:!0,needToCallback:!0,settingReset:()=>{var _this=bm.dragMove;_this.offsetX=0;_this.offsetY=0;_this.target=null;_this.dragging=!1;_this.onlyX=!1;_this.onlyY=!1;_this.limitX=null;_this.limitY=null;_this.cursorChange=!0;_this.needToCallback=!0},onFreeMoveStart:(event)=>{var _this=bm.dragMove;if(!_this.target)return;_this.offsetX=event.clientX;_this.offsetY=event.clientY;if(_this.cursorChange){$(_this.target).css({cursor:'grabbing'})};$(_this.target).css({userSelect:'none'});_this.dragging=!0;event.preventDefault();if(wvAdminIFrameBridge&&_this.needToCallback){wvAdminIFrameBridge.onMoveStart();if(bm.toolManager.editorMode==='product'){};if(bm.animation&&bm.animation['mode']===!0){bm.animation.getCurrentStyle(_this.target)}}},onFreeMove:(event)=>{var _this=bm.dragMove;const dx=event.clientX-_this.offsetX;const dy=event.clientY-_this.offsetY;let left=_this.target.offsetLeft+dx;let top=_this.target.offsetTop+dy;if(_this.limitX!==null&&left<_this.limitX){left=_this.limitX};if(_this.limitY!==null&&top<_this.limitY){top=_this.limitY};$(_this.target).css({left:left+'px'});if(!_this.onlyX){$(_this.target).css({top:top+'px'})};_this.left=left;_this.top=top;_this.offsetX=event.clientX;_this.offsetY=event.clientY;if(wvAdminIFrameBridge&&_this.needToCallback){if(bm.toolManager.editorMode==='product'){wvAdminIFrameBridge._WVToolAddBlockBelow.setSyncPageHeight()}};return{left:left,top:top}},onFreeMoveEnd:()=>{var _this=bm.dragMove;if(_this.cursorChange){$(_this.target).css({cursor:'move'})};$(_this.target).css({userSelect:'auto'});_this.dragging=!1;if(wvAdminIFrameBridge&&_this.needToCallback){const verticalDistDiff=wvAdminIFrameBridge._WVToolCentralIndicator.verticalDistDiff;const horizontalDistDiff=wvAdminIFrameBridge._WVToolCentralIndicator.horizontalDistDiff;const maxCorrectionDist=wvAdminIFrameBridge._WVToolCentralIndicator.maxCorrectionDist;let corrected=!1;if(verticalDistDiff&&horizontalDistDiff){if(Math.abs(verticalDistDiff)<=maxCorrectionDist){_this.left-=verticalDistDiff;corrected=!0};if(Math.abs(horizontalDistDiff)<=maxCorrectionDist){_this.top-=horizontalDistDiff;corrected=!0};$(_this.target).css({left:_this.left+'px'});if(!_this.onlyX){$(_this.target).css({top:_this.top+'px'})};if(corrected===!0){bm.toast('지시선에 의해 위치가 보정되었습니다.')}};wvAdminIFrameBridge.onMoveEnd();wvAdminIFrameBridge.toolManager.toolStyleSetting();bm.toolManager.showExtraToolByTarget(_this.target);if(bm.animation&&bm.animation['mode']===!0){bm.animation.changeFrameList(wvAdminIFrameBridge._WVToolbarAnimation.getTargetInstanceId(_this.target),_this.target,bm.animation.EVENT_BLOCK_STYLE)}}}};bm.dragbox={status:!1,init:()=>{if($('#WEVEN_IFRAME').length>0){var _this=bm.dragbox;_this.status=!0;var iframeContents=$('#WEVEN_IFRAME').contents(),iframeContentsLayoutCon=iframeContents.find('[data-wv-layout=layout]');_this.targetPage=$(iframeContentsLayoutCon).find('[data-wv-layout-element-board-page]')[0];_this.dragBox=wvAdminIFrameBridge._WVContentArea.$contentBody.find('#layoutDragbox')[0];_this.dragBox.style.backgroundColor='red';_this.dragBox.style.position='fixed';_this.dragBox.style.zIndex='9999999999';_this.dragBox.style.opacity='0.3';_this.dragBoxStatus={isDragBoxDragging:!1,toLeft:!1,toUp:!1,overLappedBlockList:[]}}},onDragBoxDragging:(e)=>{var _this=bm.dragbox;e.preventDefault();e.stopImmediatePropagation();if(!_this.dragBoxStatus.isDragBoxDragging)return;let width=e.clientX-_this.dragBoxStatus.startX;let height=e.clientY-_this.dragBoxStatus.startY;if(width<=1){_this.dragBox.style.left=e.clientX+'px';_this.dragBox.style.width=(_this.dragBoxStatus.startX-e.clientX)+'px';_this.dragBoxStatus.toLeft=!0}
else{_this.dragBox.style.width=width+'px';_this.dragBoxStatus.toLeft=!1};if(height<=1){_this.dragBox.style.top=e.clientY+'px';_this.dragBox.style.height=(_this.dragBoxStatus.startY-e.clientY)+'px';_this.dragBoxStatus.toUp=!0}
else{_this.dragBox.style.height=height+'px';_this.dragBoxStatus.toUp=!1}},onDragBoxEnd:(e)=>{var _this=bm.dragbox;e.preventDefault();e.stopImmediatePropagation();if($(e.target).closest('.layoutControlBtn').length>0||$(e.target).closest('.layoutOptBtn').length>0||$(e.target).closest('[data-wv-design-area]').length>0){mouseAdapter(wvAdminIFrameBridge._WVContentArea.$contentBody).draggingStop()};_this.dragBoxStatus.isDragBoxDragging=!1;let overLappedBlockList=_this.getDraggedBlock(_this.dragBox);const multiAttachByDrag=(overLappedBlockList)=>{if(wvAdminIFrameBridge&&wvAdminIFrameBridge._WVLayoutKit){wvAdminIFrameBridge._WVLayoutKit.reset();if(overLappedBlockList.length>1){wvAdminIFrameBridge._WVLayoutKit.attachMultiAtOnce(overLappedBlockList)}
else if(overLappedBlockList.length===1){wvAdminIFrameBridge._WVLayoutKit.attach(overLappedBlockList)}
else{}}};multiAttachByDrag(overLappedBlockList);_this.dragBox.style.width='0px';_this.dragBox.style.height='0px';_this.dragBoxStatus={isDragBoxDragging:!1,toLeft:!1,toUp:!1,overLappedBlockList:[]};_this.dragBox.style.border='';_this.dragBox.style.cursor='';_this.targetPage.style.cursor=''},onDragBoxStart:(e)=>{var _this=bm.dragbox;e.preventDefault();e.stopImmediatePropagation();if($(e.target).closest('.editor_dropdown').length>0||$(e.target).closest('.layoutControlBtn').length>0||$(e.target).closest('.layoutOptBtn').length>0||$(e.target).closest('[data-wv-design-area]').length>0){mouseAdapter(wvAdminIFrameBridge._WVContentArea.$contentBody).draggingStop();return};_this.dragBox.style.border='3px solid blue';_this.dragBox.style.cursor='crosshair';_this.targetPage.style.cursor='crosshair';_this.dragBox.style.width='0px';_this.dragBox.style.height='0px';_this.dragBox.style.left=e.clientX+'px';_this.dragBox.style.top=e.clientY+'px';_this.dragBoxStatus.startX=e.clientX;_this.dragBoxStatus.startY=e.clientY;_this.dragBoxStatus.isDragBoxDragging=!0},getDraggedBlock:(dragbox,blockList)=>{var _this=bm.dragbox;blockList?blockList=blockList:blockList=wvAdminIFrameBridge._WVContentArea.$contentBody.find('[data-wv-design-area]').not('.guide_inner');const getStyleTransformedRect=(node)=>{const rotatePoint=(x,y,centerX,centerY,angle)=>{const cosAngle=Math.cos(angle);const sinAngle=Math.sin(angle);const translatedX=x-centerX;const translatedY=y-centerY;const rotatedX=translatedX*cosAngle-translatedY*sinAngle;const rotatedY=translatedX*sinAngle+translatedY*cosAngle;return{x:rotatedX+centerX,y:rotatedY+centerY}};const rect=node.getBoundingClientRect();const style=window.getComputedStyle(node);const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;let rotation;if(style.rotate==='none'){rotation=0}
else{rotation=parseFloat(style.rotate.replace('rotate(','').replace('deg)',''))*(Math.PI/180.0)};const rotatedTopLeft=rotatePoint(rect.left,rect.top,centerX,centerY,rotation);const rotatedTopRight=rotatePoint(rect.right,rect.top,centerX,centerY,rotation);const rotatedBottomLeft=rotatePoint(rect.left,rect.bottom,centerX,centerY,rotation);const rotatedBottomRight=rotatePoint(rect.right,rect.bottom,centerX,centerY,rotation);const minX=Math.min(rotatedTopLeft.x,rotatedTopRight.x,rotatedBottomLeft.x,rotatedBottomRight.x);const minY=Math.min(rotatedTopLeft.y,rotatedTopRight.y,rotatedBottomLeft.y,rotatedBottomRight.y);const maxX=Math.max(rotatedTopLeft.x,rotatedTopRight.x,rotatedBottomLeft.x,rotatedBottomRight.x);const maxY=Math.max(rotatedTopLeft.y,rotatedTopRight.y,rotatedBottomLeft.y,rotatedBottomRight.y);return{minX,minY,maxX,maxY}};_this.dragBoxStatus.overLappedBlockList=[];const dragArea=getStyleTransformedRect($(dragbox)[0]);for(let i=0;i<blockList.length;i++){const blockArea=getStyleTransformedRect(blockList[i]);const isOverLap=!(dragArea.maxX<blockArea.minX||dragArea.minX>blockArea.maxX||dragArea.maxY<blockArea.minY||dragArea.minY>blockArea.maxY);if(isOverLap){_this.dragBoxStatus.overLappedBlockList.push(blockList[i])}};const result=_this.dragBoxStatus.overLappedBlockList;return result}};bm.rotate={target:null,elementAngle:0,startAngle:0,center:{x:0,y:0},bridge:null,layoutkit:null,init:(target)=>{var _this=bm.rotate;if($('#WEVEN_IFRAME').length>0){if(wvAdminIFrameBridge&&wvAdminIFrameBridge._WVLayoutKit){bm.rotate['bridge']=wvAdminIFrameBridge;bm.rotate['layoutkit']=wvAdminIFrameBridge._WVLayoutKit}}
else{if(target){_this.target=$(target)[0]}
else{console.log('타겟이 없습니다.')}}},onRotateBtnDown:(e)=>{var _this=bm.rotate;if(_this.layoutkit){_this.target=_this.layoutkit['targetElement'];$(_this.layoutkit.elementRotateIndicator).show();$(_this.layoutkit.elementRotateIndicator).css({opacity:1});_this.layoutkit.deactiveKit(null,_this.layoutkit.elementRotateBtn,!0);bm.toolManager.hideExtraTool()};if(bm.animation&&bm.animation['mode']===!0){bm.animation.getCurrentStyle(_this.target)};if(_this.target&&_this.target.isConnected){bm.rotate['ElementAngle']=Number(_this.target.style.rotate.replace('deg',''));bm.rotate['startAngle']=bm.rotate.getAngle(e.clientX,e.clientY,_this.target);$(_this.targetElement).addClass('isRotated')}
else{bm.toast('선택된 블록이 없습니다.');return!1}},onRotateBtnMove:(e)=>{var _this=bm.rotate;if(_this.layoutkit){_this.target=_this.layoutkit['targetElement']};if(_this.target&&_this.target.isConnected){let currentAngle=bm.rotate.getAngle(e.clientX,e.clientY,_this.target);let rotationAngle=currentAngle-bm.rotate['startAngle']+bm.rotate['ElementAngle'];if(rotationAngle<0){rotationAngle+=360};if(rotationAngle>360){rotationAngle-=360};$(_this.target).css({rotate:rotationAngle+'deg'});if(_this.layoutkit){$(_this.layoutkit.wvSizeControlCon).css({rotate:rotationAngle+'deg'});$(_this.layoutkit.elementRotateIndicator).text(Number(rotationAngle).toFixed(1)+'º')}}},onRotateBtnUp:(e)=>{var _this=bm.rotate;if(_this.layoutkit){if(!_this.layoutkit['isTransitioning']){_this.layoutkit['isTransitioning']=!0;setTimeout(function(){$(_this.layoutkit.elementRotateIndicator).css({opacity:0});_this.layoutkit['isTransitioning']=!1},1000)};_this.layoutkit.activeKit();_this.layoutkit.kitRepositioning();bm.toolManager.showExtraToolByTarget(_this.target)};$(_this.target).removeClass('isRotated');if(wvAdminIFrameBridge){wvAdminIFrameBridge.toolManager.toolStyleSetting();if(bm.animation&&bm.animation['mode']===!0){bm.animation.changeFrameList(wvAdminIFrameBridge._WVToolbarAnimation.getTargetInstanceId(_this.target),_this.target,bm.animation.EVENT_BLOCK_STYLE)}}},getAngle:(x,y,target)=>{const R2D=180/Math.PI;const rect=target.getBoundingClientRect();const centerX=rect.left+rect.width/2;const centerY=rect.top+rect.height/2;let angle=Math.atan2(y-centerY,x-centerX)*R2D;if(angle<0){angle+=360};if(angle>360){angle-=360};return angle}};bm.resize={target:null,resizingInfo:[{currentStyle:null,currentClient:null,direction:'',rotate:0,isResizing:!1}],minWidth:40,minHeight:40,bridge:null,layoutkit:null,init:()=>{var _this=bm.rotate;if(_this.inited){return!0};if($('#WEVEN_IFRAME').length>0){if(wvAdminIFrameBridge&&wvAdminIFrameBridge._WVLayoutKit){bm.resize['bridge']=wvAdminIFrameBridge;bm.resize['layoutkit']=wvAdminIFrameBridge._WVLayoutKit;_this.inited=!0}}},setTarget:(target)=>{var _this=bm.resize;if(!target){bm.toast('타겟이 없습니다.');return!1}
else{if(Array.isArray(target)){_this['target']=target}
else{_this['target']=[target]};return!0}},resizeStart:(e)=>{var _this=bm.resize;e.preventDefault();e.stopImmediatePropagation();if(bm.animation&&bm.animation['mode']===!0){bm.animation.getCurrentStyle(_this.target)};let btn;let btnId;if(e.target){btn=$(e.target).closest('.layoutControlBtn');if(btn.length>0){btnId=$(btn).attr('id');if(btnId==='layoutSizeTopBtn')_this.resizingInfo[0]['direction']='top';else if(btnId==='layoutSizeRightBtn')_this.resizingInfo[0]['direction']='right';else if(btnId==='layoutSizeBottomBtn')_this.resizingInfo[0]['direction']='bottom';else if(btnId==='layoutSizeLeftBtn')_this.resizingInfo[0]['direction']='left';else if(btnId==='layoutSizeRightTopBtn')_this.resizingInfo[0]['direction']='rightTop';else if(btnId==='layoutSizeLeftTopBtn')_this.resizingInfo[0]['direction']='leftTop';else if(btnId==='layoutSizeRightBottomBtn')_this.resizingInfo[0]['direction']='rightBottom';else if(btnId==='layoutSizeLeftBottomBtn')_this.resizingInfo[0]['direction']='leftBottom'}};for(let i=0;i<_this['target'].length;i++){if(!_this.resizingInfo[i]){_this.resizingInfo[i]={..._this.resizingInfo[i-1]}};if(_this['target'][i].style.rotate!==''){let rotate=Number(_this['target'][i].style.rotate.replace('deg',''));rotate=(rotate<0?rotate+360:rotate);let ed=_this.resizingInfo[i]['direction'];if(rotate>=338||rotate<23){_this.resizingInfo[i]['rotate']=0}
else if(rotate>=23&&rotate<68){_this.resizingInfo[i]['rotate']=0}
else if(rotate>=68&&rotate<113){_this.resizingInfo[i]['rotate']=90;if(ed==='top')_this.resizingInfo[i]['direction']='right';else if(ed==='right')_this.resizingInfo[i]['direction']='bottom';else if(ed==='left')_this.resizingInfo[i]['direction']='top';else if(ed==='bottom')_this.resizingInfo[i]['direction']='left';else if(ed==='rightTop')_this.resizingInfo[i]['direction']='rightBottom';else if(ed==='leftTop')_this.resizingInfo[i]['direction']='rightTop';else if(ed==='rightBottom')_this.resizingInfo[i]['direction']='leftBottom';else if(ed==='leftBottom')_this.resizingInfo[i]['direction']='leftTop'}
else if(rotate>=113&&rotate<158){_this.resizingInfo[i]['rotate']=90}
else if(rotate>=158&&rotate<203){_this.resizingInfo[i]['rotate']=180;if(ed==='top')_this.resizingInfo[i]['direction']='bottom';else if(ed==='right')_this.resizingInfo[i]['direction']='left';else if(ed==='left')_this.resizingInfo[i]['direction']='right';else if(ed==='bottom')_this.resizingInfo[i]['direction']='top';else if(ed==='rightTop')_this.resizingInfo[i]['direction']='leftBottom';else if(ed==='leftTop')_this.resizingInfo[i]['direction']='rightBottom';else if(ed==='rightBottom')_this.resizingInfo[i]['direction']='leftTop';else if(ed==='leftBottom')_this.resizingInfo[i]['direction']='rightTop'}
else if(rotate>=203&&rotate<248){_this.resizingInfo[i]['rotate']=180}
else if(rotate>=248&&rotate<293){_this.resizingInfo[i]['rotate']=270;if(ed==='top')_this.resizingInfo[i]['direction']='left';else if(ed==='right')_this.resizingInfo[i]['direction']='top';else if(ed==='left')_this.resizingInfo[i]['direction']='bottom';else if(ed==='bottom')_this.resizingInfo[i]['direction']='right';else if(ed==='rightTop')_this.resizingInfo[i]['direction']='leftTop';else if(ed==='leftTop')_this.resizingInfo[i]['direction']='leftBottom';else if(ed==='rightBottom')_this.resizingInfo[i]['direction']='rightTop';else if(ed==='leftBottom')_this.resizingInfo[i]['direction']='rightBottom'}
else if(rotate>=293&&rotate<338){_this.resizingInfo[i]['rotate']=270}};_this.resizingInfo[i]['currentStyle']={width:Number(bm.getStyle(_this['target'][i],'width').replace('px','')),height:Number(bm.getStyle(_this['target'][i],'height').replace('px','')),left:Number(_this['target'][i].style.left.replace('px','')),top:Number(_this['target'][i].style.top.replace('px','')),right:Number(_this['target'][i].style.right.replace('px','')),bottom:Number(_this['target'][i].style.bottom.replace('px',''))};if(bm.toolManager.editorMode==='product'){_this.resizingInfo[i]['currentStyle']['left']=Number(_this['target'][i].style.marginLeft.replace('px',''));_this.resizingInfo[i]['currentStyle']['top']=Number(_this['target'][i].style.marginTop.replace('px',''))};_this.resizingInfo[i]['currentClient']={x:e.clientX,y:e.clientY};_this.resizingInfo[i]['isResizing']=!0};if(_this.layoutkit){_this.layoutkit.deactiveKit(null,_this.layoutkit.wvSizeControlCon,!1);bm.toolManager.hideExtraTool()}},resizeDrag:(e)=>{var _this=bm.resize;e.preventDefault();e.stopImmediatePropagation();const fixPosition=(width,height,top,left,exTop,exLeft)=>{if(width&&height&&top&&left){if(width<=_this.minWidth){width=40;left=exLeft};if(height<=_this.minHeight){height=40;top=exTop}};return{width:width,height:height,top:top,left:left}};let posData;if(_this.layoutkit){posData={left:undefined,top:undefined,right:0,bottom:0,width:undefined,height:undefined}};for(let i=0;i<_this['target'].length;i++){if(!_this.resizingInfo[i]['isResizing'])return;let direction=_this.resizingInfo[i]['direction'];let width;let height;let top;let left;let es=_this.resizingInfo[i]['currentStyle'];let ec=_this.resizingInfo[i]['currentClient'];let er=_this.resizingInfo[i]['rotate'];let cosA=Math.cos((Math.PI/180)*er);let sinA=Math.sin((Math.PI/180)*er);let difW=cosA*(ec['x']-e.clientX)+sinA*(ec['y']-e.clientY);let difH=cosA*(ec['y']-e.clientY)-sinA*(ec['x']-e.clientX);if(direction==='top'){if(er===0||er===180){width=es['width'];height=es['height']+(ec['y']-e.clientY);if(width>=1&&height>=1){top=es['top']-(ec['y']-e.clientY);left=es['left']}}
else if(er===90||er===270){width=es['width']+(ec['y']-e.clientY);height=es['height'];if(width>=1&&height>=1){top=es['top']-(ec['y']-e.clientY)/2;left=es['left']-(ec['y']-e.clientY)/2}}}
else if(direction==='right'){if(er===0||er===180){width=es['width']-(ec['x']-e.clientX);height=es['height'];if(width>=1&&height>=1){top=es['top'];left=es['left']}}
else if(er===90||er===270){width=es['width'];height=es['height']-(ec['x']-e.clientX);if(width>=1&&height>=1){top=es['top']+(ec['x']-e.clientX)/2;left=es['left']-(ec['x']-e.clientX)/2}}}
else if(direction==='bottom'){if(er===0||er===180){width=es['width'];height=es['height']-(ec['y']-e.clientY);if(width>=1&&height>=1){top=es['top'];left=es['left']}}
else if(er===90||er===270){width=es['width']-(ec['y']-e.clientY);height=es['height'];if(width>=1&&height>=1){top=es['top']-(ec['y']-e.clientY)/2;left=es['left']+(ec['y']-e.clientY)/2}}}
else if(direction==='left'){if(er===0||er===180){width=es['width']+(ec['x']-e.clientX);height=es['height'];if(width>=1&&height>=1){top=es['top'];left=es['left']-(ec['x']-e.clientX)}}
else if(er===90||er===270){width=es['width'];height=es['height']+(ec['x']-e.clientX);if(width>=1&&height>=1){top=es['top']-(ec['x']-e.clientX)/2;left=es['left']-(ec['x']-e.clientX)/2}}}
else if(direction==='rightTop'){if(er===0||er===180){width=es['width']-(ec['x']-e.clientX);height=es['height']+(ec['y']-e.clientY);if(width>=1&&height>=1){top=es['top']-(ec['y']-e.clientY);left=es['left']}}
else if(er===90||er===270){width=es['width']+(ec['y']-e.clientY);height=es['height']-(ec['x']-e.clientX);if(width>=1&&height>=1){top=es['top']+(ec['x']-e.clientX)/2-(ec['y']-e.clientY)/2;left=es['left']-(ec['x']-e.clientX)/2-(ec['y']-e.clientY)/2}}}
else if(direction==='leftTop'){if(er===0||er===180){width=es['width']+(ec['x']-e.clientX);height=es['height']+(ec['y']-e.clientY);if(width>=1&&height>=1){top=es['top']-(ec['y']-e.clientY);left=es['left']-(ec['x']-e.clientX)}}
else if(er===90||er===270){width=es['width']+(ec['y']-e.clientY);height=es['height']+(ec['x']-e.clientX);if(width>=1&&height>=1){top=es['top']-(ec['x']-e.clientX)/2-(ec['y']-e.clientY)/2;left=es['left']-(ec['x']-e.clientX)/2-(ec['y']-e.clientY)/2}}}
else if(direction==='rightBottom'){if(er===0||er===180){width=es['width']+(e.clientX-ec['x']);height=es['height']+(e.clientY-ec['y']);if(width>=1&&height>=1){top=es['top'];left=es['left']}}
else if(er===90||er===270){width=es['width']-(ec['y']-e.clientY);height=es['height']-(ec['x']-e.clientX);if(width>=1&&height>=1){top=es['top']+(ec['x']-e.clientX)/2-(ec['y']-e.clientY)/2;left=es['left']-(ec['x']-e.clientX)/2+(ec['y']-e.clientY)/2}}}
else if(direction==='leftBottom'){if(er===0||er===180){width=es['width']+(ec['x']-e.clientX);height=es['height']+(e.clientY-ec['y']);if(width>=1&&height>=1){top=es['top'];left=es['left']-(ec['x']-e.clientX)}}
else if(er===90||er===270){width=es['width']-(ec['y']-e.clientY);height=es['height']+(ec['x']-e.clientX);if(width>=1&&height>=1){top=es['top']-(ec['x']-e.clientX)/2-(ec['y']-e.clientY)/2;left=es['left']-(ec['x']-e.clientX)/2+(ec['y']-e.clientY)/2}}};let isDiagonal=!1;if(direction==='rightTop'||direction==='leftTop'||direction==='rightBottom'||direction==='leftBottom'){isDiagonal=!0};if($('#WEVEN_IFRAME').length>0&&wvAdminIFrameBridge){if(bm.toolManager.editorMode==='product'){if(top<=0)top=0;if(left<=0)left=0;if($(_this['target'][i]).find('.wveditor_image').length>0&&isDiagonal){$(_this['target'][i]).css({width:width+'px',height:'auto',marginTop:top+'px',marginLeft:left+'px'})}
else{$(_this['target'][i]).css({width:width+'px',height:height+'px',marginTop:top+'px',marginLeft:left+'px'})}}
else{if($(_this['target'][i]).find('.wveditor_image').length>0&&isDiagonal){$(_this['target'][i]).css({width:width+'px',height:'auto',top:top+'px',left:left+'px'})}
else{$(_this['target'][i]).css({width:width+'px',height:height+'px',top:top+'px',left:left+'px'})}}}
else{$(_this['target'][i]).css({width:width+'px',height:height+'px',top:top+'px',left:left+'px'})};if(_this.layoutkit){const rect=_this['target'][i].getBoundingClientRect();if(posData.left===undefined)posData.left=rect.left;else posData.left=posData.left<rect.left?posData.left:rect.left;if(posData.top===undefined)posData.top=rect.top;else posData.top=posData.top<rect.top?posData.top:rect.top;posData.right=posData.right>rect.left+rect.width?posData.right:rect.left+rect.width;posData.bottom=posData.bottom>rect.top+rect.height?posData.bottom:rect.top+rect.height}};if(_this.layoutkit){posData.width=posData.right-posData.left;posData.height=posData.bottom-posData.top;_this.layoutkit.kitRepositioning(null,posData);if(wvAdminIFrameBridge._WVToolAddBlockBelow){wvAdminIFrameBridge._WVToolAddBlockBelow.setSyncPageHeight()}}},resizeEnd:(e)=>{var _this=bm.resize;e.preventDefault();e.stopImmediatePropagation();_this.resizingInfo=[{currentStyle:null,currentClient:null,direction:'',rotate:0,isResizing:!1}];if(_this.layoutkit){if(bm.animation&&bm.animation['mode']===!0){if(wvAdminIFrameBridge){wvAdminIFrameBridge.toolManager.toolStyleSetting();bm.animation.changeFrameList(wvAdminIFrameBridge._WVToolbarAnimation.getTargetInstanceId(_this['target']),_this['target'],bm.animation.EVENT_BLOCK_STYLE)}}
else{_this.layoutkit.activeKit();_this.layoutkit.kitRepositioning();bm.toolManager.showExtraToolByTarget(_this.layoutkit.targetElement);if(wvAdminIFrameBridge._WVToolAddBlockBelow){wvAdminIFrameBridge._WVToolAddBlockBelow.setSyncPageHeight()}}}}};var ToolInstance=function(){var t=this;this.onBtnClick=function(t){};ToolInstance.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent();if(bm.animation&&bm.animation['mode']===!0){$(this.element).hide()}
else{$(this.element).show()}};this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnInstance'].btnList[t]).trigger('click')}}};bm.extend(ToolBase,ToolInstance);var ToolAlign=function(){var t=this;this.onBtnClick=function(t){};ToolAlign.prototype.onChangeTarget=function(t,e,i){var n=wvAdminIFrameBridge._WVContentArea;if(!n.boardSetting.boardSetting){n.boardSetting.setBoardSetting(!1)};this.toolAlignBtn=this.toolBtnList['ToolBtnAlign'];if(t&&t['isConnected']){this.toolAlignBtn.data={layout:n.$contentBody.find('[data-wv-layout-element-board-page]')[0],layoutpos:n.boardSetting.boardSetting.layoutPos,pos:bm.dom.getRelativeCoordinates(n.$contentBody.find('[data-wv-layout-element-board-page]')[0],$(t)[0])}}};this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnAlign'].btnList[t]).trigger('click')}}};bm.extend(ToolBase,ToolAlign);var ToolDomRate=function(){var t=this;this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnDomRate'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolDomRate);var ToolStroke=function(){var t=this;this.elementType='text';this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnStroke'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolStroke);ToolStroke.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent();if(i==='side'){this.isShow=!1;this.show(!0,this.elementType)}};var ToolRotate=function(){var t=this;this.quickEdit=function(t){if(this.status){$(this.toolBtnList['ToolBtnRotate'].btnList[t]).focus()}}};bm.extend(ToolBase,ToolRotate);ToolRotate.prototype.onChangeTarget=function(t,e,i){this.removeEvent();this.addEvent()};var ToolBtnInstance=function(){this.type='';this.onBtnClick=function(t,e){};this.onOptionChange=function(t,e){const _this=this;const animationToolbar=wvAdminIFrameBridge._WVToolbarAnimation.$settingMenu;const allDesignAreaBlock=wvAdminIFrameBridge._WVContentArea.$contentBody.find('[data-wv-design-area]');let check=!1;if(e){for(let i=0;i<allDesignAreaBlock.length;i++){if($(allDesignAreaBlock[i]).attr('data-wv-ani-inst-id')===e){check=!0}};if(check===!1){let formerId;if($(this.target).attr('data-wv-ani-inst-id')!==undefined){formerId=$(this.target).attr('data-wv-ani-inst-id')}
else if($(this.target).attr('data-wv-res-id')!==undefined){formerId=$(this.target).attr('data-wv-res-id')}
else{bm.toast('해당 블록의 인스턴스명이 없습니다.');return!1};const newId=e;$(this.target).attr('data-wv-ani-inst-id',newId);if(animationToolbar){const targetFrameBar=$(animationToolbar).find('.animate_frame_body').find('[data-wv-ani-inst-id="'+formerId+'"]');const targetLayer=$(animationToolbar).find('#animationLayerList').find('[data-wv-ani-inst-id="'+formerId+'"]');if(targetFrameBar.length>0){$(targetFrameBar).attr('data-wv-ani-inst-id',newId)}
else{bm.toast('해당 인스턴스명을 지닌 프레임이 없습니다.');return!1};if(targetLayer.length>0){$(targetLayer).attr('data-wv-ani-inst-id',newId)}
else{bm.toast('해당 인스턴스명을 지닌 레이어가 없습니다.');return!1}};bm.toast('인스턴스명이 변경되었습니다.')}
else{bm.toast('중복된 인스턴스명을 지닌 블록이 있습니다.');return!1}}
else{bm.toast('인스턴스명을 적어주세요.');return!1}};this.applyStyle=function(t,e,i){}};bm.extend(ToolBtnBase,ToolBtnInstance);ToolBtnInstance.prototype.setStyleBtn=function(){const _this=this;let id='';if($(this.target).attr('data-wv-ani-inst-id')!==undefined){id=$(this.target).attr('data-wv-ani-inst-id')}
else if($(this.target).attr('data-wv-res-id')!==undefined){id=$(this.target).attr('data-wv-res-id')};$(this.btnList['instance_name']).val(id)};ToolBtnInstance.prototype.resetStyleBtn=function(){var t=this};ToolBtnInstance.prototype.addEvent=function(){var t=this;$(this.btnList['instance_name']).on('focus',function(){$(this).select()});$(this.btnList['instance_name']).on('keydown',function(e){var i=$(this).val();if(e.keyCode===13){if(bm.valid.isOnlyNumAndEn(i)===!0){t.onOptionChange('instance_name',i)}
else{bm.toast('인스턴스명은 숫자 및 영문으로만 구성해주세요.');return!1}}})};ToolBtnInstance.prototype.removeEvent=function(){$(this.btnList['instance_name']).off('focus');$(this.btnList['instance_name']).off('keydown')};var ToolBtnAlign=function(){this.type='';this.onBtnClick=function(t,e){let page=this.data.layout;let type;let css={};if(wvAdminIFrameBridge._WVLayoutKit.isMultiSelectMode){}
else{switch(e){case'left':if(bm.toolManager.editorMode==='product'){css={marginLeft:'0',marginRight:'auto'};type='align'}
else{css={left:0,right:'auto'};type='align'};break;case'middle_h':if(bm.toolManager.editorMode==='product'){css={marginLeft:'auto',marginRight:'auto'};type='align'}
else{css={left:(this.data.layoutpos.width-$(this.target).width())/2,right:'auto'};type='align'};break;case'right':if(bm.toolManager.editorMode==='product'){css={marginLeft:'auto',marginRight:'0'};type='align'}
else{css={left:'auto',right:0};type='align'};break;case'top':css={top:0,bottom:'auto'};type='align';break;case'middle_v':css={top:(this.data.layoutpos.height-$(this.target).height())/2,bottom:'auto'};type='align';break;case'bottom':css={top:'auto',bottom:0};type='align';break;case'toUp':type='index';break;case'toDown':type='index';break;case'toFirst':type='index';break;case'toLast':type='index';break;case'flip_h':type='flip';break;case'flip_v':type='flip';break}};if(page){this.applyStyle(e,type,css)}
else{bm.toast('적용할 레이아웃이 없습니다.')}};this.applyStyle=function(t,e,i){var r=this,o=this.target,n={};if(e==='align'){n={top:bm.getStyle(o,'top'),bottom:bm.getStyle(o,'bottom'),left:bm.getStyle(o,'left'),right:bm.getStyle(o,'right')}}
else if(e==='index'){const moveNodeForward=(node,t)=>{var a=node.previousElementSibling,s=node.nextElementSibling;if(t==='toUp'&&s){node.parentNode.insertBefore(s,node)}
else if(t==='toDown'&&a){node.parentNode.insertBefore(node,a)}
else if(t==='toFirst'){node.parentNode.append(node)}
else if(t==='toLast'){node.parentNode.insertBefore(node,node.parentNode.firstChild)}};moveNodeForward(o,t)}
else if(e==='flip'){if($(o).find('[data-wv-layout-element="block"]').length>0){o=$(o).find('[data-wv-layout-element="block"]')}
else{o=$(o).find('[data-wv-layout-element="block_inner"]').children()};n=bm.getStyle(o,'transform');if(n!=='none'){n=n.split('(')[1].split(')')[0].split(',');n='scale('+n[0]+','+n[3]+')'};if(t==='flip_h'){if(n==='none')i={transform:'scale(-1, 1)'};if(n==='scale(-1, -1)')i={transform:'scale(1, -1)'};if(n==='scale(1, -1)')i={transform:'scale(-1, -1)'};if(n==='scale(-1, 1)')i={transform:'scale(1, 1)'};if(n==='scale(1, 1)')i={transform:'scale(-1, 1)'}};if(t==='flip_v'){if(n==='none')i={transform:'scale(1, -1)'};if(n==='scale(-1, -1)')i={transform:'scale(-1, 1)'};if(n==='scale(-1, 1)')i={transform:'scale(-1, -1)'};if(n==='scale(1, -1)')i={transform:'scale(1, 1)'};if(n==='scale(1, 1)')i={transform:'scale(1, -1)'}};n={transform:n}};bm.toolManager.toolBtnEditBefore(this,o,HistoryType.EDITOR_DOM_WIDTH,n);if(i)$(o).css(i);bm.toolManager.toolBtnEditAfter(this,o,HistoryType.EDITOR_DOM_WIDTH,i);wvAdminIFrameBridge._WVLayoutKit.kitRepositioning();wvAdminIFrameBridge._WVToolbarLayerWindow.setLayerDefault()}};bm.extend(ToolBtnBase,ToolBtnAlign);ToolBtnAlign.prototype.setStyleBtn=function(){};ToolBtnAlign.prototype.resetStyleBtn=function(){var t=this};ToolBtnAlign.prototype.addEvent=function(){var t=this};ToolBtnAlign.prototype.removeEvent=function(){var t=this};var ToolBtnDomRate=function(){this.type='';this.onBtnClick=function(t,e){if(wvAdminIFrameBridge._WVLayoutKit.isMultiSelectMode){}
else{if($(t.target).hasClass('is_fixed')){$(t.target).removeClass('is_fixed');this.resetRate()}
else{$(t.target).addClass('is_fixed');this.setRate()}}};this.setRate=()=>{let widthByRate=$(this.target).innerHeight()/parseInt($(this.target).innerWidth());let heightByRate=parseInt($(this.target).innerWidth())/$(this.target).innerHeight();bm.toolManager.toolList['ToolDomWidth'].toolBtnList['ToolBtnDomWidth'].isFixed={isFixed:!0,rate:widthByRate};bm.toolManager.toolList['ToolDomHeight'].toolBtnList['ToolBtnDomHeight'].isFixed={isFixed:!0,rate:heightByRate}};this.resetRate=()=>{bm.toolManager.toolList['ToolDomWidth'].toolBtnList['ToolBtnDomWidth'].isFixed={isFixed:!1};bm.toolManager.toolList['ToolDomHeight'].toolBtnList['ToolBtnDomHeight'].isFixed={isFixed:!1}}};bm.extend(ToolBtnBase,ToolBtnDomRate);ToolBtnDomRate.prototype.setStyleBtn=function(){var t=this;if(!t.target||t.target.length){t.resetStyleBtn();return!1};if($(this.btnList['fix']).hasClass('is_fixed')){this.setRate()}
else{this.resetRate()}};ToolBtnDomRate.prototype.resetStyleBtn=function(){var t=this};ToolBtnDomRate.prototype.addEvent=function(){var t=this};ToolBtnDomRate.prototype.removeEvent=function(){var t=this};var ToolBtnStroke=function(){this.type='ToolBtnStroke';this.colorPicker=ToolOpColorPicker.get();this.addOption(this.colorPicker,'color');this.onOptionChange=function(t,e){let target=this.target;let currentCss={color:window.getComputedStyle(target)['webkitTextStrokeColor'],width:window.getComputedStyle(target)['webkitTextStrokeWidth']};bm.toolManager.toolBtnEditBefore(this,target,HistoryType.EDITOR_TEXT_COLOR,currentCss);if(t==='width'){$(target).css({'-webkit-text-stroke-width':e+'px'})};if(t==='ToolOpColorPicker'){$(target).css({'-webkit-text-stroke-color':e});$(this.btnList['color']).find('.choice_color').css({backgroundColor:e})};bm.toolManager.toolBtnEditAfter(this,target,HistoryType.EDITOR_TEXT_COLOR,currentCss)}};bm.extend(ToolBtnBase,ToolBtnStroke);ToolBtnStroke.prototype.setStyleBtn=function(){var t=this;if(!t.target){t.resetStyleBtn();return!1};let target=this.target;if($(target).length===1){let currentCss={color:window.getComputedStyle($(target)[0])['webkitTextStrokeColor'],width:window.getComputedStyle($(target)[0])['webkitTextStrokeWidth']};$(this.btnList['color']).find('.choice_color').css({backgroundColor:currentCss['color']});$(this.btnList['widthRange']).val(currentCss['width'].match(/\d+/g)[0]);$(this.btnList['widthOutput']).text(currentCss['width'].match(/\d+/g)[0])}
else{return!1}};ToolBtnStroke.prototype.resetStyleBtn=function(){var t=this};ToolBtnStroke.prototype.addEvent=function(){var t=this;$(this.btnList['widthRange']).on('propertychange change keyup paste input',function(){$(t.btnList['widthOutput']).val($(this).val());t.onOptionChange('width',$(this).val())})};ToolBtnStroke.prototype.removeEvent=function(){var t=this};var ToolBtnRotate=function(){this.type='ToolBtnRotate';var t=this;this.onBtnClick=function(e,i){switch(i){case'rotateUp':t.onOptionChange('rotate',t.getOnlyNum($(this.btnList['rotateInput']).val())+1);break;case'rotateDown':t.onOptionChange('rotate',t.getOnlyNum($(this.btnList['rotateInput']).val())-1);break}};this.onOptionChange=function(e,i){let target=this.target;let currentCss={rotate:window.getComputedStyle($(target)[0])['rotate']};bm.toolManager.toolBtnEditBefore(this,target,HistoryType.EDITOR_DOM_WIDTH,currentCss);let css={rotate:i+'deg'};$(target).css(css);bm.toolManager.kitReposition();bm.toolManager.toolBtnEditAfter(this,target,HistoryType.EDITOR_DOM_WIDTH,css);this.setStyleBtn();$(wvAdminIFrameBridge._WVLayoutKit.elementRotateIndicator).text(i+'º');$(wvAdminIFrameBridge._WVLayoutKit.elementRotateIndicator).show();$(wvAdminIFrameBridge._WVLayoutKit.elementRotateIndicator).css({opacity:1});if(!t['isTransitioning']){t['isTransitioning']=!0;setTimeout(function(){$(wvAdminIFrameBridge._WVLayoutKit.elementRotateIndicator).css({opacity:0});t['isTransitioning']=!1},1000)}};this.getOnlyNum=(val)=>{let extractedNumbers=val.match(/-?\d+/g);let numbersArray;if(extractedNumbers){numbersArray=extractedNumbers.map(Number);if(numbersArray[0]>=360){numbersArray[0]-=360};if(numbersArray[0]<=-1){numbersArray[0]+=360};return numbersArray[0]}
else{return 0}}};bm.extend(ToolBtnBase,ToolBtnRotate);ToolBtnRotate.prototype.setStyleBtn=function(){var t=this;if(!t.target){t.resetStyleBtn();return!1};let target=this.target;setTimeout(function(){if(t.isMouseDown_Up){t.onOptionChange('rotate',t.getOnlyNum($(t.btnList['rotateInput']).val())+1)};if(t.isMouseDown_Down){t.onOptionChange('rotate',t.getOnlyNum($(t.btnList['rotateInput']).val())-1)}},20);if($(target).length===1){let currentCss={rotate:parseInt(window.getComputedStyle($(target)[0])['rotate'].replace('deg',''))};if(Number.isNaN(currentCss['rotate'])){$(this.btnList['rotateInput']).val(0)}
else{$(this.btnList['rotateInput']).val(currentCss['rotate'])}}
else{return!1}};ToolBtnRotate.prototype.resetStyleBtn=function(){var t=this;$(this.btnList['rotateInput']).val(0)};ToolBtnRotate.prototype.addEvent=function(){var t=this;$(this.btnList['rotateInput']).on('focus',function(){$(this).select()});$(this.btnList['rotateInput']).on('change',function(e){var i=t.getOnlyNum($(this).val());if(e.keyCode===38){i++}
else if(e.keyCode===40){i--};$(this).val(i);if(i<0||i>=360){bm.toast('0º부터 360º까지 설정해주세요.');return!1};t.onOptionChange('rotate',i)});this.setBtnValueByOne('rotateUp',this,'isMouseDown_Up',function(){t.onOptionChange('rotate',t.getOnlyNum($(t.btnList['rotateInput']).val())+1)});this.setBtnValueByOne('rotateDown',this,'isMouseDown_Down',function(){t.onOptionChange('rotate',t.getOnlyNum($(t.btnList['rotateInput']).val())-1)})};ToolBtnRotate.prototype.removeEvent=function(){var t=this;$(this.btnList['rotateInput']).off('focus');$(this.btnList['rotateInput']).off('change');$(this.btnList['rotateUp']).off();$(this.btnList['rotateDown']).off()};var ToolOpLine=function(){this.type='ToolOpLine';this.element=$('[data-wv-tool-option=ToolOpLine]');this.onOptionBtnClick=function(t){var e=bm.toolManager.toolList['ToolLine'].toolBtnList['ToolBtnLine'],n=$(e.target).find('.wveditor_line hr');if($(e.target).attr('data-wv-layout-element-type')==='line'){var i='[data-wv-res-id="'+$(e.target).attr('data-wv-res-id')+'"] hr'}
else{var i='[data-wv-res-id="'+$($(e.target).find('[data-wv-layout-element-type="line"]')).attr('data-wv-res-id')+'"] hr'};var i='[data-wv-res-id="'+$(e.target).attr('data-wv-res-id')+'"] hr',a={};bm.toolManager.toolBtnEditBefore(this,n,HistoryType.EDITOR_LINE);a[e.borderType.toString()+'Style']=t;var o=null;if(bm.bmEditorManager.registedBoardEditor===!1){o=WVAdminResourceManager.getEmbededStyleObject(null,n)};o.applyResourceStyle(i,a,!1,!0);bm.toolManager.toolBtnEditAfter(this,n,HistoryType.EDITOR_LINE)}};bm.extend(ToolOpBase,ToolOpLine);ToolOpLine.prototype.addEvent=function(){};ToolOpLine.prototype.removeEvent=function(){var t=this};if(!document.createElement('canvas').getContext){(function(){var n=Math,e=n.round,h=n.sin,c=n.cos,T=n.abs,C=n.sqrt,i=10,o=i/2;function S(){return this.context_||(this.context_=new p(this))};var m=Array.prototype.slice;function x(t,e,i){var n=m.call(arguments,2);return function(){return t.apply(e,n.concat(m.call(arguments)))}};var g={init:function(t){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var e=t||document;e.createElement('canvas');e.attachEvent('onreadystatechange',x(this.init_,this,e))}},init_:function(t){if(!t.namespaces['g_vml_']){t.namespaces.add('g_vml_','urn:schemas-microsoft-com:vml','#default#VML')};if(!t.namespaces['g_o_']){t.namespaces.add('g_o_','urn:schemas-microsoft-com:office:office','#default#VML')};if(!t.styleSheets['ex_canvas_']){var n=t.createStyleSheet();n.owningElement.id='ex_canvas_';n.cssText='canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}'};var i=t.getElementsByTagName('canvas');for(var e=0;e<i.length;e++){this.initElement(i[e])}},initElement:function(t){if(!t.getContext){t.getContext=S;t.innerHTML='';t.attachEvent('onpropertychange',B);t.attachEvent('onresize',E);var e=t.attributes;if(e.width&&e.width.specified){t.style.width=e.width.nodeValue+'px'}
else{t.width=t.clientWidth};if(e.height&&e.height.specified){t.style.height=e.height.nodeValue+'px'}
else{t.height=t.clientHeight}};return t}};function B(t){var e=t.srcElement;switch(t.propertyName){case'width':e.style.width=e.attributes.width.nodeValue+'px';e.getContext().clearRect();break;case'height':e.style.height=e.attributes.height.nodeValue+'px';e.getContext().clearRect();break}};function E(t){var e=t.srcElement;if(e.firstChild){e.firstChild.style.width=e.clientWidth+'px';e.firstChild.style.height=e.clientHeight+'px'}};g.init();var u=[];for(var l=0;l<16;l++){for(var r=0;r<16;r++){u[l*16+r]=l.toString(16)+r.toString(16)}};function f(){return[[1,0,0],[0,1,0],[0,0,1]]};function a(t,e){var s=f();for(var o=0;o<3;o++){for(var n=0;n<3;n++){var a=0;for(var i=0;i<3;i++){a+=t[o][i]*e[i][n]};s[o][n]=a}};return s};function v(t,e){e.fillStyle=t.fillStyle;e.lineCap=t.lineCap;e.lineJoin=t.lineJoin;e.lineWidth=t.lineWidth;e.miterLimit=t.miterLimit;e.shadowBlur=t.shadowBlur;e.shadowColor=t.shadowColor;e.shadowOffsetX=t.shadowOffsetX;e.shadowOffsetY=t.shadowOffsetY;e.strokeStyle=t.strokeStyle;e.globalAlpha=t.globalAlpha;e.arcScaleX_=t.arcScaleX_;e.arcScaleY_=t.arcScaleY_;e.lineScale_=t.lineScale_};function b(t){var e,a=1;t=String(t);if(t.substring(0,3)=='rgb'){var o=t.indexOf('(',3),s=t.indexOf(')',o+1),n=t.substring(o+1,s).split(',');e='#';for(var i=0;i<3;i++){e+=u[Number(n[i])]};if(n.length==4&&t.substr(3,1)=='a'){a=n[3]}}
else{e=t};return{color:e,alpha:a}};function k(t){switch(t){case'butt':return'flat';case'round':return'round';case'square':default:return'square'}};function p(t){this.m_=f();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle='#000';this.fillStyle='#000';this.lineWidth=1;this.lineJoin='miter';this.lineCap='butt';this.miterLimit=i*1;this.globalAlpha=1;this.canvas=t;var e=t.ownerDocument.createElement('div');e.style.width=t.clientWidth+'px';e.style.height=t.clientHeight+'px';e.style.overflow='hidden';e.style.position='absolute';t.appendChild(e);this.element_=e;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1};var t=p.prototype;t.clearRect=function(){this.element_.innerHTML=''};t.beginPath=function(){this.currentPath_=[]};t.moveTo=function(t,e){var i=this.getCoords_(t,e);this.currentPath_.push({type:'moveTo',x:i.x,y:i.y});this.currentX_=i.x;this.currentY_=i.y};t.lineTo=function(t,e){var i=this.getCoords_(t,e);this.currentPath_.push({type:'lineTo',x:i.x,y:i.y});this.currentX_=i.x;this.currentY_=i.y};t.bezierCurveTo=function(t,e,i,n,o,a){var s=this.getCoords_(o,a),r=this.getCoords_(t,e),l=this.getCoords_(i,n);y(this,r,l,s)};function y(t,e,i,n){t.currentPath_.push({type:'bezierCurveTo',cp1x:e.x,cp1y:e.y,cp2x:i.x,cp2y:i.y,x:n.x,y:n.y});t.currentX_=n.x;t.currentY_=n.y};t.quadraticCurveTo=function(t,e,i,n){var s=this.getCoords_(t,e),o=this.getCoords_(i,n),a={x:this.currentX_+2.0/3.0*(s.x-this.currentX_),y:this.currentY_+2.0/3.0*(s.y-this.currentY_)};var r={x:a.x+(o.x-this.currentX_)/3.0,y:a.y+(o.y-this.currentY_)/3.0};y(this,a,r,o)};t.arc=function(t,e,n,a,s,r){n*=i;var g=r?'at':'wa',l=t+c(a)*n-o,m=e+h(a)*n-o,u=t+c(s)*n-o,v=e+h(s)*n-o;if(l==u&&!r){l+=0.125};var d=this.getCoords_(t,e),f=this.getCoords_(l,m),p=this.getCoords_(u,v);this.currentPath_.push({type:g,x:d.x,y:d.y,radius:n,xStart:f.x,yStart:f.y,xEnd:p.x,yEnd:p.y})};t.rect=function(t,e,i,n){this.moveTo(t,e);this.lineTo(t+i,e);this.lineTo(t+i,e+n);this.lineTo(t,e+n);this.closePath()};t.strokeRect=function(t,e,i,n){var o=this.currentPath_;this.beginPath();this.moveTo(t,e);this.lineTo(t+i,e);this.lineTo(t+i,e+n);this.lineTo(t,e+n);this.closePath();this.stroke();this.currentPath_=o};t.fillRect=function(t,e,i,n){var o=this.currentPath_;this.beginPath();this.moveTo(t,e);this.lineTo(t+i,e);this.lineTo(t+i,e+n);this.lineTo(t,e+n);this.closePath();this.fill();this.currentPath_=o};t.createLinearGradient=function(t,e,i,n){var o=new d('gradient');o.x0_=t;o.y0_=e;o.x1_=i;o.y1_=n;return o};t.createRadialGradient=function(t,e,i,n,o,a){var s=new d('gradientradial');s.x0_=t;s.y0_=e;s.r0_=i;s.x1_=n;s.y1_=o;s.r1_=a;return s};t.drawImage=function(t,o){var a,s,l,d,u,g,m,v,x=t.runtimeStyle.width,B=t.runtimeStyle.height;t.runtimeStyle.width='auto';t.runtimeStyle.height='auto';var f=t.width,p=t.height;t.runtimeStyle.width=x;t.runtimeStyle.height=B;if(arguments.length==3){a=arguments[1];s=arguments[2];u=g=0;m=l=f;v=d=p}
else if(arguments.length==5){a=arguments[1];s=arguments[2];l=arguments[3];d=arguments[4];u=g=0;m=f;v=p}
else if(arguments.length==9){u=arguments[1];g=arguments[2];m=arguments[3];v=arguments[4];a=arguments[5];s=arguments[6];l=arguments[7];d=arguments[8]}
else{throw Error('Invalid number of arguments')};var h=this.getCoords_(a,s),E=m/2,k=v/2,c=[],C=10,S=10;c.push(' <g_vml_:group',' coordsize="',i*C,',',i*S,'"',' coordorigin="0,0"',' style="width:',C,'px;height:',S,'px;position:absolute;');if(this.m_[0][0]!=1||this.m_[0][1]){var T=[];T.push('M11=',this.m_[0][0],',','M12=',this.m_[1][0],',','M21=',this.m_[0][1],',','M22=',this.m_[1][1],',','Dx=',e(h.x/i),',','Dy=',e(h.y/i),'');var r=h,b=this.getCoords_(a+l,s),y=this.getCoords_(a,s+d),w=this.getCoords_(a+l,s+d);r.x=n.max(r.x,b.x,y.x,w.x);r.y=n.max(r.y,b.y,y.y,w.y);c.push('padding:0 ',e(r.x/i),'px ',e(r.y/i),'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',T.join(''),', sizingmethod=\'clip\');')}
else{c.push('top:',e(h.y/i),'px;left:',e(h.x/i),'px;')};c.push(' ">','<g_vml_:image src="',t.src,'"',' style="width:',i*l,'px;',' height:',i*d,'px;"',' cropleft="',u/f,'"',' croptop="',g/p,'"',' cropright="',(f-u-m)/f,'"',' cropbottom="',(p-g-v)/p,'"',' />','</g_vml_:group>');this.element_.insertAdjacentHTML('BeforeEnd',c.join(''))};t.stroke=function(t){var a=[],U=!1,E=b(t?this.fillStyle:this.strokeStyle),L=E.color,w=E.alpha*this.globalAlpha,I=10,O=10;a.push('<g_vml_:shape',' filled="',!!t,'"',' style="position:absolute;width:',I,'px;height:',O,'px;"',' coordorigin="0 0" coordsize="',i*I,' ',i*O,'"',' stroked="',!t,'"',' path="');var j=!1,r={x:null,y:null};var l={x:null,y:null};for(var d=0;d<this.currentPath_.length;d++){var o=this.currentPath_[d],z;switch(o.type){case'moveTo':z=o;a.push(' m ',e(o.x),',',e(o.y));break;case'lineTo':a.push(' l ',e(o.x),',',e(o.y));break;case'close':a.push(' x ');o=null;break;case'bezierCurveTo':a.push(' c ',e(o.cp1x),',',e(o.cp1y),',',e(o.cp2x),',',e(o.cp2y),',',e(o.x),',',e(o.y));break;case'at':case'wa':a.push(' ',o.type,' ',e(o.x-this.arcScaleX_*o.radius),',',e(o.y-this.arcScaleY_*o.radius),' ',e(o.x+this.arcScaleX_*o.radius),',',e(o.y+this.arcScaleY_*o.radius),' ',e(o.xStart),',',e(o.yStart),' ',e(o.xEnd),',',e(o.yEnd));break};if(o){if(r.x==null||o.x<r.x){r.x=o.x};if(l.x==null||o.x>l.x){l.x=o.x};if(r.y==null||o.y<r.y){r.y=o.y};if(l.y==null||o.y>l.y){l.y=o.y}}};a.push(' ">');if(!t){var y=this.lineScale_*this.lineWidth;if(y<1){w*=y};a.push('<g_vml_:stroke',' opacity="',w,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',k(this.lineCap),'"',' weight="',y,'px"',' color="',L,'" />')}
else if(typeof this.fillStyle=='object'){var s=this.fillStyle,c=0,v={x:0,y:0};var m=0,B=1;if(s.type_=='gradient'){var P=s.x0_/this.arcScaleX_,H=s.y0_/this.arcScaleY_,W=s.x1_/this.arcScaleX_,F=s.y1_/this.arcScaleY_,f=this.getCoords_(P,H),x=this.getCoords_(W,F),N=x.x-f.x,V=x.y-f.y;c=Math.atan2(N,V)*180/Math.PI;if(c<0){c+=360};if(c<1e-6){c=0}}
else{var f=this.getCoords_(s.x0_,s.y0_),u=l.x-r.x,g=l.y-r.y;v={x:(f.x-r.x)/u,y:(f.y-r.y)/g};u/=this.arcScaleX_*i;g/=this.arcScaleY_*i;var S=n.max(u,g);m=2*s.r0_/S;B=2*s.r1_/S-m};var h=s.colors_;h.sort(function(t,e){return t.offset-e.offset});var p=h.length,M=h[0].color,R=h[p-1].color,A=h[0].alpha*this.globalAlpha,D=h[p-1].alpha*this.globalAlpha,C=[];for(var d=0;d<p;d++){var T=h[d];C.push(T.offset*B+m+' '+T.color)};a.push('<g_vml_:fill type="',s.type_,'"',' method="none" focus="100%"',' color="',M,'"',' color2="',R,'"',' colors="',C.join(','),'"',' opacity="',D,'"',' g_o_:opacity2="',A,'"',' angle="',c,'"',' focusposition="',v.x,',',v.y,'" />')}
else{a.push('<g_vml_:fill color="',L,'" opacity="',w,'" />')};a.push('</g_vml_:shape>');this.element_.insertAdjacentHTML('beforeEnd',a.join(''))};t.fill=function(){this.stroke(!0)};t.closePath=function(){this.currentPath_.push({type:'close'})};t.getCoords_=function(t,e){var n=this.m_;return{x:i*(t*n[0][0]+e*n[1][0]+n[2][0])-o,y:i*(t*n[0][1]+e*n[1][1]+n[2][1])-o}};t.save=function(){var t={};v(this,t);this.aStack_.push(t);this.mStack_.push(this.m_);this.m_=a(f(),this.m_)};t.restore=function(){v(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};function L(t){for(var i=0;i<3;i++){for(var e=0;e<2;e++){if(!isFinite(t[i][e])||isNaN(t[i][e])){return!1}}};return!0};function s(t,e,i){if(!L(e)){return};t.m_=e;if(i){var n=e[0][0]*e[1][1]-e[0][1]*e[1][0];t.lineScale_=C(T(n))}};t.translate=function(t,e){var i=[[1,0,0],[0,1,0],[t,e,1]];s(this,a(i,this.m_),!1)};t.rotate=function(t){var e=c(t),i=h(t),n=[[e,i,0],[-i,e,0],[0,0,1]];s(this,a(n,this.m_),!1)};t.scale=function(t,e){this.arcScaleX_*=t;this.arcScaleY_*=e;var i=[[t,0,0],[0,e,0],[0,0,1]];s(this,a(i,this.m_),!0)};t.transform=function(t,e,i,n,o,r){var l=[[t,e,0],[i,n,0],[o,r,1]];s(this,a(l,this.m_),!0)};t.setTransform=function(t,e,i,n,o,a){var r=[[t,e,0],[i,n,0],[o,a,1]];s(this,r,!0)};t.clip=function(){};t.arcTo=function(){};t.createPattern=function(){return new w};function d(t){this.type_=t;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]};d.prototype.addColorStop=function(t,e){e=b(e);this.colors_.push({offset:t,color:e.color,alpha:e.alpha})};function w(){};G_vmlCanvasManager=g;CanvasRenderingContext2D=p;CanvasGradient=d;CanvasPattern=w})()};BarChart=function(t,e,i,n){this.container,this.canvas,this.context;this.startX=t,this.startY=e;this.width=i,this.height=n;this.formColor='#d3d3d3',this.formThickness=1;this.xAxisLabelList=[],this.yAxisLabelList=[],this.xAxisLabelSize=15,this.yAxisLabelSize=18;this.legendConfig={},this.legendInfoList=[],this.legendList=[];this.spaceX,this.spaceY;this.barThickness,this.barSpace;this.pointLabelList=[];this.pointLabelStyleObj={};this.addPointLabel=function(t,e){this.pointLabelList.push(t);this.pointLabelStyleObj[t]=e};this.removePointLabel=function(t){var e=this.pointLabelList.indexOf(t);this.pointLabelList.split(e,1);delete this.pointLabelStyleObj[t]}};BarChart.prototype={setBrush:function(t,e,i,n){this.container=t;this.canvas=e;this.barThickness=i;this.barSpace=n;if(typeof G_vmlCanvasManager!='undefined')G_vmlCanvasManager.initElement(e);this.context=this.canvas.getContext('2d')},setFormColor:function(t){this.formColor=t},setXaxisLabelSize:function(t){this.xAxisLabelSize=t},setYaxisLabelSize:function(t){this.yAxisLabelSize=t},setLabel:function(t,e){this.xAxisLabelList=t;this.yAxisLabelList=e},setLegend:function(t){this.legendConfig=t},setLegendInfo:function(t){this.legendInfoList=t},setForm:function(){this.drawForm();this.drawLegend();this.drawLabel()},drawForm:function(){this.context.strokeStyle=this.formColor;this.context.lineWidth=this.formThickness;this.context.lineCap='square';this.context.beginPath();this.context.moveTo(this.startX,this.startY);this.context.lineTo(this.startX,this.startY+this.height);this.context.lineTo(this.startX+this.width,this.startY+this.height);this.spaceX=this.width/this.xAxisLabelList.length;this.spaceY=(this.height-10)/(this.yAxisLabelList.length-1);for(var t=0;t<this.xAxisLabelList.length-1;t++){var i=this.startX+(t+1)*this.spaceX;this.context.moveTo(i,this.startY+this.height-1);this.context.lineTo(i,this.startY+this.height-12)};for(var t=0;t<this.yAxisLabelList.length;t++){if(t!=0){var e=this.startY+this.height-(t*this.spaceY);this.context.moveTo(this.startX,e);this.context.lineTo(this.startX+this.width,e)}};this.context.stroke()},drawLegend:function(){var n=0;for(var e=0;e<this.legendInfoList.length;e++){var t=bm.html(this.legendConfig.isCheck?'<div><label style=\'cursor: pointer;\'><input type=\'checkbox\' checked=\'true\'/> '+this.legendInfoList[e].name+'</label><div class=\'legendRect\' style=\'margin-left: 5px;\'></div></div>':'<div>'+this.legendInfoList[e].name+'<div class=\'legendRect\' style=\'margin-left: 5px;\'></div></div>');t.style.position='absolute',t.style.fontSize=this.legendConfig.fontSize+'px';var i=$(t).find('.legendRect')[0];i.style.float='right',i.style.width=this.legendConfig.width+'px',i.style.height=this.legendConfig.height+'px';i.style.background=this.legendInfoList[e].color;this.container.appendChild(t);i.style.marginTop=(t.offsetHeight-this.legendConfig.height)/2+'px';if(e==0)t.style.left=this.legendConfig.startX+'px';else t.style.left=n+this.legendConfig.spaceX+'px';t.style.top=this.legendConfig.startY+'px';n=parseInt(t.style.left)+t.clientWidth;this.legendList.push(t)}},drawLabel:function(){for(var e=0;e<this.xAxisLabelList.length;e++){var t=bm.html('<div class=\'xLabel\'></div>');t.style.position='absolute',t.style.width=(this.spaceX-10)+'px';t.style.fontSize=this.xAxisLabelSize+'px',t.style.textAlign='center',t.style.position='absolute';t.innerText=this.xAxisLabelList[e];this.container.appendChild(t);t.style.left=this.startX+(e*this.spaceX)+(this.spaceX-t.offsetWidth)/2+'px';t.style.top=this.startY+this.height+10+'px'};for(var e=0;e<this.yAxisLabelList.length;e++){var t=bm.html('<div class=\'yLabel\'></div>');t.style.position='absolute',t.style.fontSize=this.yAxisLabelSize+'px';t.innerText=this.yAxisLabelList[e];this.container.appendChild(t);t.style.left=this.startX-t.offsetWidth-10+'px';t.style.top=10+this.startY+e*this.spaceY-t.offsetHeight/2+'px'}},createChart:function(t){for(var n=0;n<t.length;n++){var o=[],a=[],s=[],l=this.legendList.length,e;for(var i=0;i<l;i++){var r=this.legendList[i];e=this.legendInfoList[i].data;if(this.legendConfig.isCheck){if(t[n][e]!=undefined&&$(r).find('input')[0].checked){a.push(this.legendInfoList[i].color);o.push(t[n][e]);if(this.pointLabelList.indexOf(e)>-1){s[i]=this.pointLabelStyleObj[e]}}}
else if(t[n][e]!=undefined){a.push(this.legendInfoList[i].color);o.push(t[n][e]);if(this.pointLabelList.indexOf(e)>-1){s[i]=this.pointLabelStyleObj[e]}}};this.drawChart(o,this.barThickness,this.barSpace,n,a,s)}},drawChart:function(t,e,i,n,o,a){var d=t.length*e+(t.length-1)*i,l=this.startX+(n*this.spaceX)+(this.spaceX-d)/2;this.context.beginPath();for(var s=0;s<t.length;s++){this.context.fillStyle=o[s];var r=(this.height-10)*t[s]/this.yAxisLabelList[0];this.context.fillRect(l+s*e+s*i,this.startY+this.height-r,e,r);this.createDataNum(t[s],l+s*e+s*i,this.startY+this.height-r,e,r,a[s])}},createDataNum:function(t,e,i,n,o,a){var s=bm.html('<div class=\'data_num\'>'+t+'</div>');s.style.position='absolute',s.style.fontSize='10px';this.container.appendChild(s);s.style.left=e-(s.clientWidth-this.barThickness)/2+'px';s.style.top=i-(s.offsetHeight/2+5)+'px';if(s&&a){bm.setStyles(s,a)}},clearChart:function(){this.context.clearRect(0,0,this.container.offsetWidth,this.container.offsetHeight);$(this.container).find('.data_num').remove()},clearCanvas:function(){this.clearChart();$(this.container).find('.data_num').remove();$('.xLabel').remove();$('.yLabel').remove()}};LineChart=function(t,e,i,n){this.container,this.canvas,this.context;this.startX=t,this.startY=e;this.width=i;this.height=n;this.strokeColor='#aab3d9';this.lineThickness=3;this.xAxisLabel=[];this.yAxisLabel=[];this.legend=[];this.spaceX,this.spaceY};LineChart.prototype={setBrush:function(t,e,i){this.container=t;this.canvas=e;if(typeof G_vmlCanvasManager!='undefined')G_vmlCanvasManager.initElement(e);this.context=this.canvas.getContext('2d');this.container.style.position='relative';if(i==!0){this.drawResponsiveForm();this.canvas.style.width='100%';this.canvas.style.height='auto'}
else{this.drawForm()}},setStrokeColor:function(t){this.strokeColor=t},setLineThickness:function(t){this.lineThickness=t?t:this.lineThickness},setAxisLabel:function(t,e){this.xAxisLabel=t;this.yAxisLabel=e},setLegend:function(t){for(var e=0;e<arguments.length;e++)this.legend.push(arguments[e])},drawForm:function(){this.context.strokeStyle=this.strokeColor;var i=Math.floor(this.lineThickness/2);this.context.lineWidth=i;this.context.lineCap='square';this.context.beginPath();this.context.moveTo(this.startX,this.startY);this.context.lineTo(this.startX+i,this.startY+this.height-(i+2));this.context.lineTo(this.startX+i+this.width,this.startY+this.height-(i+2));var c=this.xAxisLabel.length,f=this.yAxisLabel.length;this.spaceX=this.width/c;this.spaceY=(this.height-10)/(f-1);var a=$(this.container).css('padding-left');a=Math.round(a.replace('px',''));for(var e=0;e<c;e++){var h=this.startX+(e+1)*this.spaceX;this.context.moveTo(h,this.startY+this.height-(i+1));this.context.lineTo(h,this.startY+this.height-12);var t=document.createElement('div');t.style.position='absolute';t.style.fontWeight='normal';t.innerHTML=this.xAxisLabel[e];this.container.appendChild(t);var n=a+this.startX+(e*this.spaceX)+(this.spaceX-t.offsetWidth)/2,o=this.startY+this.height+10;t.style.left=n+'px';t.style.top=o+'px'};for(var e=0;e<f;e++){if(e!=0){var d=this.height-(e*this.spaceY)+this.startY;this.context.moveTo(this.startX,d);this.context.lineTo(this.startX+this.width,d)};var t=document.createElement('div');t.style.position='absolute';t.innerHTML=this.yAxisLabel[e];this.container.appendChild(t);var n=a+this.startX-t.offsetWidth-10,o=10+e*this.spaceY-t.offsetHeight/2+this.startY;t.style.left=n+'px';t.style.top=o+'px'};this.context.stroke();this.context.closePath();var p=this.legend[0].startX,u=this.legend[0].startY,g=this.legend[0].spaceX,l=this.legend[0].width,m=this.legend[0].height;this.context.lineWidth=m;for(var e=1;e<this.legend.length;e++){var s=p+((e-1)*l)+((e-1)*g),r=u;this.context.beginPath();this.context.strokeStyle=this.legend[e].color;this.context.fillStyle=this.legend[e].color;this.context.moveTo(s,r);this.context.lineTo(s+l,r);this.context.stroke();this.context.closePath();var t=document.createElement('div');t.style.position='absolute';t.innerHTML=this.legend[e].name;this.container.appendChild(t);if(this.legend[e].point==!0)this.context.fillRect(s+(l-this.legend[0].pointWidth)/2,r-this.legend[0].pointHeight/2,this.legend[0].pointWidth,this.legend[0].pointHeight);var n=a+s+l+5,o=r-t.offsetHeight/2;t.style.left=n+'px';t.style.top=o+'px'}},drawResponsiveForm:function(){this.context.strokeStyle=this.strokeColor;var s=Math.floor(this.lineThickness/2);this.context.lineWidth=s;this.context.lineCap='square';this.context.beginPath();this.context.moveTo(this.startX,this.startY);this.context.lineTo(this.startX+s,this.startY+this.height-(s+2));this.context.lineTo(this.startX+s+this.width,this.startY+this.height-(s+2));var c=this.xAxisLabel.length,p=this.yAxisLabel.length;this.spaceX=this.width/c;this.spaceY=(this.height)/(p-1);var a=$(this.container).css('padding-left'),h=$(this.container).css('padding-right');a=Math.round(a.replace('px',''));h=Math.round(h.replace('px',''));var l=0,i=document.createElement('div');i.classList.add('x_label_con');i.style.position='absolute';i.style.width='calc(100% - '+(a+h)+'px)';i.style.marginLeft=a+'px';i.style.marginRight=h+'px';this.container.appendChild(i);for(var e=0;e<c;e++){var m=this.startX+(e)*this.spaceX;this.context.moveTo(m,this.startY+this.height-(s+1));this.context.lineTo(m,this.startY+this.height-12);var t=document.createElement('div');t.classList.add('x_label');t.style.position='absolute';t.style.fontWeight='normal';t.innerHTML=this.xAxisLabel[e];i.appendChild(t);if(l<t.offsetHeight)l=t.offsetHeight;var r=(e/(c)*100),d=this.startY+this.height+10;t.style.width='calc((100% / '+(c)+')';t.style.left=r+'%';t.style.top='0px'};i.style.height=l+'px';i.style.bottom=((l+5)*-1)+'px';i.style.left='0';for(var e=0;e<p;e++){if(e!=0){var g=this.height-(e*this.spaceY)+this.startY;this.context.moveTo(this.startX,g);this.context.lineTo(this.startX+this.width,g)};var t=document.createElement('div');t.classList.add('y_label');t.style.position='absolute';t.innerHTML=this.yAxisLabel[e];this.container.appendChild(t);var r=a+this.startX-t.offsetWidth-10,d=(e/(p-1)*100);t.style.left=r+'px';t.style.top=d+'%';t.style.transform='translateY(-50%)'};this.context.stroke();this.context.closePath();var y=this.legend[0].startX,w=this.legend[0].startY,T=this.legend[0].spaceX,f=this.legend[0].width,u=this.legend[0].height;this.context.lineWidth=u;var n=document.createElement('div');n.classList.add('legend_con');n.style.position='absolute';n.style.bottom=((l+30)*-1)+'px';n.style.left='0';n.style.width='100%';n.style.textAlign='center';this.container.appendChild(n);for(var e=1;e<this.legend.length;e++){var v=y+((e-1)*f)+((e-1)*T),b=w,o=document.createElement('div');o.classList.add('show');o.classList.add('vm');o.classList.add('legend_line');o.style.width=f+'px';o.style.height=u+'px';o.style.backgroundColor=this.legend[e].color;o.style.marginRight='10px';n.appendChild(o);var t=document.createElement('div');t.classList.add('show');t.classList.add('vm');t.classList.add('legend_name');if(e<this.legend.length-1)t.style.marginRight=this.legend[0].spaceX+'px';t.innerHTML=this.legend[e].name;n.appendChild(t);var r=a+v+f+5,d=b-t.offsetHeight/2;t.style.left=r+'px';t.style.top=d+'px'}},drawChart:function(t,e){this.context.strokeStyle=this.legend[e].color;this.context.fillStyle=this.legend[e].color;var s=this.lineThickness;this.context.lineWidth=this.lineThickness;this.context.lineCap='square';this.context.beginPath();var a=this.legend[e].point;for(var i=0;i<t.length;i++){var n=(this.startX+(i*this.spaceX))+this.spaceX/2,o=(this.height+this.startY)-((this.height-10)*(t[i]/this.yAxisLabel[0]));if(i==0)this.context.moveTo(n,o);else this.context.lineTo(n,o-(s));if(a)this.context.fillRect(n-this.legend[0].pointWidth/2,o-this.legend[0].pointHeight/2,this.legend[0].pointWidth,this.legend[0].pointHeight)};this.context.stroke()}};RadarChart=function(t,e,i,n){this.container,this.canvas,this.context;this.centerX=t,this.centerY=e;this.formColor='#c5c5c5',this.formThickness=1,this.chartThickness=3;this.radius=i,this.step=n,this.stepSpace=this.radius/this.step,this.radarLabelSpace;this.radarLabelList=[],this.stepLabelList=[];this.legendConfig={},this.legendInfoList=[],this.legendList=[];this.isStepLabel=!0;this.stepGap=20};RadarChart.prototype={setBrush:function(t,e,i){this.container=t;this.canvas=e;this.chartThickness=i;if(typeof G_vmlCanvasManager!='undefined')G_vmlCanvasManager.initElement(e);this.context=this.canvas.getContext('2d')},setFormColor:function(t){this.formColor=t},setLabel:function(t,e,i,n){this.radarLabelList=t;this.stepLabelList=e;this.radarLabelSpace=360/this.radarLabelList.length;this.stepGap=n;this.isStepLabel=i},setLegend:function(t){this.legendConfig=t},setLegendInfo:function(t){this.legendInfoList=t},setForm:function(){this.drawForm();this.drawLegend();this.drawLabel()},drawForm:function(){this.context.strokeStyle=this.formColor;this.context.lineWidth=this.formThickness;this.context.beginPath();for(var t=0;t<this.step;t++){this.context.moveTo(this.centerX+this.radius-(this.stepSpace*t),this.centerY);this.context.arc(this.centerX,this.centerY,this.radius-(this.stepSpace*t),0,(Math.PI/180*360),!1)};var n=this.radarLabelList.length;for(var t=0;t<n;t++){this.context.moveTo(this.centerX,this.centerY);var e=this.radius*Math.cos(Math.PI/180*(t*this.radarLabelSpace))+this.centerX,i=this.radius*Math.sin(Math.PI/180*(t*this.radarLabelSpace))+this.centerY;this.context.lineTo(e,i)};this.context.stroke()},drawLegend:function(){var n=0,o=0,a=this.legendInfoList.length;for(var e=0;e<a;e++){var t=bm.html(this.legendConfig.isCheck?'<div><div class=\'legendRect\' style=\'margin-right: 5px;\'></div><label style=\'cursor: pointer;\'>'+this.legendInfoList[e].name+' <input type=\'checkbox\' checked=\'true\'/></label></div>':'<div><div class=\'legendRect\' style=\'margin-right: 5px;\'></div>'+this.legendInfoList[e].name+'</div>');t.style.position='absolute',t.style.fontSize=this.legendConfig.fontSize;var i=$(t).find('.legendRect')[0];i.style.float='left',i.style.width=this.legendConfig.width+'px',i.style.height=this.legendConfig.height+'px';i.style.background=this.legendInfoList[e].color;if(this.legendConfig.isDisplay)this.container.appendChild(t);i.style.marginTop=(t.clientHeight-this.legendConfig.height)/2+'px';t.style.left=this.legendConfig.startX+'px';if(e==0)t.style.top=this.legendConfig.startY+'px';else t.style.top=n+this.legendConfig.spaceY+'px';n=parseInt(t.style.top)+t.clientHeight;o=Math.max(t.clientWidth,o);this.legendList.push(t)}},drawLabel:function(){var o=this.radarLabelList.length;for(var e=0;e<o;e++){var t=document.createElement('div');t.style.width='90px';t.style.textAlign='center';t.style.position='absolute';t.style.fontSize='15px';t.innerText=this.radarLabelList[e];this.container.appendChild(t);var n=(this.radius+45)*Math.cos(Math.PI/180*(e*this.radarLabelSpace))+this.centerX;t.style.left=n>this.centerX?t.style.left=(n-t.offsetWidth/2)+'px':t.style.left=(n-t.offsetWidth/2)+'px';var i=(this.radius+20)*Math.sin(Math.PI/180*(e*this.radarLabelSpace))+this.centerY;t.style.top=i>=this.centerY?(i-t.offsetHeight/2)+'px':(i-t.offsetHeight/2)+'px'};if(this.isStepLabel){o=this.stepLabelList.length;for(var e=0;e<o;e++){var t=document.createElement('div');t.innerText=this.stepLabelList[e];t.style.position='absolute';t.style.fontSize='13px';t.style.fontWeight='bold';this.container.appendChild(t);t.style.left=(this.centerX-t.clientWidth/2)+'px';t.style.top=(this.centerY-(e*this.stepSpace)-t.clientHeight/2)+'px'}}},createChart:function(t){var s=this.legendList.length,o=t.length;for(var i=0;i<s;i++){var a=this.legendList[i];if(this.legendConfig.isCheck){if($(a).find('input')[0].checked){var n=[];for(var e=0;e<o;e++){if(t[e][this.legendInfoList[i].data]!=0&&t[e][this.legendInfoList[i].data]!=undefined)n.push(t[e][this.legendInfoList[i].data])};this.drawChart(n,this.legendInfoList[i].color,this.chartThickness)}}
else{var n=[];for(var e=0;e<o;e++){if(t[e][this.legendInfoList[i].data]!=0&&t[e][this.legendInfoList[i].data]!=undefined)n.push(t[e][this.legendInfoList[i].data])};this.drawChart(n,this.legendInfoList[i].color,this.chartThickness)}}},drawChart:function(t,e,i){this.context.strokeStyle=e;this.context.lineWidth=i;this.context.lineCap='square';this.context.beginPath();var a=t[0]/this.stepGap,s=this.radius*(a/this.step)*Math.cos(Math.PI/180)+this.centerX,r=this.radius*(a/this.step)*Math.sin(Math.PI/180)+this.centerY;this.context.moveTo(s,r);var h=t.length;for(var n=1;n<h;n++){var o=t[n]/this.stepGap,l=this.radius*(o/this.step)*Math.cos(Math.PI/180*(n*this.radarLabelSpace))+this.centerX,d=this.radius*(o/this.step)*Math.sin(Math.PI/180*(n*this.radarLabelSpace))+this.centerY;this.context.lineTo(l,d)};this.context.lineTo(s,r);this.context.stroke();this.context.closePath()},clearChart:function(){this.context.clearRect(0,0,760,500)}};bm.shoplist={PrevNaviTempl:function(t,e,i){return'<div class="col-0 swiper-button-prev '+i+'" data-wv-res-id="___B1675042677299450___-1___1675042676969___" data-wv-layout-element="block" data-wv-layout-element-restricted '+e+'><div data-wv-layout-element="block_inner"><div class="col-0 swiper-button-prev-svg '+i+'" data-wv-layout-element="block" data-wv-res-id="______basic_layout_000___0___1675058971303___" data-wv-layout-element-type="svg" data-wv-layout-element-restricted><div data-wv-layout-element="block_inner" class="wveditor_svg">'+t+'</div><div data-wv-layout-element="block_selection"></div></div></div><div data-wv-layout-element="block_selection"></div></div>'},NextNaviTempl:function(t,e,i){return'<div class="col-0 swiper-button-next '+i+'" data-wv-res-id="___B1675043276171458___-1___1675043276585___" data-wv-layout-element="block" data-wv-layout-element-restricted '+e+'><div data-wv-layout-element="block_inner"><div class="col-0 swiper-button-next-svg '+i+'" data-wv-layout-element="block" data-wv-res-id="______basic_layout_000___0___1666250282873___0" data-wv-layout-element-type="svg" data-wv-layout-element-restricted><div data-wv-layout-element="block_inner" class="wveditor_svg">'+t+'</div><div data-wv-layout-element="block_selection"></div></div></div><div data-wv-layout-element="block_selection"></div></div>'},PaginationTempl:function(t){return'<div class="col-0 swiper-pagination-container" data-wv-res-id="___B1675045495385275___-1___1675045495537___" data-wv-layout-element="block" data-wv-layout-element-restricted '+t+'><div data-wv-layout-element="block_inner"><div class="swiper-pagination" data-wv-res-id="___0___1675058877477___"></div></div><div data-wv-layout-element="block_selection"></div></div>'},PrevNaviNode:function(t){const _this=bm['shoplist'];let prevSvg;if(t==='center'){prevSvg=_this['prevCenterNaviSvg'];return _this.PrevNaviTempl(prevSvg,_this['svgPaddingStyleString'],'center')}
else{prevSvg=_this['prevBottomNaviSvg'];return _this.PrevNaviTempl(prevSvg,'','bottom')}},NextNaviNode:function(t){const _this=bm['shoplist'];let nextSvg;if(t==='center'){nextSvg=_this['nextCenterNaviSvg'];return _this.NextNaviTempl(nextSvg,_this['svgPaddingStyleString'],'center')}
else{nextSvg=_this['nextBottomNaviSvg'];return _this.NextNaviTempl(nextSvg,'','bottom')}},ControlTempl:function(t,e){return'<div id="paging_'+t+'_slide" class="col-0 swiper-control" data-wv-layout-element="block" data-wv-layout-element-restricted '+e+'><div data-wv-layout-element="block_inner"></div><div data-wv-layout-element="block_selection"></div></div>'},ControlNode:function(t,e){const _this=bm['shoplist'];let controlNode;if(e==='center'){controlNode=$(_this.ControlTempl(t,_this['centerStyleString']))}
else{controlNode=$(_this.ControlTempl(t,''))};if(e==='center'){controlNode.children('[data-wv-layout-element="block_inner"]').append(_this.PrevNaviNode('center'));controlNode.children('[data-wv-layout-element="block_inner"]').append(_this.NextNaviNode('center'));controlNode.children('[data-wv-layout-element="block_inner"]').append(_this.PaginationTempl('style="pointer-events: none; visibility: hidden;"'))}
else{controlNode.children('[data-wv-layout-element="block_inner"]').append(_this.PrevNaviNode('bottom'));controlNode.children('[data-wv-layout-element="block_inner"]').append(_this.NextNaviNode('bottom'));controlNode.children('[data-wv-layout-element="block_inner"]').append(_this.PaginationTempl(''))};return controlNode},centerStyleString:'style="position: absolute; top: 36%; transform: translateY(-36%); left: 0%; width: 100%;"',svgPaddingStyleString:'style="padding: 20px"',prevBottomNaviSvg:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="레이어_1" x="0px" y="0px" viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve"><path d="M24.3,28.8L15.5,20l8.9-8.9l1,1L17.5,20l7.8,7.8C25.4,27.8,24.3,28.8,24.3,28.8z"/></path></svg>',nextBottomNaviSvg:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="레이어_1" x="0px" y="0px" viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve"><path d="M17.7,28.8l-1-1l7.8-7.8l-7.8-7.9l1-1l8.9,8.9C26.5,20,17.7,28.8,17.7,28.8z"/></path></svg>',prevCenterNaviSvg:'<svg style="fill: #fff; width: 8px; height: 14px; padding: 13px 17px 13px 15px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 7.7 13.3" style="enable-background:new 0 0 7.7 13.3;" xml:space="preserve"><path d="M6.8-0.1C7-0.1,7.3,0,7.4,0.2c0.3,0.4,0.3,0.9,0,1.3L2.2,6.6l5.2,5.1c0.4,0.3,0.4,0.9,0,1.3c-0.3,0.4-0.9,0.4-1.3,0L0.3,7.2  C0.1,7,0,6.8,0,6.6s0.1-0.5,0.3-0.7l5.9-5.8C6.3,0,6.6-0.1,6.8-0.1z"></path></svg>',nextCenterNaviSvg:'<svg style="fill: #fff; width: 8px; height: 14px; padding: 13px 15px 13px 17px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 7.7 13.3" style="enable-background:new 0 0 7.7 13.3;" xml:space="preserve"><path d="M0.9,13.3c-0.2,0-0.5-0.1-0.6-0.3c-0.3-0.4-0.3-0.9,0-1.3l5.2-5.1L0.3,1.5c-0.4-0.3-0.4-0.9,0-1.3c0.3-0.4,0.9-0.4,1.3,0  L7.4,6c0.2,0.2,0.3,0.4,0.3,0.6S7.6,7.1,7.4,7.3l-5.9,5.8C1.4,13.2,1.1,13.3,0.9,13.3z"></path></svg>',applySwiper:function(t,e,i,n){}};bm.dimTmplt={init:function(){this.dimWidth=0;this.dimHeight=0;this.registEvent();this.onLoadHandler();const bgImgBlock=$(this.block).closest('[data-wv-layout-element=block]')[0];if(bgImgBlock){const blockRect=bgImgBlock.getBoundingClientRect();this.setDimFullSize(blockRect.width,blockRect.height)}},registEvent:function(){},onLoadHandler:function(){const _this=this;if(_this.block){_this.observer=new ResizeObserver(function(t,e){const width=t[0].borderBoxSize[0].inlineSize;const height=t[0].borderBoxSize[0].blockSize;if(width!==_this.dimWidth||height!==_this.dimHeight){_this.setDimFullSize(width,height)};_this.dimWidth=width;_this.dimHeight=height});_this.observer.observe($(_this.block).closest('[data-wv-layout-element=block]')[0])}},setDimFullSize:function(t,e){const block=this.block;const bgImgBlock=$(this.block).closest('[data-wv-layout-element=block]')[0];let css={};$(block).width(t);$(block).height(e);const paddingTop=parseInt(bm.getStyle(bgImgBlock,'padding-top'));const paddingLeft=parseInt(bm.getStyle(bgImgBlock,'padding-left'));if(paddingTop!==0&&app.isEditMode){css['top']=paddingTop*-1+'px'}
else{css['top']=0};if(paddingLeft!==0&&app.isEditMode){css['left']=paddingLeft*-1+'px'}
else{css['left']=0};$(block).css(css)},removeEvent:function(){},destroy:function(){if(this.observer)this.observer.disconnect();this.dimWidth=0;this.dimHeight=0;this.removeEvent()}};bm.interaction={registVisibleToggle:function(t,e){$(t).on('click',function(){if($(e).is(':visible')){$(e).hide();events(e).dispatch('hide')}
else{$(e).show();events(e).dispatch('show')}})},registVisibleToggleCheckbox:function(t,e,i,n){if(i){if(n){if($(t).is(':checked')==!1){$(e).show()}
else{$(e).hide()}}
else{if($(t).is(':checked')){$(e).show()}
else{$(e).hide()}}};$(t).on('click',function(){if($(e).is(':visible')){$(e).hide();events(e).dispatch('hide')}
else{$(e).show();events(e).dispatch('show')}})},registDraggable:function(t){var e,i;mouseAdapter(t).onDown(function(n){e=n.clientX;i=n.clientY;var o=parseInt(bm.getStyle(t,'left'))||0,a=parseInt(bm.getStyle(t,'top'))||0;t.x=o;t.y=a});mouseAdapter(t).onDrag(function(n){t.x=t.x+(n.clientX-e);t.y=t.y+(n.clientY-i);$(t).css({left:t.x,top:t.y});e=n.clientX;i=n.clientY})}};bm.effect=function(t,e,i){this.type=t[e]['type'];this.$select=this.getTargetDiv(t['id']);this.init(t,e,this.$select,i)};bm.effect.prototype={init:function(t,e,i,n){this.registEvent();this.setEffectList(t,e,i,n)},setEffectList:function(t,e,i,n){var o=(window.name==='WEVEN_IFRAME')?window.parent:window;if(!o['effectList']){o['effectList']={}};o['effectList'][e]={attr:t,triggerNode:i,lineNode:n}},registEvent:function(){this.addEvent()},addEvent:function(){var t=this;switch(this.type){case'hover':this.$select.off('mouseenter').on('mouseenter',t.handleHoverStyle);this.$select.off('mouseleave').on('mouseleave',t.handleHoverStyle);break;case'click':this.$select.off('mousedown').on('mousedown',t.handleClickStyle);break}},removeEvent:function(){var t=bm.effect.prototype;this.$select.off('mouseenter',t.handleHoverStyle);this.$select.off('mouseleave',t.handleHoverStyle);this.$select.off('mousedown',t.handleClickStyle)},handleHoverStyle:function(t){if($(this).hasClass('wvelLayoutViewBorderPadding'))return;var e=bm.effect.prototype;let attr=JSON.parse($(this).attr('data-wv-effect'));for(let i=0;i<attr['setIdArr'].length;i++){let setId=attr['setIdArr'][i];if(attr['set'+setId]['type']=='hover'){let id=attr['id'];let elementArr=attr['set'+setId]['elementArr'];let type=attr['set'+setId]['type'];let action=(t.type=='mouseenter')?'add':'remove';for(let j=0;j<elementArr.length;j++){e.setElementAttribute(id,elementArr,j,type,action)}}}},handleClickStyle:function(t){if($(this).hasClass('wvelLayoutViewBorderPadding'))return;var n=bm.effect.prototype;let attr=JSON.parse($(this).attr('data-wv-effect'));for(let i=0;i<attr['setIdArr'].length;i++){let setId=attr['setIdArr'][i];if(attr['set'+setId]['type']=='click'){let id=attr['id'];let elementArr=attr['set'+setId]['elementArr'];let type=attr['set'+setId]['type'];for(var e=0;e<elementArr.length;e++){let element=n.getTargetDiv(elementArr[e]);if(element[0].hasAttribute('select-'+type)||element[0].hasAttribute('element-'+type)){n.setElementAttribute(id,elementArr,e,type,'remove')}
else{n.setElementAttribute(id,elementArr,e,type,'add')}}}}},setElementAttribute:function(t,e,i,n,o){let str=(t==e[i])?'select-':'element-';switch(o){case'add':bm.effect.prototype.getTargetDiv(e[i]).attr(str+n,'');break;case'remove':bm.effect.prototype.getTargetDiv(e[i]).removeAttr(str+n);break}},getTargetDiv:function(t){let selector;if($('#WEVEN_IFRAME')['length']>0){selector=window.wvAdminIFrameBridge._WVContentArea.$content.find('[data-wv-effect]')}
else{selector=$('[data-wv-effect]')};selector.each(function(){try{let attr=JSON.parse($(this).attr('data-wv-effect'));if(attr.id===t){targetDiv=$(this);return!1}}catch(e){}});return targetDiv}};bm.Rolling=function(){};bm.rolling=function(t){var r=[],c=[],f=[],v=function(t){},d=bm.enterFPS,a=$(t).find('[effect]'),n,i,e;if(a&&a.length>0){n=a.length;for(i=0;i<n;i++){e=bm.parsing.parseStrToObj($(a[i]).attr('effect'));if(!e['mode'])e.mode='fadeOut';e.intervalCnt=e.intervalCnt==undefined?0:Math.floor(parseFloat(e.intervalCnt)*d);e.target=e.selector?$(a[i]).find(e.selector)[0]:a[i];e.intervalIn=Math.floor(parseFloat(e.intervalIn?e.intervalIn:0)*d);e.intervalOut=Math.floor(parseFloat(e.intervalOut?e.intervalOut:0)*d);c.push(e);v(a[i])}};var s=$(t).find('[scrollFollow]');if(s&&s.length>0){n=s.length;for(i=0;i<n;i++){e=parseStrToObj($(s[i]).attr('scrollFollow'));e.target=s[i];e.duration=e.duration?parseFloat(e.duration):1;e.top=s[i].offsetTop;f.push(e)}};var o=$(t).find('[data-wv-ux-rolling]');o.css('position','absolute');var w,T;if(o&&o.length>0){n=o.length;for(i=0;i<n;i++){e=bm.parsing.parseStrToObj($(o[i]).attr('data-wv-ux-rolling'));e.con=o[i];e.childSelector=e.childSelector?e.childSelector:'li';e.list=$(o[i]).find(e.childSelector);e.pos=[];e.targetPos=[];if(e.list.length<2)continue;(function(t){t.direction=t.direction?t.direction:'left';t.interval=Math.floor(parseFloat(t.interval?t.interval:0)*d);t.duration=parseFloat(t.duration?t.duration:0);t.ease=t.ease?t.ease:Cubic.easeInOut;t.unlimit=t.unlimit=='true'?!0:!1;t.auto=t.auto=='true'?!0:!1;t.mouseResponceOff=t.mouseResponceOff=='false'?!1:!0;t.mouseResponceOffTarget=t.mouseResponceOffTarget==undefined?$(t.con):(t.mouseResponceOffTarget=='this'?$(t.con):$(t.mouseResponceOffTarget));t.mouseHover=!1;t.viewNum=t.viewNum==undefined?1:parseInt(t.viewNum);t.index=t.preIndex=0;t.loadLen=t.list.find('img').length;t.loaded=0;t.intervalCnt=0;if(t.indexBtnSelector){$(t.indexBtnSelector).on('click',function(){t.preIndex=t.index;t.index=$(t.indexBtnSelector).index(this);if(t.index>t.preIndex){t.direction='left'}
else{t.direction='right'};l(t);t.intervalCnt=0})};function e(){var e=t.list.find('img').index(this),a=t.list[e],n=0,o=t.con.offsetHeight/((t.direction=='top'||t.direction=='bottom')?t.viewNum:1)-a.offsetHeight>>1;t.pos[e]={left:n,top:o};if(t.targetPos[e]){n+=t.targetPos[e].left;o+=t.targetPos[e].top};$(a).css('left',n).css('top',o);t.loaded++;if(t.loaded==t.loadLen){i(t)}};t.list.css('position','absolute');if(t.loadLen==t.list.length){t.list.find('img').each(function(){if(this.offsetWidth&&this.offsetHeight){e.apply(this)}
else{this.onload=function(){e.apply(this)}}})};if(t.mouseResponceOff){t.mouseResponceOffTarget.hover(function(){t.mouseHover=!0},function(){t.mouseHover=!1})};if(t.keyNext){$(t.keyNext).css('cursor','pointer').on('click',function(e){g(t)})};if(t.keyPrev){$(t.keyPrev).css('cursor','pointer').on('click',function(e){u(t)})};if(t.keyPause){$(t.keyPause).css('cursor','pointer').on('click',function(e){t.auto=!1;$(t.keyPause).hide();$(t.keyPlay).show()})};if(t.keyPlay){$(t.keyPlay).css('cursor','pointer').on('click',function(e){t.auto=!0;$(t.keyPause).show();$(t.keyPlay).hide()})};i(t);function i(t){var o=t.list.length,i,n,a=$(t.con).width();for(var e=0;e<o;e++){if(t.direction=='left'||t.direction=='right'){i=a/t.viewNum*(e-t.index)+(t.pos[e]?t.pos[e].left:0);n=(t.pos[e]?t.pos[e].top:0)}
else if(t.direction=='top'||t.direction=='bottom'){i=(t.pos[e]?t.pos[e].left:0);n=t.con.offsetHeight/t.viewNum*(e-t.index)+(t.pos[e]?t.pos[e].top:0)};t.targetPos[e]={left:i,top:n};t.list[e].style.left=t.targetPos[e].left+'px';t.list[e].style.top=t.targetPos[e].top+'px'}}})(e);r.push(e)}};if((a&&a.length>0)||(o&&o.length>0)){bm.onEnterRegist(b)};$(window).scroll(function(){var i=$(window).scrollTop(),n=f.length,t;for(var e=0;e<n;e++){t=f[e];TweenMax.killTweensOf(t.target);TweenMax.to(t.target,t.duration,{top:t.top+i,ease:Cubic.easeOut})}});function b(){var e=c.length,t;while(e--){t=c[e];t.intervalCnt++;if(t.mode=='fadeIn'&&t.intervalOut<t.intervalCnt)p(t);else if(t.mode=='fadeOut'&&t.intervalIn<t.intervalCnt)p(t)};e=r.length;while(e--){t=r[e];if(t.mouseResponceOff&&t.mouseHover)continue;if(t.auto){t.intervalCnt++;if(t.interval<t.intervalCnt){if(t.direction=='left')g(t);else if(t.direction=='right')u(t)}}}};function p(t){if(t.mode=='fadeIn'&&!t.fadeIn)return;if(t.mode=='fadeOut'&&!t.fadeOut)return;TweenMax.to(t.target,t.duration,t.mode=='fadeIn'?t.fadeIn:t.fadeOut);t.mode=t.mode=='fadeIn'?'fadeOut':'fadeIn';t.intervalCnt=0};function u(t){if(t.intervalCnt<bm.enterFPS/2)return;t.direction='right';t.preIndex=t.index;t.intervalCnt=0;t.index--;if(t.index==-1){if(t.unlimit){t.index=t.list.length-1;l(t)}
else{t.index=0}}
else{l(t)}};function g(t){if(t.intervalCnt<bm.enterFPS/2)return;t.direction='left';t.preIndex=t.index;t.intervalCnt=0;t.index++;if(t.index==t.list.length){if(t.unlimit){t.index=0;l(t)}
else{t.index=t.list.length-1}}
else{l(t)}};function l(t){function e(e){if(e>t.list.length-1)e=e-t.list.length;else if(e<0)e=t.list.length+e;return e};if(t.direction=='left'||t.direction=='top'){n=t.viewNum+1;h(t,t.preIndex);idx=t.index-1;while(n--){h(t,e(idx++))};m(idx-1,t)}
else if(t.direction=='right'||t.direction=='bottom'){n=t.viewNum+1;h(t,t.preIndex);idx=t.index;while(n--){h(t,e(idx++))};m(idx-2,t)}};function m(t,e){var i=$(e.indexBtnSelector);i.each(function(){var n=i.index(this);if(n==t){if(e.indexBtnActiveClass){$(this).addClass(e.indexBtnActiveClass)}
else{$(this).find('img').attr('src',$(this).find('img').attr('src').replace('_off','_on'))}}
else{if(e.indexBtnActiveClass){$(this).removeClass(e.indexBtnActiveClass)}
else{$(this).find('img').attr('src',$(this).find('img').attr('src').replace('_on','_off'))}}})};function h(t,e){var n,o,i=e-t.index;if(e-t.index<0){i+=t.list.length};var a=$(t.con).width(),s=$(t.con).height();switch(t.direction){case'left':n=-a/t.viewNum+(t.pos[e]?t.pos[e].left:0);o=(t.pos[e]?t.pos[e].top:0);break;case'right':n=a/t.viewNum+(t.pos[e]?t.pos[e].left:0);o=(t.pos[e]?t.pos[e].top:0);break;case'top':n=(t.pos[e]?t.pos[e].left:0);o=-s/t.viewNum+(t.pos[e]?t.pos[e].top:0);break;case'bottom':n=(t.pos[e]?t.pos[e].left:0);o=s/t.viewNum+(t.pos[e]?t.pos[e].top:0);break};if(e==t.index){switch(t.direction){case'left':t.list[e].style.left=a/t.viewNum*(i+1)+(t.pos[e]?t.pos[e].left:0)+'px';t.list[e].style.top=(t.pos[e]?t.pos[e].top:0)+'px';break;case'right':t.list[e].style.left=a/t.viewNum*(i-1)+(t.pos[e]?t.pos[e].left:0)+'px';t.list[e].style.top=(t.pos[e]?t.pos[e].top:0)+'px';break;case'top':t.list[e].style.left=(t.pos[e]?t.pos[e].left:0)+'px';t.list[e].style.top=s/t.viewNum*(i+1)+(t.pos[e]?t.pos[e].top:0)+'px';break;case'bottom':t.list[e].style.left=(t.pos[e]?t.pos[e].left:0)+'px';t.list[e].style.top=s/t.viewNum*(i-1)+(t.pos[e]?t.pos[e].top:0)+'px';break};n=((t.direction=='left'||t.direction=='right')?a/t.viewNum*i:0)+(t.pos[e]?t.pos[e].left:0);o=((t.direction=='top'||t.direction=='bottom')?s/t.viewNum*i:0)+(t.pos[e]?t.pos[e].top:0)};t.targetPos[e]={left:n,top:o};TweenMax.to(t.list[e],t.duration,{left:t.targetPos[e].left,top:t.targetPos[e].top,ease:t.ease})};function y(t){for(var o in r){var e=r[o];if(e){for(var n in e.list){if(isNaN(n))continue;if(e.index!=n){var i=e.list[n];if(TweenMax.isTweening(i)==!1){i.style.left='-99999px';i.style.top='-99999px'}}}}}};$(window).on('resize',y)};bm.wvSelectBox=function(t){this.idGenerator=++bm.wvSelectBox.prototype.__id__;this.selectTarget=t?t:null;this.tempSelect=null;this.originSelect=null;this.optionList=null;var e=this};bm.wvSelectBox.EVENT_CHANGE='change';bm.wvSelectBox.prototype={__id__:0,init:function(){var t=this;this.tempSelect=$('<ul class=\'wv-select\'></ul>');$(this.selectTarget).attr('data-selectTarget-id',this.idGenerator);$(this.selectTarget).parent().prepend(this.tempSelect);this.originSelect=$(this.selectTarget);this.originSelect.on('change',function(){events(t).dispatch(bm.wvSelectBox.EVENT_CHANGE,{target:t,value:$(this).val()})});this.createOptionLIst();if(this.selectTarget){$(this.selectTarget).hide()}},setIndex:function(t){},setIndexAtValue:function(t){var e=t;this.setIndex(e)},createOptionLIst:function(){if(!this.selectTarget)return;var t=this;if(this.tempSelect.length>0)this.tempSelect.empty();$(this.selectTarget).find('option').each(function(e,i){if(this.attributes[0].specified){var n=t.createOption(this.attributes[0].value,$(this).text());t.tempSelect.append(n);if(e==0){t.tempSelect.append(n)}};if($(t.selectTarget).find('option').length-1==e){t.optionList=t.tempSelect.find('li');t.addEvent()}})},createOption:function(t,e){return'<li data-wv-selectVal="'+t+'">'+e+'</li>'},addEvent:function(){var t=this;$(this.optionList).off('click mouseenter mouseleave');$(this.optionList).parent().off('mouseleave');$(this.optionList).on('mouseenter',function(){$(t.optionList).addClass('selected')});$(this.optionList).parent().on('mouseleave',function(){$(t.optionList).removeClass('selected')});$(this.optionList).on('click',function(){t.originSelect.val($(this).text()).change();$(t.optionList).removeClass('selected');t.tempSelect.find('li:first-child').remove();t.tempSelect.prepend($(this).clone());t.optionList=t.tempSelect.find('li');t.addEvent()})}};bm.Carousel=function(t){var e=$(t.listSelector);if(e.length<2){$(t.prevBtnSelector).hide();$(t.nextBtnSelector).hide();return};t.selectedIndex=t.selectedIndex?t.selectedIndex:0;t.moveStatus='ready';function f(){t.conWidth=$(t.containerSelector).width()};f();$(window).on('resize',f);e.each(function(){var i=e.index(this);$(this).on('dragstart',function(t){t.preventDefault()});if(i==t.selectedIndex){t.activeLeft=parseInt($(this).css('left'))||0}
else if(i>t.selectedIndex){$(e[i]).css('left',t.conWidth+t.activeLeft)}
else if(i<t.selectedIndex){$(e[i]).css('left',-t.conWidth)};if(i>=2){$(e[i]).css('left',-(t.conWidth+t.activeLeft))};if(typeof $(t.btnImgSelector)[0]!=='undefined'){var n=$(t.btnImgSelector)[0].tagName.toLowerCase();if(n=='img'){if(i==t.selectedIndex)$(t.btnImgSelector)[i].src=t.btnOnSrc;else $(t.btnImgSelector)[i].src=t.btnOffSrc}
else{if(i==t.selectedIndex)$($(t.btnImgSelector)[i]).addClass(t.btnImgSelectorActiveClass);else $($(t.btnImgSelector)[i]).removeClass(t.btnImgSelectorActiveClass)}}});t.currList=e[t.selectedIndex];t.nextList=u();if(t.prevList)$(t.prevList).css('left',-(t.conWidth+t.activeLeft));t.nextList=p();if(t.nextList)$(t.nextList).css('left',t.conWidth+t.activeLeft);t.con=$(t.containerSelector)[0];t.preventMouseDown=!0;t.direction='next'||t.direction;var i={x:0,y:0,direction:'',status:'ready'};s();if(t.auto){t.autoTime=5||t.autoTime};var r=!1;$(t.prevBtnSelector).on('mousedown',function(){r=!0});$(t.nextBtnSelector).on('mousedown',function(){r=!0});$(t.prevBtnSelector).on('click',function(){if(t.moveStatus!='ready')return;h()});$(t.nextBtnSelector).on('click',function(){if(t.moveStatus!='ready')return;d()});var n=[],a=[],l=3,o=0,w=0,c=0,T=this;this.eventRegistration=function(e){if(e){mouseAdapter(t.con).onDown(m);mouseAdapter(t.con).onDrag(v,b)}
else{mouseAdapter(t.con).offDown();mouseAdapter(t.con).offDrag()}};this.eventRegistration(!0);function g(){if(t.direction=='next')d();else h()};function m(e){if(t.auto)clearInterval(t.timer);if(t.prevPage)TweenMax.killTweensOf(t.prevPage);if(t.nextPage)TweenMax.killTweensOf(t.nextPage);if(t.currPage)TweenMax.killTweensOf(t.currPage);i.x=i.y=0;i.direction='';var o=l;while(o--){n[o]=e.clientX;a[o]=e.clientY}};function v(e){if(i.direction==''){i.x+=e.clientX-n[0];i.y+=e.clientY-a[0];if(Math.abs(i.x)>Math.abs(i.y)){i.direction='horizontal'};if(Math.abs(i.x)>10){i.direction='horizontal';if(t.preventMouseDown)(e.preventDefault)?e.preventDefault():(e.returnValue=!1)}
else if(Math.abs(i.y)>20){i.direction='vertical';return}}
else if(i.direction=='horizontal'){if(t.preventMouseDown)(e.preventDefault)?e.preventDefault():(e.returnValue=!1)}
else if(i.direction=='vertical'){return};o=e.clientX-n[0];if(t.prevList)$(t.prevList).css('left',parseInt($(t.prevList).css('left'))+o);if(t.nextList)$(t.nextList).css('left',parseInt($(t.nextList).css('left'))+o);$(t.currList).css('left',parseInt($(t.currList).css('left'))+o);var s=l;while(s--){n[s]=n[s-1];a[s]=a[s-1]};n[0]=e.clientX;a[0]=e.clientY};function b(e){if(r){r=!1;return};if(t.moveStatus!='ready')return;if(i.direction=='vertical'){return};o=n[0]-n[l-1];c=Math.abs(o);if(o!=0&&(c>10||t.currList.offsetLeft<-t.currList.offsetWidth/2||t.currList.offsetLeft>t.currList.offsetWidth/2)){if(o>0)h();else d()}
else{t.direction='none';s()}};function d(){t.direction='next';++t.selectedIndex;if(e.length==2&&t.selectedIndex>e.length-1)t.selectedIndex=e.length-1;else if(e.length>2&&t.selectedIndex>e.length-1)t.selectedIndex=0;s()};function h(){t.direction='prev';--t.selectedIndex;if(e.length==2&&t.selectedIndex<0)t.selectedIndex=0;else if(e.length>2&&t.selectedIndex<0)t.selectedIndex=e.length-1;s()};function s(){if(t.auto)clearInterval(t.timer);t.moveStatus='moving';t.prevList=u();t.nextList=p();t.currList=e[t.selectedIndex];if(t.pageWrapperSelector){$(t.containerSelector).css('height',$(t.currPage).height()+'px');$(t.pageWrapperSelector).css('width',$(t.currPage).width()+'px');$(t.pageWrapperSelector).css('height',$(t.currPage).height()+'px')};var i=0.5;if(t.direction=='next'){if(t.nextList)$(t.nextList).css('left',parseInt($(t.currList).css('left'))+(t.conWidth+t.activeLeft))}
else if(t.direction=='prev'){if(t.prevList)$(t.prevList).css('left',parseInt($(t.currList).css('left'))-(t.conWidth+t.activeLeft))};if(t.prevList)TweenMax.to(t.prevList,i,{left:-parseInt((t.conWidth+t.activeLeft)),ease:Cubic.easeOut});if(t.nextList)TweenMax.to(t.nextList,i,{left:parseInt(t.conWidth+t.activeLeft),ease:Cubic.easeOut});TweenMax.to(t.currList,i,{left:t.activeLeft,onComplete:y,ease:Cubic.easeOut})};function y(){if(typeof $(t.btnImgSelector)[0]!=='undefined'){var o=e.length;for(var i=0;i<o;i++){var n=$(t.btnImgSelector)[0].tagName.toLowerCase();if(n=='img'){if(i==t.selectedIndex)$(t.btnImgSelector)[i].src=t.btnOnSrc;else $(t.btnImgSelector)[i].src=t.btnOffSrc}
else{if(i==t.selectedIndex)$($(t.btnImgSelector)[i]).addClass(t.btnImgSelectorActiveClass);else $($(t.btnImgSelector)[i]).removeClass(t.btnImgSelectorActiveClass)}}};t.moveStatus='ready';if(t.auto)t.timer=setInterval(g,(t.autoTime)*1000)};function p(){if(e.length==2&&t.selectedIndex==1)return null;return t.selectedIndex+1==e.length?e[0]:e[t.selectedIndex+1]};function u(){if(e.length==2&&t.selectedIndex==0)return null;return t.selectedIndex==0?e[e.length-1]:e[t.selectedIndex-1]};t.listControl=s};bm.swiper={list:[],isInit:!1,swiperBySelector:{},swiperOptionList:{},controllableList:[],autoplayList:[],crawling:function(){this.innerWindow=window;if($('#WEVEN_IFRAME').length>0){this.innerWindow=$('#WEVEN_IFRAME')[0].contentWindow};app.additionalCrawling($(this.innerWindow)[0].document.body,'swiper')},init:function(){this.isInit=!0;for(var i=0;i<this.list.length;i++){var t=this.list[i];if(t.completeStatus===!1){t.init(t.el[0]);if(t.originalParams.pagination&&t.originalParams.pagination.type===this.swiperType.CUSTOM&&t.originalParams.pagination.childList){var c=t.originalParams.pagination.childList;this.customIndicatorEvent(t,c)};this.ableSwiper(`[data-wv-res-id=${t['res-id']}].swiper-container`);t.completeStatus=!0}};var h=this.controllableList.length,s,e,o,a,r,n,l;for(var i=0;i<h;i++){s=this.controllableList[i];e=this.swiperOptionList[s]['option'];if(e.controller.connect==='unconnect'||!e.controller.connect){o=this.swiperBySelector[s];a=this.swiperBySelector[e.controller.control];if(a){if(a.destroyed===!0)return;o.controller.control=a;e.controller.connect=!0}
else{if(e.controller.uncontrollable){r=e.controller.uncontrollable.split(',');var d=r.length;while(d--){n=bm.string.trim(r[d]);if(n==='')continue;l=bm.object.deepCopy(e[n]);delete l['default'];o[n]=l;if(o[n].completeStatus){o[n].update()}}};e.controller.connect='unconnect'}}}},ableSwiper:function(t){var e=bm.swiper.getSwiper(t);if(e!==undefined){if(e.slideCount<=1){$(e.pagination.el).hide();$(e.navigation.nextEl).hide();$(e.navigation.prevEl).hide();e.disable()}
else{$(e.pagination.el).show();$(e.navigation.nextEl).show();$(e.navigation.prevEl).show();e.enable()}}},add:function(t,e){if(t==null||t.length==0)return;if(this.initStatus==!1){e['init']=!1;e['loop']=!1;e['allowTouchMove']=!1};if(!e['option'])return;var n=new Swiper(t,e);n['res-id']=t.closest('[data-wv-swiper-con]').attr('data-wv-res-id');this.list.push(n);this.list[this.list.length-1].completeStatus=!1;var s=$(t).closest('[data-wv-res-id]').attr('data-wv-res-id'),i,a;$('script[data-block-js]').each(function(){if(i)return;a=$(this).attr('data-block-js');if($(t).closest('[data-wv-res-id='+a+']').length!=0){i=a}});var o;if(i!=s){o='[data-wv-res-id='+i+'] [data-wv-res-id='+s+'] .swiper-container'}
else{o='[data-wv-res-id='+i+'] .swiper-container'};this.swiperBySelector[o]=n;return n},addNew:function(t,e){if(t&&!t['length']&&Object.prototype.toString.call(t)=='[object HTMLDivElement]'){t=$(t)};if(t==null||t.length==0)return;if(!e['option'])return;this.remove(e.selector);var i=bm.object.deepCopy(e['option'].basic);if(app.isEditMode){i['init']=!1;i['loop']=!1;i['allowTouchMove']=!1;i['touchStartPreventDefault']=!1}
else if(window['wvAdminIFrameBridge']){i['init']=!1;i['loop']=!1};if(e['option'].pagination){if(e['option'].pagination.default!='off'){i.pagination=bm.object.deepCopy(e['option'].pagination);i.pagination.el=e['option'].pagination.el;var a=$(i.pagination.el).attr('data-wv-swiper-pagination');if(a&&a!=''){i.pagination.type=a;if(a==this.swiperType.CUSTOM){if($(i.pagination.el).attr('data-wv-swiper-pagination-activeClass')!==undefined){i.bulletActiveClass=$(i.pagination.el).attr('data-wv-swiper-pagination-activeClass')};var s=this.getCustomIndicatorList(i.pagination.el),d=s[0].tagName.toLowerCase(),o=$(s[0]).clone();o=$(o).removeClass(i.bulletActiveClass);o=$(o)[0].outerHTML;i.pagination.template=o;i.pagination.childList=s;i.pagination.bulletElement=d}};delete i.pagination.default}};if(e['option'].navigation){if(e['option'].navigation.default!='off'){i.navigation=bm.object.deepCopy(e['option'].navigation);i.navigation.prevEl=e['option'].navigation.prevEl=$(e['option'].navigation.prevEl)[0];i.navigation.nextEl=e['option'].navigation.nextEl=$(e['option'].navigation.nextEl)[0];delete i.navigation.default}};if(e['option'].breakpoints){i.breakpoints=bm.object.deepCopy(e['option'].breakpoints)};if(e['option'].basic.autoplay){i.autoplay=bm.object.deepCopy(e['option'].basic.autoplay);if(i.autoplay.delay||i.autoplay.disableOnInteraction)i.autoplay={disableOnInteraction:0,delay:i.autoplay.delay};if(!i.autoplay)i.autoplay=!1};this.swiperOptionList[e.selector]=e;var l=$(t).find('.swiper-slide').length,n=new Swiper(t[0],i);n.slideCount=l;var r=t.closest('[data-wv-swiper-con]');if(r.length>0){n['res-id']=r.attr('data-wv-res-id')};n.completeStatus=!1;this.list.push(n);this.swiperBySelector[e.selector]=n;if(e['option'].controller&&this.controllableList.indexOf(e.selector)==-1){this.controllableList.push(e.selector)};this.swiperOptionList[e.selector].swiper=n;if(this.isInit==!0){this.init()};return n},remove:function(t){var e;if(t){e=this.getSwiper(t);if(e){var n=this.list.indexOf(e);this.list.splice(n,1);if(!e.destroyed)e.destroy();if(this.autoplayList.indexOf(e)>-1){this.autoplayList.splice(this.autoplayList.indexOf(e),1)}};delete this.swiperBySelector[t];delete this.swiperOptionList[t];if(this.controllableList.indexOf(t)>-1){this.controllableList.splice(this.controllableList.indexOf(t),1)}}
else{var i=this.list.length;while(i--){e=this.list[i];if(!e.destroyed)e.destroy()};this.list.length=0;this.isInit=!1;this.swiperBySelector={};this.swiperOptionList={};this.controllableList=[];this.autoplayList=[]}},getSwiper:function(t){return this.swiperBySelector[t]},getIdx:function(t){var e=this.list.indexOf(t);return e},setSwiperIndex:function(t,e){var i=this.getSwiper(t);i.slideTo(e)},changeThumbImageItem:function(t,e,i){var r=this.getSwiper(t),n=window;if(n.name=='WEVEN_IFRAME'||n.name=='wevenIframePreview')n=n.parent;var o=r.slides[i];if($(o).is('[data-wv-swiper-img]')==!1){o=$(o).find('[data-wv-swiper-img]')[0]};var s={'background-image':'url('+e+')'};var a=n.WVAdminResourceManager.getEmbededStyleObject();a.applyResourceStyle(o,s,!1,!0);a.refreshStyleElementText();n.wvAdminIFrameBridge.resetControllContentArea()},addThumbItem:function(t,e,i,n){var o=this.getSwiper(t),a=window;if(a.name=='WEVEN_IFRAME'||a.name=='wevenIframePreview')a=a.parent;var s=a.wvAdminIFrameBridge.copyBlockIncludeAssets(o.slides[o.slides.length-1],!0);if($(o.el).closest('[data-wv-inc]').length>0){var p=a.WVAdminResourceManager.getEmbededStyleObject(null,$(o.el),null)}
else{var p=a.WVAdminResourceManager.getEmbededStyleObject()};if(!i){var y={'background-image':'url('+e+')'};var d=$(s).find('[data-wv-swiper-img]');if(d.length===0){if($(s).is('[data-wv-swiper-img]')===!0){d=$(s)}
else{s=a.wvAdminIFrameBridge.copyBlockIncludeAssets($($(o.el).find('[data-wv-swiper-img]')[0]).closest('.swiper-slide')[0],!0);d=$(s).find('[data-wv-swiper-img]')}};p.applyResourceStyle(d,y,!1,!0);p.refreshStyleElementText()};var m=o.originalParams.pagination,b=m.type;if(b===this.swiperType.CUSTOM){this.addCustomIndicatorRender(o,m.childList)};o.appendSlide(s);o.slideCount+=1;this.ableSwiper(t);if(!n&&o.controller&&o.controller.control){var l=o.controller.control,v=$(l.el).closest('[data-wv-swiper-con]'),c=$(l.el).closest('[data-wv-layout-element-type=thumb]').attr('data-wv-res-id'),f,g=$(v).attr('data-wv-res-id');if(c!=g){f='[data-wv-res-id='+c+'] [data-wv-res-id='+g+'] .swiper-container'}
else{f='[data-wv-res-id='+c+'] .swiper-container'};var u=l.slides[l.slides.length-1],h=$(u).hasClass('text_thumb'),r;if(h){r='url("/weven_service/asset/toolbar/img/tool_data/thumb_text_default.png")'}
else{r=$(u).css('backgroundImage');if(!r||r=='none'){h=!0;r='url("/weven_service/asset/toolbar/img/tool_data/thumb_text_default.png")'}};this.addThumbItem(f,r,h,!0)};if(!n){a.wvAdminIFrameBridge.resetControllContentArea()};return s},removeThumbItem:function(t,e,i){var n=this.getSwiper(t),o=window;if(o.name=='WEVEN_IFRAME'||o.name=='wevenIframePreview')o=o.parent;if(n.slides.length<=e)return;if(o.wvAdminIFrameBridge)o.wvAdminIFrameBridge.removeAssetsByResId($(n.slides[e]).attr('data-wv-res-id'));var d=n.originalParams.pagination,c=d.type;if(c===this.swiperType.CUSTOM){this.removeCustomIndicatorRender(n,d.childList,e)};n.removeSlide(e);n.slideCount-=1;this.ableSwiper(t);if(!i&&n.controller&&n.controller.control){var r=n.controller.control,h=$(r.el).closest('[data-wv-swiper-con]'),a=$(r.el).closest('[data-wv-layout-element-type=thumb]').attr('data-wv-res-id'),s,l=$(h).attr('data-wv-res-id');if(a!=l){s='[data-wv-res-id='+a+'] [data-wv-res-id='+l+'] .swiper-container'}
else{s='[data-wv-res-id='+a+'] .swiper-container'};this.removeThumbItem(s,e,!0)}},changeThumbItem:function(t,e,i,n){var o=this.getSwiper(t);if(e==i)return;var h=o.originalParams.pagination,f=h.type;if(f===this.swiperType.CUSTOM){this.changeCustomIndicatorRender(o,h.childList,e,i)};var d=o.slides[e];if(e>i)$(o.slides[i]).before(d);else if(e<i)$(o.slides[i]).after(d);o.update();if(!n&&o.controller&&o.controller.control){var r=o.controller.control,c=$(r.el).closest('[data-wv-swiper-con]'),a=$(r.el).closest('[data-wv-layout-element-type=thumb]').attr('data-wv-res-id'),s,l=$(c).attr('data-wv-res-id');if(a!=l){s='[data-wv-res-id='+a+'] [data-wv-res-id='+l+'] .swiper-container'}
else{s='[data-wv-res-id='+a+'] .swiper-container'};this.changeThumbItem(s,e,i,!0)}},touchEventOff:function(t){var n=this.list;if(t){var o=this.getIdx(t);n=this.list[o]};for(var i=0;i<n.length;i++){var e=n[i];e.allowTouchMove=!1;if(e.autoplay&&e.autoplay.running){this.autoplayList.push(e)}}},touchEventOn:function(t){var i=this.list;if(t){var o=this.getIdx(t);i=this.list[o]};for(var e=0;e<i.length;e++){var n=i[e];n.allowTouchMove=!0};for(e=0;e<this.autoplayList.length;e++){var n=this.autoplayList[e]};this.autoplayList.length=0},autoPlayOff:function(t){var i=this.list;if(t){var o=this.getIdx(t);i=this.list[o]};for(var e=0;e<i.length;e++){var n=i[e];n.autoplay.stop()}},autoPlayOn:function(t){var n=this.list;if(t){var o=this.getIdx(t);n=this.list[o]};for(var i=0;i<n.length;i++){var e=n[i];if($(e.el).attr('data-wv-com-op').includes('autoplay: {disableOnInteraction:0')){if($(e.el).attr('data-wv-com-op').split('delay:')){e.params.autoplay.delay=Number($(e.el).attr('data-wv-com-op').split('delay:')[1].substring(0,4))};e.autoplay.start()}
else{e.autoplay.stop()}}},patchVersion:function(){var t=window['wvAdminIFrameBridge']&&wvAdminIFrameBridge.iframeWindow;if(!t)t=window;var i=!1;$(t.document).find('[data-block-js]').each(function(){if(this.innerHTML.indexOf('bm.swiper.add')>-1){i=!0;var t=$(this).attr('data-block-js');this.innerHTML='wevenBlock[\''+t+'\'] = { initStatus : 0 ,init : function(){ this.registEvent(); }, editInit : function(){ } , registEvent : function(){ }, removeEvent : function(){ }, destroy : function(){ this.removeEvent(); } }';o(t)}});function o(e){$(t.document).find('[data-wv-res-id='+e+']').attr('data-wv-layout-element-type','thumb');$(t.document).find('[data-wv-res-id='+e+'] .swiper-container').each(function(){var l=$(this).closest('[data-wv-layout-element=block]');$(l).addClass('wveditor_thumb');$(l).attr('data-wv-swiper-con','');if(!$(this).attr('data-wv-com')){$(this).attr('data-wv-com','swiper');var h=$(l).attr('data-wv-res-id'),s;if(e!=h){s='[data-wv-res-id='+e+'] [data-wv-res-id='+h+'] .swiper-container'}
else{s='[data-wv-res-id='+e+'] .swiper-container'};var r=t.bm.swiper.getSwiper(s),o=r.params,i='{ selector : \''+s+'\' , option:{ basic : {';i+=n(o)+' } ';if(o.pagination.el){i+=', pagination:{el:\'[data-wv-res-id='+e+'] [data-wv-swiper-pagination]\'';var a=n(o.pagination,['el']);if(a!=''){i+=', '+a};i+='}'};if(o.navigation.nextEl||o.navigation.prevEl){var a='';i+=', navigation:{';if(o.navigation.prevEl){a='prevEl : \'[data-wv-res-id='+e+'] [data-wv-swiper-navigation=prev]\''};if(o.navigation.nextEl){if(a!=''){a+=', '};a+='nextEl : \'[data-wv-res-id='+e+'] [data-wv-swiper-navigation=next]\''};i+=a+' }'};if(o.breakpoints){i+=', breakpoints:'+JSON.stringify(o.breakpoints).replace(/"/g,'')};if(r.controller&&r.controller.control){var d=$(r.controller.control.el).closest('[data-wv-res-id]').attr('data-wv-res-id');if(e!=d){s='[data-wv-res-id='+e+'] [data-wv-res-id='+d+'] .swiper-container'}
else{s='[data-wv-res-id='+e+'] .swiper-container'};i+=', controller : { control : \''+s+'\' }'};i+='} } ';$(this).attr('data-wv-com-op',i)};if($(this).find('[data-wv-swiper-img]').length==0){if($(this).find('[data-wv-layout-element-type="image"]').length>0){$(this).find('[data-wv-layout-element-type="image"]').attr('data-wv-swiper-img','')}
else{$(this).find('.swiper-slide').each(function(){var e,t;t=$(this).css('backgroundImage');if(t!='none'&&t&&t.indexOf('url')>-1){e=this};if(!e){$(this).find('[data-wv-layout-element=block]').each(function(){if(e)return;t=$(this).css('backgroundImage');if(t!='none'&&t&&t.indexOf('url')>-1){e=this}})};if(e){$(e).attr('data-wv-swiper-img','')}
else{$(this).attr('data-wv-swiper-img','')}})}}})};function n(t,e){var i,n='';for(var o in t){if(e&&e.indexOf(o)!=-1)continue;i=t[o];if(!bm.type.isObject(i)&&!bm.type.isFunction(i)){if(n!=='')n+=', ';if(i===!0){i=1;n+=o+': '+i+''}
else if(i===!1){i=0;n+=o+': '+i+''}
else if(i===undefined||i===null){}
else{n+=o+': '+i+''}}};return n};var e=-1;$(t.document).find('[data-wv-swiper-con]').each(function(){e=-1;$(this).find('[data-wv-swiper-img]').each(function(){var a=$(this).find('.wveditor_image > img');if(a.length>0){i=!0;var n={};if(e==-1)e=parseInt($(a).height())+'px';n['height']=e;n['background-image']='url(\''+$(a).attr('src')+'\')';n['background-repeat']='no-repeat';n['background-size']='cover';n['background-position']='center';var o;t=t.parent;if(t.bm.bmEditorManager.registedBoardEditor===!1){o=t.WVAdminResourceManager.getEmbededStyleObject(null,this)};var s=t.WVAdminResourceManager.checkNewResourceId(this);if(s!=null){o.copyStyleBySelector('[data-wv-res-id="'+s.old+'"]','[data-wv-res-id="'+s.new+'"]')};var r=t.wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList();o.applyResourceStyle(this,n,!1,!0,!1,!0,r);o.refreshStyleElementText();$(this).find('[data-wv-layout-element="block_inner"]').removeClass('wveditor_image');$(this).removeAttr('data-wv-layout-element-type');a.remove()}})});return i},getCustomIndicatorList:function(t){var e=$(t).children(),n=e.length;for(var i=0;i<n;i++){if($(e[i]).attr('data-wv-layout-element')=='block_inner'){e=$(e[i]).children();break}};return e},addCustomIndicatorRender:function(t,e){var r=t.originalParams.pagination,c=r.el,n=e.length,f=$(e)[n-1].outerHTML;$(e).parent().append(f);e=t.originalParams.pagination.childList=this.getCustomIndicatorList(c);n=e.length;$(e[n-1]).removeClass(r.bulletActiveClass);$(e[n-1]).removeClass('edit_target_block');$(e[n-1]).find('.edit_target_block').removeClass('edit_target_block');var s,i=window;if(i.name=='WEVEN_IFRAME'||i.name=='wevenIframePreview')i=i.parent;if(i.bm.bmEditorManager.registedBoardEditor===!1){s=i.WVAdminResourceManager.getEmbededStyleObject(null,this)};var a={};var h=100/n;a.width=h+'%';var d=i.wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList();for(var o=0;o<n;o++){var l=$(e[o]).attr('data-wv-res-id');s.mergeRule('[data-wv-res-id="'+l+'"]',a,d,!0,!1)};this.customIndicatorEvent(t,e)},removeCustomIndicatorRender:function(t,e,i){var h=t.originalParams.pagination,c=h.el;$(e[i]).remove();e=t.originalParams.pagination.childList=this.getCustomIndicatorList(c);len=e.length;var s,n=window;if(n.name=='WEVEN_IFRAME'||n.name=='wevenIframePreview')n=n.parent;if(n.bm.bmEditorManager.registedBoardEditor===!1){s=n.WVAdminResourceManager.getEmbededStyleObject(null,this)};var a={};var d=100/len;a.width=d+'%';var l=n.wvAdminIFrameBridge._WVAdminTopBar.getResponsiveSizeList();for(var o=0;o<len;o++){var r=$(e[o]).attr('data-wv-res-id');s.mergeRule('[data-wv-res-id="'+r+'"]',a,l,!0,!1)};this.customIndicatorEvent(t,e)},changeCustomIndicatorRender:function(t,e,i,n){var s=t.originalParams.pagination,a=s.el;e=t.originalParams.pagination.childList=this.getCustomIndicatorList(a);var o=e[i];if(i>n)$(e[n]).before(o);else if(i<n)$(e[n]).after(o);e=t.originalParams.pagination.childList=this.getCustomIndicatorList(a);this.customIndicatorEvent(t,e)},customIndicatorEvent:function(t,e){$(e).off('click');var n=t.originalParams.pagination,i=n.bulletActiveClass;$(e).on('click',function(){$(this).siblings().removeClass(i);$(this).addClass(i);t.slideToLoop($(this).index())})},changeExtraElement:function(t,e){var i=this.swiperAnalysisMap;for(var n of e){switch(n){case i.SWIPER_PAGI_SLIDE_BLACK:case i.SWIPER_PAGI_SLIDE_WHITE:case i.SWIPER_PAGI_BULLET_BLACK:case i.SWIPER_PAGI_BULLET_WHITE:this.changePaginationStyle(t,n);break;case i.SWIPER_NAVI_ARROW_LEFT:case i.SWIPER_NAVI_ARROW_RIGHT:this.changeNavigationStyle(t,n);break}}},changePaginationStyle:function(t,e){var n=this.swiperAnalysisMap,o=$(t).find('[data-wv-swiper-pagination]');if(o.length>0){var s=o.closest('[data-wv-layout-element="block"]').attr('data-wv-res-id'),a=WVAdminResourceManager.getEmbededStyleObject(null,o),r='[data-wv-res-id="'+s+'"] [data-wv-swiper-pagination] > span',i={};switch(e){case n.SWIPER_PAGI_SLIDE_BLACK:i['width']='100px';i['height']='2px';i['margin-right']=0;i['border-radius']=0;i['background-color']='rgb(0,0,0)';break;case n.SWIPER_PAGI_SLIDE_WHITE:i['width']='100px';i['height']='2px';i['margin-right']=0;i['border-radius']=0;i['background-color']='rgb(255,255,255)';break;case n.SWIPER_PAGI_BULLET_BLACK:i['width']='10px';i['height']='10px';i['margin-right']='15px';i['border-radius']='50%';i['background-color']='rgb(0,0,0)';break;case n.SWIPER_PAGI_BULLET_WHITE:i['width']='10px';i['height']='10px';i['margin-right']='15px';i['border-radius']='50%';i['background-color']='rgb(255,255,255)';break};a.applyResourceStyle(r,i,!1,!0,!1,!1,['default','768','992','1200','1600']);a.refreshStyleElementText()}},changeNavigationStyle:function(t,e){var o=this.swiperAnalysisMap,i=$(t).find('[data-wv-swiper-navigation="prev"]'),n=$(t).find('[data-wv-swiper-navigation="next"]');if(i.length>0||n.length>0){switch(e){case o.SWIPER_NAVI_ARROW_LEFT:i.removeAttr('data-wv-display-hide992');i.removeAttr('data-wv-display-hide1200');i.removeAttr('data-wv-display-hide1600');break;case o.SWIPER_NAVI_ARROW_RIGHT:n.removeAttr('data-wv-display-hide992');n.removeAttr('data-wv-display-hide1200');n.removeAttr('data-wv-display-hide1600');break}}}};bm.swiper.swiperAnalysisMap={SWIPER_PAGI_SLIDE_BLACK:'흑슬라이드',SWIPER_PAGI_SLIDE_WHITE:'백슬라이드',SWIPER_PAGI_BULLET_BLACK:'흑슬라이드버튼',SWIPER_PAGI_BULLET_WHITE:'백슬라이드버튼',SWIPER_NAVI_ARROW_LEFT:'왼쪽화살표',SWIPER_NAVI_ARROW_RIGHT:'오른쪽화살표'};bm.swiper.swiperType={BULLETS:'bullets',CUSTOM:'custom',DYNAMIC:'dynamic',FRACTION:'fraction'};app.init(function(){bm.swiper.init()});app.reset(function(){bm.swiper.remove();bm.swiper.crawling()});bm.headerEvent={isMobile:!1,isTablet:!1,isSelectedMenu:!1,isSeparateHeader:!1,isPromotion:!1,isEditModeChecked:!1,windowScrollTop:0,standMobileValue:992,headerWrapper:null,menuType:'default',originHeader:null,fixedHeader:null,clickHeader:null,clickHeaderDim:null,originHeaderMenu:null,clickHeaderMenu:null,fixedHeaderMenu:null,originFixedMenu:null,clickHeaderOpenBtn:null,clickHeaderCloseBtn:null,languageSelect:null,anchorScrollList:[],headerElVisibleOpt:{},activeIdx:-1,anchorCenterStandardSeperate:3,init:function(t){var e=this;if(t.length===0||t==null){if($('[data-wv-inc^="header"]').length>0){t=$('[data-wv-inc^="header"]')}
else{return}};this.headerWrapper=t;if($('.wrapper.promotion').length>0)this.isPromotion=!0;this.originHeader=$(t).find('.header_wrap');this.clickHeader=$(t).find('.click_header_wrap');this.clickHeaderDim=$(t).find('.click_header_dim');this.fixedHeader=$(t).find('.fixed_header_wrap');this.originHeaderMenu=$(this.originHeader).find('.gnb_wrap');this.clickHeaderMenu=$(this.clickHeader).find('.gnb_wrap');this.fixedHeaderMenu=$(this.fixedHeader).find('.gnb_wrap');this.clickHeaderOpenBtn=$(t).find('[data-wv-sitemap-open-btn]');this.clickHeaderCloseBtn=$(t).find('[data-wv-sitemap-close-btn]');this.originHeaderHoverMenuWrap=$(this.originHeader).find('.hover_menu_wrap');this.fixedHeaderHoverMenuWrap=$(this.fixedHeader).find('.hover_menu_wrap');this.languageSelect=$(e.headerWrapper).find('.language_select_wrap');this.bodyWrapper=$('[data-wv-layout-element="layout_screen"]').find('#contentArea');if(this.bodyWrapper.length===0)this.bodyWrapper=$('[data-wv-layout-element="layout_screen"]').first();this.isFixedExist=this.fixedHeader.length>0;if(!this.isFixedExist)this.originFixedMenu=$(t).find('[data-wv-origin-fixed-menu]');if(window.innerWidth<=this.standMobileValue)this.isMobile=!0;if($('body').attr('data-wv-agent')==='ipad'||$('body').attr('data-wv-os')==='ipad'||($('body').attr('data-wv-pc')==='mobile'&&$('body').attr('data-wv-agent')==='Mac'))this.isTablet=!0;this.windowWidth=$(window).width();$(t).find('[data-wv-layout-element="menu"]').each(function(){var t=bm.parsing.parseStrToObj($(this).attr('data-wv-layout-element-param'));if(!t['type']){e.menuType='default';return!1}
else{e.menuType=t['type']}});this.activeDepth1MenuIdx=-1;if(this.menuType.includes('block')){if($(this.originHeaderMenu).find('li[data-wv-menu-depth="1"].active').length>0){this.isSelectedMenu=!0;this.activeDepth1MenuIdx=$(this.originHeaderMenu).find('li[data-wv-menu-depth="1"].active').index()}}
else{if($(this.originHeaderMenu).find(' > li.active').length>0){this.isSelectedMenu=!0;this.activeDepth1MenuIdx=$(this.originHeaderMenu).find(' > li.active').index()}};if(t.hasClass('separate'))this.isSeparateHeader=!0;this.setPaddingAfterSeparateHeader(t);this.windowScrollTop=window.scrollY||document.documentElement.scrollTop;if(this.originHeader.find('[data-wv-logo]').length>0&&$(t).find('[data-wv-origin-fixed-menu]').length===0){this.originHeader.find('[data-wv-logo]').each(function(t,e){if($(e).attr('data-wv-logo-param')){var i=bm.parsing.parseStrToObj($(e).attr('data-wv-logo-param'));if(!i.sync){i.sync=!0;$(e).attr('data-wv-logo-param',JSON.stringify(i).replace(/"/g,''))}}
else{$(e).attr('data-wv-logo-param','{sync:true}')}})};if(this.isFixedExist&&this.fixedHeader.find('[data-wv-logo]').length>0&&$(t).find('[data-wv-origin-fixed-menu]').length===0){this.fixedHeader.find('[data-wv-logo]').each(function(t,e){if($(e).attr('data-wv-logo-param')){var i=bm.parsing.parseStrToObj($(e).attr('data-wv-logo-param'));if(!i.sync){i.sync=!0;$(e).attr('data-wv-logo-param',JSON.stringify(i).replace(/"/g,''))}}
else{$(e).attr('data-wv-logo-param','{sync:true}')}})};$('[data-wv-logo]').each(function(t){if($(this)[0].tagName!=='A'&&$(this).attr('tabindex')===undefined){$(this).attr('tabindex',0)}});if(this.isFixedExist){if(this.windowScrollTop>0){this.upHeader(this.originHeader);$(this.fixedHeader).addClass('active');this.downHeader(this.fixedHeader)}
else{if($(this.fixedHeader).hasClass('active')){this.upHeader(this.fixedHeader);$(this.fixedHeader).removeClass('active');this.downHeader(this.originHeader)}}};this.setheaderOverFlow();this.isWebEventRegisted=!1;this.isMobileEventRegisted=!1;this.registEvent()},registEvent:function(){var t=this;$(window).on('scroll',function(){t.headerScrollEvent();t.closeLanguageSelect()});$(window).resize(function(){if(t.isMobile&&t.windowWidth===$(window).width())return!1;t.windowWidth=$(window).width();t.headerResizeEvent()});if(t.isMobile){t.registMobileEvent()}
else{t.registWebEvent()};t.clickHeaderMenu.find('a').attr('tabindex','-1');t.fixedHeaderMenu.find('a').attr('tabindex','-1');$(t.clickHeaderOpenBtn).on('click',function(){t.showClickHeader('button');t.clickHeaderMenu.find('a').removeAttr('tabindex')});$(t.clickHeaderCloseBtn).on('click',function(){t.hideClickHeader('button');t.clickHeaderMenu.find('a').attr('tabindex','-1')});$(t.clickHeaderOpenBtn).on('keyup',function(e){if(e.keyCode===13){t.showClickHeader('button');t.clickHeaderMenu.find('a').removeAttr('tabindex')}});$(t.clickHeaderCloseBtn).on('keyup',function(e){if(e.keyCode===13){t.hideClickHeader('button');t.clickHeaderMenu.find('a').attr('tabindex','-1')}});$(t.clickHeaderDim).on('click',function(){t.hideClickHeader()});if(t.isPromotion){$(window).trigger('scroll');t.setAnchorScrolList();$('[data-wv-logo]').on('click keydown',function(t){if(t.type==='click'||(t.type==='keydown'&&t.which===13)){t.stopPropagation();history.pushState({},'',WEB_ROOT);$('html,body').stop().animate({scrollTop:0+'px'},{duration:500,complete:function(){}})}})}
else{if(!app.isEditMode){$('[data-wv-logo]').on('keydown',function(t){if(t.which===13)location.href=WEB_ROOT})}}},setheaderOverFlow:function(t){var e=window;if(e.name=='WEVEN_IFRAME'||e.name=='wevenIframePreview')e=e.parent;var i=e.wvAdminIFrameBridge||e.parent.wvAdminIFrameBridge;if(!t&&this.headerWrapper&&this.headerWrapper.length>0){t=this.headerWrapper};if(t){if(this.isEditModeChecked&&i&&i._WVContentArea.designMode==='expert'){t.css({width:'calc(100% - 14px)'})}
else{t.css({width:''})}}},setAnchorScrolList:function(){var t=this;if(t.wholeHeight!==$('[data-wv-layout-element="layout_screen"]').innerHeight()){bm.headerEvent.wholeHeight=$('[data-wv-layout-element="layout_screen"]').innerHeight();if($('[data-wv-menu-target]').length>0){t.anchorScrollList=[];$('[data-wv-menu-target]').each(function(){bm.headerEvent.anchorScrollList.push(parseInt($(this).offset().top))})}}},closeLanguageSelect:function(){var t=this;if(t.languageSelect&&t.languageSelect.find('.select_style_0_con').is(':visible')){t.languageSelect.each(function(){$(this).find('select').trigger('click')})}},headerScrollEvent:function(){var t=this;t.windowScrollTop=window.scrollY||document.documentElement.scrollTop;if(t.isFixedExist){if(t.windowScrollTop>0){t.upHeader(t.originHeader);t.fixedHeader.addClass('active');t.downHeader(t.fixedHeader);if(this.isPromotion){$(t.fixedHeaderMenu).find('> li').removeClass('active');$(t.originHeaderMenu).find('> li').removeClass('active');var i=t.windowScrollTop+Math.round($(window).innerHeight()/t.anchorCenterStandardSeperate),o=$(t.fixedHeader).innerHeight();for(var e=0;e<t.anchorScrollList.length;e++){if(i<=t.anchorScrollList[0]){t.activeIdx=-1;break}
else{if(e!=t.anchorScrollList.length-1){if(i>=t.anchorScrollList[e]&&i<t.anchorScrollList[e+1]){if(t.windowScrollTop+$(window).height()==$(document).height()){t.activeIdx=t.anchorScrollList.length-1}
else{t.activeIdx=e};break}}
else{if(i<t.anchorScrollList[e]+$('[data-wv-menu-target]').eq(e).innerHeight()){t.activeIdx=e;break}}}};if(t.activeIdx>-1){var n=$('[data-wv-menu-target]').eq(t.activeIdx).attr('id');$(t.fixedHeaderMenu).find('> li > a[data-wv-menu-link="'+n+'"]').parent('li').addClass('active');$(t.originHeaderMenu).find('> li > a[data-wv-menu-link="'+n+'"]').parent('li').addClass('active')}}}
else if(t.windowScrollTop<=0){t.upHeader(t.fixedHeader);t.fixedHeader.removeClass('active');t.downHeader(t.originHeader)}}},headerResizeEvent:function(){var t=this;if(t.isPromotion){t.setAnchorScrolList()};if(t.isSeparateHeader){t.setPaddingAfterSeparateHeader(this.headerWrapper)};if(t.isTablet)return;if(window.innerWidth<=t.standMobileValue&&!(t.isMobile)){t.isMobile=!0;t.removeWebEvent(!0);t.registMobileEvent();if(t.clickHeader.hasClass('active'))t.clickHeaderDim.removeClass('hidden')}
else if(window.innerWidth>t.standMobileValue&&t.isMobile){t.isMobile=!1;t.removeMobileEvent(!0);t.registWebEvent();if(t.isFixedExist&&t.windowScrollTop>0){t.upHeader(t.originHeader);t.fixedHeader.addClass('active');t.downHeader(t.fixedHeader)}};t.hideGnbScroll(t.originHeader);if(t.isFixedExist)t.hideGnbScroll(t.fixedHeader)},downHeader:function(t){TweenMax.to(t,0.3,{marginTop:0,ease:Cubic.easeOut,delay:0.3})},upHeader:function(t,e){var i=this,n=t.outerHeight();TweenMax.to(t,0.3,{marginTop:-n+'px',ease:Cubic.easeOut,onComplete:function(){if(e)e.call(i)}})},showClickHeader:function(t){var e=this;if(app.isEditMode&&t&&$(parent.document).find('#viewLayoutBtn').is(':checked')){if(confirm('사이트메뉴를 여시겠습니까?')){var i=window;if(i.name=='WEVEN_IFRAME'||i.name=='wevenIframePreview')i=i.parent;e.clickHeader.addClass('active');e.clickHeaderDim.show();i.wvAdminIFrameBridge._WVLayoutKit.detach();i.wvAdminIFrameBridge.toolManager.hideExtraTool()}
else{return}}
else{e.clickHeader.addClass('active');e.clickHeaderDim.show()};if(e.isFixedExist){if(e.windowScrollTop>0){e.upHeader(e.fixedHeader);e.fixedHeader.removeClass('active')}};e.clickHeaderPreventScrollEventOn();$('body').css('overflow','hidden')},hideClickHeader:function(t){var e=this;if(app.isEditMode&&t&&$(parent.document).find('#viewLayoutBtn').is(':checked')){if(confirm('사이트메뉴를 닫으시겠습니까?')){var i=window;if(i.name=='WEVEN_IFRAME'||i.name=='wevenIframePreview')i=i.parent;e.clickHeader.removeClass('active');e.clickHeaderDim.hide();i.wvAdminIFrameBridge._WVLayoutKit.detach();i.wvAdminIFrameBridge.toolManager.hideExtraTool()}
else{return}}
else{e.clickHeader.removeClass('active');e.clickHeaderDim.hide()};if(e.isFixedExist){if(e.windowScrollTop>0){e.fixedHeader.addClass('active');e.downHeader(e.fixedHeader)}
else if(e.windowScrollTop<=0){e.downHeader(e.originHeader)}};e.clickHeaderPreventScrollEventOff();$('body').css('overflow','')},originHeaderMenuOnMobileEvent:function(){},originHeaderMenuOffMobileEvent:function(){},originHeaderMenuOnWebEvent:function(t){},originHeaderMenuOffWebEvent:function(t){},fixedHeaderMenuOnMobileEvent:function(){},fixedHeaderMenuOffMobileEvent:function(){},fixedHeaderMenuOnWebEvent:function(t){},fixedHeaderMenuOffWebEvent:function(t){},clickHeaderMenuOnMobileEvent:function(){var e=this;if(e.isPromotion)return;var t=$(e.clickHeaderMenu),a=$(t).find('li[data-wv-menu-depth="1"]').has(' ul ').find('a[data-wv-menu-depth="1"]'),i=-1;if(e.isSelectedMenu)i=e.activeDepth1MenuIdx;var n,o;if(!($(t).find('li[data-wv-menu-depth="1"].active').hasClass('list_on'))&&$(t).find('li[data-wv-menu-depth="1"].active').has('ul[data-wv-menu-depth="2"]').length>0){n=$(t).find('li[data-wv-menu-depth="1"].active ul[data-wv-menu-depth="2"]').height();o=$(t).find('li[data-wv-menu-depth="1"].active ul[data-wv-menu-depth="2"]').css('height','auto').height();$(t).find('li[data-wv-menu-depth="1"].active ul[data-wv-menu-depth="2"]').height(n).animate({height:o},{duration:400,complete:function(){if(e.isSelectedMenu)i=$(t).find('li[data-wv-menu-depth="1"].active').index()}});$(t).find('li[data-wv-menu-depth="1"].active').addClass('list_on')};$(a).on('click',function(a){a.preventDefault();a.stopPropagation();var s=$(this).closest('li'),r=$(s).index();i=s.siblings('.list_on').index();if($(s).hasClass('list_on')){if(e.activeDepth1MenuIdx!=r){$(s).find('ul[data-wv-menu-depth="2"]').animate({height:0},{duration:400,progress:function(){$(s).removeClass('list_on')},complete:function(){i=-1;if(e.activeDepth1MenuIdx>-1){t.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx).addClass('active');if(t.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx).has('ul').length>0){n=$(t.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx)).find('ul[data-wv-menu-depth="2"]').height();o=$(t.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx)).find('ul[data-wv-menu-depth="2"]').css('height','auto').height();$(t.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx)).find('ul[data-wv-menu-depth="2"]').height(n).animate({height:o},{duration:400,complete:function(){i=e.activeDepth1MenuIdx}});$(t.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx)).addClass('list_on')}}}})}}
else{if(i>-1){$(t).find('li[data-wv-menu-depth="1"]').eq(i).removeClass('list_on');$(t).find('li[data-wv-menu-depth="1"]').eq(i).find('ul[data-wv-menu-depth="2"]').animate({height:0},{duration:400,progress:function(){$(t).find('li[data-wv-menu-depth="1"]').eq(i).removeClass('list_on')}})};n=$(s).find('ul[data-wv-menu-depth="2"]').height();o=$(s).find('ul[data-wv-menu-depth="2"]').css('height','auto').height();$(s).find('ul[data-wv-menu-depth="2"]').height(n).animate({height:o},{duration:400,complete:function(){i=r}});$(s).addClass('list_on')}})},clickHeaderMenuOffMobileEvent:function(){var e=this;if(e.isPromotion)return;var t=$(e.clickHeaderMenu),i=$(t).find('li[data-wv-menu-depth="1"]').has(' ul ').find('a[data-wv-menu-depth="1"]');$(t).find('ul[data-wv-menu-depth="2"]').css('height','');$(t).find('li[data-wv-menu-depth="1"]').removeClass('list_on');$(i).off('click')},clickHeaderMenuOnWebEvent:function(t){var e=this;if(e.isPromotion)return;var i=$(e.clickHeaderMenu),o=$(i).find('li[data-wv-menu-depth="1"]'),s=$(i).find('li[data-wv-menu-depth="2"]'),a=$(i).find('a[data-wv-menu-depth="2"]'),n=null;if(e.isSelectedMenu&&$(i).find('li[data-wv-menu-depth="1"].active li[data-wv-menu-depth="2"].active').length>0){n=$(i).find('li[data-wv-menu-depth="1"].active li[data-wv-menu-depth="2"].active')};$(o).on('mouseover',function(){$(this).siblings('li').removeClass('active');$(this).addClass('active')});$(o).on('mouseleave',function(){$(this).removeClass('active');if(e.isSelectedMenu&&e.activeDepth1MenuIdx>-1)i.find('li[data-wv-menu-depth="1"]').eq(e.activeDepth1MenuIdx).addClass('active')});$(a).on('mouseover',function(){$(s).removeClass('active');$(this).closest('li').addClass('active')});$(a).on('mouseleave',function(){$(this).closest('li').removeClass('active');if(e.isSelectedMenu&&n!=null)n.addClass('active')})},clickHeaderMenuOffWebEvent:function(t){var o=this;if(o.isPromotion)return;var e=$(o.clickHeaderMenu),i=$(e).find('li[data-wv-menu-depth="1"]'),n=$(e).find('a[data-wv-menu-depth="2"]');$(i).off('mouseover');$(i).off('mouseleave');$(n).off('mouseover');$(n).off('mouseleave')},clickHeaderPreventScrollEventOn:function(){this.clickHeader.on('touchmove scroll mousewheel',function(t){t.stopImmediatePropagation();if($(this).find('.click_header_con').length>0&&$(this).outerHeight()>$(this).find('.click_header_con').outerHeight()){t.preventDefault()}});this.clickHeaderDim.parent().on('touchmove scroll mousewheel',function(t){t.stopImmediatePropagation();t.preventDefault();return!1})},clickHeaderPreventScrollEventOff:function(){this.clickHeader.off('touchmove scroll mousewheel');this.clickHeaderDim.parent().off('touchmove scroll mousewheel')},addEvent:function(){var t=this;if(this.isPromotion){this.initAnchorScrollList();$(t.originHeaderMenu).find('li[data-wv-menu-depth="1"]').removeClass('active');$(t.fixedHeaderMenu).find('li[data-wv-menu-depth="1"]').removeClass('active');var i=t.windowScrollTop+Math.round($(window).innerHeight()/t.anchorCenterStandardSeperate);for(var e=0;e<t.anchorScrollList.length;e++){if(i<=t.anchorScrollList[0]){t.activeIdx=-1;break}
else{if(e!=t.anchorScrollList.length-1){if(i>=t.anchorScrollList[e]&&i<t.anchorScrollList[e+1]){t.activeIdx=e;break}}
else{i=t.windowScrollTop+Math.round($(window).innerHeight());if(i<t.anchorScrollList[e]+$('[data-wv-menu-target]').eq(e).innerHeight()){t.activeIdx=e;break}}}};if(t.activeIdx>-1){var n=$('[data-wv-menu-target]').eq(t.activeIdx).attr('data-wv-menu-target');$(t.fixedHeaderMenu).find('[data-wv-menu-link="'+n+'"]').closest('li').addClass('active');$(t.originHeaderMenu).find('[data-wv-menu-link="'+n+'"]').closest('li').addClass('active')}}},initAnchorScrollList:function(){var t=this;if($('[data-wv-menu-target]').length>0){t.anchorScrollList=[];$('[data-wv-menu-target]').each(function(){t.anchorScrollList.push($(this).offset().top+$(t.fixedHeader).innerHeight())})}},onAnchorClick:function(){var t=this,e=$(t.originHeaderMenu).find('a[data-wv-menu-depth="1"]'),i=$(t.fixedHeaderMenu).find('a[data-wv-menu-depth="1"]');e.add(i).on('click',function(e){e.preventDefault();e.stopPropagation();var i=$(this).attr('data-wv-menu-link'),n=$('[id="'+i+'"]');if($(n).length>0){var o=($(n).offset().top-$(t.fixedHeader).innerHeight());TweenMax.to($('html,body'),0.6,{scrollTop:o,ease:Sine.easeOut,onComplete:function(){$(t.fixedHeaderMenu).find('li[data-wv-menu-depth="1"]').removeClass('active');$(t.fixedHeaderMenu).find('[data-wv-menu-link ="'+i+'"]').closest('li').addClass('active');location.hash=i}})}})},offAnchorClick:function(){var t=this,e=$(t.originHeaderMenu).find('a[data-wv-menu-depth="1"]'),i=$(t.fixedHeaderMenu).find('a[data-wv-menu-depth="1"]');e.add(i).off('click')},setUtilMenuVisiblePoint:function(t,e){var i=this,e=e?e:0;i.headerElVisibleOpt[t+'UtilMenuVisiblePoint']=$(window).width()+e},setGnbVisiblePoint:function(t,e){var i=this,e=e?e:0;i.headerElVisibleOpt[t+'gnbVisiblePoint']=$(window).width()+e},hideGnbScroll:function(t){if(t.length===0)return;var e=this,s=t.find('.gnb_wrap').closest('[data-wv-gnb]'),n=t.find('.gnb_wrap'),o=$(t).find('[data-wv-util-menu]'),i,l=t.attr('class').split(' ');bm.each(l,function(t,e){if(e&&e.indexOf('header_wrap')>-1){i=e}});if(!n||n.length===0||!i)return;var a=n.get(0).scrollWidth-parseInt(n.width()),r=o.width();if(e.hasScrollBar(n,'horizontal')){if(o.is(':visible')){o.hide();e.setUtilMenuVisiblePoint(i,a);e.headerElVisibleOpt['is'+i+'UtilMenuVisible']=!1};if(e.isSeparateHeader){e.setPaddingAfterSeparateHeader(e.headerWrapper)}};if(e.hasScrollBar(n,'horizontal')){if(!o.is(':visible')){s.hide();if(!e.headerElVisibleOpt[i+'gnbVisiblePoint']){e.setGnbVisiblePoint(i,a-r)}
else{e.setGnbVisiblePoint(i,a)};e.headerElVisibleOpt['is'+i+'UtilMenuVisible']=!1};if(e.isSeparateHeader){e.setPaddingAfterSeparateHeader(e.headerWrapper)}};if(e.headerElVisibleOpt['is'+i+'UtilMenuVisible']===!1){if($(window).width()>e.headerElVisibleOpt[i+'UtilMenuVisiblePoint']&&s.is(':visible')){o.css('display','');e.headerElVisibleOpt['is'+i+'UtilMenuVisible']=!0}
else if($(window).width()>e.headerElVisibleOpt[i+'gnbVisiblePoint']){s.css('display','')}}},hasScrollBar:function(t,e){if($(t).length===0)return!1;if(e==='horizontal'){return $(t).get(0).scrollWidth>Math.round($(t).width())}
else if(e==='vertical'){return $(t).get(0).scrollHeight>Math.round($(t).height())}
else{return!1}},setPaddingAfterSeparateHeader:function(t,e){var o=this;if(!t||t.length<1){t=$('[data-wv-inc^="header"]');t=t.length>0?t:o.originHeader};if(o.originHeader===null||o.originHeader.length<1){o.originHeader=t};var n,i=null;if(e!==null&&e!==undefined)i=e>0?e:'';if(!t.is(':visible'))i='';if(t.length>0&&(t.hasClass('separate')||t.find('.separate').length>0)){this.isSeparateHeader=!0;if(t.closest('[data-wv-layout-element="skin-page"]').length>0){if((t.closest('[data-wv-layout-element=block]').parent().attr('data-wv-layout-element')==='skin-page'||t.parent().closest('[data-wv-layout-element=block]').parent().attr('data-wv-layout-element')==='skin-page')&&t[0]===t.closest('[data-wv-layout-element="skin-page"]').find('[data-wv-design-area]')[0]){n=t.next();if(n.attr('id')==='dropArea'){n=t.next().next()};if(i===null)i=Math.round($(t).innerHeight());o.setContentBoxPadding(n,i)}}
else if(t.closest('[data-wv-layout-element="layout_screen"]').length>0&&t.closest('[data-wv-layout-element="layout_screen"]').find('> div > div')[0]===t[0]){n=t.next();if(i===null)i=Math.round($(t).innerHeight());n.css('padding-top',i)}
else{if($('.wrapper').length>0){if(i===null)i=Math.round($(o.originHeader).innerHeight());$('.wrapper').find('[data-wv-layout-element="skin-page"]').css('padding-top',i)}}}
else{this.isSeparateHeader=!1;if(t.closest('[data-wv-layout-element="skin-page"]').length>0){n=t.next();if(n.attr('id')==='dropArea'){n=t.next().next()};n.css('padding-top','')}
else{$('[data-wv-layout-element="layout_screen"]').find('[data-wv-layout-element="skin-page"]').css('padding-top','')}}},setContentBoxPadding:function(t,e){if($('#WEVEN_IFRAME').length>0||$(window.top.parent.document).find('#WEVEN_IFRAME').length>0){t.css({'padding-top':e,'box-sizing':'content-box'})}
else{t.css({'padding-top':e})}},setFullHeightAfterSeparateHeader:function(){if(!this.isSeparateHeader)return;var a=this.headerWrapper,s=a.css('height'),t=$(a).next().not('#dropArea'),e=[480,768,992,1200,1600],o=$(window).width();for(var n=1;n<e.length;n++){var i;if(o>=e[n-1]&&o<e[n])i=e[n-1];else if(o>=e[e.length-1])i=e[e.length-1];else if(o<e[0])i=e[0];if(i){if(t.attr('data-wv-full-height'+i)!==undefined){t.css('height','calc(100vh - '+s+')')}
else if(t.find('[data-wv-full-height'+i+']').length>0){t.find('[data-wv-full-height'+i+']').css('height','calc(100vh - '+s+')')}
else{t.css('height','');t.find('[data-wv-full-height1600]').css('height','');t.find('[data-wv-full-height1200]').css('height','');t.find('[data-wv-full-height992]').css('height','');t.find('[data-wv-full-height768]').css('height','');t.find('[data-wv-full-height480]').css('height','')};break}}},getExtraMenuHTML:function(t,e,i){var n='';for(var d=0;d<t.length;d++){var o=t[d],s=WEB_ROOT+o['uri'],p=[],l='',h='',u='',c='_self',a=parseInt(o['depth']);if(d===0&&e){n+='<ul data-wv-menu-depth=\''+a+'\' class=\'menu_con menu_depth_'+a+' gnb_con gnb_depth_'+a+'\'';if(i){n+=' data-wv-layout-element=\'block\''};n+='>'};var r=location.href;if(r&&r.indexOf(s)>-1){if(r.indexOf('?')>-1){if(s.indexOf('?')>-1&&(r.slice(r.indexOf('?'))===s.slice(s.indexOf('?')))){l='active'}}
else{l='active'}};if(o['children']&&o['children'].length>0)h='has_child';if(o['is_newtab'])c='_blank';if(o['login_required']&&loginSessionInfo.seq==='-99')u='login_required';p=[l,h,u];var f=p.join(' ');if(i){n+='<li data-wv-menu-depth=\''+a+'\' class=\''+f+'\' data-wv-layout-element=\'block\'>';n+='<a data-wv-menu-depth=\''+a+'\' href=\''+s+'\' target=\''+c+'\' class=\''+l+'\' data-wv-layout-element=\'block\' data-wv-layout-element-type=\'text\' data-wv-ineditable><span>'+o['name']+'</span></a>'}
else{n+='<li data-wv-menu-depth=\''+a+'\' class=\''+f+'\'>';n+='<a data-wv-menu-depth=\''+a+'\' href=\''+s+'\' target=\''+c+'\' class=\''+l+'\'><span>'+o['name']+'</span></a>'};if(h){n+=this.getExtraMenuHTML(o['children'],!0,i)};n+='</li>'};if(e)n+='</ul>';return n},hideMemberUtilMenu:function(){if(this.headerWrapper&&$(this.headerWrapper).length>0){$(this.headerWrapper).find('[data-wv-util-menu="member"]').hide()}
else{$('[data-wv-util-menu="member"]').hide()}},editInit:function(){var t=this;t.offAnchorClick();t.addEditInit()},addEditInit:function(){},editDestroy:function(){var t=this;$(t.originHeader).css('margin-top','');$(t.clickHeader).removeClass('active');$(t.clickHeaderDim).css('display','');$(t.fixedHeader).css('margin-top','');$(t.fixedHeader).removeClass('active');t.addEditDestroy()},addEditDestroy:function(){},removeEvent:function(){var t=this;$(t.clickHeaderOpenBtn).off('click');$(t.clickHeaderCloseBtn).off('click');$(t.clickHeaderOpenBtn).off('click');$(t.clickHeaderCloseBtn).off('click');$(t.clickHeaderDim).off('click')},setIsEditModeChecked:function(){var t=window;if(t.name=='WEVEN_IFRAME'||t.name=='wevenIframePreview')t=t.parent;var e=t.wvAdminIFrameBridge||t.parent.wvAdminIFrameBridge;if(e)this.isEditModeChecked=e.isEditModeChecked},registWebEvent:function(){if(this.isWebEventRegisted)return;var t=app.isEditMode&&this.isEditModeChecked?'click':'mouse';this.originHeaderMenuOnWebEvent(t);this.clickHeaderMenuOnWebEvent(t);if(this.isFixedExist)this.fixedHeaderMenuOnWebEvent(t);this.isWebEventRegisted=!0},removeWebEvent:function(t){if(!this.isWebEventRegisted)return;var e;if(t){e=app.isEditMode&&this.isEditModeChecked?'click':'mouse'}
else{e=app.isEditMode&&this.isEditModeChecked?'mouse':'click'};this.originHeaderMenuOffWebEvent(e);this.clickHeaderMenuOffWebEvent(e);if(this.isFixedExist)this.fixedHeaderMenuOffWebEvent(e);this.isWebEventRegisted=!1},registMobileEvent:function(){if(this.isMobileEventRegisted)return;this.originHeaderMenuOnMobileEvent();this.clickHeaderMenuOnMobileEvent();if(this.isFixedExist)this.fixedHeaderMenuOnMobileEvent();this.isMobileEventRegisted=!0},removeMobileEvent:function(){if(!this.isMobileEventRegisted)return;this.originHeaderMenuOffMobileEvent();this.clickHeaderMenuOffMobileEvent();if(this.isFixedExist)this.fixedHeaderMenuOffMobileEvent();this.isMobileEventRegisted=!1}};bm.scroll={delta:0,flag:!0,window:null,minOffsetTopList:[],maxOffsetTopList:[],offsetAreaList:[],areaList:null,direction:null,optionList:[],len:0,scrollTop:0,prevScrollTop:0,scrollBehavior:null,screenHeight:null,duration:300,easing:'linear',targetScrollValue:0,init:function(t){var e=this;this.window=t?t:window;this.areaList=$(this.window.document).find('[data-wv-event=\'scroll\']');this.len=this.areaList.length;this.screenHeight=$(this.window).outerHeight();this.scrollBehavior=$(this.window.document).find('html').css('scroll-behavior');setTimeout(function(){e.setOffsetTopList();e.prevScrollTop=$(e.window.document).scrollTop()},500);this.registEvent()},setOffsetTopList:function(){this.minOffsetTopList=[];this.maxOffsetTopList=[];this.offsetAreaList=[];for(var t=0;t<this.len;t++){var e=$(this.areaList[t]).offset().top,s=parseInt($(this.areaList[t]).css('margin-top').replace('px',''));if(s!=0){e=e-s};if(t==0)e=0;var d=$(this.areaList[t]).height(),r=$(this.areaList[t]).outerHeight(),l=parseInt(Math.ceil(r)),n=e+l,o=$(this.areaList[t]).attr('data-wv-event-option'),a=null;if(o&&o!=''){a=bm.parsing.parseStrToObj(o,null,!0)};this.optionList.push(a);var i={};if(this.minOffsetTopList.indexOf(e)===-1){i.min=parseInt(Math.round(e));this.minOffsetTopList.push(parseInt(Math.round(e)))};if(this.maxOffsetTopList.indexOf(n)===-1){i.max=parseInt(Math.round(n));this.maxOffsetTopList.push(parseInt(Math.round(n)))};this.offsetAreaList.push(i)}},getCurrentPositionIndex:function(t){var a=this,i=t?t:Math.ceil($(a.window.document).scrollTop()),s=-1;for(var e=0;e<this.len;e++){var n=this.minOffsetTopList[e],o=this.maxOffsetTopList[e];if(n<=i&&o>i){return e}};return s},getMoveOffsetTop:function(t){var e=-1;if(this.direction==='down'){e=this.maxOffsetTopList[t]!==undefined?this.maxOffsetTopList[t]:-1;if(e>$(this.window.document).scrollTop()+this.screenHeight){e=-1}}
else{if(t-1<0){t=0;e=this.minOffsetTopList[t]!==undefined?this.minOffsetTopList[t]:-1}
else if(t===1){e=this.maxOffsetTopList[t-1]!==undefined?this.maxOffsetTopList[t-1]:this.minOffsetTopList[t-1];if(e===undefined)e=-1}
else{e=this.minOffsetTopList[t-1]!==undefined?this.minOffsetTopList[t-1]:-1};var i=this.minOffsetTopList[t],o=this.maxOffsetTopList[t],n=o-i,a=$(this.window.document).scrollTop()-n;if(e<a){e=parseInt(Math.round(this.prevScrollTop))-n;if(e<i)e=i}};return e},moveScroll:function(t,e,i){e=e?e:0.5;TweenMax.killTweensOf(this.window.document.body);TweenMax.killTweensOf(this.window.document.documentElement);TweenMax.to(this.window.document.body,e,{scrollTop:t});TweenMax.to(this.window.document.documentElement,e,{scrollTop:t,onComplete:function(){if(i)i.call(this)}});this.targetScrollValue=t},mainThemePos:-1,registEvent:function(){var t=this,e=$(this.window.document).find('html,body');$(e).on('touchmove mousewheel scroll',function(i){setTimeout(function(){t.scrollTop=$(t.window.document).scrollTop();let isEditing=!1;if(window.top.parent.wvAdminIFrameBridge){isEditing=window.top.parent.wvAdminIFrameBridge.isEditModeChecked};if($(e).is(':animated')){return};if(!bm.isMobile&&$(t.window).outerWidth()>=992){var r=i.originalEvent;t.delta=0;if(r.detail){t.delta=r.detail*-40}
else{t.delta=r.wheelDelta};if(t.delta<0)t.direction='down';else if(t.delta>0)t.direction='up';var n=t.getCurrentPositionIndex(),o=t.optionList[n],a=t.duration,s=t.easing;if(o){a=o.duration?o.duration:a;s=o.easing?o.easing:s};if(t.flag===!0&&isEditing===!1){if(n>-1&&0<=t.scrollTop&&t.delta<0){t.mainThemePos=t.getMoveOffsetTop(n);if(t.mainThemePos>-1){t.flag=!1;if(t.scrollBehavior==='smooth'||t.scrollBehavior==='auto'){$(e).css('scroll-behavior','unset')};$(e).stop().animate({scrollTop:t.mainThemePos+'px'},{duration:a,easing:s,complete:function(){t.flag=!0;t.scrollTop=$(t.window.document).scrollTop();t.prevScrollTop=t.scrollTop;$(e).css('scroll-behavior','smooth')}})}}
else if(n>-1&&0<t.scrollTop&&t.delta>0){t.mainThemePos=t.getMoveOffsetTop(n);if(t.mainThemePos>-1){t.flag=!1;if(t.scrollBehavior==='smooth'||t.scrollBehavior==='auto'){$(e).css('scroll-behavior','unset')};$(e).stop().animate({scrollTop:t.mainThemePos+'px'},{duration:a,easing:s,complete:function(){t.flag=!0;t.scrollTop=$(t.window.document).scrollTop();t.prevScrollTop=t.scrollTop;$(e).css('scroll-behavior','smooth')}})}}}}},100)});$(this.window).on('resize',function(){t.setOffsetTopList()})}};$(function(){if(window.name&&window.name=='WEVEN_IFRAME'){setTimeout(function(){bm.scroll.init(window)},1000)}
else{bm.scroll.init()}});bm.dragDropUpload=function(t,e,i){this.init=function(){this.registEvent()};this.registEvent=function(){var a=wvAdminIFrameBridge._WVContentArea;t=t?t=t:t=a.$contentBody.find('#fileManagerUploadFormByDrop')[0];e=e?e=e:e=a.$contentBody.find('#filemanagerFileSelectByDrop')[0];$(t).attr('action',WEB_ROOT+'filemanager/uploadFile');var n=function(t){if(t.type.indexOf('image')<0){bm.toast('이미지 파일만 업로드 가능합니다.');return!1};if(t.length>1){bm.toast('파일은 하나씩 전송이 가능합니다.');return!1};if(t.size>=1024*1024*50){bm.toast('50MB 이상인 파일은 업로드할 수 없습니다.');return!1};return!0},o=function(e){var n=bm.formMultipart('fileManagerUploadFormByDrop'),o={'defaultPath':'','isOverride':1};n.extraData=o;n.form=t;n.start();e=e;i=i;n.onSubmitComplete=function(t){if(t.result){if(i){i(e,t)}}
else{console.log('이미지업로드 실패')}}};if(t&&e){t.addEventListener('dragenter',function(e){e.preventDefault();$(t).css({opacity:0.5})});t.addEventListener('dragover',function(t){t.preventDefault()});t.addEventListener('dragleave',function(e){e.preventDefault();$(t).css({opacity:1})});t.addEventListener('drop',function(i){i.preventDefault();$(t).css({opacity:1});e['files']=i.dataTransfer['files'];var a=e['files'][0];if(n(a)){o(a)}});e.addEventListener('change',function(t){if(n(this['files'][0])){o(file)}})}};this.init()};bm.valid={isRegistrationNumber:function(t){var e='[0-9]{6}(-|.|)[1|2|3|4]{1}[0-9]{6}';if(t.search(e)!=-1){return!0};return!1},isValidUrl:function(t){var e=new RegExp('^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+@:]*)*(\\?[;&a-z\\d%_.~+=-]*[;&a-z\\d%_.~+=|\\-_@:]*)?(\\#[-a-z\\d_]*)?$','i');if(!e.test(t)){return!1}
else{return!0}},isValidUrlRequireProtocol:function(t){var e=new RegExp('^(https?:\\/\\/)+((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+@]*)*(\\?[;&a-z\\d%_.~+=-@]*)?(\\#[-a-z\\d_]*)?$','i');if(!e.test(t)){return!1}
else{return!0}},isValidUrlNotProtocol:function(t){var e=new RegExp('^((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+@]*)*(\\?[;&a-z\\d%_.~+=-@]*)?(\\#[-a-z\\d_]*)?$','i');if(!e.test(t)){return!1}
else{return!0}},isBusinessRegistrationNumber:function(t){if(!t||(t.length!==10&&t.length!==12))return!1;var o=new Array(1,3,7,1,3,7,1,3,5,1),s,i,n=0,e,a;t=t.replace(/-/gi,'');for(i=0;i<=7;i++)n+=o[i]*t.charAt(i);e='0'+(o[8]*t.charAt(8));e=e.substring(e.length-2,e.length);n+=Math.floor(e.charAt(0))+Math.floor(e.charAt(1));a=(10-(n%10))%10;if(Math.floor(t.charAt(9))==a)return!0;return!1},isInKr:function(t){for(nindex=0;nindex<t.length;nindex++){str2=t.charAt(nindex);if((str2>='ㄱ'&&str2<='힣')){return!0}};return!1},isEmoji:function(t){var e=/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|[\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|[\ud83c[\ude32-\ude3a]|[\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g,i=/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g;if(e.test(t)||i.test(t)){return!0};return!1},onlyNumAndEnRegex:/[^\._A-Za-z0-9]{1,}/g,isOnlyNumAndEn:function(t){var e=this.onlyNumAndEnRegex;if(e.test(t)){return!1};return!0},onlyNumAndEnAnHyphenRegex:/[^\._A-Za-z0-9-]{1,}/g,isOnlyNumAndEnAndHyphen:function(t){var e=this.onlyNumAndEnAnHyphenRegex;if(e.test(t)){return!1};return!0},onlyNumAndKrRegex:/[^0-9가-힣ㄱ-ㅎㅏ-ㅣ\x20]{1,}/g,isOnlyNumAndKr:function(t){var e=this.onlyNumAndKrRegex;if(e.test(t)){return!1};return!0},onlyNumAndKrAndEnRegex:/[^0-9A-Za-z가-힣ㄱ-ㅎㅏ-ㅣ\x20]{1,}/g,isOnlyNumAndKrAndEn:function(t){var e=this.onlyNumAndKrAndEnRegex;if(e.test(t)){return!1};return!0},onlyKrRegex:/([^가-힣ㄱ-ㅎㅏ-ㅣ\x20])/ig,isOnlyKr:function(t){var e=this.onlyKrRegex;if(e.test(t)){return!1};return!0},onlyKrsyllableAndNum:/^[가-힣\s\d]+$/,isOnlyKrsyllableAndNum:function(t){var e=this.onlyKrsyllableAndNum;return e.test(t)},onlyNotKrRegex:/([가-힣ㄱ-ㅎㅏ-ㅣ])/ig,isOnlyNotKr:function(t){var e=this.onlyNotKrRegex;if(e.test(t)){return!1};return!0},onlyNumDotRegex:/[^\d.]/g,isOnlyNumDot:function(t){var e=this.onlyNumDotRegex;if(e.test(t)){return!1};return!0},onlyNumRegex:/[^\d]/g,isOnlyNum:function(t){var e=this.onlyNumRegex;if(e.test(t)){return!1};return!0},isOnlyNumWithNegative:function(t){return Number.isInteger(Number(t))},addCommaRegex:/(^[+-]?\d+)(\d{3})/,addComma:function(t){if(!t||t=='0'||t==0)return 0;var e=this.addCommaRegex;t+='';while(e.test(t)){t=t.replace(e,'$1,$2')};return t},onlyTextRegex:/[\d]/g,isOnlyText:function(t){var e=this.onlyTextRegex;if(e.test(t)){return!1};return!0},onlyEnRegex:/[^A-Za-z\s]/g,isOnlyEn:function(t){var e=this.onlyEnRegex;if(e.test(t)){return!1};return!0},onlyNotEnRegex:/[A-Za-z]/g,isOnlyNotEn:function(t){var e=this.onlyNotEnRegex;if(e.test(t)){return!1};return!0},isUpperCase:function(t){var e=t.toUpperCase();if(t===e){return!0}
else{return!1}},isEmail:function(t){var e=/^[A-Za-z0-9_\.\-]+@[-_A-Za-z0-9\-]+\.[A-Za-z0-9\-]+/;if(t.search(e)!=-1){return!0};return!1},isPhoneNumber:function(t){var e=/^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})-?[0-9]{3,4}-?[0-9]{4}$/;if(t.search(e)!=-1){return!0};return!1},isMobileNumber:function(t){var e=/^01[016789]-\d{3,4}-\d{4}$/g;if(t.search(e)!=-1){return!0};return!1},isInHtml:function(t){t=t.replace('<','<');t=t.replace('>','>');var e='<*[0-9a-zA-Z]*>';if(t.search(e)!=-1){return!0};return!1},isYYYYMMDD:function(t){var e=/^(19[2-9][0-9]|20\d{2})-(0[0-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/,i=/^(19[2-9][0-9]|20\d{2}).(0[0-9]|1[0-2]).(0[1-9]|[1-2][0-9]|3[0-1])$/;if(!e.test(t)&&!i.test(t)){return!1}
else{return!0}},checkPassword:function(t){var e=t,i=e.search(/[0-9]/g),n=e.search(/[a-z]/ig),o=e.search(/[`~!@@#$%^&*|₩₩₩'₩";:₩/?]/gi);if(e.length<10||e.length>20){return'10자리 ~ 20자리 이내로 입력해주세요.'};if(e.search(/₩s/)!=-1){return'비밀번호는 공백업이 입력해주세요.'};if((i<0&&n<0)||(n<0&&o<0)||(o<0&&i<0)){return'영문,숫자, 특수문자 중 2가지 이상을 혼합하여 입력해주세요.'};return!0},passwordValid:function(t){if(t.length<8){return!1};var e=/[0-9]/,i=/[a-zA-Z]/,n=/[~!@\#$%<>^&*]/;if(!e.test(t)||!i.test(t)||!n.test(t)){return!1};return!0},sourceJsErrorCheck:function(t){return!0;try{eval(t);return!0}catch(e){alert('입력된 js소스에 에러가 있습니다.\n 확인 후 다시입력해주세요. \n'+e);return!1}},hashTagValid:function(t){if(!t||t==''){alert('태그를 입력해주세요');return!1};if(t.indexOf('#')!==0){alert('단어에 반드시 해시태그(#)기 붙어야 합니다.');return!1};t=t.substring(1);var n=t.split(' #');for(var i=0;i<n.length;i++){var e=n[i];if(e.indexOf(' ')>-1){alert('해시태그에 공백이 포함되어있습니다. ( '+e+' )');return!1}
else if(!this.checkHtmlTag(e)){return!1}};return!0},tagLengthValid:function(t,e){if(!e){e=10};if(!t||t==''){alert('태그를 입력해주세요');return!1};if(t.indexOf('#')!==0){alert('단어에 반드시 해시태그(#)기 붙어야 합니다.');return!1};t=t.substring(1);var o=t.split(' #');for(var i=0;i<o.length;i++){var n=o[i];if(n.length>e){alert('태그 하나당 최대 글자수는 10자입니다.');return!1}
else if(!this.checkHtmlTag(n)){return!1}};return!0},checkHtmlTag:function(t){var e=new DOMParser().parseFromString(t,'text/html');if(Array.from(e.body.childNodes).some(node=>node.nodeType===1)){alert('HTML태그는 사용할 수 없습니다.');return!1};return!0},isValidJSON:function(t,e){try{JSON.parse(t);return!0}catch(i){if(e===!0&&loginSessionInfo&&String(loginSessionInfo.seq)==='-1'){console.warn('parsing이 불가능한 블록을 감지: '+i)};return!1}}};bm.formCheck=function(t,e,i,n,o,a,s){var u,h,g;if(t.length){u='';h=t}
else{u=document[t]};var g=e.length,l,c,m,p;n=n||[];i=i||[];o=o||'필수항목을 모두 채워주세요.';function B(t){var n=h.length,i=[];for(var e=0;e<n;e++){if(h[e].name==t){i.push(h[e])}};return i};if(h&&h.length>0){var w,f=[];for(var r=0;r<g;r++){w=e[r];f.push(B(w))};if(f.length==e.length){h=f}
else{alert('ERROR ==> valid체크를 하려는 elementList와 chkList의 name 수가 일치하지 않습니다.');console.log(f,name);return}};for(var r=0;r<g;r++){l=u==''?h[r]:u[e[r]];var x=a[r];if(x){var C=s[r],S=bm.dateCheck($(h[r]),C);if(!S){c=n[r]||o;alert(c);setTimeout(function(){$(h[r]).focus()});return!1}}
else{if(!l){alert('ERROR ==> form 에 없는 값을 체크하려 하였습니다. [ '+e[r]+' ]');return!1};m=i[r];c=n[r]||o;if(!l.type){var b=l[0].type,y=l.length,d;if(b=='radio'||b=='checkbox'){var v=null;for(d=0;d<y;d++){if(l[d].checked&&l[d].value){v=l[d].value;break}};if(!v){l[0].focus();alert(c);return!1}}
else{for(d=0;d<y;d++){p=T(l[d],m,c);if(p==!1)return!1}}}
else{p=T(l,m,c);if(p==!1)return!1}}};function T(t,e,i){if(!t.value||t.value==e){var n=$(t),o=n.is('[disabled]');n.removeAttr('disabled');if(o){n.attr('disabled','disabled')};alert(i);setTimeout(function(){n.focus()});return!1}
else{return!0}};return!0};bm.radioAndCheckboxDefaultValueCheck=function(t,e){var i=t,n={};$(t).find('input[type="checkbox"]').each(function(){if(this.name.indexOf('[]')===-1){if(this.checked){if(this.getAttribute('data-wv-check-value')){e[this.name]=this.getAttribute('data-wv-check-value')}}
else{if(this.getAttribute('data-wv-nocheck-value')){e[this.name]=this.getAttribute('data-wv-nocheck-value')}
else{if(!e[this.name])e[this.name]=0}}}});return e};bm.dateCheck=function(t,e){var i=t.val();if(!i)return!1;var l=!1,n;if(e=='-')n=/^\d{4}\-\d{2}\-\d{2}$/;else if(e=='.')n=/^\d{4}\.\d{2}\.\d{2}$/;else if(e=='/')n=/^\d{4}\/\d{2}\/\d{2}$/;else{return!1};if(!n.test(i)){alert('날짜 형식이 올바르지 않습니다.\nYYYY'+e+'MM'+e+'DD');t.focus();return!1}
else{var a=i.split(e)[0],s=i.split(e)[1],r=i.split(e)[2],o=new Date(a,s-1,r);if((o.getMonth()+1!=s)||(o.getDate()!=r)||(o.getFullYear()!=a)){alert('날짜 형식이 올바르지 않습니다.\nYYYY'+e+'MM'+e+'DD');t.focus();return!1}
else{l=!0}};return l};bm.wvValidCheck=function(t){var p=$(t).find('[data-wv-valid]'),s=[],r=[],l=[],a=[],e=[];p.each(function(){if($(this).is(':visible')==!1){if($(this).attr('data-wv-com')=='selectbox'){var n=app.getWvCom($(this).attr('id')).dom;if($(n).is(':visible')==!1){return}}
else{return}};var i=$(this).attr('name');if(i!=null&&i!=''){var t=bm.parsing.parseStrToObj($(this).attr('data-wv-handler'));s.push($(this).attr('name'));l.push($(this).attr('data-wv-valid'));r.push(this);if(t.type=='datepicker'){a.push(!0);if(t.separator)e.push(t.separator);else e.push('-')}
else{a.push(!1);e.push('')}}});var f=bm.formCheck(r,s,[],l,null,a,e);if(f==!1)return!1;var o=!1,c=$(t).find('[data-wv-valid-max-len]');c.each(function(){if(o)return;var e=parseInt($(this).attr('data-wv-valid-max-len')),i=$(this).val();if(i.length>e){var t=$(this).attr('data-wv-valid-label');if(t=='')t='[data-wv-valid-label]';alert(t+'은/는 최대 '+e+'자만 입력 가능합니다.');o=!0;$(this).focus();$(window).scrollTop($(this).position().top)}});if(o)return!1;var n=!1,h=$(t).find('[data-maxbyte]');h.each(function(){if(n)return;var t=parseInt($(this).attr('data-maxbyte')),i=$(this).val();if(bm.string.getByte(i)>t){var e=$(this).attr('data-wv-valid-label');if(e){alert(e+'은/는 최대 '+t+'Byte(s)만 입력 가능합니다.')}
else{alert(i+'는 최대 '+t+'Byte(s)를 초과합니다.')};n=!0;$(this).focus();$(window).scrollTop($(this).position().top)}});if(n)return!1;var i=!1,d=$(t).find('[data-wv-valid-regex]');d.each(function(){if(i)return;var t=$(this).attr('data-wv-valid-regex');if(t.indexOf('/')==0){t=t.substr(1)}
else{throw new Error('pattern은 /pattern/flag 형식의 값으로 구성되어야 합니다.')};var a=t.lastIndexOf('/'),r=null;if(a>-1){r=t.substr(a+1);t=t.substr(0,a)};var d=new RegExp(t,r),s=$(this).val();if(s!=''&&d.test(s)==!1){var n=$(this).attr('data-wv-valid-label');if(n=='')n='[data-wv-valid-label]';var o=$(this).attr('data-wv-valid-regex-msg');if(o=='')o='[data-wv-valid-regex-msg]';var e=$(this),l=e.is('[disabled]');e.removeAttr('disabled');e.focus();$(window).scrollTop(e.position().top);if(l){e.attr('disabled','disabled')};alert(((n==null||n=='')?'':(n+'은/는 '))+o);i=!0}});if(i)return!1;return!0};bm.focus=function(t,e,i){var l='#ef72b7',d=0,c=3,f=null;if(typeof t==='string')t=$(t);t=t[0]?t:$(t);e=e?e:'border';var n;switch(e){case'border':n='borderColor';break;case'background':n='backgroundColor';break;case'color':n=e;break;default:n='backgroundColor';break};i=i?i:0;var r=t[0].style[n],h=t[0].tagName.toLowerCase();function p(){TweenMax.to($(t),0.3,{borderColor:l,onComplete:function(){d++;if(c-1<=d){clearInterval(f);t.css(n,r)}}})};if(h=='input'){var s=t.attr('type');if(s=='radio'||s=='checkbox'||s=='file'){var a=t.offset().top,o=a-i;if(o<0)o=0;$(window).scrollTop(o)}
else{t.focus()}}
else{var a=t.offset().top,o=a-i;if(o<0)o=0;$(window).scrollTop(o)};t.css(n,l);setTimeout(function(){t.css(n,r)},2000)};bm.filter=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var n=$(t).attr('data-wv-bind'),i=new BMFilter();i.init(t,e,n);i.registEvent();return i};var BMFilter=function(){this.type='BMFilter';this.onSubmitReady=null;this.choiceList=[]};BMFilter.SEARCH_CLICK='SEARCH_CLICK';BMFilter.ADD_CLICK='ADD_CLICK';BMFilter.DOWNLOAD_EXCEL='DOWNLOAD_EXCEL';BMFilter.prototype={init:function(t,e,i){this.type='BMFilter';this.container=t;this.bindTargetID=i;this.op=e;this.wrapper=e.wrapper;this.buttonList=[];this.param=null;var n=this;$(this.container).find('[data-wv-type=choice]').each(function(){var t=$(this).attr('id'),e=app.getWvElement(t);n.choiceList.push(e)});this.id=$(t).attr('id')},reset:function(){bm.formUtil.reset(this.container);this.param=null},binding:function(){if(this.bindTargetID){var t=this.bindTargetID.split(',');t=bm.string.trimList(t);var e=t.length;while(e--){if(app.getWvElement(t[e]))app.getWvElement(t[e]).bindFilter(this)}}},registEvent:function(){var t=this;$(this.container).on('click','[data-wv-filtersubmit]',function(e){var i=bm.getParamList();if(app.isEditMode&&i['isCustomCrawling']&&!app.childApp&&app.parentApp){window.parent.bm.toast('편집화면에서는 검색이 불가능합니다.');return!1};if(t.onSubmitReady){if(t.onSubmitReady.call(t,!0)==!1)return};e.stopPropagation();t.submit(!0)});$(this.container).find('input').off('keypress');$(this.container).find('input').on('keypress',function(e){if(e.which==13){if(t.onSubmitReady){if(t.onSubmitReady.call(t,!0)==!1)return};e.stopPropagation();t.submit(!0)}});$(this.container).on('click','[data-wv-downloadexcel]',function(e){e.stopPropagation();var i=$(this).attr('data-wv-downloadexcel');i=bm.parsing.parseStrToObj(i);t.downloadExcel(i)})},submit:function(t){if(this.op['ignoreValidCheck']==undefined||this.op['ignoreValidCheck']==!0||bm.wvValidCheck(this.container)){this.param=this.makeParamToSearch(t);events(this).dispatch(BMFilter.SEARCH_CLICK)}},downloadExcel:function(t){if(bm.wvValidCheck(this.container)){this.param=t.param||{};this.param=$.extend(this.param,this.makeParamToSearch());events(this).dispatch(BMFilter.DOWNLOAD_EXCEL,t)}},show:function(){$(this.container).show();if(this.wrapper)$(this.wrapper).show()},hide:function(){$(this.container).hide();if(this.wrapper)$(this.wrapper).hide()},makeParamToSearch:function(t){var e={};var i=this;function n(t){if(!t||t==''||t===undefined)return t;var e=/,/g;t=t.replace(e,'{comma}');e=/&/g;t=t.replace(e,'{and}');return t};$(this.container).find('[data-wv-key]').each(function(){var o={key:$(this).attr('data-wv-key'),value:bm.dom.getValueByFormElement(this,i.container)};if($(this).attr('data-wv-selected-value')){o.value=$(this).attr('data-wv-selected-value')};var a=n(o.value);if(o.key!==undefined){if(t){if(o.key.indexOf('[]')>-1){if(!a)a='null';if(e[o.key]!=undefined){e[o.key]+=','+(a)}
else{e[o.key]=(a)}}
else{if(!a)a='null';e[o.key]=(a)}}
else if(a!==0&&a){if(o.key.indexOf('[]')>-1){if(e[o.key]!=undefined){e[o.key]+=','+(a)}
else{e[o.key]=(a)}}
else{e[o.key]=(a)}}}});$(this.container).find('[data-wv-keySelector]').each(function(){var t={key:bm.dom.getValueByFormElement($($(this).attr('data-wv-keySelector')),i.container),value:bm.dom.getValueByFormElement(this,i.container)};v=n(t.value);if(t.key!==undefined&&v!==0&&v){e[t.key]=(v)}});return e},destroy:function(){$(this.container).find('input').off('keypress');var t=this.buttonList.length;while(--t){$(this.buttonList[t]).off('click')}}};bm.choice=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var n=$(t).attr('data-wv-bind'),i=new BMChoice();i.init(t,e,n);i.registEvent();return i};var BMChoice=function(){this.type='BMChoice';this.selectType='';this.loaded=!1;this.dataKey='data.result';this.wrapper;this.id;this.param;this.data;this.dataOrigin;this.dataList=[];this.choiceList=[];this.defaultAddedIndex=0;this.template;this.templateParent;this.container;this.onLoadStart=null;this.onLoad=null;this.onComplete=null;this.onAdd=null;this.onRemove=null;this.loadStatus=!0;this.isBind=!1;this.dataAutoLoad=!1;this.bindedView=!1;this.defaultValue=null;return this};BMChoice.HIDE='BMChoice.HIDE';BMChoice.SHOW='BMChoice.SHOW';BMChoice.CHANGE='BMChoice.CHANGE';BMChoice.prototype={init:function(t,e,i){this.url=e.url;this.dataType=e.dataType||'json';this.dataKey=e.dataKey||'data.result';this.method=e.method||'POST';this.wrapper=e.wrapper;this.id=$(t).attr('id');this.param={};if(e.param){this.setParam(e.param)};this.data=null;this.dataOrigin=null;if($('#'+this.id).attr('data-wv-selected-value')){this.defaultValue=$('#'+this.id).attr('data-wv-selected-value')};this.dataAutoLoad=e.dataAutoLoad===!0||e.dataAutoLoad==='true'?!0:!1;this.container=t;if($(this.container).find('[data-wv-choice-template]').length==0){alert('data-wv-choice-template 이 없습니다. ');return};this.template=$(this.container).find('[data-wv-choice-template]')[0].outerHTML;this.templateParent=$(this.container).find('[data-wv-choice-template]').parent();if($(this.container).is('select')||$(this.container).find('select').length>0){this.selectType='select';var n=null;if($(this.container).is('select')){n=this.container}
else{n=$(this.container).find('select')}}
else if($(this.container).find('radio').length>0){this.selectType='radio'};this.bindTargetID=i},appDefaultCheck:function(){$(this.container).find('[data-wv-choice-template]').remove();if($(this.container).is('select')||$(this.container).find('select').length>0){var t=null;if($(this.container).is('select')){t=this.container}
else{t=$(this.container).find('select')};this.defaultAddedIndex=$(t).find('option').length}
else if($(this.container).find('radio').length>0){this.defaultAddedIndex=$(this.container).find('radio').length};if(this.dataAutoLoad&&this.bindedView==!1)this.load()},getSelectedIndex:function(){if($(this.container).is('select')||$(this.container).find('select').length>0){this.selectType='select';var t=null;if($(this.container).is('select')){t=this.container}
else{t=$(this.container).find('select')};return $(t).prop('selectedIndex')}
else if($(this.container).find('radio').length>0){var e=$(_this.container).find('radio');return e.index(e.find(':checked'))};return-1},getSelectedData:function(){if(this.getSelectedIndex()==-1){return null}
else{return this.dataList[this.getSelectedIndex()-this.defaultAddedIndex]}},setSelectedIndex:function(t){if($(this.container).is('select')||$(this.container).find('select').length>0){this.selectType='select';var e=null;if($(this.container).is('select')){e=this.container}
else{e=$(this.container).find('select')};$(e).find('option').eq(t).prop('selected',!0)}
else if($(this.container).find('radio').length>0){var i=$(_this.container).find('radio');i.prop('checked',!1);i.eq(t).prop('checked',!0)}},setSelectedData:function(t){if($(this.container).is('select')||$(this.container).find('select').length>0){this.selectType='select';var e=null;if($(this.container).is('select')){e=this.container}
else{e=$(this.container).find('select')};$(e).val(t)}
else if($(this.container).find('radio').length>0){var i=$(_this.container).find('radio');i.prop('checked',!1);i.filter('[value='+t+']').prop('checked',!0)}},refresh:function(){this.load()},setViewWithLoad:function(t){this.load(t)},setViewWithSync:function(t){var i=this.dataKey.split('.');if(i.length<1||i.length==1&&i[0]=='data'){i[0]='data';i[1]='result'}
else if(i[0]!=='data'){i.unshift('data')};if(!t['data']){if(i[1]=='result'&&!t['result']){t={result:t}};t={data:t}}
else{if(i[1]=='result'&&!t.data['result']){t.data={result:t}}};this.dataOrigin=t;var a=i.length,o=t;for(var n=0;n<a;n++){try{o=o[i[n]]}catch(e){if(t.result===!1){alert(t.message)}
else{alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.')};if(this.onLoad)this.onLoad(t);if(this.onComplete)this.onComplete(t);return}};if(this.onLoad)this.onLoad(t);this.setView(o);if(this.onComplete)this.onComplete(t)},registEvent:function(){var t=this,i=$('#'+this.id);if(this.selectType=='select'){$('body').on('change','#'+this.id,function(e){e.stopPropagation();i.attr('data-wv-selected-value',this.value);events(t).dispatch(BMChoice.CHANGE,t)})}
else if(this.selectType=='radio'){$(this.container).on('change','radio',function(e){e.stopPropagation();events(t).dispatch(BMChoice.CHANGE,t)})};if(this.bindTargetID&&this.isBind==!1){var e=app.getWvElement(this.bindTargetID);events(e).addListener(BMChoice.CHANGE,function(e){t.load()});this.isBind=!0}},binding:function(){},resetChoice:function(){var e=this.choiceList.length;for(var t=0;t<e;t++){$(this.choiceList[t]).remove()};$('#'+this.id).attr('data-wv-selected-value','');this.choiceList.length=0;this.dataList.length=0},addChoice:function(t){var i=t?bm.dom.convertVariables(t,this.template):this.template,e=$(i).appendTo(this.templateParent);if(!t)bm.formUtil.reset(e);t=t?t:{};if(this.onAdd&&this.onAdd(e,t)===!1){$(e).remove();return};$(e).show();app.wvHandlerCrawling(e);app.additionalCrawling(e);this.choiceList.push(e[0]);this.dataList.push(t)},removeChoice:function(t){if(t['length']&&t['length']>0){t=t[0]};var e=this.choiceList.indexOf(t);if(this.onRemove&&this.onRemove(t,this.dataList[e])===!1)return;this.choiceList.splice(e,1);this.dataList.splice(e,1);$(t).off();$(t).remove()},setParam:function(t){this.param=t},addParam:function(t){if(!this.param)this.param={};for(var e in t){this.param[e]=t[e]}},setChoiceWithLoad:function(){this.load()},setChoiceWithSync:function(t){if(!t)return;this.setChoiceData(t);if(this.onComplete)this.onComplete(result)},cancelLoad:function(){this.loadStatus=!1},setChoiceData:function(t){if(!t)return;var n=this.dataKey.split('.');if(n.length<1||n.length==1&&n[0]=='data'){n[0]='data';n[1]='result'}
else if(n[0]!=='data'){n.unshift('data')};var o=n.length,c,d,h;d=t;for(var i=0;i<o;i++){var a=n.slice(0,i+1).join('.');if(!bm.object.isExistKey(t,a)){a=n.slice(0,i).join('.');h=bm.object.getObjAtKeyList(t,a);bm.object.insertWrapKey(t,a,n[i])}};this.dataOrigin=t;var o=n.length,s=t;for(var i=0;i<o;i++){try{s=s[n[i]]}catch(e){if(t.result===!1){alert(t.message)}
else{alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.')};return}};this.data=s;if(this.choiceList.length>0){this.resetChoice()};if(this.container!==$('#'+this.id)[0]){this.container=$('#'+this.id)[0];this.templateParent=$(this.container).find('[data-wv-choice-template]').parent();$(this.templateParent).find('[data-wv-choice-template]').remove()};o=this.data.length;for(i=0;i<o;i++){this.addChoice(this.data[i])};if($('#'+this.id).attr('data-wv-selected-value')){var l=$('#'+this.id).attr('data-wv-selected-value');this.setSelectedData(l);events(this).dispatch(BMChoice.CHANGE,this)};if($(this.container).attr('data-wv-com')!==undefined){if($(this.container).attr('data-wv-com')=='selectbox'){var r=app.getWvCom(this.id);r.renderOption()}}},load:function(){if(this.bindTargetID){var o=app.getWvElement(this.bindTargetID),n=o.getSelectedData();if(n){this.addParam(n)}
else{this.resetChoice();events(this).dispatch(BMChoice.CHANGE,this);return}};if(this.onLoadStart)this.onLoadStart.call(this);if(this.loadStatus==!1){this.loadStatus=!0;return};var t=this,i={};for(var e in this.param){i[e]=this.param[e]};bm.httpSend(this.url,i,a,this.dataType,this.method,10000,!1,!1);var t=this;function a(e){if(e.result===!1){alert(e.message);if(t.onLoad)t.onLoad(e);if(t.onComplete)t.onComplete(e);alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.');return};t.loaded=!0;if(t.onLoad)t.onLoad(e);t.setChoiceData(e);if(t.onComplete)t.onComplete(e);return t}},show:function(){if(this.viewStatus!=1){this.viewStatus=1;if(this.loaded==!1&&this.dataAutoLoad)this.load();$(this.container).show();if(this.wrapper)$(this.wrapper).show();events(this).dispatch(BMChoice.SHOW,this)}},hide:function(){if(this.viewStatus!=0){this.viewStatus=0;$(this.container).hide();if(this.wrapper)$(this.wrapper).hide();events(this).dispatch(BMChoice.HIDE,this)}}};bm.list=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var i=new BMList();i.init(t,e);i.registEvent();return i};var BMList=function(){this.type='BMList';this.txtNoDataTarget=null;try{this.txtNoData=$('<div class=\'col-12 nodata tc pt15 pb15\'><div class=\'nodata_img\'><span>조회결과가 없습니다.</span></div></div>')}catch(t){throw t};this.txtNoData.hide();this.wrapper=null;this.initialLoaded=!1;this.directViewLoad=!1;this.loaded=!1;this.viewStatus=-1};BMList.SHOW='bmlistShow';BMList.HIDE='bmlistHide';BMList.prototype={init:function(t,e){this.filterObject=null;this.pagingObject=null;this.viewObject=null;this.updateObject=null;this.insertObject=null;this.id=$(t).attr('id');this.param={};this.data=null;this.dataOrigin=null;this.onLoadStart=null;this.onLoad=null;this.onComplete=null;this.dataAutoLoad=!0;this.onSelectItem=null;this.container=t;this.dataAutoLoad=e.dataAutoLoad===!1||e.dataAutoLoad==='false'?!1:!0;this.url=e.url;if(this.url&&this.url.indexOf('[WEB_ROOT]')>-1){this.url=this.url.replace('[WEB_ROOT]',WEB_ROOT)};if(this.url&&this.url.indexOf('previewAiPage')>-1){var i=this.url.split('previewAiPage');this.url=i[0]};this.dataType=e.dataType||'json';this.method=e.method||'POST';this.wrapper=e.wrapper||null;this.setTemplate();if(e.param){this.setParam(e.param)};if($(this.templateParent).closest('table').length>0){$(this.templateParent).closest('table').after(this.txtNoData)}
else{$(this.templateParent).after(this.txtNoData)};this.allCommentList=null;this.allCommentCnt=0;this.originCommentList=null},setContainer:function(t){this.container=t},setTemplate:function(){if($(this.container).find('[data-wv-template-extra]').length>0){this.extraTemplate=$(this.container).find('[data-wv-template-extra]')[0].outerHTML;this.extraTemplateParent=$(this.container).find('[data-wv-template-extra]').parent();this.extraTemplateParent.attr('data-wv-template-parent-extra',this.id);this.extraTemplateCnt=parseInt($(this.container).find('[data-wv-template-extra]').attr('data-wv-template-extra-cnt'))}
else if($(this.container).find('[data-wv-template-parent-extra=\''+this.id+'\']').length>0){this.extraTemplateParent=$(this.container).find('[data-wv-template-parent-extra=\''+this.id+'\']');$(this.extraTemplateParent).empty()};if($(this.container).find('[data-wv-template]').length>0){this.template=$(this.container).find('[data-wv-template]')[0].outerHTML;this.templateParent=$(this.container).find('[data-wv-template]').parent();this.templateParent.attr('data-wv-template-parent',this.id)}
else if($(this.container).find('[data-wv-template-parent=\''+this.id+'\']').length>0){this.templateParent=$(this.container).find('[data-wv-template-parent=\''+this.id+'\']');$(this.templateParent).empty()}},setData:function(t){this.data=t;this.dataOrigin=t},setNoData:function(t,e){this.txtNoData.remove();this.txtNoData=$(t);if(e){this.txtNoDataTarget=$(e)};if(this.txtNoDataTarget){this.txtNoDataTarget.html(this.txtNoData)}
else{if($(this.templateParent).closest('table').length>0){$(this.templateParent).closest('table').after(this.txtNoData)}
else{$(this.templateParent).after(this.txtNoData)}}},setNoDataView:function(t){this.txtNoData.html(t)},directViewWithSync:function(t){},bindPaging:function(t){this.pagingObject=t;events(this.pagingObject).addListener(BMPaging.PAGE_CLICK,i);var e=this;function i(t){e.addParam(t.data);e.load()}},excelPopup:null,isDownloadExcel:!1,bindFilter:function(t){this.filterObject=t;events(this.filterObject).addListener(BMFilter.SEARCH_CLICK,i);events(this.filterObject).addListener(BMFilter.DOWNLOAD_EXCEL,n);var e=this;function i(){e.load()};function o(){console.log('open')};function n(t){if(!t||!t.data||!t.data.url){alert('다운로드를 위한 url 이 정의되지 않았습니다.');return};try{if(e.isDownloadExcel){alert('현재 다운로드 진행중인 엑셀파일이 존재합니다.');return};e.isDownloadExcel=!0;e.excelPopup=window.open(t.data.url,'엑셀 다운로드');e.excelPopup.onbeforeunload=function(){e.isDownloadExcel=!1;e.excelPopup=null}}catch(i){}}},bindUpdate:function(t){this.updateObject=t;var e=this;events(this.updateObject).addListener(BMUpdate.SHOW,function(){e.hide()});events(this.updateObject).addListener(BMUpdate.HIDE,function(){e.showAndRefresh()})},bindInsert:function(t){this.insertObject=t;var e=this;events(this.insertObject).addListener(BMInsert.SHOW,function(){e.hide()});events(this.insertObject).addListener(BMInsert.HIDE,function(){e.showAndRefresh()})},bindView:function(t){this.viewObject=t;var e=this;events(this.viewObject).addListener(BMView.SHOW,function(){e.hide()});events(this.viewObject).addListener(BMView.HIDE,function(){if(e.directViewLoad&&bm.getParam('bmDirect')){var i=bm.getParamList();delete i['bmDirect'];var n=bm.makeQueryString(i),t=location.href.slice(0,location.href.indexOf('?'));t=t+'?'+n;app.removePageInfo();location.href=t}
else{e.showAndRefresh()}})},getDataItem:function(t,e){if(this.data&&this.data[t])return this.data[t];else if(this.data&&this.data.length){var o=null,n=this.data.length;for(var i=0;i<n;i++){if(this.data[i][t]==e)return this.data[i]}};return null},registEventRow:function(t,e,i){if(this.onSelectItem){var n=this;$(t).off('click');$(t).on('click',function(o){n.onSelectItem(t,e,i,o)});$(t).on('keyup',function(o){if(o.keyCode===13)n.onSelectItem(t,e,i,o)})}},registEvent:function(){var t=this;$(this.container).on('click','[data-wv-click-href]',function(t){t.stopPropagation();var e=$(this).attr('data-wv-click-href');location.href=e});$(this.container).on('keyup','[data-wv-click-href]',function(t){t.stopPropagation();if(t.keyCode==13){var e=$(this).attr('data-wv-click-href');location.href=e}});$(this.container).on('click','[data-wv-clickview-load]',function(e){e.stopPropagation();var i=$(this).attr('data-wv-clickview-load');i=bm.parsing.parseStrToObj(i);if(t.viewObject)t.viewObject.setViewWithLoad(i)});$(this.container).on('click','[data-wv-clickview-sync]',function(e){e.stopPropagation();var i=$(this).attr('data-wv-clickview-sync');i=bm.parsing.parseStrToObj(i);var o,a;for(var n in i){o=n;a=i[n]};var s=t.getDataItem(o,a);if(t.viewObject)t.viewObject.setViewWithSync(s)});$(this.container).on('click','[data-wv-clickupdate-sync]',function(e){e.stopPropagation();var i=$(this).attr('data-wv-clickupdate-sync');i=bm.parsing.parseStrToObj(i);var o,a;for(var n in i){o=n;a=i[n]};var s=t.getDataItem(o,a);if(t.updateObject)t.updateObject.setViewWithSync(s)});$(this.container).on('click','[data-wv-clickupdate-load]',function(e){e.stopPropagation();var i=$(this).attr('data-wv-clickupdate-load');i=bm.parsing.parseStrToObj(i);var o,a;for(var n in i){o=n;a=i[n]};var s=t.getDataItem(o,a);if(t.updateObject)t.updateObject.setViewWithLoad(s)});$(this.container).on('click','[data-wv-checkbox-header] input[type="checkbox"]',function(e){e.stopPropagation();t.toggleCheckbox()})},setParam:function(t){this.param=t},addParam:function(t){if(!this.param)this.param={};for(var e in t){this.param[e]=t[e]}},setUrl:function(t){this.url=t},showAndRefresh:function(){if(this.viewStatus!=1){this.load();this.show()}},refresh:function(){this.load()},load:function(t,e){this.initialLoaded=!0;if(this.url==null)return;if(this.onLoadStart)this.onLoadStart();if(t)this.onComplete=t;if(e)this.onLoad=e;var a=this,n={};for(var i in this.param){n[i]=this.param[i]};if(this.filterObject!=null){var o=this.filterObject.param;for(var i in o){n[i]=o[i]}};if(this.pagingObject!=null){n['paging_type']=this.pagingObject.pagingType};bm.httpSend(this.url,n,function(){a.onDataLoaded.apply(a,arguments)},this.dataType,this.method,180000,!1,!1)},onDataLoaded:function(t){if(this.container&&!this.container.isConnected){this.setContainer($('#'+this.id)[0]);this.setTemplate()};this.data=t.data;this.loaded=!0;if(this.onLoad)this.onLoad(t);this.render();if(this.onComplete)this.onComplete(t);return this},show:function(){if(this.viewObject){app.removePageInfo()};if(this.viewStatus!=1){this.viewStatus=1;if(this.loaded==!1&&this.dataAutoLoad)this.load();$(this.container).show();if(this.wrapper)$(this.wrapper).show();if(this.filterObject)this.filterObject.show();if(this.pagingObject)this.pagingObject.show();events(this).dispatch(BMList.SHOW,this)}},hide:function(){if(this.viewStatus!=0){this.viewStatus=0;$(this.container).hide();if(this.wrapper)$(this.wrapper).hide();if(this.filterObject)this.filterObject.hide();if(this.pagingObject)this.pagingObject.hide();events(this).dispatch(BMList.HIDE,this)}},render:function(){var o=this,a=!1;if(this.pagingObject!=null&&this.pagingObject.pagingType==BMPaging.PAGE_MORE){a=!0;if(this.data!=null&&this.data.pagingInfo!=null){if(this.data.pagingInfo.totalPage==0||this.data.pagingInfo.currentPage==this.data.pagingInfo.totalPage){this.pagingObject.$buttonContainer.hide();if(this.pagingObject.isScrollEvent==!0){this.pagingObject.scrollEventOFF()}}
else{this.pagingObject.$buttonContainer.show();if(this.pagingObject.isScrollEvent==!1){if(o.data&&o.data.pagingInfo){this.pagingObject.scrollEventON(function(){var t={data:{_this:o.pagingObject,_type:'m'}};o.pagingObject._onClickSinglePage(t)})}}}}}
else if(this.pagingObject!=null&&this.pagingObject.pagingType==BMPaging.PAGE_MORE_CLICK){a=!0;if(this.data!=null&&this.data.pagingInfo!=null){if(this.data.pagingInfo.totalPage==0||this.data.pagingInfo.currentPage==this.data.pagingInfo.totalPage){this.pagingObject.$buttonContainer.hide()}
else{this.pagingObject.$buttonContainer.show()}}}
else{$(this.templateParent).empty();$(this.extraTemplateParent).empty()};if(this.data==null||this.data.result==null||this.data.result.length==0){if(this.txtNoDataTarget){this.txtNoDataTarget.html(this.txtNoData)}
else{if(this.txtNoData.find('span')!==''){this.txtNoData.find('span').show()};this.txtNoData.show()};if(this.pagingObject!=null){this.pagingObject.setPageButton(1,-1,1);this.pagingObject.setSelectedIndex(1)}}
else{var e=0,r=1,l=1,i;if(this.pagingObject!=null&&this.data.pagingInfo!=null){r=this.data.pagingInfo.count-(this.data.pagingInfo.currentPage-1)*this.pagingObject.getNumPerPage();l=-1;var n=this.data.pagingInfo;if(a&&n.currentPage>1){e=n.numPerPage*(n.currentPage-1);if(n.notice_count&&parseInt(n.notice_count)>0){e+=parseInt(n.notice_count)}}};let errorPreventIdx=0;for(var t=0;t<this.data.result.length;t++){if(!this.data.result[t]){if(parseInt(loginSessionInfo['seq'])===-1){console.error('crud데이터리스트에 undefined가 있어 대체데이터로 대체합니다.\n대체한 데이터idx: '+t+'\n대체된 데이터idx: '+errorPreventIdx)};this.data.result[t]=this.data.result[errorPreventIdx];errorPreventIdx++};if(this.data.pagingInfo==null){this.data.result[t]['display_no']=this.data.result.length-t}
else if(t<this.data.pagingInfo.offset){this.data.result[t]['display_no']='-'}
else{if(this.data.pagingInfo.offset){this.data.result[t]['display_no']=(r+l*t)+this.data.pagingInfo.offset}};if(this.extraTemplate&&this.extraTemplateParent){if(t<this.extraTemplateCnt){i=bm.dom.singleInterpreter(this.data.result[t],this.extraTemplate,this.extraTemplateParent,!1,e)}
else{i=bm.dom.singleInterpreter(this.data.result[t],this.template,this.templateParent,!1,e)}}
else{i=bm.dom.singleInterpreter(this.data.result[t],this.template,this.templateParent,!1,e)};if($(i).find('a').length===0&&$(i).attr('tabindex')===undefined)$(i).attr('tabindex',0);this.registEventRow(i,this.data.result[t],e);e++};if(this.txtNoData.find('span')!==''){this.txtNoData.find('span').hide()};this.txtNoData.hide();if(this.pagingObject!=null&&this.data.pagingInfo!=null){var s=this.pagingObject.getNumPerPage(),d=Math.floor((this.data.pagingInfo.currentPage-1)/s)*s+1;this.pagingObject.setPageButton(d,-1,this.data.pagingInfo.totalPage);this.pagingObject.setSelectedIndex(this.data.pagingInfo.currentPage)}}},toggleCheckbox:function(){var t=!0;$('[data-wv-checkbox-row] input[type=checkbox]').each(function(){if($(this).prop('checked')==!1)t=!1});if(t==!1){$('[data-wv-checkbox-row] input[type=checkbox]').each(function(){$(this).prop('checked',!0)})}
else{$('[data-wv-checkbox-row] input[type=checkbox]').each(function(){$(this).prop('checked',!1)})};return t},isAllCheck:function(){var t=!0;$('[data-wv-checkbox-row] input[type=checkbox]').each(function(){if($(this).prop('checked')==!1)t=!1});return t},setCheckedIndex:function(t){var i=t.length;for(var e=0;e<i;e++){$('[data-wv-checkbox-row] input[type=checkbox]').eq(index).prop('chekced','true')}},getCheckedIndex:function(){var t=[],e=0;$('[data-wv-checkbox-row] input[type=checkbox]').each(function(){if($(this).prop('checked'))t.push(e);e++});return t},getCheckedSeqList:function(){var t=[],e;$('[data-wv-checkbox-row]').each(function(){e=$(this).attr('data-wv-checkbox-row');if($(this).find('input[type=checkbox]:checked').length>0){t.push(e)}});return t},getCheckedData:function(){var t=[],e=this.data;if(this.data.result)e=this.data.result;$(this.container).find('[data-wv-template]').each(function(i,n){var o=$(n).find('input[type=checkbox]');if(o.length>0){if($(o).prop('checked')){t.push($.extend({},e[i]))}}});return t},setOriginCommentListWithChild:function(t){this.originCommentList=t},separateReplyComment:function(t){this.allCommentList=t;var o={};var n=[],h=0,s=0;for(var e=0;e<t.length;e++){var d=t[e]['bbsctt_cmmt_seq'];if(t[e].cmmt_level>0){n[h++]=t[e]}
else{o[d]=t[e];s++}};for(var r in o){var a=[];for(var i=0;i<n.length;i++){var l=n[i]['frst_bbsctt_cmmt_seq'];if(r==l){a.push(n[i]);s++}};if(a.length>0){o[r]['child_list']=a}};this.setOriginCommentListWithChild(o);this.allCommentCnt=s}};bm.grid=function(t){var i=$(t).attr('data-wv-option');if(i)i=bm.parsing.parseStrToObj(i);else i={};var e=new BMGrid();e.init(t,i);e.registEvent();if(e.dataAutoLoad&&e.url)e.load();return e};function BMGrid(){BMList.apply(this);this.type='BMGrid';this.onSelectItem=null;this.optionItemRowHeight=60;this._ignoreSelectHanlder=!1};BMGrid.COLUMN_RENDERER_CHECKBOX='checkbox';BMGrid.prototype=new BMList();BMGrid.prototype.constructor=BMGrid;BMGrid.prototype.parent=BMList.prototype;BMGrid.prototype.setColumns=function(t,e,i,n){var r={enableCellNavigation:!0,enableColumnReorder:!0,multiColumnSort:!0,forceFitColumns:!0,editable:!0,autoHeight:!0,multiSelect:!1,enableTextSelectionOnCells:!0,rowHeight:this.optionItemRowHeight,syncColumnCellResize:!0};if(e!=null){r=$.extend(r,e)};var s=[];for(var a in t){t[a]['minWidth']=22;if(i!=null){t[a]=$.extend(t[a],i)};switch(t[a].columnRenderer){case BMGrid.COLUMN_RENDERER_CHECKBOX:var d=new Slick.CheckboxSelectColumn(t[a]);t[a]=d.getColumnDefinition();s.push(d);break}};this.grid=new Slick.Grid(this.container,[],t,r);for(a=0;a<s.length;a++){this.grid.registerPlugin(s[a])};var l=this.grid;$(window).resize(function(){l.resizeCanvas()});var o=this;this.grid.onClick.subscribe(function(t,e){var i=e.grid.getDataItem(e.row);if(o.viewObject)o.viewObject.setViewWithLoad(i)});if(n==!0){this.grid.onSort.subscribe(function(t,e){BMGrid.prototype._localDataSorter(o,t,e)})}
else{this.grid.onSort.subscribe(function(t,e){BMGrid.prototype._dynamicDataSorter(o,t,e)})};this.grid.onCellChange.subscribe(function(t,e){});this.grid.setSelectionModel(new Slick.RowSelectionModel());this.grid.onSelectedRowsChanged.subscribe(function(t,e){if(o.onSelectItem==null)return;if(o._ignoreSelectHanlder==!0){o._ignoreSelectHanlder=!1;return};var n=e.grid,i=n.getSelectedRows();if(i!=null&&i.length>0){i=i.map(function(t,e,i){return n.getData()[t]});if(i.length==1){o.onSelectItem.call(o,i[0])}
else{o.onSelectItem.call(o,i)}}
else{o.onSelectItem.call(o,null)}});l.resizeCanvas()};BMGrid.prototype.init=function(t,e){this.parent.init.apply(this,arguments);if(e.itemRowHeight&&isNaN(e.itemRowHeight)==!1)this.optionItemRowHeight=parseInt(e.itemRowHeight)};BMGrid.prototype.bindFilter=function(t){this.filterObject=t;events(this.filterObject).addListener(BMFilter.SEARCH_CLICK,i);events(this.filterObject).addListener(BMFilter.DOWNLOAD_EXCEL,n);var e=this;function i(){e.param.currentPage=1;delete e.param['sortOption[]'];e.grid.setSortColumns([]);e.load()};function n(t){var h=t['url']||e.url;delete t['url'];var i=$.extend({},t);var s=e.grid.getColumns().concat();for(var a in s){var l=s[a],o=l['field'];if(o==undefined||o==null||o==''||o=='display_no'){s[a]='';continue};s[a]='<input type="hidden" name="columnField[]" value="'+o+'"/><input type="hidden" name="columnName[]" value="'+l['name']+'"/>'};var n=null;if(e.param!=null&&e.param['sortOption[]']!=null){n=e.param['sortOption[]'].split(',');for(a in n){var d=n[a];n.push('<input type="hidden" name="sortOption[]" value="'+d+'"/>')}}
else{n=[]};i=$.extend(i,e.filterObject.param);if(i){i=typeof i=='string'?i:decodeURIComponent($.param(i));var r='';$.each(i.split('&'),function(){var t=this.split('=');r+='<input type="hidden" name="'+t[0]+'" value="'+decodeURIComponent(t[1])+'" />'});$('<form action="'+h+'" method="post">'+s.join('')+n.join('')+r+'</form>').appendTo('body').submit().remove()}}};BMGrid.prototype.setGridOptions=function(t){this.grid.setOptions(t)};BMGrid.prototype.show=function(){this.grid.resizeCanvas();this.parent.show()};BMGrid.prototype.render=function(){this.setSelectedIndex(null,!1);if(this.data==null||this.data.list==null||this.data.list.length==0){this.txtNoData.show();this.grid.resizeCanvas();this.grid.setData([]);if(this.pagingObject!=null){this.pagingObject.setPageButton(1,-1,1);this.pagingObject.setSelectedIndex(1)}}
else{var i=1,n=1;if(this.data.pagingInfo!=null){i=this.data.pagingInfo.count-(this.data.pagingInfo.currentPage-1)*this.data.pagingInfo.numPerPage;n=-1};for(var t=0;t<this.data.list.length;t++){if(this.data.pagingInfo==null||t<this.data.pagingInfo.offset){this.data.list[t]['display_no']='-'}
else{this.data.list[t]['display_no']=(i+n*t)+this.data.pagingInfo.offset}};this.txtNoData.hide();this.grid.setData(this.data.list);this.grid.resizeCanvas();if(this.pagingObject!=null&&this.data.pagingInfo!=null){var e=this.pagingObject.getNumPerPage(),o=Math.floor((this.data.pagingInfo.currentPage-1)/e)*e+1;this.pagingObject.setPageButton(o,-1,this.data.pagingInfo.totalPage);this.pagingObject.setSelectedIndex(this.data.pagingInfo.currentPage)}}};BMGrid.prototype._localDataSorter=function(t,e,i){var n=i.sortCols,o=i.grid;trace('BMGrid : onSort - _localDataSorter :',t,n);o.getData().sort(function(t,e){for(var i=0,d=n.length;i<d;i++){var o=n[i].sortCol.field,l=n[i].sortAsc?1:-1,a=t[o],s=e[o],r=(a==s?0:(a>s?1:-1))*l;if(r!=0){return r}};return 0});o.invalidate();o.render()};BMGrid.prototype._dynamicDataSorter=function(t,e,i){var n=i.sortCols;trace('BMGrid : onSort - _dynamicDataSorter :',t,n);var a=[];for(var l in n){var o=n[l],s=o['sortAsc']?'ASC':'DESC',r=o.sortCol['field'];a.push(r+'='+s)};t.addParam({'sortOption[]':a.join(',')});t.refresh()};BMGrid.prototype.setSelectedIndex=function(t,e){if(e==!1){this._ignoreSelectHanlder=!0};this.grid.setSelectedRows(t||[])};BMGrid.prototype.getSelectedIndex=function(){return this.grid.getSelectedRows()};BMGrid.prototype.getSelectedData=function(){var t=this.grid.getSelectedRows(),e=[];for(var n in t){var i=t[n];e.push(this.grid.getData()[i])};return e};bm.gridAdvanced=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var i=new BMGridAdvanced(),n=e.scrollable?!0:!1;i.init(t,e,n);if(e&&e.param){i.viewNum=e.param.numPerPage}
else{i.viewNum=10};i.registEvent();if(i.dataAutoLoad&&i.url)i.load();return i};function BMGridAdvanced(){BMList.apply(this);this.type='BMGridAdvanced';this.grid;this.table;this.tableId;this.container;this.width;this.itemHeight;this.viewNum;this.useScroll;this.onSelectItem=null;this.onDoubleClickItem=null;this.onRender=null;var t=this,e=$('html')[0];this.onSelectionChange=function(e){if(t.onSelectItem)t.onSelectItem(e.data.data,e.data,e.data.index)};this.onDoubleClick=function(e){if(t.onDoubleClickItem)t.onDoubleClickItem(e.data.data,e.data,e.data.index)}};BMGridAdvanced.COLUMN_RENDERER_CHECKBOX='checkbox';BMGridAdvanced.COLUMN_RENDERER_RADIO='radio';BMGridAdvanced.prototype=new BMList();BMGridAdvanced.prototype.constructor=BMGridAdvanced;BMGridAdvanced.prototype.parent=BMList.prototype;BMGridAdvanced.prototype.init=function(t,e,i){this.tableId=$(t).attr('id')+'_table';if(e.scrollable){var n=e.width?e.width:'100%';n=''+n;if(n.indexOf('%')==-1&&n.indexOf('px')==-1)n=n+'px';$(t).append('<div style=\'overflow-x:auto; \'><table style=\'width:'+n+';\' id=\''+this.tableId+'\'><thead></thead><tbody></tbody></table></div>')}
else{$(t).append('<table id=\''+this.tableId+'\'><thead></thead><tbody></tbody></table>')};this.table=$(t).find('#'+this.tableId)[0];this.container=t;this.width=100;this.itemHeight=50;this.viewNum=10;this.columns;this.rowTemplate;this.colGroup;this.gridHeader;this.grid=new GridAdvance(this.table,this.width,this.itemHeight,this.viewNum,t);this.grid.setSelectStyle('');this.grid.selectable(!0);this.scrollable(i);this.grid.setUserWidth(!0);this.grid.render=a;this.formatterList={};this.columnRendererList={};this.columnRendererIDList=[];this.columnIdIndexMapper={};this.columnDataList={};this.checkedIndexList=[];this.radioSelectedIndex=-1;var o=this;events(this.grid).addListener(Grid.SELECTION_CHANGE,this.onSelectionChange);events(this.grid).addListener(Grid.DOUBLE_CLICK,this.onDoubleClick);this.parent.init.apply(this,arguments);function a(t,e,i){var l=o.columnRendererIDList,d=o.columnRendererList,a,s,n,h=l.length;for(var r=0;r<h;r++){s=l[r];n=$(t).find('th > .grid_cell_div[data-grid-id=\''+s+'\']');if(n.length==0){n=$(t).find('td > .grid_cell_div[data-grid-id=\''+s+'\']')};if(n.length==0)continue;n=n[0];a=d[s];if(bm.type.isFunction(a)){a(t,e,i,n)}
else if(bm.type.isString(a)){if(a===BMGridAdvanced.COLUMN_RENDERER_CHECKBOX){o.checkboxRenderer(t,e,i,n)}
else if(a===BMGridAdvanced.COLUMN_RENDERER_RADIO){o.radioRenderer(t,e,i,n)}
else if(a==='select'){}}};if(o.onRender)o.onRender(t,e,i)}};BMGridAdvanced.prototype.resetItemContainer=function(t){this.grid.resetItemContainer();this.grid.noDataShow()};BMGridAdvanced.prototype.scrollable=function(t){this.useScroll=t;this.grid.scrollable(this.useScroll)};BMGridAdvanced.prototype.setColumns=function(t){var r,n,o,c,e,y,S,a,k,p,s,g,l,m,w,d,h,i,f,I,u;this.columns=t;function x(t){if(Object.prototype.toString.call(t)=='[object String]'){if(t.indexOf('%')>-1){return t}
else if(t.indexOf('px')>-1){return t}}
else if(t){return t+'%'}
else{return'auto'}};if(!this.gridHeader){p='<colgroup>';s='<tr>';g=!1;r=t.length;while(r--){if(t[r].columns){g=!0;break}};l='';if(g){l='<tr>'};var b=!1,E=!1;r=t.length;a=0;for(n=0;n<r;n++){e=t[n];a++;if(e.columnRenderer){this.columnRendererList[e.id]=e.columnRenderer;this.columnRendererIDList.push(e.id);if(e.columnRenderer==BMGridAdvanced.COLUMN_RENDERER_CHECKBOX){b=!0}
else if(e.columnRenderer==BMGridAdvanced.COLUMN_RENDERER_RADIO){E=!0}
else{b=!1}}
else{b=!1};d=e.styles?'style=\''+e.styles+'\'':'';h=e.classes||'';S=e.colClasses||'';tbodyClasses=e.tbodyClasses||'';if(e.sortable!==!1){u='data-grid-sort=\''+e.sortable+'\''}
else{u=''};s+='<th '+u+' class=\'grid_header '+h+' l'+a+'\' '+d+' data-grid-id=\''+e.id+'\' data-bmgrid-colfield=\''+e.field+'\' ';if(g){if(!e.columns){s+=' rowSpan=\'2\'';y='<col width=\''+x(e.width)+'\' class=\'grid_col l'+a+' '+S+'\'>';p+=y}
else{c=e.columns.length;s+=' colspan=\''+c+'\'';var v=!1,B=!1;for(o=0;o<c;o++){i=e.columns[o];if(i.columnRenderer){this.columnRendererList[i.id]=i.columnRenderer;this.columnRendererIDList.push(i.id);if(i.columnRenderer==BMGridAdvanced.COLUMN_RENDERER_CHECKBOX){v=!0}
else if(e.columnRenderer==BMGridAdvanced.COLUMN_RENDERER_RADIO){B=!0}
else{v=!1}}
else{v=!1};k='<col width=\''+x(i.width)+'\'>';p+=k;a++;d=i.styles?'style=\''+i.styles+'\'':'';h=i.classes||'';if(e.sortable!==!1){u='data-grid-sort=\''+e.sortable+'\''}
else{u=''};l+='<th '+u+' class=\'grid_header double_header '+h+' l'+a+'\' '+d+' data-grid-id=\''+e.id+'\' data-bmgrid-colfield=\''+e.field+'\' ><div class=\'grid_header_div\' data-grid-field=\''+i.field+'\' data-grid-id=\''+i.id+'\'>';if(v){l+='<input type=\'checkbox\' id=\''+this.tableId+'_checkbox\'/>'}
else if(B){l+='선택'}
else{l+=i.name};l+='</div></th>'}}}
else{y='<col width=\''+x(e.width)+'\' class=\'grid_col l'+a+' '+S+'\'>';p+=y};s+='><div class=\'grid_header_div\' data-grid-field=\''+e.field+'\' data-grid-id=\''+e.id+'\'>';if(b){s+='<input type=\'checkbox\' id=\''+this.tableId+'_checkbox\'/>'}
else if(E){s+='선택'}
else{s+=e.name};s+='</div></th>'};p+='</colgroup>';if(g){l+='</tr>';s+=l};s+='';this.colGroup=p;this.gridHeader=s};$(this.table).prepend(this.colGroup);$(this.table).find('thead').append(this.gridHeader);var L=this;$(this.table).find('#'+this.tableId+'_checkbox').off('click');$(this.table).find('#'+this.tableId+'_checkbox').on('click',function(){L.checkAllHandler()});this.columnIdIndexMapper={};this.columnFieldIndexMapper={};this.columnDataList={};this.formatterList={};this.templateList={};var T=!1,C=!1;f=0;w=[];r=t.length;for(n=0;n<r;n++){e=t[n];if(e.formatter){if(!e.id){throw new Error('BMGridAdvanced의 setColumn을 호출하는 과정에 id가 없는 컬럼의 formatter를 호출한 이력이 존재합니다. ===> '+e.id)};T=!0;this.formatterList[e.id]=e.formatter};if(e.template){if(!e.id){throw new Error('BMGridAdvanced의 setColumn을 호출하는 과정에 id가 없는 컬럼의 template를 호출한 이력이 존재합니다. ===> '+e.id)};C=!0;this.templateList[e.id]=e.template};if(!e.columns){w.push(e.field);this.columnIdIndexMapper[f]=e.id;this.columnFieldIndexMapper[f]=e.field;this.columnDataList[e.id]=e;f++}
else{c=e.columns.length;for(o=0;o<c;o++){i=e.columns[o];if(i.formatter){if(!i.id){throw new Error('BMGridAdvanced의 setColumn을 호출하는 과정에 id가 없는 컬럼의 formatter를 호출한 이력이 존재합니다. ===> '+i.id)};T=!0;this.formatterList[i.id]=i.formatter;this.templateList[i.id]=i.templateList};if(i.template){if(!i.id){throw new Error('BMGridAdvanced의 setColumn을 호출하는 과정에 id가 없는 컬럼의 formatter를 호출한 이력이 존재합니다. ===> '+i.id)};C=!0;this.templateList[i.id]=i.template};w.push(i.field);this.columnIdIndexMapper[f]=i.id;this.columnFieldIndexMapper[f]=i.field;this.columnDataList[i.id]=i;f++}}};if(T){this.grid.formatter=this.formatterList}
else{this.grid.formatter=null};if(C){this.grid.template=this.templateList}
else{this.grid.template=null};this.grid.setLabels(w);if(!this.rowTemplate){m='<tr>';a=0;r=t.length;for(n=0;n<r;n++){e=t[n];a++;d=e.styles?'style=\''+e.styles+'':'';h=e.classes||'';tbodyClasses=e.tbodyClasses||'';if(!e.columns){m+='<td class=\'grid_cell '+h+' l'+a+' '+tbodyClasses+'\' '+d+'><div class=\'grid_cell_div\' data-grid-field=\''+e.field+'\' data-grid-id=\''+e.id+'\' style=\'overflow:hidden; text-overflow: ellipsis; white-space: nowrap;\'></div></td>'}
else{c=e.columns.length;for(o=0;o<c;o++){a++;i=e.columns[o];d=i.styles?'style=\''+i.styles+'\'':'';h=i.classes||'';m+='<td class=\'grid_cell '+h+' l'+a+' '+tbodyClasses+'\' '+d+'><div class=\'grid_cell_div\' data-grid-field=\''+i.field+'\' data-grid-id=\''+i.id+'\'\' style=\'height:30px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap;\'></div></td>'}}};m+='</tr>';this.rowTemplate=m};this.grid.setColumnData(this.columns);this.grid.setRow(this.rowTemplate);this.grid.setHeaderSortOn()};BMGridAdvanced.prototype.setColumnIndexIdMapping=function(){if($(this.table).find('thead tr').length==0)return;var t=0,e=this,i,o,a,n;this.columnIdIndexMapper={};this.columnFieldIndexMapper={};if($(this.table).find('thead tr').length==1){$(this.table).find('thead tr').find('th, td').each(function(){e.columnIdIndexMapper[t]=$(this).attr('data-grid-id');e.columnFieldIndexMapper[t]=$(this).attr('data-bmgrid-colfield');t++})}
else if($(this.table).find('thead tr').length==2){i=[];$($(this.table).find('thead tr')[1]).find('th, td').each(function(){i.push(this)});$($(this.table).find('thead tr')[0]).find('th, td').each(function(){if(this.rowSpan==2){e.columnIdIndexMapper[t]=$(this).attr('data-grid-id');e.columnFieldIndexMapper[t]=$(this).attr('data-bmgrid-colfield')}
else if(this.rowSpan==1&&this.colSpan>1){o=this.colSpan;while(o--){n=i.shift();e.columnIdIndexMapper[t]=$(n).attr('data-grid-id');e.columnFieldIndexMapper[t]=$(n).attr('data-bmgrid-colfield');t++}};t++})}
else{throw new Error('BMGridAdvanced는 3줄 이상의 헤더는 지원하지 않습니다.')}};BMGridAdvanced.prototype.render=function(){if(this.data==null||this.data.result==null||this.data.result.length==0){if(this.pagingObject!=null){this.pagingObject.setPageButton(1,-1,1);this.pagingObject.setSelectedIndex(1)}}
else{var i=1,n=1;if(this.data.pagingInfo!=null){i=this.data.pagingInfo.count-(this.data.pagingInfo.currentPage-1)*this.data.pagingInfo.numPerPage;n=-1};for(var t=0;t<this.data.result.length;t++){if(this.data.pagingInfo==null||t<this.data.pagingInfo.offset){this.data.result[t]['display_no']='-'}
else{this.data.result[t]['display_no']=(i+n*t)+this.data.pagingInfo.offset}};if(this.pagingObject!=null&&this.data.pagingInfo!=null){var e=this.pagingObject.getNumPerPage(),o=Math.floor((this.data.pagingInfo.currentPage-1)/e)*e+1;this.pagingObject.setPageButton(o,-1,this.data.pagingInfo.totalPage);this.pagingObject.setSelectedIndex(this.data.pagingInfo.currentPage)}};if(this.data){this.grid.setData(this.data.result)}};BMGridAdvanced.prototype.getDataItem=function(t,e){var i=this.data.result;if(i&&i[t])return i[t];else if(i&&i.length){var a=null,o=i.length;for(var n=0;n<o;n++){if(i[n][t]==e)return i[n]}};return null};BMGridAdvanced.prototype.setData=function(t){if(t.data){this.data=t.data;this.grid.setData(t.data.result)}
else{console.log('BMGridAdvanced ==> data not loaded')}};BMGridAdvanced.prototype.radioRenderer=function(t,e,i,n){var o=$(n).find('input[type=\'radio\']');if(o.length==0){$(n).html('<input type=\'radio\' name=\''+this.tableId+'_radio\' class=\'grid_row_selector_radio\'>');o=$(n).find('input[type=\'radio\']')}};BMGridAdvanced.prototype.setRadioSelectedIndex=function(t){var e=$('#'+this.tableId).find('.grid_row_selector_radio');e.prop('checked',!1);$(e[t]).prop('checked',!0);this.radioSelectedIndex=t};BMGridAdvanced.prototype.getRadioSelectedIndex=function(){return this.radioSelectedIndex};BMGridAdvanced.prototype.getRadioSelectedData=function(){var t=$.extend({},this.data.result[this.radioSelectedIndex]);return t};BMGridAdvanced.prototype.checkboxRenderer=function(t,e,i,n){var a=$(n).find('input[type=\'checkbox\']');if(a.length==0){$(n).html('<input type=\'checkbox\' class=\'grid_row_selector_checkbox\'>');a=$(n).find('input[type=\'checkbox\']')};var o=this;a.off();a.on('click',function(t){t.stopImmediatePropagation();if($(this).is(':checked'))o.checkedIndexList.push(i);else{o.checkedIndexList.splice(o.checkedIndexList.indexOf(i),1)};if(o.isAllCheck(o.tableId)){$('#'+o.tableId+'_checkbox').prop('checked',!0)}
else{$('#'+o.tableId+'_checkbox').prop('checked',!1)}});if(o.checkedIndexList.indexOf(i)>-1){a.prop('checked',!0)}
else{a.prop('checked',!1)}};BMGridAdvanced.prototype.checkAllHandler=function(t){var i=$('#'+this.tableId).find('.grid_row_selector_checkbox').not(':disabled');this.checkedIndexList.length=0;if($('#'+this.tableId+'_checkbox').is(':checked')){i.prop('checked',!0);for(var e=0;e<i.length;e++){this.checkedIndexList.push(e+this.grid.itemIndex)}}
else{i.prop('checked',!1)}};BMGridAdvanced.prototype.checkAll=function(t){var e=$('#'+this.tableId).find('.grid_row_selector_checkbox').not(':disabled');if(t){this.checkedIndexList.length=cbkList.length}
else{this.checkedIndexList.length=0};e.prop('checked',t)};BMGridAdvanced.prototype.isAllCheck=function(t){if($('#'+t).find('.grid_row_selector_checkbox').not(':disabled').length==this.checkedIndexList.length)return!0;else return!1};BMGridAdvanced.prototype.setCheckedIndex=function(t){this.checkedIndexList=t;this.checkedIndexList.sort();var i=$('#'+this.tableId).find('.grid_row_selector_checkbox');$(i).prop('checked',!1);var o=i.length,n;for(var e=0;e<o;e++){n=i[e];if(this.checkedIndexList.indexOf(e+this.grid.itemIndex)>-1){$(n).prop('checked',!0)}}};BMGridAdvanced.prototype.addCheckedIndex=function(t){var n=t.length,o;for(e=0;e<n;e++){o=t[e];if(this.checkedIndexList.indexOf(o)==-1){this.checkedIndexList.push(o)}};var a=$('#'+this.tableId).find('.grid_row_selector_checkbox');n=a.length;var i;for(var e=0;e<n;e++){i=a[e];if(this.checkedIndexList.indexOf(e)==-1){$(i).prop('checked',!1)}
else{$(i).prop('checked',!0)}};this.checkedIndexList.sort();if(this.isAllCheck(this.tableId)){$('#'+this.tableId+'_checkbox').prop('checked',!0)}
else{$('#'+this.tableId+'_checkbox').prop('checked',!1)}};BMGridAdvanced.prototype.getCheckedIndex=function(){this.checkedIndexList.sort();return this.checkedIndexList};BMGridAdvanced.prototype.getCheckedData=function(){this.checkedIndexList.sort();var o=this.checkedIndexList.length,e,i,n=[];for(var t=0;t<o;t++){i=this.checkedIndexList[t];e=$.extend({},this.grid.data[i]);n.push(e)};return n};bm.view=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var n=$(t).attr('data-wv-bind'),i=new BMView();i.init(t,e,n);i.defaultSetting();i.registEvent();return i};var BMView=function(){this.type='BMView';this.loaded=!1;this.dataKey='data';this.onClose=null;this.directMode='sync';this.param;this.extraParam=null;this.data;this.dataOrigin;this.container;this.actionBtnContainer;this.btnContainers;this.templateList;this.parentList;this.parentChildIndex;this.directViewLoad=!1;this.itemList=[];this.choiceList=[];this.history=!0;this.onLoadStart=null;this.onComplete=null;this.onLoad=null;this.onDeleteStart=null;this.onDeleteReady=null;this.onDelete=null;this.updateObject=null;this.insertObject=null;this.viewStatus=-1;this.isCrudViewMode=!1;return this};BMView.SHOW='bmviewShow';BMView.HIDE='bmviewHide';BMView.prototype={init:function(t,e,i){this.url=e.url;this.dataType=e.dataType||'json';this.method=e.method||'POST';this.wrapper=e.wrapper;this.directMode=e.directMode?e.directMode:'sync';this.id=$(t).attr('id');this.param={};if(e.param){this.setParam(e.param)};this.ajaxView=!0;if(e.ajaxView&&(e.ajaxView===!1||e.ajaxView==='false')){this.ajaxView=!1};if(e.history&&e.history!==undefined){this.history=(e.history===!0||e.history===1||e.history==='true'||e.history==='1')?!0:!1};this.data=null;this.dataOrigin=null;this.setContainer(t);this.setTemplate();var n=this;this.actionBtnContainer=e&&e.actionBtnContainer?e.actionBtnContainer:this.container;if(this.actionBtnContainer===this.container)this.btnContainers=this.container;else{if($(this.container).has(this.actionBtnContainer).length>0)this.btnContainers=this.container;else{this.btnContainers=[this.actionBtnContainer,this.id]}};this.itemList=[];$(this.container).find('[data-wv-item]').each(function(){var t=bm.item(this);n.itemList.push(t);t.bindTargetID=n.id});this.choiceList=[];$(this.container).find('[data-wv-type=choice]').each(function(){var e=$(this).attr('id'),t=app.getWvElement(e);n.choiceList.push(t);t.bindedView=!0});this.bindTargetID=i},setContainer:function(t){this.container=t},setTemplate:function(){if(!this.templateList)this.templateList=$(this.container).find('[data-wv-interpreter]');var e=[];this.parentList=[];this.parentChildIndex=[];var t=this;if($(this.container).find('[data-wv-template-parent=\''+this.id+'\']').length>0){$(this.container).find('[data-wv-template-parent=\''+this.id+'\']').each(function(e,i){var n=$(i);n.attr('data-wv-template-parent',t.id);t.parentList[e]=n;t.parentChildIndex[e]=n.index()})}
else{$(this.templateList).each(function(i,n){var s=typeof n==='string'?n:n.outerHTML;e.push(s);var o=$(n),a=o.parent();a.attr('data-wv-template-parent',t.id);t.parentList[i]=a;t.parentChildIndex[i]=o.index()});this.templateList=e}},defaultSetting:function(){$(this.parentList).each(function(t,e){$(e).find('[data-wv-interpreter]').remove()})},binding:function(){if(this.bindTargetID){var t=this.bindTargetID.split(',');t=bm.string.trimList(t);var e=t.length;while(e--){if(app.getWvElement(t[e]))app.getWvElement(t[e]).bindView(this)};this.hide(-1,!0)}},refresh:function(){this.load(this.onComplete,this.onLoad)},setViewWithLoad:function(t){this.load(this.onComplete,this.onLoad,t)},getItem:function(t){var i=this.itemList.length;for(var e=0;e<i;e++){if(this.itemList[e].id==t)return this.itemList[e]};return null},getItemAt:function(t){return this.itemList[t]},directViewWithSync:function(t){if(this.bindTargetID){var e=app.getWvElement(this.bindTargetID);e.directViewLoad=!0};this.directViewLoad=!0;this.setViewWithSync(t)},directViewWithLoad:function(t){if(this.bindTargetID){var e=app.getWvElement(this.bindTargetID);e.directViewLoad=!0};this.directViewLoad=!0;this.setViewWithLoad(t)},setViewWithSync:function(t){var i=this.dataKey.split('.');if(i.length<1||i.length==1&&i[0]=='data'){i[0]='data';i[1]='result'}
else if(i[0]!=='data'){i.unshift('data')};var a=i.length,d,r,l;r=t;for(var n=0;n<a;n++){var o=i.slice(0,n+1).join('.');if(!bm.object.isExistKey(t,o)){o=i.slice(0,n).join('.');l=bm.object.getObjAtKeyList(t,o);bm.object.insertWrapKey(t,o,i[n])}};this.dataOrigin=t;var a=i.length,s=t;for(var n=0;n<a;n++){try{s=s[i[n]]}catch(e){if(t.result===!1){alert(t.message)}
else{alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.')};if(this.onLoad)this.onLoad(t);if(this.onComplete)this.onComplete(t);return}};if(this.onLoad)this.onLoad(t);this.setView(s);this.setItem();this.setChoice();if(this.onComplete)this.onComplete(t)},setViewWithNoData:function(){this.setView({})},setView:function(t){this.loaded=!0;if(!t){this.show(!0);return};this.data=t;if(!this.dataOrigin)this.dataOrigin=t;var e=this;if(this.container!=$('#'+this.id)[0]){this.setContainer($('#'+this.id)[0]);this.setTemplate()};$(this.parentList).each(function(t,e){$(e).find('[data-wv-interpreter]').remove()});bm.each(this.templateList,function(i,n){var o=$(e.parentList[i]),a=e.parentChildIndex[i];bm.dom.singleInterpreter(t,n,o,!1,a)});if(this.history&&this.type=='BMView'&&this.ajaxView){app.setPageInfo(t,this.id)};if(this.type=='BMUpdate'&&this.isCrudViewMode==!1){$(this.container).find('[data-wv-text-editor]').each(function(){bm.bmEditorManager.get($(this).attr('id'),this)})};this.show();$(this.parentList).each(function(t,e){$(e).show();app.wvHandlerCrawling(e);app.additionalCrawling(e)})},hideView:function(){this.hide();$(this.parentList).each(function(t,e){$(e).hide()})},bindUpdate:function(t){this.updateObject=t;var e=this;events(this.updateObject).addListener(BMUpdate.SHOW,function(){e.hide(!1,!0)});events(this.updateObject).addListener(BMUpdate.HIDE,function(){e.load(null,null,e.data)})},bindInsert:function(t){this.insertObject=t;var e=this;events(this.insertObject).addListener(BMView.SHOW,function(){e.hide(!1,!0)});events(this.insertObject).addListener(BMView.HIDE,function(){e.show(!1,!0)})},registEvent:function(){var t=this;$(this.actionBtnContainer).on('click','[data-wv-replybtn]',function(e){e.stopPropagation();if(t.insertObject){t.insertObject.setReplyView(t.data)}});$(this.btnContainers).each(function(){var e;if(Object.prototype.toString.call(this).indexOf('object HTML')>-1){e=this}
else{e=this.toString()};$(e).on('click','[data-wv-updatebtn-sync]',function(e){e.stopPropagation();if(t.updateObject){t.updateObject.setViewWithSync(t.dataOrigin)}});$(e).on('click','[data-wv-updatebtn-load]',function(e){e.stopPropagation();if(t.updateObject){t.updateObject.setViewWithLoad(t.data)}});$(e).on('click','[data-wv-insertbtn]',function(e){e.stopPropagation();if(t.insertObject){t.insertObject.setView(t.data)}});$(e).on('click','[data-wv-replybtn]',function(e){e.stopPropagation();if(t.insertObject){t.insertObject.setReplyView(t.data)}});$(e).on('click','[data-wv-closebtn]',function(e){e.stopPropagation();if(t.directViewLoad&&bm.getParam('bmDirect')){var n=bm.getParamList();delete n['bmDirect'];var o=bm.makeQueryString(n),i=location.href.slice(0,location.href.indexOf('?'));i=i+'?'+o;app.removePageInfo();location.href=i}
else{t.hide();if(t.onClose){t.onClose.apply(t)}}});$(e).on('click','[data-wv-deletebtn]',function(e){e.stopPropagation();var i=bm.parsing.parseStrToObj($(this).attr('data-wv-deletebtn'));t.deleteData(i)})});events(t.container).addListener('show',function(){t.show.call(t)});events(t.container).addListener('hide',function(){t.hide.call(t)})},deleteStatus:!0,cancelDelete:function(){this.deleteStatus=!1},deleteData:function(t){if(!t||!t.url){alert('삭제를 위한 url 이 정의되지 않았습니다.');return};if(confirm(t.removeConfirmMsg?t.removeConfirmMsg:'삭제하시겠습니까?')){var e=this;if(e.onDeleteStart){e.onDeleteStart.call(e,i);return}
else{i.call(e)};function i(i){var n=$.extend({},e.data,i,t.param);if(e.onDeleteReady){e.onDeleteReady.call(e,e.data);if(e.deleteStatus===!1){e.deleteStatus=!0;return}};e.deleteStatus=!0;bm.httpSend(t.url,n,function(i){var n=!1;if(e.onDelete){n=e.onDelete.apply(e,arguments)}
else{n=i.result};if(n&&t.confirmMsg!=''){alert(t.confirmMsg)};if(i.result==!1){alert(i.message)}
else{e.hide()}},e.dataType,e.method,10000,!1,!1)}}},setCondition:function(t){this.param.whereCondition=t},setParam:function(t){this.param=t},addParam:function(t){if(!this.param)this.param={};for(var e in t){this.param[e]=t[e]}},load:function(t,e,i){if(t)this.onComplete=t;if(e)this.onLoad=e;var n=this,a={};for(var o in this.param){a[o]=this.param[o]};if(i!=null){for(var o in i){a[o]=i[o]}};if(this.onLoadStart&&this.onLoadStart.call(this,a)==!1){return};if(this.extraParam!=null){for(var o in this.extraParam){a[o]=this.extraParam[o]};this.extraParam=null};bm.httpSend(this.url,a,s,this.dataType,this.method,10000,!1,!1);var n=this;function s(t){var i=n.dataKey.split('.');if(i.length<1||i.length==1&&i[0]=='data'){i[0]='data';i[1]='result'}
else if(i[0]!=='data'){i.unshift('data')};var r=i.length,h,l,d;l=t;for(var o=0;o<r;o++){var a=i.slice(0,o+1).join('.');if(!bm.object.isExistKey(t,a)){a=i.slice(0,o).join('.');d=bm.object.getObjAtKeyList(t,a);bm.object.insertWrapKey(t,a,i[o])}};r=i.length;var s=t;for(var o=0;o<r;o++){try{s=s[i[o]]}catch(e){if(t.result===!1){alert(t.message)}
else{alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.')};if(n.onLoad)n.onLoad(t);if(n.onComplete)n.onComplete(t);return}};n.dataOrigin=t;if(n.onLoad)n.onLoad(t);n.setView(s);n.setItem();n.setChoice();if(n.onComplete)n.onComplete(t);return n}},setItem:function(){var i=this.itemList.length,e;for(var t=0;t<i;t++){e=this.itemList[t];e.setItemWithSync(this.dataOrigin)}},setChoice:function(){var i=this.choiceList.length,e;for(var t=0;t<i;t++){e=this.choiceList[t];if(e.dataAutoLoad)e.load()}},getDataAtKey:function(t){t=t.split('.');var n=t.length,i=this.dataOrigin;for(var e=0;e<n;e++){if(i[t[e]]){i=i[t[e]]}
else{return null}};return i},show:function(t,e){if(this.viewStatus!=1){this.viewStatus=1;if(t){this.setView({})}
else{if(!$(this.container).is(':visible')){$(this.container).show();if(this.wrapper)$(this.wrapper).show();$(this.container).find('[data-wv-interpreter]').each(function(){bm.setStyles(this,{display:'block'})});if(!e){events(this).dispatch(BMView.SHOW,this)}};$(this.parentList).each(function(t,e){$(e).show()})}}
else{if(!$(this.container).is(':visible')){$(this.container).show();if(this.wrapper)$(this.wrapper).show();$(this.container).find('[data-wv-interpreter]').each(function(){bm.setStyles(this,{display:'block'})});events(this).dispatch(BMView.SHOW,this);$(this.parentList).each(function(t,e){$(e).show()})}}},hide:function(t,e){if(this.viewStatus!=0){this.viewStatus=0;if($(this.container).is(':visible')){$(this.container).hide();if(this.wrapper)$(this.wrapper).hide();if(!e){events(this).dispatch(BMView.HIDE,this)}}}
else{if($(this.container).is(':visible')){$(this.container).hide();if(this.wrapper)$(this.wrapper).hide()}}}};bm.update=function(t){var e=$(t).attr('data-wv-option');if(e){e=bm.parsing.parseStrToObj(e)}
else e={};var n=$(t).attr('data-wv-bind'),i=new BMUpdate();i.useconfirm=e.useconfirm===!1||e.useconfirm==='false'?!1:!0;i.init(t,e,n);i.registEvent();if(e.confirmMsg)i.confirmMsg=e.confirmMsg;if(e.updateMsg)i.updateMsg=e.updateMsg;return i};var BMUpdate=function(){this.type='BMUpdate';this.onUpdateStart=null;this.onUpdateReady=null;this.onUpdate=null;this.formObject=null;this.updateMsg='';this.confirmMsg='';this.isTempSaveMode=!1;this.useconfirm=!0;this.onCancel=null;this.viewStatus=-1;return this};BMUpdate.prototype.constructor=BMView.prototype;BMUpdate.prototype=new BMView();BMUpdate.prototype.init=function(t,e,i){BMView.prototype.init.call(this,t,e,i)};BMUpdate.prototype.binding=function(){if(this.bindTargetID){var t=this.bindTargetID.split(',');t=bm.string.trimList(t);var e=t.length;while(e--){if(app.getWvElement(t[e]))app.getWvElement(t[e]).bindUpdate(this)};this.hide(-1,!0)}};BMUpdate.prototype.reset=function(){bm.formUtil.reset(this.formObject.form);bm.formUtil.setDefaultValue(this.formObject.form);var t=$(this.container).find('[data-wv-text-editor]'),e,i=!0;if(t.length>0){t.each(function(){e=bm.bmEditorManager.get($(this).attr('id'),this);e.reset()})}};BMUpdate.prototype.cancelSubmit=function(){this.formObject.cancelSubmit()};BMUpdate.prototype.registEvent=function(){var t=this,e=$(t.container).find('form')[0];this.formObject=bm.formMultipart(e.getAttribute('name'),null,null,null,null,null,null,!1);this.formObject.onSubmitComplete=function(e){var i=e;if(typeof i==='string'||i instanceof String){i=$.parseJSON(e)};if(i.result==='false'||!i.result){alert(i.message)}
else if(i.result==='true'||i.result){if(t.confirmMsg)bm.toast(t.confirmMsg);else if(i.message)bm.toast(i.message);t.hide()};if(t.onUpdate)t.onUpdate(i)};$(this.btnContainers).each(function(){var e;if(Object.prototype.toString.call(this).indexOf('object HTML')>-1){e=this}
else{e=this.toString()};$(e).on('click','[data-wv-updatebtn]',function(e){t.isTempSaveMode=!1;var s=bm.getParamList();if(app.isEditMode&&s['isCustomCrawling']&&!app.childApp&&app.parentApp){window.parent.bm.toast('편집화면에서는 수정이 불가능합니다.');return!1};e.preventDefault();var n=bm.parsing.parseStrToObj($(this).attr('data-wv-updatebtn')),o=n.message?n.message:t.updateMsg;if((t.useconfirm&&confirm((o!=null&&o!='')?o:[LANGUAGE_PACK['save_confirm']]))||!t.useconfirm){var a=t.onUpdate,i=null;if(n!=null&&n['param'])i=n['param'];if(i!=null){for(key in i){if(key==''){delete i[key]}};t.addParam(i)};t.update(function(e){if(i!=null){for(key in i){delete t.param[key]}};if(a!=null){t.onUpdate=a;t.onUpdate(e)}})}});$(e).on('click','[data-wv-temp-updatebtn]',function(e){t.isTempSaveMode=!0;e.preventDefault();var n=bm.parsing.parseStrToObj($(this).attr('data-wv-temp-updatebtn'));if(confirm('임시 저장하시겠습니까?')){var o=t.onUpdate,i=null;if(n!=null&&n['param'])i=n['param'];if(i!=null){for(key in i){if(key==''){delete i[key]}};t.addParam(i)};t.update(function(e){if(i!=null){for(key in i){delete t.param[key]}};if(o!=null){t.onUpdate=o;t.onUpdate(e)}},null,!0)}});$(e).on('click','[data-wv-cancelbtn]',function(e){e.preventDefault();var i=bm.parsing.parseStrToObj($(this).attr('data-wv-cancelbtn')),n=(i['message']!=undefined)?i['message']:'취소하시겠습니까?';if(n==''||confirm(n)){$(t.container).find('form')[0].reset();t.hide();if(t.onCancel){t.onCancel.apply(t)}}});$(e).on('click','[data-wv-deletebtn]',function(e){e.stopPropagation();var i=bm.parsing.parseStrToObj($(this).attr('data-wv-deletebtn'));t.deleteData(i)})});events(this.container).addListener('show',function(){t.show.call(t)});events(this.container).addListener('hide',function(){t.hide.call(t)})};BMUpdate.prototype.update=function(t,e,i){this.formObject.status=!0;if(this.onUpdateStart)this.onUpdateStart.call(this.formObject);if(this.formObject.status==!1)return;if(!i&&!bm.wvValidCheck(this.container))return;var o=$(this.container).find('[data-wv-text-editor]'),a,n=!0,s=o.length,r=0,l=this;if(s>0){o.each(function(){a=bm.bmEditorManager.get($(this).attr('id'),this);if(n==!1)return;a.readyToSave(function(i){n=i;r++;if(r==s){if(!n)return!1;l.onReadyToUploadComplete(t,e)}})})}
else{this.onReadyToUploadComplete(t,e)}};BMUpdate.prototype.onReadyToUploadComplete=function(t,e){app.removePageInfo();e=e||this.onUpdateReady;this.onUpdate=t||this.onUpdate;var n={};var a=this.formObject.form;for(var i in this.param){var o=bm.array.isExistKey(a,i,'name');if(o==!1){n[i]=this.param[i]}};this.formObject.extraData=n;this.formObject.onSubmit=function(){if(e)e.call(this)};this.formObject.start()};BMUpdate.SHOW='bmupdateShow';BMUpdate.HIDE='bmupdateHide';BMUpdate.prototype.show=function(t,e){if(this.viewStatus!=1){this.viewStatus=1;if(t){this.setView({})}
else{if(!$(this.container).is(':visible')){$(this.container).show();if(this.wrapper)$(this.wrapper).show();$(this.container).find('[data-wv-interpreter]').each(function(){bm.setStyles(this,{display:'block'})});if(!e){events(this).dispatch(BMView.SHOW,this)}};$(this.parentList).each(function(t,e){$(e).show()})}}
else{if(!$(this.container).is(':visible')){$(this.container).show();if(this.wrapper)$(this.wrapper).show();$(this.container).find('[data-wv-interpreter]').each(function(){bm.setStyles(this,{display:'block'})});events(this).dispatch(BMView.SHOW,this);$(this.parentList).each(function(t,e){$(e).show()})}}};BMUpdate.prototype.hide=function(t,e){if(this.viewStatus!=0){this.viewStatus=0;if($(this.container).is(':visible')){$(this.container).hide();if(this.wrapper)$(this.wrapper).hide();if(!e){events(this).dispatch(BMUpdate.HIDE,this)}}}};bm.insert=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};$(t).attr('data-wv-bind');var n=$(t).attr('data-wv-bind'),i=new BMInsert();i.init(t,e,n);i.registEvent();return i};var BMInsert=function(){this.type='BMInsert';this.onInsertStart=null;this.onInsertReady=null;this.onInsert=null;this.formObject=null;this.param={};this.itemList=[];this.onCancel=null;this.viewStatus=-1;return this};BMInsert.SHOW='bminsertShow';BMInsert.HIDE='bminsertHide';BMInsert.prototype={init:function(t,e,i){this.url=e.url;this.dataType=e.dataType||'json';this.method=e.method||'POST';this.confirmMsg=e.confirmMsg||'';if(e.param){this.setParam(e.param)};this.id=$(t).attr('id');this.wrapper=e.wrapper;this.bindTargetID=i;this.parentData=null;this.container=t;var a=this;$(this.container).find('[data-wv-item]').each(function(){var t=bm.item(this);a.itemList.push(t)});this.onLoad=null;this.insertObject=null;var n=$(this.container).find('[data-wv-text-editor]'),o,s=!0;if(n.length>0){n.each(function(){o=bm.bmEditorManager.get($(this).attr('id'),this);o.reset()})}},getItem:function(t){var i=this.itemList.length;for(var e=0;e<i;e++){if(this.itemList[e].id==t)return this.itemList[e]};return null},reset:function(){this.formObject.form.reset();var t=$(this.container).find('[data-wv-text-editor]'),e,i=!0;if(t.length>0){t.each(function(){e=bm.bmEditorManager.get($(this).attr('id'),this);e.reset()})}},binding:function(){if(this.bindTargetID){var t=this.bindTargetID.split(',');t=bm.string.trimList(t);var e=t.length;while(e--){if(app.getWvElement(t[e]))app.getWvElement(t[e]).bindInsert(this)};this.hide(-1,!0)}},cancelSubmit:function(){this.formObject.cancelSubmit()},registEvent:function(){var t=this,e=$(t.container).find('form')[0];this.formObject=bm.formMultipart(e.getAttribute('name'),null,null,null,null,null,null,!1);this.formObject.onSubmitComplete=function(e){var i=e;if(typeof i==='string'||i instanceof String){i=$.parseJSON(e)};if(i.result==='false'||!i.result){alert(i.message)}
else if(i.result==='true'||i.result){if(t.confirmMsg)alert(t.confirmMsg);else if(i.message)alert(i.message)};if(t.onInsert)t.onInsert(i);t.hide()};$(this.container).on('click','[data-wv-insertbtn]',function(e){e.preventDefault();t.insert()});$(this.container).on('click','[data-wv-cancelbtn]',function(e){e.preventDefault();if(confirm('입력을 취소하시겠습니까?')){$(t.container).find('form')[0].reset();t.hide();if(t.onCancel){t.onCancel.apply(t)}}});events(t.container).addListener('show',function(){t.show.call(t)});events(t.container).addListener('hide',function(){t.hide.call(t)})},setParam:function(t){this.param=t},addParam:function(t){if(!this.param)this.param={};for(var e in t){this.param[e]=t[e]}},show:function(){if(this.viewStatus!=1){this.viewStatus=1;$(this.container).show();if(this.wrapper)$(this.wrapper).show();events(this).dispatch(BMInsert.SHOW,this)}},setView:function(t){this.parentData=null;this.show()},setReplyView:function(t){this.parentData=t;this.show()},hide:function(t,e){if(this.viewStatus!=0){this.viewStatus=0;this.parentData=null;$(this.container).hide();if(this.wrapper)$(this.wrapper).hide();if(!e){events(this).dispatch(BMInsert.HIDE,this)}}
else if(t){$(this.container).hide();if(this.wrapper)$(this.wrapper).hide()}},insert:function(t,e,i){this.formObject.status=!0;if(this.onInsertStart)this.onInsertStart.call(this.formObject);if(this.formObject.status==!1)return;if(!i&&!bm.wvValidCheck(this.container))return;var n=$(this.container).find('[data-wv-text-editor]'),a,o=!0,r=n.length,s=0,l=this;if(n.length>0){n.each(function(){a=bm.bmEditorManager.get($(this).attr('id'),this);if(o==!1)return;a.readyToSave(function(i){o=i;s++;if(s==r){if(!o)return!1;l.onReadyToUploadComplete(t,e)}})})}
else{this.onReadyToUploadComplete(t,e)}},onReadyToUploadComplete:function(t,e){e=e||this.onInsertReady;this.onInsert=t||this.onInsert;this.formObject.extraData=this.param;this.formObject.onSubmit=function(){if(e)e.call(this)};this.formObject.start()}};bm.item=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var n=$(t).attr('data-wv-bind'),i=new BMItem();i.init(t,e,n);i.registEvent();return i};var BMItem=function(){this.type='BMItem';this.loaded=!1;this.dataKey='data.result';this.wrapper;this.id;this.param;this.data;this.dataOrigin;this.dataList=[];this.elementList=[];this.template;this.templateParent;this.container;this.onLoadStart=null;this.onLoad=null;this.onComplete=null;this.onAdd=null;this.onRemove=null;this.loadStatus=!0;this.removeConfirmMsg=null;return this};BMItem.SHOW='show';BMItem.HIDE='hide';BMItem.prototype={init:function(t,e,i){this.url=e.url;this.dataType=e.dataType||'json';this.dataKey=e.dataKey||'data.result';this.method=e.method||'POST';this.wrapper=e.wrapper;this.id=$(t).attr('data-wv-item');this.removeConfirmMsg=e.removeConfirmMsg;this.param={};if(e.param){this.setParam(e.param)};this.data=null;this.dataOrigin=null;this.container=t;this.template=$(this.container).find('[data-wv-item-template]')[0].outerHTML;this.templateParent=$(this.container).find('[data-wv-item-template]').parent();$(this.container).find('[data-wv-item-template]').remove();this.bindTargetID=i},refresh:function(){this.load()},setViewWithLoad:function(t){this.load(t)},setViewWithSync:function(t){var i=this.dataKey.split('.');if(i.length<1||i.length==1&&i[0]=='data'){i[0]='data';i[1]='result'}
else if(i[0]!=='data'){i.unshift('data')};var a=i.length,d,r,l;r=t;for(var n=0;n<a;n++){var o=i.slice(0,n+1).join('.');if(!bm.object.isExistKey(t,o)){o=i.slice(0,n).join('.');l=bm.object.getObjAtKeyList(t,o);bm.object.insertWrapKey(t,o,i[n])}};this.dataOrigin=t;var a=i.length,s=t;for(var n=0;n<a;n++){try{s=s[i[n]]}catch(e){if(t.result===!1){alert(t.message)}
else{alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.')};if(this.onLoad)this.onLoad(t);if(this.onComplete)this.onComplete(t);return}};if(this.onLoad)this.onLoad(t);this.setView(s);if(this.onComplete)this.onComplete(t)},registEvent:function(){var t=this;$(this.container).on('click','[data-wv-item-addbtn]',function(e){e.stopPropagation();t.addItem()});$(this.container).on('click','[data-wv-item-removebtn]',function(e){e.stopPropagation();t.removeItem($(this).closest('[data-wv-item-template]'))})},setCheckboxIndex:function(t){var e='';if(t==undefined){t=this.dataList.length;e=$(this.template).find('input[type="checkbox"]').attr('id')}
else{e=$($(this.container).find('[data-wv-item-template]')[t]).find('input[type="checkbox"]').attr('id')};$($(this.container).find('[data-wv-item-template]')[t]).find('input[type="checkbox"]').attr('id',e+t);$($(this.container).find('[data-wv-item-template]')[t]).find('input[type="checkbox"]').siblings('label').attr('for',e+t)},resetItem:function(){var e=this.elementList.length;for(var t=0;t<e;t++){$(this.elementList[t]).remove()};this.elementList.length=0;this.dataList.length=0},addItem:function(t,e){var n=t?bm.dom.convertVariables(t,this.template):this.template,i=$(n).appendTo(this.templateParent);if(!t)bm.formUtil.reset(i);t=t?t:{};if(this.onAdd&&this.onAdd(i,t)===!1){$(i).remove();return};$(i).show();this.setCheckboxIndex(e);app.wvHandlerCrawling(i);app.additionalCrawling(i);this.elementList.push(i[0]);this.dataList.push(t)},removeItem:function(t){if(t['length']&&t['length']>0){t=t[0]};if(this.removeConfirmMsg){if(!confirm(this.removeConfirmMsg))return};var e=this.elementList.indexOf(t);if(this.onRemove&&this.onRemove(t,this.dataList[e])===!1)return;this.elementList.splice(e,1);this.dataList.splice(e,1);$(t).off();$(t).remove()},getRemovedData:function(){var o=this.dataKey.split('.'),i=o.length,e=this.dataOrigin;for(var t=0;t<i;t++){e=e[o[t]]};var n=[];i=e.length;for(t=0;t<i;t++){if(this.isExistData(e[t])==!1){n.push(e[t])}};return n},isExistData:function(t){var i=this.dataList.length;for(var e=0;e<i;e++){if(this.dataList[e]==t)return!0};return!1},setParam:function(t){this.param=t},addParam:function(t){if(!this.param)this.param={};for(var e in t){this.param[e]=t[e]}},setItemWithLoad:function(){this.load()},setItemWithSync:function(t){if(!t)return;this.setItemData(t);if(this.onComplete)this.onComplete(t.data.result)},cancelLoad:function(){this.loadStatus=!1},setItemData:function(t){if(!t)return;var n=this.dataKey.split('.');if(n.length<1||n.length==1&&n[0]=='data'){n[0]='data';n[1]='result'}
else if(n[0]!=='data'){n.unshift('data')};var o=n.length,f,d,h;d=t;for(var i=0;i<o;i++){var s=n.slice(0,i+1).join('.');if(!bm.object.isExistKey(t,s)){s=n.slice(0,i).join('.');h=bm.object.getObjAtKeyList(t,s);bm.object.insertWrapKey(t,s,n[i])}};this.dataOrigin=t;var o=n.length,r=t;for(var i=0;i<o;i++){try{r=r[n[i]]}catch(e){if(t.result===!1){alert(t.message)}
else{alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.')};return}};this.data=r;if(this.elementList.length>0){this.resetItem()};var c,l,a;if(this.bindTargetID){l=app.getWvElement(this.bindTargetID).container;a=$(l).find('[data-wv-item='+this.id+']');if(this.container!==a){this.container=a;this.registEvent()};this.templateParent=$(a).find('[data-wv-item-template]').parent();$(this.templateParent).find('[data-wv-item-template]').remove()};o=this.data.length;for(i=0;i<o;i++){this.addItem(this.data[i],i)}},load:function(){var t=this,i={};for(var e in this.param){i[e]=this.param[e]};if(this.onLoadStart)this.onLoadStart.call(this);if(this.loadStatus==!1){this.loadStatus=!0;return};bm.httpSend(this.url,i,n,this.dataType,this.method,10000,!1,!1);var t=this;function n(e){if(e.result===!1){alert(e.message);if(t.onLoad)t.onLoad(e);if(t.onComplete)t.onComplete(e);alert('데이터 로딩에 실패했습니다. 다시 시도해주세요.');return};if(t.onLoad)t.onLoad(e);t.setItemData(e);if(t.onComplete)t.onComplete(e);return t}},getItemData:function(t){return $.extend({},this.dataList[t])},getFormDataAtRow:function(t){var n=this.elementList[t],i={};var e;$(n).find('input').not('[type=button], [type=submit], [type=image], [type=radio], [type=checkbox]').each(function(){e=$(this).attr('name');if(!e)return;i[e]=$(this).val()});$(n).find('input[type=radio], input[type=checkbox]').each(function(){e=$(this).attr('name');if(!e)return;if(this.checked){i[e]=this.value}
else{if(this.getAttribute('data-wv-nocheck-value')){i[e]=this.getAttribute('data-wv-nocheck-value')}
else{i[e]=0}}});$(n).find('select').each(function(){e=$(this).attr('name');if(!e)return;i[e]=$(this).val()});$(n).find('textarea').each(function(){e=$(this).attr('name');if(!e)return;i[e]=$(this).val()});return i},getFormDataAllRow:function(){var e=[],i=this.elementList.length;for(var t=0;t<i;t++){e.push(this.getFormDataAtRow(t))};return e},getFormDataAllRowToJson:function(){var t=this.getFormDataAllRow();return JSON.stringify(t)}};bm.form=function(){return new BMForm()};var BMForm=function(){this.formName=null;this.updateView='';this.updateMode='';this.onUpdate=null;this.onUpdateReady=null;this.updateBtnSelector=null;this.insertView='';this.insertMode='';this.onInsert=null;this.onInsertReady=null;this.insertBtnSelector=null;this.confirmMessage=''};BMForm.prototype.constructor=BMView;BMForm.prototype.load=function(t,e){this.param.view=this.view;this.param.mode=this.mode;this.onComplete=t;this.onLoad=e;if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Object]'){var a=[],i=this;bm.each(this.param.search,function(t,e){a.push(t+'='+e)});this.param.search=a}
else if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Array]'){}
else{delete this.param.search};if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Object]'){var o=[],i=this;bm.each(this.param.whereCondition,function(t,e){o.push(t+'='+e)});this.param.whereCondition=o}
else if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Array]'){}
else{delete this.param.whereCondition};if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Object]'){var n=[],i=this;bm.each(this.param.encodeSearch,function(t,e){n.push(t+'='+encodeURI(encodeURIComponent(e)))});this.param.encodeSearch=n}
else if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Array]'){}
else{delete this.param.encodeSearch};if(this.updateBtnSelector)$(this.updateBtnSelector).off();if(this.insertBtnSelector)$(this.insertBtnSelector).off();if(this.deleteBtnSelector)$(this.deleteBtnSelector).off();if(this.templateSelector)$(this.templateSelector).remove();var i=this;app.callAndAutoSet(this.param,this.template,this.parent,'form',function(t){if(t.data.value!=null){i.defaultValue.hide()}
else{i.defaultValue.show()};if(i.onLoad)i.onLoad(t)},function(t){if(i.updateBtnSelector)$(i.updateBtnSelector).on('click',function(){i.update()});if(i.insertBtnSelector)$(i.insertBtnSelector).on('click',function(){i.insert()});if(i.deleteBtnSelector)$(i.deleteBtnSelector).on('click',function(){i.remove()});if(i.onComplete)i.onComplete(t)},this.isEmptyView)};BMForm.prototype.active=function(){if(this.updateBtnSelector)$(this.updateBtnSelector).off();if(this.insertBtnSelector)$(this.insertBtnSelector).off();if(this.deleteBtnSelector)$(this.deleteBtnSelector).off();var t=this;if(t.updateBtnSelector)$(t.updateBtnSelector).on('click',function(){t.update()});if(t.insertBtnSelector)$(t.insertBtnSelector).on('click',function(){t.insert()});if(t.deleteBtnSelector)$(t.deleteBtnSelector).on('click',function(){t.remove()})};BMForm.prototype.checkForm=function(){var i=$('[name=\''+this.formName+'\']'),n=i.find('[valid]'),t=[],e=[];n.each(function(){t.push($(this).attr('name'));e.push($(this).attr('valid'))});return bm.formCheck(this.formName,t,[],e)};BMForm.prototype.update=function(){this.param.view=this.updateView;this.param.mode=this.updateMode;if(this.confirmMessage){if(confirm(this.confirmMessage)==!1)return}
else{if(confirm('저장하시겠습니까?')==!1)return};if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Object]'){var o=[],i=this;bm.each(this.param.search,function(t,e){o.push(t+'='+e)});this.param.search=o}
else if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Array]'){}
else{delete this.param.search};if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Object]'){var n=[],i=this;bm.each(this.param.whereCondition,function(t,e){n.push(t+'='+e)});this.param.whereCondition=n}
else if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Array]'){}
else{delete this.param.whereCondition};if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Object]'){var e=[],i=this;bm.each(this.param.encodeSearch,function(t,i){e.push(t+'='+encodeURI(encodeURIComponent(i)))});this.param.encodeSearch=e}
else if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Array]'){}
else{delete this.param.encodeSearch};if(this.checkForm()){var t=bm.formMultipart(this.formName);t.extraData=this.param;t.useFormCheck=!1;t.onSubmit=this.onUpdateReady;t.onSubmitComplete=this.onUpdate;t.start()}};BMForm.prototype.insert=function(){this.param.view=this.insertView;this.param.mode=this.insertMode;if(this.confirmMessage){if(confirm(this.confirmMessage)==!1)return}
else{if(confirm('등록하시겠습니까?')==!1)return};if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Object]'){var o=[],t=this;bm.each(this.param.search,function(t,e){o.push(t+'='+e)});this.param.search=o}
else if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Array]'){}
else{delete this.param.search};if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Object]'){var n=[],t=this;bm.each(this.param.whereCondition,function(t,e){n.push(t+'='+e)});this.param.whereCondition=n}
else if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Array]'){}
else{delete this.param.whereCondition};if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Object]'){var i=[],t=this;bm.each(this.param.encodeSearch,function(t,e){i.push(t+'='+encodeURI(encodeURIComponent(e)))});this.param.encodeSearch=i}
else if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Array]'){}
else{delete this.param.encodeSearch};if(this.checkForm()){var t=this,e=bm.formMultipart(this.formName);e.extraData=this.param;e.useFormCheck=!1;e.onSubmit=this.onInsertReady;e.onSubmitComplete=function(e){document[t.formName].reset();t.onInsert(e)};e.start()}};BMForm.prototype.remove=function(){this.param.view=this.deleteView;this.param.mode=this.deleteMode;if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Object]'){var o=[],i=this;bm.each(this.param.search,function(t,e){o.push(t+'='+e)});this.param.search=o}
else if(this.param.search&&Object.prototype.toString.call(this.param.search)=='[object Array]'){}
else{delete this.param.search};if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Object]'){var n=[],i=this;bm.each(this.param.whereCondition,function(t,e){n.push(t+'='+e)});this.param.whereCondition=n}
else if(this.param.whereCondition&&Object.prototype.toString.call(this.param.whereCondition)=='[object Array]'){}
else{delete this.param.whereCondition};if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Object]'){var e=[],i=this;bm.each(this.param.encodeSearch,function(t,i){e.push(t+'='+encodeURI(encodeURIComponent(i)))});this.param.encodeSearch=e}
else if(this.param.encodeSearch&&Object.prototype.toString.call(this.param.encodeSearch)=='[object Array]'){}
else{delete this.param.encodeSearch};if(confirm('삭제하시겠습니까?')){var t=bm.formMultipart(this.formName);t.extraData=this.param;t.useFormCheck=!1;t.onSubmitComplete=this.onDelete;t.start()}};bm.paging=function(t){var e=$(t).attr('data-wv-option');if(e){e=bm.parsing.parseStrToObj(e);e.selectedIndex=e.selectedIndex||1;e.numPerPage=e.numPerPage||10;e.totalPage=e.totalPage||1;e.pagingType=e.pagingType||'default'};var i=$(t).attr('data-wv-bind'),n=new BMPaging(t,e.pagingType,e.selectedIndex,e.numPerPage,e.totalPage,i,e.wrapper);return n};var BMPaging=function(t,e,i,n,o,a,r){try{$}catch(s){throw new Error('jQuery가 필요합니다.')};this.type='BMPaging';this.pagingType=e;this.bindTargetID=a;this.wrapper=r;this.uid=BMPaging.prototype.__uid__++;this.isScrollEvent=!1;this.$container=$(t);this.id=this.$container.attr('id');if(this.pagingType=='default'){this.$container.empty();this.$buttonContainer=$('<ul class=\'button_container\' data-wv-comp-pagenavi></ul>');this.$container.append(this.$buttonContainer);if(this.$container.closest('[data-wv-crud="shop"]').length===0&&this.$container.closest('[data-wv-block-config="shop_list"]').length===0){this.$btn_firstPage=$('<li class=\'btn_singlePage btn_firstPage\' tabindex=\'0\'>처음으로</li>');this.$btn_prevPage=$('<li class=\'btn_singlePage btn_prevPage\' tabindex=\'0\'>이전페이지</li>');this.$btn_nextPage=$('<li class=\'btn_singlePage btn_nextPage\' tabindex=\'0\'>다음페이지</li>');this.$btn_lastPage=$('<li class=\'btn_singlePage btn_lastPage\' tabindex=\'0\'>맨끝으로</li>')}
else{this.$btn_firstPage=$('<li class=\'btn_singlePage btn_firstPage\' tabindex=\'0\' style=\'background-image: none; text-indent: 0px;\'>처음으로<svg style="width:19px; margin-top:3px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="레이어_1" x="0px" y="0px" viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve"><g><rect x="12.7" y="10.8" width="1.4" height="18.3"/><polygon points="26.3,28.8 17.5,20 26.3,11.3 27.3,12.3 19.5,20 27.3,27.8  "/></g></svg></li>');this.$btn_prevPage=$('<li class=\'btn_singlePage btn_prevPage\' tabindex=\'0\' style=\'background-image: none; text-indent: 0px;\'>이전페이지<svg style="width:19px; margin-top:3px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="레이어_1" x="0px" y="0px" viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve"><path d="M24.3,28.8L15.5,20l8.9-8.9l1,1L17.5,20l7.8,7.8C25.4,27.8,24.3,28.8,24.3,28.8z"/></svg></li>');this.$btn_nextPage=$('<li class=\'btn_singlePage btn_nextPage\' tabindex=\'0\' style=\'background-image: none; text-indent: 0px;\'>다음페이지<svg style="width:19px; margin-top:3px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="레이어_1" x="0px" y="0px" viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve"><path d="M17.7,28.8l-1-1l7.8-7.8l-7.8-7.9l1-1l8.9,8.9C26.5,20,17.7,28.8,17.7,28.8z"/></svg></li>');this.$btn_lastPage=$('<li class=\'btn_singlePage btn_lastPage\' tabindex=\'0\' style=\'background-image: none; text-indent: 0px;\'>맨끝으로<svg style="width:19px; margin-top:3px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="레이어_1" x="0px" y="0px" viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve"><g><polygon points="13.7,28.8 12.7,27.8 20.5,20 12.7,12.2 13.7,11.2 22.5,20  "/><rect x="25.9" y="10.8" width="1.4" height="18.3"/></g></svg></li>')}}
else if(this.pagingType=='more'){this.$buttonContainer=this.$container.find('>div')}
else if(this.pagingType=='moreClick'){this.$buttonContainer=this.$container.find('>div')};this.selectedIndex=i;this.setPageButton(this.selectedIndex,n,o);this.onSelectPage=null;this.onPrevPage=null;this.onNextPage=null;this.onFirstPage=null;this.onLastPage=null};BMPaging.PAGE_MORE='more';BMPaging.PAGE_MORE_CLICK='moreClick';BMPaging.PAGE_DEFAULT='default';BMPaging.PAGE_CLICK='pageClick';BMPaging.prototype={__uid__:0};BMPaging.prototype.binding=function(){if(this.bindTargetID){var t=this.bindTargetID.split(',');t=bm.string.trimList(t);var e=t.length;while(e--){if(app.getWvElement(t[e]))app.getWvElement(t[e]).bindPaging(this)}}};BMPaging.prototype._onClickSinglePage=function(t){if(t.data._keyEvent&&t.keyCode!==13)return!1;var o=bm.getParamList();if(app.isEditMode&&o['isCustomCrawling']&&!app.childApp&&app.parentApp){if($(this).closest('[data-wv-layout-element-type="bbs"]').length>0){window.parent.bm.toast('편집화면에서는 게시판의 페이지 이동이 불가능합니다.')}
else if($(this).closest('[data-wv-layout-element-type="shop_list"]').length>0){window.parent.bm.toast('편집화면에서는 상품리스트의 페이지 이동이 불가능합니다.')};return!1};var e=t.data._this,n=t.data._type,i=null;e.selectedIndex=parseInt(e.selectedIndex);switch(n){case'p':i=e.onPrevPage;e.selectedIndex=parseInt((e.selectedIndex-1)/e._numPerPage)*e._numPerPage;break;case'n':i=e.onNextPage;e.selectedIndex=parseInt((e.selectedIndex+e._numPerPage-1)/e._numPerPage)*e._numPerPage+1;break;case'f':i=e.onFirstPage;e.selectedIndex=1;break;case'l':i=e.onLastPage;e.selectedIndex=parseInt(e._totalPage);break;case'm':e.selectedIndex=parseInt(e.selectedIndex)+1;break};if(e.selectedIndex<1)e.selectedIndex=1;if(e.selectedIndex>e._totalPage)e.selectedIndex=parseInt(e._totalPage);e._startPage=Math.floor((parseInt(e.selectedIndex)-1)/parseInt(e._numPerPage))*parseInt(e._numPerPage)+1;if(e._startPage<1)e._startPage=1;if(e._startPage>e._totalPage)e._startPage=e._totalPage;e._updateLayout(e);if(i!=null){i.apply(e,[e.selectedIndex])};events(e).dispatch(BMPaging.PAGE_CLICK,{currentPage:e.selectedIndex,event:t})};BMPaging.prototype._updateLayout=function(t){if(t.pagingType==BMPaging.PAGE_DEFAULT){t.$buttonContainer.empty();t.$buttonContainer.append(t.$btn_firstPage);t.$buttonContainer.append(t.$btn_prevPage);var n=Math.min(t._startPage+t._numPerPage,t._totalPage+1)-1;for(var e=t._startPage;e<=n;e++){var i=$('<li class=\'btn_page\'><button type=\'button\' aria-label=\''+(e)+' page\' aria-selected=\'false\' data-wv-href-btn>'+(e)+'</button></li>');t.$buttonContainer.append(i);if(e==t._startPage){i.addClass('first')}
else if(e==n){i.addClass('last')};i.on('click',{_this:t,_page:e},t.setSelectedIndex);i.on('click',{_this:t,_page:e},t.updateUrlParam);i.on('keyup',{_this:t,_page:e,_keyEvent:!0},t.setSelectedIndex)};t.$buttonContainer.append(t.$btn_nextPage);t.$buttonContainer.append(t.$btn_lastPage);t.setSelectedIndex(t.selectedIndex);t.$btn_prevPage.on('click',{_this:t,_type:'p'},t._onClickSinglePage);t.$btn_nextPage.on('click',{_this:t,_type:'n'},t._onClickSinglePage);t.$btn_prevPage.on('keyup',{_this:t,_type:'p',_keyEvent:!0},t._onClickSinglePage);t.$btn_nextPage.on('keyup',{_this:t,_type:'n',_keyEvent:!0},t._onClickSinglePage);if(t.selectedIndex>1){t.$btn_firstPage.on('click',{_this:t,_type:'f'},t._onClickSinglePage);t.$btn_firstPage.on('keyup',{_this:t,_type:'f',_keyEvent:!0},t._onClickSinglePage)};if(t.selectedIndex<t._totalPage){t.$btn_lastPage.on('click',{_this:t,_type:'l'},t._onClickSinglePage);t.$btn_lastPage.on('keyup',{_this:t,_type:'l',_keyEvent:!0},t._onClickSinglePage)};if(!app.isEditMode&&t.bindTargetID){if($('#'+t.bindTargetID).closest('[data-wv-layout-element-type="shop_list"]').length>0){window.scrollTo(0,window.pageYOffset+$('#'+t.bindTargetID)[0].getBoundingClientRect().y)}}}
else if(t.pagingType==BMPaging.PAGE_MORE){if(t.$buttonContainer.find('button').length>0){t.$buttonContainer.find('button').off('click');t.$buttonContainer.find('button').off('keyup');t.$buttonContainer.find('button').on('click',{_this:t,_type:'m'},t._onClickSinglePage);t.$buttonContainer.find('button').on('keyup',{_this:t,_type:'m',_keyEvent:!0},t._onClickSinglePage)}
else{t.$buttonContainer.off('click');t.$buttonContainer.off('keyup');t.$buttonContainer.on('click',{_this:t,_type:'m'},t._onClickSinglePage);t.$buttonContainer.on('keyup',{_this:t,_type:'m',_keyEvent:!0},t._onClickSinglePage)}}
else if(t.pagingType==BMPaging.PAGE_MORE_CLICK){if(t.$buttonContainer.find('button').length>0){t.$buttonContainer.find('button').off('click');t.$buttonContainer.find('button').off('keyup');t.$buttonContainer.find('button').on('click',{_this:t,_type:'m'},t._onClickSinglePage);t.$buttonContainer.find('button').on('keyup',{_this:t,_type:'m',_keyEvent:!0},t._onClickSinglePage)}
else{t.$buttonContainer.off('click');t.$buttonContainer.off('keyup');t.$buttonContainer.on('click',{_this:t,_type:'m'},t._onClickSinglePage);t.$buttonContainer.on('keyup',{_this:t,_type:'m',_keyEvent:!0},t._onClickSinglePage)}}};BMPaging.prototype.setPageButton=function(t,e,i){this.setStartPage(t,e);if(e>0){this._numPerPage=Math.max(e,1)};this._totalPage=Math.max(i,1);this._updateLayout(this)};BMPaging.prototype.getNumPerPage=function(){return this._numPerPage};BMPaging.prototype.getTotalPage=function(){return this._totalPage};BMPaging.prototype.setStartPage=function(t,e){this._startPage=Math.floor((parseInt(t)-1)/parseInt(e))*parseInt(e)+1};BMPaging.prototype.setSelectedIndex=function(t){var i=1,e=null,n=null,o=!1;if(isNaN(t)){var a=bm.getParamList();if(app.isEditMode&&a['isCustomCrawling']&&!app.childApp&&app.parentApp){if($(this).closest('[data-wv-layout-element-type="bbs"]').length>0){window.parent.bm.toast('편집화면에서는 게시판의 페이지 이동이 불가능합니다.')}
else if($(this).closest('[data-wv-layout-element-type="shop_list"]').length>0){window.parent.bm.toast('편집화면에서는 상품리스트의 페이지 이동이 불가능합니다.')};return!1};if(t.data._keyEvent&&t.keyCode!==13)return!1;i=t.data._page;e=t.data._this;n=t.data._this.$buttonContainer;o=!0}
else{i=t;e=this;n=this.$buttonContainer};e.selectedIndex=i;if(e.pagingType=='default'){n.find('>li.selected').removeClass('selected');$(n.find('>li.btn_page')[i-e._startPage]).addClass('selected');$(n.find('>li.btn_page')[i-e._startPage]).find('button').attr('aria-selected',!0);$(n.find('>li.btn_page')[i-e._startPage]).find('button').attr('title','선택된 페이지');if(o){if(e.onSelectPage!=null){e.onSelectPage(i)};events(e).dispatch(BMPaging.PAGE_CLICK,{currentPage:e.selectedIndex})}}};BMPaging.prototype.updateUrlParam=function(t){history.replaceState({exPageUrl:document.location.href,exStartPage:bm.getParam('startPage')},null,'?startPage='+t.data._page+'&numPerPage=&'+t.data._this._numPerPage)};BMPaging.prototype.getSelectedIndex=function(){return this.selectedIndex};BMPaging.prototype.show=function(){this.$container.show();if(this.wrapper)$(this.wrapper).show()};BMPaging.prototype.hide=function(){this.$container.hide();if(this.wrapper)$(this.wrapper).hide()};BMPaging.prototype.scrollEventON=function(t){this.isScrollEvent=!0;var i=300,e;$(window).on('scroll',function(n){if(e){clearTimeout(e)};e=setTimeout(function(){if(Math.round($(window).scrollTop())===$(document).height()-$(window).height()){if(t)t()}},i)})};BMPaging.prototype.scrollEventOFF=function(){$(window).off('scroll');this.isScrollEvent=!1};bm.numPerPaging=function(t){var e=$(t).attr('data-wv-option');if(e){e=bm.parsing.parseStrToObj(e);e.filter=e.filter||'bmFilter';e.grid=e.grid||'bmGrid'}
else{e={filter:'bmFilter',grid:'bmGrid'}};return new BMNumPerPaging(t,e.filter,e.grid)};var BMNumPerPaging=function(t,e,i){try{$}catch(n){throw new Error('jQuery가 필요합니다.')};var o=this;this.selectBox=t;this.onChangeReady;$(t).on('change',function(){if(o.onChangeReady&&o.onChangeReady($(t).val())!==!1){app.getWvElement(i).addParam({numPerPage:$(t).val()});app.getWvElement(e).submit(!0)}})};BMNumPerPaging.prototype.setValue=function(t){$(this.selectBox).val(t);if(this.selectBox.hasAttribute('data-wv-com')){var e=$(this.selectBox).attr('id');app.getWvCom(e).val(t)}};bm.menu=function(t){var e=$(t).attr('data-wv-option');if(e)e=bm.parsing.parseStrToObj(e);else e={};var i=new BMMenu();i.init(t,e);i.registEvent();return i};var BMMenu=function(){this.type='BMMenu'};BMMenu.prototype={init:function(t,e){this.container=t;this.op=e;this.param=null},registEvent:function(){var t=this;$(this.container).hover(function(){},function(){})},destroy:function(){}};bm.bmEditorManager={list:{},registedBoardEditor:!1,activeStatus:!1,activeBoardEditor:null,add:function(t,e){var i=this;this.list[t]=e;e.statusChange=this.onActiveStatusChange;$(e.editorEl).on('click',function(){i.toolStyleSetting(e)})},get:function(t,e){var i=t||e;if(!this.list[i]){bm.BoardRichEditor(i)};return this.list[i]},hideCheckExtraTool:function(t){for(var e in this.list){this.list[e].hideCheckExtraTool(t)}},hideAllTool:function(t){for(var e in this.list){this.list[e].hideAllTool(t)}},onActiveStatusChange:function(t,e){if(bm.bmEditorManager.activeBoardEditor==e){bm.bmEditorManager.activeStatus=t};bm.bmEditorManager.registedBoardEditor=!0;bm.bmEditorManager.activeBoardEditor=e},toolStyleSetting:function(t){var i,n=t.toolList.length;for(var e=0;e<n;e++){i=t.toolList[e];i.setStyleTool()}},getBoardEditorActiveStatus:function(){return this.activeStatus}};bm.BoardRichEditor=function(t){window['isExpertMode']?window['isExpertMode']=window['isExpertMode']:window['isExpertMode']=!1;var i='ToolDomAlignHorizontal,ToolDomAlignVertical,ToolDomBackground,ToolDomWidth,ToolDomHeight,ToolDomSpace,ToolDomSpaceSizeSmall,ToolMap, ToolVideo, ToolTable, ToolLine, ToolSvg, ToolImage, ToolRecentBoard, ToolThumb, ToolSwiper, ToolTab, ToolDomBackgroundImage, ToolDomEffect',n='ToolBtnTextHistory,ToolBtnTextLetterSpacing,ToolBtnTextListStyle,ToolBtnMotion, ToolBtnScroll, ToolBtnRecentBoard, ToolBtnTextShadow',o='ToolBtnTextVideo',e=new BoardRichEditor(i,n,o,t);bm.bmEditorManager.add(t,e);return e};var BoardRichEditor=function(t,e,i,n){this.textarea;this.editorWrapper;this.editorEl;this.validMessage;this.id;this.statusChange=null;var o=this;this.removeTools=t;this.removeBtns=e;this.addBtns=i;t=t.split(',');this.removeTools=[];$.each(t,function(){o.removeTools.push($.trim(this))});e=e.split(',');this.removeBtns=[];$.each(e,function(){o.removeBtns.push($.trim(this))});this.webroot=window.parent?window.parent.WEB_ROOT:WEB_ROOT;this.fileUploadPath='fileHandler/uploadEditorFile';this.defaultTextEditorFilePath='file_manager/editor_user_file';if(n){this.init(n)};bm.toolManager.registEvent()};BoardRichEditor.prototype={lastRange:null,editorStatus:0,selectedClass:'edit_target_block',activeStatus:0,toolList:[],showToolList:[],targetElement:null,extraToolList:[],resotreLatestRange:function(){if(this.lastRange){bm.selectionManager.setRange(this.lastRange.startContainer,this.lastRange.startOffset,this.lastRange.endContainer,this.lastRange.endOffset)}},addElementAtLatestRange:function(t){this.resotreLatestRange();if(!this.lastRange){alert('적용할 위치가 선택되지 않았습니다.');return};var e=this.lastRange.endContainer;if(this.lastRange.collapsed){e=this.lastRange.endContainer}
else{var i=this.lastRange.endContainer;while(1){if(bm.dom.isBlock(i.parentNode)){e=i;break}
else{i=i.parentNode}}};if(e===this.editorEl){$(e).append(t)}
else{$(e).after(t)}},init:function(t){var s,c,i,n,e,o,a,p,u,g,B,m,v,b,y,w,T,f,C,S,x,l=this;if(Object.prototype.toString.call(t)==='[object String]'){this.textarea=document.getElementById(t);this.id=s=t}
else{if(t.length)this.textarea=t[0];else this.textarea=t;s=$(this.textarea).attr('id')||$(this.textarea).attr('data-wv-text-editor')||$(this.textarea).attr('name');if(!s){alert('에디터로 변환하려하는 textarea에 id 또는 name 또는 data-wv-text-editor의 값이 없습니다.');$(this.textarea).focus();return};this.id=s};s=s+'_bmeditor';this.validMessage=$(this.textarea).attr('data-wv-valid');$(this.textarea).removeAttr('data-wv-valid');pHolder=$(this.textarea).attr('placeholder');$(this.textarea).removeAttr('placeholder');c=$(this.textarea).width();i=$(this.textarea).height();n=bm.getStyle(this.textarea,'min-width');e=bm.getStyle(this.textarea,'min-height');o=bm.getStyle(this.textarea,'max-width');a=bm.getStyle(this.textarea,'max-height');p=bm.getStyle(this.textarea,'margin');u=bm.getStyle(this.textarea,'padding');g=bm.getStyle(this.textarea,'left');B=bm.getStyle(this.textarea,'right');m=bm.getStyle(this.textarea,'top');v=bm.getStyle(this.textarea,'bottom');b=bm.getStyle(this.textarea,'border');y=bm.getStyle(this.textarea,'background');w=bm.getStyle(this.textarea,'position');T=bm.getStyle(this.textarea,'box-sizing');C=bm.getStyle(this.textarea,'font-size');S=bm.getStyle(this.textarea,'line-height');x=bm.getStyle(this.textarea,'font-weight');c='100%';if(i<=100&&i>0)i=i+'%';else if(!bm.type.isString(i)||(i.indexOf('px')==-1&&i!='none'))i=i+'px';if(n<=100&&n>0)n=n+'%';else if(!bm.type.isString(n)||(n.indexOf('px')==-1&&n!='none'))n=n+'px';if(e<=100&&e>0)e=e+'%';else if(!bm.type.isString(e)||(e.indexOf('px')==-1&&e!='none')){if(e<400){e='400px'}
else{e=e+'px'}}
else{e='400px'};if(o<=100&&o>0)o=o+'%';else if(!bm.type.isString(o)||(o.indexOf('px')==-1&&o!='none'))o=o+'px';if(a<=100&&a>0)a=a+'%';else if(!bm.type.isString(a)||(a.indexOf('px')==-1&&a!='none'))a=a+'px';var r='';if(c){r+='width:'+c+'; '};if(i){r+='height:'+i+'; '};if(n){r+='min-width:'+n+'; '};if(e){r+='min-height:'+e+'; '};if(o){r+='max-width:'+o+'; '};if(a){r+='max-height:'+a+'; '};f=this.textarea.style.fontFamily;if(f=='')f='"Noto Sans KR", "돋움", Dotum, Verdana, Sans-serif';$(this.textarea).before('<div class=\'editor_wrapper\' id=\''+s+'EditorWrapper\'><div id=\''+s+'Editor\' class=\'wveditor_text\' style=\''+r+' margin:'+p+'; padding:'+u+'; left:'+g+'; top:'+m+'; bottom:'+v+'; background:'+y+'; position:'+w+'; border:'+b+'; box-sizing:'+T+'; font-family: '+f+'; font-size:'+C+'; line-height:'+S+'; font-weight:'+x+'; overflow: hidden; overflow-y: auto; outline: none; color: #000;\' contentEditable=\'true\' spellcheck=\'false\' placeholder=\''+pHolder+'\'></div></div>');this.editorWrapper=$('#'+s+'EditorWrapper')[0];this.editorEl=$('#'+s+'Editor')[0];this.editorEl.innerHTML=$(this.textarea).val();this.toolsetWrap=$('.toolset_wrap').not('.not_default_tool');this.toolsetWrap.css({'border':'1px solid #dde4ed','overflow':'unset'});var l=this,h,d;$('[data-wv-toolset]').each(function(){d=$(this).attr('data-wv-toolset');$(this).hide();if(l.removeTools.indexOf(d)==-1&&window[d]){h=new window[d]();l.toolList[d]=h;l.toolList.push(h);h.init(d,this,l.removeBtns,l.addBtns);h.show()}});$(this.editorWrapper).before($('.toolset_wrap'));$('.toolset_wrap [data-wv-toolset=ToolTable]').addClass('hide_label');this.toolsetWrap.find('#hotKeyBtn').closest('.toolset_box').hide();this.reposition();$(this.textarea).hide();this.active()},makeToolSet:function(t){if(!window[t]){alert('등록된 Tool Type 객체가 없습니다 : '+t);return};var e=new window[t](),i=$('[data-wv-toolset='+t+']')[0];e.init(t,i);e.targetElement=this.editorEl;e.onChangeTarget(this.editorEl);$(document).find('body').prepend(i);$(i).css({position:'absolute',width:'auto',height:'auto'});this.toolList[t]=e;this.toolList.push(e);this.extraToolList[t]=e;this.extraToolList.push(e);var n=this;e.onShow=function(t){n.showToolList.push(t)};return e},__fileUploadFormName:'editor_user_file_upload_form',__fileUploadForm:null,__getFileUploadPureForm:function(){if(!this.__fileUploadForm){$(document.body).append('<form action=\''+this.webroot+this.fileUploadPath+'\' method=\'post\' style=\'display:none;\' name=\''+this.__fileUploadFormName+'\' id=\''+this.__fileUploadFormName+'\' enctype=\'multipart/form-data\'><input type=\'hidden\' name=\'uploadFilePath\' value=\''+this.defaultTextEditorFilePath+'\'/></form>');this.__fileUploadForm=$('#'+this.__fileUploadFormName+'')};return this.__fileUploadForm},__multipartFormUploader:null,__uploadAllFile:function(t){var o=this.__getFileUploadPureForm(),i=this.__fileUploadList.pop(),e=$(i).next('p'),n=this;o.append(i);if(this.__multipartFormUploader){this.__multipartFormUploader.resetForm(this.__fileUploadFormName)}
else{this.__multipartFormUploader=new bm.formMultipart(this.__fileUploadFormName)};this.__multipartFormUploader.onSubmitComplete=function(o){var a=o.data.files.userfile;$(e).find('a').attr('href',a.src);$(e).find('a').attr('title',a.display_name);$(e).find('a').text(a.display_name);e.css('display','inline-block');i.remove();if(n.__fileUploadList.length>0)n.__uploadAllFile(t);else{t.call(n)}};this.__multipartFormUploader.start()},__fileUploadList:[],onFileSync:function(t){var e=this,i=!1;$(this.editorEl).find('.bmeditor_file_input').each(function(){if(i)return;if(!this.value){i=!0;alert('파일을 선택하지 않은 항목이 존재합니다.');return};e.__fileUploadList.push(this)});if(i){e.__fileUploadList.length=0;t(!1);return!1};if(this.__fileUploadList.length==0){t.call(e);return!0}
else{this.__uploadAllFile(t)}},readyToSave:function(t){var e=this;this.onFileSync(i);function i(i){if(i===!1)t(!1);else{t(e.updateContentField())}}},updateContentField:function(){if(this.valid()){var t=[];$(this.editorEl).find('[contentEditable="true"]').each(function(){t.push(this);$(this).attr('contentEditable',!1)});$(this.editorEl).find('table td.active').each(function(){$(this).removeClass('active')});$(this.textarea).val(this.editorEl.innerHTML);$(t).each(function(){$(this).attr('contentEditable',!0)});if(bm.wvValidCheck($(this.textarea).parent())==!1){$(this.textarea).val('');return!1};return!0}
else{return!1}},valid:function(){if(!this.validMessage)return!0;if(this.editorEl){if(bm.string.trim(this.editorEl.innerHTML)==''){this.editorEl.focus();alert(this.validMessage);return!1}
else{return!0}}
else{alert('init 함수를 먼저실행해서 에디터를 활성화 해주세요.')}},value:function(t){if(this.editorEl){this.reposition();if(t!==undefined&&t!==null){this.editorEl.innerHTML=t}
else{return this.editorEl.innerHTML}}
else{alert('init 함수를 먼저실행해서 에디터를 활성화 해주세요.')}},reset:function(){this.value('');this.reposition();if(this.textarea){$(this.textarea).val('')}},reposition:function(){var e=$(this.editorWrapper).offset(),i=$(this.toolsetWrap).height()||168,t={height:'auto',width:'100%'};$(this.toolsetWrap).css(t)},deactive:function(){if(this.activeStatus==0)return;this.activeStatus=0;if(this.statusChange)this.statusChange(this.activeStatus,this);var i=this.showToolList.length,e;for(var t=0;t<i;t++){e=this.showToolList[t];e.hide();e.deactive()};this.showToolList.length=0;this.removeListener()},removeTargetElementSingle:function(t){$(t).removeClass(this.selectedClass);this.removeTableMouseInteraction(t);this.targetElement=null},active:function(){if(this.activeStatus==1)return;this.activeStatus=1;if(this.statusChange)this.statusChange(this.activeStatus,this);bm.selectionManager.active(window,this.textarea);var t,e,i=this.toolList.length;for(t=0;t<i;t++){e=this.toolList[t];e.active(this.editorEl)};this.registListener()},registListener:function(){var t=this;$(this.editorEl).on('mouseleave',function(){if(t.activeStatus==1){t.lastRange=bm.selectionManager.getRange();t.activeStatus=0;if(t.statusChange)t.statusChange(t.activeStatus,t)}});$(this.editorEl).on('mousedown',function(e){t.activeStatus=1;if(t.statusChange)t.statusChange(t.activeStatus,t)});$(this.editorEl).on('keyup',function(){t.activeStatus=1;if(t.statusChange)t.statusChange(t.activeStatus,t)});$(window).on('resize',function(){t.reposition()});this.registTableMouseInteraction();this.registImageDblClick();$(window).on('click',this.onBodyClick);$(window).on('keydown',this.onKeyDown)},registImageDblClick:function(){var t=this,e;if(!this.editorEl)return;$(this.editorEl).find('img').off('dblclick');$(this.editorEl).off('dblclick').on('dblclick','img',function(i){var o=i.target;if(o.tagName.toLowerCase()=='img'){e=o;if(t.toolList['ToolText']&&t.toolList['ToolText'].toolBtnList&&t.toolList['ToolText'].toolBtnList['ToolBtnTextImage']){if(t.toolList['ToolText'].toolBtnList['ToolBtnTextImage'].mode=='default'){return!1}};var n=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(n).css('max-width','1600px');$(n).on('load',function(){n.contentWindow.fileManager.onSelectCallBack=function(i){t.toolList['ToolText'].toolBtnList['ToolBtnTextImage'].onFileManagerFileSelected(i,e)}})}
else if(o.tagName.toLowerCase()=='div'&&$(o).children().length==1&&$(o).find('img').length==1){e=$(o).find('img');var n=bm.popupManager.addToIframe(WEVEN_ASSET_WEB_PATH+'filemanager/page/main.php',null,'calc(95%)','calc(95%)',null,[0,0,0,0],!0,!0,!0,100005);$(n).css('max-width','1600px');$(n).on('load',function(){n.contentWindow.fileManager.onSelectCallBack=function(i){t.toolList['ToolText'].toolBtnList['ToolBtnTextImage'].onFileManagerFileSelected(i,e)}})}})},registTableMouseInteraction:function(t){var e=this;if(!t)t=this.editorEl;$(t).on('click','table',function(t){if(e.currentTarget!==this){bm.table.colSizeStatus=''};if(bm.table.colSizeStatus=='active')return})},removeImageDblClick:function(){$(this.editorEl).find('img').off('dblclick')},removeTableMouseInteraction:function(t){if(!t)t=this.editorEl;$(t).off('click','table')},hideAllTool:function(t){bm.each(this.toolList,function(e,i){i.hideOptionAll(t)})},hideCheckExtraTool:function(t){var e=this;bm.each(this.showToolList,function(i,n){if(n.type=='ToolTable'){if($(t).closest(n.targetTable).length==0&&$(t).closest(n.element).length==0){n.hide();n.deactive();var o=e.showToolList.indexOf(n);e.showToolList.splice(o,1)}}})},onBodyClick:function(t){bm.bmEditorManager.hideCheckExtraTool(t.target);bm.bmEditorManager.hideAllTool()},onkeydown:function(t){if(t.keyCode==27){bm.bmEditorManager.hideAllTool()}},getTool:function(t){return this.toolList[t]},removeListener:function(){$(this.editorEl).off();$(window).off('click',this.onBodyClick);$(window).off('keydown',this.onKeyDown);this.removeImageDblClick();this.removeTableMouseInteraction()},destroy:function(){this.removeListener()}};window.version=(function(){var t=-1;if(navigator.appName=='Microsoft Internet Explorer'){var e=navigator.userAgent,i=new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})');if(i.exec(e)!=null)t=parseFloat(RegExp.$1)};return parseInt(t)})();window.wevenBlock={};var Application=function(t){var h=!1,o=!1,s=t.readyList,a=t.initList,d=t.resetList;this.wvElementList={length:0};this.wvComList={length:0};var l=location.href.length;if(location.href.indexOf('#')>-1)l=location.href.indexOf('#');if(location.href.indexOf('?')>-1)l=location.href.indexOf('?');this.url=location.href.slice(0,l);var e=this,i='list',n=null;this.childApp=null;this.parentApp=null;this.window=window;this.isEditMode=undefined;this.editModeSetting=null;this.setEditMode=function(t){this.isEditMode=t;if(this.childApp){this.childApp.setEditMode(t)}};this.setChildren=function(t){this.childApp=t;t.setParent(app);if(this.isEditMode!==undefined){t.setEditMode(this.isEditMode)}};this.setParent=function(t){this.parentApp=t};this.uniqueCode=function(){var t;if(this.uniqueValue){t=bm.string.numUtitToString(++this.uniqueValue)}
else{this.uniqueValue=0;t=bm.string.numUtitToString(this.uniqueValue)};return bm.number.hex(Math.floor(Math.random()*255))+t};var r=function(t){if(h&&o==!1){var i=s.length;for(var e=0;e<i;e++)s[e]();s.length=0;c()}},c=function(){bm.rolling('.wrapper');AOS.init()},f=function(){var e=a.length;for(var t=0;t<e;t++)a[t]()};this.resetCall=function(){var e=d.length;for(var t=0;t<e;t++)d[t]();var e=a.length;for(var t=0;t<e;t++)a[t]()};this.getWvElement=function(t){return this.wvElementList[t]};this.getWvCom=function(t){return this.wvComList[t]};$(function(){f();h=!0;e.defaultSetting();if(e.editModeSetting)e.editModeSetting();e.registEvent();r()});this.elementCrawling=function(t,e){o=!1;this.wvTypeCrawling(t);this.wvHandlerCrawling(t);this.wvLayoutElementCrawling(e);this.additionalCrawling(t);r(t)};this.getPreventAppStatus=function(){return o};this.setPreventAppStatus=function(t){if(t===undefined)o=!0;else{o=t}};this.init=function(t){a.push(t)};this.reset=function(t){d.push(t)};this.ready=function(t){s.push(t);r()};this.defaultSetting=function(t){if(window.parent!==window&&window.parent.app){window.parent.app.setChildren(app)};var e=bm.getParamList();this.wvTypeCrawling(t);if(e['isCustomCrawling']&&!this.childApp&&this.parentApp){return};this.wvHandlerCrawling(t);this.wvLayoutElementCrawling();this.additionalCrawling(t)};this.registEvent=function(){if(typeof window.onhashchange!='undefined'){window.onhashchange=function(t){if(i=='view'&&location.hash==''){n.hide()}}}
else{window.addEventListener('popstate',function(t){if(i=='view'&&location.hash==''){n.hide()}})}};this.wvLayoutElementCrawling=function(t){var i=this,e;$('body').find('[data-block-js]').each(function(){e=$(this).attr('data-block-js');i.wvLayoutTargetCrawling(e,t)})};this.wvLayoutTargetCrawling=function(t,e){if(!wevenBlock[t])return;if(e==!0){if(wevenBlock[t]&&wevenBlock[t].hasOwnProperty('destroy')){wevenBlock[t].destroy()};wevenBlock[t].initStatus=0};if(wevenBlock[t]&&wevenBlock[t].hasOwnProperty('init')&&wevenBlock[t].initStatus!=1){if($('[data-wv-res-id='+t+']'))wevenBlock[t].block=$('[data-wv-res-id='+t+']')[0];wevenBlock[t].init();wevenBlock[t].initStatus=1;if(window.parent){if(window.parent.wvAdminIFrameBridge){if(wevenBlock[t].hasOwnProperty('editInit')){wevenBlock[t].editInit()}}}}};this.additionalCrawling=function(t,e){var o=this,i;t=t||document.body;$(t).find('[data-maxbyte]').each(function(){i=$(this).attr('data-maxbyte');bm.formHandler.maxbyte(this,i)});var a,n,s='[data-wv-com]';if(e){s='[data-wv-com='+e+']'};$(t).find(s).each(function(){i=$(this).attr('data-wv-com');if(i=='selectbox'){function t(t,e){if($(t).attr(e)!==undefined){if(isNaN(parseInt($(t).attr(e)))!==!0){return parseInt($(t).attr(e))}
else{return $(t).attr(e)}}
else{return null}};const customZIndex=t(this,'data-wv-selectbox-z-index');const customHeight=t(this,'data-wv-selectbox-height')+'px';a=new BMSelectBox(this,customZIndex,customHeight);n=$(this).attr('id')}
else if(i=='radio'){}
else if(i=='checkbox'){}
else if(i=='toggle'){}
else if(i=='datepicker'){}
else if(i=='swiper'){var e=bm.parsing.parseStrToObj($(this).attr('data-wv-com-op'));bm.swiper.addNew(this,e);n=$(this).attr('id')}
else{};if(!o.wvComList[n]){o.wvComList[n]=a;o.wvComList.length++}
else{o.wvComList[n]=a}});$(t).find('[data-wv-tooltip]').each(function(){i=$(this).attr('data-wv-tooltip');if(i.indexOf('\\n')>-1)i=i.replaceAll('\\n','<br>');new ToolTip(this,i)});function r(t){let attr=JSON.parse($(t).attr('data-wv-effect'));let setIdArr=attr['setIdArr'];if(setIdArr){for(var e=0;e<setIdArr.length;e++){new bm.effect(attr,'set'+setIdArr[e],null)}}};if($(t)[0].hasAttribute('data-wv-effect')){r(t)};$(t).find('[data-wv-effect]').each(function(){r(this)})};this.needLogin=function(){if(confirm('로그인이 필요한 서비스입니다. \n로그인 페이지로 이동하시겠습니까? ')){var t=location.href;t=t.substring('<?= WEB_ROOT ?>'.length-1);var e=WEB_ROOT+'page/login?returnUrl='+t;location.href=e}
else{history.back()}};this.setPageInfo=function(t,e){i='view';n=this.getWvElement(e);location.hash=e;if(t){var t=JSON.stringify(t);sessionStorage.setItem(location.host,this.url);sessionStorage.setItem(this.url,t);sessionStorage.setItem(this.url+'id',e)}};this.removePageInfo=function(){i='list';n=null;sessionStorage.removeItem(location.host);sessionStorage.removeItem(this.url);sessionStorage.removeItem(this.url+'id')};this.getPageInfo=function(){if(!location.hash||location.hash==='#'){return null};var t=sessionStorage.getItem(this.url+'id'),e=$.parseJSON(sessionStorage.getItem(this.url));if(t&&e){return{id:t,data:e}}
else{return null}};this.isStoredSessionStorage=function(){if(sessionStorage&&sessionStorage.getItem(location.host)){return!0}
else{return!1}};this.resetSessionStorage=function(){i='list';n=null;var t=sessionStorage.getItem(location.host);sessionStorage.removeItem(location.host);sessionStorage.removeItem(t);sessionStorage.removeItem(t+'id')};this.wvHandlerCrawling=function(t){var e,n=this,i=null;if(t!=null){i=$(t).find('[data-wv-handler]')}
else{i=$('[data-wv-handler]')};i.each(function(){e=bm.parsing.parseStrToObj($(this).attr('data-wv-handler'));if(e.type=='datepicker'){bm.datepicker.registDatePicker(this,e.target,null,e.isClear,e.isPastDisabled)};if(e.type=='timepicker'){bm.timepicker.registTimePicker(this,e.target,null,e.format,e.isPastDisabled)}
else if(e.type=='visibleToggle'){if(!e.target){alert('visibleToggle의 target이 없습니다.');return};bm.interaction.registVisibleToggle(this,$(e.target))}
else if(e.type=='visibleToggleCheckbox'){if(!e.target){alert('visibleToggleCheckbox의 target이 없습니다.');return};bm.interaction.registVisibleToggleCheckbox(this,$(e.target),e.isDefaultVisibleCheck,e.isReverse)}
else if(e.type=='draggable'){bm.interaction.registDraggable(this)}
else if(e.type=='fileUploader'){bm.fileUploader.registFileUploader(this,e)}
else if(e.type=='searchZipcode'){bm.zipcode.registZipcode(this,e)}
else if(e.type=='formHandler'){var o=e.action.split('&'),n=e.target?e.target.split('&'):null,a=this;bm.each(o,function(t,i){var o=$.extend(!0,{},e);if(n){o['target']=n[t]}
else{o['target']=null};bm.formHandler[i](a,o)})}
else if(e.type=='excelDownload'){var i=!1;events(this).addListener(e.type,function(t){if(!t||!t.data||!t.data.url){alert('다운로드를 위한 url 이 정의되지 않았습니다.');return};var n=t.data.url;try{if(i)return;i=!0;$ifr=$('<iframe src="'+n+'" style="width:0; height:0; display:none;"></iframe>');$('body').append($ifr);setTimeout(function(){$ifr.remove();i=!1},3000)}catch(e){throw new Error('BMList는 BMFilter.DOWNLOAD_EXCEL 이벤트가 미구현되어 있습니다.')}});$(this).off('click');$(this).on('click',function(){events(this).dispatch(e.type,e)})}
else if(e.type=='changeValue'){var t=this;events(this).addListener(e.type,function(e){if($(t)[0].nodeName!='SELECT'&&$(t)[0].nodeName!='DIV'&&$(t).hasClass('select_style_0_con')==!1){alert('지정한 엘리먼트는 SELECT 만 가능합니다.');return};if(!e||!e.data||!e.data.target){alert('값을 입력할 target이 존재하지 않습니다.');return};var n=e.data.value,i=e.data.target;$(i).val(n);if(n==''){$(i).attr('readonly',!1).focus()}
else{$(i).attr('readonly',!0)}});if($(t)[0].nodeName.toLowerCase()=='select'){$(this).off('change');$(this).on('change',function(){e.value=$(this).val();events(this).dispatch(e.type,e)})}
else if($(t)[0].nodeName.toLowerCase()=='div'&&$(t).hasClass('select_style_0_con')){$(t).find('>ul>li').on('click',function(){e.value=$(this).attr('data-wv-value');events(t).dispatch(e.type,e)})}}
else if(e.type=='swiper'){}});if(t!=null){i=$(t).find('[data-wv-form-bind-readonly]')}
else{i=$('[data-wv-form-bind-readonly]')};i.each(function(){e=$(this).attr('data-wv-handler')})};this.wvTypeCrawling=function(t){var r,l,i,a=this,n=[],d=[],h=null,c=null;if(t!=null){c=$(t).find('[data-wv-type=choice]');h=$(t).find('[data-wv-type]').not('[data-wv-type=choice]')}
else{c=$('[data-wv-type=choice]');h=$('[data-wv-type]').not('[data-wv-type=choice]')};c.each(function(){var t=g(this);d.push(t)});h.each(function(){g(this)});function g(t){r=$(t).attr('data-wv-type');l=$(t).attr('id');if(!l){alert('data-wv-type : '+r+' 의 ID가 정의되지 않았습니다.');return};if(!bm[r]){alert('data-wv-type : '+r+' 은 정의되지 않은 객체입니다.');return};i=bm[r](t);if(!a.wvElementList[l]){a.wvElementList[l]=i;a.wvElementList.length++}
else{a.wvElementList[l]=i};n.push(i);return i};var o=d.length;while(o--){if(d[o])d[o].appDefaultCheck()};var o=n.length;while(o--){if(n[o].binding)n[o].binding()};var s=a.getPageInfo(),i=null;if(s){i=a.getWvElement(s.id);if(i){if(i['directMode']&&i.directMode=='load'){i.directViewWithLoad(s.data)}
else{i.directViewWithSync(s)}}
else{var o=n.length;for(var e=0;e<o;e++){if(n[e].hasOwnProperty('type')&&n[e].type=='BMView'){i=n[e];break}};if(i){if(i['directMode']&&i.directMode=='load'){i.directViewWithLoad(s.data)}
else{i.directViewWithSync(s)}}
else{a.removePageInfo()}}}
else{if(a.isStoredSessionStorage()){a.resetSessionStorage()};var u=bm.getParam('bmDirect');i=a.getWvElement(u);if(i)i.directViewWithLoad(bm.getParamList());else if(u=='view'){var o=n.length;for(var e=0;e<o;e++){if(n[e].hasOwnProperty('type')&&n[e].type=='BMView'){i=n[e];break}};if(i)i.directViewWithLoad(bm.getParamList())}};var o=n.length,f,p;for(var e=0;e<o;e++){if(n[e].hasOwnProperty('type')&&n[e].type=='BMList'&&n[e].hasOwnProperty('dataAutoLoad')&&n[e]['dataAutoLoad']==!0&&n[e].directViewLoad==!1){f=n[e].container.getAttribute('id');p=$(n[e].container).attr('data-wv-crud');if(f!='crudList'&&p===undefined){if(n[e].filterObject){n[e].filterObject.submit(!0)}
else{n[e].load()}}}}};this.applyWvLanguagePack=function(t){var i=this,e=null;if(t!=null){e=$(t).find('[data-wv-lang]')}
else{e=$('[data-wv-lang]')};if(e.length>0){e.each(function(){var t=$(this).attr('data-wv-lang'),e;if(t&&t!==''&&LANGUAGE_PACK[t]){e=LANGUAGE_PACK[t];$(this).html(e)}})}};this.isCheckedSiteValid=!1;this.goToServiceSiteUrl=function(t){var e=this;if(this.isCheckedSiteValid===!1){this.isCheckedSiteValid=!0;bm.httpSendJsonPost(WEB_ROOT+'member/isValidAppSiteLoginId',{},function(i){if(i.result){if(t){var n=i.data;n.is_move=1;bm.httpSendFormPostByElemnt(SERVICE_SITE_WEB_ROOT+t,n,null,!0)}}
else{window.open(SERVICE_SITE_WEB_ROOT+t)};e.isCheckedSiteValid=!1})}};this.historyBackFnCallback=null;this.addHistoryBackEvent=function(t,i){if(i)this.historyBackFnCallback=i;events(t).removeListener('WV_HISTORY_BACK',this.historyBackEvent);events(t).addListener('WV_HISTORY_BACK',this.historyBackEvent);e.runHistoryBackEvent(t)};this.historyBackEvent=function(){history.pushState(null,null,location.href);window.onpopstate=function(t){if(app.historyBackFnCallback)app.historyBackFnCallback()}};this.runHistoryBackEvent=function(t){events(t).dispatch('WV_HISTORY_BACK')};this.historyBackComplete=function(t){if(t){window.onpageshow=function(e){if(e.persisted||(window.performance&&window.performance.navigation.type==2)){t()}}}}},app=new Application(app);