-
Notifications
You must be signed in to change notification settings - Fork 141
/
cardkit.min.js
2 lines (2 loc) · 60.2 KB
/
cardkit.min.js
1
2
define("cardkit/bus",["eventmaster"],function(a){return a()}),define("cardkit/supports",["mo/browsers"],function(a){var b={touch:a.isTouch,webview:a.webview,noBugWhenFixed:"android"!==a.os||"ucbrowser"!==a.shell};return b}),define("cardkit/ui/growl",["mo/lang","dollar","moui/growl"],function(a,b,c){function d(h,i){var j,k={corner:"bottom"};h.nodeName?(h=b(h),j=h[0][e],j&&g[j]&&g[j].close(),j=h[0][e]=++f,i=a.mix(k,h.data(),i)):i=a.mix(k,h),i.className="ck-growl",a.merge(i,d.defaultOptions);var l=c(i);return j&&(g[j]=l),l}var e="_ckGrowlUid",f=0,g={};return d.defaultOptions={},d}),define("cardkit/ui/util",["mo/lang","dollar","mo/network"],function(a,b,c){var d={flag:"_ckViewUid",forceOptions:{},defaultOptions:{},customOptions:{},config:function(){},extend:function(){}},e={singleton:function(c){function e(d,h){var i=d;"object"==typeof d?(d=b(d),i=d[0][c.flag]):d=!1;var j=i&&g[i];return j?h&&c.config(j,h):(d&&(i=d[0][c.flag]=++f),h=a.merge(a.mix(h||{},e.forceOptions,c.forceOptions),c.defaultOptions,e.defaultOptions),j=g[i]=c.factory(d,h),a.merge(j._config,a.merge(a.interset(h,c.customOptions),c.customOptions)),c.extend(j,d)),j}var f=0,g={};return c=a.merge(c,d),e.forceOptions={},e.defaultOptions={},e.gc=function(a){for(var b in g)a(g[b])&&delete g[b]},e},request:function(a){var b=a.config,d=b.jsonUrl||b.url;if(d){var e;d=d.replace(/\?(.+)$/,function(a,b){return e=b.replace(/#.*/,""),""}),c.ajax({url:d,data:e,type:b.method||"post",dataType:b.jsonUrl?"json":"text",beforeSend:a.before,handleError:a.callback,success:a.callback})}else a.callback()}};return e}),define("cardkit/ui/actionview",["moui/actionview","cardkit/bus","cardkit/ui/util"],function(a,b,c){var d=c.singleton({flag:"_ckActionViewUid",forceOptions:{className:"ck-actionview"},factory:function(b,c){return a(c)},config:function(a,b){a.set(b)},extend:function(a,c){var e={component:a};a.event.bind("prepareOpen",function(a){d.current=a}).bind("cancelOpen",function(){d.current=null}).bind("open",function(a){b.fire("actionView:open",[a]),c&&c.trigger("actionView:open",e)}).bind("close",function(){d.current=null,b.unbind("actionView:confirmOnThis"),b.fire("actionView:close",[a]),c&&c.trigger("actionView:close",e)}).bind("cancel",function(){b.fire("actionView:cancel",[a]),c&&c.trigger("actionView:cancel",e)}).bind("confirm",function(a,d){if(b.fire("actionView:confirmOnThis",[a]).fire("actionView:confirm",[a]),c&&c.trigger("actionView:confirm",e),d&&d._lastSelected){var f=d._lastSelected._node[0];"A"===f.nodeName&&b.fire("actionView:jump",[a,f.href,f.target])}})}});return d}),define("cardkit/ui/modalview",["mo/lang","dollar","moui/modalview"],function(a,b,c){function d(a){return e||(e=new d.ModalView(a)),e}var e,f={className:"ck-modalview",openDelay:400,closeDelay:400,oldStylePage:!1,contentFilter:!1},g={"text/modalview-javascript":1,"text/cardscript":1,"text/jscode":1},h=a.construct(c.ModalView);return a.mix(h.prototype,{_defaults:a.mix({},h.prototype._defaults,f),init:function(){return this.superMethod("init",arguments),this.event.bind("confirm",function(a){a.event.fire("confirmOnThis",arguments)}).bind("close",function(a){a.event.unbind("confirmOnThis")}),this},set:function(a){if(!a)return this;a.iframeUrl&&(a.iframe=a.iframeUrl),a.source&&(a.content=b("."+a.source).map(function(a){var c=b(a).attr("type");return g[c]?'<script type="text/darkscript">'+a.innerHTML+"</script>":a.innerHTML}).join(""));var c=this.superMethod("set",[a]);return this.pageNode()[0]||this._content.append(this.wrapPageContent("<div></div>")),c},setContent:function(a){if(a){var b=this._config.contentFilter;b&&(a=(new RegExp(b).exec(a)||[])[1]),a=this.wrapPageContent(a)}return this.superMethod("setContent",[a])},pageNode:function(){return this._content.find(".ck-modal-page")},wrapPageContent:function(a){var b=this._config.oldStylePage,c=b?'<div class="ckd-page-card ck-modal-page" data-cfg-deck="modalview" id="ckPage-'+this.id+'">':'<ck-card type="page" class="ck-modal-page" deck="modalview" id="ckPageOld-'+this.id+'">',d=b?"</div>":"</ck-card>";return c+a+d}}),d.ModalView=h,d}),define("cardkit/ui/ranger",["moui/ranger","cardkit/bus","cardkit/ui/growl","cardkit/ui/util"],function(a,b,c,d){return d.singleton({flag:"_ckRangerUid",customOptions:{enableNotify:!0},factory:function(b,c){return a(b,c)},config:function(a,b){a.set(b)},extend:function(a,d){a.notify=a._config.enableNotify?c({parent:d.parent(),corner:"stick"}):null,a.event.bind("change",function(b){a.notify&&a.notify.set({content:b}).open()}).bind("changed",function(){var c=d.trigger("ranger:changed",{component:a}).data("url");b.fire("ranger:changed",[a,c])}).bind("changeEnd",function(){a.notify&&a.notify.close()})}})}),define("cardkit/ui/picker",["mo/lang","moui/picker","cardkit/ui/util"],function(a,b,c){return a.mix(b.Picker.prototype._defaults,{disableRequest:!1}),c.singleton({flag:"_ckPickerUid",factory:function(a,c){return b(a,c)},defaultOptions:{options:".ck-option"},config:function(a,b){a.set(b)},extend:function(a,b){a.event.bind("change",function(a,d){var e,f=d.data(),g={component:a};a._config.disableRequest||(a.showLoading(),e=d.isEnabled?{method:f.enableMethod,url:f.enableUrl,jsonUrl:f.enableJsonUrl}:{method:f.disableMethod,url:f.disableUrl,jsonUrl:f.disableJsonUrl},c.request({config:e,callback:function(c,d){a.hideLoading(),"success"===d&&(a.responseData=c,b.trigger("picker:response",g))}})),b.trigger("picker:change",g)})}})}),define("cardkit/ui/control",["mo/lang","moui/control","cardkit/ui/util"],function(a,b,c){var d={disableRequest:!1,enableUrl:"",enableJsonUrl:"",enableMethod:"post",disableUrl:"",disableJsonUrl:"",disableMethod:"post"},e=a.construct(b.Control);a.mix(e.prototype,{_defaults:a.mix({},e.prototype._defaults,d),enable:function(){var a=this._config;return this.request({method:a.enableMethod,url:a.enableUrl,jsonUrl:a.enableJsonUrl},function(){this.superClass.enable.call(this)})},disable:function(){var a=this._config;return this.request({method:a.disableMethod,url:a.disableUrl,jsonUrl:a.disableJsonUrl},function(){this.superClass.disable.call(this)})},request:function(a,b){var d=this,e=function(a,c){"success"===c&&(d.responseData=a),d.hideLoading(),b.call(d)};return this._config.disableRequest?e():c.request({config:a,before:function(){d.showLoading()},callback:e}),this}});var f=c.singleton({flag:"_ckControlUid",factory:function(a,b){return new f.Control(a,b)},config:function(a,b){a.set(b)},extend:function(a,b){a.event.bind("enable",function(a){b.trigger("control:enable",{component:a})}).bind("disable",function(a){b.trigger("control:disable",{component:a})})}});return f.Control=e,f}),define("cardkit/ui",["mo/lang","dollar","mo/browsers","mo/template","mo/network","soviet","momo/base","momo/tap","cardkit/ui/control","cardkit/ui/picker","cardkit/ui/ranger","cardkit/ui/modalview","cardkit/ui/actionview","cardkit/ui/growl","cardkit/supports","cardkit/bus"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(){var a=i(this),b=a.data();b.disableUrl||b.disableJsonUrl?a.toggle():a.isEnabled||a.enable()}function r(){i(this).toggle()}function s(){return b(this).hasClass("ck-post-button")?void q.call(this):s.call(this.parentNode)}function t(){return b(this).hasClass("ck-switch")?void r.call(this):t.call(this.parentNode)}function u(c){var d=a.mix({confirmText:"确认",cancelText:"取消",multiselect:!1},c.data());return d.options=b(d.options||".ck-option",c),m(c,d).open()}function v(a){for(var c in a)b.Event.aliases[c]=A[c]="ck_"+a[c]}function w(){}var x,y=document,z=l(),A={},B={aliasEvents:A,autoOverride:!0,matchesSelector:!0,preventDefault:!0},C=f(y,B),D=a.construct(f.Soviet);D.prototype.on=function(a,b,c){return"string"!=typeof b||/dd-autogen/.test(b)||(b="[dd-autogen] "+b),this.superMethod("on",[a,b,c])};var E=a.construct(f.Soviet);E.prototype.on=function(a,b,c){return"string"!=typeof b||/dd-connect/.test(b)||(b="[dd-connect] "+b),this.superMethod("on",[a,b,c])},a.mix(g.Class.prototype,{bind:function(a,c,d){return b(d||this.node).bind(a,c),this},unbind:function(a,c,d){return b(d||this.node).unbind(a,c),this},trigger:function(a,c){return delete a.layerX,delete a.layerY,delete a.returnValue,b(a.target).trigger(c,a),this}});var F={".ck-link, .ck-link *":function(){H.openLink(this)},".ck-link-direct, .ck-link-direct *":function(){H.openLink(this)},".ck-link-extern, ck-link-extern *":function(){H.openLink(this,{target:this.target||"_blank"})},".ck-link-img":function(){H.openImage(this.href)},".ck-post-link":q,".ck-post-button, .ck-post-button span":s,".ck-folder header":function(){i(this.parentNode).toggle()},".ck-switch, .ck-switch span":t,".ck-segment .ck-option, .ck-segment .ck-option span":function(){var a=b(this);a.hasClass("ck-option")||(a=a.closest(".ck-option"));var c=j(a.parent());c.select(a)},".ck-select, .ck-select span, .ck-select .enabled":function(){var a=b(this);a.hasClass("ck-select")||(a=a.parent());var c=j(a);u(a),p.on("actionView:confirmOnThis",function(b){H.updatePicker(c,b.val()),a.trigger("selector:change",{component:c})})},".ck-tagselector .ck-option":function(){var a=j(this.parentNode);a.select(this)},".ck-actions .ck-option":function(){var a=b(this).closest(".ck-actions"),c=j(a,{ignoreStatus:"false"!==a.data("ignoreStatus")&&!0});c.select(this)},".ck-actions-button, .ck-actions-button span":function(){var a=b(this);a.hasClass("ck-actions-button")||(a=a.parent()),u(a)},".ck-modal-button, .ck-modal-button *":function(){var a=b(this);a.hasClass("ck-modal-button")||(a=a.closest(".ck-modal-button")),H.openModal(a.data())},".ck-modal-link, .ck-modal-link *":function(){var a=b(this);a.hasClass("ck-modal-link")||(a=a.closest(".ck-modal-link")),H.openModal(a.data())},".ck-modalview .wrapper > header .confirm":function(){z.confirm()},".ck-modalview .wrapper > header .cancel":function(){z.cancel()},".ck-actionview .ck-option, .ck-actionview .ck-option > *":function(){var a=b(this);a.hasClass("ck-option")||(a=a.parent()),m.current.select(a)},".ck-actionview > footer .confirm":function(){m.current.confirm()},".ck-actionview > footer .cancel":function(){m.current.cancel()},".ck-top-overflow":function(){u(b(this))},".ck-confirm-link":function(){var a=this;a.href||(a=a.parentNode),H.confirm("",function(){H.openLink(a.href,a.target)},b(a).data())},".ck-growl-button":function(){n(this).open()}};p.on("ranger:changed",function(a,b){b&&H.openLink(d.format(b,{value:a.val()}))}),p.on("actionView:jump",function(a,b,c){H.openLink(b,{target:c})});var G={control:i,picker:j,ranger:k,modalCard:z,modalView:l,actionView:m,growl:n},H={alert:function(b,c){return m("ckAlert",a.mix({title:"提示",content:b||"",cancelText:"关闭",multiselect:!1},c)).open()},confirm:function(b,c,d){var e=m("ckAlert",a.mix({title:"提示",content:b||"",confirmText:"确认",cancelText:"取消",multiselect:!0},d)).open();return p.on("actionView:confirmOnThis",c),e},openModal:function(a){function b(b){c===x&&(a.jsonUrl&&(b=b.html),a.content=b,H.hideLoading(),z.set(a).open())}var c=+new Date,d=a.jsonUrl||a.url;d?(H.showLoading(),x=c,a.jsonUrl?e.getJSON(d,b):a.url&&e.ajax({url:d,success:b})):z.set(a).open()},closeModal:function(){return x=0,z.cancel(),z.event.promise("close")},openImage:function(a){H.openLink(a,{target:"_blank"})},notify:function(b,c){return n(a.mix({content:b},c)).open()},showLoading:function(a){this.loadingTips||(this.loadingTips=n({expires:-1,keepalive:!0,corner:"center"})),this.loadingTips.set({content:a||"加载中..."}).open(),this._loadingStart=+new Date},hideLoading:function(b){b=a.mix({duration:800},b);var c=+new Date-this._loadingStart;c<b.duration?setTimeout(function(){H.hideLoading(b)},b.duration-c):this.loadingTips&&this.loadingTips.close()},updatePicker:function(b,c){if(Array.isArray(c)){var d=b.val();a.each(d,function(a){this[a]||b.unselect(a)},a.index(c)),a.each(c,function(a){this[a]||b.select(a)},a.index(d))}else b.select(c)},openLink:function(a,b){if(b=b||{},"string"!=typeof a){var c=a;a=c.href,b.target=b.target||c.target}b.target&&"_self"!==b.target?window.open(a,b.target):location.href=a}},I={init:function(a){a=a||{};var c=b(a.appWrapper);m.forceOptions.parent=c,n.defaultOptions.parent=c,z.set({oldStylePage:a.oldStyle,parent:c});var d=h(y);v(d.event);var e={};Object.keys(F).forEach(function(a){this[a]=w},e),C.on("tap",F).on("click",e),this.brightDelegate.on("change",{".ck-ranger":function(a){return k(this).val(a.target.value),!0}}).on("touchstart",{".ck-ranger":function(a){return k(this).val(a.target.value),k(this).changeStart(),!0}}).on("touchend",{".ck-ranger":function(){return k(this).changeEnd(),!0}})},brightDelegate:new D(y,B),darkDelegate:new E(y,B),action:H,component:G};return I}),define("cardkit/helper",["mo/lang","dollar","darkdom","cardkit/ui"],function(a,b,c,d){function e(b,c){var d=i(b,a.merge({disableRequest:!0},c.component._config));d.responseData=c.component.responseData,d.enable()}function f(b,c){var d=i(b,a.merge({disableRequest:!0},c.component._config));d.responseData=c.component.responseData,d.disable()}function g(a){return function(b,d){var e=b.target.id;e&&(e=c.getDarkByCustomId(e),e[0]&&!e[0]._ckDisablePageForward&&(a(e,b),d.updateDarkDOM({ignoreRender:!0})))}}function h(a){return function(d){var e=d.target.id;if(e=e?c.getDarkByCustomId(e):c.getDarkById(d.target.parentNode.id),e[0])if(e[0]._ckDisablePageForward=!0,a(e,d),e[0].isDarkSource){var f=b(d.target).closest(".ck-top-actions");c.getDarkById(f[0].id).updateDarkSource()}else e.updateDarkDOM()}}var i=d.component.control,j=d.component.picker,k=d.component.ranger,l={readState:function(a,b){return a&&(a.state||{})[b]},readSource:function(a){var b=a.data("source");return b&&"."+b},readLabel:function(a){var c=a.data("label");return c&&(c=a.find(c)[0]),c=b(c||a),c.text()||c.val()},readClass:function(a){return a[0].className.split(/\s+/).filter(function(a){return a&&!/^ckd\-/.test(a)}).join(" ")},forwardStateEvents:function(a){a.forward({"control:enable *":"control:enable","control:disable *":"control:disable","picker:change *":"picker:change","picker:response *":"picker:response","selector:change *":"selector:change","ranger:changed *":"ranger:changed"})},applyStateEvents:function(a){a.forward({"control:enable":m,"control:disable":n,"picker:change":o,"picker:response":p,"selector:change":q,"ranger:changed":r})},forwardActionEvents:function(a){a.forward({"control:enable .ck-top-act > *":"topControl:enable","control:disable .ck-top-act > *":"topControl:disable","actionView:confirm .ck-top-overflow":"topOverflow:confirm"})},applyActionEvents:function(a){a.forward({"topOverflow:confirm":u,"topControl:enable":s,"topControl:disable":t})},forwardInputEvents:function(a){a.forward({"change select":"select:change","change input":"input:change","change textarea":"input:change"})},applyInputEvents:function(a){a.forward({"select:change":v,"input:change":w})},isBlank:function(a){return!a||!/\S/m.test(a)}},m=g(e),n=g(f),o=g(function(b,c){var e=j(b,a.merge({disableRequest:!0},c.component._config)),f=c.component.val();d.action.updatePicker(e,f)}),p=g(function(b,c){var d=j(b,a.merge({},c.component._config));d.responseData=c.component.responseData,b.trigger("picker:response",{component:d})}),q=g(function(b,c){b.trigger("selector:change",{component:j(b,a.merge({disableRequest:!0},c.component._config))})}),r=g(function(b,c){var d=k(b,a.merge({enableNotify:!1},c.component._config)),e=c.component.val();d.val(e).attr("value",e),b.trigger("ranger:changed",{component:d})}),s=h(e),t=h(f),u=function(a){var c=a.component.val(),d=b("#"+c).children();d.trigger("tap")},v=g(function(a,c){b("option",c.target).forEach(function(a,b){a.selected?this.eq(b).attr("selected","selected"):this.eq(b).removeAttr("selected")},a.find("option"))}),w=g(function(a,b){var c=b.target.checked;a[0].checked=c,c===!1?a.removeAttr("checked"):a.attr("checked","checked");var d=b.target.value;a.val(d).attr("value",d)});return l}),define("cardkit/oldspec/common/item",["cardkit/helper"],function(a){var b={source:a.readSource};return{title:function(a){a.watch(".ckd-title"),a.state(b),a.state({link:"href",linkTarget:function(a){return a.hasClass("ckd-title-link-extern")&&(a.attr("target")||"_blank")},isAlone:function(a){return a.hasClass("ckd-title-link-alone")}})},titleLink:function(a){a.watch(".ckd-title-link"),a.state(b),a.state({link:"href",linkTarget:function(a){return a.hasClass("ckd-title-link-extern")&&(a.attr("target")||"_blank")},isAlone:function(a){return a.hasClass("ckd-title-link-alone")}})},titlePrefix:function(a){a.watch(".ckd-title-prefix"),a.state(b)},titleSuffix:function(a){a.watch(".ckd-title-suffix"),a.state(b)},titleTag:function(a){a.watch(".ckd-title-tag"),a.state(b)},icon:function(a){a.watch(".ckd-icon"),a.state(b),a.state({imgUrl:"src"})},info:function(a){a.watch(".ckd-info"),a.state(b)},opt:function(a){a.watch(".ckd-opt"),a.state(b)},desc:function(a){a.watch(".ckd-desc, .ckd-subtitle"),a.state(b)},content:function(a){a.watch(".ckd-content"),a.state(b)},meta:function(a){a.watch(".ckd-meta"),a.state(b)},author:function(a){a.watch(".ckd-author"),a.state(b),a.state({link:"href",linkTarget:function(a){return a.hasClass("ckd-author-link-extern")&&(a.attr("target")||"_blank")}})},authorLink:function(a){a.watch(".ckd-author-link"),a.state(b),a.state({link:"href",linkTarget:function(a){return a.hasClass("ckd-author-link-extern")&&(a.attr("target")||"_blank")}})},authorPrefix:function(a){a.watch(".ckd-author-prefix"),a.state(b)},authorSuffix:function(a){a.watch(".ckd-author-suffix"),a.state(b)},avatar:function(a){a.watch(".ckd-avatar"),a.state(b),a.state({imgUrl:"src"})},authorInfo:function(a){a.watch(".ckd-author-info"),a.state(b)},authorDesc:function(a){a.watch(".ckd-author-desc"),a.state(b)},authorMeta:function(a){a.watch(".ckd-author-meta"),a.state(b)}}}),define("cardkit/oldspec/common/scaffold",["cardkit/helper"],function(a){var b={source:a.readSource};return{hd:function(a){a.watch(".ckd-hd"),a.state(b),a.state({link:"href",linkTarget:function(a){return a.hasClass("ckd-hd-link-extern")&&(a.attr("target")||"_blank")}})},hdLink:function(a){a.watch(".ckd-hd-link:not(.ckd-hd)"),a.state(b),a.state({link:"href",linkTarget:function(a){return a.hasClass("ckd-hd-link-extern")&&(a.attr("target")||"_blank")}})},hdOpt:function(a){a.watch(".ckd-hdopt"),a.state(b)},ft:function(a){a.watch(".ckd-ft")},blank:function(a){a.watch(".ckd-blank")}}}),define("cardkit/spec/common/source_item",["cardkit/oldspec/common/item"],function(a,b){return b("cardkit/oldspec/common/item")}),define("cardkit/spec/common/item",[],function(){return{title:function(a){a.watch('ck-part[type="title"]'),a.state({link:"href",linkTarget:"target",isAlone:"alone-mode"})},titleLink:function(a){a.watch('ck-part[type="titleLink"]'),a.state({link:"href",linkTarget:"target",isAlone:"alone-mode"})},titlePrefix:'ck-part[type="titlePrefix"]',titleSuffix:'ck-part[type="titleSuffix"]',titleTag:'ck-part[type="titleTag"]',icon:function(a){a.watch('ck-part[type="icon"]'),a.state({imgUrl:"src"})},info:'ck-part[type="info"]',opt:function(a){a.watch('ck-part[type="opt"]')},desc:'ck-part[type="desc"]',content:'ck-part[type="content"]',meta:'ck-part[type="meta"]',author:function(a){a.watch('ck-part[type="author"]'),a.state({link:"href",linkTarget:"target"})},authorLink:function(a){a.watch('ck-part[type="authorLink"]'),a.state({link:"href",linkTarget:"target"})},authorPrefix:'ck-part[type="authorPrefix"]',authorSuffix:'ck-part[type="authorSuffix"]',avatar:function(a){a.watch('ck-part[type="avatar"]'),a.state({imgUrl:"src"})},authorInfo:'ck-part[type="authorInfo"]',authorDesc:'ck-part[type="authorDesc"]',authorMeta:'ck-part[type="authorMeta"]'}}),define("cardkit/spec/common/source_scaffold",["cardkit/oldspec/common/scaffold"],function(a,b){return b("cardkit/oldspec/common/scaffold")}),define("cardkit/spec/common/scaffold",[],function(){return{hd:function(a){a.watch('ck-part[type="hd"]'),a.state({link:"href",linkTarget:"target"})},hdLink:function(a){a.watch('ck-part[type="hdLink"]'),a.state({link:"href",linkTarget:"target"})},hdOpt:function(a){a.watch('ck-part[type="hdOpt"]')},ft:function(a){a.watch('ck-part[type="ft"]')},blank:function(a){a.watch('ck-part[type="blank"]')}}}),define("cardkit/spec/list",["dollar","cardkit/helper","cardkit/spec/common/scaffold","cardkit/spec/common/source_scaffold","cardkit/spec/common/item","cardkit/spec/common/source_item"],function(a,b,c,d,e,f){function g(a){a.watch(".ckd-item"),a.state(k),a.component(f)}function h(a){a.state({subtype:"subtype",blankText:"blank-text",limit:"limit",col:"col",paperStyle:"paper-style",plainStyle:"plain-style",plainHdStyle:"plain-hd-style",customClass:"custom-class"}),a.component(c),a.component("item",function(a){a.watch('ck-part[type="item"]'),a.state({link:"href",linkTarget:"target",isAlone:"alone-mode",customClass:"custom-class"}),a.component(e),a.source().state(k).component(f)}),a.source().component(d).component("item",g)}function i(b,c){b.watch(a(j,c)),h(b)}var j='ck-card[type="list"]',k={link:"href",linkTarget:function(a){return a.hasClass("ckd-title-link-extern")&&(a.attr("target")||"_blank")},isAlone:function(a){return a.hasClass("ckd-title-link-alone")},customClass:b.readClass};return i.sourceItemStates=k,i.sourceItemSpec=g,i.initList=h,i}),define("cardkit/oldspec/list",["dollar","cardkit/helper","cardkit/spec/list","cardkit/oldspec/common/scaffold","cardkit/oldspec/common/item"],function(a,b,c,d,e){function f(a){a.state({subtype:"data-style",blankText:"data-cfg-blank",limit:"data-cfg-limit",col:"data-cfg-col",paperStyle:"data-cfg-paper",plainStyle:"data-cfg-plain",plainHdStyle:"data-cfg-plainhd",customClass:b.readClass}),a.state(h),a.component(d),a.component("item",function(a){a.watch(".ckd-item"),a.state(h),a.state(i),a.component(e),a.source().component(e)}),a.source().component(d).component("item",j)}function g(b,c){b.watch(a(k,c)),b.watch(a(l,c)),f(b)}var h={source:b.readSource},i=c.sourceItemStates,j=c.sourceItemSpec,k=".ckd-list-card",l=".ck-list-unit";return g.initList=f,g}),define("cardkit/oldspec/box",["dollar","cardkit/helper","cardkit/oldspec/common/scaffold"],function(a,b,c){var d={source:b.readSource},e=".ckd-box-card",f=".ck-box-unit";return function(g,h){g.watch(a(e,h)),g.watch(a(f,h)),g.state({subtype:"data-style",paperStyle:"data-cfg-paper",plainStyle:"data-cfg-plain",plainHdStyle:"data-cfg-plainhd",customClass:b.readClass}),g.state(d),g.component(c),g.component({content:function(a){a.watch(".ckd-content"),a.state(d)},collect:function(a){a.watch(".ckd-collect"),a.state(d)}}),g.source().component(c).component({content:".ckd-content",collect:".ckd-collect"})}}),define("cardkit/spec/form",["dollar","cardkit/helper","cardkit/spec/common/scaffold","cardkit/spec/common/source_scaffold"],function(a,b,c,d){function e(g,h){g.watch(a(f,h)),g.state({subtype:"subtype",blankText:"blank-text",plainHdStyle:"plain-hd-style",customClass:"custom-class"}),g.component(c),g.component("item",function(a){a.watch('ck-part[type="item"]'),a.component({title:'ck-part[type="title"]',content:'ck-part[type="content"]'}),b.applyInputEvents(a),a.source().component({title:".ckd-title",content:".ckd-content"})}),g.source().component(d).component("item",e.sourceItemSpec)}var f='ck-card[type="form"]';return e.sourceItemSpec=function(a){a.watch(".ckd-item"),a.component({title:".ckd-title",content:".ckd-content"})},e}),define("cardkit/oldspec/form",["dollar","cardkit/helper","cardkit/spec/form","cardkit/oldspec/common/scaffold"],function(a,b,c,d){var e={source:b.readSource},f=".ckd-form-card",g=".ck-form-unit";return function(h,i){h.watch(a(f,i)),h.watch(a(g,i)),h.state({subtype:"data-style",blankText:"data-cfg-blank",plainHdStyle:"data-cfg-plainhd",customClass:b.readClass}),h.state(e),h.component(d),h.component("item",function(a){a.watch(".ckd-item"),a.component({title:function(a){a.watch(".ckd-title"),a.state(e)},content:function(a){a.watch(".ckd-content"),a.state(e)}}),b.applyInputEvents(a),a.source().component({title:".ckd-title",content:".ckd-content"})}),h.source().component(d).component("item",c.sourceItemSpec)}}),define("cardkit/oldspec/mini",["dollar","cardkit/oldspec/list"],function(a,b){var c=".ckd-mini-card",d=".ck-mini-unit";return function(e,f){e.watch(a(c,f)),e.watch(a(d,f)),b.initList(e)}}),define("cardkit/spec/mini",["dollar","cardkit/spec/list"],function(a,b){var c='ck-card[type="mini"]';return function(d,e){d.watch(a(c,e)),b.initList(d)}}),define("cardkit/spec/box",["dollar","cardkit/spec/common/scaffold","cardkit/spec/common/source_scaffold"],function(a,b,c){var d='ck-card[type="box"]';return function(e,f){e.watch(a(d,f)),e.state({subtype:"subtype",paperStyle:"paper-style",plainStyle:"plain-style",plainHdStyle:"plain-hd-style",customClass:"custom-class"}),e.component(b),e.component({content:'ck-part[type="content"]',collect:'ck-part[type="collect"]'}),e.source().component(c).component({content:".ckd-content",collect:".ckd-collect"})}}),define("cardkit/spec/page",["dollar","cardkit/helper","cardkit/spec/box","cardkit/spec/list","cardkit/spec/mini","cardkit/spec/form"],function(a,b,c,d,e,f,g){function h(a){a.watch('ck-part[type="nav"]'),a.state({link:"href"})}function i(a){a.watch('ck-part[type="banner"]'),a.state({plainStyle:"plain-style"})}function j(a){a.watch('ck-part[type="actionbar"]'),a.state({limit:"limit"}),a.component("action",k),a.source().component("action",l),p.applyActionEvents(a)}function k(a){a.watch("[action-layout]"),a.state({label:p.readLabel,forceOverflow:function(a){return"overflow"===a.attr("action-layout")}}),m(a.source())}function l(a){a.watch(".ckd-item, .ckd-overflow-item"),m(a)}function m(a){a&&a.state({label:p.readLabel,forceOverflow:function(a){return a.hasClass("ckd-overflow-item")}})}function n(a,b){a.watch(o(n.SELECTOR+q,b)),a.state({blankText:"blank-text",deck:"deck",isPageActive:"active-page",isDeckActive:"active-deck",currentDeck:"current-deck",fixedMinHeight:"fixed-minheight",cardId:"id"}),a.component(r),p.applyStateEvents(a)}var o=g("dollar"),p=g("cardkit/helper"),q=".unmount-page",r={title:'ck-part[type="title"]',actionbar:j,nav:h,banner:i,footer:'ck-part[type="footer"]',blank:'ck-part[type="blank"]',box:g("cardkit/spec/box"),list:g("cardkit/spec/list"),mini:g("cardkit/spec/mini"),form:g("cardkit/spec/form")};return n.SELECTOR='ck-card[type="page"]',n.initOldStyleActionState=m,n}),define("cardkit/oldspec/page",["dollar","cardkit/spec/page","cardkit/helper","cardkit/oldspec/box","cardkit/oldspec/list","cardkit/oldspec/mini","cardkit/oldspec/form"],function(a,b,c,d,e,f,g,h){function i(a){a.watch(".ckd-page-title"),a.state("source",s.readSource)}function j(a){a.watch(".ckd-page-blank"),a.state("source",s.readSource)}function k(a){a.watch(".ckd-page-nav"),a.state({link:"href",source:s.readSource})}function l(a){a.watch(".ckd-page-banner"),a.watch(".ck-banner-unit"),a.state({plainStyle:"data-cfg-plain",source:s.readSource})}function m(a){a.watch(".ckd-page-actions"),a.state({limit:"data-cfg-limit",source:s.readSource}),a.component("action",o),a.source().component("action",o),s.applyActionEvents(a)}function n(a){a.watch(".ckd-page-footer"),a.state("source",s.readSource)}function o(a){a.watch(".ckd-item, .ckd-overflow-item"),a.state("source",s.readSource),t(a),t(a.source())}function p(a,b){a.watch(q(p.SELECTOR+u,b)),a.watch(q(p.SELECTOR_OLD+u,b)),a.state({blankText:"data-cfg-blank",deck:"data-cfg-deck",isPageActive:"data-active-page",isDeckActive:"data-active-deck",currentDeck:"data-current-deck",fixedMinHeight:"data-fixed-minheight",cardId:"id"}),a.component(v),s.applyStateEvents(a)}var q=h("dollar"),r=h("cardkit/spec/page"),s=h("cardkit/helper"),t=r.initOldStyleActionState,u=".unmount-page",v={title:i,actionbar:m,nav:k,banner:l,footer:n,blank:j,box:h("cardkit/oldspec/box"),list:h("cardkit/oldspec/list"),mini:h("cardkit/oldspec/mini"),form:h("cardkit/oldspec/form")};return p.SELECTOR=".ckd-page-card",p.SELECTOR_OLD=".ck-card",p}),define("cardkit/oldspec",["cardkit/oldspec/page","cardkit/oldspec/box","cardkit/oldspec/list"],function(a,b,c,d){return{page:[d("cardkit/oldspec/page")],box:[d("cardkit/oldspec/box")],list:[d("cardkit/oldspec/list")]}}),define("cardkit/tpl/scaffold/ft",[],function(){return{template:"<footer>{%= content %}</footer>\n"}}),define("cardkit/tpl/scaffold/hd_opt",[],function(){return{template:'<span class="ck-hdopt">{%= content %}</span>\n'}}),define("cardkit/tpl/scaffold/hd",[],function(){return{template:'<span class="ck-hd {%= (hdLink && \'clickable\' || \'\') %}">\n {% if (hdLink) { %}\n <a href="{%= hdLink %}" \n target="{%= (hdLinkTarget || \'_self\') %}" \n class="ck-link-mask ck-link"></a>\n {% } %}\n <span>{%= content %}</span>\n</span>\n'}}),define("cardkit/card/common/scaffold",["darkdom","mo/template/micro","cardkit/helper","cardkit/tpl/scaffold/hd","cardkit/tpl/scaffold/hd_opt","cardkit/tpl/scaffold/ft"],function(a,b,c,d,e,f,g){var h=g("darkdom"),i=g("mo/template/micro").convertTpl,j=g("cardkit/helper"),k=i(g("cardkit/tpl/scaffold/hd").template),l=i(g("cardkit/tpl/scaffold/hd_opt").template),m=i(g("cardkit/tpl/scaffold/ft").template),n={hd:function(){return h({unique:!0,enableSource:!0,render:function(a){var b=a.context.componentData.hdLink,c=j.readState(b,"link");return a.hdLink=c||a.state.link,a.hdLinkTarget=c?j.readState(b,"linkTarget"):a.state.linkTarget,k(a)}})},hdLink:function(){return h({unique:!0,enableSource:!0,render:function(a){return a.state.link}})},hdOpt:function(){return h({enableSource:!0,sourceAsContent:!0,render:l})},ft:function(){return h({unique:!0,enableSource:!0,render:m})},blank:function(){return h({unique:!0,enableSource:!0,render:function(a){return"<div>"+a.content+"</div>"}})}};return n}),define("cardkit/tpl/item/author_meta",[],function(){return{template:'<span class="ck-author-meta">{%= content %}</span>\n'}}),define("cardkit/tpl/item/author_info",[],function(){return{template:'<span class="ck-author-info">{%= content %}</span>\n'}}),define("cardkit/tpl/item/author_desc",[],function(){return{template:'<span class="ck-author-desc">{%= content %}</span>\n'}}),define("cardkit/tpl/item/avatar",[],function(){return{template:'{% if (state.imgUrl) { %}\n {% if (context.authorLink) { %}\n <a href="{%= context.authorLink %}" \n target="{%= (context.authorLinkTarget || \'_self\') %}" \n class="ck-avatar ck-link">\n <img src="{%= state.imgUrl %}"/>\n </a>\n {% } else { %}\n <span class="ck-avatar">\n <img src="{%= state.imgUrl %}"/>\n </span>\n {% } %}\n{% } %}\n'}}),define("cardkit/tpl/item/author_suffix",[],function(){return{template:'<span class="ck-author-suffix">{%= content %}</span>\n'}}),define("cardkit/tpl/item/author_prefix",[],function(){return{template:'<span class="ck-author-prefix">{%= content %}</span>\n'}}),define("cardkit/tpl/item/author",[],function(){return{template:'{% if (context.authorLink) { %}\n<a href="{%= context.authorLink %}" \n target="{%= (context.authorLinkTarget || \'_self\') %}" \n class="ck-author ck-link">{%= content %}</a>\n{% } else { %}\n<span class="ck-author">{%= content %}</span>\n{% } %}\n'}}),define("cardkit/tpl/item/meta",[],function(){return{template:'<span class="ck-meta">{%= content %}</span>\n'}}),define("cardkit/tpl/item/content",[],function(){return{template:'<span class="ck-content">{%= content %}</span>\n'}}),define("cardkit/tpl/item/opt",[],function(){return{template:'<span class="ck-opt">{%= content %}</span>\n'}}),define("cardkit/tpl/item/info",[],function(){return{template:'<span class="ck-info">{%= content %}</span>\n'}}),define("cardkit/tpl/item/desc",[],function(){return{template:'<span class="ck-desc">{%= content %}</span>\n'}}),define("cardkit/tpl/item/icon",[],function(){return{template:'{% if (state.imgUrl) { %}\n {% if (context.isItemLinkAlone) { %}\n <a href="{%= context.itemLink %}" \n target="{%= (context.itemLinkTarget || \'_self\') %}" \n class="ck-icon ck-link">\n <img src="{%= state.imgUrl %}"/>\n </a>\n {% } else { %}\n <span class="ck-icon">\n <img src="{%= state.imgUrl %}"/>\n </span>\n {% } %}\n{% } %}\n'}
}),define("cardkit/tpl/item/title_tag",[],function(){return{template:'<span class="ck-tag">{%= content %}</span>\n'}}),define("cardkit/tpl/item/title_suffix",[],function(){return{template:'<span class="ck-title-suffix">{%= content %}</span>\n'}}),define("cardkit/tpl/item/title_prefix",[],function(){return{template:'<span class="ck-title-prefix">{%= content %}</span>\n'}}),define("cardkit/tpl/item/title",[],function(){return{template:'{% if (context.isItemLinkAlone) { %}\n<a href="{%= context.itemLink %}" \n class="ck-link"\n target="{%= (context.itemLinkTarget || \'_self\') %}">{%= content %}</a>\n{% } else { %}\n<span class="ck-title">{%= content %}</span>\n{% } %}\n\n'}}),define("cardkit/tpl/item",[],function(){return{template:'<div class="ck-item {%= (itemLink && \'clickable\' || \'\') %} {%= state.customClass %}" \n style="width:{%= (context.state.col ? Math.floor(1000/context.state.col)/10 + \'%\' : \'\') %};">\n\n <div class="ck-initem">\n\n {% if (itemLink && !isItemLinkAlone) { %}\n <a href="{%= itemLink %}" \n target="{%= (itemLinkTarget || \'_self\') %}"\n class="ck-link-mask ck-link"></a>\n {% } %}\n\n <div class="ck-title-box">\n\n {%= component.opt.join(\'\') %}\n {%= component.icon %}\n\n <div class="ck-title-set">\n\n {% if (itemContent) { %}\n <div class="ck-title-line">\n {%= component.titlePrefix.join(\'\') %}\n {%= itemContent %}\n {%= component.titleSuffix.join(\'\') %}\n {%= component.titleTag.join(\'\') %}\n </div>\n {% } %}\n\n {% if (component.info.length) { %}\n <div class="ck-info-wrap">\n {%= component.info.join(\'\') %}\n </div>\n {% } %}\n\n {% if (component.desc.length) { %}\n <div class="ck-desc-wrap">\n {%= component.desc.join(\'\') %}\n </div>\n {% } %}\n\n </div>\n\n {% if (component.content.length) { %}\n <div class="ck-content-wrap">\n {%= component.content.join(\'\') %}\n </div>\n {% } %}\n\n {% if (component.meta.length) { %}\n <div class="ck-meta-wrap">\n {%= component.meta.join(\'\') %}\n </div>\n {% } %}\n\n </div>\n\n {% if (component.author || component.authorDesc.length || component.authorMeta.length) { %}\n <div class="ck-author-box">\n\n {%= component.avatar %}\n\n <div class="ck-author-set">\n\n <div class="ck-author-line">\n {%= component.authorPrefix.join(\'\') %}\n {%= component.author %}\n {%= component.authorSuffix.join(\'\') %}\n </div>\n\n {% if (component.authorInfo.length) { %}\n <div class="ck-author-info-wrap">\n {%= component.authorInfo.join(\'\') %}\n </div>\n {% } %}\n\n {% if (component.authorDesc.length) { %}\n <div class="ck-author-desc-wrap">\n {%= component.authorDesc.join(\'\') %}\n </div>\n {% } %}\n\n </div>\n\n {% if (component.authorMeta.length) { %}\n <div class="ck-author-meta-wrap">\n {%= component.authorMeta.join(\'\') %}\n </div>\n {% } %}\n\n </div>\n {% } %}\n\n </div>\n\n</div>\n\n'}}),define("cardkit/card/item",["darkdom","mo/lang/mix","mo/template/micro","cardkit/helper","cardkit/tpl/item","cardkit/tpl/item/title","cardkit/tpl/item/title_prefix","cardkit/tpl/item/title_suffix","cardkit/tpl/item/title_tag","cardkit/tpl/item/icon","cardkit/tpl/item/desc","cardkit/tpl/item/info","cardkit/tpl/item/opt","cardkit/tpl/item/content","cardkit/tpl/item/meta","cardkit/tpl/item/author","cardkit/tpl/item/author_prefix","cardkit/tpl/item/author_suffix","cardkit/tpl/item/avatar","cardkit/tpl/item/author_desc","cardkit/tpl/item/author_info","cardkit/tpl/item/author_meta"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){var x=w("darkdom"),y=w("mo/lang/mix"),z=w("mo/template/micro").convertTpl,A=w("cardkit/helper"),B=z(w("cardkit/tpl/item").template),C=z(w("cardkit/tpl/item/title").template),D=z(w("cardkit/tpl/item/title_prefix").template),E=z(w("cardkit/tpl/item/title_suffix").template),F=z(w("cardkit/tpl/item/title_tag").template),G=z(w("cardkit/tpl/item/icon").template),H=z(w("cardkit/tpl/item/desc").template),I=z(w("cardkit/tpl/item/info").template),J=z(w("cardkit/tpl/item/opt").template),K=z(w("cardkit/tpl/item/content").template),L=z(w("cardkit/tpl/item/meta").template),M=z(w("cardkit/tpl/item/author").template),N=z(w("cardkit/tpl/item/author_prefix").template),O=z(w("cardkit/tpl/item/author_suffix").template),P=z(w("cardkit/tpl/item/avatar").template),Q=z(w("cardkit/tpl/item/author_desc").template),R=z(w("cardkit/tpl/item/author_info").template),S=z(w("cardkit/tpl/item/author_meta").template),T={title:function(){return x({unique:!0,enableSource:!0,render:C})},titleLink:function(){return x({unique:!0,enableSource:!0,render:function(a){return a.state.link}})},titlePrefix:function(){return x({enableSource:!0,sourceAsContent:!0,render:D})},titleSuffix:function(){return x({enableSource:!0,sourceAsContent:!0,render:E})},titleTag:function(){return x({enableSource:!0,render:F})},icon:function(){return x({unique:!0,enableSource:!0,render:G})},desc:function(){return x({enableSource:!0,sourceAsContent:!0,render:H})},info:function(){return x({enableSource:!0,sourceAsContent:!0,render:I})},opt:function(){return x({enableSource:!0,sourceAsContent:!0,render:J})},content:function(){return x({enableSource:!0,sourceAsContent:!0,render:K})},meta:function(){return x({enableSource:!0,sourceAsContent:!0,render:L})},author:function(){return x({unique:!0,enableSource:!0,render:M})},authorLink:function(){return x({unique:!0,enableSource:!0,render:function(a){return a.state.link}})},authorPrefix:function(){return x({enableSource:!0,sourceAsContent:!0,render:N})},authorSuffix:function(){return x({enableSource:!0,sourceAsContent:!0,render:O})},avatar:function(){return x({unique:!0,enableSource:!0,render:P})},authorDesc:function(){return x({enableSource:!0,sourceAsContent:!0,render:Q})},authorInfo:function(){return x({enableSource:!0,sourceAsContent:!0,render:R})},authorMeta:function(){return x({enableSource:!0,sourceAsContent:!0,render:S})},item:function(){var a=x({enableSource:!0,render:function(a){var b=A.readState,c=a.state,d=a.component,e=a.componentData,f=d.titleLink?e.titleLink:e.title;a.itemLinkTarget=b(f,"linkTarget")||c.linkTarget,a.isItemLinkAlone=b(f,"isAlone")||c.isAlone,a.itemLink=d.titleLink||b(e.title,"link")||c.link,a.itemContent=d.title||a.content;var g=d.authorLink?e.authorLink:e.author;return a.authorLinkTarget=b(g,"linkTarget"),a.authorLink=d.authorLink||b(e.author,"link"),B(a)}}),b=y.copy(T);return delete b.item,a.contain(b),a}};return T}),define("cardkit/tpl/list",[],function(){return{template:"<div class=\"ck-list-card {%= (state.blankText === 'false' ? 'no-blank' : '') %} {%= state.customClass %}\"\n data-style=\"{%= state.subtype %}\"\n {%= state.col ? 'data-cfg-col=\"' + state.col + '\" ' : '' %}\n {%= state.paperStyle ? 'data-cfg-paper=\"true\" ' : '' %}\n {%= state.plainStyle ? 'data-cfg-plain=\"true\" ' : '' %}\n {%= state.plainHdStyle ? 'data-cfg-plainhd=\"true\" ' : '' %}>\n\n {% if (hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n\n <article class=\"ck-card-wrap\">\n\n {% if (!hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n \n <div class=\"ck-list-wrap\">\n\n {% if (component.item.length) { %}\n\n <div class=\"ck-list\">\n {% component.item.forEach(function(item, i){ %}\n\n {% if (i && (i % state.col === 0)) { %}\n </div><div class=\"ck-list\">\n {% } %}\n\n {%= item %}\n\n {% }); %}\n </div>\n\n {% } else { %}\n\n <div class=\"ck-list\">\n <div class=\"ck-item blank\">\n <div class=\"ck-initem\">\n {% if (component.blank) { %}\n {%= component.blank %}\n {% } else { %}\n {%=(state.blankText || '目前还没有内容')%}\n {% } %}\n </div>\n </div>\n </div>\n\n {% } %}\n\n </div>\n\n {%= component.ft %}\n\n </article>\n\n</div>\n\n"}}),define("cardkit/tpl/scaffold/hdwrap",[],function(){return{template:'\n{% if (component.hd) { %}\n<header class="ck-hd-wrap">\n\n {%= component.hd %}\n\n {% if (component.hdOpt.length) { %}\n <div class="ck-hdopt-wrap">\n {%= component.hdOpt.join(\'\') %}\n </div>\n {% } %}\n\n</header>\n{% } %}\n'}}),define("cardkit/card/list",["darkdom","mo/template/micro","cardkit/tpl/scaffold/hdwrap","cardkit/tpl/list","cardkit/card/item","cardkit/card/common/scaffold"],function(a,b,c,d,e,f,g){var h=g("darkdom"),i=g("mo/template/micro").convertTpl,j=i(g("cardkit/tpl/scaffold/hdwrap").template),k=i(g("cardkit/tpl/list").template),l=g("cardkit/card/item"),m=g("cardkit/card/common/scaffold"),n={item:l.item,list:function(){var a=h({enableSource:!0,render:function(a){var b=a.state;return a.hasSplitHd="true"===b.plainStyle||"true"===b.plainHdStyle||"split"===b.subtype,a.hdwrap=j(a),k(a)}});return a.contain(m),a.contain("item",n.item),a}};return n}),define("cardkit/tpl/box",[],function(){return{template:"<div class=\"ck-box-card {%= state.customClass %}\"\n data-style=\"{%= state.subtype %}\"\n {%= state.paperStyle ? 'data-cfg-paper=\"true\" ' : '' %}\n {%= state.plainStyle ? 'data-cfg-plain=\"true\" ' : '' %}\n {%= state.plainHdStyle ? 'data-cfg-plainhd=\"true\" ' : '' %}>\n\n {% if (hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n\n <article class=\"ck-card-wrap\">\n\n {% if (!hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n\n {% if (!isBlank) { %}\n <section>{%= component.collect.join('') || content %}</section>\n {% } %}\n\n {%= component.ft %}\n\n </article>\n\n</div>\n"}}),define("cardkit/tpl/box/collect",[],function(){return{template:'<div class="ck-content">{%= content %}</div>\n'}}),define("cardkit/tpl/box/content",[],function(){return{template:'<div class="ck-content">{%= content %}</div>\n'}}),define("cardkit/card/box",["darkdom","mo/template/micro","cardkit/helper","cardkit/tpl/box/content","cardkit/tpl/box/collect","cardkit/tpl/scaffold/hdwrap","cardkit/tpl/box","cardkit/card/common/scaffold"],function(a,b,c,d,e,f,g,h,i){var j=i("darkdom"),k=i("mo/template/micro").convertTpl,l=i("cardkit/helper"),m=k(i("cardkit/tpl/box/content").template),n=k(i("cardkit/tpl/box/collect").template),o=k(i("cardkit/tpl/scaffold/hdwrap").template),p=k(i("cardkit/tpl/box").template),q=i("cardkit/card/common/scaffold"),r={content:function(){return j({enableSource:!0,sourceAsContent:!0,render:m})},collect:function(){return j({enableSource:!0,sourceAsContent:!0,render:n})},box:function(){var a=j({enableSource:!0,render:function(a){return a.isBlank=!a.component.collect.length&&l.isBlank(a.content),a.hasSplitHd="true"===a.state.plainStyle||"true"===a.state.plainHdStyle,a.hdwrap=o(a),p(a)}});return a.contain(q),a.contain("content",r.content,{content:!0}),a.contain("collect",r.collect),a}};return r}),define("cardkit/tpl/form",[],function(){return{template:"<div class=\"ck-form-card {%= (state.blankText === 'false' ? 'no-blank' : '') %} {%= state.customClass %}\"\n data-style=\"{%= state.subtype %}\"\n {%= state.plainHdStyle ? 'data-cfg-plainhd=\"true\" ' : '' %}>\n\n {% if (hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n\n <article class=\"ck-card-wrap\">\n\n {% if (!hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n\n {% if (component.item.length) { %}\n {% component.item.forEach(function(item){ %}\n {%= item %}\n {% }); %}\n {% } else { %}\n <div class=\"ck-item blank\">\n {% if (component.blank) { %}\n {%= component.blank %}\n {% } else { %}\n {%=(state.blankText || '目前还没有内容')%}\n {% } %}\n </div>\n {% } %}\n\n {%= component.ft %}\n\n </article>\n\n</div>\n"}}),define("cardkit/tpl/form/content",[],function(){return{template:'<div class="ck-content">{%= content %}</div>\n'}}),define("cardkit/tpl/form/title",[],function(){return{template:'<label class="ck-title">{%= content %}</label>\n'}}),define("cardkit/tpl/form/item",[],function(){return{template:'<div class="ck-item">\n {%= component.title %}\n {%= content %}\n</div>\n'}}),define("cardkit/card/form",["darkdom","mo/template/micro","cardkit/tpl/form/item","cardkit/tpl/form/title","cardkit/tpl/form/content","cardkit/tpl/scaffold/hdwrap","cardkit/tpl/form","cardkit/helper","cardkit/card/common/scaffold"],function(a,b,c,d,e,f,g,h,i,j){var k=j("darkdom"),l=j("mo/template/micro").convertTpl,m=l(j("cardkit/tpl/form/item").template),n=l(j("cardkit/tpl/form/title").template),o=l(j("cardkit/tpl/form/content").template),p=l(j("cardkit/tpl/scaffold/hdwrap").template),q=l(j("cardkit/tpl/form").template),r=j("cardkit/helper"),s=j("cardkit/card/common/scaffold"),t={title:function(){return k({unique:!0,enableSource:!0,render:n})},content:function(){return k({enableSource:!0,sourceAsContent:!0,render:o})},item:function(){var a=k({enableSource:!0,render:m}).contain("content",t.content,{content:!0}).contain("title",t.title);return r.forwardInputEvents(a),a},form:function(){var a=k({enableSource:!0,render:function(a){return a.hasSplitHd="true"===a.state.plainStyle||"true"===a.state.plainHdStyle,a.hdwrap=p(a),q(a)}});return a.contain(s),a.contain("item",t.item),a}};return t}),define("cardkit/tpl/mini",[],function(){return{template:'<div class="ck-mini-card {%= (state.blankText === \'false\' ? \'no-blank\' : \'\') %} {%= state.customClass %}"\n data-style="{%= state.subtype %}">\n\n {% if (hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n\n <article class="ck-card-wrap {%= (component.item.length > 1 ? \'slide\' : \'\') %}">\n\n {% if (!hasSplitHd) { %}\n {%= hdwrap %}\n {% } %}\n \n <div class="ck-list-wrap">\n\n {% if (component.item.length) { %}\n\n <div class="ck-list" style="width:{%= listWidth %};">\n {% component.item.forEach(function(item){ %}\n <div class="ck-col" style="width:{%= itemWidth %};">\n {%= item %}\n </div>\n {% }); %}\n </div>\n\n {% } else { %}\n\n <div class="ck-list">\n <div class="ck-item blank">\n <div class="ck-initem">\n {% if (component.blank) { %}\n {%= component.blank %}\n {% } else { %}\n {%=(state.blankText || \'目前还没有内容\')%}\n {% } %}\n </div>\n </div>\n </div>\n\n {% } %}\n\n </div>\n\n {%= component.ft %}\n\n </article>\n\n</div>\n\n'}}),define("cardkit/card/mini",["darkdom","mo/template/micro","cardkit/tpl/scaffold/hdwrap","cardkit/tpl/mini","cardkit/card/item","cardkit/card/common/scaffold"],function(a,b,c,d,e,f,g){var h=g("darkdom"),i=g("mo/template/micro").convertTpl,j=i(g("cardkit/tpl/scaffold/hdwrap").template),k=i(g("cardkit/tpl/mini").template),l=g("cardkit/card/item"),m=g("cardkit/card/common/scaffold"),n={item:l.item,mini:function(){var a=h({enableSource:!0,render:function(a){a.hasSplitHd=!0,a.hdwrap=j(a);var b=a.component.item.length;return a.listWidth=b>1?100*b*.94+"%":"",a.itemWidth=Math.floor(1e3/b)/10+"%",k(a)}});return a.contain(m),a.contain("item",n.item),a}};return n}),define("cardkit/tpl/page",[],function(){return{template:'\n<div class="ck-page-card{%= !hasHeader ? \' no-header\' : \'\' %}{%= !component.banner || componentData.banner.isBlank ? \'\' : \' with-banner\' %}{%= state.isPageActive === \'true\' ? \' topbar-enabled\' : \'\' %}" \n data-style="{%= state.subtype %}"\n data-page-active="{%= state.isPageActive || \'false\' %}"\n data-deck-active="{%= state.isDeckActive || \'false\' %}"\n data-deck="{%= (state.deck || \'main\') %}"\n data-curdeck="{%= state.currentDeck %}"\n data-fixed-minheight="{%= (state.fixedMinHeight === \'false\' && \'false\' || \'true\') %}"\n data-cardid="{%= state.cardId %}">\n\n {% if (hasHeader) { %}\n <div class="ck-header">\n <div class="ck-header-shd"></div>\n {%= component.nav %}\n {%= component.title %}\n {%= component.actionbar %}\n </div>\n {% } %}\n\n {%= component.banner %}\n\n <div class="ck-article">\n {% if (!isBlank) { %}\n {%= content %}\n {% } else { %}\n <div class="ck-blank-card">\n <article class="ck-card-wrap">\n {% if (component.blank) { %}\n {%= component.blank %}\n {% } else { %}\n <div>{%=(state.blankText || \'目前还没有内容\')%}</div>\n {% } %}\n </article>\n </div>\n {% } %}\n </div>\n\n {% if (component.footer) { %}\n <div class="ck-footer">{%= component.footer %}</div>\n {% } %}\n\n <a class="ck-page-link-mask ck-link" href="#{%= state.cardId %}"></a>\n\n</div>\n\n'}}),define("cardkit/tpl/page/actionbar/action",[],function(){return{template:'\n<span class="ck-top-act">\n <button type="button" class="ck-option" \n value="{%= id %}">{%= state.label %}</button>\n {%= content %}\n</span>\n'}}),define("cardkit/tpl/page/actionbar",[],function(){return{template:'<div class="ck-top-actions">\n\n {% if (overflowActions.length) { %}\n <span class="ck-top-overflow"\n data-title="More actions...">\n {% overflowActions.forEach(function(action){ %}\n {%= action %}\n {% }); %}\n </span>\n {% } %}\n\n {% visibleActions.forEach(function(action){ %}\n {%= action %}\n {% }); %}\n\n</div>\n'}}),define("cardkit/tpl/page/banner",[],function(){return{template:'<div class="ck-top-banner"\n {%= state.plainStyle ? \'data-cfg-plain="true" \' : \'\' %}>\n <div class="ck-top-banner-inner">{%= content %}</div>\n</div>\n'}}),define("cardkit/tpl/page/nav",[],function(){return{template:'{% if (content) { %}\n<span class="ck-top-nav">{%= content %}</span>\n{% } else { %}\n<a class="ck-top-nav ck-link" href="{%= state.link %}"></a>\n{% } %}\n'}}),define("cardkit/tpl/page/title",[],function(){return{template:'<div class="ck-top-title">{%= content %}</div>\n'}}),define("cardkit/card/page",["darkdom","mo/lang/mix","mo/template/micro","cardkit/helper","cardkit/tpl/page/title","cardkit/tpl/page/nav","cardkit/tpl/page/banner","cardkit/tpl/page/actionbar","cardkit/tpl/page/actionbar/action","cardkit/tpl/page","cardkit/card/box","cardkit/card/list","cardkit/card/mini","cardkit/card/form"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){function p(a){var b=a.root;return"true"===a.newValue?("false"!==b.attr("data-fixed-minheight")&&b.css("min-height",1.4*window.innerHeight+"px"),b.attr("data-page-active",!0),setTimeout(function(){b.addClass("topbar-enabled"),window.scrollTo(0,0)},100)):b.attr("data-page-active",!1).removeClass("topbar-enabled"),!1}function q(a){var b=a.root;return"true"===a.newValue?("false"!==b.attr("data-fixed-minheight")&&b.css("min-height",1.4*window.innerHeight+"px"),b.attr("data-deck-active",!0)):(b.attr("data-deck-active",!1),setTimeout(function(){window.scrollTo(0,0)},300)),!1}function r(a){return a.root.attr("data-curdeck",a.newValue),!1}var s=o("darkdom"),t=o("mo/lang/mix"),u=o("mo/template/micro").convertTpl,v=o("cardkit/helper"),w=u(o("cardkit/tpl/page/title").template),x=u(o("cardkit/tpl/page/nav").template),y=u(o("cardkit/tpl/page/banner").template),z=u(o("cardkit/tpl/page/actionbar").template),A=u(o("cardkit/tpl/page/actionbar/action").template),B=u(o("cardkit/tpl/page").template),C={box:o("cardkit/card/box").box,list:o("cardkit/card/list").list,mini:o("cardkit/card/mini").mini,form:o("cardkit/card/form").form},D={title:function(){return s({unique:!0,enableSource:!0,render:w})},nav:function(){return s({unique:!0,enableSource:!0,render:x})},banner:function(){return s({unique:!0,enableSource:!0,render:function(a){return a.isBlank=v.isBlank(a.content),y(a)}})},action:function(){return s({enableSource:!0,entireAsContent:!0,render:A})},actionbar:function(){var a=s({unique:!0,enableSource:!0,render:function(a){var b=a.state.limit||1;return a.visibleActions=[],a.overflowActions=[],a.componentData.action.forEach(function(c,d){var e=a.component.action[d];this.length<b&&!c.state.forceOverflow?this.push(e):a.overflowActions.push(e)},a.visibleActions),z(a)}}).contain("action",D.action);return v.forwardActionEvents(a),a},blank:function(){return s({unique:!0,enableSource:!0,render:function(a){return"<div>"+a.content+"</div>"}})},footer:function(){return s({unique:!0,enableSource:!0,render:function(a){return"<div>"+a.content+"</div>"}})},page:function(){var a=s({render:function(a){var b=a.component;return a.hasHeader=b.title||b.nav||b.actionbar,a.isBlank=v.isBlank(a.content),B(a)}}),b=t.copy(D);return delete b.page,a.contain(b),a.contain(C,{content:!0}),a.response("state:isPageActive",p),a.response("state:isDeckActive",q),a.response("state:currentDeck",r),v.forwardStateEvents(a),a}};return D}),define("cardkit/spec",["cardkit/spec/page","cardkit/card/page","cardkit/spec/box","cardkit/card/box","cardkit/spec/list","cardkit/card/list"],function(a,b,c,d,e,f,g){return{page:[g("cardkit/spec/page"),g("cardkit/card/page")],box:[g("cardkit/spec/box"),g("cardkit/card/box")],list:[g("cardkit/spec/list"),g("cardkit/card/list")]}}),define("mo/easing/base",[],function(){return{def:"ease",positions:{linear:[.25,.25,.75,.75],ease:[.25,.1,.25,1],easeIn:[.42,0,1,1],easeOut:[0,0,.58,1],easeInOut:[.42,0,.58,1]},values:{linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out"},functions:{linear:function(a,b,c,d){return c+d*a},ease:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c},easeIn:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOut:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOut:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c}}}}),define("mo/mainloop",["mo/lang","mo/easing/base"],function(a,b){function c(a){for(var b,c=0,d=k.length;d>c;c++)b=k[c],b&&a-b.lastLoop>=j&&(b.lastLoop=a,b.renders.call(b,a))}var d=this,e="RequestAnimationFrame",f=4e12,g=d["webkit"+e]||d["moz"+e]||d["o"+e]||d["ms"+e],h=1,i=1,j=0,k=[],l={},m={},n={fps:0,easing:a.copy(b.functions)},o={config:function(b){return a.config(this,b,n),b.fps&&(j=this.fps?1e3/this.fps:0),this},run:function(a){function b(){if(h===n){var a=+new Date;l(a),f.globalSignal?i&&i(b):j(e)}}if(a){var d=m[a];if(d||(this.addStage(a),d=m[a]),d&&!d.state&&(d.state=1,k.push(d),d.renders.forEach(function(a){var b=this.delays[a._rid];b&&(b[3]=+new Date,b[0]=setTimeout(b[1],b[2]))},d)),this.globalSignal)return this}var e,f=this,i=g,j=clearInterval,l=c,n=++h;return this.globalSignal=1,i?i(b):e=setInterval(b,15),this},pause:function(a){if(a){var b=k.indexOf(m[a]);if(b>=0){var c=m[a];k.splice(b,1),c.state=0,c.pauseTime=+new Date,c.renders.forEach(function(a){var b=this.delays[a._rid];b&&(clearTimeout(b[0]),b[2]-=this.pauseTime-b[3])},c)}}else this.globalSignal=0;return this},complete:function(a){var b=m[a];return b&&b.state?(b.renders.forEach(function(a){var c=b.delays[a._rid];c&&(clearTimeout(c[0]),c[1]()),a.call(b,this)},f),this.remove(a)):this},remove:function(a,b){if(b){var c=m[a];c&&(clearTimeout((c.delays[b._rid]||[])[0]),c.renders.clear(b))}else this.pause(a),delete m[a];return this},info:function(a){return m[a]},isRunning:function(a){return!!(m[a]||{}).state},addStage:function(b,c){return b&&(m[b]={name:b,ctx:c,state:0,lastLoop:0,pauseTime:0,delays:{},renders:a.fnQueue()}),this},addRender:function(a,b,c){return m[a]||this.addStage(a,c),this._lastestRender=b,m[a].renders.push(b),this},getRender:function(a){return l[a]||this._lastestRender},addTween:function(a,b,c,d,e){function f(g){p!==this.pauseTime&&h<this.pauseTime&&(p=this.pauseTime,h+=+new Date-p);var i,j=g-h,l=j/d;0>=j||(1>l&&(o&&(l=k.easing[o](l,j,0,1,d)),0>q?(l=1-l,i=c+-1*q*l):i=b+q*l),j>=d?(e.step(c,d),k.remove(a,f),e.callback&&e.callback()):e.step(i,j))}function g(){return j&&delete j[n],d?(e.step(b,0),h=+new Date,void k.addRender(a,f)):(e.step(c,0),void(e.callback&&setTimeout(function(){e.callback()},0)))}var h,j,k=this,n=e.renderId,o=e.easing,p=0,q=c-b;if(e.delay){m[a]||this.addStage(a),n||(n=e.renderId="_oz_mainloop_"+i++),j=m[a].delays;var r=setTimeout(g,e.delay);j[n]=[r,g,e.delay,+new Date]}else g();return n&&(f._rid=n,l[n]=f),this}};return o.config(n),o}),define("cardkit",["mo/lang","dollar","mo/mainloop","cardkit/spec","cardkit/oldspec","cardkit/ui","cardkit/supports","cardkit/bus"],function(a,b,c,d,e,f,g,h){function i(a){"true"!==a.getDarkState("isPageActive")&&a.trigger("pageCard:willOpen").setDarkState("isPageActive",!0,{update:!0}).trigger("pageCard:opened")}function j(a){"true"===a.getDarkState("isPageActive")&&a.trigger("pageCard:willClose").setDarkState("isPageActive",!1,{update:!0}).trigger("pageCard:closed")}function k(a){"true"!==a.getDarkState("isDeckActive")&&a.trigger("pageCard:willFocus").setDarkState("isDeckActive",!0,{update:!0}).trigger("pageCard:focused")}function l(a){"true"===a.getDarkState("isDeckActive")&&a.trigger("pageCard:willBlur").setDarkState("isDeckActive",!1,{update:!0}).trigger("pageCard:blured")}function m(a){a.setDarkState("currentDeck",this,{update:!0})}var n,o,p="main",q="unmount-page",r=/#(.+)$/,s=document,t=s.body,u={},v={},w={},x={},y={appWrapper:null,defaultPage:"ckDefault",oldStyle:!1,hybirdMode:!1},z={init:function(b){this._config=a.config({},b,y),this._specs=this._config.oldStyle?e:d,this.initSpec(),this.initView()},initSpec:function(){a.each(d,function(a,b){var c=this._specs[b][0];this.component(b,a[1][b]()),v[b]=c},this)},initView:function(){this.wrapper=b(this._config.appWrapper||t),g.webview&&this.wrapper.addClass("ck-in-webview"),this._config.hybirdMode&&this.wrapper.addClass("ck-in-hybird"),g.noBugWhenFixed||this.wrapper.addClass("ck-bugfix-fixed"),h.on("ready",function(){b(window).on("hashchange",function(a){a.preventDefault(),z.openPage()})}),f.init(this._config)},component:function(a,b){return b?void(u[a]=b):u[a]},guard:function(a){return w[a]||(w[a]=this.component(a).createGuard()),w[a]},render:function(a,b){var c=v[a],d=this.guard(a);c&&d&&(c(d,b||this.wrapper),d.mount())},scrollPageTo:function(a){var d=b(".ck-page-card #"+a);d[0]&&c.addTween("scrollPage",window.scrollY,d.offset().top,400,{easing:"ease",step:function(a){window.scrollTo(0,a)},callback:function(){c.pause()}}).run("scrollPage")},openPageByNode:function(a){var b=this._specs.page[0],c=a.closest(b.SELECTOR);if(c[0]||(c=a.closest(b.SELECTOR_OLD)),c[0]){var d=x[n];d&&d[0]===c[0]||this.openPage(c)}return c},openPage:function(c){if(o)return!1;c=this.findPage(c);var d=c[1];c=c[0];var e=this.isPage(c);if(d&&c[0]&&!e)return this.openPageByNode(c),setTimeout(function(){this.scrollPageTo(d)}.bind(this),400),!0;var f=x[p],g=!f;if(!c[0]||!e){if(!g)return!1;location.replace("#"+this._config.defaultPage),c=b("#"+this._config.defaultPage)}window.scrollTo(0,0),g&&(f=b("#"+this._config.defaultPage),c[0]!==f[0]&&(x[p]=f,this.openPage(f))),o=!0,c[0].isMountedDarkDOM||(c.addClass(q),this.render("page"),c.removeClass(q));var r=c.getDarkState("deck")||p,s=x[r];if(f=x[n],x[r]=c,a.each(x,m,r),r!==n){var u="modalview"===n;n=r,u&&z.closeModal(),f&&b.contains(t,f[0])&&l(f)}return s&&s[0]!==c[0]&&b.contains(t,s[0])&&j(s),g&&c.once("pageCard:opened",function(){h.resolve("ready")}),i(c),k(c),o=!1,!0},resetPage:function(a){a=this.findPage(a)[0],a[0]&&a.resetDarkDOM()},updatePage:function(a){a=a?this.findPage(a)[0]:this.currentPage()[0],a.updateDarkDOM()},currentPage:function(){return x[n]||b()},findPage:function(a){var c;if(a&&"string"!=typeof a)a=b(a);else{var d=r.exec(location.href);c=a||d&&d[1]||this._config.defaultPage,a=b("#"+c)}return[a,c]},isPage:function(a){var b=this._specs.page[0];return a.is(b.SELECTOR)||b.SELECTOR_OLD&&a.is(b.SELECTOR_OLD)},isLandscape:function(){return window.innerWidth/window.innerHeight>1.1},brightDelegate:f.brightDelegate,darkDelegate:f.darkDelegate,ui:f,event:h};return a.mix(z,f.action),a.mix(z,f.component),z.openURL=z.openLink,z.modalCard.event.on("open",function(a){a.lastDecktop=x[n],z.openPage(a.pageNode())}).on("willUpdateContent",function(a){var b=a.pageNode();b[0]&&b[0].isMountedDarkDOM&&z.resetPage(b)}).on("close",function(a){"modalview"===n&&z.openPage(a.lastDecktop)}),z});